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

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #10b981;
    --accent-color: #f97316;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --sidebar-width: 260px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 应用容器 */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-menu {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.user-profile {
    padding: 16px;
    margin: 12px;
    background: var(--bg-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-status {
    font-size: 12px;
    color: var(--secondary-color);
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* 头部 */
.header {
    background: var(--bg-secondary);
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notification-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-btn:hover {
    background: var(--border-color);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: var(--danger-color);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ecfdf5;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary-color);
}

.ai-indicator {
    width: 8px;
    height: 8px;
    background: var(--secondary-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 内容包装器 */
.content-wrapper {
    padding: 24px 32px;
}

/* 页面切换 */
.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

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

/* 指标卡片网格 */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.metric-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.heart-rate .metric-icon {
    background: #fef2f2;
    color: var(--danger-color);
}

.blood-pressure .metric-icon {
    background: #eff6ff;
    color: var(--primary-color);
}

.blood-oxygen .metric-icon {
    background: #f0fdf4;
    color: var(--secondary-color);
}

.temperature .metric-icon {
    background: #fffbeb;
    color: var(--warning-color);
}

.metric-info {
    flex: 1;
}

.metric-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.metric-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 4px;
}

.metric-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
}

.metric-trend.up {
    color: var(--secondary-color);
}

.metric-trend.down {
    color: var(--danger-color);
}

.metric-trend.stable {
    color: var(--text-secondary);
}

.metric-chart {
    width: 80px;
    color: var(--primary-color);
    opacity: 0.6;
}

.sparkline {
    width: 100%;
}

.circular-progress {
    width: 60px;
    height: 60px;
    position: relative;
}

.circular-progress svg {
    transform: rotate(-90deg);
}

.progress-circle {
    stroke-dasharray: 283;
    stroke-dashoffset: 5.66;
    transition: stroke-dashoffset 0.5s;
}

/* 主图表区域 */
.main-chart-section {
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.chart-card.large {
    height: 400px;
}

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

.chart-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.chart-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.chart-btn:hover {
    background: var(--bg-primary);
}

.chart-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chart-container {
    height: 300px;
    position: relative;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* AI 建议区域 */
.ai-suggestions-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary-color);
}

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

.suggestion-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    gap: 16px;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.suggestion-card:hover {
    transform: translateY(-4px);
}

.suggestion-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.suggestion-icon.exercise {
    background: #fef2f2;
    color: var(--danger-color);
}

.suggestion-icon.diet {
    background: #f0fdf4;
    color: var(--secondary-color);
}

.suggestion-icon.sleep {
    background: #eff6ff;
    color: var(--primary-color);
}

.suggestion-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.suggestion-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.suggestion-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag {
    padding: 4px 10px;
    background: var(--bg-primary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* 实时监测页面 */
.monitoring-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.monitor-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.monitor-card.large {
    grid-column: span 2;
}

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

.monitor-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.monitor-header h3 i {
    color: var(--danger-color);
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fef2f2;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--danger-color);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--danger-color);
    border-radius: 50%;
    animation: livePulse 1s infinite;
}

@keyframes livePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

.ecg-container {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 12px;
    overflow: hidden;
}

.ecg-container canvas {
    width: 100%;
    height: 100%;
}

.ecg-info {
    position: absolute;
    top: 20px;
    left: 20px;
}

.bpm-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.bpm-value {
    font-size: 48px;
    font-weight: 700;
    color: #4ade80;
}

.bpm-unit {
    font-size: 18px;
    color: #94a3b8;
}

.bpm-range {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 4px;
}

/* 活动统计 */
.activity-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.activity-ring {
    position: relative;
    width: 140px;
    height: 140px;
}

.ring-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.ring-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
}

.ring-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.activity-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
}

.activity-item {
    text-align: center;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 10px;
}

.activity-item i {
    display: block;
    font-size: 20px;
    color: var(--accent-color);
    margin-bottom: 8px;
}

.activity-value {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.activity-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 血氧显示 */
.spo2-display {
    text-align: center;
    padding: 20px 0;
}

.spo2-value {
    margin-bottom: 16px;
}

.big-number {
    font-size: 56px;
    font-weight: 700;
    color: var(--secondary-color);
}

.percent {
    font-size: 24px;
    color: var(--text-secondary);
}

.spo2-bar {
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}

.spo2-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), #34d399);
    border-radius: 6px;
    transition: width 0.5s;
}

.spo2-status {
    font-size: 14px;
    color: var(--secondary-color);
    font-weight: 500;
}

/* 睡眠统计 */
.sleep-stats {
    text-align: center;
    padding: 10px 0;
}

.sleep-total {
    margin-bottom: 24px;
}

.sleep-hours {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
}

.sleep-min {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
}

.sleep-unit {
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: 4px;
}

.sleep-stages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stage {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stage-bar {
    height: 16px;
    border-radius: 8px;
    flex: 1;
}

.stage-bar.deep {
    background: #4c1d95;
}

.stage-bar.light {
    background: #8b5cf6;
}

.stage-bar.rem {
    background: #c4b5fd;
}

.stage-label {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 80px;
}

/* AI 分析页面 */
.analysis-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
}

.score-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.score-main {
    display: flex;
    justify-content: center;
    padding: 20px 0;
}

.score-circle {
    width: 160px;
    height: 160px;
    position: relative;
}

.score-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-number {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: var(--secondary-color);
}

.score-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.score-breakdown h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.score-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.score-item {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: center;
    gap: 12px;
}

.score-item-name {
    font-size: 14px;
    color: var(--text-secondary);
}

.score-bar {
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.5s;
}

.score-item-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.report-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

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

.report-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-header h3 i {
    color: var(--primary-color);
}

.report-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.report-content {
    margin-bottom: 24px;
}

.report-section {
    margin-bottom: 20px;
}

.report-section h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-section h4 i {
    color: var(--secondary-color);
}

.report-section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.report-section ul {
    padding-left: 20px;
}

.report-section li {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.6;
}

/* 按钮 */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -4px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-full {
    width: 100%;
}

/* 风险评估 */
.risk-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.risk-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.risk-card h3 i {
    color: var(--primary-color);
}

.risk-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.risk-item {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    align-items: center;
    gap: 12px;
}

.risk-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.risk-info {
    display: flex;
    flex-direction: column;
}

.risk-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.risk-level {
    font-size: 12px;
}

.risk-item.low .risk-level {
    color: var(--secondary-color);
}

.risk-item.medium .risk-level {
    color: var(--warning-color);
}

.risk-item.high .risk-level {
    color: var(--danger-color);
}

.risk-bar {
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.risk-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s;
}

.risk-item.low .risk-fill {
    background: var(--secondary-color);
}

.risk-item.medium .risk-fill {
    background: var(--warning-color);
}

.risk-item.high .risk-fill {
    background: var(--danger-color);
}

/* 健康方案页面 */
.plan-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
}

.plan-today {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.plan-today h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.plan-progress {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.progress-ring {
    width: 120px;
    height: 120px;
    position: relative;
}

.progress-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-percent {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.progress-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.plan-tasks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.plan-task {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.plan-task:hover {
    background: #e2e8f0;
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    transition: all 0.2s;
}

.plan-task.completed .task-checkbox {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.plan-task.active {
    background: #eff6ff;
    border: 1px solid var(--primary-color);
}

.task-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.task-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.plan-task.completed .task-name {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-time {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 个人方案 */
.personal-plans {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.plan-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.plan-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
}

.plan-image {
    width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
}

.exercise-plan .plan-image {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.diet-plan .plan-image {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.sleep-plan .plan-image {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.plan-content {
    flex: 1;
    padding: 24px;
}

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

.plan-header h4 {
    font-size: 18px;
    font-weight: 600;
}

.plan-badge {
    padding: 4px 12px;
    background: var(--bg-primary);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--primary-color);
}

.plan-content > p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.plan-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.plan-meta span {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-schedule,
.meal-preview,
.sleep-tips {
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.schedule-item {
    display: flex;
    gap: 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.schedule-item .day {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 40px;
}

.schedule-item .activity {
    color: var(--text-secondary);
    font-size: 14px;
}

.meal {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
}

.meal i {
    color: var(--accent-color);
    width: 20px;
}

.tip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.tip i {
    color: var(--secondary-color);
}

/* 健康档案页面 */
.records-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.records-header h3 {
    font-size: 20px;
    font-weight: 600;
}

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

.record-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.record-card.wide {
    grid-column: span 2;
}

.record-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.record-title i {
    color: var(--primary-color);
}

.record-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.info-value.healthy {
    color: var(--secondary-color);
}

/* 历史表格 */
.history-table-wrapper {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 14px;
}

.history-table th {
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
}

.history-table td {
    border-bottom: 1px solid var(--border-color);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.good {
    background: #dcfce7;
    color: #166534;
}

.status-badge.normal {
    background: #eff6ff;
    color: #1e40af;
}

/* 目标列表 */
.goals-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.goal-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.goal-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.goal-name {
    font-weight: 500;
    color: var(--text-primary);
}

.goal-progress {
    color: var(--text-secondary);
}

.goal-bar {
    height: 10px;
    background: var(--bg-primary);
    border-radius: 5px;
    overflow: hidden;
}

.goal-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
    transition: width 0.5s;
}

/* 医疗记录 */
.medical-records {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.medical-item {
    padding: 16px;
    background: var(--bg-primary);
    border-radius: 10px;
}

.medical-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.medical-type {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.medical-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 设置页面 */
.settings-container {
    max-width: 800px;
}

.settings-section {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.settings-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toggle-name {
    font-weight: 500;
    color: var(--text-primary);
}

.toggle-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #e5e7eb;
    border-radius: 26px;
    transition: background 0.3s;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .suggestions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .analysis-container {
        grid-template-columns: 1fr;
    }

    .plan-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .suggestions-grid {
        grid-template-columns: 1fr;
    }

    .monitor-card.large {
        grid-column: span 1;
    }

    .monitoring-grid {
        grid-template-columns: 1fr;
    }

    .records-grid {
        grid-template-columns: 1fr;
    }

    .record-card.wide {
        grid-column: span 1;
    }

    .plan-card {
        flex-direction: column;
    }

    .plan-image {
        width: 100%;
        height: 100px;
    }
}
