/* newword-starter · 样式
 * 两种主题色：墨蓝 --ink、橙 --accent，其余是中性色。
 * 第一屏（.play）正好一屏高：1920×1080、640×360、390×844 三档都要放下。 */
:root {
  --ink: #16324f;
  --accent: #e07a1f;
  --paper: #f6f4ef;
  --card: #ffffff;
  --text: #1d2733;
  --muted: #5b6878;
  --line: #dcd8cf;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); line-height: 1.55; -webkit-text-size-adjust: 100%; }
a { color: var(--ink); }
h1, h2 { color: var(--ink); line-height: 1.2; }

/* ---------- 按钮 ---------- */
.btn {
  font: inherit; font-weight: 600; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 1.1em; border-radius: 999px;
  border: 2px solid var(--ink); background: var(--ink); color: #fff;
  cursor: pointer; text-decoration: none; touch-action: manipulation;
}
.btn:hover { filter: brightness(1.12); }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: .4; cursor: default; filter: none; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-big {
  width: clamp(140px, 34vmin, 260px); height: clamp(140px, 34vmin, 260px);
  border-radius: 50%; font-size: clamp(1.2rem, 4.5vmin, 2.2rem);
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 6px 0 #a9560f; transition: transform .05s, box-shadow .05s;
}
.btn-big:active { transform: translateY(4px); box-shadow: 0 2px 0 #a9560f; }

/* ---------- 第一屏 ---------- */
.play {
  position: relative; height: 100vh; height: 100svh; min-height: 320px;
  display: flex; flex-direction: column; align-items: center;
  padding: max(12px, env(safe-area-inset-top)) 16px 8px;
}
.play-head { text-align: center; max-width: 52rem; }
.play-head h1 { margin: 0; font-size: clamp(1.4rem, 4.2vmin, 2.6rem); }
.tagline { margin: .25em 0 0; color: var(--muted); font-size: clamp(.85rem, 2.1vmin, 1.1rem); }
.game {
  flex: 1; width: 100%; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(6px, 2vmin, 18px);
}
.play-more { font-size: .9rem; color: var(--muted); padding: 6px 10px; }

/* 占位演示，换玩法时一起删 */
.demo-count { margin: 0; font-size: clamp(2.2rem, 10vmin, 6rem); font-weight: 800; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.demo-hint { margin: 0; color: var(--muted); font-size: .9rem; text-align: center; }

/* ---------- 结果面板（盖在第一屏上） ---------- */
.result {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center; padding: 12px;
  background: rgba(246, 244, 239, .92);
}
.result[hidden] { display: none; }
.result-card {
  width: min(460px, 100%); max-height: 100%; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(12px, 3vmin, 28px); text-align: center;
  box-shadow: 0 10px 30px rgba(22, 50, 79, .12);
}
.result-title { margin: 0; color: var(--muted); font-size: .95rem; }
.result-score { margin: .1em 0; font-size: clamp(2.4rem, 11vmin, 5rem); font-weight: 800; color: var(--accent); line-height: 1.05; font-variant-numeric: tabular-nums; }
.result-pitch { margin: 0 0 .8em; color: var(--text); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.result-toast { min-height: 1.4em; margin: .6em 0 0; color: var(--muted); font-size: .9rem; }

/* ---------- 说明区 ---------- */
.about { max-width: 46rem; margin: 0 auto; padding: 24px 16px 40px; }
.about h2 { margin: 1.6em 0 .5em; font-size: 1.4rem; }
.about ul { padding-left: 1.2em; }
.about li { margin: .35em 0; }
details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin: 10px 0; padding: 0 16px; }
summary { cursor: pointer; font-weight: 600; padding: 12px 0; color: var(--ink); }
details p { margin: 0 0 14px; }

/* ---------- 页脚、隐私页、404 ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 16px; text-align: center; color: var(--muted); font-size: .85rem; }
.site-foot p { margin: 0; }
.doc { max-width: 42rem; margin: 0 auto; padding: 32px 16px; }

/* ---------- 工具模式（mode: 'tool'） ---------- */
.play.expanded { height: auto; min-height: 100vh; min-height: 100svh; }
.tool {
  flex: 1; width: min(720px, 100%); min-height: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 8px 0;
}
.tool-label { font-weight: 600; color: var(--ink); }
.tool-input {
  width: 100%; height: clamp(110px, 28vh, 320px); resize: vertical; font: inherit; line-height: 1.45;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text);
}
.tool-input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-result { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tool-result[hidden] { display: none; }
.tool-stats { margin: 0 0 6px; color: var(--muted); font-size: .9rem; }
.tool-output { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; max-height: 40vh; overflow: auto; }
.tool-result-actions { margin: 8px 0 0; display: flex; align-items: center; gap: 10px; }
.tool-toast { color: var(--muted); font-size: .9rem; }
.pay { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; }
.btn-pay { background: var(--accent); border-color: var(--accent); }
.pay-note { margin: 6px 0 0; color: var(--muted); font-size: .85rem; }
.longtail ul { padding-left: 1.2em; }
.site-foot .foot-pay { margin-bottom: 10px; }
.site-foot .foot-links { margin-top: 6px; }

/* pricing / 法务页 / 长尾页 */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 20px 0; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.plan h2 { margin: 0; font-size: 1.2rem; }
.plan-price { margin: 6px 0 2px; font-size: 1.8rem; font-weight: 800; color: var(--ink); }
.plan-billing { margin: 0; color: var(--muted); font-size: .9rem; }
.plan ul { padding-left: 1.2em; }
.legal h2 { font-size: 1.15rem; margin-top: 1.4em; }

/* 矮屏（横屏手机、640×360）：压缩第一屏 */
@media (max-height: 460px) {
  .play { padding-top: 6px; }
  .tagline { display: none; }
  .demo-hint { display: none; }
  .btn-big { width: 120px; height: 120px; font-size: 1.15rem; }
  .btn { min-height: 38px; }
  .result-card { padding: 10px 14px; }
  .result-score { font-size: 2.4rem; }
  .result-pitch { margin-bottom: .4em; font-size: .9rem; }
  .result-toast { margin-top: .3em; }
  .tool-label { display: none; }
  .tool-input { height: 72px; }
  .tool { gap: 6px; }
}

/* ---------- 合集首页 ---------- */
.hub { max-width: 46rem; margin: 0 auto; padding: 48px 16px 40px; }
.hub h1 { margin: 0; font-size: clamp(2rem, 6vw, 2.8rem); }
.hub .tagline { font-size: 1.1rem; margin: .4em 0 1.6em; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: var(--text); }
.card:hover { border-color: var(--ink); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card h2 { margin: 0 0 .3em; font-size: 1.3rem; }
.card p { margin: 0; color: var(--muted); }
.plans-title { font-size: 1.2rem; margin: 1.6em 0 0; }
.plans-title a { text-decoration: none; }
.plan h3 { margin: 0; font-size: 1.15rem; color: var(--ink); }
.plan-delivery { color: var(--muted); font-size: .9rem; }
