:root {
  --paper: #f4efe4; --card: #fbf8f1; --ink: #2b2925; --muted: #7a7366; --line: #ddd4c2;
  --seal: #a8382a; --jade: #4f7a6a; --soft: #efe7d6;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #1b1a18; --card: #24221f; --ink: #e9e3d6; --muted: #a39b8c; --line: #3a3631;
    --seal: #d0604f; --jade: #7fb09d; --soft: #2c2925; }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.8 "Noto Serif SC", "Songti SC", serif;
}
a { color: var(--seal); }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
h2 { font-weight: 600; letter-spacing: .3em; margin: 0 0 4px; }
h2::before { content: "◈ "; color: var(--seal); }
.sub { color: var(--muted); margin: 0 0 24px; font-size: 14px; }
section { padding: 56px 0; border-bottom: 1px solid var(--line); }

/* 首屏 */
.hero {
  min-height: 62vh; display: grid; place-items: center; text-align: center; color: #fff;
  background: linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.45)), url(img/2.jpg) center/cover;
}
.hero h1 { font-size: clamp(36px, 8vw, 64px); letter-spacing: .4em; margin: 0 0 8px; font-weight: 600; }
.hero p { margin: 0; letter-spacing: .2em; opacity: .9; }
nav { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
nav .wrap { display: flex; gap: 28px; justify-content: center; }
nav a { color: var(--ink); text-decoration: none; padding: 12px 0; letter-spacing: .2em; }
nav a:hover { color: var(--seal); }

/* 表单 */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; width: 100%;
}
textarea { resize: vertical; min-height: 90px; }
button {
  background: var(--seal); color: #fff; border: 0; border-radius: 6px; padding: 9px 22px; cursor: pointer; letter-spacing: .15em;
}
button.ghost { background: transparent; color: var(--seal); border: 1px solid var(--seal); padding: 4px 12px; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > label { flex: 1 1 200px; font-size: 14px; color: var(--muted); }
.err { color: var(--seal); font-size: 14px; min-height: 1.5em; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }

/* 九宫格结果 */
.sets { display: grid; gap: 20px; margin-top: 24px; }
.set h3 { margin: 0 0 12px; font-size: 16px; color: var(--muted); font-weight: 400; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.ge { font-size: 34px; letter-spacing: .15em; color: var(--seal); font-weight: 600; line-height: 1.2; }
.ge small { font-size: 14px; color: var(--muted); letter-spacing: 0; font-weight: 400; }
.meta { font-size: 14px; color: var(--muted); margin: 6px 0 12px; }
.meta b { color: var(--ink); font-weight: 600; }
.nine { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.cell { border: 1px solid var(--line); border-radius: 6px; padding: 6px; text-align: center; min-height: 64px; position: relative; }
.cell .n { font-size: 22px; font-weight: 600; }
.cell .c { font-size: 12px; color: var(--muted); }
.cell.miss { background: color-mix(in srgb, var(--seal) 10%, transparent); border-color: var(--seal); }
.cell.miss .n { color: var(--seal); }
.cell .tag { position: absolute; top: 2px; right: 5px; font-size: 11px; color: var(--seal); }
.cell.half .tag { color: var(--jade); }
.zero { grid-column: 2; }
.facts { font-size: 14px; margin: 0; padding-left: 18px; }
.legend { margin-top: 24px; font-size: 14px; }
.legend table { width: 100%; border-collapse: collapse; }
.legend td, .legend th { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; }
details summary { cursor: pointer; color: var(--muted); }

/* 文章 */
.articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.art {
  aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; position: relative; cursor: pointer; color: #fff;
  background: center/cover; display: flex; flex-direction: column; justify-content: end; padding: 18px;
  border: 0; text-align: left; letter-spacing: 0;
}
.art::before { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, rgba(0,0,0,.7)); }
.art > * { position: relative; }
.art h3 { margin: 0; font-size: 20px; letter-spacing: .1em; }
.art p { margin: 4px 0 0; font-size: 13px; opacity: .85; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.art:hover { transform: translateY(-2px); transition: transform .2s; }
dialog { border: 0; border-radius: 12px; padding: 0; max-width: 640px; width: calc(100% - 32px); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.55); }
dialog .cover { height: 200px; background: center/cover; }
dialog .body { padding: 20px 24px; white-space: pre-wrap; }
dialog form { text-align: right; padding: 0 24px 20px; }

/* 留言 */
.msgs { display: grid; gap: 12px; margin-top: 20px; }
.msg { border-left: 3px solid var(--jade); padding: 8px 14px; background: var(--card); border-radius: 0 8px 8px 0; }
.msg .who { font-size: 13px; color: var(--muted); }
.msg .txt { white-space: pre-wrap; word-break: break-word; }
.hp { position: absolute; left: -9999px; }

/* 音乐 */
.player {
  position: fixed; right: 16px; bottom: 16px; z-index: 10; display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 8px 6px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12); font-size: 13px; max-width: calc(100% - 32px);
}
.player .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; color: var(--muted); }
.player button { border-radius: 999px; padding: 4px 10px; letter-spacing: 0; }
.player.playing .disc { animation: spin 4s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 32px 0 80px; }

/* 语言切换 */
nav .wrap { align-items: center; }
nav .lang { margin-left: auto; padding: 2px 10px; font-size: 13px; letter-spacing: 0; }
nav .wrap > a:first-child { margin-left: auto; }

/* 缺漏与补漏 */
.fix { margin-top: 16px; }
.fix h4 { margin: 0 0 8px; letter-spacing: .2em; color: var(--seal); }
.fixItem { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.fixNum { font-size: 28px; font-weight: 600; color: var(--seal); min-width: 28px; text-align: center; line-height: 1.3; }
.fixItem p { margin: 4px 0 0; font-size: 14px; }
.fixItem .muted { color: var(--muted); }
.chips span { font-size: 12px; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; margin-left: 4px; color: var(--muted); }
