:root {
  --blue: #55CDFC;
  --pink: #F7A8B8;
  --white: #FFFFFF;
  --blue-deep: #0E7FB8;
  --pink-deep: #B85A75;
  --ink: #1F2328;
  --muted: #71767E;
  --warn: #A9601C;
  --line: #EDF0F4;
  --soft: #F7F9FC;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow-soft: 0 1px 2px rgba(16, 24, 40, 0.03), 0 8px 24px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

body {
  background:
    radial-gradient(1100px 420px at 50% -140px, rgba(85, 205, 252, 0.10), transparent 62%),
    radial-gradient(820px 340px at 88% -80px, rgba(247, 168, 184, 0.12), transparent 62%),
    #FCFDFE;
  background-attachment: fixed;
  min-height: 100vh;
}

.accent-bar {
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--blue) 22%, var(--pink) 78%, transparent);
  opacity: 0.8;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.screen { display: block; }
.hidden { display: none !important; }

h1 {
  font-size: 25px;
  font-weight: 600;
  margin: 6px 0 14px;
  letter-spacing: 0.015em;
}

h2 {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 10px;
  letter-spacing: 0.01em;
}

.lede {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  margin: 0 0 20px;
}

.card {
  background: var(--soft);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
}

.card.subtle {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
}

.card p { margin: 0 0 8px; font-size: 14px; line-height: 1.8; }
.card p:last-child { margin-bottom: 0; }

.checks {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 14px;
  line-height: 2;
}

.small { color: var(--muted); font-size: 12.5px; line-height: 1.8; }

button {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 16px 18px;
  font-size: 15.5px;
  font-family: inherit;
  letter-spacing: 0.01em;
  cursor: pointer;
  margin-top: 10px;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button.primary {
  background: linear-gradient(135deg, #3FAFD9, var(--blue-deep));
  color: var(--white);
  font-weight: 500;
  box-shadow: 0 6px 18px rgba(14, 127, 184, 0.18);
}

button.primary:active {
  transform: translateY(1px);
  box-shadow: 0 3px 10px rgba(14, 127, 184, 0.16);
  background: linear-gradient(135deg, #3098C4, #0B6A9B);
}

button.ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border: 1px solid var(--line);
}

button.ghost:active { background: #F4F7FA; }

button:disabled { opacity: 0.45; cursor: default; box-shadow: none; }

.warn {
  color: var(--warn);
  font-size: 13.5px;
  line-height: 1.8;
  margin: 12px 0 0;
  padding: 12px 14px;
  background: rgba(255, 248, 236, 0.9);
  border-radius: var(--radius-md);
}

.warn:empty { display: none; }

.footnote {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  margin-top: 26px;
}

/* 方向选择 */
.mode {
  display: flex;
  gap: 6px;
  padding: 5px;
  margin: 0 0 10px;
  background: #F2F5F9;
  border-radius: 999px;
}

.mode-btn {
  flex: 1;
  margin: 0;
  padding: 11px 8px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.22s ease, color 0.22s ease;
}

.mode-btn span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.75;
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.mode-btn.active { color: var(--ink); }

.mode-btn.active[data-dir="mtf"] {
  background: linear-gradient(135deg, #FBE0E6, var(--pink));
  color: #3B2129;
}

.mode-btn.active[data-dir="ftm"] {
  background: linear-gradient(135deg, #DEF4FD, var(--blue));
  color: #12303F;
}

.mode-hint {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
  margin: 0 0 20px;
  min-height: 34px;
}

.report-mode {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 16px;
}

/* 页脚 */
.footer {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.heart-mini {
  display: block;
  width: 44px;
  height: 44px;
  margin: 0 auto 8px;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  color: #D6C3C9;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.18s ease, color 0.2s ease;
}

.heart-mini svg {
  display: block;
  width: 26px;
  height: 26px;
  margin: 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.heart-mini:active { transform: scale(0.9); }

.heart-mini.liked { color: #D9738D; }

.heart-mini.liked svg {
  fill: #F7A8B8;
  stroke: #D9738D;
}

.like-count {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
  min-height: 16px;
  letter-spacing: 0.02em;
}

.maker {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin: 0 0 6px;
}

.star-link {
  display: inline-block;
  font-size: 12.5px;
  color: var(--blue-deep);
  text-decoration: none;
  padding: 6px 4px;
}

.star-link:active { opacity: 0.7; }

/* 录音 */
.step-line { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.step-title { font-size: 21px; font-weight: 600; margin: 0 0 8px; letter-spacing: 0.01em; }

.progress {
  height: 8px;
  background: #EEF2F6;
  border-radius: 999px;
  overflow: hidden;
  margin: 32px 0 22px;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pink), #F9C4CF);
  border-radius: 999px;
  transition: width 0.08s linear;
}

.status {
  font-size: 16.5px;
  color: #2E86AE;
  min-height: 26px;
  line-height: 1.6;
}

.rec-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 12px;
}

.rec-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 32px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.rec-live {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--pink-deep);
  opacity: 0.9;
}

.level {
  height: 8px;
  border-radius: 999px;
  background: #EDF2F7;
  overflow: hidden;
  margin-bottom: 16px;
}

#level-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), #8FDCF8);
  transition: width 0.1s linear;
}

/* 报告 */
.sec-title {
  font-size: 14.5px;
  font-weight: 600;
  margin: 24px 0 10px;
  color: #3A4048;
}

.item {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.025);
}

.bar {
  width: 5px;
  align-self: stretch;
  border-radius: 999px;
  background: #D5DAE1;
  flex: none;
  min-height: 34px;
}

.bar.percentile { background: linear-gradient(180deg, #6FC9EC, var(--blue-deep)); }
.bar.interval { background: linear-gradient(180deg, #F2B3C1, var(--pink-deep)); }
.bar.absolute { background: linear-gradient(180deg, #6FC9EC, var(--blue-deep)); }
.bar.self_only { background: #D5DAE1; }

.item-body { flex: 1; }

.item-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.item-label { font-size: 14px; font-weight: 500; }
.item-value { font-size: 14px; color: var(--blue-deep); font-variant-numeric: tabular-nums; }
.item-value.interval { color: var(--pink-deep); }
.item-value.self_only { color: var(--muted); }

.item-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
  margin-top: 4px;
}

.priority { margin: 6px 0 0; padding-left: 18px; font-size: 14px; line-height: 2; }

.disclaimer {
  color: #9AA0A8;
  font-size: 12px;
  line-height: 1.8;
  margin-top: 22px;
}

.hist {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.8;
}

.hist .t { color: var(--muted); font-size: 12px; }

/* 结论 */
.conclusion {
  background: linear-gradient(160deg, #F7FCFF, #F1F8FD);
  border: 1px solid #E3F0F8;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin: 0 0 24px;
  box-shadow: var(--shadow-soft);
}

.conclusion-kicker {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #6293AB;
  margin-bottom: 6px;
}

.conclusion-head {
  font-size: 16px;
  font-weight: 600;
  color: #1B2B33;
  margin-bottom: 8px;
  line-height: 1.5;
}

.conclusion-text {
  font-size: 13px;
  line-height: 1.9;
  color: #5A6770;
  margin: 0;
}

.conclusion .priority { margin: 12px 0 0; padding-left: 18px; }

.conclusion.low {
  background: linear-gradient(160deg, #FFFBF2, #FFF6E6);
  border-color: #F3E3C4;
}

.conclusion.low .conclusion-head { color: #8A5A12; }
.conclusion.low .conclusion-kicker { color: #A97B33; }

/* 区间标尺 */
.viz { margin: 10px 0 2px; }

.viz-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #EEF3F8;
}

.viz-band {
  position: absolute;
  left: 25%;
  right: 25%;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: #D9EBF6;
}

.viz-mid {
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: #CBD5DE;
}

.viz-dot {
  position: absolute;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--blue-deep);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(14, 127, 184, 0.35);
  transform: translate(-50%, -50%);
}

.viz.out .viz-dot {
  background: #D08A3A;
  box-shadow: 0 1px 4px rgba(208, 138, 58, 0.35);
}

.viz.far .viz-dot {
  background: #C06A5E;
  box-shadow: 0 1px 4px rgba(192, 106, 94, 0.35);
}

.viz-note {
  font-size: 10.5px;
  color: #8B929B;
  margin-top: 4px;
}

/* ---------- 平板与宽屏 ---------- */

@media (min-width: 700px) {
  .wrap { max-width: 760px; padding: 36px 28px 64px; }
  h1 { font-size: 28px; }
  .lede { font-size: 15px; line-height: 1.85; }
  .card { padding: 20px 22px; border-radius: 20px; }
  .checks { line-height: 2.1; }
  .mode { max-width: 420px; margin-left: auto; margin-right: auto; }
  .mode-hint { max-width: 620px; margin-left: auto; margin-right: auto; }
  .step-title { font-size: 24px; }
  .rec-time { font-size: 44px; }
  .status { font-size: 18px; }
  button.primary, button.ghost {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    display: block;
  }
  .item { padding: 16px 18px; }
  .conclusion { padding: 22px 26px; }
  .report-mode { max-width: 640px; }
}

@media (min-width: 1024px) {
  .wrap { max-width: 920px; }
  #screen-home .lede,
  #screen-home .card,
  #screen-home .footnote,
  #screen-home .footer {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }
  #report-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
    align-items: start;
  }
  #report-body > .wide,
  #report-body > .conclusion { grid-column: 1 / -1; }
  .sec-title { margin-top: 20px; }
}

/* ---------- 内置浏览器底部工具栏遮挡（QQ / 微信等） ---------- */
/* 这些 WebView 在页面上方浮一条工具栏，既不报告安全区也不缩减视口，
   所以给底部留足可滚动余量，页脚才能翻到工具栏上方。 */

body {
  min-height: 100vh;
  min-height: 100dvh;
}

.wrap {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 699px) {
  .wrap {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  }
}

/* 页脚自身再加一点下边距，避免贴住工具栏 */
.footer {
  padding-bottom: 8px;
}

/* 页脚爱心缩小：视觉变小，点击区域仍保留 */
.heart-mini {
  width: 36px;
  height: 36px;
  margin-bottom: 4px;
}

.heart-mini svg {
  width: 18px;
  height: 18px;
}

.like-count {
  font-size: 11.5px;
  margin-bottom: 6px;
}

/* ---------- 桌面 ---------- */

@media (min-width: 1280px) {
  .wrap { max-width: 1060px; padding: 48px 40px 84px; }
  html, body { font-size: 16px; }
  h1 { font-size: 32px; letter-spacing: 0.02em; }
  .lede { font-size: 16px; line-height: 1.85; }
  .card { padding: 24px 26px; border-radius: 22px; }
  .checks { font-size: 15px; line-height: 2.15; }
  .step-title { font-size: 26px; }
  .rec-time { font-size: 52px; }
  .status { font-size: 19px; }

  .mode { max-width: 380px; }
  .mode-hint { max-width: 560px; }
  button.primary, button.ghost { max-width: 380px; padding: 17px 20px; font-size: 16px; }

  #screen-home .lede,
  #screen-home .card,
  #screen-home .footnote,
  #screen-home .footer { max-width: 720px; }

  #report-body { gap: 0 36px; }
  .item { padding: 18px 20px; }
  .conclusion { padding: 26px 30px; }
  .sec-title { font-size: 15.5px; margin-top: 26px; }
  .item-label, .item-value { font-size: 14.5px; }
  .item-text { font-size: 13.5px; line-height: 1.8; }
}

/* 鼠标设备才有悬停反馈，触屏不会残留 */
@media (hover: hover) and (pointer: fine) {
  button.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(14, 127, 184, 0.22);
  }
  button.ghost:hover { background: #F4F7FA; border-color: #E1E6EC; }
  .mode-btn:hover { color: var(--ink); }
  .heart-mini:hover { color: #D9738D; transform: scale(1.08); }
  .star-link:hover { text-decoration: underline; }
  .item:hover { border-color: #E3E8EF; }
}

/* 键盘可达性 */
:focus-visible {
  outline: 2px solid var(--blue-deep);
  outline-offset: 2px;
  border-radius: 8px;
}
