/* 十日终焉 · 资料站 —— 白色主题（共用） */
/* 设计令牌统一在 /assets/tokens.css（M10 收口）；这里只管组件样式。 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }

/* ── 顶栏 ── */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 26px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .mark {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 17px; letter-spacing: 1px; color: var(--ink);
}
.nav .mark i {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--ink); color: #fff; font-style: normal;
  font-size: 14px; letter-spacing: 0; font-family: var(--serif);
}
.nav .links { display: flex; gap: 4px; margin-left: 8px; }
.nav .links a {
  padding: 6px 12px; border-radius: 999px; color: var(--dim);
  font-size: 13.5px; transition: .15s;
}
.nav .links a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav .links a.on { background: var(--ink); color: #fff; }
.nav .sp { margin-left: auto; }
.nav .ghost {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--dim); font-size: 13px; cursor: pointer;
}
.nav .ghost:hover { border-color: #cfd6e4; color: var(--ink); }

/* ── 通用容器 ── */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 26px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.muted { color: var(--dim); }
.dimmer { color: var(--dimmer); }
.tiny { font-size: 12px; }
.kicker {
  font-size: 11.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--dimmer);
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-family: inherit; transition: .15s;
}
.btn:hover { border-color: #cdd5e4; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #232a3a; }
.btn.soft { background: var(--brand-soft); border-color: #dfe3ff; color: var(--brand); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--dim);
}
.chip.gold { background: var(--gold-soft); border-color: #f3e3c0; color: var(--gold); }
.chip.green { background: var(--green-soft); border-color: #cfeee0; color: var(--green); }

/* ── 首页 ── */
.hero { padding: 54px 0 26px; }
.hero h1 {
  font-family: var(--serif); font-size: 46px; line-height: 1.18;
  margin: 10px 0 14px; letter-spacing: 2px;
}
.hero .lead { font-size: 16.5px; color: var(--dim); max-width: 720px; margin: 0 0 20px; }
.hero .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.hero .acts { display: flex; gap: 10px; flex-wrap: wrap; }

.entrygrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 26px 0 10px; }
.entry {
  display: block; padding: 20px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  color: inherit; transition: .18s;
}
.entry:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: #d9dfec; }
.entry .ei { font-size: 22px; }
.entry h3 { margin: 10px 0 6px; font-size: 16px; font-family: var(--serif); letter-spacing: .5px; }
.entry p { margin: 0; font-size: 13px; color: var(--dim); }

.sect { margin: 44px 0; }
.sect > h2 {
  font-family: var(--serif); font-size: 22px; letter-spacing: 1px; margin: 0 0 4px;
}
.sect > .sub { color: var(--dimmer); font-size: 13px; margin: 0 0 18px; }

.acts4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.act {
  padding: 16px 16px 14px; border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--line); position: relative; overflow: hidden;
}
.act::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--brand), #9aa7ff);
}
.act h4 { margin: 0 0 4px; font-size: 14px; }
.act .r { font-size: 11.5px; color: var(--dimmer); margin-bottom: 8px; }
.act p { margin: 0; font-size: 12.5px; color: var(--dim); line-height: 1.62; }

.volgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.vol {
  display: block; padding: 16px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  color: inherit; transition: .18s; box-shadow: var(--shadow-sm);
}
.vol:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.vol .n { font-family: var(--serif); font-size: 30px; line-height: 1; color: #d3d9e8; }
.vol h4 { margin: 8px 0 2px; font-size: 14.5px; font-family: var(--serif); }
.vol .r { font-size: 11.5px; color: var(--dimmer); }
.vol .k { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.vol .k span { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--dim); }

/* ── 阅读页 ── */
.readlayout {
  display: grid; grid-template-columns: 236px minmax(0, 1fr) 190px;
  gap: 26px; align-items: start; padding: 22px 0 60px;
}
.rail { position: sticky; top: 72px; max-height: calc(100vh - 96px); overflow: auto; }
.rail h5 { margin: 16px 0 6px; font-size: 11px; letter-spacing: .14em; color: var(--dimmer); text-transform: uppercase; }
.rail a {
  display: block; padding: 5px 10px; border-radius: 8px; color: var(--dim);
  font-size: 13px; line-height: 1.45;
}
.rail a:hover { background: var(--surface); color: var(--ink); text-decoration: none; }
.rail a.on { background: var(--ink); color: #fff; }
.rail a.small { font-size: 12px; padding-left: 20px; color: var(--dimmer); }

.article {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 34px 46px 48px; box-shadow: var(--shadow-sm); min-height: 60vh;
}
.article h1 { font-family: var(--serif); font-size: 30px; line-height: 1.35; margin: 0 0 8px; letter-spacing: 1px; }
.article .meta { color: var(--dimmer); font-size: 12.5px; margin-bottom: 22px; }
.article h2 {
  font-family: var(--serif); font-size: 21px; margin: 34px 0 12px; padding-top: 14px;
  border-top: 1px solid var(--line-2); letter-spacing: .5px;
}
.article h3 { font-size: 16px; margin: 22px 0 8px; color: #26304a; }
.article p { margin: 0 0 12px; font-size: 15.5px; line-height: 1.86; color: #1b2130; }
.article li { margin: 4px 0; line-height: 1.8; }
.article blockquote {
  margin: 14px 0; padding: 10px 16px; border-left: 3px solid #dfe4f2;
  background: var(--surface-2); color: var(--dim); font-size: 14px; border-radius: 0 8px 8px 0;
}
.article code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 4px; font-size: .9em; }
.article strong { color: #0b0f18; }
.tbl { overflow-x: auto; margin: 14px 0 18px; border: 1px solid var(--line); border-radius: 10px; }.article table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.article th, .article td { padding: 8px 12px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.article th { background: var(--surface-2); font-weight: 600; font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.article tr:last-child td { border-bottom: none; }
.article tbody tr:hover { background: #fafbfe; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.pager a {
  flex: 1; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--dim); font-size: 13px;
}
.pager a:hover { text-decoration: none; border-color: #cfd6e4; color: var(--ink); }
.pager .r { text-align: right; }

.readbar {
  position: sticky; top: 57px; z-index: 30; height: 3px; background: transparent;
}
.readbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #8b9bff); transition: width .1s linear; }

/* ── 问答页 ── */
.chatwrap { max-width: 880px; margin: 0 auto; padding: 26px 20px 120px; }
.chathead { text-align: center; margin: 18px 0 26px; }
.chathead h1 { font-family: var(--serif); font-size: 30px; margin: 0 0 8px; letter-spacing: 1px; }
.chathead p { color: var(--dim); margin: 0; font-size: 14px; }

.suggests { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 22px 0 8px; }
.suggests button {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--dim); font-size: 13px; cursor: pointer; font-family: inherit;
}
.suggests button:hover { border-color: #cfd6e4; color: var(--ink); }

.msgs { display: flex; flex-direction: column; gap: 18px; margin-top: 26px; }
.msg { display: flex; gap: 12px; }
.msg .av {
  width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  font-size: 13px; background: var(--surface-2); border: 1px solid var(--line); color: var(--dim);
}
.msg.me .av { background: var(--ink); color: #fff; border-color: var(--ink); }
.msg .body { min-width: 0; flex: 1; }
.msg .who { font-size: 12px; color: var(--dimmer); margin-bottom: 4px; }
.msg .text {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; font-size: 15px; line-height: 1.78; color: #1b2130;
  box-shadow: var(--shadow-sm);
}
.msg.me .text { background: var(--brand-soft); border-color: #e2e6ff; }
.msg .text p:first-child { margin-top: 0; }
.msg .text p:last-child { margin-bottom: 0; }
.msg .text ul, .msg .text ol { padding-left: 20px; }
.srcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rewrote {
  display: inline-block; margin-bottom: 6px; padding: 2px 9px; border-radius: 999px;
  background: var(--gold-soft); border: 1px solid #f1e2bf; color: var(--gold);
  font-size: 11.5px;
}
.srcs a {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--dim);
}
.srcs a:hover { text-decoration: none; border-color: #cfd6e4; color: var(--ink); }
.srcs a b { color: var(--brand); font-weight: 600; }

.composer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 14px 20px 18px;
  background: linear-gradient(180deg, rgba(246, 247, 250, 0), var(--bg) 34%);
}
.composer .inner {
  max-width: 880px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 10px 10px 10px 16px; box-shadow: var(--shadow);
}
.composer textarea {
  flex: 1; border: none; outline: none; resize: none; font-family: inherit;
  font-size: 15px; line-height: 1.6; max-height: 140px; background: transparent; color: var(--ink);
}
.composer .send {
  border: none; background: var(--ink); color: #fff; border-radius: 10px;
  padding: 9px 18px; font-size: 14px; cursor: pointer; font-family: inherit;
}
.composer .send[disabled] { opacity: .4; cursor: not-allowed; }
.composer .hint { max-width: 880px; margin: 6px auto 0; font-size: 11.5px; color: var(--dimmer); text-align: center; }

.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--dimmer); display: inline-block;
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* 设置抽屉 */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 92vw); z-index: 60;
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -20px 0 50px -30px rgba(16, 24, 40, .35);
  transform: translateX(102%); transition: transform .22s ease;
  display: flex; flex-direction: column;
}
.drawer.show { transform: none; }
.drawer header { display: flex; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer header h3 { margin: 0; font-size: 15px; }
.drawer header button { margin-left: auto; border: none; background: transparent; font-size: 20px; color: var(--dimmer); cursor: pointer; }
.drawer .body { padding: 18px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--dim); }
.field input, .field select {
  border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px;
  font-size: 13.5px; font-family: inherit; color: var(--ink); background: var(--surface);
}
.field input:focus, .field select:focus { outline: none; border-color: #c3cdf0; box-shadow: 0 0 0 3px #eef1ff; }
.field .hint { font-size: 11.5px; color: var(--dimmer); }

/* 页脚 */
.foot { padding: 30px 0 40px; color: var(--dimmer); font-size: 12px; display: flex; gap: 10px; flex-wrap: wrap; }

/* 响应式 */
@media (max-width: 1080px) {
  .readlayout { grid-template-columns: 210px minmax(0, 1fr); }
  .readlayout > .rail:last-child { display: none; }
  .volgrid { grid-template-columns: repeat(3, 1fr); }
  .acts4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 780px) {
  .nav { padding: 10px 14px; gap: 10px; }
  .nav .links a { padding: 5px 9px; font-size: 12.5px; }
  .wrap { padding: 0 16px; }
  .hero h1 { font-size: 32px; }
  .entrygrid { grid-template-columns: 1fr; }
  .volgrid { grid-template-columns: repeat(2, 1fr); }
  .acts4 { grid-template-columns: 1fr; }
  .readlayout { grid-template-columns: 1fr; }
  .readlayout > .rail:first-child { display: none; }
  .article { padding: 22px 18px 30px; }
  .article h1 { font-size: 23px; }
}
