@charset "utf-8";
/* CSS Document */

/* 长辈健康守护 - 适老化设计 */

:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #f0fdf4;
    --bg-card: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #d1d5db;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.container { max-width: 800px; margin: 0 auto; padding: 20px; }

/* 头部 */
.header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 30px;
    position: relative;
}

.header h1 {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 8px;
}

.header .subtitle { color: var(--text-light); font-size: 18px; }

.back-btn {
    position: absolute;
    left: 0;
    top: 30px;
    color: var(--primary);
    text-decoration: none;
    font-size: 18px;
}

/* 导航卡片 */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.nav-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 2px solid transparent;
}

.nav-card:hover, .nav-card:active {
    border-color: var(--primary);
    transform: translateY(-4px);
}

.nav-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.nav-icon.heart { background: #fee2e2; }
.nav-icon.medicine { background: #dbeafe; }
.nav-icon.consult { background: #d1fae5; }
.nav-icon.report { background: #fef3c7; }

.nav-card span { font-size: 22px; font-weight: 600; display: block; }
.nav-card p { color: var(--text-light); margin-top: 8px; font-size: 16px; }

/* 统计卡片 */
.quick-stats { margin-bottom: 40px; }
.quick-stats h2 { font-size: 24px; margin-bottom: 20px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-label { font-size: 16px; color: var(--text-light); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary); margin-top: 8px; }

/* 表单 */
.form-row { margin-bottom: 24px; }
.form-row label { display: block; font-size: 18px; font-weight: 600; margin-bottom: 8px; }

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row textarea { min-height: 100px; resize: vertical; }

.input-group { display: flex; align-items: center; gap: 8px; }
.input-group input { flex: 1; }
.separator { font-size: 24px; color: var(--text-light); }

/* 按钮 */
.btn {
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
    background: #e5e7eb;
    color: var(--text);
}

.btn-large {
    width: 100%;
    padding: 20px;
    font-size: 20px;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 16px;
    cursor: pointer;
}

/* 历史/提醒列表 */
.history-list { margin-top: 20px; }
.history-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.history-item .date { color: var(--text-light); font-size: 16px; }
.history-item .data { font-size: 20px; font-weight: 600; margin-top: 8px; }
.history-item .status { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 14px; margin-top: 8px; }
.history-item .status.normal { background: #d1fae5; color: #059669; }
.history-item .status.warning { background: #fef3c7; color: #d97706; }
.history-item .status.danger { background: #fee2e2; color: #dc2626; }

/* 用药提醒 */
.time-list { margin-bottom: 12px; }
.time-item { display: flex; gap: 12px; margin-bottom: 8px; align-items: center; }
.time-item input { flex: 1; }

.medicine-item {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
}

.medicine-item .name { font-size: 22px; font-weight: 600; }
.medicine-item .dose { color: var(--text-light); margin-top: 4px; }
.medicine-item .times { margin-top: 12px; }
.medicine-item .time-tag {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    margin-right: 8px;
    font-size: 16px;
}

/* 咨询聊天 */
.disclaimer {
    background: #fef3c7;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    text-align: center;
}

.quick-questions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.quick-questions button {
    padding: 12px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 24px;
    font-size: 16px;
    cursor: pointer;
}

.quick-questions button:hover { border-color: var(--primary); color: var(--primary); }

.chat-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.message {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    max-width: 85%;
}

.message.bot {
    background: #f3f4f6;
    border-bottom-left-radius: 4px;
}

.message.user {
    background: var(--primary);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-input { display: flex; gap: 12px; }
.chat-input input { flex: 1; padding: 16px; font-size: 18px; border: 2px solid var(--border); border-radius: 12px; }

/* 上传区域 */
.upload-area {
    border: 3px dashed var(--border);
    border-radius: 16px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    margin-bottom: 24px;
}

.upload-area:hover { border-color: var(--primary); background: rgba(16, 185, 129, 0.05); }
.upload-icon { font-size: 48px; margin-bottom: 16px; }
.upload-area .hint { color: var(--text-light); font-size: 16px; margin-top: 8px; }

.preview-area { text-align: center; margin-bottom: 24px; }
.preview-area img { max-width: 100%; max-height: 300px; border-radius: 12px; margin-bottom: 16px; }

/* 结果卡片 */
.result-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.result-card h3 { font-size: 20px; color: var(--primary); margin-bottom: 12px; }
.result-text { white-space: pre-wrap; line-height: 1.8; }

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
.loading p { margin-top: 16px; font-size: 20px; }

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
    font-size: 16px;
}

/* 响应式 */
@media (max-width: 600px) {
    .container { padding: 16px; }
    .header h1 { font-size: 28px; }
    .nav-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .quick-questions button { width: 100%; }
}