/* App-Scope 2026 */
:root {
  --bg: #F7F8F6; --sf2: #EDEFEC; --ink: #17201C; --ink2: #4B5550; --mut: #5E6863;
  --rule: #DDE1DC; --ac: #0A7A61; --mint: #5CC9A9;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", Monaco, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #101413; --sf2: #1A201E; --ink: #E6EAE8; --ink2: #A9B3AE; --mut: #8C9792; --rule: #29302D; --ac: #5CC9A9; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: var(--ac); text-decoration: none; touch-action: manipulation; }
img { max-width: 100%; height: auto; }
button, a, summary { touch-action: manipulation; }
button, summary, .btn, .icons a { -webkit-user-select: none; user-select: none; }
input, textarea, select { font: inherit; font-size: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }

/* 图标：CSS mask，跟随文字颜色 */
.i { display: inline-block; flex: 0 0 auto; width: 18px; height: 18px; vertical-align: -3px; }
.i.lg { width: 22px; height: 22px; }
.i.sm { width: 14px; height: 14px; vertical-align: -1px; }

/* 骨架：左侧照片面板 + 右侧正文 */
.shell { display: grid; grid-template-columns: minmax(320px, 32%) minmax(0, 1fr); align-items: start; min-height: 100vh; min-height: 100dvh; }

.pn {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 72px 48px 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  text-align: right; color: rgba(255,255,255,.72);
  background-color: #1f1815;
  background-image: url(../img/overlay.png), linear-gradient(rgba(24,18,16,.5), rgba(24,18,16,.5)), url(../img/bg.jpg);
  background-repeat: repeat, no-repeat, no-repeat; background-size: auto, cover, cover; background-position: top left, center, center;
}
.pn a { color: rgba(255,255,255,.85); }
.pn-top { display: flex; flex-direction: column; gap: 40px; }
.slogan { margin: 0; font-size: 24px; line-height: 1.6; font-weight: 400; }
.slogan a { color: #fff; font-weight: 700; }
.pnav { display: flex; flex-direction: column; align-items: flex-end; }
.pnav > a, .search summary { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; color: rgba(255,255,255,.72); cursor: pointer; }
.pnav a[aria-current] { color: var(--mint); font-weight: 600; }
.search { display: flex; flex-direction: column; align-items: flex-end; }
.search summary { list-style: none; }
.search summary::-webkit-details-marker { display: none; }
.search input { width: 220px; max-width: 100%; height: 44px; margin-top: 6px; padding: 0 14px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.35); color: #fff; }
.search input::placeholder { color: rgba(255,255,255,.6); }
.pn-bottom { display: flex; flex-direction: column; gap: 20px; }
.author { margin: 0; font-size: 14px; line-height: 1.75; }
.author strong { color: #fff; }
.author a { color: var(--mint); }
.icons { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px; }
.icons a, .icons button { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: transparent; color: rgba(255,255,255,.8); cursor: pointer; transition: transform 120ms ease-out; }
.icons a:active, .icons button:active { transform: scale(.92); }
.icons .sep { width: 12px; }
.trad #translateBtn { color: var(--mint); }
.cr { margin: 0; font-size: 14px; color: rgba(255,255,255,.6); }
.cr a { border-bottom: 1px dotted rgba(255,255,255,.6); }

.col { min-width: 0; padding: 56px 64px 72px; }

/* 列表 */
.meta { margin: 0; font-size: 14px; color: var(--mut); font-variant-numeric: tabular-nums; }
.meta a { color: inherit; }
.entry, .list-head, .pager, .empty, .err { max-width: 680px; }
.entry { display: flex; flex-direction: column; gap: 16px; padding: 48px 0; border-top: 1px solid var(--rule); }
.entry:first-child, .list-head + .entry { border-top: 0; padding-top: 8px; }
.entry h2 { margin: 0; font-size: 28px; line-height: 1.4; font-weight: 600; }
.entry h2 a { color: var(--ink); }
.summary { margin: 0; font-size: 18px; line-height: 1.9; }
.tray { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; background: var(--sf2); border-radius: 12px; overflow: hidden; }
.tray img { max-width: calc(100% - 64px); max-height: calc(100% - 48px); object-fit: contain; border-radius: 4px; }
.read { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; }
.series-strip { display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.series-strip > .meta { display: flex; gap: 8px; align-items: flex-start; line-height: 1.6; }
.series-strip > .meta .i { margin-top: 2px; }
.eps { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding-bottom: 6px; }
.ep { flex: 0 0 200px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px;
  border: 1px solid var(--rule); border-radius: 8px; color: var(--ink); line-height: 1.5; transition: transform 120ms ease-out; }
.ep:active { transform: scale(.98); }
.list-head h1 { margin: 0 0 8px; font-size: 28px; font-weight: 600; }
.empty { color: var(--ink2); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 40px; border-top: 1px solid var(--rule); }
.btn, .pager a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--rule); background: transparent; color: var(--ink); font: 500 16px var(--sans); cursor: pointer; transition: transform 120ms ease-out; }
.pager a .btn { border: 0; padding: 0; min-height: 0; }
.btn:active, .pager a:active { transform: scale(.98); }

/* 文章 */
.lay { display: grid; grid-template-columns: minmax(0, 680px); column-gap: 56px; align-items: start; }
.lay.has-series { grid-template-columns: minmax(0, 680px) 200px; }
.post { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.post-head { display: flex; flex-direction: column; gap: 14px; }
.post-head h1 { margin: 0; font-size: 36px; line-height: 1.35; font-weight: 700; }
.note { margin: 0; display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px; border-radius: 12px; background: var(--sf2); color: var(--ink2); line-height: 1.75; }
.note .i { margin-top: 5px; }
.prose { font-size: 18px; line-height: 1.9; overflow-wrap: anywhere; }
.prose > * { margin: 0 0 24px; }
.prose h2 { margin: 40px 0 16px; font-size: 22px; line-height: 1.5; }
.prose h3, .prose h4 { margin: 32px 0 12px; font-size: 18px; }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose img { display: block; border-radius: 12px; cursor: zoom-in; }
.prose blockquote { margin-left: 0; padding-left: 20px; border-left: 3px solid var(--rule); color: var(--ink2); }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--sf2); padding: 2px 6px; border-radius: 4px; }
.prose pre { position: relative; background: var(--sf2); border-radius: 12px; padding: 20px 24px; font: 400 14px/1.8 var(--mono);
  overflow-x: auto; overscroll-behavior-x: contain; white-space: pre; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { padding: 8px 12px; border-bottom: 1px solid var(--rule); text-align: left; }
.copy { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink2); font: 500 14px var(--sans); cursor: pointer; }
.copy:active { transform: scale(.97); }
.near { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.near:empty { display: none; }
.near > a, .near > span { display: flex; flex-direction: column; gap: 6px; padding: 20px 24px; border-radius: 12px; background: var(--sf2); color: var(--ink); }
.near .meta { display: inline-flex; align-items: center; gap: 6px; }
.near > span > span:last-child, .near > a > span:last-child { font-size: 18px; font-weight: 600; }
.near .next { text-align: right; align-items: flex-end; }
.byline { display: flex; flex-direction: column; gap: 4px; font-size: 14px; line-height: 1.7; color: var(--ink2); }
.byline strong { font-size: 16px; color: var(--ink); }
.sl { position: sticky; top: 32px; display: flex; flex-direction: column; }
.sl-title { margin: 0 0 8px; display: flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 600; }
.sl-title .i { color: var(--mut); }
.sl a { display: flex; gap: 8px; padding: 7px 0; font-size: 14px; line-height: 1.5; color: var(--ink2); }
.sl a.gap { margin-top: 12px; }
.sl .n { flex: 0 0 60px; color: var(--mut); font-variant-numeric: tabular-nums; }
.sl a[aria-current] { color: var(--ink); font-weight: 600; }
.sl a[aria-current] .n { color: var(--ac); }
.comments h2 { margin: 16px 0 0; font-size: 22px; }

/* 归档页 */
.archive { max-width: 820px; }
.lede { margin: 0; color: var(--ink2); }
.jump { display: flex; flex-wrap: wrap; gap: 0 8px; margin: 24px 0 8px; }
.jump a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--ink2); font-variant-numeric: tabular-nums; }
.yr { display: grid; grid-template-columns: 160px minmax(0, 1fr); column-gap: 48px; padding: 40px 0; border-top: 1px solid var(--rule); }
.yr h2 { margin: 0; font-size: 28px; font-weight: 600; display: flex; flex-direction: column; gap: 4px; font-variant-numeric: tabular-nums; }
.yr ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.yr li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: baseline; line-height: 1.6; }
.yr li a { color: var(--ink); }
.unfold { margin-top: 20px; }

.err h1 { margin: 0 0 12px; font-size: 28px; color: var(--ac); }

/* 大图 */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh; overflow: visible; }
.lightbox::backdrop { background: rgba(10, 8, 7, .85); }
.lightbox img { display: block; max-width: 96vw; max-height: 92vh; border-radius: 8px; }
.lb-close { position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border: 0; border-radius: 22px;
  background: rgba(0,0,0,.5); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 8px); opacity: 0;
  padding: 12px 18px; border-radius: 12px; background: #1f1815; color: #fff; font-size: 14px; pointer-events: none;
  transition: opacity 180ms ease-out, transform 180ms ease-out; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (hover: hover) and (pointer: fine) {
  .entry h2 a:hover, .yr li a:hover, .sl a:hover { color: var(--ac); }
  .pnav > a:hover, .search summary:hover, .icons a:hover, .icons button:hover, .cr a:hover { color: #fff; }
  .ep:hover, .btn:hover, .pager a:hover { border-color: var(--ink2); }
  .copy:hover { color: var(--ink); }
  .prose a:hover { text-decoration-thickness: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (max-width: 1279px) {
  .lay.has-series { grid-template-columns: minmax(0, 680px); }
  .sl { position: static; margin-top: 56px; }
}
@media (max-width: 1023px) {
  /* 窄屏：照片面板拆成页头（标语、导航）和页脚（图标、版权） */
  .shell { display: flex; flex-direction: column; }
  .pn { display: contents; text-align: left; }
  .pn-top, .pn-bottom {
    color: rgba(255,255,255,.72); background-color: #1f1815;
    background-image: url(../img/overlay.png), linear-gradient(rgba(24,18,16,.5), rgba(24,18,16,.5)), url(../img/bg.jpg);
    background-repeat: repeat, no-repeat, no-repeat; background-size: auto, cover, cover; background-position: top left, center, center;
  }
  .pn-top { order: 0; gap: 16px; padding: calc(32px + env(safe-area-inset-top)) 24px 12px; }
  .col { order: 1; width: 100%; }
  .pn-bottom { order: 2; padding: 24px 24px calc(24px + env(safe-area-inset-bottom)); }
  .pnav { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 20px; }
  .search { flex-basis: 100%; align-items: flex-start; }
  .search input { width: 100%; }
  .icons { justify-content: flex-start; }
  .col { padding: 40px 24px 64px; }
}
@media (max-width: 767px) {
  .pn-top { padding: calc(24px + env(safe-area-inset-top)) 16px 8px; }
  .pn-bottom { padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
  .slogan { font-size: 20px; }
  .col { padding: 32px 16px 56px; }
  .entry h2, .post-head h1 { font-size: 22px; }
  .post-head h1 { font-size: 28px; }
  .yr { grid-template-columns: minmax(0, 1fr); row-gap: 16px; }
  .yr li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
