/* ============================================================
   荔枝的个人站 · 「Type and nothing else」/ editorial
   v2：修掉自检发现的 11 类排版问题
   - 只用两套字：标题/界面用黑体，正文用宋体
   - 白纸黑字 + 一个蓝；没有渐变、没有阴影、没有 1px 分隔线
   - 版面靠留白与色块分层，不靠线
   - 每个页面版式不同：首屏陈述 / 书脊索引 / 两头行 / 词砖墙 / 双栏 / 大字地址 / 图文带
   ============================================================ */

:root {
  --bg: #ffffff;
  --surface: #f4f4f4;
  --surface-2: #e9e9e9;
  --ink: #111111;
  --muted: #565656;
  --accent: #1a4be0;
  --accent-ink: #ffffff;
  --field: #111111;
  --field-ink: #ffffff;
  --field-muted: #c9c9c9;

  --step-small: 14px;
  --step-body: 18px;
  --step-lead: 26px;
  --step-head: 44px;
  --step-display: clamp(2.75rem, 9.4vw, 8.5rem);

  --pad: clamp(18px, 3vw, 34px);
  --gap: clamp(72px, 9vw, 132px);
  --radius: 3px;

  --font-sans: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  --font-serif: "Songti SC", "Source Han Serif SC", "SimSun", Georgia, serif;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0e0e0e;
  --surface: #1a1a1a;
  --surface-2: #262626;
  --ink: #f2f2f2;
  --muted: #b4b4b4;
  --accent: #8ba4ff;
  --accent-ink: #0e0e0e;
  --field: #f2f2f2;
  --field-ink: #0e0e0e;
  --field-muted: #4d4d4d;
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--step-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection { background: var(--accent); color: var(--accent-ink); }

.skip {
  position: absolute;
  left: -9999px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  z-index: 90;
}
.skip:focus { left: 12px; top: 12px; }

/* ---- 唯一的一组外边距：所有横向内边距只在这里给 ---- */
.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding-inline: var(--pad);
}

.muted { color: var(--muted); }
.small { font-size: var(--step-small); }
.serif { font-family: var(--font-serif); }
.link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

/* ---------------- 顶部 ---------------- */

.top {
  background: var(--bg);
}
.top-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 60px;
  font-size: var(--step-small);
}
.top .mark {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1rem;
}
.nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); }
.theme-toggle {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: var(--step-small);
  cursor: pointer;
  padding: 8px 0;
}
.theme-toggle:hover { color: var(--ink); }

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--step-small);
  cursor: pointer;
  transition: background .15s ease, transform .12s ease, color .15s ease;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-quiet { background: none; padding: 8px 0; color: var(--muted); }
.btn-quiet:hover { color: var(--ink); background: none; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---------------- 首屏：只有字 ---------------- */

.hero {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  min-height: min(80svh, 720px);
  padding-block: clamp(28px, 5vw, 64px) clamp(28px, 4vw, 48px);
}

.hero-shortcuts {
  display: flex;
  gap: 20px;
  font-size: var(--step-small);
  color: var(--muted);
}
.hero-shortcuts a:hover { color: var(--ink); }
.hero-shortcuts .count { color: var(--ink); }

.hero-statement {
  font-size: var(--step-display);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.96;
  margin: 0;
  max-width: 15em;
  align-self: start;
  text-wrap: balance;
}

.hero-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.hero-note {
  font-family: var(--font-serif);
  font-size: var(--step-lead);
  line-height: 1.5;
  max-width: 28em;
}
.hero-meta {
  margin-top: 12px;
  font-size: var(--step-small);
  color: var(--muted);
}

/* ---------------- 板块：只给上下内边距，横向交给 .wrap ---------------- */

.section { padding-block: var(--gap) 0; }
.section:last-of-type { padding-bottom: var(--gap); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: clamp(18px, 2.6vw, 30px);
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: var(--step-lead);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.section-head .more {
  font-size: var(--step-small);
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* ---------------- 图文带（每个纯文字页面都分到一张真图） ---------------- */

.band { padding-block: var(--gap) 0; }
.band figure { margin: 0; }
.band img {
  width: 100%;
  max-height: 62svh;
  object-fit: cover;
  background: var(--surface);
}
.band figcaption {
  margin-top: 10px;
  font-size: var(--step-small);
  color: var(--muted);
}
.band--full img { max-height: 68svh; }

.strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.6vw, 20px);
}
.strip--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.strip--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.strip figure { margin: 0; }
.strip img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--surface); }
.strip figcaption { margin-top: 8px; font-size: var(--step-small); color: var(--muted); }
@media (max-width: 620px) { .strip { grid-template-columns: minmax(0, 1fr); } }
.band img[data-parallax] { will-change: transform; transform: scale(1.04); }

/* ---------------- 1) 书脊索引 ---------------- */

.spines { display: grid; }
.spine {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: clamp(14px, 2vw, 30px);
  padding-block: clamp(16px, 2.2vw, 26px);
  transition: background .16s ease, padding-inline .2s ease;
  padding-inline: 0;
}
.spine:hover { background: var(--surface); padding-inline: 12px; }
.spine-bar {
  display: block;
  height: 2.4em;
  background: var(--accent);
  transform: translateY(0.45em);
  transition: transform .25s ease;
}
.spine:nth-child(2) .spine-bar { background: var(--ink); }
.spine:nth-child(3) .spine-bar { background: var(--muted); }
.spine:nth-child(4) .spine-bar { background: var(--accent); }
.spine:hover .spine-bar { transform: translateY(0.45em) scaleY(1.08); }
.spine-title {
  display: block;
  font-size: clamp(1.5rem, 3.4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.spine-sub {
  display: block;
  font-family: var(--font-serif);
  font-size: var(--step-body);
  color: var(--muted);
  margin-top: 6px;
}
.spine-meta {
  font-size: var(--step-small);
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

/* ---------------- 2) 两头对齐的行 ---------------- */

.tworows { display: grid; max-width: 46em; }
.tworow {
  display: grid;
  grid-template-columns: 8.5em minmax(0, 1fr) 84px;
  gap: 20px;
  align-items: start;
  padding-block: 18px;
  transition: background .16s ease;
}
.tworow:nth-child(even) { background: var(--surface); }
.tworow:hover .tworow-title { color: var(--accent); }
.tworow-date {
  font-size: var(--step-small);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}
.tworow-text { display: block; min-width: 0; }
.tworow-title {
  display: block;
  font-family: var(--font-serif);
  font-size: var(--step-lead);
  line-height: 1.35;
}
.tworow-tags {
  display: block;
  font-size: var(--step-small);
  color: var(--muted);
  margin-top: 6px;
}
.tworow-thumb {
  width: 84px;
  height: 56px;
  object-fit: cover;
  background: var(--surface-2);
}

/* ---------------- 3) 词砖墙 ---------------- */

.wall { display: flex; flex-wrap: wrap; gap: 8px; }
.tile {
  padding: 10px 15px;
  background: var(--surface);
  font-family: var(--font-serif);
  font-size: var(--step-body);
  line-height: 1.45;
  border-radius: var(--radius);
}
.tile.is-key { background: var(--accent); color: var(--accent-ink); }
.tile.is-muted { color: var(--muted); }
.wall-caption { margin-top: 18px; font-size: var(--step-small); color: var(--muted); }

/* ---------------- 4) 双栏 + 高亮 ---------------- */

.twocol {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(22px, 4vw, 60px);
  align-items: start;
}
.twocol-side { font-size: var(--step-small); color: var(--muted); display: grid; gap: 16px; }
.twocol-side dt { color: var(--ink); font-size: var(--step-body); font-weight: 700; }
.twocol-side dd { margin: 3px 0 0; }
.lede {
  font-family: var(--font-serif);
  font-size: var(--step-lead);
  line-height: 1.6;
}
.lede + .lede { margin-top: 1em; }
.prose { font-family: var(--font-serif); font-size: var(--step-body); line-height: 1.9; }
.prose p + p { margin-top: 1em; }
mark { background: none; color: var(--accent); font-weight: 600; }

/* ---------------- 5) 大字地址 ---------------- */

.addresses { display: grid; }
.address {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding-block: clamp(14px, 2vw, 22px);
  font-size: clamp(1.5rem, 0.9rem + 2.8vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  transition: color .15s ease;
}
.address:hover { color: var(--accent); }
.address .kind {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: var(--step-small);
  color: var(--muted);
  flex: none;
}
.field .address .kind { color: var(--field-muted); }

/* ---------------- 6) 反色整段 ---------------- */

.field {
  background: var(--field);
  color: var(--field-ink);
  padding-block: var(--gap);
  margin-top: var(--gap);
}
.field .section-head h2 { color: var(--field-ink); }
.field .muted { color: var(--field-muted); }

/* ---------------- 页脚 ---------------- */

.foot {
  background: var(--field);
  color: var(--field-ink);
  padding-block: clamp(150px, 14vw, 210px) 30px;
}
.foot-mark {
  font-size: clamp(3rem, 12vw, 9rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.9;
  margin-bottom: 28px;
}
.foot-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: var(--step-small);
  color: var(--field-muted);
}
.foot-row a:hover { color: var(--field-ink); }

/* ---------------- 内页通用头 ---------------- */

.page-head { padding-block: clamp(30px, 5vw, 62px) clamp(18px, 2.4vw, 30px); }
.page-head h1 {
  font-size: clamp(2rem, 6vw, 4.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
}
.page-head .sub {
  margin-top: 16px;
  font-family: var(--font-serif);
  font-size: var(--step-lead);
  line-height: 1.5;
  color: var(--muted);
  max-width: 32em;
}

/* ---------------- 作品列表 ---------------- */

.cards { display: grid; gap: clamp(30px, 4vw, 52px); }
.card-row {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(20px, 3vw, 44px);
  align-items: center;
}
.card-row:nth-child(even) .card-media { order: 2; }
.card-media { display: block; overflow: hidden; background: var(--surface); aspect-ratio: 16 / 10; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card-media:hover img { transform: scale(1.03); }
.card-title {
  font-size: clamp(1.25rem, 1rem + 1.4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.card-title a:hover { color: var(--accent); }
.card-meta { margin-top: 10px; font-size: var(--step-small); color: var(--muted); }
.card-text { margin-top: 12px; font-family: var(--font-serif); line-height: 1.8; max-width: 30em; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tag {
  font-size: var(--step-small);
  color: var(--muted);
  padding: 4px 10px;
  background: var(--surface);
  border-radius: var(--radius);
}
a.tag:hover { color: var(--accent-ink); background: var(--accent); }

/* ---------------- 作品详情：标题在首屏，图在下面粘住 ---------------- */

.detail-head { padding-block: clamp(26px, 4vw, 52px) clamp(20px, 3vw, 36px); }
.detail-head .back { font-size: var(--step-small); color: var(--muted); }
.detail-head .back:hover { color: var(--ink); }
.detail-head h1 {
  font-size: clamp(2rem, 5.4vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin: 10px 0 0;
}
.detail-head .kicker {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: var(--step-lead);
  color: var(--muted);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  padding-block: 0 var(--gap);
}
.split-media { position: sticky; top: 24px; display: grid; gap: 14px; }
.split-media img { width: 100%; background: var(--surface); }
.split-media figcaption { font-size: var(--step-small); color: var(--muted); margin-top: 8px; }
.split-body .prose p { margin-bottom: 1em; }

.spec { margin: 26px 0; font-size: var(--step-small); }
.spec div { display: flex; gap: 14px; padding-block: 10px; }
.spec div:nth-child(even) { background: var(--surface); padding-inline: 10px; }
.spec dt { color: var(--muted); min-width: 5em; }
.spec dd { margin: 0; }

/* ---------------- 单条动态 ---------------- */

.post { max-width: 42em; padding-block: clamp(26px, 4vw, 48px) 0; }
.post h1 {
  font-size: clamp(1.75rem, 3.6vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 8px 0 18px;
}
.post-body {
  font-family: var(--font-serif);
  font-size: var(--step-lead);
  line-height: 1.7;
  white-space: pre-line;
}
.post-figure { margin: 26px 0; }
.post-figure figcaption { font-size: var(--step-small); color: var(--muted); margin-top: 8px; }

/* ---------------- 互动 ---------------- */

.act-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
  font-size: var(--step-small);
  flex-wrap: wrap;
}
.like {
  border: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--step-small);
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .15s ease, color .15s ease;
}
.like:hover { background: var(--surface-2); }
.like[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------------- 表单 ---------------- */

.form { display: grid; gap: 14px; max-width: 34em; }
.form label { display: grid; gap: 7px; font-size: var(--step-small); color: var(--muted); }
.form input,
.form textarea,
.form select {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--step-body);
}
.form input::placeholder,
.form textarea::placeholder { color: var(--muted); opacity: .85; }
.form textarea { resize: vertical; min-height: 100px; }
.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.status { font-size: var(--step-small); color: var(--muted); }
.status.is-ok { color: var(--accent); }
.status.is-err { color: #b3261e; }

/* ---------------- 留言 ---------------- */

.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-width: 40em; }
.note-item { display: grid; gap: 4px; padding-block: 14px; }
.note-item:nth-child(even) { background: var(--surface); padding-inline: 12px; }
.note-head { display: flex; align-items: baseline; gap: 10px; font-size: var(--step-small); }
.note-name { font-size: var(--step-body); font-weight: 700; }
.note-time { color: var(--muted); }
.note-body { font-family: var(--font-serif); line-height: 1.75; }
.note-empty { color: var(--muted); font-size: var(--step-small); }

.comments { margin-top: 36px; }
.comments h2 { font-size: var(--step-lead); font-weight: 700; margin: 0 0 16px; }

.gb-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(26px, 4vw, 64px);
  align-items: start;
  padding-block: 0 var(--gap);
}

/* ---------------- 后台 ---------------- */

.admin-top { display: flex; align-items: center; gap: 16px; padding-block: 20px; font-size: var(--step-small); }
.admin-top .grow { flex: 1; }
.admin-tabs { display: flex; gap: 18px; flex-wrap: wrap; margin-block: 8px 22px; }
.admin-tab {
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--step-small);
  color: var(--muted);
  padding: 9px 0;
  cursor: pointer;
}
.admin-tab[aria-selected="true"] { color: var(--accent); font-weight: 700; }
.admin-panel { display: none; gap: 16px; }
.admin-panel[data-active="1"] { display: grid; }

.panel { background: var(--surface); border-radius: var(--radius); padding: 18px; display: grid; gap: 12px; }
.panel h2 { font-size: var(--step-body); font-weight: 700; margin: 0; }
.rows { display: grid; gap: 6px; }
.row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg);
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: var(--step-small);
}
.row:nth-child(even) { background: var(--surface-2); }
.row .row-main { display: grid; gap: 4px; min-width: 0; }
.row strong { font-weight: 700; font-size: var(--step-body); }
.row .row-actions { display: flex; gap: 8px; flex: none; }
.row button {
  border: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--step-small);
  padding: 7px 12px;
  border-radius: var(--radius);
  cursor: pointer;
}
.row button:hover { background: var(--accent); color: var(--accent-ink); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--bg); padding: 16px; border-radius: var(--radius); }
.stat:nth-child(even) { background: var(--surface-2); }
.stat b { display: block; font-size: 1.75rem; letter-spacing: -0.02em; }
.stat span { font-size: var(--step-small); color: var(--muted); }

.login { max-width: 26em; margin-block: clamp(48px, 9vw, 110px); display: grid; gap: 18px; }
.login h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 700; margin: 0; }

/* ---------------- 动效 ---------------- */

.mask { display: block; overflow: hidden; }
.mask > span { display: block; transform: translateY(104%); transition: transform .85s cubic-bezier(.19, 1, .22, 1); }
.mask.is-in > span { transform: none; }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mask > span { transform: none; transition: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 900px) {
  .twocol { grid-template-columns: minmax(0, 1fr); }
  .card-row,
  .card-row:nth-child(even) .card-media { grid-template-columns: minmax(0, 1fr); order: 0; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-media { position: static; }
  .gb-split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  :root { --pad: 18px; --step-lead: 22px; }
  .hero { min-height: auto; }
  .hero-statement { font-size: 11.6vw; }
  .spine { grid-template-columns: 6px minmax(0, 1fr); }
  .spine-meta { grid-column: 2; text-align: left; margin-top: 6px; }
  .tworow { grid-template-columns: 5.5em minmax(0, 1fr); gap: 12px; }
  .tworow-thumb { display: none; }
  .address { flex-direction: column; align-items: flex-start; gap: 2px; font-size: 8.6vw; }
  .nav { gap: 12px; overflow-x: auto; }
}
