/* ===== CSS Variables ===== */
:root {
  --green: #2D8B4E;
  --green-light: #eaf7ef;
  --gold: #C9A84C;
  --gold-border: #D4C08A;
  --bg: #FBF7F0;
  --bg-card: #FCF9F3;
  --bg-card2: #faf3e0;
  --text: #2C2416;
  --text2: #6B6050;
  --text3: #A09888;
  --white: #fff;
  --red: #E55541;
  --orange: #E8913A;
  --blue: #3B82F6;
  --tab-h: 56px;
  --nav-h: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ===== Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif; background: var(--bg); color: var(--text); -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }

/* ===== App Shell ===== */
#app { height: 100%; display: flex; flex-direction: column; }
#app.has-tabbar { padding-bottom: var(--tab-h); }

/* ===== Views ===== */
.view { display: none; flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; position: relative; }
.view.active { display: flex; flex-direction: column; }

/* ===== Navigation Bar ===== */
.nav { display: flex; align-items: center; height: var(--nav-h); padding: 0 12px; background: var(--green); color: var(--white); position: sticky; top: 0; z-index: 100; flex-shrink: 0; padding-top: var(--safe-top); }
.nav-back { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.25); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nav-back img { width: 16px; height: 16px; }
.nav-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; }
.nav-spacer { width: 36px; flex-shrink: 0; }

/* ===== TabBar ===== */
.tabbar { display: flex; height: var(--tab-h); background: var(--white); border-top: 1px solid #eee; padding-bottom: var(--safe-bottom); flex-shrink: 0; }
.tabbar.hidden { display: none; }
.tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tab-icon { width: 24px; height: 24px; }
.tab-text { font-size: 11px; color: var(--text3); }
.tab-item.active .tab-text { color: var(--green); font-weight: 600; }

/* ===== Common Components ===== */
.bg-pattern { position: absolute; inset: 0; pointer-events: none; z-index: 0; }

/* AI生成标注 */
.ai-badge { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; margin: 12px 16px 0; background: rgba(45,139,78,0.06); border-radius: 10px; font-size: 13px; color: var(--text3); flex-shrink: 0; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 32px; border-radius: 24px; font-size: 16px; font-weight: 600; border: none; cursor: pointer; }
.btn-primary { background: var(--green); color: var(--white); }
.btn-outline { background: transparent; border: 1.5px solid var(--green); color: var(--green); }
.btn-gold { background: linear-gradient(135deg, #C9A84C, #D4B86A); color: var(--white); }
.btn-block { display: flex; width: 100%; }

/* 云纹装饰 */
.cloud-tl { position: absolute; top: 4px; left: 5px; width: 80px; height: 32px; opacity: 0.5; pointer-events: none; z-index: 0; }
.cloud-br { position: absolute; bottom: 3px; right: 5px; width: 80px; height: 32px; opacity: 0.3; pointer-events: none; z-index: 0; transform: scaleX(-1); }

/* 卡片 */
.card { position: relative; background: linear-gradient(135deg, var(--bg-card), var(--bg-card2)); border-radius: 12px; border: 1px solid var(--gold-border); overflow: hidden; }
.card-padded { padding: 22px; }

/* 分段标题 */
.section-label { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; }
.section-label img { width: 20px; height: 20px; opacity: 0.6; }
.section-label span { font-size: 14px; font-weight: 600; color: var(--text2); }

/* 功能宫格 */
.func-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px; }
.func-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px; background: var(--white); border-radius: 10px; border: 1px solid #f0ebe0; cursor: pointer; touch-action: manipulation; }
.func-item img { width: 32px; height: 32px; }
.func-item span { font-size: 13px; color: var(--text2); }

/* Toast */
.toast { position: fixed; top: 20%; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.75); color: #fff; padding: 10px 24px; border-radius: 20px; font-size: 14px; z-index: 9999; pointer-events: none; opacity: 0; transition: opacity 0.3s; }
.toast.show { opacity: 1; }

/* Loading */
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 0; color: var(--text3); }
.spinner { width: 32px; height: 32px; border: 3px solid #eee; border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Home Page ===== */
.header { position: relative; background: linear-gradient(135deg, #1F6B3A, var(--green)); padding: 20px 20px 50px; color: var(--white); overflow: hidden; flex-shrink: 0; }
.header-clouds { position: absolute; inset: 0; pointer-events: none; }
.header-clouds img { position: absolute; width: 80px; height: 32px; opacity: 0.3; }
.header-clouds .cloud-img-tl { top: 8px; left: 8px; }
.header-clouds .cloud-img-br { bottom: 8px; right: 8px; transform: scaleX(-1); }
.header-content { position: relative; z-index: 1; }
.brand-name { font-size: 26px; font-weight: 700; }
.brand-slogan { display: block; font-size: 13px; opacity: 0.8; margin-top: 4px; }

.hero-card { position: relative; margin: -38px 13px 12px; z-index: 2; flex-shrink: 0; cursor: pointer; touch-action: manipulation; }
.hero-card-inner { position: relative; display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, var(--bg-card), var(--bg-card2)); padding: 22px; border-radius: 12px; border: 1px solid var(--gold-border); overflow: hidden; }
.hero-left { display: flex; flex-direction: column; position: relative; z-index: 1; flex: 1; min-width: 0; }
.hero-badge { display: inline-block; background: var(--green); color: var(--white); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 10px; width: fit-content; margin-bottom: 8px; }
.hero-title { font-size: 21px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.hero-desc { font-size: 13px; color: var(--text2); }
.hero-disclaimer { display: block; font-size: 10px; color: var(--text3); margin-top: 4px; }
.hero-icon-img { width: 88px; height: 88px; flex-shrink: 0; border-radius: 12px; }

.ai-card { margin: 0 13px 12px; flex-shrink: 0; cursor: pointer; touch-action: manipulation; }
.ai-card-inner { position: relative; display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, var(--bg-card), var(--bg-card2)); padding: 18px; border-radius: 12px; border: 1px solid var(--gold-border); overflow: hidden; }
.ai-card-inner .ai-left img { width: 40px; height: 40px; }
.ai-title { display: block; font-size: 16px; font-weight: 600; color: var(--text); }
.ai-desc { display: block; font-size: 12px; color: var(--text3); margin-top: 3px; }

.kepu-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 12px; -webkit-overflow-scrolling: touch; flex-shrink: 0; }
.kepu-scroll::-webkit-scrollbar { display: none; }
.kepu-item { flex-shrink: 0; width: 120px; background: var(--white); border-radius: 10px; padding: 14px 12px; border: 1px solid #f0ebe0; }
.kepu-item img { width: 24px; height: 24px; margin-bottom: 6px; }
.kepu-item .kepu-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.kepu-item .kepu-tag { font-size: 10px; color: var(--text3); }

.about-footer { text-align: center; padding: 30px 20px 40px; flex-shrink: 0; }
.about-footer .brand { font-size: 15px; font-weight: 700; color: var(--green); }
.about-footer .desc { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ===== Tongue Entry Page ===== */
.tongue-hero { position: relative; text-align: center; padding: 40px 20px 30px; flex-shrink: 0; }
.hero-glow { display: flex; justify-content: center; margin-bottom: 16px; }
.hero-ring { width: 100px; height: 100px; border-radius: 50%; background: var(--green-light); border: 2px solid rgba(45,139,78,0.2); display: flex; align-items: center; justify-content: center; }
.hero-ring img { width: 70px; height: 70px; border-radius: 50%; }
.tongue-hero .hero-title { font-size: 22px; margin-bottom: 4px; }
.tongue-hero .hero-desc { font-size: 13px; color: var(--text3); }
.hero-stats { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 14px 0 0; }
.stat-item { text-align: center; }
.stat-num { display: block; font-size: 20px; font-weight: 700; color: var(--green); }
.stat-label { font-size: 10px; color: var(--text3); }
.stat-divider { width: 1px; height: 24px; background: #eee; }

.action-card { margin: 8px 16px; border-radius: 12px; overflow: hidden; }
.action-card.primary .card-inner { background: linear-gradient(135deg, var(--green), #1F6B3A); color: var(--white); }
.action-card .card-inner { position: relative; display: flex; align-items: center; padding: 16px; gap: 12px; }
.action-icon-wrap { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.action-body { flex: 1; min-width: 0; }
.action-name { font-size: 16px; font-weight: 600; }
.action-desc { font-size: 12px; opacity: 0.8; }
.action-arrow { font-size: 22px; opacity: 0.6; }

/* ===== Camera Page ===== */
.camera-wrap { position: relative; flex: 1; background: #000; overflow: hidden; display: flex; flex-direction: column; }
.camera-preview { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; }
.camera-preview video, .camera-preview canvas { width: 100%; height: 100%; object-fit: cover; }
.camera-overlay { position: absolute; inset: 0; pointer-events: none; }
.camera-frame { position: absolute; left: 10%; top: 15%; width: 80%; height: 60%; border: 2px solid rgba(255,255,255,0.5); border-radius: 20px; }
.camera-frame::before, .camera-frame::after { content: ''; position: absolute; width: 24px; height: 24px; border-color: var(--green); border-style: solid; }
.camera-frame::before { top: -2px; left: -2px; border-width: 3px 0 0 3px; border-radius: 8px 0 0 0; }
.camera-frame::after { top: -2px; right: -2px; border-width: 3px 3px 0 0; border-radius: 0 8px 0 0; }
.camera-frame-corner-bl { position: absolute; bottom: -2px; left: -2px; width: 24px; height: 24px; border: 3px solid var(--green); border-width: 0 0 3px 3px; border-radius: 0 0 0 8px; }
.camera-frame-corner-br { position: absolute; bottom: -2px; right: -2px; width: 24px; height: 24px; border: 3px solid var(--green); border-width: 0 3px 3px 0; border-radius: 0 0 8px 0; }
.camera-tip { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,0.7); font-size: 12px; line-height: 1.6; }

.camera-bar { display: flex; align-items: center; justify-content: center; gap: 30px; padding: 20px 0 30px; background: #000; flex-shrink: 0; padding-bottom: calc(30px + var(--safe-bottom)); }
.camera-btn { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--white); background: transparent; cursor: pointer; position: relative; }
.camera-btn::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: var(--white); }
.camera-btn.capture { width: 74px; height: 74px; }
.camera-btn-album { width: 40px; height: 40px; border-radius: 8px; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; }
.camera-btn-album img { width: 22px; height: 22px; }

/* ===== Questionnaire Page ===== */
.quest-list { padding: 0 16px; }
.quest-item { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 8px; background: var(--white); border-radius: 10px; border: 1.5px solid #eee; cursor: pointer; }
.quest-item.selected { border-color: var(--green); background: var(--green-light); }
.quest-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid #ccc; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.quest-item.selected .quest-check { background: var(--green); border-color: var(--green); }
.quest-check::after { content: '✓'; color: #fff; font-size: 13px; font-weight: 700; display: none; }
.quest-item.selected .quest-check::after { display: block; }
.quest-name { flex: 1; font-size: 15px; }

/* ===== Report Page ===== */
.report-header { background: linear-gradient(135deg, #1F6B3A, var(--green)); padding: 20px; color: var(--white); text-align: center; flex-shrink: 0; }
.report-score-wrap { position: relative; width: 120px; height: 120px; margin: 0 auto 10px; }
.report-score-ring { width: 100%; height: 100%; }
.report-score-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.report-score-num { font-size: 36px; font-weight: 700; }
.report-score-label { font-size: 11px; opacity: 0.8; }
.report-level { font-size: 14px; font-weight: 600; padding: 4px 16px; border-radius: 10px; display: inline-block; margin-bottom: 4px; }
.report-level.good { background: rgba(255,255,255,0.3); }
.report-level.caution { background: rgba(255,180,0,0.3); }
.report-meta { font-size: 11px; opacity: 0.7; margin-top: 4px; }

.report-tabs { display: flex; border-bottom: 1px solid #eee; position: sticky; top: 0; background: var(--bg); z-index: 10; flex-shrink: 0; }
.report-tab { flex: 1; text-align: center; padding: 12px 0; font-size: 14px; color: var(--text3); border-bottom: 2px solid transparent; cursor: pointer; }
.report-tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }

.report-tab-content { display: none; padding: 16px; }
.report-tab-content.active { display: block; }
.report-section { margin-bottom: 20px; }
.report-section-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 10px; padding-left: 8px; border-left: 3px solid var(--green); }

/* Organ Score Bar */
.organ-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.organ-icon { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--white); flex-shrink: 0; }
.organ-icon.heart { background: #E55541; }
.organ-icon.liver { background: #3B82F6; }
.organ-icon.spleen { background: #E8913A; }
.organ-icon.lung { background: #8BC34A; }
.organ-icon.kidney { background: #7C4DFF; }
.organ-bar-wrap { flex: 1; height: 10px; background: #eee; border-radius: 5px; overflow: hidden; }
.organ-bar { height: 100%; border-radius: 5px; transition: width 0.6s; }
.organ-bar.good { background: var(--green); }
.organ-bar.caution { background: var(--orange); }
.organ-bar.bad { background: var(--red); }
.organ-score { font-size: 13px; font-weight: 600; width: 36px; text-align: right; }
.organ-status { font-size: 11px; width: 40px; text-align: center; }

/* Meridian Grid */
.meridian-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.meridian-item { text-align: center; padding: 10px 4px; background: var(--white); border-radius: 8px; border: 1px solid #f0ebe0; }
.meridian-name { font-size: 12px; color: var(--text2); margin-bottom: 4px; }
.meridian-score { font-size: 15px; font-weight: 700; }
.meridian-score.good { color: var(--green); }
.meridian-score.caution { color: var(--orange); }

/* Recommendation Cards */
.rec-card { background: var(--white); border-radius: 10px; padding: 14px; margin-bottom: 8px; border: 1px solid #f0ebe0; }
.rec-card .rec-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.rec-card .rec-desc { font-size: 12px; color: var(--text2); line-height: 1.5; }

/* Radar Canvas */
.radar-wrap { width: 100%; max-width: 300px; margin: 0 auto; }

/* Report Footer Buttons */
.report-footer { display: flex; gap: 10px; padding: 16px; background: var(--white); border-top: 1px solid #eee; flex-shrink: 0; }
.report-footer .btn { flex: 1; }

/* ===== History Page ===== */
.history-item { margin: 8px 16px; background: var(--white); border-radius: 10px; padding: 14px; display: flex; align-items: center; gap: 12px; border: 1px solid #f0ebe0; cursor: pointer; }
.history-thumb { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.history-info { flex: 1; min-width: 0; }
.history-score { font-size: 18px; font-weight: 700; color: var(--green); }
.history-constitution { font-size: 13px; color: var(--text2); margin-top: 2px; }
.history-time { font-size: 11px; color: var(--text3); margin-top: 2px; }
.history-arrow { font-size: 18px; color: var(--text3); }

/* ===== Chat Page ===== */
.chat-report-head { padding: 12px 16px; background: var(--green-light); border-bottom: 1px solid #eee; display: flex; align-items: center; gap: 8px; font-size: 13px; flex-shrink: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px 16px; }
.chat-msg { margin-bottom: 14px; display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg .msg-bubble { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.chat-msg.assistant .msg-bubble { background: var(--white); border: 1px solid #eee; border-radius: 4px 14px 14px 14px; }
.chat-msg.user .msg-bubble { background: var(--green); color: var(--white); border-radius: 14px 4px 14px 14px; }
.chat-msg .msg-model { font-size: 10px; color: var(--text3); margin-top: 4px; }
.chat-quick { display: flex; gap: 8px; padding: 8px 16px; overflow-x: auto; border-top: 1px solid #eee; background: var(--white); flex-shrink: 0; }
.chat-quick-btn { flex-shrink: 0; padding: 6px 14px; border-radius: 16px; border: 1px solid var(--green); color: var(--green); font-size: 12px; background: var(--white); cursor: pointer; }
.chat-input-wrap { display: flex; gap: 8px; padding: 10px 16px; background: var(--white); border-top: 1px solid #eee; align-items: center; flex-shrink: 0; padding-bottom: calc(10px + var(--safe-bottom)); }
.chat-input-wrap input { flex: 1; padding: 10px 14px; border: 1px solid #eee; border-radius: 20px; font-size: 14px; outline: none; }
.chat-input-wrap input:focus { border-color: var(--green); }
.chat-send { width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: var(--white); border: none; font-size: 16px; cursor: pointer; flex-shrink: 0; }

/* ===== Login Page ===== */
.login-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; padding: 30px; }
.login-logo { width: 80px; height: 80px; border-radius: 50%; margin-bottom: 20px; }
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.login-subtitle { font-size: 13px; color: var(--text3); margin-bottom: 30px; }
.login-input { width: 100%; max-width: 300px; padding: 12px 16px; border: 1px solid #ddd; border-radius: 10px; font-size: 15px; margin-bottom: 12px; outline: none; }
.login-input:focus { border-color: var(--green); }
.login-agree { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text3); margin-bottom: 16px; }
.login-btn { width: 100%; max-width: 300px; }

/* ===== User Center ===== */
.user-header { background: linear-gradient(135deg, #1F6B3A, var(--green)); padding: 30px 20px; color: var(--white); text-align: center; flex-shrink: 0; }
.user-avatar { width: 64px; height: 64px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.3); margin-bottom: 8px; }
.user-name { font-size: 18px; font-weight: 600; }
.user-stats { display: flex; justify-content: center; gap: 20px; margin-top: 12px; font-size: 12px; opacity: 0.8; }
.user-menu { margin: -16px 16px 0; position: relative; z-index: 2; background: var(--white); border-radius: 12px; overflow: hidden; }
.user-menu-item { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid #f5f5f5; font-size: 14px; cursor: pointer; }
.user-menu-item:last-child { border-bottom: none; }
.user-menu-item img { width: 22px; height: 22px; margin-right: 12px; }
.user-menu-arrow { margin-left: auto; color: var(--text3); font-size: 16px; }

/* ===== Member ===== */
.member-card { margin: 20px 16px; background: linear-gradient(135deg, #2C2416, #4A3728); border-radius: 16px; padding: 24px; text-align: center; color: var(--gold); position: relative; overflow: hidden; }
.member-card .price { font-size: 42px; font-weight: 700; margin: 8px 0 4px; }
.member-card .price small { font-size: 18px; }
.member-card .orig { font-size: 13px; text-decoration: line-through; opacity: 0.5; }
.member-benefits { padding: 0 16px; }
.benefit-item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f5f5f5; font-size: 14px; }
.benefit-check { color: var(--green); font-weight: 700; font-size: 16px; }

/* ===== Profile ===== */
.profile-form { padding: 16px; }
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid #eee; border-radius: 8px; font-size: 15px; outline: none; }
.form-input:focus { border-color: var(--green); }
.form-radio { display: flex; gap: 16px; }
.form-radio label { display: flex; align-items: center; gap: 4px; font-size: 14px; cursor: pointer; }

/* ===== Message ===== */
.msg-tabs { display: flex; border-bottom: 1px solid #eee; flex-shrink: 0; }
.msg-tab { flex: 1; text-align: center; padding: 12px 0; font-size: 14px; color: var(--text3); cursor: pointer; }
.msg-tab.active { color: var(--green); font-weight: 600; border-bottom: 2px solid var(--green); }
.msg-list { padding: 0 16px; }
.msg-item { display: flex; gap: 10px; padding: 14px 0; border-bottom: 1px solid #f5f5f5; }
.msg-icon { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; }
.msg-body { flex: 1; min-width: 0; }
.msg-title { font-size: 14px; font-weight: 500; }
.msg-content { font-size: 12px; color: var(--text3); margin-top: 3px; }
.msg-time { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* ===== About ===== */
.about-content { padding: 20px 16px; line-height: 1.8; }
.about-content h2 { font-size: 18px; color: var(--green); margin: 16px 0 8px; }
.about-content h3 { font-size: 15px; margin: 12px 0 6px; }
.about-content p { font-size: 14px; color: var(--text2); margin-bottom: 8px; }
.about-content ul { padding-left: 20px; }
.about-content li { font-size: 14px; color: var(--text2); margin-bottom: 4px; }

/* ===== Kepu Detail ===== */
.kepu-detail-body { padding: 16px; line-height: 1.8; }
.kepu-detail-body h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.kepu-detail-body .meta { font-size: 12px; color: var(--text3); margin-bottom: 16px; }
.kepu-detail-body p { font-size: 14px; color: var(--text2); margin-bottom: 10px; }

/* ===== Service Page ===== */
.service-wrap { padding: 16px; }
.service-card { background: var(--white); border-radius: 10px; padding: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.service-card .icon { font-size: 28px; }
.service-card .name { font-size: 15px; font-weight: 600; }
.service-card .desc { font-size: 12px; color: var(--text3); margin-top: 2px; }
.form-textarea { width: 100%; height: 100px; padding: 10px; border: 1px solid #eee; border-radius: 8px; font-size: 14px; resize: vertical; outline: none; margin-top: 8px; }

/* ===== 健康方案 Health Page ===== */
.health-tabs { display: flex; border-bottom: 1px solid #eee; flex-shrink: 0; position: sticky; top: 0; background: var(--bg); z-index: 10; }
.health-tab { flex: 1; text-align: center; padding: 12px 0; font-size: 13px; color: var(--text3); cursor: pointer; }
.health-tab.active { color: var(--green); font-weight: 600; border-bottom: 2px solid var(--green); }
.health-panel { display: none; padding: 16px; }
.health-panel.active { display: block; }
.health-card { background: var(--white); border-radius: 10px; padding: 14px; margin-bottom: 10px; border: 1px solid #f0ebe0; }
.health-card .h-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.health-card .h-desc { font-size: 13px; color: var(--text2); line-height: 1.6; }
.tag-green { display: inline-block; padding: 2px 10px; background: var(--green-light); color: var(--green); border-radius: 10px; font-size: 11px; margin: 2px 4px 2px 0; }
.tag-red { display: inline-block; padding: 2px 10px; background: #fde8e8; color: var(--red); border-radius: 10px; font-size: 11px; margin: 2px 4px 2px 0; }

/* ===== 首页新增样式 ===== */
.hero-icon { flex-shrink: 0; position: relative; z-index: 1; }
.hero-icon-img { width: 100px; height: 100px; border-radius: 16px; }
.func-emoji { font-size: 28px; line-height: 1; }
.func-name { font-size: 12px; color: var(--text2); }
.footer-brand { text-align: center; padding: 24px 16px; flex-shrink: 0; }
.footer-brand p { font-size: 13px; font-weight: 600; color: var(--text); }
.footer-sub { font-size: 11px !important; color: var(--text3) !important; font-weight: 400 !important; }

/* ===== 服务页 ===== */
.service-list { padding: 0 16px; }
.service-card { display: flex; align-items: center; gap: 12px; background: var(--white); padding: 16px; margin-bottom: 10px; border-radius: 12px; border: 1px solid #f0ebe0; cursor: pointer; touch-action: manipulation; }
.svc-icon { font-size: 28px; flex-shrink: 0; width: 44px; text-align: center; }
.svc-info { flex: 1; min-width: 0; }
.svc-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.svc-desc { font-size: 12px; color: var(--text3); }
.svc-arrow { font-size: 18px; color: var(--text3); flex-shrink: 0; }

/* ===== 拍照页（新版 H5） ===== */
.camera-container { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.camera-frame { flex: 1; display: flex; align-items: center; justify-content: center; position: relative; background: #000; border-radius: 12px; overflow: hidden; margin-bottom: 16px; min-height: 320px; }
.camera-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.camera-hint-area { text-align: center; color: rgba(255,255,255,0.6); }
.camera-hint-ring { width: 96px; height: 96px; border-radius: 50%; border: 2px dashed rgba(255,255,255,0.3); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.camera-hint-icon { font-size: 36px; }
.camera-hint-text { font-size: 13px; }
.camera-hint-small { font-size: 12px; }
.camera-actions { display: flex; gap: 12px; padding: 0 16px 16px; }
.camera-actions .btn { flex: 1; }

/* ===== 问卷页（新版） ===== */
.q-container { padding: 0 16px; }
.q-block { background: var(--white); border-radius: 10px; padding: 14px; margin-bottom: 10px; border: 1px solid #f0ebe0; }
.q-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.q-options { display: flex; flex-wrap: wrap; gap: 8px; }
.q-option { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text2); padding: 6px 12px; background: #f9f7f2; border-radius: 8px; cursor: pointer; }

/* ===== 报告页（新版简洁化） ===== */
.report-header { background: var(--green); padding: 20px; color: var(--white); flex-shrink: 0; }
.report-img-wrap { text-align: center; margin-bottom: 12px; }
.report-img { max-width: 180px; max-height: 180px; border-radius: 12px; display: block; margin: 0 auto; }
.report-score { text-align: center; }
.score-num { font-size: 48px; font-weight: 700; }
.score-unit { font-size: 16px; margin-left: 2px; }
.score-label { display: block; font-size: 14px; opacity: 0.85; }
.report-type { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; background: var(--green-light); margin: 0 16px; border-radius: 10px; }
.type-label { font-size: 13px; color: var(--text2); }
.type-value { font-size: 16px; font-weight: 700; color: var(--green); }
.report-btns { display: flex; gap: 10px; padding: 16px; flex-shrink: 0; }
.report-btns .btn { flex: 1; }

/* 分析维度条 */
.dims-container { padding: 0 16px; }
.dim-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.dim-label { font-size: 13px; color: var(--text2); width: 44px; flex-shrink: 0; }
.dim-track { flex: 1; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; }
.dim-fill { height: 100%; border-radius: 4px; transition: width 0.6s; }
.dim-val { font-size: 13px; font-weight: 600; color: var(--text); width: 30px; text-align: right; }

/* 建议卡片 */
.advice-card { margin: 0 16px 16px; }
.advice-item { background: var(--white); border-radius: 10px; padding: 16px; border: 1px solid #f0ebe0; font-size: 14px; line-height: 1.7; color: var(--text2); }

/* ===== 历史记录（新版） ===== */
.list-container { padding: 0 16px; }
.history-card { display: flex; align-items: center; gap: 12px; background: var(--white); padding: 14px; margin-bottom: 8px; border-radius: 10px; border: 1px solid #f0ebe0; cursor: pointer; touch-action: manipulation; }
.h-left { flex: 1; min-width: 0; }
.h-type { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.h-date { font-size: 12px; color: var(--text3); }
.h-score { font-size: 20px; font-weight: 700; flex-shrink: 0; }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 14px; color: var(--text3); }

/* ===== AI问答 ===== */
.aiask-input-area { padding: 0 16px; }
.aiask-textarea { width: 100%; padding: 12px; border: 1px solid #eee; border-radius: 10px; font-size: 14px; resize: vertical; outline: none; }
.aiask-textarea:focus { border-color: var(--green); }
.aiask-result { padding: 0 16px 16px; }

/* ===== 聊天（新版简化） ===== */
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
.chat-msg { margin-bottom: 14px; display: flex; }
.msg-user { justify-content: flex-end; }
.msg-bot { justify-content: flex-start; }
.msg-bubble { max-width: 80%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.msg-user .msg-bubble { background: var(--green); color: var(--white); border-radius: 14px 4px 14px 14px; }
.msg-bot .msg-bubble { background: var(--white); border: 1px solid #eee; border-radius: 4px 14px 14px 14px; }
.chat-input-bar { display: flex; gap: 8px; padding: 10px 16px; background: var(--white); border-top: 1px solid #eee; align-items: center; flex-shrink: 0; }
.chat-input { flex: 1; padding: 10px 14px; border: 1px solid #eee; border-radius: 20px; font-size: 14px; outline: none; }
.chat-input:focus { border-color: var(--green); }
.chat-send-btn { width: 56px; padding: 10px 0; border-radius: 20px; background: var(--green); color: var(--white); border: none; font-size: 14px; font-weight: 600; cursor: pointer; flex-shrink: 0; }

/* ===== 科普 ===== */
.kepu-card { display: flex; align-items: center; gap: 12px; background: var(--white); padding: 16px; margin-bottom: 10px; border-radius: 12px; border: 1px solid #f0ebe0; cursor: pointer; touch-action: manipulation; }
.kepu-icon { font-size: 32px; flex-shrink: 0; width: 44px; text-align: center; }
.kepu-info { flex: 1; min-width: 0; }
.kepu-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.kepu-desc { font-size: 12px; color: var(--text3); line-height: 1.4; }
.kepu-tag { font-size: 10px; background: var(--green-light); color: var(--green); padding: 2px 8px; border-radius: 8px; flex-shrink: 0; }

/* ===== 科普详情 ===== */
.article-card { margin: 16px; background: var(--white); border-radius: 12px; padding: 20px; border: 1px solid #f0ebe0; }
.article-tag { display: inline-block; background: var(--green-light); color: var(--green); padding: 2px 10px; border-radius: 10px; font-size: 11px; margin-bottom: 12px; }
.article-content { font-size: 14px; line-height: 1.8; color: var(--text2); }
.article-content p { margin-bottom: 12px; }

/* ===== 登录页（新版） ===== */
.login-container { display: flex; flex-direction: column; align-items: center; flex: 1; padding: 30px 24px; }
.login-logo { font-size: 60px; margin-bottom: 12px; }
.login-brand { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--text3); margin-bottom: 30px; }
.login-form { width: 100%; max-width: 320px; }
.login-input { width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 10px; font-size: 15px; margin-bottom: 12px; outline: none; }
.login-input:focus { border-color: var(--green); }

/* ===== 用户中心（新版） ===== */
.user-header { background: linear-gradient(135deg, #1F6B3A, var(--green)); padding: 30px 20px; color: var(--white); text-align: center; flex-shrink: 0; }
.user-avatar { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 12px; border: 3px solid rgba(255,255,255,0.3); }
.user-name { font-size: 18px; font-weight: 600; }
.user-menu { margin: -16px 16px 0; position: relative; z-index: 2; background: var(--white); border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.menu-item { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #f5f5f5; font-size: 14px; cursor: pointer; touch-action: manipulation; }
.menu-item:last-child { border-bottom: none; }
.menu-arrow { color: var(--text3); }

/* ===== 个人资料（新版） ===== */
.profile-form { padding: 16px; }
.pf-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pf-label { font-size: 14px; color: var(--text2); width: 64px; flex-shrink: 0; }
.pf-input { flex: 1; padding: 10px 14px; border: 1px solid #eee; border-radius: 8px; font-size: 14px; outline: none; }
.pf-input:focus { border-color: var(--green); }

/* ===== 会员（新版） ===== */
.member-card { margin: 16px; background: linear-gradient(135deg, #2C2416, #4A3728); border-radius: 16px; padding: 24px; text-align: center; color: var(--gold); }
.member-level { font-size: 13px; opacity: 0.7; margin-bottom: 4px; }
.member-desc { font-size: 14px; }
.member-benefits { padding: 0 16px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mb-item { background: var(--white); border-radius: 10px; padding: 14px; text-align: center; border: 1px solid #f0ebe0; }
.mb-icon { font-size: 28px; display: block; margin-bottom: 6px; }
.mb-name { font-size: 13px; font-weight: 600; color: var(--text); display: block; margin-bottom: 2px; }
.mb-desc { font-size: 11px; color: var(--text3); }

/* ===== 关于（新版） ===== */
.about-container { padding: 20px 16px; text-align: center; }
.about-logo { font-size: 48px; margin-bottom: 8px; }
.about-name { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.about-ver { font-size: 12px; color: var(--text3); margin-bottom: 8px; }
.about-desc { font-size: 13px; color: var(--text2); margin-bottom: 24px; }
.about-section { text-align: left; margin-bottom: 20px; }
.as-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.as-content { font-size: 13px; color: var(--text2); line-height: 1.7; }
.about-copy { font-size: 11px; color: var(--text3); margin-top: 24px; }

/* ===== Loading ===== */
.loading-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 0; }
.loading-spinner { width: 32px; height: 32px; border: 3px solid #eee; border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 12px; }
.loading-text { font-size: 13px; color: var(--text3); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Responsive ===== */
@media (min-width: 768px) {
  #app { max-width: 450px; margin: 0 auto; border-left: 1px solid #eee; border-right: 1px solid #eee; }
  .hero-card { margin: -38px 20px 12px; }
  .ai-card { margin: 0 20px 12px; }
  .action-card { margin: 8px 20px; }
  .func-grid { padding: 0 20px; }
}
