/* ============================================================
   我是谁 · 同生共命 — 烛光夜色 / 灯下生辰册
   深暖棕夜色 + 琥珀烛光 + 朱红点缀。全站系统字体，无外部资源。
   ============================================================ */

:root {
  --night:    #221A12;   /* 夜色底 */
  --night-2:  #1B150E;   /* 更深一层的夜（页头/页脚） */
  --card:     #2C2215;   /* 卡片 */
  --card-2:   #362A1B;   /* 输入框 */
  --line:     #4A3A26;   /* 描边 */
  --paper:    #F3E7CB;   /* 烛下纸 */
  --paper-dim:#C9B48D;   /* 次文字 */
  --paper-faint:#A89068; /* 弱文字（≥5.09:1，过 AA） */
  --amber:    #FFB547;   /* 烛火 */
  --amber-soft:#FFD9A0;
  --vermil:   #E0493F;   /* 朱红（蜡烛/樱桃/强调） */
  --vermil-soft:#F2A096;

  --serif: "Noto Serif SC","Songti SC","SimSun","STSong",Georgia,"Times New Roman",serif;
  --sans:  "PingFang SC","Hiragino Sans GB","Noto Sans CJK SC","Microsoft YaHei",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --latin: Georgia,"Times New Roman",serif;

  --radius: 16px;
  --shadow: 0 1px 0 rgba(255,255,255,.03), 0 12px 30px rgba(0,0,0,.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden 属性必须永远赢过任何 display 声明（如 .btn 的 inline-flex） */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255,181,71,.08), transparent 60%),
    var(--night);
  color: var(--paper);
  font: 16px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

/* 大字模式：根字号放大，间距随 em 同步放大 */
html.big { font-size: 120%; }

::selection { background: var(--amber); color: var(--night); }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

a { color: var(--amber); }
a:hover { color: var(--amber-soft); }

.skip {
  position: absolute; left: 0; top: -1000px;
  background: var(--amber); color: var(--night);
  padding: .7em 1.2em; font-weight: 700; border-radius: 0 0 10px 0; z-index: 50;
}
.skip:focus { top: 0; }

/* ---------- 页头 ---------- */
.sitehead {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--night-2) 96%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--paper); }
.brand-logo { width: 40px; height: 40px; display: block; flex: none; }
.brand-name { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; letter-spacing: .06em; }
.brand-name em {
  display: block; font-style: normal; font-family: var(--sans);
  font-size: .6rem; font-weight: 400; color: var(--amber); letter-spacing: .42em; margin-top: -.1rem;
}
.mainnav {
  display: flex; gap: .25rem; margin-left: auto;
  flex: 1 1 auto; min-width: 0; /* 允许收缩，内部滚动而不是撑破页头 */
  overflow-x: auto; scrollbar-width: none;
}
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a {
  color: var(--paper-dim); text-decoration: none;
  padding: .4em .7em; border-radius: 999px; font-size: .92rem; white-space: nowrap;
}
.mainnav a:hover { color: var(--amber); background: rgba(255,181,71,.1); }
.bigtext {
  flex: none;
  background: var(--card); color: var(--amber);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .5em .9em; font-size: .85rem; font-weight: 600; letter-spacing: .08em;
  cursor: pointer; transition: .2s;
}
.bigtext:hover { border-color: var(--amber); }
.bigtext[aria-pressed="true"] { background: var(--amber); color: var(--night); border-color: var(--amber); }
.guidebtn {
  flex: none; display: inline-flex; align-items: center; gap: .38em;
  background: transparent; color: var(--paper-dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .5em .8em; font-family: inherit; font-size: .82rem; font-weight: 600;
  white-space: nowrap; cursor: pointer; transition: .2s;
}
.guidebtn:hover { color: var(--amber); border-color: var(--amber); }
.guidebtn-icon { width: 1.05em; height: 1.05em; flex: none; opacity: .85; }

.langbtn {
  flex: none;
  background: transparent; color: var(--paper-dim);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .5em .8em; font-size: .82rem; font-weight: 700; letter-spacing: .04em;
  cursor: pointer; transition: .2s;
}
.langbtn:hover { color: var(--amber); border-color: var(--amber); }
.langbtn[aria-pressed="true"] { background: var(--amber); color: var(--night); border-color: var(--amber); }

/* ---------- 通用 ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem) 4rem; }

.chapter { padding-top: clamp(3rem, 8vw, 5.5rem); }
.chapter-lead { color: var(--paper-dim); font-size: 1.05rem; max-width: 46em; margin: 0 0 1.8rem; }
.chapter-lead strong { color: var(--paper); }

.eyebrow {
  display: flex; align-items: center; gap: .7rem;
  font-family: var(--serif); font-weight: 700; letter-spacing: .28em;
  font-size: 1rem; color: var(--paper-dim); margin-bottom: 1rem;
}
.eyebrow svg { width: 22px; height: 22px; color: var(--amber); }
.eyebrow::after { content: ""; height: 1px; flex: 1; background: linear-gradient(to right, var(--line), transparent); }

.subhead { font-family: var(--serif); font-size: 1.12rem; font-weight: 700; margin: 1.6rem 0 .7rem; letter-spacing: .03em; }
.minihead { font-size: .92rem; color: var(--amber); margin: 1.2rem 0 .5rem; letter-spacing: .1em; }
.hint { color: var(--paper-dim); font-size: .9rem; max-width: 52em; }
.consent { color: var(--paper-dim); font-size: .9rem; max-width: 52em; margin-top: .8rem; }
.consent strong { color: var(--paper); }

.card {
  background: linear-gradient(180deg, var(--card), color-mix(in srgb, var(--card) 85%, var(--night-2)));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.2rem, 3vw, 1.9rem); box-shadow: var(--shadow);
  margin: 0 0 1.2rem;
}
.card h3 { margin-top: 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 1px solid transparent; border-radius: 999px;
  padding: .85em 1.7em; font: inherit; font-weight: 600; letter-spacing: .06em;
  cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .2s, background .2s, border-color .2s, color .2s;
  min-height: 48px;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--amber); color: var(--night); box-shadow: 0 6px 22px rgba(255,181,71,.25); }
.btn-primary:hover { background: var(--amber-soft); color: var(--night); box-shadow: 0 8px 26px rgba(255,181,71,.35); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--paper-dim); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }
.btn-soft { background: var(--card-2); border-color: var(--line); color: var(--paper); }
.btn-soft:hover { border-color: var(--amber); }
.btn-danger { background: transparent; border-color: var(--vermil-soft); color: var(--vermil-soft); }
.btn-danger:hover { background: rgba(224,73,63,.12); }

/* ---------- 扉页 ---------- */
.hero { text-align: center; padding: clamp(3rem, 9vw, 6rem) 0 2rem; }
.hero-logo-wrap { position: relative; display: inline-block; margin-bottom: 1.4rem; }
.hero-logo-wrap::before {
  content: ""; position: absolute; inset: -22px;
  background: radial-gradient(closest-side, rgba(255,181,71,.35), transparent 70%);
  border-radius: 50%; pointer-events: none;
}
.hero-logo { width: clamp(130px, 22vw, 190px); height: auto; display: block; position: relative; animation: flicker 5s ease-in-out infinite; }
@keyframes flicker {
  0%,100% { filter: drop-shadow(0 0 6px rgba(255,181,71,.35)); }
  50%     { filter: drop-shadow(0 0 14px rgba(255,181,71,.55)); }
}
@media (prefers-reduced-motion: reduce) { .hero-logo, .flicker { animation: none !important; } }

.hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 4.4rem); letter-spacing: .28em; text-indent: .28em;
  line-height: 1.15; margin-bottom: 1.1rem;
}
.hero-hook {
  font-family: var(--serif); color: var(--amber);
  font-size: clamp(1.15rem, 3.2vw, 1.7rem); letter-spacing: .04em; line-height: 1.7;
  margin-bottom: 1rem;
}
.hero-hook b { color: var(--amber-soft); font-weight: 700; }
.hero-sub { color: var(--paper-dim); font-size: 1.02rem; max-width: 34em; margin: 0 auto 1.9rem; }
.hero-sub strong { color: var(--paper); }
.hero-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.4rem; }
.hero-note { color: var(--paper-faint); font-size: .88rem; max-width: 40em; margin: 0 auto; }

/* 页面对访问者的两句承诺：不让隐私提示把人吓走 */
.promise-line {
  color: var(--amber-soft);
  font-family: var(--serif);
  font-size: clamp(1.08rem, 1rem + .7vw, 1.32rem);
  font-weight: 600;
  letter-spacing: .04em;
  margin: .55rem auto 1.3rem;
}
.consent-note {
  color: var(--amber-soft);
  font-size: 1.04rem;
  line-height: 1.6;
  margin: 1.1rem 0 .2rem;
  padding: .75rem 1rem .75rem 1.1rem;
  background: rgba(255, 181, 71, .08);
  border-left: 4px solid var(--amber);
  border-radius: 0 12px 12px 0;
}

/* ---------- 数据屏（动态计数） ---------- */
.databand {
  margin-top: 2.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.4rem 1.2rem 1.2rem;
  text-align: center;
}
.databand-title {
  color: var(--paper-dim); font-size: .92rem; letter-spacing: .16em;
  margin: 0 0 1rem;
}
.databand-grid {
  display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap;
}
.databand-item {
  flex: 1 1 0; min-width: 96px; max-width: 230px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 1rem .5rem;
}
.databand-num {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  color: var(--amber); line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.databand-label {
  display: block; margin-top: .45rem;
  color: var(--paper-dim); font-size: .82rem; line-height: 1.5;
}
.databand-note {
  color: var(--paper-faint); font-size: .8rem; max-width: 46em;
  margin: .9rem auto 0; line-height: 1.7;
}

/* ---------- 同生共命 ---------- */
.fate-picker {
  display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem clamp(1rem, 4vw, 2rem); box-shadow: var(--shadow);
}
.fate-field { display: flex; align-items: center; gap: .5rem; color: var(--paper-dim); font-size: .95rem; }
.fate-field select {
  font: 700 1.5rem var(--serif); color: var(--amber);
  background: var(--card-2); border: 1px solid var(--line); border-radius: 12px;
  padding: .5em .9em; min-height: 56px; cursor: pointer;
}
.fate-field select:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.fate-and { color: var(--paper-dim); font-size: 1.05rem; }

.sharebar {
  display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1rem;
  margin-top: 1rem; padding: 1rem clamp(1rem, 3vw, 1.4rem);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.sharebar-lead { flex: 1 1 22em; color: var(--paper-dim); font-size: .95rem; }
.sharebar-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.sharebar-status { flex: 1 1 100%; color: var(--amber-soft); font-size: .9rem; }
@media (max-width: 560px) {
  .sharebar-actions { width: 100%; }
  .sharebar-actions .btn { flex: 1 1 auto; justify-content: center; }
}

.fate-result { margin-top: 1.4rem; }
.fate-empty { color: var(--paper-dim); text-align: center; padding: 1.2rem 0; }
.famous-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .9rem;
  margin: 1.2rem 0 1.4rem;
}
.famous-card {
  background: linear-gradient(180deg, var(--card), var(--night-2));
  border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.15rem;
}
.famous-name { font-family: var(--serif); font-size: 1.28rem; font-weight: 700; color: var(--paper); letter-spacing: .03em; }
.famous-orig { color: var(--paper-faint); font-size: .82rem; margin-top: .15rem; }
.famous-tags { display: flex; gap: .45rem; flex-wrap: wrap; margin: .6rem 0 .5rem; }
.famous-tag {
  font-size: .76rem; color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  border-radius: 999px; padding: .1em .7em; letter-spacing: .08em;
}
.famous-era { color: var(--paper-dim); font-family: var(--latin); font-size: .85rem; }
.famous-note { color: var(--paper-dim); font-size: .86rem; margin-top: .4rem; line-height: 1.6; }
.fate-meta { color: var(--paper-dim); font-size: .92rem; }
.fate-meta b { color: var(--amber); font-family: var(--latin); font-size: 1.05em; }

.honesty {
  display: flex; gap: .8rem; align-items: flex-start;
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; margin-top: 1.4rem; color: var(--paper-dim);
}
.honesty svg { width: 22px; height: 22px; color: var(--amber); flex: none; margin-top: .2rem; }
.honesty p { font-size: .9rem; line-height: 1.75; }
.honesty strong { color: var(--amber-soft); }

/* 获奖者分布趋势区 */
.trend .subhead { margin-top: 0; }
.trend-filters { display: flex; gap: .45rem; flex-wrap: wrap; margin: .1rem 0 .6rem; }
.trend-filters button {
  font: inherit; font-size: .85rem; color: var(--paper-dim);
  background: var(--card-2); border: 1px solid var(--line); border-radius: 999px;
  padding: .45em 1em; min-height: 36px; cursor: pointer; letter-spacing: .06em; transition: .15s;
}
.trend-filters button:hover { border-color: var(--amber); color: var(--amber); }
.trend-filters button[aria-pressed="true"] {
  background: var(--amber); color: var(--night); border-color: var(--amber); font-weight: 700;
}
.trend-expect { color: var(--paper-dim); font-size: .9rem; margin-bottom: .9rem; }
.trend .bar-val { font-size: .85rem; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 1.1rem; }
.field label, .optin-row { color: var(--paper); font-size: .98rem; font-weight: 600; display: block; margin-bottom: .4rem; }
.field input[type="date"], .field input[type="text"], .field select {
  width: 100%; max-width: 26rem; color-scheme: dark;
  background: var(--card-2); border: 1px solid var(--line); border-radius: 12px;
  color: var(--paper); font: inherit; font-size: 1.05rem;
  padding: .7em .9em; min-height: 50px;
}
.field input:focus-visible, .field select:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.field .hint { margin-top: .4rem; }

.optin-row { display: flex; gap: .7rem; align-items: flex-start; font-weight: 400; cursor: pointer; margin-bottom: .5rem; }
.optin-row input { width: 24px; height: 24px; margin-top: .2rem; accent-color: var(--amber); flex: none; }
.optin-row b { color: var(--paper); font-weight: 600; }
.optin-row span { color: var(--paper-dim); font-size: .92rem; line-height: 1.7; }
.optin-row b { display: block; color: var(--paper); }
.optin-row span { color: var(--paper-dim); }

.done { color: var(--amber); font-weight: 600; margin-top: .8rem; }
.error { color: var(--vermil-soft); font-size: .95rem; margin-top: .7rem; }

/* ---------- 统计 ---------- */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .9rem; margin-bottom: 1.4rem; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; text-align: center;
}
.stat b { display: block; font-family: var(--latin); font-size: 2rem; color: var(--amber); line-height: 1.2; }
.stat span { color: var(--paper-dim); font-size: .9rem; }

.chart { display: grid; gap: .45rem; margin-top: 1rem; }
.bar-row { display: grid; grid-template-columns: 3.4em 1fr 9em; gap: .7rem; align-items: center; }
.bar-m { text-align: right; color: var(--paper-dim); font-size: .92rem; }
.bar-track { height: 16px; background: var(--card-2); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--amber), var(--amber-soft)); min-width: 2px; }
.bar-fill.low { background: var(--line); }
.bar-val { color: var(--paper-dim); font-size: .85rem; font-family: var(--latin); white-space: nowrap; }
.bar-val b { color: var(--amber); }

.bench-rows { display: grid; gap: .55rem; margin: .9rem 0; }
.bench-row { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--line); padding-bottom: .5rem; font-size: .95rem; }
.bench-row span { color: var(--paper-dim); }
.bench-row b { color: var(--paper); font-family: var(--latin); font-size: 1.05em; }

.milestones { list-style: none; display: grid; gap: .55rem; margin-top: .6rem; }
.milestones li {
  display: flex; gap: .8rem; align-items: baseline;
  color: var(--paper-dim); font-size: .95rem;
  border-left: 3px solid var(--line); padding-left: .9rem;
}
.milestones li b { color: var(--paper); font-family: var(--latin); white-space: nowrap; }
.milestones li.done { border-left-color: var(--amber); }
.milestones li.done b { color: var(--amber); }

/* ---------- 日历 ---------- */
.cal { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-top: .4rem; }
@media (min-width: 900px) { .cal { grid-template-columns: repeat(4, 1fr); } }
.month { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .55rem .5rem .6rem; }
.month h4 { font-size: .82rem; color: var(--paper-dim); text-align: center; letter-spacing: .3em; margin-bottom: .4rem; font-weight: 600; }
.mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.day {
  border: 0; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--paper-dim);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font: 600 .72rem var(--sans); line-height: 1.15; padding: 0;
  height: 36px; /* 固定高而非 aspect-ratio，避免格子被撑宽导致横向溢出 */
}
.day b { font-weight: 600; }
.day small { font-size: .6rem; font-family: var(--latin); color: var(--paper-dim); }
.day:hover { background: rgba(255,181,71,.22); }
.day.has { color: var(--amber); background: rgba(255,181,71,.12); }
.day.has small { color: var(--amber); }
.day.today { box-shadow: inset 0 0 0 1.5px var(--vermil); }
.day.mine { background: var(--amber); color: var(--night); box-shadow: 0 0 14px rgba(255,181,71,.5); }
.day.mine small { color: var(--night); }
.day.selected { box-shadow: inset 0 0 0 2.5px var(--amber-soft); }
@media (max-width: 560px) {
  .cal { grid-template-columns: repeat(2, 1fr); }
}

.daypanel { margin-top: 1.2rem; }
.day-famous { margin-top: .6rem; }
.day-famous .famous-name { font-size: 1.02rem; }

/* ---------- 列表 ---------- */
.list { list-style: none; display: grid; gap: .6rem; margin: .6rem 0; }
.list li {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: .85rem 1.05rem; display: flex; align-items: flex-start; gap: .9rem; font-size: .95rem;
}
.list .l-badge {
  flex: none; color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent);
  border-radius: 8px; padding: .15em .55em; font-family: var(--latin); font-size: .8rem; margin-top: .15rem;
}
.list .l-body { flex: 1; color: var(--paper-dim); line-height: 1.65; }
.list .l-body b { color: var(--paper); font-weight: 600; }
.list .l-meta { font-size: .82rem; color: var(--paper-faint); }
.list .l-act { flex: none; }

.wallpost .l-note { display: block; color: var(--paper); margin-top: .25rem; }

/* ---------- 承诺 ---------- */
.promises { list-style: none; display: grid; gap: .7rem; max-width: 52em; }
.promises li {
  border-left: 3px solid var(--amber); background: var(--card);
  border-radius: 0 12px 12px 0; padding: .9rem 1.2rem; color: var(--paper-dim); line-height: 1.7;
}
.promises b { color: var(--amber); margin-right: .4em; }

/* ---------- 页脚 ---------- */
.sitefoot {
  margin-top: 3rem; padding: 2.2rem clamp(1rem, 4vw, 2.5rem) 2.5rem;
  background: var(--night-2); border-top: 1px solid var(--line);
  text-align: center; color: var(--paper-dim);
}
.foot-row { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.1rem; }
#foot-status { color: var(--paper-faint); font-size: .9rem; margin-bottom: .6rem; }
.foot-line { font-size: .85rem; color: var(--paper-faint); line-height: 1.9; }
.foot-line a { color: var(--paper-dim); display: inline-block; padding: .4em .3em; border-radius: 6px; }
.foot-line a:hover { color: var(--amber); }

/* 空状态友好占位 */
.placeholder { color: var(--paper-dim); text-align: center; padding: 1.4rem 0; font-size: .95rem; }

@media (max-width: 560px) {
  .fate-field select { font-size: 1.25rem; }
  .bar-row { grid-template-columns: 3em 1fr 7.5em; }
  .mainnav a { padding: .35em .55em; font-size: .88rem; }
  /* 窄屏页头两行：第一行品牌+大字按钮，第二行整行导航，六项全可见 */
  .sitehead { flex-wrap: wrap; row-gap: .4rem; }
  .brand { margin-right: auto; }
  .brand-name { white-space: nowrap; }
  .mainnav { order: 3; flex-basis: 100%; margin-left: 0; justify-content: center; flex-wrap: wrap; row-gap: .15rem; }
  /* 窄屏页头只留图标，给导航和语言键腾位置 */
  .guidebtn { padding: .5em .62em; }
  .guidebtn-text { display: none; }
}

/* 英文模式：导航词更长，窄屏下允许换行并稍缩小 */
html.lang-en .mainnav { gap: .15rem; }
html.lang-en .mainnav a { letter-spacing: .02em; padding: .3em .55em; }
@media (max-width: 560px) {
  html.lang-en .mainnav a { font-size: .76rem; flex: 1 1 30%; text-align: center; }
}

/* ---------- 生日祝福卡 ---------- */
.wish-section { padding-top: clamp(1.4rem, 4vw, 2.6rem); padding-bottom: clamp(.6rem, 2vw, 1.2rem); }
.wish-card {
  position: relative; overflow: hidden;
  background:
    radial-gradient(420px 210px at 6% -30%, rgba(255,181,71,.16), transparent 65%),
    linear-gradient(165deg, var(--card), color-mix(in srgb, var(--night) 88%, var(--card)));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.4rem, 4vw, 2.4rem);
  box-shadow: var(--shadow);
}
.wish-card::before {
  content: ""; position: absolute; inset: 8px; pointer-events: none;
  border: 1px solid rgba(255, 181, 71, .12); border-radius: calc(var(--radius) - 6px);
}
.wish-eyebrow {
  display: flex; align-items: center; gap: .5rem;
  color: var(--amber); font-size: .78rem; letter-spacing: .24em;
  margin-bottom: .4rem;
}
.wish-eyebrow svg { width: 1.05rem; height: 1.05rem; }
.wish-title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.05rem);
  letter-spacing: .05em; line-height: 1.3; margin-bottom: .45rem;
}
.wish-lead { color: var(--paper-dim); max-width: 40em; margin-bottom: 1.3rem; }
/* 从祝福幕进来写祝福时，留一个回去重新选入口的按钮 */
.wish-fold { width: 100%; max-width: 30rem; justify-content: center; margin-bottom: 1rem; }
.wish-fold[hidden] { display: none; }
#wish-form { max-width: 30rem; }
#wish-form .btn-primary { min-height: 50px; }
/* 生成链接、录音、试效果并排；手机上主按钮独占一行 */
.wish-create-row { display: flex; flex-wrap: wrap; gap: .55rem; align-items: stretch; }
.wish-create-row .btn { flex: 1 1 auto; justify-content: center; }
.wish-create-row #wish-record,
.wish-create-row #wish-preview-btn { flex: 0 1 auto; font-size: .92rem; padding: .7em 1.05em; }
@media (max-width: 560px) {
  .wish-create-row .btn-primary { flex: 1 1 100%; }
  .wish-create-row #wish-record,
  .wish-create-row #wish-preview-btn { flex: 1 1 0; }
}
/* 录一段祝福语：录音面板 */
.wish-recorder {
  margin-top: 1rem; padding: 1rem 1.05rem;
  border: 1px solid var(--line); border-radius: 14px;
  background: rgba(255, 255, 255, .04);
}
.wish-recorder[hidden] { display: none; }
.wish-recorder-title { font-weight: 700; color: var(--amber-soft); letter-spacing: .06em; margin-bottom: .35rem; }
.wish-recorder-hint { color: var(--paper-dim); font-size: .86rem; line-height: 1.7; }
.wish-rec-time {
  font-variant-numeric: tabular-nums; font-size: 1.35rem; font-weight: 700;
  color: var(--paper); margin-top: .7rem; letter-spacing: .06em;
}
.wish-rec-time.is-live { color: #FF6B52; }
.wish-rec-phase { color: var(--amber-soft); font-size: .84rem; line-height: 1.6; margin-top: .15rem; min-height: 1.2em; }
.wish-rec-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.wish-rec-actions .btn { flex: 1 1 auto; justify-content: center; min-height: 46px; padding: .6em 1.1em; font-size: .94rem; }
.wish-rec-status { margin-top: .65rem; font-size: .88rem; line-height: 1.6; color: var(--amber); }
.wish-rec-status.is-error { color: #ff9b90; }
.wish-rec-note { color: var(--paper-faint); font-size: .78rem; line-height: 1.65; margin-top: .65rem; }
#wish-voice-note { color: var(--amber-soft); }
/* 名字示例比较长：提示字略小，手机上也能完整显示 */
#wish-name::placeholder { font-size: .84rem; }
html.lang-en #wish-name::placeholder { font-size: .64rem; }
.wish-error { color: var(--vermil-soft); font-size: .95rem; margin: -.2rem 0 .9rem; }
.wish-result { margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.wish-preview-label { color: var(--paper-faint); font-size: .78rem; letter-spacing: .18em; margin-bottom: .35rem; }
.wish-preview {
  font-family: var(--serif); font-weight: 700; color: var(--amber-soft);
  font-size: clamp(1.3rem, 1.05rem + 1.1vw, 1.75rem); line-height: 1.45;
  margin-bottom: .85rem; overflow-wrap: anywhere;
}
.wish-link {
  color: var(--paper-faint); font-size: .82rem; line-height: 1.65; word-break: break-all;
  background: rgba(0, 0, 0, .18); border: 1px solid var(--line); border-radius: 10px;
  padding: .55em .7em; margin-bottom: .9rem;
}
.wish-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.wish-actions .btn { flex: 1 1 auto; justify-content: center; }
#wish-status { margin-top: .65rem; color: var(--amber-soft); }

/* ---------- 生日祝福幕 ---------- */
.greet {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  place-items: safe center; /* 内容再高也不会被裁掉上半截 */
  overflow-x: hidden; overflow-y: auto;
  background:
    radial-gradient(900px 520px at 50% 6%, rgba(255,181,71,.20), transparent 62%),
    radial-gradient(760px 520px at 50% 112%, rgba(224,73,63,.15), transparent 66%),
    #17110B;
  transition: opacity .85s ease;
}
.greet.is-closing { opacity: 0; }
html.greet-open, html.greet-open body { overflow: hidden; }
.greet-fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.greet-inner {
  position: relative; z-index: 1; text-align: center;
  padding: clamp(1.2rem, 5vw, 3rem); max-width: 60rem;
  animation: greet-rise .9s cubic-bezier(.2, .7, .3, 1) both;
}
.greet-cake {
  width: clamp(78px, 14vw, 124px); height: auto; display: block; margin: 0 auto .9rem;
  filter: drop-shadow(0 14px 42px rgba(255, 181, 71, .38));
}
.greet-text {
  font-family: var(--serif); font-weight: 700; color: var(--paper);
  font-size: clamp(2.1rem, 1.1rem + 5.4vw, 5rem);
  line-height: 1.24; letter-spacing: .035em;
  overflow-wrap: anywhere; text-wrap: balance;
  text-shadow: 0 14px 54px rgba(0, 0, 0, .5);
}
.greet-text .greet-name { color: var(--amber); }
.greet-tail { white-space: nowrap; }
.greet-sub {
  color: var(--paper-dim); font-size: clamp(1rem, .9rem + .45vw, 1.22rem);
  letter-spacing: .07em; line-height: 1.8; margin-top: 1rem;
}
/* 第几位收到祝福：进页面 1 秒后出现，歌结束前 3 秒淡出；放在蜡烛上方 */
.greet-count {
  margin: 0 0 .9rem; color: #FF6B52;
  font-size: clamp(.95rem, .88rem + .28vw, 1.12rem);
  font-weight: 600;
  letter-spacing: .04em; line-height: 1.65;
  text-shadow: 0 0 22px rgba(255, 107, 82, .5), 0 2px 10px rgba(0, 0, 0, .45);
  opacity: 0; transition: opacity 1.2s ease;
}
.greet-count.is-on { opacity: 1; }

/* 收到的是别人的生日愿望：把愿望本身放在祝福画面上 */
.greet-wish-note {
  max-width: 34rem; margin: 1.35rem auto 0; padding: .95rem 1.1rem;
  border: 1px solid rgba(243, 231, 203, .22); border-radius: 16px;
  background: rgba(255, 255, 255, .055); text-align: left;
}
.greet-wish-note[hidden] { display: none; }
.greet-wish-note-label {
  color: var(--amber); font-size: .88rem; letter-spacing: .06em;
}
.greet-wish-note-text {
  color: var(--paper); font-size: clamp(1.05rem, 1rem + .3vw, 1.25rem);
  line-height: 1.65; margin-top: .35rem; overflow-wrap: anywhere;
}
.greet-wish-note-year {
  color: var(--paper-dim); font-size: .84rem; line-height: 1.6;
  margin-top: .45rem; letter-spacing: .03em;
}

/* 愿望框上面的一句引子 */
.greet-wish-lead {
  color: var(--amber-soft); font-size: .95rem; line-height: 1.7;
  margin: -.1rem 0 .75rem; white-space: pre-line;
}

.greet-actions { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; margin-top: 1.9rem; }
.greet-actions .btn { min-height: 48px; padding: .62em 1.35em; font-size: 1.02rem; }
/* 同款祝福 / 同款许愿：并排放在“进入网站”上面 */
.greet-same { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; }
.greet-same[hidden] { display: none; }
.greet-same .btn {
  flex: 1 1 0; min-width: 0; min-height: 46px;
  padding: .55em 1em; font-size: .95rem;
}
.greet-same .btn[hidden] { display: none; }
/* 小手提示：告诉不熟悉手机的人该点哪个按钮 */
.greet-hint {
  position: fixed; z-index: 5; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: .1rem;
  animation: greet-hint-bob 1.3s ease-in-out infinite;
}
.greet-hint[hidden] { display: none; }
/* 小手出现时，按钮右侧让出位置，文字不被压住 */
.greet-actions .btn.is-hinting { padding-right: 3.6rem; }
.greet-hint-label {
  background: rgba(23, 17, 11, .9); border: 1px solid rgba(255, 181, 71, .55);
  color: var(--amber); font-size: .78rem; font-weight: 600; letter-spacing: .06em;
  padding: .28em .62em; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .4);
}
.greet-hint-hand {
  width: 33px; height: 40px; flex: none;
  transform: rotate(-90deg);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .45));
}
@keyframes greet-hint-bob {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-5px); }
}
.greet-preview-note {
  margin-top: .9rem; color: var(--paper-faint);
  font-size: .84rem; letter-spacing: .04em;
}
.greet-preview-note[hidden] { display: none; }

/* 明年的生日愿望：写一张小卡片，直接发给能帮忙的人 */
.greet-wish {
  max-width: 34rem; margin: 1.5rem auto 0; text-align: left;
}
.greet-wish[hidden] { display: none; }
.greet-wish-field { position: relative; }
.greet-wish input {
  width: 100%; min-height: 52px; padding: .72rem 3.8rem .72rem 1rem;
  border-radius: 14px; border: 1px solid rgba(243, 231, 203, .26);
  background: rgba(255, 255, 255, .06); color: var(--paper);
  font: inherit; font-size: 1.02rem;
}
.greet-wish input::placeholder { color: rgba(243, 231, 203, .46); font-size: .7rem; }
html.lang-en .greet-wish input::placeholder { font-size: .64rem; }
.greet-wish input:focus { outline: 2px solid var(--amber); outline-offset: 2px; }
.greet-wish-count {
  position: absolute; right: .9rem; top: 50%; transform: translateY(-50%);
  color: var(--paper-dim); font-size: .78rem; font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.greet-wish-count.is-full { color: var(--amber); }
.greet-wish-hint { color: var(--paper-dim); font-size: .82rem; line-height: 1.7; margin-top: .5rem; }
.greet-wish-send { width: 100%; margin-top: .95rem; min-height: 48px; }
.greet-wish-status { margin-top: .7rem; font-size: .9rem; line-height: 1.6; color: var(--amber); }
.greet-wish-status.is-error { color: #ff9b90; }
/* 写愿望时把内容贴到上方，键盘弹出也能看见输入框 */
.greet.is-writing { place-items: start center; overflow-y: auto; }
.greet.is-writing .greet-inner { margin-top: clamp(.8rem, 4vh, 2.5rem); padding-bottom: 9rem; }
@keyframes greet-rise {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: none; }
}
/* 收到愿望的祝福画面内容更多：标题收一点，小屏也放得下 */
.greet.has-note .greet-cake { width: clamp(64px, 11vw, 96px); }
.greet.has-note .greet-text { font-size: clamp(1.8rem, 1rem + 4.4vw, 3.8rem); }
.greet.has-note .greet-actions { margin-top: 1.45rem; }
@media (max-height: 680px) {
  .greet-count { margin-bottom: .55rem; font-size: .9rem; }
  .greet.has-note .greet-cake { width: 54px; margin-bottom: .5rem; }
  .greet.has-note .greet-text { font-size: clamp(1.5rem, 1rem + 3.6vw, 2.4rem); }
  .greet.has-note .greet-sub { margin-top: .55rem; font-size: .94rem; }
  .greet.has-note .greet-wish-note { margin-top: .9rem; padding: .75rem .9rem; }
  .greet.has-note .greet-wish-note-text { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .greet-inner { animation: none; }
  .greet { transition: none; }
  .greet-count { transition: none; }
  .greet-hint { animation: none; }
}
@media (max-width: 560px) {
  .wish-actions .btn { flex: 1 1 100%; }
  .greet-actions .btn { flex: 1 1 100%; }
  .greet-same .btn { flex: 1 1 calc(50% - .3rem); min-height: 44px; padding: .5em .7em; font-size: .9rem; }
}
@media (max-width: 340px) {
  .greet-wish input::placeholder { font-size: .64rem; }
  html.lang-en .greet-wish input::placeholder { font-size: .58rem; }
  #wish-name::placeholder { font-size: .72rem; }
  html.lang-en #wish-name::placeholder { font-size: .58rem; }
}

/* ---------- 首页「使用说明」按钮与说明卡片 ---------- */
.hero-guide { display: flex; justify-content: center; margin: -.55rem auto 1.15rem; }
.btn-guide {
  display: inline-flex; align-items: center; gap: .45em;
  min-height: 40px; padding: .42em .95em;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--paper-dim);
  font: inherit; font-size: .9rem; line-height: 1.2;
  cursor: pointer; transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.btn-guide:hover { color: var(--amber); border-color: var(--amber); background: rgba(255,181,71,.06); }
.btn-guide-icon { width: 1.15em; height: 1.15em; flex: none; opacity: .85; }

.guide {
  width: min(760px, calc(100vw - 2rem));
  max-width: none;
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--line); border-radius: 20px;
  background:
    radial-gradient(620px 240px at 18% -12%, rgba(255,181,71,.11), transparent 72%),
    var(--card);
  color: var(--paper);
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  overflow: hidden;
}
.guide::backdrop { background: rgba(10,7,3,.72); backdrop-filter: blur(4px); }
.guide-inner { max-height: calc(90vh - 2px); overflow-y: auto; overscroll-behavior: contain; padding: clamp(1.4rem, 4vw, 2.4rem); }
html.guide-open, html.guide-open body { overflow: hidden; }

.guide-close {
  position: absolute; top: .75rem; right: .75rem; z-index: 2;
  width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid transparent; border-radius: 50%;
  background: rgba(0,0,0,.28); color: var(--paper-dim);
  font: 400 1.55rem/1 var(--sans); cursor: pointer;
}
.guide-close:hover { color: var(--amber); border-color: var(--line); }

.guide-eyebrow { font-size: .76rem; font-weight: 700; letter-spacing: .16em; color: var(--amber); margin-bottom: .45rem; }
.guide-title { font-family: var(--serif); font-size: clamp(1.65rem, 5vw, 2.2rem); line-height: 1.25; margin-bottom: .55rem; padding-right: 2.6rem; }
.guide-lead { color: var(--paper-dim); max-width: 46em; margin-bottom: 1.5rem; }

.guide-part { padding: 1.05rem 0; border-top: 1px solid var(--line); }
.guide-h { display: flex; align-items: baseline; gap: .5rem; font-family: var(--serif); font-size: 1.1rem; line-height: 1.4; margin-bottom: .55rem; }
.guide-emoji { font-size: 1.05em; flex: none; }
.guide-list { list-style: none; display: grid; gap: .5rem; }
.guide-list li { position: relative; padding-left: 1.1em; color: var(--paper-dim); font-size: .95rem; line-height: 1.75; }
.guide-list li::before {
  content: ''; position: absolute; left: .08em; top: .72em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--amber); opacity: .72;
}
.guide-foot { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--paper-faint); font-size: .86rem; line-height: 1.7; }
.guide-actions { display: flex; justify-content: flex-end; margin-top: 1.1rem; }
.guide-actions .btn { min-height: 46px; }

@media (max-width: 600px) {
  .guide {
    width: 100%; max-width: 100%; max-height: 92dvh;
    margin: auto auto 0;
    border-radius: 22px 22px 0 0;
    border-left: 0; border-right: 0; border-bottom: 0;
  }
  .guide-inner { max-height: calc(92dvh - 2px); padding: 1.35rem 1.15rem 1.6rem; }
  .guide-close { top: .55rem; right: .55rem; }
  .guide-actions .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-guide { transition: none; }
}

/* ---------- 奥运奖牌得主（同月同日） ---------- */
.oly-slot {
  margin-top: 1.7rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(420px 160px at 12% -20%, rgba(255,181,71,.09), transparent 70%),
    var(--card);
  padding: 1.1rem 1.15rem 1.2rem;
}
.oly-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.oly-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 700; color: var(--paper); margin: 0; letter-spacing: .02em; line-height: 1.35; }
.oly-count {
  flex: none; font-family: var(--latin); font-size: .8rem; color: var(--amber);
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  border-radius: 999px; padding: .12em .62em; font-variant-numeric: tabular-nums;
}
.oly-sub { color: var(--paper-faint); font-size: .78rem; line-height: 1.65; margin: .45rem 0 .6rem; }
.oly-list { list-style: none; margin: 0; padding: 0; }
.oly-row {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  padding: .55rem .05rem; border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
.oly-row:first-child { border-top: 0; }
.oly-who { display: flex; flex-direction: column; gap: .12rem; min-width: 0; }
.oly-who b { color: var(--paper); font-weight: 600; font-size: .97rem; line-height: 1.35; overflow-wrap: anywhere; }
.oly-meta { color: var(--paper-faint); font-size: .76rem; line-height: 1.35; }
.oly-medals { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; flex: none; max-width: 46%; }
.oly-m {
  font-size: .72rem; line-height: 1.5; padding: .08em .5em; border-radius: 999px;
  border: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.oly-g { color: #FFD37A; border-color: rgba(255,181,71,.45); background: rgba(255,181,71,.08); }
.oly-s { color: #DCDCE4; border-color: rgba(220,220,228,.32); }
.oly-b { color: #E2A585; border-color: rgba(226,165,133,.32); }
.oly-list li:nth-child(n+9) { display: none; }
.oly-slot.open .oly-list li:nth-child(n+9) { display: flex; }
.oly-slot.open .oly-list { max-height: 26rem; overflow-y: auto; overscroll-behavior: contain; }
.oly-toggle {
  margin-top: .8rem; width: 100%; min-height: 44px;
  border: 1px solid var(--line); border-radius: 10px; background: transparent;
  color: var(--amber); font: inherit; font-size: .86rem; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.oly-toggle:hover { border-color: var(--amber); background: rgba(255,181,71,.06); }
.day-oly { margin-top: .55rem; }
.day-oly-line b { font-family: var(--latin); }
@media (max-width: 600px) {
  .oly-slot { padding: 1rem .9rem 1.05rem; }
  .oly-title { font-size: 1rem; }
  .oly-medals { max-width: 42%; }
}
