* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

:root {
    --primary: #3498db;
    --secondary: #2ecc71;
    --accent: #e74c3c;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --warning: #f39c12;
    --card-bg: #ffffff;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 0;
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--card-bg);
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* 顶部导航 */
header {
    background: linear-gradient(135deg, #1a2a6c, #3498db);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

.logo-icon {
    background: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: bold;
}

.nav-tabs {
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 5px;
}

.tab-btn {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-stats {
    text-align: right;
}

.user-stats .weight {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--secondary);
}

.user-stats .bmi {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

/* 主内容区域 */
.content-area {
    padding: 25px;
}

.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.section-title {
    color: var(--dark);
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary);
    font-size: 1.5rem;
}

.section-title h2 {
    font-size: 1.4rem;
    font-weight: 600;
}

/* 仪表盘样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    text-align: center;
    border-top: 4px solid var(--primary);
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 10px 0;
}

.stat-primary {
    color: var(--primary);
}

.stat-secondary {
    color: var(--secondary);
}

.stat-accent {
    color: var(--accent);
}

.stat-warning {
    color: var(--warning);
}

.stat-label {
    color: #7f8c8d;
    font-size: 1rem;
}

.progress-container {
    margin: 15px 0;
}

.progress-label {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.progress-bar {
    height: 20px;
    background-color: var(--light);
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    width: 0;
    transition: width 1s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--dark);
    font-weight: 600;
    font-size: 0.85rem;
}

.chart-container {
    height: 300px;
    margin-top: 20px;
}

/* 计划详情样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

th, td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
}

th {
    background-color: var(--primary);
    color: white;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f8f9fa;
}

tr:hover {
    background-color: #e3f2fd;
}

.highlight {
    background-color: #fffde7 !important;
    font-weight: bold;
}

.note-box {
    background-color: #e3f2fd;
    border-left: 4px solid var(--primary);
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.warning {
    background-color: #ffecb3;
    border-left: 4px solid var(--warning);
}

.btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 8px 15px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.btn-success {
    background-color: var(--secondary);
}

.btn-warning {
    background-color: var(--warning);
}

.btn-danger {
    background-color: var(--accent);
}

.completed {
    background-color: #e8f5e9;
}

.flex-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.flex-item {
    flex: 1;
    min-width: 300px;
}

.daily-tasks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.task-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    border-left: 4px solid var(--primary);
}

.task-card.warning {
    border-left: 4px solid var(--warning);
}

.task-card.success {
    border-left: 4px solid var(--secondary);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.task-title {
    font-weight: 600;
    color: var(--dark);
}

.task-time {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.task-content {
    margin: 10px 0;
}

.task-actions {
    display: flex;
    justify-content: flex-end;
}

footer {
    text-align: center;
    padding: 20px;
    background: var(--dark);
    color: white;
    margin-top: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-tabs {
        display: none;
    }
    
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        z-index: 100;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-nav-btn {
        flex: 1;
        text-align: center;
        padding: 12px;
        color: #7f8c8d;
        font-size: 0.8rem;
    }
    
    .mobile-nav-btn.active {
        color: var(--primary);
    }
    
    .flex-container {
        flex-direction: column;
    }
}

@media (min-width: 769px) {
    .mobile-nav {
        display: none;
    }
}