/* =============================================
   康康 · 全能管家 H5移动端样式 v2.0
   紫色系全能服务主题 - 完整5Tab移动应用
   ============================================= */

/* ===== CSS Variables ===== */
:root {
    --primary: #7C3AED;
    --primary-light: #A78BFA;
    --primary-dark: #5B21B6;
    --primary-bg: #F5F3FF;
    --primary-gradient: linear-gradient(135deg, #7C3AED 0%, #A78BFA 100%);
    
    --secondary: #06B6D4;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;
    
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-hint: #9CA3AF;
    --text-white: #FFFFFF;
    
    --bg-app: #F9FAFB;
    --bg-white: #FFFFFF;
    --bg-card: #FFFFFF;
    
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --nav-height: 60px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --status-height: env(safe-area-inset-top, 0px);
}

/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { 
    width: 100%; height: 100%; 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 14px; color: var(--text-primary);
    background: var(--bg-app);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}
button { border: none; background: none; cursor: pointer; outline: none; font-family: inherit; }
input, textarea { outline: none; border: none; font-family: inherit; font-size: 14px; }
ul, li { list-style: none; }
a { text-decoration: none; color: inherit; }

/* ===== App Container ===== */
.h5-app {
    width: 100%; 
    height: 100vh; 
    height: 100dvh;
    display: flex; 
    flex-direction: column;
    background: var(--bg-app);
    position: relative;
    max-width: 480px; 
    margin: 0 auto;
    overflow: hidden;
}

/* 桌面端显示边框 */
@media (min-width: 481px) {
    .h5-app { 
        border-left: 1px solid var(--border); 
        border-right: 1px solid var(--border);
        box-shadow: 0 0 40px rgba(0,0,0,0.1);
    }
}

/* ===== Status Bar ===== */
.status-bar {
    height: var(--status-height);
    background: transparent;
    flex-shrink: 0;
}

/* ===== Page Container ===== */
.page-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.page {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: calc(var(--nav-height) + var(--safe-bottom));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: none;
    animation: fadeIn 0.3s ease;
}
.page.active { display: block; }
.page-ai.active { display: flex; flex-direction: column; }

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

.bottom-spacer { height: calc(var(--nav-height) + var(--safe-bottom) + 20px); }

/* ===== Bottom Navigation ===== */
.bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-hint);
    font-size: 11px;
    transition: color 0.2s;
    position: relative;
    height: 100%;
}
.nav-item i { font-size: 20px; }
.nav-item.active { color: var(--primary); }
.nav-item:active { transform: scale(0.95); }

.nav-record-btn { position: relative; }
.nav-record-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: -8px;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
    position: relative;
    z-index: 1;
}
.nav-record-btn span { margin-top: 4px; }

/* ========== 首页 ========== */

/* 顶部欢迎区 */
.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 20px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.home-greeting { flex: 1; }
.greeting-text {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}
.greeting-hi { font-size: 16px; opacity: 0.9; }
.greeting-name { font-size: 22px; font-weight: 700; }
.greeting-sub { font-size: 13px; opacity: 0.85; }

.home-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    border: 2px solid rgba(255,255,255,0.4);
}

/* 健康评分卡片 */
.score-card {
    margin: -16px 16px 16px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
}
.score-card::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 120px; height: 120px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}
.score-card::after {
    content: '';
    position: absolute;
    bottom: -20px; left: 40%;
    width: 80px; height: 80px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.score-left { position: relative; z-index: 1; }
.score-ring {
    width: 100px; height: 100px;
    position: relative;
}
.ring-svg { width: 100%; height: 100%; }
.score-value {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.score-num {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}
.score-unit {
    font-size: 12px;
    opacity: 0.8;
}
.score-right {
    flex: 1;
    position: relative;
    z-index: 1;
}
.score-right h3 {
    font-size: 15px;
    margin-bottom: 6px;
    font-weight: 600;
}
.score-desc {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 10px;
}
.score-items {
    display: flex;
    gap: 12px;
}
.score-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    opacity: 0.9;
}
.dot {
    width: 6px; height: 6px;
    border-radius: 50%;
}
.dot-green { background: #4ADE80; }
.dot-yellow { background: #FCD34D; }
.dot-blue { background: #93C5FD; }

/* 快捷入口 */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 16px 16px;
}
.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 4px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.quick-item:active { transform: scale(0.95); }
.quick-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}
.bg-purple { background: linear-gradient(135deg, #7C3AED, #A78BFA); }
.bg-blue { background: linear-gradient(135deg, #3B82F6, #60A5FA); }
.bg-green { background: linear-gradient(135deg, #10B981, #34D399); }
.bg-orange { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.bg-gray { background: linear-gradient(135deg, #6B7280, #9CA3AF); }
.bg-red { background: linear-gradient(135deg, #EF4444, #F87171); }
.bg-cyan { background: linear-gradient(135deg, #06B6D4, #22D3EE); }
.bg-pink { background: linear-gradient(135deg, #EC4899, #F472B6); }

/* 通用卡片 */
.section-card {
    margin: 0 16px 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.section-header h3 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.section-header h3 i { color: var(--primary); font-size: 14px; }
.section-more {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}
.section-more i { font-size: 10px; }

/* 趋势图 */
.trend-chart-wrap, .record-chart-wrap {
    width: 100%;
    position: relative;
}

/* 待办列表 */
.todo-list { display: flex; flex-direction: column; gap: 10px; }
.todo-empty, .record-empty, .med-empty, .history-empty {
    text-align: center;
    padding: 24px 0;
    color: var(--text-hint);
    font-size: 13px;
}
.todo-empty i, .record-empty i, .med-empty i {
    font-size: 32px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.todo-tabs {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
    background: var(--bg-app);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.todo-tabs::-webkit-scrollbar { display: none; }
.todo-tab {
    flex-shrink: 0;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
}
.todo-tab.active {
    background: var(--primary-gradient);
    color: white;
}
.todo-tab i { font-size: 12px; }
.todo-tab:active { transform: scale(0.95); }

.todo-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: all 0.2s;
}
.todo-card:active { transform: scale(0.98); }
.todo-card.done { opacity: 0.6; }
.todo-card.done .todo-title { text-decoration: line-through; }

.todo-check {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: transparent;
    font-size: 12px;
    transition: all 0.2s;
}
.todo-check.done {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.todo-content { flex: 1; min-width: 0; }
.todo-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.todo-type-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    color: white;
}
.todo-type-tag.bg-blue { background: linear-gradient(135deg, #3B82F6, #60A5FA); }
.todo-type-tag.bg-purple { background: linear-gradient(135deg, #7C3AED, #A78BFA); }
.todo-type-tag.bg-green { background: linear-gradient(135deg, #10B981, #34D399); }
.todo-type-tag.bg-cyan { background: linear-gradient(135deg, #06B6D4, #22D3EE); }
.todo-type-tag.bg-orange { background: linear-gradient(135deg, #F59E0B, #FBBF24); }
.todo-type-tag i { font-size: 10px; margin-right: 3px; }

.todo-date.overdue { color: var(--danger); font-weight: 500; }

.todo-card.priority-high { border-left: 3px solid var(--danger); }
.todo-card.priority-medium { border-left: 3px solid var(--warning); }

.priority-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
}
.todo-date {
    font-size: 12px;
    color: var(--text-hint);
}
.todo-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.todo-desc {
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.todo-delete {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-hint);
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s;
}
.todo-delete:active { background: var(--bg-app); color: var(--danger); }

.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-app);
    border-radius: var(--radius-sm);
}
.todo-time { font-size: 12px; color: var(--text-hint); margin-top: 2px; }
.todo-icon { font-size: 18px; color: var(--primary); }

/* 健康洞察 */
.insight-list { display: flex; flex-direction: column; gap: 10px; }
.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
}
.insight-item i { font-size: 16px; color: var(--primary); margin-top: 2px; flex-shrink: 0; }
.insight-item.insight-warning { background: #FEF3C7; }
.insight-item.insight-warning i { color: var(--warning); }
.insight-item.insight-info { background: #EFF6FF; }
.insight-item.insight-info i { color: var(--info); }
.insight-item.insight-success { background: #ECFDF5; }
.insight-item.insight-success i { color: var(--success); }
.insight-content { flex: 1; }
.insight-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.insight-desc { font-size: 12px; color: var(--text-secondary); }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.badge-primary { background: var(--primary-bg); color: var(--primary); }

/* ========== AI对话页 ========== */
.page-chat {
    display: none;
    flex-direction: column;
}
.page-chat.active {
    display: flex !important;
    flex-direction: column;
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.chat-header-left { display: flex; align-items: center; gap: 10px; }
.chat-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.chat-name { font-size: 15px; font-weight: 600; }
.chat-status {
    font-size: 11px;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}
.status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.chat-header-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.chat-header-btn:active { background: var(--bg-app); }

/* 聊天区 */
.chat-area {
    flex: 1;
    overflow: hidden;
    position: relative;
    background: var(--bg-app);
}
.chat-messages {
    height: 100%;
    overflow-y: auto;
    padding: 16px 12px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--text-hint); border-radius: 3px; }

/* 消息气泡 */
.message {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    animation: fadeInUp 0.3s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.message-user { flex-direction: row-reverse; }

.avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.avatar-ai {
    background: var(--primary-gradient);
    color: white;
}
.avatar-user {
    background: #E0E7FF;
    color: var(--primary);
}

.bubble {
    max-width: 78%;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    line-height: 1.6;
    font-size: 14px;
    word-wrap: break-word;
    position: relative;
}
.bubble-ai {
    background: var(--bg-white);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-sm);
}
.bubble-ai p { margin: 4px 0; }
.bubble-ai ul { margin: 4px 0 4px 16px; }
.bubble-ai li { margin: 2px 0; }
.bubble-ai strong { color: var(--primary); }
.bubble-user {
    background: var(--primary-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}
.bubble-user p { margin: 2px 0; }

/* 快捷问题气泡下方 */
.quick-questions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 12px 16px 52px;
}
.qq-item {
    padding: 10px 12px;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.qq-item i { color: var(--primary); font-size: 12px; }
.qq-item:active { background: var(--primary-bg); color: var(--primary); }

/* 加载指示器 */
.chat-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin: 0 12px 16px 52px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    font-size: 12px;
    color: var(--text-secondary);
    animation: fadeInUp 0.3s ease;
}
.loading-dots { display: flex; gap: 4px; }
.loading-dots span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--primary-light);
    animation: bounce 1.4s ease-in-out infinite both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.loading-dots span:nth-child(3) { animation-delay: 0s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 聊天底部栏 */
.chat-footer {
    flex-shrink: 0;
    background: var(--bg-white);
    border-top: 1px solid var(--border-light);
    padding: 8px 12px;
    padding-bottom: calc(8px + var(--safe-bottom));
}
.input-tools {
    display: flex;
    gap: 4px;
    padding: 4px 0 8px;
}
.tool-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 16px;
    transition: all 0.2s;
}
.tool-btn:active { background: var(--bg-app); color: var(--primary); }
.input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.chat-input {
    flex: 1;
    resize: none;
    padding: 16px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.4;
    max-height: 100px;
    min-height: 56px;
    background: var(--bg-app);
    transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--primary); background: var(--bg-white); }
.chat-input::placeholder { color: var(--text-hint); }
.send-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.2s;
}
.send-btn:active { transform: scale(0.9); opacity: 0.9; }

/* 文件消息 */
.file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    font-size: 12px;
}
.msg-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--radius-sm);
    margin-top: 6px;
}

/* 历史面板 */
.history-panel {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 500;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.history-panel.active { display: flex; }
.history-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
}
.history-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--bg-white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.history-header h3 { font-size: 16px; font-weight: 600; }
.history-header button {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}
.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.history-item {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
}
.history-item:active { background: var(--bg-app); }
.history-item-title {
    font-size: 14px;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.history-item-time {
    font-size: 12px;
    color: var(--text-hint);
    flex-shrink: 0;
    margin-left: 12px;
}

/* ========== 健康记录页 ========== */
.page-header {
    padding: 20px 20px 16px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    margin-bottom: 16px;
}
.page-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-header p { font-size: 13px; opacity: 0.85; }

.record-tabs {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
    overflow-x: auto;
    scrollbar-width: none;
}
.record-tabs::-webkit-scrollbar { display: none; }
.record-tab {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--bg-white);
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.record-tab.active {
    background: var(--primary-gradient);
    color: white;
}
.record-tab:active { transform: scale(0.95); }

/* 记录列表 */
.record-list {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.record-card {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: all 0.2s;
}
.record-card:active { transform: scale(0.98); }
.record-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.record-type-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: var(--primary-bg);
    color: var(--primary);
}
.record-date {
    font-size: 12px;
    color: var(--text-hint);
}
.record-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.record-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.record-metric-label {
    font-size: 11px;
    color: var(--text-hint);
}
.record-metric-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.record-metric-unit {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 2px;
}
.record-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}
.record-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.record-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-hint);
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
}
.record-card:active .record-delete { opacity: 1; }

/* 浮动按钮 */
.fab-btn {
    position: absolute;
    right: 20px;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
    z-index: 50;
    transition: all 0.2s;
}
.fab-btn:active { transform: scale(0.9); }

/* ========== 用药提醒页 ========== */
.today-med-list, .medication-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.med-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    position: relative;
}
.med-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10B981, #34D399);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.med-info { flex: 1; min-width: 0; }
.med-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.med-detail {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.med-detail i { color: var(--text-hint); }
.med-time {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}
.med-toggle {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: var(--border);
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}
.med-toggle.active { background: var(--primary); }
.med-toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.med-toggle.active::after { transform: translateX(20px); }
.med-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-hint);
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.2s;
}
.med-card:active .med-delete { opacity: 1; }

.today-med-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-app);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.today-med-item.taken { opacity: 0.6; }
.today-med-item.taken .med-name { text-decoration: line-through; }
.med-check {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    flex-shrink: 0;
    transition: all 0.2s;
    font-size: 12px;
}
.med-check.done {
    background: var(--success);
    border-color: var(--success);
    color: white;
}
.today-med-info { flex: 1; }
.today-med-name { font-size: 14px; font-weight: 500; }
.today-med-dose { font-size: 12px; color: var(--text-hint); margin-top: 2px; }
.today-med-time {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}

/* ========== 个人中心页 ========== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 20px 32px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    position: relative;
}
.profile-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 3px solid rgba(255,255,255,0.4);
    flex-shrink: 0;
}
.profile-info { flex: 1; min-width: 0; }
.profile-info h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-info p {
    font-size: 13px;
    opacity: 0.85;
}
.profile-edit-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.profile-edit-btn:active { background: rgba(255,255,255,0.3); }

.profile-stats {
    margin: -20px 16px 16px;
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 1;
}
.stat-item {
    flex: 1;
    text-align: center;
}
.stat-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}
.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}
.stat-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
}

.profile-menu {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.menu-group {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
    position: relative;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg-app); }
.menu-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}
.menu-text {
    flex: 1;
    font-size: 14px;
}
.menu-arrow {
    color: var(--text-hint);
    font-size: 12px;
}
.menu-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}
.menu-danger .menu-text { color: var(--danger); }

/* ========== 通用弹窗 ========== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
}
.modal-container {
    position: relative;
    width: calc(100% - 32px);
    max-width: 448px;
    max-height: 85vh;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    animation: modalIn 0.3s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
}
.modal-close:active { background: var(--bg-app); }
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    -webkit-overflow-scrolling: touch;
}
.modal-footer {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--primary-gradient);
    color: white;
}
.btn-primary:active { opacity: 0.9; transform: scale(0.98); }
.btn-secondary {
    background: var(--bg-app);
    color: var(--text-primary);
}
.btn-secondary:active { background: var(--border); }
.btn-block {
    width: 100%;
    padding: 12px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-white);
    transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
}
.form-textarea {
    resize: vertical;
    min-height: 80px;
}
.form-row {
    display: flex;
    gap: 12px;
}
.form-row .form-group {
    flex: 1;
}
.form-tip {
    font-size: 12px;
    color: var(--text-hint);
    margin-top: 4px;
}

/* 通知列表弹窗 */
.notif-list {
    display: flex;
    flex-direction: column;
}
.notif-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}
.notif-item:last-child { border-bottom: none; }
.notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.notif-title {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}
.notif-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--danger);
}
.notif-dot.read { background: transparent; }
.notif-time {
    font-size: 11px;
    color: var(--text-hint);
}
.notif-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 健康档案表单 */
.health-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* 订单列表 */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.order-card {
    background: var(--bg-app);
    border-radius: var(--radius-md);
    padding: 14px;
}
.order-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.order-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}
.order-info { flex: 1; min-width: 0; }
.order-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.order-meta { font-size: 11px; color: var(--text-hint); }
.order-status {
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;
}
.order-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}
.order-date { font-size: 12px; color: var(--text-secondary); }
.order-amount { font-size: 16px; font-weight: 700; color: var(--primary); }

/* 收藏服务列表 */
.fav-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.fav-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-app);
    border-radius: var(--radius-md);
    position: relative;
}
.fav-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}
.fav-info { flex: 1; min-width: 0; }
.fav-name { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.fav-desc { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-price { font-size: 15px; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.fav-unit { font-size: 11px; font-weight: 400; color: var(--text-hint); margin-left: 2px; }
.fav-remove {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-hint);
    font-size: 12px;
    flex-shrink: 0;
}
.fav-remove:active { background: var(--bg-white); color: var(--danger); }

/* 报告评分卡片 */
.report-score-card {
    text-align: center;
    padding: 20px;
    background: var(--primary-gradient);
    border-radius: var(--radius-lg);
    color: white;
    margin-bottom: 16px;
}
.score-circle {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto 8px;
}
.score-label { font-size: 13px; opacity: 0.85; }
.score-level {
    font-size: 16px;
    font-weight: 600;
    margin-top: 4px;
}
.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.report-grid-item {
    background: var(--bg-app);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
}
.report-grid-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}
.report-grid-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* 报告弹窗 */
.report-content {
    line-height: 1.8;
    font-size: 14px;
}
.report-content h3 {
    color: var(--primary);
    margin: 16px 0 8px;
    font-size: 16px;
}
.report-content h4 {
    color: var(--text-primary);
    margin: 12px 0 6px;
    font-size: 14px;
}
.report-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}
.report-label { color: var(--text-secondary); }
.report-value { font-weight: 500; }
.report-suggestion {
    padding: 10px 12px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 13px;
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 24px;
    background: rgba(0,0,0,0.8);
    color: white;
    border-radius: var(--radius-md);
    font-size: 14px;
    z-index: 3000;
    animation: toastIn 0.3s ease;
    max-width: 80%;
    text-align: center;
}
@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -40%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* ========== 快捷提问面板 ========== */
.quick-panel {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.quick-panel.active { display: flex; }
.panel-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
}
.quick-panel .panel-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--bg-white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}
.panel-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.quick-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.quick-list-item {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-app);
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
}
.quick-list-item:active { background: var(--primary-bg); color: var(--primary); }

/* 加载中遮罩 */
.loading-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}
.loading-spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ===== 通知 & 弹窗 ===== */
.notif-badge {
    background: #EF4444;
    color: #fff;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    margin-left: 4px;
}
.home-notif-bar {
    background: var(--primary-bg);
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 12px;
    text-align: center;
    color: var(--primary);
    cursor: pointer;
    font-size: 14px;
}
.home-notif-bar:hover { background: #EDE9FE; }
.notif-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
}
.notif-item.unread { background: #FEF2F2; border-left: 3px solid #EF4444; }
.notif-item p { margin: 0 0 4px; font-size: 14px; }
.notif-item small { color: #999; font-size: 12px; }

/* ===== 健康看板 ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.dash-item {
    background: var(--primary-bg);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}
.dash-label { display: block; font-size: 12px; color: #666; margin-bottom: 4px; }
.dash-val { display: block; font-size: 24px; font-weight: 700; color: var(--primary); }
.dash-unit { display: block; font-size: 11px; color: #999; margin-top: 2px; }

/* ===== 弹窗遮罩 ===== */
.overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.overlay .modal {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #eee;
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-header button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}
.modal-body { padding: 16px; }

/* ===== 暗黑模式 ===== */
[data-theme='dark'] {
    --primary: #A78BFA;
    --primary-light: #C4B5FD;
    --primary-dark: #7C3AED;
    --primary-bg: #1E1B4B;
    --bg: #0F0F1A;
    --bg-card: #1A1A2E;
    --bg-secondary: #16213E;
    --text: #E2E8F0;
    --text-secondary: #94A3B8;
    --border: #2D2D44;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
}
[data-theme='dark'] .chat-container { background: var(--bg); }
[data-theme='dark'] .message-bubble { background: var(--bg-card); color: var(--text); }
[data-theme='dark'] .message-bubble.user { background: var(--primary); }
[data-theme='dark'] .tab-bar { background: var(--bg-card); border-top-color: var(--border); }
[data-theme='dark'] .input-area { background: var(--bg-card); border-top-color: var(--border); }
[data-theme='dark'] .card { background: var(--bg-card); }
[data-theme='dark'] .quick-questions { background: var(--bg-card); }
[data-theme='dark'] .history-item { border-bottom-color: var(--border); }
[data-theme='dark'] .history-item:hover { background: var(--bg-secondary); }

/* ===== 登录弹窗 ===== */
.login-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.login-mask {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
}
.login-container {
    position: relative;
    width: calc(100% - 32px);
    max-width: 360px;
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}
.login-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-light);
}
.login-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}
.login-header button {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 14px;
}
.login-header button:active { background: var(--bg-app); }
.login-body {
    padding: 20px;
}
.login-body .form-group {
    margin-bottom: 16px;
}
.login-body .form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--bg-app);
    transition: border-color 0.2s;
}
.login-body .form-group input:focus {
    border-color: var(--primary);
    background: var(--bg-white);
    outline: none;
}
.login-body .form-group input::placeholder {
    color: var(--text-hint);
}
.login-error {
    display: none;
    text-align: center;
    color: var(--danger);
    font-size: 12px;
    margin-bottom: 12px;
}

/* ===== 骨架屏 ===== */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 8px; }
[data-theme='dark'] .skeleton { background: linear-gradient(90deg, #2D2D44 25%, #3D3D54 50%, #2D2D44 75%); background-size: 200% 100%; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-line { height: 14px; margin-bottom: 8px; width: 100%; }
.skeleton-line.short { width: 60%; }

/* ===== 健康报告样式 ===== */
.report-card { background: var(--bg-card); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.report-card h3 { color: var(--primary); font-size: 18px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.report-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.report-item:last-child { border-bottom: none; }
.report-label { color: var(--text-secondary); font-size: 14px; }
.report-value { color: var(--text); font-weight: 500; font-size: 14px; }
.report-badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.report-badge.good { background: #D1FAE5; color: #065F46; }
.report-badge.warn { background: #FEF3C7; color: #92400E; }
.report-badge.bad { background: #FEE2E2; color: #991B1B; }
[data-theme='dark'] .report-badge.good { background: #064E3B; color: #6EE7B7; }
[data-theme='dark'] .report-badge.warn { background: #78350F; color: #FCD34D; }
[data-theme='dark'] .report-badge.bad { background: #7F1D1D; color: #FCA5A5; }

/* ===== 登录/注册弹窗 ===== */
.auth-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.2s ease; }
.auth-modal { background: var(--bg-card); border-radius: var(--radius-xl); padding: 32px 24px; width: 85%; max-width: 360px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); animation: slideUp 0.3s ease; }
.auth-modal h2 { text-align: center; color: var(--primary); margin-bottom: 24px; font-size: 22px; }
.auth-modal .form-group { margin-bottom: 16px; }
.auth-modal .form-group label { display: block; font-size: 14px; color: var(--text-secondary); margin-bottom: 6px; }
.auth-modal .form-group input { width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius-md); font-size: 16px; background: var(--bg); color: var(--text); transition: border-color 0.2s; }
.auth-modal .form-group input:focus { outline: none; border-color: var(--primary); }
.auth-modal .btn-primary { width: 100%; padding: 14px; background: var(--primary-gradient); color: white; border: none; border-radius: var(--radius-md); font-size: 16px; font-weight: 600; cursor: pointer; }
.auth-modal .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-modal .auth-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-secondary); }
.auth-modal .auth-switch a { color: var(--primary); cursor: pointer; text-decoration: none; }
.auth-modal .close-btn { position: absolute; top: 12px; right: 12px; background: none; border: none; font-size: 24px; color: var(--text-secondary); cursor: pointer; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== 个人中心Tab ===== */
.profile-header { text-align: center; padding: 30px 20px; }
.profile-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--primary-gradient); display: flex; align-items: center; justify-content: center; font-size: 32px; color: white; margin: 0 auto 12px; }
.profile-name { font-size: 20px; font-weight: 600; color: var(--text); }
.profile-phone { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.profile-menu { padding: 0 16px; }
.profile-menu-item { display: flex; align-items: center; padding: 14px 16px; background: var(--bg-card); border-radius: var(--radius-md); margin-bottom: 8px; cursor: pointer; transition: transform 0.1s; }
.profile-menu-item:active { transform: scale(0.98); }
.profile-menu-item .icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; color: white; margin-right: 12px; }
.profile-menu-item .label { flex: 1; font-size: 15px; color: var(--text); }
.profile-menu-item .arrow { color: var(--text-secondary); font-size: 14px; }
.profile-menu-item .badge { background: #EF4444; color: white; font-size: 11px; padding: 2px 6px; border-radius: 10px; margin-right: 8px; }

/* ===== AI对话卡片样式 ===== */
.action-card { padding: 12px 0; }
.action-card h4 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.action-card .todo-form { background: rgba(124, 58, 237, 0.05); padding: 12px; border-radius: var(--radius-md); }
.action-card .form-group { margin-bottom: 10px; }
.action-card .form-group label { display: block; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.action-card .form-input, .action-card .form-select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; background: var(--bg-white); }

.service-grid { padding: 8px 0; }
.service-grid h4 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.service-card { display: flex; align-items: center; padding: 12px; background: rgba(124, 58, 237, 0.05); border-radius: var(--radius-md); margin-bottom: 8px; cursor: pointer; transition: background 0.2s; }
.service-card:active { background: rgba(124, 58, 237, 0.1); }
.service-card .service-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-gradient); display: flex; align-items: center; justify-content: center; color: white; font-size: 16px; margin-right: 12px; }
.service-card .service-info { flex: 1; }
.service-card .service-info h5 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.service-card .service-info p { font-size: 12px; color: var(--text-secondary); }
.service-card .fa-chevron-right { color: var(--text-secondary); font-size: 14px; }

.provider-list { padding: 8px 0; }
.provider-list h4 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.provider-card { display: flex; align-items: center; padding: 12px; background: rgba(124, 58, 237, 0.05); border-radius: var(--radius-md); margin-bottom: 8px; cursor: pointer; transition: background 0.2s; }
.provider-card:active { background: rgba(124, 58, 237, 0.1); }
.provider-avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--bg-app); object-fit: cover; margin-right: 12px; }
.provider-info { flex: 1; min-width: 0; }
.provider-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.provider-header h5 { font-size: 14px; font-weight: 600; color: var(--text); }
.provider-rating { font-size: 12px; color: #F59E0B; }
.provider-rating .fa-star { margin-right: 2px; }
.provider-info p { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.provider-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.provider-tags .tag { font-size: 10px; padding: 2px 6px; background: rgba(124, 58, 237, 0.15); color: var(--primary); border-radius: 4px; }
.provider-price { font-size: 14px; font-weight: 600; color: var(--primary); }

.option-list { padding: 8px 0; }
.option-list h4 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.option-list p { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; }
.option-card { display: flex; align-items: center; padding: 12px; background: rgba(124, 58, 237, 0.05); border-radius: var(--radius-md); margin-bottom: 8px; cursor: pointer; transition: background 0.2s; }
.option-card:active { background: rgba(124, 58, 237, 0.1); }
.option-info { flex: 1; }
.option-info h5 { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.option-info p { font-size: 12px; color: var(--text-secondary); }
.option-price { font-size: 14px; font-weight: 600; color: var(--primary); }

.text-hint { font-size: 12px; color: var(--text-hint); margin-top: 8px; }
.mt-2 { margin-top: 8px; }

.todo-list, .workflow-list { padding: 8px 0; }
.todo-list h4, .workflow-list h4 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 10px; }

.todo-stats { display: flex; gap: 12px; margin-bottom: 10px; font-size: 12px; color: var(--text-secondary); }

.todo-card { display: flex; align-items: center; padding: 12px; background: rgba(124, 58, 237, 0.05); border-radius: var(--radius-md); margin-bottom: 8px; cursor: pointer; transition: background 0.2s; }
.todo-card:active { background: rgba(124, 58, 237, 0.1); }
.todo-checkbox { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; margin-right: 12px; color: var(--text-secondary); }
.todo-info { flex: 1; min-width: 0; }
.todo-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.todo-header h5 { font-size: 14px; font-weight: 600; color: var(--text); }
.priority-badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; }
.priority-high { background: rgba(239, 68, 68, 0.1); color: #EF4444; }
.priority-medium { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.priority-low { background: rgba(16, 185, 129, 0.1); color: #10B981; }
.todo-info p { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.todo-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--text-hint); }
.todo-meta .tag { background: rgba(124, 58, 237, 0.1); color: var(--primary); padding: 1px 4px; border-radius: 2px; }

.workflow-card { display: flex; align-items: center; padding: 12px; background: rgba(124, 58, 237, 0.05); border-radius: var(--radius-md); margin-bottom: 8px; cursor: pointer; transition: background 0.2s; }
.workflow-card:active { background: rgba(124, 58, 237, 0.1); }
.workflow-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-gradient); display: flex; align-items: center; justify-content: center; color: white; font-size: 14px; margin-right: 12px; }
.workflow-info { flex: 1; min-width: 0; }
.workflow-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.workflow-header h5 { font-size: 14px; font-weight: 600; color: var(--text); }
.workflow-type { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: rgba(124, 58, 237, 0.1); color: var(--primary); }
.workflow-info p { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.workflow-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--text-hint); }
.workflow-meta .tag { background: rgba(124, 58, 237, 0.1); color: var(--primary); padding: 1px 4px; border-radius: 2px; }

/* ===== Booking Flow Cards ===== */
.booking-flow-card { padding: 12px 0; }
.booking-flow-card h4 { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; }

.booking-info { background: rgba(124, 58, 237, 0.05); border-radius: var(--radius-md); padding: 10px; margin-bottom: 12px; }
.info-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid rgba(124, 58, 237, 0.1); }
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 12px; color: var(--text-secondary); }
.info-value { font-size: 12px; font-weight: 500; color: var(--text-primary); }

.booking-section { margin-bottom: 16px; }
.booking-section h5 { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }

.package-card { display: flex; align-items: center; padding: 12px; background: rgba(124, 58, 237, 0.05); border-radius: var(--radius-md); margin-bottom: 8px; cursor: pointer; transition: background 0.2s; }
.package-card:active { background: rgba(124, 58, 237, 0.1); }
.package-info { flex: 1; }
.package-info h6 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.package-info p { font-size: 12px; color: var(--text-secondary); }
.package-price { font-size: 14px; font-weight: 600; color: var(--primary); }

.caregiver-card { display: flex; align-items: center; padding: 12px; background: rgba(124, 58, 237, 0.05); border-radius: var(--radius-md); margin-bottom: 8px; cursor: pointer; transition: background 0.2s; }
.caregiver-card:active { background: rgba(124, 58, 237, 0.1); }
.caregiver-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-gradient); display: flex; align-items: center; justify-content: center; color: white; font-size: 16px; margin-right: 12px; }
.caregiver-info { flex: 1; }
.caregiver-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.caregiver-header h6 { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.caregiver-rating { font-size: 12px; color: #F59E0B; }
.caregiver-info p { font-size: 12px; color: var(--text-secondary); }
.caregiver-status { font-size: 10px; padding: 2px 8px; border-radius: 10px; }
.status-available { background: rgba(16, 185, 129, 0.1); color: #10B981; }
.status-busy { background: rgba(156, 163, 175, 0.1); color: #9CA3AF; }

.date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.date-card { background: rgba(124, 58, 237, 0.05); border-radius: var(--radius-sm); padding: 8px 4px; text-align: center; cursor: pointer; transition: background 0.2s; }
.date-card:active { background: rgba(124, 58, 237, 0.1); }
.date-day { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.date-weekday { font-size: 10px; color: var(--text-secondary); margin-top: 2px; }
