/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f0f4f8;
    color: #1a202c;
    padding-top: 60px;
    min-height: 100vh;
}

/* ===== 导航栏 ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #2b6cb0;
    color: white;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo { font-size: 20px; font-weight: 700; }
.mode-toggle {
    background: rgba(255,255,255,0.2);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.mode-toggle:hover { background: rgba(255,255,255,0.3); }

/* ===== 容器 ===== */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* ===== 页面切换 ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== 卡片 ===== */
.card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ===== 进度条 ===== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}
.progress-fill {
    height: 100%;
    background: #48bb78;
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* ===== 药品列表 ===== */
.drug-list .empty {
    color: #a0aec0;
    text-align: center;
    padding: 20px 0;
}
.drug-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f4f8;
}
.drug-item:last-child { border-bottom: none; }
.drug-item .info { flex: 1; }
.drug-item .name { font-weight: 500; }
.drug-item .meta { font-size: 13px; color: #718096; }
.drug-item .status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
}
.status.done { background: #c6f6d5; color: #22543d; }
.status.pending { background: #fefcbf; color: #744210; }
.drug-item .del {
    color: #fc8181;
    cursor: pointer;
    margin-left: 12px;
    font-size: 14px;
}

/* ===== 按钮 ===== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary { background: #2b6cb0; color: white; }
.btn-primary:hover { background: #1a4f8b; }
.btn-secondary { background: #e2e8f0; color: #2d3748; }
.btn-secondary:hover { background: #cbd5e0; }
.btn-success { background: #48bb78; color: white; }
.btn-success:hover { background: #38a169; }
.btn-danger { background: #fc8181; color: white; }
.btn-danger:hover { background: #e53e3e; }
.quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.quick-actions .btn { flex: 1; min-width: 80px; text-align: center; }

/* ===== 表单 ===== */
.form-card input, .form-card select {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: border 0.2s;
}
.form-card input:focus, .form-card select:focus {
    outline: none;
    border-color: #2b6cb0;
}
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 600;
}
.btn-back {
    background: none;
    border: none;
    font-size: 16px;
    color: #2b6cb0;
    cursor: pointer;
    padding: 4px 8px;
}

/* ===== 冲突警告 ===== */
.conflict-warn {
    background: #fed7d7;
    color: #9b2c2c;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 500;
    border-left: 4px solid #e53e3e;
}

/* ===== 提醒弹窗 ===== */
.reminder-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}
.reminder-popup {
    background: white;
    border-radius: 24px;
    padding: 32px 28px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.3s ease;
}
.reminder-icon { font-size: 56px; margin-bottom: 8px; }
.reminder-name { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.reminder-dosage { font-size: 18px; color: #4a5568; }
.reminder-note { font-size: 15px; color: #718096; margin: 8px 0 20px; }
.reminder-btns {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.reminder-btns .btn { width: 100%; padding: 14px; font-size: 17px; }

@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes slideUp { from { transform: translateY(30px); opacity:0; } to { transform: translateY(0); opacity:1; } }

/* ===== 我的页面 ===== */
.info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}
.info-row label {
    width: 80px;
    font-weight: 500;
    color: #4a5568;
    flex-shrink: 0;
}
.info-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
}
.info-row input:focus { outline: none; border-color: #2b6cb0; }

/* ===== 适老化模式（长辈模式） ===== */
body.elderly-mode * {
    font-size: 20px !important;
}
body.elderly-mode .btn {
    padding: 16px 28px !important;
    font-size: 22px !important;
    min-height: 56px;
}
body.elderly-mode input,
body.elderly-mode select {
    padding: 16px 18px !important;
    font-size: 22px !important;
    min-height: 56px;
}
body.elderly-mode .card-title { font-size: 26px !important; }
body.elderly-mode .reminder-name { font-size: 32px !important; }
body.elderly-mode .reminder-btns .btn { padding: 18px !important; font-size: 22px !important; }
body.elderly-mode .nav-inner .logo { font-size: 28px !important; }
body.elderly-mode .mode-toggle { font-size: 20px !important; padding: 8px 18px; }

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .container { padding: 12px; }
    .card { padding: 16px; }
    .quick-actions .btn { font-size: 14px; padding: 10px 14px; }
}