:root {
  --warm-pink: #F2A0B3;
  --warm-pink-dark: #E8839A;
  --warm-pink-light: #FBD5DE;
  --coral: #F0967D;
  --coral-light: #FAD4C8;

  --bg-warm: #FFF8F0;
  --bg-card: #FFFFFF;
  --bg-card2: #FFF5EE;
  --bg-secondary: #FEF0E8;
  --bg-input: #FFF5EE;

  --text-primary: #4A3728;
  --text-secondary: #7A6558;
  --text-muted: #A89888;
  --text-on-pink: #FFFFFF;

  --color-success: #7BC67E;
  --color-success-light: #E8F5E9;
  --color-warning: #F5B041;
  --color-warning-light: #FFF8E1;
  --color-danger: #E8839A;
  --color-danger-light: #FBD5DE;
  --color-info: #7EB5D6;
  --color-info-light: #E3F2FD;

  --border: #F0E0D0;
  --border-dark: #E0D0C0;
  --shadow-card: 0 2px 12px rgba(180,140,110,0.1);
  --shadow-btn: 0 4px 16px rgba(242,160,179,0.3);
  --shadow-overlay: 0 8px 32px rgba(180,140,110,0.15);

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-warm);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}

.page { display: none; min-height: 100vh; padding-bottom: 30px; background: var(--bg-warm); }
.page.active { display: block; animation: fadeInUp 0.35s ease; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatGentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 4px 16px rgba(242,160,179,0.3); }
  50% { box-shadow: 0 4px 24px rgba(242,160,179,0.5); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: var(--bg-card);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
}
.page-header h2 { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.header-right { min-width: 40px; text-align: right; }
.back-btn { background: none; border: none; font-size: 22px; color: var(--warm-pink); cursor: pointer; padding: 4px 8px; min-width: 40px; }
.icon-btn { background: none; border: none; font-size: 20px; cursor: pointer; padding: 4px; }

/* ===== 登录页 ===== */
.login-container {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 40px 24px; position: relative; overflow: hidden;
  background: var(--bg-warm);
  background-image: radial-gradient(ellipse at 50% 30%, #FBD5DE 0%, #FFF8F0 70%);
}
.login-decor { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; }
.floating-leaf { position: absolute; font-size: 28px; opacity: 0.4; animation: floatGentle 6s ease-in-out infinite; }
.leaf-1 { top: 10%; left: 10%; animation-delay: 0s; }
.leaf-2 { top: 20%; right: 15%; animation-delay: 2s; font-size: 22px; }
.leaf-3 { bottom: 25%; left: 20%; animation-delay: 4s; font-size: 18px; }

.login-header { text-align: center; margin-bottom: 36px; position: relative; z-index: 1; }
.login-logo-wrap {
  width: 80px; height: 80px; margin: 0 auto 16px;
  background: var(--warm-pink-light); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.logo-taiji { font-size: 40px; }

.login-title {
  font-size: 32px; font-weight: 800; color: var(--warm-pink);
  letter-spacing: 4px; margin-bottom: 8px;
}
.login-subtitle { font-size: 18px; color: var(--text-secondary); margin-bottom: 6px; }
.login-hook { font-size: 14px; color: var(--text-muted); }

.login-form { width: 100%; max-width: 380px; position: relative; z-index: 1; }
.form-group { margin-bottom: 16px; }
.form-group input {
  width: 100%; padding: 16px 18px; border: 1px solid var(--border);
  border-radius: var(--radius-md); font-size: 16px;
  background: var(--bg-card); color: var(--text-primary); transition: all 0.3s;
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group input:focus { outline: none; border-color: var(--warm-pink); box-shadow: 0 0 0 3px var(--warm-pink-light); }

.code-group { display: flex; gap: 12px; }
.code-group input { flex: 1; }
.btn-code {
  white-space: nowrap; padding: 16px 18px; background: var(--bg-card);
  color: var(--warm-pink); border: 1px solid var(--warm-pink-light);
  border-radius: var(--radius-md); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all 0.3s;
}
.btn-code:disabled { background: var(--bg-card2); color: var(--text-muted); border-color: var(--border); cursor: not-allowed; }

.btn-primary {
  width: 100%; padding: 16px;
  background: linear-gradient(135deg, var(--warm-pink-dark), var(--warm-pink));
  color: var(--text-on-pink); border: none; border-radius: var(--radius-md);
  font-size: 17px; font-weight: 800; cursor: pointer; transition: all 0.3s;
  letter-spacing: 1px;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { background: var(--text-muted); cursor: not-allowed; transform: none; }
.btn-glow { box-shadow: var(--shadow-btn); }
.btn-breathe:not(:disabled) { animation: breathe 3s ease-in-out infinite; }

.btn-secondary {
  width: 100%; padding: 14px; background: transparent;
  color: var(--warm-pink); border: 1px solid var(--warm-pink-light);
  border-radius: var(--radius-md); font-size: 16px; cursor: pointer; transition: all 0.3s;
}
.btn-mega { padding: 20px; font-size: 20px; border-radius: var(--radius-lg); position: relative; }
.btn-sub { display: block; font-size: 13px; font-weight: 400; opacity: 0.85; margin-top: 4px; letter-spacing: 0; }

.login-trust {
  margin-top: 28px; display: flex; gap: 16px; justify-content: center;
  color: var(--text-muted); font-size: 12px; position: relative; z-index: 1;
}

/* ===== 首页 ===== */
.home-content { padding: 0 0 30px; }

.hero-banner {
  position: relative; padding: 40px 24px 30px; overflow: hidden;
  background: linear-gradient(160deg, #FBD5DE 0%, #FFF5EE 100%);
  border-bottom: 1px solid var(--border);
}
.hero-text { position: relative; z-index: 2; }
.hero-badge {
  display: inline-block; padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--warm-pink-light); color: var(--warm-pink);
  font-size: 13px; font-weight: 700; margin-bottom: 16px;
  border: 1px solid rgba(242,160,179,0.3);
}
.hero-headline { font-size: 28px; font-weight: 800; line-height: 1.4; margin-bottom: 12px; color: var(--text-primary); }
.highlight { color: var(--warm-pink); }
.hero-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.8; }

.hero-visual {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-size: 64px; opacity: 0.5;
}
.tongue-anim { animation: floatGentle 6s ease-in-out infinite; }
.scan-line {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--warm-pink), transparent);
  animation: scanDown 2s ease-in-out infinite; opacity: 0.4;
}
@keyframes scanDown {
  0% { top: 0; opacity: 0; }
  20% { opacity: 0.4; }
  80% { opacity: 0.4; }
  100% { top: 100%; opacity: 0; }
}

.home-cta { padding: 24px 20px 0; }
.bottom-cta { padding: 0 20px; }

.pain-points {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 24px 20px 0;
}
.pain-item {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; background: var(--bg-card);
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  box-shadow: var(--shadow-card); transition: all 0.3s;
}
.pain-item:active { transform: scale(0.97); border-color: var(--warm-pink-light); }
.pain-icon { font-size: 24px; }
.pain-text { font-size: 14px; color: var(--text-secondary); font-weight: 600; }

.section-title {
  font-size: 18px; font-weight: 800; color: var(--text-primary);
  margin-bottom: 16px; padding: 0 20px;
}

.how-it-works { padding: 28px 0 0; }
.steps {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 0 16px; overflow-x: auto;
}
.step-card {
  flex: 0 0 auto; min-width: 100px; text-align: center;
  padding: 16px 12px; background: var(--bg-card);
  border-radius: var(--radius-md); border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--warm-pink); color: var(--text-on-pink);
  font-size: 13px; font-weight: 800; display: flex;
  align-items: center; justify-content: center; margin: 0 auto 8px;
}
.step-icon { font-size: 28px; margin-bottom: 6px; }
.step-title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.step-desc { font-size: 11px; color: var(--text-muted); }
.step-arrow { color: var(--warm-pink-light); font-size: 18px; flex-shrink: 0; }

.schemes-preview { padding: 28px 0 0; }
.scheme-preview-card {
  margin: 0 20px 12px; padding: 20px; border-radius: var(--radius-lg);
  position: relative; overflow: hidden; box-shadow: var(--shadow-card);
}
.scheme-preview-card.sanfu {
  background: linear-gradient(135deg, #FEF0E8 0%, #FFFFFF 100%);
  border: 1px solid var(--coral-light);
  border-left: 4px solid var(--coral);
}
.scheme-preview-card.biyan {
  background: linear-gradient(135deg, #E8F5E9 0%, #FFFFFF 100%);
  border: 1px solid var(--color-success-light);
  border-left: 4px solid var(--color-success);
}
.scheme-badge {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 700; margin-bottom: 8px;
}
.sanfu .scheme-badge { background: var(--coral-light); color: var(--coral); }
.biyan .scheme-badge { background: var(--color-success-light); color: var(--color-success); }
.scheme-preview-card h4 { font-size: 17px; color: var(--text-primary); margin-bottom: 6px; font-weight: 700; }
.scheme-preview-card p { font-size: 13px; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.6; }
.scheme-tag {
  display: inline-block; padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
  background: var(--color-success-light); color: var(--color-success);
  border: 1px solid rgba(123,198,126,0.3);
}

.social-proof {
  text-align: center; padding: 30px 20px; color: var(--text-muted); font-size: 13px;
}
.social-proof strong { color: var(--warm-pink); font-size: 20px; }
.stars { font-size: 16px; margin: 8px 0; }
.review { font-style: italic; color: var(--text-secondary); margin-top: 8px; }

/* ===== 分析页 ===== */
.analysis-content { padding: 20px; }
.upload-section { margin-bottom: 16px; }
.upload-area {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 20px; border: 1px solid var(--border); margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.upload-label {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; font-size: 16px; font-weight: 700;
}
.upload-icon { font-size: 24px; }
.required { color: var(--warm-pink); font-size: 12px; font-weight: 400; }
.optional { color: var(--color-success); font-size: 12px; font-weight: 400; }

.upload-preview {
  width: 100%; min-height: 100px; border: 2px dashed var(--warm-pink-light);
  border-radius: var(--radius-md); display: flex; align-items: center;
  justify-content: center; margin-bottom: 12px; overflow: hidden;
  background: var(--bg-card2);
}
.upload-preview img { max-width: 100%; max-height: 180px; object-fit: contain; }
.placeholder-text { color: var(--text-muted); font-size: 14px; }

.upload-actions { display: flex; gap: 10px; }
.btn-upload {
  flex: 1; padding: 12px; background: var(--bg-card2);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-size: 14px; cursor: pointer; color: var(--text-secondary); transition: all 0.3s;
}
.btn-upload:active { background: var(--warm-pink-light); color: var(--warm-pink); border-color: var(--warm-pink); }

.upload-divider {
  text-align: center; color: var(--warm-pink-light); font-size: 24px; font-weight: 800;
  margin: 4px 0;
}

.analysis-tip {
  text-align: center; color: var(--warm-pink); font-size: 14px;
  margin-bottom: 20px; padding: 14px;
  background: var(--warm-pink-light); border-radius: var(--radius-md);
  border: 1px solid rgba(242,160,179,0.3);
}

/* ===== 分析中 ===== */
.overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,248,240,0.92); display: flex; align-items: center;
  justify-content: center; z-index: 1000;
}
.analyzing-content {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 40px 32px; text-align: center; max-width: 340px; width: 90%;
  border: 1px solid var(--border); box-shadow: var(--shadow-overlay);
}
.analyzing-spinner {
  width: 52px; height: 52px; border: 3px solid var(--warm-pink-light);
  border-top-color: var(--warm-pink); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 20px;
}
.analyzing-content h3 { margin-bottom: 8px; color: var(--warm-pink); font-size: 17px; }
.analyzing-content p { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.analyzing-steps { text-align: left; }
.analyzing-steps .step {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; font-size: 14px; color: var(--text-muted); transition: all 0.3s;
}
.analyzing-steps .step.active { color: var(--warm-pink); font-weight: 700; }
.step-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); flex-shrink: 0; transition: all 0.3s;
}
.analyzing-steps .step.active .step-dot { background: var(--warm-pink); box-shadow: 0 0 8px rgba(242,160,179,0.5); }

/* ===== 报告页 ===== */
.report-content { padding: 20px; }
.report-section {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 20px; margin-bottom: 16px; border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.report-section h3 {
  font-size: 16px; color: var(--text-primary); margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.radar-chart-container { width: 100%; max-width: 320px; margin: 0 auto; }
.radar-chart-container canvas { width: 100% !important; height: auto !important; }

.report-section.main-result {
  text-align: center; padding: 32px 20px;
  background: linear-gradient(160deg, #FBD5DE 0%, #FFFFFF 100%);
  border: 1px solid var(--warm-pink-light);
}
.result-badge {
  display: inline-block; padding: 6px 16px; border-radius: var(--radius-pill);
  background: var(--warm-pink-light); color: var(--warm-pink);
  font-size: 13px; font-weight: 700; margin-bottom: 16px;
  border: 1px solid rgba(242,160,179,0.3);
}
.result-emoji { font-size: 56px; margin-bottom: 12px; animation: floatGentle 6s ease-in-out infinite; }
.result-name {
  font-size: 36px; font-weight: 900; color: var(--warm-pink);
  margin-bottom: 8px; letter-spacing: 4px;
}
.result-score { font-size: 15px; color: var(--text-secondary); }
.result-score strong { color: var(--warm-pink); font-size: 22px; }

.organ-indicators { display: flex; flex-direction: column; gap: 12px; }
.organ-item { display: flex; align-items: center; gap: 12px; }
.organ-name { min-width: 70px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.organ-bar { flex: 1; height: 8px; background: var(--warm-pink-light); border-radius: var(--radius-pill); overflow: hidden; }
.organ-bar-fill { height: 100%; border-radius: var(--radius-pill); transition: width 0.8s cubic-bezier(0.16,1,0.3,1); }
.organ-value { min-width: 36px; text-align: right; font-size: 13px; color: var(--text-muted); }

.warning-list { display: flex; flex-direction: column; gap: 8px; }
.warning-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-pill); font-size: 14px;
}
.warning-item.level-high { background: var(--color-danger-light); color: var(--color-danger); }
.warning-item.level-medium { background: var(--color-warning-light); color: var(--color-warning); }
.warning-item.level-low { background: var(--color-success-light); color: var(--color-success); }

.view-scheme-btn {
  width: 100%; padding: 20px;
  background: linear-gradient(135deg, var(--warm-pink-dark), var(--warm-pink));
  color: var(--text-on-pink); border: none; border-radius: var(--radius-lg);
  font-size: 18px; font-weight: 800; cursor: pointer; margin-top: 16px;
  box-shadow: var(--shadow-btn);
}
.view-scheme-btn .btn-sub {
  display: block; font-size: 13px; font-weight: 400; opacity: 0.85; margin-top: 4px;
  letter-spacing: 0;
}

/* ===== 调理方案页 ===== */
.scheme-content { padding: 20px; }
.scheme-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 24px; margin-bottom: 16px; border: 1px solid var(--border);
  overflow: hidden; position: relative; box-shadow: var(--shadow-card);
}
.scheme-card-sanfu {
  border-left: 4px solid var(--coral);
  background: linear-gradient(135deg, #FEF0E8 0%, #FFFFFF 100%);
  border-top: 1px solid var(--coral-light); border-right: 1px solid var(--coral-light);
  border-bottom: 1px solid var(--coral-light);
}
.scheme-card-biyan {
  border-left: 4px solid var(--color-success);
  background: linear-gradient(135deg, #E8F5E9 0%, #FFFFFF 100%);
  border-top: 1px solid var(--color-success-light); border-right: 1px solid var(--color-success-light);
  border-bottom: 1px solid var(--color-success-light);
}
.scheme-card-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.scheme-icon { font-size: 28px; }
.scheme-card h3 {
  font-size: 20px; color: var(--text-primary); font-weight: 800; margin: 0;
}
.scheme-adaptability { margin-bottom: 14px; }
.adaptability-tag {
  display: inline-block; padding: 5px 14px;
  border-radius: var(--radius-pill); font-size: 13px; font-weight: 800; letter-spacing: 1px;
}
.scheme-reason {
  padding: 16px; border-radius: var(--radius-md); margin: 14px 0;
  font-size: 15px; line-height: 1.7; font-weight: 600;
}
.scheme-card-sanfu .scheme-reason {
  background: var(--coral-light); color: var(--coral);
  border: 1px solid rgba(240,150,125,0.3);
}
.scheme-card-biyan .scheme-reason {
  background: var(--color-success-light); color: var(--color-success);
  border: 1px solid rgba(123,198,126,0.3);
}
.reason-label, .details-label {
  font-size: 14px; font-weight: 800; color: var(--warm-pink);
  margin-bottom: 10px; letter-spacing: 1px;
}
.scheme-details { margin-top: 14px; }
.scheme-detail-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.scheme-detail-item:last-child { border-bottom: none; }
.scheme-detail-item .detail-name { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.scheme-detail-item .detail-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }

/* ===== 历史报告页 ===== */
.history-content { padding: 20px; }
.history-item {
  background: var(--bg-card); border-radius: var(--radius-md);
  padding: 16px; margin-bottom: 12px; border: 1px solid var(--border);
  cursor: pointer; transition: all 0.3s; box-shadow: var(--shadow-card);
}
.history-item:active { transform: scale(0.97); border-color: var(--warm-pink); }
.history-date { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.history-constitution { font-size: 17px; font-weight: 700; color: var(--warm-pink); margin-bottom: 8px; }
.history-tags { display: flex; gap: 8px; }
.history-tag {
  padding: 3px 10px; border-radius: var(--radius-pill); font-size: 12px;
  background: var(--color-success-light); color: var(--color-success);
  border: 1px solid rgba(123,198,126,0.3);
}

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { margin-bottom: 16px; }

/* ===== 个人中心 ===== */
.profile-content { padding: 20px; }
.profile-info {
  text-align: center; padding: 40px 20px;
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border); margin-bottom: 20px; box-shadow: var(--shadow-card);
}
.profile-avatar { font-size: 48px; margin-bottom: 12px; }
.profile-phone { font-size: 18px; color: var(--text-primary); }
.profile-actions { display: flex; flex-direction: column; gap: 12px; }
.profile-menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; background: var(--bg-card);
  border-radius: var(--radius-md); border: 1px solid var(--border);
  font-size: 16px; color: var(--text-primary); cursor: pointer; width: 100%; text-align: left;
  box-shadow: var(--shadow-card);
}
.profile-menu-item.logout { color: var(--color-danger); border-color: var(--color-danger-light); }

/* ===== 分享页 ===== */
.share-content { padding: 20px; }
.share-link-box {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 24px; border: 1px solid var(--border); box-shadow: var(--shadow-card);
}
.share-link-box h3 { color: var(--warm-pink); margin-bottom: 12px; }
.share-link-input { display: flex; gap: 8px; margin-top: 12px; }
.share-link-input input {
  flex: 1; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius-md); font-size: 14px;
  background: var(--bg-card2); color: var(--text-primary);
}
.share-link-input button {
  padding: 12px 18px; background: var(--warm-pink); color: var(--text-on-pink);
  border: none; border-radius: var(--radius-md); font-size: 14px;
  font-weight: 700; cursor: pointer;
}

/* ===== Toast ===== */
.toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  padding: 14px 28px; background: rgba(255,255,255,0.95); color: var(--warm-pink);
  border-radius: var(--radius-md); font-size: 14px; z-index: 2000;
  border: 1px solid var(--warm-pink-light); animation: fadeInUp 0.3s ease;
  box-shadow: var(--shadow-overlay);
}

/* ===== 响应式 ===== */
@media (max-width: 375px) {
  body { font-size: 13px; }
  .hero-headline { font-size: 24px; }
  .btn-mega { padding: 16px; font-size: 18px; }
}

@media (min-width: 415px) and (max-width: 768px) {
  .hero-headline { font-size: 30px; }
}

@media (min-width: 769px) {
  .page { max-width: 480px; margin: 0 auto; }
}
