/* 青岚拼音 — emerald studio theme layered over the shared base.css shell. */
:root {
  --paper: #edf5ef;
  --paper-deep: #dceadd;
  --card: #fbfffc;
  --card-soft: #f1faf4;
  --ink: #10261d;
  --muted: #5d7568;
  --line: #163c2e;
  --soft-line: #bed6c7;
  --accent: #087f5b;
  --accent-dark: #04563d;
  --accent-soft: #d3f2e2;
  --green: #176b4d;
  --green-soft: #d9f1e2;
  --warning: #ae4826;
  --shadow: 6px 6px 0 var(--ink);
  --shadow-soft: 3px 3px 0 var(--ink);
  --radius: 18px;
  --radius-sm: 10px;
  --emerald-night: #0b2b21;
  --emerald-deep: #073e2d;
  --emerald-mist: #e3f5eb;
  --emerald-line: #94bfa8;
  --emerald-glow: rgba(8, 127, 91, .12);
}

html { scroll-behavior: smooth; }

body {
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 88% 3%, rgba(8, 127, 91, .13), transparent 31rem),
    radial-gradient(circle at 3% 45%, rgba(23, 107, 77, .075), transparent 27rem),
    linear-gradient(rgba(7, 62, 45, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 62, 45, .04) 1px, transparent 1px);
  background-size: auto, auto, 28px 28px, 28px 28px;
}

::selection { color: #f4fff9; background: var(--accent-dark); }
:focus-visible { outline-color: var(--accent); }

.skip-link {
  color: var(--card);
  background: var(--ink);
  border-color: var(--card);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 18px 0;
  background: rgba(237, 245, 239, .88);
  border-bottom-color: rgba(22, 60, 46, .14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand { color: var(--ink); }
.brand-mark {
  color: #f3fff9;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .18), transparent 46%),
    var(--accent);
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 20px;
}
.brand-copy strong { color: var(--ink); letter-spacing: .11em; }
.brand-copy small { color: var(--muted); letter-spacing: .11em; }

.top-nav { color: #294d3e; }
.top-nav a { transition: color .16s ease; }
.top-nav a:hover,
.top-nav a:focus-visible { color: var(--accent-dark); }
.top-nav a::after { height: 2px; background: var(--accent); }

/* Hero */
.hero {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: clamp(38px, 7vw, 92px);
  align-items: center;
  padding-block: clamp(48px, 7.5vw, 96px) 74px;
}
.hero-copy,
.hero-visual { min-width: 0; }

.eyebrow { color: #5b7467; letter-spacing: .075em; }
.eyebrow span {
  color: #ecfff5;
  background: var(--accent-dark);
  border-radius: 4px;
  box-shadow: 2px 2px 0 rgba(7, 62, 45, .22);
}

.hero h1 {
  font-size: clamp(54px, 7.7vw, 94px);
  letter-spacing: -.075em;
}
.hero h1 em { color: var(--accent); }
.hero h1 em::after {
  height: .15em;
  background: var(--accent);
  opacity: .15;
  border-radius: 100%;
  bottom: .09em;
}

.hero-lead {
  max-width: 660px;
  color: #486354;
  line-height: 1.88;
}

.hero-facts { gap: 8px; }
.hero-facts span {
  padding: 6px 11px;
  color: #315746;
  background: rgba(251, 255, 252, .74);
  border-color: var(--emerald-line);
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.hero-actions .button { min-height: 48px; }

/* Hero tone sample board */
.tone-board {
  position: relative;
  isolation: isolate;
  align-self: center;
  justify-self: end;
  width: min(100%, 440px);
  padding: 22px 22px 18px;
  overflow: hidden;
  color: #eafff3;
  background:
    radial-gradient(circle at 80% 5%, rgba(94, 206, 153, .19), transparent 34%),
    linear-gradient(155deg, #10382a, var(--emerald-night));
  border: 1.5px solid #061e16;
  border-radius: 24px;
  box-shadow: 11px 11px 0 var(--accent);
  transform: rotate(.45deg);
}
.tone-board::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(220, 255, 237, .18) 1px, transparent 1px);
  background-size: 15px 15px;
  mask-image: linear-gradient(145deg, rgba(0, 0, 0, .74), transparent 64%);
}
.tone-board::after {
  content: "声";
  position: absolute;
  right: -14px;
  bottom: -34px;
  color: rgba(126, 221, 172, .08);
  font-family: var(--font-display);
  font-size: 150px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.tone-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  color: #8fb9a5;
  border-bottom: 1px solid rgba(195, 236, 214, .2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .11em;
}

.tone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 13px 0 11px;
}
.tone-sample {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  gap: 3px 8px;
  min-height: 104px;
  padding: 12px 13px 10px;
  background: rgba(226, 255, 240, .055);
  border: 1px solid rgba(190, 234, 212, .17);
  border-radius: 11px;
}
.tone-sample b {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  color: #f4fff9;
  font-family: var(--font-display);
  font-size: clamp(44px, 5vw, 58px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.05em;
}
.tone-sample small {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  color: #8fdfb7;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .015em;
}
.tone-sample em {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  color: #6f9d87;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-style: normal;
  text-align: right;
}

.tone-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  align-items: center;
  gap: 1px;
  overflow: hidden;
  background: rgba(140, 219, 178, .2);
  border: 1px solid rgba(174, 231, 202, .16);
  border-radius: 8px;
}
.tone-strip span {
  display: grid;
  place-items: center;
  min-height: 39px;
  color: #e8fff3;
  background: rgba(12, 48, 36, .8);
  font-family: var(--font-mono);
  font-size: 15px;
}
.tone-strip i {
  display: grid;
  place-items: center;
  align-self: stretch;
  padding: 0 13px;
  color: #08291e;
  background: #77d4a6;
  font-family: var(--font-sans);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.tone-foot {
  position: relative;
  z-index: 1;
  margin: 13px 1px 0;
  color: #9dbbb0;
  font-size: 10px;
  line-height: 1.7;
}

/* Main tool */
.tool-shell {
  margin-top: 10px;
  scroll-margin-top: 86px;
}
.card { min-width: 0; }
.card-heading { position: relative; z-index: 1; }
.form-actions { align-items: center; }
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 330px);
  gap: 25px;
  align-items: start;
}

.pinyin-card {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 3.8vw, 40px);
  background:
    radial-gradient(circle at 97% 1%, rgba(8, 127, 91, .095), transparent 22rem),
    linear-gradient(145deg, rgba(227, 245, 235, .46), transparent 40%),
    var(--card);
  box-shadow: 5px 5px 0 var(--line);
}
.pinyin-card::after {
  content: "";
  position: absolute;
  top: -74px;
  right: -74px;
  width: 168px;
  height: 168px;
  border: 23px solid var(--accent);
  border-radius: 50%;
  opacity: .08;
  pointer-events: none;
}
.pinyin-heading { position: relative; z-index: 1; align-items: flex-start; }
.pinyin-heading h2 {
  font-size: clamp(29px, 3.6vw, 40px);
  letter-spacing: -.035em;
}
.pinyin-heading p:not(.section-index) { max-width: 600px; }

.section-index { color: var(--accent-dark); letter-spacing: .15em; }
.status-pill {
  color: var(--accent-dark);
  background: var(--emerald-mist);
  border-color: var(--emerald-line);
  font-weight: 650;
  white-space: nowrap;
}
.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(8, 127, 91, .13);
}

/* Mode switch */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  margin: 25px 0 21px;
  padding: 5px;
  background: #e4f0e7;
  border-color: #aac8b6;
  border-radius: 12px;
}
.mode-tab {
  position: relative;
  min-height: 43px;
  padding: 8px 12px;
  color: #526c5d;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}
.mode-tab:hover { color: var(--accent-dark); background: rgba(251, 255, 252, .72); }
.mode-tab.is-active,
.mode-tab[aria-selected="true"] {
  color: #f6fff9;
  background: var(--accent);
  box-shadow: 0 2px 0 var(--accent-dark), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.mode-tab:focus-visible { outline-offset: 2px; }

/* Input and actions */
.field-label {
  margin-bottom: 8px;
  color: #254a39;
  font-size: 12.5px;
  letter-spacing: .02em;
}
#inputText {
  min-height: 188px;
  padding: 16px 17px;
  color: var(--ink);
  background: #fefffe;
  border: 1.5px solid #8fb4a0;
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(7, 62, 45, .04);
  font-size: 16px;
  line-height: 1.78;
}
#inputText::placeholder { color: #8da094; }
#inputText:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(8, 127, 91, .12), inset 0 1px 2px rgba(7, 62, 45, .04);
}

.input-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10.5px;
}
.input-meta > span { margin-right: auto; font-family: var(--font-mono); }
.text-button {
  min-height: 36px;
  color: var(--accent-dark);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid rgba(8, 127, 91, .3);
}
.text-button:hover { color: var(--accent); border-bottom-color: var(--accent); }

.pinyin-actions {
  align-items: center;
  gap: 12px;
  margin-top: 15px;
}
.pinyin-actions .button-primary {
  min-width: 158px;
  background: var(--accent);
  border-color: var(--line);
  box-shadow: 3px 3px 0 var(--line);
}
.pinyin-actions .button-primary:hover:not(:disabled) {
  background: var(--accent-dark);
  box-shadow: 4px 4px 0 var(--line);
}
.pinyin-actions .mini-note { max-width: 350px; margin: 0; }

.form-notice {
  margin: 18px 0 0;
  padding: 10px 13px;
  color: #315e49;
  background: #e8f7ee;
  border-left: 4px solid var(--accent);
  border-radius: 0 9px 9px 0;
  font-size: 11.5px;
  line-height: 1.72;
}
.form-notice.is-ok {
  color: #1d5e43;
  background: #dff5e8;
  border-left-color: var(--green);
}
.form-notice.is-error,
.form-notice.is-warning {
  color: #812d1b;
  background: #ffe9e0;
  border-left-color: var(--warning);
}

.result-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 24px;
}
.result-head > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
}
.result-label { font-size: 13px; font-weight: 750; letter-spacing: .02em; }
.result-head .mini-note { margin: 0; }
.result-mode {
  flex: 0 0 auto;
  padding: 4px 9px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid #aad5bf;
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.35;
}

/* Result */
#result,
.result {
  min-height: 146px;
  max-height: 350px;
  margin-top: 9px;
  padding: 17px 18px;
  overflow: auto;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(8, 127, 91, .035) 1px, transparent 1px),
    #f8fdf9;
  background-size: 25px 25px, auto;
  border: 1px solid #a8c9b6;
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(7, 62, 45, .035);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.9;
  letter-spacing: .015em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#result:empty::before {
  content: "生成后，拼音会显示在这里。";
  color: #7f9789;
  font-size: 12px;
  letter-spacing: 0;
}

/* Ruby output */
.ruby-view {
  margin-top: 9px;
  padding: 15px 17px 12px;
  background:
    radial-gradient(circle at 96% 0, rgba(8, 127, 91, .07), transparent 12rem),
    #f5fcf7;
  border: 1px solid #a8c9b6;
  border-left: 4px solid var(--accent);
  border-radius: 10px;
}
.ruby-view-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px 12px;
  padding-bottom: 10px;
  color: var(--accent-dark);
  border-bottom: 1px dashed #bad8c7;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
}
.ruby-view-top .mini-note { margin: 0; letter-spacing: 0; }
.ruby-content {
  min-height: 112px;
  max-height: 320px;
  padding: 17px 2px 5px;
  overflow: auto;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 30px);
  line-height: 2.35;
  overflow-wrap: anywhere;
}
.ruby-content ruby,
.ruby-demo ruby {
  ruby-position: over;
  margin-inline: 1px;
}
.ruby-content rt,
.ruby-demo rt {
  color: var(--accent-dark);
  font-family: var(--font-sans);
  font-size: .39em;
  font-weight: 650;
  letter-spacing: .015em;
}
.py-token {
  padding: 0 1px;
  border-radius: 3px;
  transition: background .14s ease;
}
.py-han { padding: 1px 2px 7px; border-radius: 3px; }
.py-token.is-poly { cursor: pointer; }
.py-token.is-poly .py-han {
  border-bottom: 1.5px dashed var(--accent);
  text-underline-offset: 5px;
}
.py-token.is-poly:hover .py-han { background: var(--accent-soft); }
.py-token.is-poly:focus-visible { outline-offset: 3px; }
.py-unknown,
.pinyin-unknown {
  color: #71391e;
  border-bottom: 1.5px dotted #bd7046;
  cursor: help;
}

/* Result buttons */
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}
.result-actions .button {
  flex: 1 1 126px;
  min-height: 42px;
  padding: 8px 11px;
  font-size: 11.5px;
}
.result-actions .button-primary {
  flex-grow: 1.35;
  color: #f5fff9;
  background: var(--accent-dark);
  border-color: var(--line);
}
.result-actions .button-quiet {
  color: #274f3d;
  background: #eef8f1;
  border-color: #a9c7b6;
}
.result-actions .button-quiet:hover:not(:disabled) {
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 3px 3px 0 var(--line);
}
.result-actions .button.is-copied,
.button.is-copied {
  color: #124b33;
  background: var(--green-soft);
  border-color: var(--green);
}
.tiny-lock {
  margin-left: 2px;
  padding: 1px 5px;
  color: #edfff4;
  background: var(--accent-dark);
  border-radius: 3px;
  font-size: 8px;
  letter-spacing: .02em;
}
[data-premium-control]:disabled {
  color: #6d8175;
  background: #ecf2ed;
  opacity: .72;
}

/* Coverage and stats */
.coverage-block {
  margin-top: 19px;
  padding: 13px 15px 14px;
  background: #eef8f1;
  border: 1px solid #bed9c9;
  border-radius: 10px;
}
.coverage-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 14px;
  font-size: 11px;
}
.coverage-line strong { color: #234b39; font-size: 11.5px; }
.coverage-line span { color: var(--muted); font-size: 10px; }
.coverage-meter {
  width: 100%;
  height: 8px;
  margin-top: 9px;
  overflow: hidden;
  background: #d6e6db;
  border: 1px solid #b7d1c0;
  border-radius: 100px;
}
.coverage-meter > i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #38b37a);
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .26);
  transition: width .24s ease;
}

.stats-grid { gap: 9px; margin-top: 15px; }
.pinyin-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pinyin-stats .stat {
  position: relative;
  overflow: hidden;
  padding: 11px 12px 10px;
  background: #f8fdf9;
  border-color: #c3dccc;
}
.pinyin-stats .stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
  opacity: .72;
}
.pinyin-stats .stat strong {
  color: var(--accent-dark);
  font-size: 22px;
  letter-spacing: -.03em;
}
.pinyin-stats .stat span { color: #647d6e; font-size: 9.5px; }

/* Polyphone panel */
.poly-panel {
  margin-top: 16px;
  padding: 15px 16px 16px;
  background:
    linear-gradient(135deg, rgba(211, 242, 226, .66), transparent 55%),
    #f5fcf7;
  border: 1px dashed #94bea7;
  border-radius: 12px;
}
.poly-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 11px;
}
.poly-heading h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: -.01em;
}
.poly-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}
.premium-chip {
  color: #effff6;
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  font-weight: 650;
  letter-spacing: .04em;
}
.poly-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.poly-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-height: 37px;
  padding: 6px 9px;
  color: var(--ink);
  background: #fbfefc;
  border: 1px solid #b7d2c1;
  border-radius: 7px;
  font-family: var(--font-sans);
  line-height: 1.2;
  text-align: left;
}
button.poly-chip { cursor: pointer; transition: border-color .14s ease, background .14s ease, transform .14s ease; }
button.poly-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.poly-chip b {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 19px;
}
.poly-chip span {
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
}
.poly-chip em {
  color: #7b9184;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-style: normal;
}
.poly-chip.is-changed {
  background: #dcf5e7;
  border-color: var(--accent);
  box-shadow: inset 0 -2px 0 rgba(8, 127, 91, .2);
}
.poly-chip.is-locked {
  color: #526d5d;
  background: #eff5f1;
  border-style: dashed;
  cursor: default;
}

.honesty-note {
  margin: 17px 0 0;
  padding-top: 13px;
  color: #657c6e;
  border-top: 1px solid #d4e5da;
  font-size: 10.5px;
  line-height: 1.78;
}
.honesty-note strong { color: var(--accent-dark); }

/* Tool side cards */
.side-stack { gap: 18px; }
.tone-guide,
.mode-card {
  padding: 23px 23px 21px;
  background: var(--card);
  border-color: var(--line);
  box-shadow: 4px 4px 0 var(--line);
}
.tone-guide h2,
.mode-card h2 {
  margin: 2px 0 10px;
  font-family: var(--font-display);
  font-size: clamp(23px, 2.5vw, 28px);
  line-height: 1.2;
  letter-spacing: -.025em;
}
.tone-guide .mini-note { margin-top: 12px; }

.tone-ladder {
  display: grid;
  gap: 0;
  margin-top: 13px;
  border-top: 1px solid #d9e8de;
}
.tone-ladder > div {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 43px;
  border-bottom: 1px solid #d9e8de;
}
.tone-num {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border: 1px solid #b9dcc9;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
}
.tone-ladder b {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
}
.tone-ladder small { color: var(--muted); font-size: 9px; text-align: right; }
.tone-ladder .is-neutral .tone-num { color: #64786c; background: #e8f0eb; border-color: #ccdcd1; }
.tone-ladder .is-neutral b { color: #5e7466; font-weight: 500; }

.mode-card p:not(.section-index) {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.78;
}
.mode-example {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 13px;
  background: var(--emerald-night);
  border-radius: 9px;
}
.mode-example b {
  color: #f1fff7;
  font-family: var(--font-display);
  font-size: 23px;
}
.mode-example span {
  color: #8ee0b5;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .02em;
}
.fact-list { margin-top: 14px; }
.fact-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed #d1e4d7;
  font-size: 10.5px;
}
.fact-list > div:last-child { border-bottom: 0; }
.fact-list span { color: var(--muted); }
.fact-list strong { color: #2a513e; font-size: 10.5px; font-weight: 650; }

/* Premium feature grid */
.premium-shell {
  margin-top: 62px;
  scroll-margin-top: 86px;
}
.guide-heading { border-bottom-color: #b9d2c2; }
.guide-heading h2 { letter-spacing: -.055em; }
.guide-heading > p { color: #61796b; }

.premium-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.feature-card {
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 2.8vw, 28px);
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(8, 127, 91, .08), transparent 12rem),
    var(--card);
  border-color: var(--line);
  box-shadow: 4px 4px 0 var(--accent);
}
.feature-card:nth-child(2) { box-shadow: 4px 4px 0 var(--green); }
.feature-card:nth-child(3) { box-shadow: 4px 4px 0 var(--line); }
.feature-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 15px;
}
.feature-no {
  color: #a7bfb1;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.04em;
}
.feature-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 24px);
  line-height: 1.25;
  letter-spacing: -.025em;
}
.feature-card > p:not(.lock-note) {
  margin: 12px 0 15px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.75;
}
.feature-card > .button { margin-top: auto; width: 100%; }

.ruby-demo {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  min-height: 86px;
  padding: 15px 14px 11px;
  color: var(--ink);
  background: #f1faf4;
  border: 1px solid #c0dcc9;
  border-radius: 9px;
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 2;
}
.ruby-demo rt { color: var(--accent); font-size: 10px; }

.poly-demo {
  display: grid;
  gap: 5px;
  min-height: 86px;
  padding: 10px;
  background: #f1faf4;
  border: 1px solid #c0dcc9;
  border-radius: 9px;
}
.poly-demo > span {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  color: var(--ink);
  background: rgba(251, 255, 252, .8);
  border: 1px solid #d2e5d9;
  border-radius: 5px;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.2;
}
.poly-demo i {
  color: var(--accent-dark);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-style: normal;
}
.poly-demo b { color: #9bb3a5; font-size: 10px; font-weight: 400; }

.export-demo {
  display: grid;
  align-content: center;
  gap: 7px;
  min-height: 86px;
  padding: 11px 12px;
  overflow: hidden;
  background: var(--emerald-night);
  border: 1px solid #173c2d;
  border-radius: 9px;
}
.export-demo code {
  overflow: hidden;
  color: #93e2b9;
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.export-demo span {
  width: max-content;
  padding: 3px 8px;
  color: #0b2b21;
  background: #79d7a8;
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 13px;
}

.lock-note {
  margin: 0 0 13px;
  padding: 9px 11px;
  color: #6e3925;
  background: #fff0e7;
  border-left: 3px solid #c66943;
  border-radius: 0 7px 7px 0;
  font-size: 10px;
  line-height: 1.68;
}
body.is-premium .premium-chip { background: var(--green); border-color: var(--green); }
body.is-premium .premium-chip::after { content: " ✓"; }
body.is-premium .pinyin-card { box-shadow: 5px 5px 0 var(--green); }
body.is-premium .feature-card { box-shadow: 4px 4px 0 var(--green); }
body.is-premium .premium-map { box-shadow: 5px 5px 0 var(--green); }

/* How-to, FAQ and unlock */
.guide-shell,
.faq-shell { scroll-margin-top: 86px; }
.how-to-grid li {
  border-color: var(--line);
  box-shadow: 3px 3px 0 var(--accent);
}
.how-to-grid li > span {
  color: #f1fff7;
  background: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent-dark);
}
.how-to-grid h3 { color: #1d4633; }
.faq-list details {
  background: rgba(251, 255, 252, .82);
  border-color: #c0d9c9;
}
.faq-list details[open] {
  border-color: #96bea7;
  box-shadow: 2px 2px 0 rgba(8, 127, 91, .12);
}
.faq-list summary { color: #204a36; }
.faq-list summary::after { color: var(--accent); }
.faq-list p { color: #536c5d; }

.unlock-section { scroll-margin-top: 86px; }
.premium-map {
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 5px 5px 0 var(--accent);
}
.premium-map h2 { color: #173f2d; }
.premium-map li { color: #496353; border-bottom-color: #d2e4d8; }
.premium-map li span { color: var(--accent); }
.premium-map > p:last-child { color: #677e70; }

/* Referral card and share prompt */
.referral-card {
  color: #ebfff4;
  background:
    radial-gradient(circle at 92% 7%, rgba(80, 196, 139, .18), transparent 16rem),
    var(--emerald-night);
  border-color: #061e16;
  box-shadow: 7px 7px 0 var(--accent);
}
.referral-card::after { border-color: #5bd095; opacity: .18; }
.referral-kicker { color: #9dbbae; }
.referral-dot { background: #6bdaa2; box-shadow: 0 0 0 4px rgba(107, 218, 162, .18); }
.referral-heading h2 { color: #f2fff7; }
.referral-heading p { color: #b1cbbf; }
.referral-badge { color: #bfd7ca; border-color: #4d6d5c; }
.referral-badge.is-unlocked,
.referral-badge.is-trial { color: #0b2b21; background: #a4e9c4; border-color: #a4e9c4; }
.referral-badge.is-trial { background: #ffd9c8; border-color: #ffd9c8; }
.referral-progress { color: #c5d9cf; }
.referral-steps i { background: #355344; }
.referral-steps i.is-filled { background: #6bdaa2; }
.referral-label { color: #a9c3b6; }
.referral-link {
  color: #e5f8ee !important;
  background: #163a2d !important;
  border-color: #4a6959 !important;
}
.referral-copy {
  color: #08291e;
  background: #72d6a2;
  border-color: #72d6a2;
}
.referral-copy:hover { background: #98e7bc; }
.referral-copy.is-copied { background: #c9f1d9; border-color: #c9f1d9; }
.referral-foot { color: #8ea99b; }
.referral-refresh { color: #bfd4c9; border-bottom-color: #547161; }
.referral-refresh:hover { color: #f1fff7; }
.referral-trial { color: #d8ffe7; background: rgba(72, 172, 120, .16); border-color: rgba(114, 214, 162, .32); }
.share-prompt {
  color: #effff6;
  background: var(--emerald-night);
  border-color: #dff9e9;
  box-shadow: 5px 5px 0 var(--accent);
}
.share-prompt-copy span { color: #b8d4c5; }
.share-prompt-action { color: #08291e; background: #72d6a2; border-color: #72d6a2; }
.share-prompt-action.is-copied { background: #c9f1d9; border-color: #c9f1d9; }
.share-prompt-close { color: #b9d1c4; }

/* Popup chooser */
.poly-popup {
  position: fixed;
  z-index: 90;
  width: min(286px, calc(100vw - 24px));
  max-height: min(430px, calc(100vh - 24px));
  padding: 15px;
  overflow: auto;
  color: var(--ink);
  background: #fefffe;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  box-shadow: 5px 5px 0 var(--accent), 0 18px 44px rgba(7, 36, 25, .18);
}
.poly-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid #d3e5da;
}
.poly-popup-head strong {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: -.01em;
}
.poly-popup-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  color: #4c6557;
  background: #edf6f0;
  border: 1px solid #c3d9ca;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.poly-popup-close:hover { color: var(--accent-dark); background: var(--accent-soft); border-color: var(--accent); }
.poly-popup-note {
  margin: 9px 0 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}
.poly-options { display: grid; gap: 6px; }
.poly-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 7px 10px;
  color: #244c39;
  background: #f4faf6;
  border: 1px solid #c7dccf;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.poly-option:hover { background: var(--accent-soft); border-color: var(--accent); }
.poly-option.is-current {
  color: #063d2b;
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 700;
}
.poly-option small {
  color: var(--accent-dark);
  font-family: var(--font-sans);
  font-size: 8.5px;
  font-weight: 650;
}
.poly-reset {
  width: 100%;
  min-height: 38px;
  margin-top: 9px;
  color: var(--accent-dark);
  background: transparent;
  border: 0;
  border-top: 1px dashed #c9ded2;
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.poly-reset:disabled { color: #99aa9f; cursor: not-allowed; text-decoration: none; }

/* Footer */
.site-footer {
  margin-top: 72px;
  color: #e9fff2;
  background:
    radial-gradient(circle at 88% 0, rgba(49, 144, 98, .17), transparent 20rem),
    var(--emerald-night);
}
.footer-main { align-items: center; }
.footer-brand strong { color: #f2fff7; }
.footer-brand p { color: #9ab4a7; }
.footer-mark {
  color: #08291e;
  background: #72d6a2;
  border-color: #d9f7e4;
}
.footer-links a,
#toolLinks a { color: #b9d2c5; }
.footer-links a:hover,
#toolLinks a:hover { color: #7ee1ab; }
.footer-base { color: #829d8f; border-top-color: #2a4b3b; }

/* Responsive */
@media (max-width: 1040px) {
  .work-grid { grid-template-columns: minmax(0, 1fr) 292px; }
  .premium-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 38px;
    padding-block: 48px 58px;
  }
  .tone-board {
    justify-self: start;
    width: min(100%, 520px);
    transform: none;
  }
  .work-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unlock-section { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .site-header { padding: 13px 0; }
  .hero { padding-top: 40px; }
  .pinyin-card { padding: 22px 20px; }
  .side-stack { grid-template-columns: 1fr; }
  .premium-grid { grid-template-columns: 1fr; }
  .feature-card:last-child { grid-column: auto; }
  .premium-shell { margin-top: 48px; }
  .guide-heading h2 { font-size: clamp(32px, 8vw, 46px); }
  .pinyin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-actions .button { flex-basis: calc(50% - 4px); }
  .result-actions .button-primary { flex-basis: 100%; }
}

@media (max-width: 520px) {
  .header-inner { gap: 9px; }
  .brand { gap: 8px; }
  .brand-mark { width: 37px; height: 37px; font-size: 17px; }
  .brand-copy strong { font-size: 15px; }
  .top-nav { gap: 8px; font-size: 10.5px; }
  .top-nav a { white-space: nowrap; }
  .hero h1 { font-size: clamp(44px, 14.5vw, 64px); }
  .hero-lead { font-size: 14px; line-height: 1.82; }
  .hero-actions .button { flex: 1 1 100%; }
  .tone-board { padding: 18px 17px 16px; box-shadow: 8px 8px 0 var(--accent); }
  .tone-sample { min-height: 92px; padding: 10px; }
  .tone-sample b { font-size: 43px; }
  .tone-sample small { font-size: 9.5px; }
  .tone-sample em { font-size: 8.5px; }
  .tone-foot { font-size: 9.5px; }
  .section-index { font-size: 9px; }
  .result-head { align-items: flex-start; }
  .result-head > div { display: grid; gap: 2px; }
  .ruby-content { font-size: 25px; line-height: 2.35; }
}

/* 375px narrow phone */
@media (max-width: 400px) {
  .shell,
  .shell.narrow { width: calc(100% - 28px); }
  .site-header { padding: 11px 0; }
  .header-inner { gap: 8px; }
  .brand-copy strong { font-size: 14px; letter-spacing: .07em; }
  .top-nav { gap: 7px; font-size: 10px; }
  .hero { gap: 28px; padding-top: 34px; padding-bottom: 46px; }
  .eyebrow { gap: 6px 8px; margin-bottom: 17px; font-size: 9px; }
  .hero h1 { font-size: clamp(41px, 14vw, 52px); line-height: .98; }
  .hero-facts { gap: 6px; }
  .hero-facts span { padding: 5px 8px; font-size: 9px; }
  .hero-actions { margin-top: 22px; }
  .tone-board { width: 100%; padding: 16px 14px 14px; border-radius: 18px; }
  .tone-grid { gap: 6px; padding-block: 10px 9px; }
  .tone-sample { min-height: 82px; padding: 9px 8px; }
  .tone-sample b { font-size: 38px; }
  .tone-sample small { font-size: 8.5px; }
  .tone-sample em { font-size: 8px; }
  .tone-strip span { min-height: 36px; font-size: 13px; }
  .tone-strip i { padding-inline: 9px; font-size: 8px; }
  .tool-shell { margin-top: 0; }
  .pinyin-card { padding: 18px 15px; box-shadow: 3px 3px 0 var(--line); }
  .pinyin-heading h2 { font-size: 27px; }
  .pinyin-heading .status-pill { align-self: flex-start; }
  .mode-tabs { margin-block: 19px 17px; padding: 4px; }
  .mode-tab { min-height: 42px; padding-inline: 5px; font-size: 11.5px; }
  #inputText { min-height: 170px; padding: 13px; font-size: 16px; }
  .input-meta { gap: 0 8px; font-size: 9.5px; }
  .text-button { min-height: 38px; font-size: 10.5px; }
  .pinyin-actions { align-items: stretch; flex-direction: column; }
  .pinyin-actions .button-primary { width: 100%; }
  .pinyin-actions .mini-note { max-width: none; }
  #result,
  .result { min-height: 132px; padding: 14px; font-size: 16px; }
  .ruby-view { padding: 13px 13px 9px; }
  .ruby-content { min-height: 100px; padding-top: 13px; font-size: 23px; }
  .result-actions { gap: 7px; }
  .result-actions .button { flex-basis: calc(50% - 4px); min-height: 42px; padding-inline: 7px; font-size: 10.5px; }
  .result-actions .button-primary { flex-basis: 100%; }
  .coverage-block { padding: 11px 12px 12px; }
  .coverage-line { display: grid; gap: 2px; }
  .pinyin-stats { gap: 7px; }
  .pinyin-stats .stat { padding: 9px 9px 8px; }
  .pinyin-stats .stat strong { font-size: 19px; }
  .pinyin-stats .stat span { font-size: 9px; }
  .poly-panel { padding: 13px 12px 14px; }
  .poly-heading h3 { font-size: 15px; }
  .poly-chip { min-height: 35px; padding: 5px 7px; }
  .tone-guide,
  .mode-card { padding: 19px 17px 17px; box-shadow: 3px 3px 0 var(--line); }
  .tone-guide h2,
  .mode-card h2 { font-size: 23px; }
  .premium-shell { margin-top: 42px; }
  .feature-card { padding: 18px 16px; box-shadow: 3px 3px 0 var(--accent); }
  .ruby-demo { font-size: 27px; }
  .premium-map { padding: 20px 18px; box-shadow: 4px 4px 0 var(--accent); }
  .premium-map h2 { font-size: 26px; }
  .referral-card { padding: 20px 17px; box-shadow: 5px 5px 0 var(--accent); }
  .referral-heading h2 { font-size: 25px; }
  .poly-popup { padding: 13px; }
  .site-footer { margin-top: 54px; }
  .footer-base { font-size: 8.5px; line-height: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
  .tone-board { transform: none; }
  .mode-tab,
  .result-actions .button,
  .poly-chip,
  .coverage-meter > i { transition: none; }
}

@media print {
  .tone-board { color: var(--ink); background: #fff; box-shadow: none; }
  .pinyin-card,
  .feature-card,
  .premium-map,
  .referral-card { box-shadow: none; }
}
