/* =============================================
   100天减肥打卡网站 - 样式表
   ============================================= */

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc;
    color: #0f172a;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    z-index: 1000;
    height: 60px;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    text-decoration: none;
    color: #0f172a;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #64748b;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #0f172a;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
    text-align: center;
}

/* Hero区域 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 100px 20px;
}

.hero h1 {
    font-size: 48px;
    margin-bottom: 16px;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 30px;
}

/* 功能介绍 */
.features {
    padding: 40px 0px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: white;
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.feature-card h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.feature-card p {
    color: #64748b;
}

/* 排行榜 */
.ranking-section {
    padding: 40px 0px;
    background: white;
}

.section-title {
    text-align: center;
    font-size: 32px;
    margin-bottom: 40px;
}

.ranking-table {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.ranking-header {
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px 150px;
    padding: 16px 20px;
    background: #f8fafc;
    font-weight: 600;
    font-size: 14px;
    color: #64748b;
}

.ranking-item {
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px 150px;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-item.current-user {
    background: #eff6ff;
}

.medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: bold;
    color: white;
    gap: 2px;
}

.medal-1 { 
    background: linear-gradient(135deg, #FFD700, #FFA500); 
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}
.medal-2 { 
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8); 
    box-shadow: 0 2px 8px rgba(192, 192, 192, 0.4);
}
.medal-3 { 
    background: linear-gradient(135deg, #CD7F32, #B8860B); 
    box-shadow: 0 2px 8px rgba(205, 127, 50, 0.4);
}

.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #64748b;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.avatar-default {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    font-size: 18px;
    flex-shrink: 0;
}

.nickname {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

.days-badge {
    background: #eff6ff;
    color: #3b82f6;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}

.weight-loss {
    color: #10b981;
    font-weight: 600;
}

.weight-gain {
    color: #dc2626;
    font-weight: 600;
}

.progress-mini {
    width: 80px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

.progress-bar-mini {
    height: 100%;
    background: #10b981;
    border-radius: 3px;
}

.progress-text {
    font-size: 13px;
    color: #64748b;
}

/* 认证页面 */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
}

.auth-header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-size: 36px;
    margin-bottom: 10px;
}

.auth-form {
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 30px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: #64748b;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input:disabled {
    background: #f8fafc;
    color: #64748b;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input {
    width: auto;
}

/* 提示框 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    text-align: center;
}

.stat-label {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
}

.trend-down {
    color: #10b981;
}

.trend-up {
    color: #dc2626;
}

/* 头部卡片 */
.header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header h1 {
    margin-bottom: 12px;
    font-size: 32px;
}

.header p {
    opacity: 0.9;
    font-size: 16px;
}

/* 进度条 */
.progress-section {
    background: white;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.progress-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 16px;
}

.progress-bar-container {
    background: #e2e8f0;
    border-radius: 999px;
    height: 24px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
    min-width: 40px;
    transition: width 0.5s ease;
}

/* 详细数据区域 */
.summary-section {
    background: white;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}

.summary-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #0f172a;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.summary-item {
    text-align: center;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
}

.summary-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 24px;
    font-weight: bold;
    color: #0f172a;
}

/* 打卡记录 */
.records-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.records-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px;
}

.record-item {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    min-height: 140px;
    transition: all 0.2s;
}

.record-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.record-item.today {
    border-color: #10b981;
    border-width: 2px;
}

.record-item.future {
    opacity: 0.6;
}

.record-day-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.day-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.day-badge.today {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.day-badge.future {
    background: #cbd5e1;
}

.record-date {
    font-size: 13px;
    color: #64748b;
}

.today-label {
    color: #10b981;
    font-size: 11px;
    font-weight: bold;
}

.future-label {
    color: #94a3b8;
    font-size: 11px;
}

.record-weight-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.record-weight-label {
    font-size: 12px;
    color: #94a3b8;
}

.weight-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
}

.weight-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.weight-input:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
    color: #94a3b8;
}

.weight-input.saving {
    border-color: #3b82f6 !important;
}

.weight-input.saved {
    border-color: #10b981 !important;
}

.weight-input.error {
    border-color: #ef4444 !important;
}

.record-change-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    margin-top: auto;
}

.change-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    gap: 4px;
}

.change-down {
    background: #d1fae5;
    color: #059669;
}

.change-up {
    background: #fee2e2;
    color: #dc2626;
}

.change-same {
    background: #e0e7ff;
    color: #4f46e5;
}

.pending-badge {
    background: #f1f5f9;
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.waiting-badge {
    color: #94a3b8;
    font-size: 12px;
}

/* 个人中心 */
.profile-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.profile-card h3 {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
}

.avatar-section {
    display: flex;
    align-items: center;
    gap: 30px;
}

.avatar-preview img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e2e8f0;
}

.avatar-default-lg {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state p {
    margin-bottom: 20px;
}

/* 页脚 */
.footer {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
}

/* 响应式 */
/* 移动端汉堡菜单 */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #0f172a;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* 移动端菜单遮罩 */
.menu-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 1024px) {
    .records-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    
    .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.feature-card {
    padding: 24px 16px;
}

.feature-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 16px;
}

.feature-card p {
    font-size: 13px;
}
    /* 移动端导航栏 */
    .menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 0;
        gap: 0;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
    }
    
    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-links a {
        display: block;
        padding: 16px 20px;
        border-bottom: 1px solid #e2e8f0;
        font-size: 15px;
        color: #334155;
    }
    
    .nav-links a:last-child {
        border-bottom: none;
    }
    
    .nav-links a:hover {
        background: #f8fafc;
        color: #667eea;
    }
    
    .hero h1 {
        font-size: 32px;
    }
    
    .records-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .record-item {
        padding: 14px;
    }
    
    .ranking-header,
    .ranking-item {
        grid-template-columns: 60px 1fr 80px 80px;
    }
    
    .col-progress {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .avatar-section {
        flex-direction: column;
        text-align: center;
    }
    
    /* 移动端页面顶部间距 */
    body {
        padding-top: 60px;
    }
}
