/* =========================================================
   视力记 · 儿童向设计系统
   奶油底 / 贴纸卡片 / 圆润控件 / 猫头鹰瞳瞳
   ---------------------------------------------------------
   一条硬约束：.optotype-area 必须保持纯白 #FFF，
   视标必须纯黑。那是测量条件，不是审美选择。
   ========================================================= */

:root {
  --cream: #FFF6EA;
  --cream-2: #FFEFDC;
  --paper: #FFFFFF;

  --ink: #33304A;
  --ink-2: #6E6787;
  --ink-3: #A49DB8;

  --coral: #FF7A59;
  --coral-d: #DE5636;
  --sun: #FFC53D;
  --sun-d: #E9A400;
  --mint: #2FD3A6;
  --mint-d: #17A87F;
  --sky: #4C9AFF;
  --sky-d: #2C79DB;
  --grape: #9B8CFF;
  --grape-d: #7A66F0;
  --pink: #FF9DBB;

  --line: rgba(51, 48, 74, .085);
  --line-2: rgba(51, 48, 74, .16);

  --r-xl: 30px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 13px;

  --sh-card: 0 3px 0 rgba(126, 96, 62, .05), 0 14px 26px -18px rgba(126, 96, 62, .38);
  --sh-btn: 0 4px 0 rgba(126, 96, 62, .13);

  /* 兼容别名：旧代码里的 token 名 */
  --ok: var(--mint-d);
  --warn: var(--sun-d);
  --danger: var(--coral-d);
  --muted: var(--ink-2);
  --dim: var(--ink-3);
  --accent: var(--coral);
  --accent-2: var(--coral-d);
  --text: var(--ink);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

/* 背景：三团柔光 + 零星小点，像儿童房的墙纸 */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(58% 30% at 8% 4%, rgba(255, 197, 61, .30), transparent 68%),
    radial-gradient(52% 28% at 96% 12%, rgba(155, 140, 255, .22), transparent 66%),
    radial-gradient(66% 32% at 50% 104%, rgba(47, 211, 166, .18), transparent 68%);
}
body::after {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: var(--pattern, none);
  background-size: 178px 178px;
  background-repeat: repeat;
  opacity: .4;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 54%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 54%);
}

/* ---------------- 屏幕容器 ---------------- */
.screen {
  display: none;
  position: fixed; inset: 0;
  flex-direction: column;
  background: transparent;
  z-index: 1;
}
.screen.active { display: flex; animation: screenFade .22s ease both; }
.screen.active .scroll { animation: riseIn .34s cubic-bezier(.22, .61, .36, 1) both; }

@keyframes screenFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes riseIn {
  from { opacity: 0; transform: translateY(12px) }
  to { opacity: 1; transform: none }
}

.scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px calc(116px + var(--safe-b));
}

/* ---------------- 排版 ---------------- */
h1 { font-size: 28px; margin: 0 0 4px; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 16.5px; margin: 0 0 10px; font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 14.5px; margin: 0 0 8px; font-weight: 700; }
p { margin: 0 0 10px; }
.muted { color: var(--ink-2); }
.small { font-size: 13.5px; }
.tiny { font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.center { text-align: center; }
.mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------------- 卡片：白纸 + 落地阴影 ---------------- */
.card {
  position: relative;
  background: var(--paper);
  border: 2px solid rgba(51, 48, 74, .055);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--sh-card);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.card-head h2 { margin: 0; }

/* ---------------- 按钮：厚底可按下 ---------------- */
.btn {
  appearance: none;
  border: 2px solid var(--line-2);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--r-md);
  padding: 11px 18px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 700;
  min-height: 52px;
  cursor: pointer;
  box-shadow: var(--sh-btn);
  transition: transform .1s cubic-bezier(.3, .7, .4, 1), box-shadow .1s, background .16s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(126, 96, 62, .13); }

.btn.primary {
  background: linear-gradient(180deg, #FF8B6B, var(--coral));
  border-color: var(--coral-d);
  color: #fff;
  font-weight: 800;
  letter-spacing: .01em;
  text-shadow: 0 1px 0 rgba(180, 60, 35, .35);
  box-shadow: 0 5px 0 var(--coral-d), 0 16px 26px -16px rgba(222, 86, 54, .9);
}
.btn.primary:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--coral-d);
}
.btn.ghost {
  background: transparent; border-color: transparent;
  color: var(--ink-2); box-shadow: none;
}
.btn.ghost:active { transform: none; opacity: .6; box-shadow: none; }
.btn.danger {
  color: var(--coral-d); border-color: rgba(222, 86, 54, .28);
  background: #FFF2EE;
}
.btn.block { display: block; width: 100%; margin-bottom: 10px; }
.btn.big { min-height: 60px; font-size: 17.5px; border-radius: 21px; }
.btn:disabled { opacity: .4; box-shadow: none; }
.btn.small { min-height: 40px; font-size: 13.5px; padding: 8px 14px; border-radius: 13px; }

/* 主按钮里的玩法图标 */
.btn.big::before {
  content: '';
  display: inline-block; vertical-align: -3px;
  width: 20px; height: 20px; margin-right: 8px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.2v13.6L19 12z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.2v13.6L19 12z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.btn.big.no-icon::before { display: none; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-t) + 14px) 16px 10px;
  background: linear-gradient(180deg, rgba(255, 246, 234, .96), rgba(255, 246, 234, .72));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  z-index: 3;
}
.topbar-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }

.back-btn, .ghost-btn {
  background: var(--paper); border: 2px solid var(--line);
  color: var(--ink-2);
  font-size: 13px; font-family: inherit; font-weight: 700;
  padding: 6px 12px; min-width: 52px; border-radius: 12px; cursor: pointer;
  box-shadow: 0 2px 0 rgba(126, 96, 62, .1);
  transition: transform .1s, box-shadow .1s;
}
.back-btn:active, .ghost-btn:active {
  transform: translateY(2px); box-shadow: none;
}

/* ---------------- 底部导航：漂浮胶囊 ---------------- */
.tabbar {
  position: absolute; left: 12px; right: 12px;
  bottom: calc(10px + var(--safe-b));
  display: flex;
  background: var(--paper);
  border: 2px solid rgba(51, 48, 74, .06);
  border-radius: 26px;
  padding: 6px;
  box-shadow: 0 4px 0 rgba(126, 96, 62, .06), 0 18px 30px -20px rgba(126, 96, 62, .55);
  z-index: 4;
}
.tab {
  flex: 1;
  background: none; border: none; color: var(--ink-3);
  padding: 7px 0 5px;
  border-radius: 20px;
  font-size: 10.5px; font-family: inherit; font-weight: 700;
  letter-spacing: .02em;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer;
  transition: color .18s, background .18s;
}
.tab::before {
  content: '';
  width: 22px; height: 22px;
  background: currentColor;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  transition: transform .2s cubic-bezier(.3, 1.5, .5, 1);
}
.tab.active { color: var(--coral); background: #FFF1EB; }
.tab.active::before { transform: translateY(-1px) scale(1.08); }

.tab[data-tab="home"]::before {
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 10.6 12 3.6l8.5 7'/%3E%3Cpath d='M5.8 9.4V20h12.4V9.4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 10.6 12 3.6l8.5 7'/%3E%3Cpath d='M5.8 9.4V20h12.4V9.4'/%3E%3C/svg%3E");
}
.tab[data-tab="trend"]::before {
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17.5 8.5 12l3.8 3.2L21 6'/%3E%3Cpath d='M15.6 6H21v5.4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17.5 8.5 12l3.8 3.2L21 6'/%3E%3Cpath d='M15.6 6H21v5.4'/%3E%3C/svg%3E");
}
.tab[data-tab="records"]::before {
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round'%3E%3Cpath d='M9 6.5h11M9 12h11M9 17.5h11'/%3E%3Ccircle cx='4.5' cy='6.5' r='1.2' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='12' r='1.2' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='17.5' r='1.2' fill='black' stroke='none'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round'%3E%3Cpath d='M9 6.5h11M9 12h11M9 17.5h11'/%3E%3Ccircle cx='4.5' cy='6.5' r='1.2' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='12' r='1.2' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='17.5' r='1.2' fill='black' stroke='none'/%3E%3C/svg%3E");
}
.tab[data-tab="settings"]::before {
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round'%3E%3Cpath d='M4 7.5h16M4 16.5h16'/%3E%3Ccircle cx='9.5' cy='7.5' r='2.6' fill='white'/%3E%3Ccircle cx='15' cy='16.5' r='2.6' fill='white'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round'%3E%3Cpath d='M4 7.5h16M4 16.5h16'/%3E%3Ccircle cx='9.5' cy='7.5' r='2.6' fill='white'/%3E%3Ccircle cx='15' cy='16.5' r='2.6' fill='white'/%3E%3C/svg%3E");
}

/* ---------------- 吉祥物：瞳瞳 ---------------- */
.owl-slot { display: inline-flex; align-items: center; justify-content: center; }
.owl-slot svg { display: block; overflow: visible; }
.owl-bob { animation: owlBob 3.4s ease-in-out infinite; }
@keyframes owlBob {
  0%, 100% { transform: translateY(0) }
  50% { transform: translateY(-4px) }
}
.owl-eyes { transform-box: fill-box; transform-origin: center; animation: owlBlink 5.6s infinite; }
@keyframes owlBlink {
  0%, 93%, 100% { transform: scaleY(1) }
  95.5% { transform: scaleY(.08) }
}
.owl-wave { transform-box: fill-box; transform-origin: 70% 80%; animation: owlWave 2.8s ease-in-out infinite; }
@keyframes owlWave {
  0%, 70%, 100% { transform: rotate(0) }
  78% { transform: rotate(-14deg) }
  88% { transform: rotate(6deg) }
}

/* ---------------- 品牌 ---------------- */
.brand { text-align: center; padding: 26px 0 20px; }
.brand-mark {
  width: 96px; height: 96px; margin: 0 auto 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #FFFFFF, #FFEFD6 70%);
  border: 3px solid #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    0 0 0 8px rgba(255, 197, 61, .28),
    0 16px 30px -14px rgba(233, 164, 0, .65);
}
.brand .sub { color: var(--ink-2); font-size: 13.5px; margin: 0; }

/* ---------------- 知情同意 ---------------- */
.notice {
  background: #FFFCF5;
  border-color: rgba(233, 164, 0, .2);
}
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 14px; }
.split-col {
  border-radius: var(--r-md);
  padding: 11px 11px 6px;
  border: 2px solid transparent;
}
.split-col.ok { background: #EFFCF7; border-color: rgba(47, 211, 166, .28); }
.split-col.no { background: #FFF6F1; border-color: rgba(255, 122, 89, .22); }
.split-col h3 { font-size: 12.5px; margin-bottom: 7px; letter-spacing: .02em; font-weight: 800; }
.split-col.ok h3 { color: var(--mint-d); }
.split-col.no h3 { color: var(--coral-d); }
.split-col ul { margin: 0; padding-left: 14px; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.split-col li { margin-bottom: 5px; }
.split-col li::marker { color: var(--ink-3); }
.split-col b { color: var(--ink); }

.warn-line {
  font-size: 12.5px; color: var(--ink-2); line-height: 1.65;
  background: #FFF4E4;
  border-radius: 12px;
  padding: 9px 11px; margin-bottom: 9px;
}
.warn-line b { color: var(--ink); }

.check-line {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: 14px; line-height: 1.6;
  margin: 16px 0 14px;
  cursor: pointer;
}
.check-line input {
  appearance: none; -webkit-appearance: none;
  width: 24px; height: 24px; margin: 0; flex: none;
  border: 2.5px solid var(--line-2);
  border-radius: 8px;
  background: var(--paper);
  position: relative;
  transition: background .16s, border-color .16s;
}
.check-line input:checked {
  background: var(--mint);
  border-color: var(--mint-d);
}
.check-line input:checked::after {
  content: '';
  position: absolute; left: 6.5px; top: 2.5px;
  width: 6px; height: 11px;
  border: solid #fff;
  border-width: 0 2.6px 2.6px 0;
  transform: rotate(42deg);
}

/* ---------------- 插画 ---------------- */
svg.art { display: block; width: 100%; height: auto; }

/* 首页主视觉：天空 + 山丘 + 瞳瞳 */
.hero {
  position: relative;
  margin: 2px 0 12px;
  border-radius: 26px;
  overflow: hidden;
  background: #FFF0DC;
  border: 2px solid rgba(51, 48, 74, .05);
  box-shadow: 0 4px 0 rgba(126, 96, 62, .06), 0 20px 32px -24px rgba(126, 96, 62, .8);
}
.hero-art { height: 172px; }
.hero-art svg { display: block; width: 100%; height: 100%; }
.hero-copy {
  position: absolute; left: 18px; top: 15px; right: 128px;
  font-size: 14px; font-weight: 800; line-height: 1.55;
  color: #5A4632;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .75);
}
.art-cloud { animation: cloudDrift 15s ease-in-out infinite alternate; }
.art-cloud.b { animation-duration: 21s; animation-delay: -6s; }
@keyframes cloudDrift {
  from { transform: translateX(0) }
  to { transform: translateX(13px) }
}

/* 说明插画：虚线框，像课本里的示意图 */
.art-card {
  background: #FFFCF5;
  border: 2px dashed rgba(233, 164, 0, .34);
  border-radius: 22px;
  padding: 12px 14px 8px;
  margin-bottom: 12px;
}
.art-card-head {
  font-size: 11.5px; font-weight: 800; color: #B07C00;
  letter-spacing: .04em; margin-bottom: 2px;
}

/* 空状态插画 */
.art-empty { display: block; width: 134px; height: 96px; margin: 0 auto 2px; }

/* 达标奖章 */
.res-medal {
  position: absolute; right: 14px; top: 12px;
  width: 52px; height: 52px;
  animation: medalPop .5s cubic-bezier(.2, 1.6, .4, 1) both;
}
.res-medal svg { display: block; width: 100%; height: 100%; }
@keyframes medalPop {
  from { opacity: 0; transform: scale(.4) rotate(-18deg) }
  to { opacity: 1; transform: none }
}

/* ---------------- 首页 ---------------- */
.profile-card {
  display: flex; align-items: center; gap: 13px;
  background: linear-gradient(120deg, #FFFFFF, #FFF9F1);
}
.avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: linear-gradient(160deg, #FFE9CF, #FFD9B8);
  border: 2.5px solid #fff;
  box-shadow: 0 4px 10px -6px rgba(233, 164, 0, .9);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px; font-weight: 800; color: #C97A22;
}
.profile-name { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.profile-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.profile-meta { flex: 1; min-width: 0; }

.row-stat { font-size: 15px; }
.stat-empty { color: var(--ink-3); font-size: 13.5px; text-align: center; padding: 10px 0; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.stat-grid > div { position: relative; padding: 2px 0; }
.stat-grid > div + div::before {
  content: ''; position: absolute; left: 0; top: 14%; bottom: 14%;
  width: 2px; border-radius: 2px; background: var(--line);
}
.stat-grid .k { font-size: 11.5px; color: var(--ink-3); letter-spacing: .02em; font-weight: 600; }
.stat-grid .v {
  font-size: 27px; font-weight: 800; margin: 2px 0 1px;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.stat-grid .v.good { color: var(--mint-d); }
.stat-grid .v.mid { color: var(--sun-d); }
.stat-grid .v.bad { color: var(--coral-d); }

/* 记录打卡条 */
.streak {
  display: flex; align-items: center; gap: 10px;
  background: #FFF8E8;
  border: 2px solid rgba(233, 164, 0, .18);
  border-radius: var(--r-md);
  padding: 10px 13px;
  margin-bottom: 12px;
  font-size: 13px; color: #A97612; font-weight: 700;
}
.streak .spark {
  width: 26px; height: 26px; flex: none;
  background: var(--sun);
  -webkit-mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.4l2.6 6.2 6.7.5-5.1 4.4 1.6 6.5L12 16.6 6.2 20l1.6-6.5-5.1-4.4 6.7-.5z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.4l2.6 6.2 6.7.5-5.1 4.4 1.6 6.5L12 16.6 6.2 20l1.6-6.5-5.1-4.4 6.7-.5z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.streak:empty, .streak.hide { display: none; }

.hint {
  background: #F4F8FF;
  border-color: rgba(76, 154, 255, .18);
  font-size: 13px; line-height: 1.65; color: var(--ink-2);
}
.hint:empty { display: none; }

/* ---------------- 结论卡 ---------------- */
.concl { border-left: 6px solid var(--line-2); }
.concl:empty { display: none; }
.concl.good { background: #F1FCF8; border-color: rgba(47, 211, 166, .3); border-left-color: var(--mint); }
.concl.watch { background: #FFFBF0; border-color: rgba(233, 164, 0, .26); border-left-color: var(--sun); }
.concl.alert { background: #FFF4F1; border-color: rgba(255, 122, 89, .3); border-left-color: var(--coral); }

.concl-head { display: flex; gap: 11px; align-items: flex-start; }
.concl-icon {
  width: 34px; height: 34px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800;
  background: var(--cream-2); color: var(--ink-2);
}
.concl.good .concl-icon { background: rgba(47, 211, 166, .18); color: var(--mint-d); }
.concl.watch .concl-icon { background: rgba(255, 197, 61, .26); color: #B07C00; }
.concl.alert .concl-icon { background: rgba(255, 122, 89, .18); color: var(--coral-d); }
.concl-title { font-size: 16px; font-weight: 800; line-height: 1.42; letter-spacing: -.01em; }
.concl-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; font-weight: 600; }
.concl-body { font-size: 13px; color: var(--ink-2); margin: 10px 0 0; line-height: 1.72; }

/* ---------------- 宫格按钮 ---------------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.card-btn {
  margin: 0; min-height: 68px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  font-size: 13.5px; font-weight: 700;
  background: var(--paper);
  border-radius: 20px;
}
.card-btn::before {
  content: ''; width: 24px; height: 24px; flex: none;
  background: var(--sky);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
}
#go-trend::before {
  background: var(--mint);
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17.5 8.5 12l3.8 3.2L21 6'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 17.5 8.5 12l3.8 3.2L21 6'/%3E%3C/svg%3E");
}
#go-rx::before {
  background: var(--grape);
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3.5h8l5 5V20a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4.5a1 1 0 0 1 1-1z'/%3E%3Cpath d='M14 3.5V9h5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3.5h8l5 5V20a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4.5a1 1 0 0 1 1-1z'/%3E%3Cpath d='M14 3.5V9h5'/%3E%3C/svg%3E");
}
#go-records::before {
  background: var(--sun);
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round'%3E%3Cpath d='M9 6.5h11M9 12h11M9 17.5h11'/%3E%3Ccircle cx='4.5' cy='6.5' r='1.3' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='12' r='1.3' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='17.5' r='1.3' fill='black' stroke='none'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round'%3E%3Cpath d='M9 6.5h11M9 12h11M9 17.5h11'/%3E%3Ccircle cx='4.5' cy='6.5' r='1.3' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='12' r='1.3' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='17.5' r='1.3' fill='black' stroke='none'/%3E%3C/svg%3E");
}
#go-settings::before {
  background: var(--ink-3);
  -webkit-mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round'%3E%3Cpath d='M4 7.5h16M4 16.5h16'/%3E%3Ccircle cx='9.5' cy='7.5' r='2.8' fill='white'/%3E%3Ccircle cx='15' cy='16.5' r='2.8' fill='white'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round'%3E%3Cpath d='M4 7.5h16M4 16.5h16'/%3E%3Ccircle cx='9.5' cy='7.5' r='2.8' fill='white'/%3E%3Ccircle cx='15' cy='16.5' r='2.8' fill='white'/%3E%3C/svg%3E");
}

/* ---------------- 校准 ---------------- */
.cal-stage {
  background: #ffffff; border-radius: var(--r-md); padding: 26px 6px; margin: 16px -8px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  border: 2px solid var(--line);
  box-shadow: 0 8px 20px -16px rgba(51, 48, 74, .9);
}
.cal-line-wrap { width: 100%; display: flex; justify-content: center; overflow: visible; }
/* flex: none 是必须的 —— 默认 flex-shrink:1 会把线段压窄，存的 px/mm 就和看到的长度对不上 */
.cal-line { height: 7px; background: #000; border-radius: 4px; flex: 0 0 auto; }
.cal-arrow {
  color: #6B6480; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  margin-top: -8px; font-variant-numeric: tabular-nums;
}

.slider-row { display: flex; align-items: center; gap: 12px; font-size: 13.5px; font-weight: 600; }
.slider-row input[type=range] {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 8px; border-radius: 5px; background: var(--cream-2); outline: none;
  border: 2px solid var(--line);
}
.slider-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(180deg, #FF9A7C, var(--coral));
  border: 3px solid #fff;
  box-shadow: 0 3px 8px -2px rgba(222, 86, 54, .8);
}
.slider-row .mono { min-width: 68px; text-align: right; color: var(--ink-2); font-size: 12.5px; }
.cal-tips { font-size: 12.5px; color: var(--ink-3); line-height: 1.65; margin: 12px 0; }
.cal-tips p { margin-bottom: 6px; }

/* ---------------- 选项 chips ---------------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
  flex: 1 1 0; min-width: 0;
  background: var(--paper);
  border: 2px solid var(--line);
  color: var(--ink);
  border-radius: 16px;
  padding: 10px 6px;
  font-size: 14.5px; font-family: inherit; font-weight: 700;
  white-space: nowrap;
  cursor: pointer; min-height: 54px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 rgba(126, 96, 62, .09);
  transition: transform .1s, box-shadow .1s, background .16s, border-color .16s;
}
.chip small { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; font-weight: 600; }
.chip.wide { min-width: 0; }
.chip:active { transform: translateY(3px); box-shadow: none; }
.chip.on {
  background: #FFF1EB;
  border-color: var(--coral);
  color: var(--coral-d);
  box-shadow: 0 3px 0 rgba(222, 86, 54, .35);
}
.chip.on small { color: rgba(222, 86, 54, .72); }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; font-weight: 700; }
.field input, .field select {
  width: 100%;
  background: var(--paper);
  border: 2px solid var(--line);
  color: var(--ink);
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 16px; font-family: inherit; font-weight: 600;
  transition: border-color .16s, background .16s;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--sky);
  background: #F7FBFF;
}
.field input::placeholder { color: var(--ink-3); font-weight: 400; }
.field.inline { display: flex; align-items: center; gap: 10px; }
.field.inline label { margin: 0; min-width: 108px; }
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.field-row.two { grid-template-columns: repeat(2, 1fr); }
.field-group {
  margin: 16px 0 9px; color: var(--grape-d);
  font-size: 12px; font-weight: 800; letter-spacing: .06em;
}

/* 下拉箭头 */
.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E6787' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 15px;
  padding-right: 38px;
}

/* 开关 */
.switch-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; }
.switch-line input[type=checkbox] {
  appearance: none; -webkit-appearance: none;
  width: 54px; height: 32px; border-radius: 17px;
  background: #E8E2D6;
  flex: none; margin: 0; cursor: pointer;
  position: relative;
  transition: background .22s;
}
.switch-line input[type=checkbox]::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(51, 48, 74, .28);
  transition: transform .22s cubic-bezier(.3, .8, .4, 1);
}
.switch-line input[type=checkbox]:checked { background: var(--mint); }
.switch-line input[type=checkbox]:checked::after { transform: translateX(22px); }

/* ---------------- 准备清单 ---------------- */
.checklist .check-item { display: flex; gap: 13px; margin-bottom: 16px; }
.check-item:last-child { margin-bottom: 0; }
.ci-num {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--sun);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  box-shadow: 0 3px 0 rgba(233, 164, 0, .4);
}
.check-item p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.check-item b { font-size: 14px; font-weight: 800; }

/* ---------------- 测量界面：暗场舞台 ---------------- */
#screen-test {
  background: #241F3D;
}
#screen-test::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 12% 14%, rgba(255, 197, 61, .55) 1.6px, transparent 2px),
    radial-gradient(circle at 82% 9%, rgba(255, 255, 255, .5) 1.4px, transparent 2px),
    radial-gradient(circle at 92% 26%, rgba(155, 140, 255, .6) 2px, transparent 2.4px),
    radial-gradient(circle at 22% 8%, rgba(255, 255, 255, .35) 1.2px, transparent 1.6px),
    radial-gradient(circle at 8% 76%, rgba(255, 255, 255, .32) 1.5px, transparent 2px),
    radial-gradient(circle at 93% 72%, rgba(255, 197, 61, .5) 2px, transparent 2.6px),
    radial-gradient(circle at 18% 93%, rgba(155, 140, 255, .55) 1.6px, transparent 2.1px),
    radial-gradient(circle at 80% 96%, rgba(255, 255, 255, .26) 1.2px, transparent 1.7px),
    radial-gradient(circle at 60% 84%, rgba(255, 255, 255, .2) 1.1px, transparent 1.6px),
    radial-gradient(circle at 38% 89%, rgba(255, 255, 255, .24) 1.3px, transparent 1.8px);
}

.test-topbar {
  display: flex; align-items: center; gap: 12px;
  padding: calc(var(--safe-t) + 12px) 16px 12px;
  position: relative; z-index: 2;
}
.back-btn.light {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .16);
  color: #E9E4FF;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25);
}
.test-progress {
  flex: 1; height: 12px; border-radius: 8px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .2);
}
.test-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--mint), var(--sun) 55%, var(--coral));
  border-radius: 8px;
  transition: width .3s cubic-bezier(.3, .8, .4, 1);
}
.test-label {
  font-size: 12px; color: #C7BEEA; min-width: 52px; text-align: right;
  font-variant-numeric: tabular-nums; font-weight: 700;
}

/* 视标区必须纯白 —— 这是测量条件，不是审美选择 */
.optotype-area {
  flex: 1;
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  padding: 12px;
  border-radius: 0 0 26px 26px;
  box-shadow: 0 0 46px rgba(255, 255, 255, .18);
  position: relative; z-index: 1;
}
.optotype-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.optotype-inner svg { display: block; }
.opt-cell { display: flex; flex-direction: column; align-items: center; }
.opt-cell .marker { width: 100%; height: 4px; border-radius: 3px; margin-top: 5px; }
.opt-row { display: flex; align-items: flex-end; justify-content: center; flex-wrap: wrap; }

.answer-area {
  background: #241F3D;
  padding: 12px 16px calc(14px + var(--safe-b));
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  position: relative; z-index: 2;
}
.answer-prompt {
  font-size: 13.5px; color: #CFC7EE; min-height: 20px;
  font-weight: 700; letter-spacing: .01em;
  display: flex; align-items: center; gap: 7px;
}
.answer-prompt .mini-owl { display: inline-flex; }
.dir-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, auto);
  gap: 9px;
  width: 100%; max-width: 330px;
}
.dir-btn {
  border: none;
  color: #fff;
  border-radius: 20px;
  font-size: 26px; font-family: inherit; font-weight: 800;
  min-height: 66px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; line-height: 1;
  transition: transform .1s, box-shadow .1s, filter .14s;
}
.dir-btn svg { display: block; width: 25px; height: 25px; }
.dir-btn span { font-size: 10px; font-weight: 700; opacity: .8; margin-top: 3px; letter-spacing: .08em; }
.dir-btn:active { transform: translateY(4px); box-shadow: none !important; filter: brightness(1.1); }
.dir-btn:nth-child(1) { grid-column: 2; grid-row: 1; background: var(--sun); box-shadow: 0 5px 0 var(--sun-d); }
.dir-btn:nth-child(2) { grid-column: 1; grid-row: 2; background: var(--mint); box-shadow: 0 5px 0 var(--mint-d); }
.dir-btn:nth-child(3) { grid-column: 3; grid-row: 2; background: var(--sky); box-shadow: 0 5px 0 var(--sky-d); }
.dir-btn:nth-child(4) { grid-column: 2; grid-row: 3; background: var(--pink); box-shadow: 0 5px 0 #E2728F; }

/* "看不清" —— 必须好点，孩子会频繁用到 */
#btn-cant {
  background: rgba(255, 255, 255, .09);
  border: 2px solid rgba(255, 255, 255, .16);
  color: #D6CEF3;
  min-height: 42px;
  padding: 0 24px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 700;
  box-shadow: none;
}
#btn-cant:active { transform: translateY(2px); background: rgba(255, 255, 255, .16); }

/* ---------------- 结果页 ---------------- */
.result-hero { text-align: center; padding: 4px 12px 12px; position: relative; overflow: hidden; }
.result-hero .owl-slot { margin-bottom: 2px; }

/* 完成彩带：只在结果达标时撒 */
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti span {
  position: absolute; top: -14px;
  width: 7px; height: 11px; border-radius: 2px;
  opacity: 0;
  animation: confettiFall 1.6s cubic-bezier(.3, .7, .5, 1) forwards;
}
@keyframes confettiFall {
  0% { opacity: 0; transform: translateY(-10px) rotate(0deg) }
  12% { opacity: 1 }
  100% { opacity: 0; transform: translateY(240px) rotate(430deg) }
}
.result-kid {
  font-size: 15px; font-weight: 800; color: var(--coral-d);
  margin: 4px 0 12px;
}
.result-label {
  font-size: 11.5px; color: var(--ink-3);
  letter-spacing: .14em; font-weight: 700;
}
.result-value {
  font-size: 66px; font-weight: 800; line-height: 1;
  margin: 6px 0 6px;
  letter-spacing: -.05em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: var(--ink);
}
.result-sub { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.result-badge {
  display: inline-block; margin-top: 10px;
  padding: 6px 16px; border-radius: 14px; font-size: 12.5px; font-weight: 800;
  letter-spacing: .01em;
}
.result-badge.good { background: #E9FBF4; color: var(--mint-d); }
.result-badge.watch { background: #FFF6DF; color: #B07C00; }
.result-badge.alert { background: #FFEDE7; color: var(--coral-d); }

/* 同龄刻度尺 */
.va-scale { margin: 26px auto 6px; max-width: 336px; padding: 0 14px; }
.va-track {
  position: relative; height: 12px; border-radius: 7px;
  background: #F0EBE2;
  margin: 30px 0 26px;
  box-shadow: inset 0 2px 3px rgba(51, 48, 74, .07);
}
.va-fill {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 7px;
  background: linear-gradient(90deg, rgba(76, 154, 255, .18), rgba(76, 154, 255, .7));
}
.va-track.good .va-fill { background: linear-gradient(90deg, rgba(47, 211, 166, .2), rgba(47, 211, 166, .8)); }
.va-track.watch .va-fill { background: linear-gradient(90deg, rgba(255, 197, 61, .3), rgba(255, 197, 61, .95)); }
.va-track.alert .va-fill { background: linear-gradient(90deg, rgba(255, 122, 89, .2), rgba(255, 122, 89, .8)); }
.va-ref {
  position: absolute; top: -8px; bottom: -8px; width: 3px;
  background: var(--sun-d); border-radius: 2px;
}
.va-mark { position: absolute; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.va-mark.prev {
  width: 11px; height: 11px;
  background: #fff;
  border: 2.5px solid var(--ink-3);
}
.va-mark.now {
  width: 20px; height: 20px;
  border: 3.5px solid #fff;
  box-shadow: 0 0 0 2px rgba(51, 48, 74, .12), 0 3px 8px -2px rgba(51, 48, 74, .5);
}
.va-mark.now.good { background: var(--mint); }
.va-mark.now.watch { background: var(--sun); }
.va-mark.now.alert { background: var(--coral); }
.va-ref-tag {
  position: absolute; top: -27px; transform: translateX(-50%);
  font-size: 10.5px; color: #B07C00; white-space: nowrap;
  letter-spacing: .01em; font-weight: 800;
}
.va-axis { position: relative; height: 16px; font-size: 10.5px; color: var(--ink-3); font-weight: 700; }
.va-axis .va-lo { position: absolute; left: 0; }
.va-axis .va-hi { position: absolute; right: 0; }

/* ---------------- 详情 / 可信度 ---------------- */
.kv {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0; border-bottom: 2px dashed var(--line);
  font-size: 13.5px; font-weight: 600;
}
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--ink-3); flex: none; }
.kv span:last-child { font-variant-numeric: tabular-nums; text-align: right; }

.qc-head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 10px; font-weight: 700; }
.qc-bar { height: 12px; background: #F0EBE2; border-radius: 7px; overflow: hidden; }
.qc-bar div { height: 100%; border-radius: 7px; transition: width .5s cubic-bezier(.3, .8, .4, 1); }
.qc-issues { margin: 11px 0 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.qc-issues li { margin-bottom: 4px; }
.qc-issues li::marker { color: var(--ink-3); }

.advice {
  background: #F4F8FF;
  border-color: rgba(76, 154, 255, .18);
}
.action-list { margin: 6px 0 12px; padding-left: 17px; font-size: 13.5px; line-height: 1.7; }
.action-list li { margin-bottom: 6px; }
.action-list li::marker { color: var(--sky); }

/* ---------------- 图表 ---------------- */
.chart-box { width: 100%; overflow-x: auto; }
.chart-box svg { display: block; min-width: 100%; }
.legend {
  display: flex; gap: 18px; font-size: 12px; color: var(--ink-3);
  margin-top: 10px; justify-content: center; letter-spacing: .01em; font-weight: 700;
}
.dot { display: inline-block; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot-r { width: 11px; height: 11px; background: #FF7A59; }
.dot-l { width: 7px; height: 7px; background: #4C9AFF; vertical-align: 2px; }
.empty-note { color: var(--ink-3); font-size: 13px; text-align: center; padding: 18px 0; }
.empty-wrap { text-align: center; padding: 0 0 6px; }
.empty-wrap .empty-note { padding: 6px 0 0; }

/* ---------------- 列表 ---------------- */
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 2px dashed var(--line);
  font-size: 13.5px;
}
.list-item:last-child { border-bottom: none; }
.list-item .li-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.list-item .li-sub { font-size: 11.5px; color: var(--ink-3); }
.list-item .li-val {
  font-size: 19px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  flex: none;
}
.profile-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 0; border-bottom: 2px dashed var(--line);
  cursor: pointer;
}
.profile-item:last-child { border-bottom: none; }
.profile-item .pi-name { flex: 1; font-size: 14.5px; font-weight: 700; }
.profile-item.on .pi-name { color: var(--coral-d); }

/* ---------------- toast / modal ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 112px;
  transform: translateX(-50%) translateY(14px) scale(.94);
  background: var(--ink);
  color: #fff;
  padding: 11px 20px; border-radius: 16px;
  font-size: 13.5px; font-weight: 700;
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s cubic-bezier(.3, 1.4, .4, 1);
  z-index: 60; max-width: 82vw; text-align: center;
  box-shadow: 0 16px 30px -14px rgba(51, 48, 74, .9);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }

.modal {
  position: fixed; inset: 0;
  background: rgba(51, 48, 74, .42);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: none; align-items: center; justify-content: center;
  padding: 22px; z-index: 70;
}
.modal.show { display: flex; animation: screenFade .2s ease both; }
.modal-box {
  background: var(--paper);
  border: 3px solid rgba(51, 48, 74, .07);
  border-radius: 26px;
  padding: 22px;
  width: 100%; max-width: 340px;
  box-shadow: 0 30px 60px -24px rgba(51, 48, 74, .8);
  animation: modalIn .3s cubic-bezier(.22, 1.3, .36, 1) both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.95) }
  to { opacity: 1; transform: none }
}
.modal-box h3 { margin-bottom: 14px; font-size: 17px; font-weight: 800; }
.modal-box input {
  width: 100%;
  background: #FBF7F0;
  border: 2px solid var(--line);
  color: var(--ink);
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 16px; font-family: inherit; font-weight: 600;
  margin-bottom: 10px;
}
.modal-box input:focus {
  outline: none;
  border-color: var(--sky);
  background: #fff;
}
.modal-actions { display: flex; gap: 10px; margin-top: 8px; }
.modal-actions .btn { flex: 1; margin: 0; }
#modal-body { max-height: 70vh; overflow-y: auto; }

/* ---------------- 报告 ---------------- */
.report-pre {
  background: #FBF7F0;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  font-size: 12px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-all;
  max-height: 52vh; overflow-y: auto; margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-2);
}

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-block; font-size: 10.5px; font-weight: 800;
  padding: 2px 8px; border-radius: 9px;
  background: #EEF4FF; color: var(--sky-d);
  margin-left: 6px;
}
.tag.warn { background: #FFF3E0; color: #B07C00; }

/* ---------------- 亮度适应（必须纯白） ---------------- */
.adapt-overlay {
  position: fixed; inset: 0; background: #ffffff; z-index: 90;
  display: none; align-items: flex-end; justify-content: center;
  padding-bottom: 15vh;
}
.adapt-overlay.show { display: flex; animation: screenFade .2s ease both; }
.adapt-tip { color: #9a9a9a; font-size: 12.5px; letter-spacing: .06em; }

/* ---------------- 宽屏：保持手机比例 ---------------- */
@media (min-width: 560px) {
  body { background: #F3E9DA; }
  body::before {
    background:
      radial-gradient(58% 30% at 50% -4%, rgba(255, 197, 61, .3), transparent 66%),
      radial-gradient(50% 28% at 50% 106%, rgba(47, 211, 166, .16), transparent 66%);
  }
  .screen {
    left: 50%; right: auto; transform: translateX(-50%);
    width: 430px;
    box-shadow: 0 0 70px -24px rgba(51, 48, 74, .45);
    border-left: 2px solid rgba(51, 48, 74, .05);
    border-right: 2px solid rgba(51, 48, 74, .05);
  }
  .toast { bottom: 118px; }
}

/* ---------------- 小屏 ---------------- */
@media (max-height: 700px) {
  .result-value { font-size: 54px; }
  .brand { padding: 16px 0 14px; }
  .brand-mark { width: 78px; height: 78px; }
  .dir-btn { min-height: 58px; font-size: 22px; }
  .va-scale { margin: 20px auto 6px; }
  .answer-area { padding-top: 8px; gap: 8px; }
  .hero-art { height: 126px; }
  .hero-copy { font-size: 13px; top: 12px; right: 116px; }
  .art-empty { width: 118px; height: 84px; }
  .profile-card { padding: 14px 16px; }
  .avatar { width: 46px; height: 46px; font-size: 19px; }
}

/* 尊重系统的减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
