/* 树洞 hollow — 夜里的树洞 */
:root {
  --pine: #0e1510;        /* 松夜 */
  --pine-deep: #0a100c;   /* 洞底 */
  --moss: #16211a;        /* 苔面 */
  --moss-hi: #1d2b20;     /* 亮苔面 */
  --ring: #263428;        /* 年轮线 */
  --mist: #dce5d9;        /* 雾白 */
  --dim: #86988a;         /* 暗苔 */
  --fly: #e2bd66;         /* 萤火 */
  --fly-dim: #a8904e;
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--pine);
  color: var(--mist);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(226, 189, 102, .28); }

a { color: var(--mist); text-decoration: none; }
a:hover { color: var(--fly); }

code {
  font-family: var(--mono);
  font-size: .88em;
  color: var(--fly);
}

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* 纸纹 */
.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 萤火 */
.fireflies { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.fireflies i {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: var(--fly); opacity: .25; filter: blur(1px);
}
.fireflies i:nth-child(1) { left: 12%; top: 70%; animation: drift1 26s ease-in-out infinite alternate; }
.fireflies i:nth-child(2) { left: 78%; top: 24%; width: 3px; height: 3px; animation: drift2 34s ease-in-out infinite alternate; }
.fireflies i:nth-child(3) { left: 58%; top: 82%; opacity: .18; animation: drift3 22s ease-in-out infinite alternate; }
.fireflies i:nth-child(4) { left: 30%; top: 12%; width: 2px; height: 2px; animation: drift2 40s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { from { transform: translate(0,0); } to { transform: translate(60px,-90px); opacity: .5; } }
@keyframes drift2 { from { transform: translate(0,0); } to { transform: translate(-70px,60px); opacity: .45; } }
@keyframes drift3 { from { transform: translate(0,0); } to { transform: translate(40px,-70px); } }

/* 顶栏 */
.top {
  position: relative; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1080px; margin: 0 auto; padding: 26px 28px 0;
}
.brand { font-family: var(--serif); font-weight: 600; font-size: 18px; letter-spacing: .12em; }
.brand code { color: var(--dim); font-size: 14px; margin-left: 4px; }
.brand-mark { color: var(--fly); font-size: 9px; vertical-align: 2px; margin-right: 6px; }
.top nav { display: flex; gap: 22px; font-size: 14px; }
.top nav a { color: var(--dim); }
.top nav a:hover { color: var(--fly); }
.top .nav-em { color: var(--fly); }

main { position: relative; z-index: 3; }

section {
  max-width: 1080px; margin: 0 auto; padding: 96px 28px 0;
}

h2 {
  font-family: var(--serif); font-weight: 700; font-size: 30px;
  letter-spacing: .06em; margin-bottom: 14px;
}
.sec-para { color: var(--dim); max-width: 560px; margin-bottom: 36px; }

/* 首屏 */
.hero { position: relative; padding-top: 88px; display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: start; }
.hero-copy { position: relative; }
.hero-copy::before {
  /* 洞口 */
  content: ""; position: absolute; left: -60px; top: -88px; width: 420px; height: 420px;
  background: radial-gradient(closest-side, var(--pine-deep) 0%, rgba(10,16,12,.5) 55%, transparent 72%);
  pointer-events: none;
}
.hero-kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: .22em;
  color: var(--fly-dim); margin-bottom: 26px;
}
h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(64px, 11vw, 118px); line-height: 1.05; letter-spacing: .1em;
}
.hero-en {
  font-family: var(--mono); font-size: 15px; letter-spacing: .5em;
  color: var(--dim); margin: 10px 0 30px; text-transform: lowercase;
}
.hero-def { font-size: 19px; font-weight: 500; margin-bottom: 18px; max-width: 540px; }
.hero-para { color: var(--dim); font-size: 15px; max-width: 540px; margin-bottom: 40px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 12px 26px; border-radius: 999px;
  background: var(--fly); color: #221a09; font-weight: 700; font-size: 15px;
  letter-spacing: .04em; transition: transform .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(226,189,102,.22); color: #221a09; }
.btn-ghost { background: transparent; color: var(--mist); border: 1px solid var(--ring); font-weight: 500; }
.btn-ghost:hover { border-color: var(--fly); color: var(--fly); box-shadow: none; }

/* 竖排铭牌 */
.plaque {
  writing-mode: vertical-rl; text-orientation: upright;
  background: var(--moss); border: 1px solid var(--ring); border-radius: 6px;
  padding: 30px 20px; margin-top: 26px;
  display: flex; gap: 18px; align-self: start;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.plaque-zh {
  font-family: var(--serif); font-weight: 600; font-size: 21px;
  letter-spacing: .42em; color: var(--mist);
}
.plaque-en {
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em;
  color: var(--fly-dim); text-orientation: mixed; padding-top: 6px;
}

/* 试一句 */
.try { padding-top: 110px; }
.try-hint { color: var(--dim); font-size: 14px; margin-bottom: 24px; }
#whisper-form { display: flex; gap: 12px; max-width: 640px; }
#whisper-form input {
  flex: 1; background: var(--moss); border: 1px solid var(--ring); border-radius: 999px;
  color: var(--mist); font-family: var(--sans); font-size: 15px; padding: 13px 22px;
}
#whisper-form input::placeholder { color: var(--dim); opacity: .7; }
#whisper-form input:focus { outline: none; border-color: var(--fly-dim); }
#whisper-form button {
  background: var(--fly); color: #221a09; border: none; border-radius: 999px;
  font-family: var(--sans); font-weight: 700; font-size: 14px; padding: 13px 24px;
  cursor: pointer; transition: transform .18s ease;
}
#whisper-form button:hover { transform: translateY(-1px); }
.try-gone { color: var(--fly-dim); font-size: 14px; margin-top: 18px; min-height: 1.6em; }
.try-count { color: var(--dim); font-size: 13px; }

.whisper-float {
  position: fixed; z-index: 9; pointer-events: none;
  font-family: var(--serif); font-size: 17px; color: var(--fly);
  text-shadow: 0 0 18px rgba(226,189,102,.4); white-space: nowrap;
  animation: rise 4.2s ease-out forwards;
}
@keyframes rise {
  0%   { opacity: 0; transform: translateY(0); filter: blur(0); }
  12%  { opacity: .92; }
  100% { opacity: 0; transform: translateY(-150px); filter: blur(7px); }
}

/* 房间 */
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; max-width: 860px; }
.door {
  background: var(--moss); border: 1px solid var(--ring);
  border-radius: 200px 200px 14px 14px / 150px 150px 14px 14px;
  padding: 58px 38px 34px; text-align: center;
}
.door h3 { font-family: var(--serif); font-size: 24px; font-weight: 700; letter-spacing: .2em; margin-bottom: 10px; }
.door-loc { font-family: var(--mono); font-size: 12px; color: var(--fly-dim); letter-spacing: .08em; margin-bottom: 20px; }
.door p { font-size: 15px; color: var(--mist); margin-bottom: 8px; }
.door-listen { color: var(--dim); font-size: 13px !important; border-top: 1px solid var(--ring); padding-top: 16px; margin-top: 16px !important; }

/* 红线 */
.plaques { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 960px; }
.plaques li {
  background: var(--moss); border: 1px solid var(--ring); border-top: 3px solid var(--fly);
  border-radius: 4px; padding: 26px 24px;
}
.plaques h3 { font-family: var(--serif); font-size: 19px; font-weight: 700; letter-spacing: .14em; margin-bottom: 10px; }
.plaques p { color: var(--dim); font-size: 14px; }
.boundary { color: var(--dim); font-size: 13px; margin-top: 26px; }

/* 动词 */
.verb-rows { max-width: 860px; border-top: 1px solid var(--ring); }
.verb {
  display: grid; grid-template-columns: minmax(260px, 44%) 1fr; gap: 20px;
  padding: 22px 0; border-bottom: 1px solid var(--ring); align-items: baseline;
}
.verb code { font-size: 13.5px; color: var(--fly); }
.verb p { color: var(--dim); font-size: 14.5px; }
.verbs .sec-para { margin-top: 28px; margin-bottom: 0; }

/* 接入 */
.access-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 22px; }
.access-card {
  background: var(--moss); border: 1px solid var(--ring); border-radius: 10px; padding: 26px;
}
.access-card h3 { font-family: var(--serif); font-size: 17px; font-weight: 600; letter-spacing: .1em; margin-bottom: 14px; }
.access-card pre {
  background: var(--pine-deep); border: 1px solid var(--ring); border-radius: 8px;
  padding: 16px 18px; overflow-x: auto; margin-bottom: 14px;
}
.access-card pre code { color: var(--mist); font-size: 12.5px; line-height: 1.75; }
.access-note { color: var(--dim); font-size: 13px; }

/* 页脚 */
footer {
  position: relative; z-index: 3; max-width: 1080px; margin: 96px auto 0;
  padding: 34px 28px 48px; border-top: 1px solid var(--ring);
  color: var(--dim); font-size: 13px; line-height: 2;
}
footer a { color: var(--dim); border-bottom: 1px dotted var(--ring); }
footer a:hover { color: var(--fly); }

/* 入场 */
.hero-copy, .plaque, section h2, .sec-para, .doors, .plaques, .verb-rows, .access-grid, #whisper-form {
  animation: settle .9s ease-out both;
}
@keyframes settle { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 响应式 */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .plaque { writing-mode: horizontal-tb; text-orientation: mixed; margin-top: 0; padding: 18px 24px; gap: 10px; align-items: baseline; flex-direction: column; }
  .plaque-zh { font-size: 17px; letter-spacing: .3em; }
  .doors { grid-template-columns: 1fr; }
  .plaques { grid-template-columns: 1fr; }
  .verb { grid-template-columns: 1fr; gap: 6px; }
  .top { flex-direction: column; gap: 14px; align-items: flex-start; }
  .hero-copy::before { left: -100px; }
}
@media (max-width: 560px) {
  section { padding: 72px 20px 0; }
  .top { padding: 20px 20px 0; }
  #whisper-form { flex-direction: column; }
  #whisper-form button { align-self: flex-start; }
  footer { padding: 30px 20px 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fireflies i { animation: none !important; opacity: .2; }
  .whisper-float { animation: none !important; opacity: 0; }
  .hero-copy, .plaque, section h2, .sec-para, .doors, .plaques, .verb-rows, .access-grid, #whisper-form {
    animation: none;
  }
  .btn:hover, #whisper-form button:hover { transform: none; }
}
