/* ============================================================
   Artisanal Wealth · Shared Design System
   cici · 保单儿 · H5 工具集
   ============================================================ */

:root {
  /* Brand */
  --midnight: #0A111F;
  --midnight-soft: #151b2a;
  --gold: #D4AF37;
  --gold-soft: #e9c349;
  --gold-bg: #fef7e0;
  --cloud: #fbf9f8;
  --paper: #ffffff;
  --paper-2: #f5f3f3;
  --paper-3: #efeded;

  /* Text */
  --ink: #1b1c1c;
  --ink-2: #45474c;
  --ink-3: #76777d;
  --ink-4: #a8a9ad;
  --ink-5: #c6c6cc;

  /* Lines */
  --line: rgba(10, 17, 31, 0.08);
  --line-2: rgba(10, 17, 31, 0.04);

  /* Semantic */
  --ok: #5d8a5d;
  --ok-bg: rgba(93, 138, 93, 0.08);
  --warn: #b08940;
  --warn-bg: rgba(176, 137, 64, 0.08);
  --bad: #a64545;
  --bad-bg: rgba(166, 69, 69, 0.08);

  /* Accent */
  --accent: var(--gold);
  --accent-text: #735c00;

  /* Type */
  --serif: 'Noto Serif SC', 'Noto Serif', 'Songti SC', 'PingFang SC', Georgia, serif;
  --sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;

  /* Radius */
  --r-sm: 0.5rem;
  --r-md: 0.75rem;
  --r-lg: 1rem;
  --r-xl: 1.5rem;

  /* Shadow */
  --shadow-paper: 0 40px 80px -20px rgba(21, 27, 42, 0.08);
  --shadow-paper-sm: 0 12px 32px -8px rgba(21, 27, 42, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--cloud);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: 0; }
input, select, textarea { font-family: inherit; font-size: inherit; }
img { max-width: 100%; display: block; }

/* Material Symbols */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 200, 'GRAD' 0, 'opsz' 24;
}

/* Type primitives */
.t-display  { font-family: var(--serif); font-size: 40px; font-weight: 400; line-height: 1.15; letter-spacing: -0.01em; }
.t-headline { font-family: var(--serif); font-size: 28px; font-weight: 400; line-height: 1.25; }
.t-title    { font-family: var(--serif); font-size: 22px; font-weight: 500; line-height: 1.3; }
.t-body-lg  { font-family: var(--sans); font-size: 16px; line-height: 1.6; letter-spacing: 0.02em; color: var(--ink-2); }
.t-body     { font-family: var(--sans); font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.t-caps     { font-family: var(--sans); font-size: 11px; font-weight: 600; line-height: 1; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-4); }
.t-mono     { font-feature-settings: 'tnum'; font-variant-numeric: tabular-nums; }

/* ============================================================
   Layout
   ============================================================ */
.app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  padding-bottom: 120px;
}
@media (min-width: 768px) {
  body {
    background:
      radial-gradient(at 20% 20%, rgba(212,175,55,0.04), transparent 50%),
      radial-gradient(at 80% 80%, rgba(10,17,31,0.03), transparent 50%),
      var(--cloud);
  }
  .app {
    max-width: 480px;
    box-shadow: 0 0 80px rgba(10,17,31,0.04);
    background: var(--cloud);
    min-height: 100vh;
  }
}

/* ============================================================
   Top Bar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 249, 248, 0.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-icon {
  cursor: pointer;
  color: var(--midnight);
  transition: opacity 0.2s;
}
.topbar-icon:active { opacity: 0.5; }
.brand-mark {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--midnight);
  text-transform: uppercase;
}
.brand-mark .dot { color: var(--gold); margin: 0 4px; }
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1b2030, #0A111F);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(10,17,31,0.15);
}
.back-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--midnight);
  border-radius: 50%;
  margin-left: -6px;
  transition: background 0.2s;
}
.back-btn:active { background: var(--paper-2); }

/* ============================================================
   Tool Page Layout
   ============================================================ */
main { padding: 28px 24px 48px; }

.tool-head { margin-bottom: 32px; text-align: left; }
.tool-head .label {
  color: var(--accent-text);
  margin-bottom: 14px;
}
.tool-head .name {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
  color: var(--midnight);
  margin-bottom: 10px;
}
.tool-head .desc {
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.6;
}

/* ============================================================
   Card
   ============================================================ */
.card {
  background: var(--paper);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-paper-sm);
}
.card-title {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--midnight);
  font-weight: 500;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--gold);
  border-radius: 2px;
}

/* ============================================================
   Form · 输入字段
   ============================================================ */
.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }
.field-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-bottom: 10px;
  font-weight: 500;
}
.field-input,
.field-select {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  background: var(--paper-2);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--ink);
  font-size: 16px;
  font-family: var(--sans);
  transition: border-color 0.2s, background 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
.field-input:focus,
.field-select:focus {
  outline: 0;
  border-color: var(--gold);
  background: var(--paper);
}
.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2376777d' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 44px;
  cursor: pointer;
}
.field-hint {
  font-size: 12px;
  color: var(--ink-4);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.chip {
  padding: 8px 16px;
  background: var(--paper-2);
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s;
}
.chip:active { transform: scale(0.97); }
.chip.active {
  background: var(--midnight);
  color: var(--paper);
  border-color: var(--midnight);
}

/* Tabs (mode switcher) */
.tabs {
  display: flex;
  background: var(--paper-2);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 24px;
}
.tab {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
  border-radius: 999px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.tab.active {
  background: var(--midnight);
  color: var(--paper);
  font-weight: 600;
}

/* CTA Button */
.btn-cta {
  width: 100%;
  height: 56px;
  background: var(--midnight);
  color: var(--paper);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s;
}
.btn-cta:active { transform: scale(0.98); }
.btn-cta .material-symbols-outlined { font-size: 18px; }

.btn-ghost {
  width: 100%;
  height: 48px;
  background: transparent;
  color: var(--midnight);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ============================================================
   Result Hero · 大数字结果
   ============================================================ */
.result-hero {
  background: var(--midnight);
  color: var(--paper);
  border-radius: var(--r-lg);
  padding: 40px 28px 36px;
  margin-bottom: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-paper);
}
.result-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 100% 0%, rgba(212,175,55,0.18), transparent 60%),
    radial-gradient(circle at 0% 100%, rgba(212,175,55,0.06), transparent 60%);
  pointer-events: none;
}
.result-hero > * { position: relative; }
.result-hero .hero-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.result-hero .hero-num {
  font-family: var(--serif);
  font-size: 56px;
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.02em;
}
.result-hero .hero-num .small { font-size: 24px; color: rgba(255,255,255,0.7); margin-left: 4px; font-weight: 400; }
.result-hero .hero-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-top: 14px;
  line-height: 1.6;
}
.result-hero.ok .hero-num { color: var(--gold); }
.result-hero.bad .hero-num { color: #ff8a8a; }

/* ============================================================
   Breakdown · 双卡数据
   ============================================================ */
.breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.breakdown-item {
  background: var(--paper-2);
  border-radius: var(--r-md);
  padding: 18px 16px;
  text-align: center;
}
.breakdown-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.breakdown-val {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--midnight);
  font-weight: 500;
  line-height: 1.1;
}
.breakdown-val.gold { color: var(--accent-text); }
.breakdown-val.ok { color: var(--ok); }
.breakdown-val.bad { color: var(--bad); }

/* ============================================================
   Bar Chart · 横向柱条对比
   ============================================================ */
.bar-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}
.bar-row:last-child { margin-bottom: 0; }
.bar-label {
  flex-shrink: 0;
  width: 70px;
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.bar-track {
  flex: 1;
  height: 28px;
  background: var(--paper-2);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}
.bar-fill {
  position: absolute;
  inset-block: 0;
  left: 0;
  background: var(--midnight);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  color: var(--paper);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: width 0.5s ease;
}

/* ============================================================
   Insight · 引言/提示框
   ============================================================ */
.insight {
  background: var(--paper-2);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-sm);
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.insight:last-child { margin-bottom: 0; }
.insight .b { color: var(--midnight); font-weight: 600; }
.insight.ok { background: var(--ok-bg); border-left-color: var(--ok); }
.insight.ok .b { color: var(--ok); }
.insight.warn, .insight.orange { background: var(--warn-bg); border-left-color: var(--warn); }
.insight.warn .b, .insight.orange .b { color: var(--warn); }
.insight.bad { background: var(--bad-bg); border-left-color: var(--bad); }
.insight.bad .b { color: var(--bad); }

/* ============================================================
   Concierge / CTA Foot
   ============================================================ */
.cta-foot {
  background: var(--midnight);
  color: var(--paper);
  border-radius: var(--r-lg);
  padding: 36px 24px;
  text-align: center;
  margin-top: 28px;
  position: relative;
  overflow: hidden;
}
.cta-foot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(212,175,55,0.14), transparent 60%);
  pointer-events: none;
}
.cta-foot > * { position: relative; }
.cta-foot .cta-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.cta-foot .cta-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  margin-bottom: 8px;
  line-height: 1.3;
}
.cta-foot .cta-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 20px;
}
.cta-foot .cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--paper);
  color: var(--midnight);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.cta-foot .cta-channels {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.05em;
}

/* ============================================================
   Disclaim
   ============================================================ */
.disclaim {
  margin-top: 40px;
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}
.disclaim .divider {
  width: 32px; height: 1px;
  background: var(--ink-5);
  margin: 0 auto 14px;
}

/* ============================================================
   Bottom Nav
   ============================================================ */
.bottomnav {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 432px;
  z-index: 60;
}
.bottomnav-pill {
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border: 1px solid rgba(10,17,31,0.06);
  border-radius: 999px;
  display: flex;
  justify-content: space-around;
  padding: 10px 8px;
  box-shadow: 0 24px 60px -12px rgba(10,17,31,0.18);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  color: var(--ink-4);
  padding: 6px 2px;
  position: relative;
  transition: color 0.2s;
}
.nav-item .material-symbols-outlined { font-size: 22px; }
.nav-item .nav-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  font-weight: 600;
  text-transform: uppercase;
}
.nav-item.active { color: var(--midnight); }
.nav-item.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1, 'wght' 400;
  filter: drop-shadow(0 0 8px rgba(212,175,55,0.4));
}
.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold);
}
