/* 站点共用样式（B3）：首页、/works/、作品介绍、/method/、/about/、404 共用这一个文件。
 * 配色与字体沿用测评台（site/hub/hub.css）和 favicon：纸色底、墨色字、铜色点缀、宋体标题。
 * 只用系统字体与原生 CSS，不引外部资源；窄屏优先，任何宽度下都不让整页横向溢出。 */

:root {
  --paper: #f7f4ef; --paper-2: #ece6dc; --ink: #1d2230; --ink-2: #4a5163; --muted: #858a96;
  --rule: #dcd5c8; --flame: #e2602f; --copper: #b87333; --night: #0a0f1d;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --wrap: 1080px;
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--ink); font: 17px/1.75 var(--sans); overflow-wrap: break-word; }
img, video { max-width: 100%; height: auto; }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--flame); outline-offset: 3px; border-radius: 4px; }
/* 只居中、不写 margin-top：否则会盖掉下面 section 的上边距 */
.wrap { max-width: var(--wrap); margin-inline: auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 50; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; }
.skip:focus { left: 12px; top: 12px; }

/* ---------- 页头 ---------- */
.site-head { position: sticky; top: 0; z-index: 30; background: rgba(247, 244, 239, .93); backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2); border-bottom: 1px solid var(--rule); }
.head-in { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.brand .mark { width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--ink); color: var(--paper); border: 1px solid var(--copper); display: grid; place-items: center; font: 700 17px/1 var(--serif); }
.brand .name { font: 900 19px/1.2 var(--serif); letter-spacing: .5px; }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.nav a { font-size: 14.5px; color: var(--ink-2); text-decoration: none; padding: 8px 11px; border-radius: 8px; white-space: nowrap; transition: color .2s, background .2s; }
.nav a:hover { color: var(--ink); background: var(--paper-2); }
.nav a[aria-current="page"] { color: var(--flame); font-weight: 600; }
.menu { display: none; margin-left: auto; position: relative; }
.menu summary { list-style: none; cursor: pointer; border: 1px solid var(--rule); background: #fff; border-radius: 9px; padding: 8px 14px; font-size: 14px; font-weight: 600; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; }
.menu[open] summary { color: var(--flame); border-color: var(--flame); }
.menu nav { position: absolute; right: 0; top: calc(100% + 8px); min-width: 184px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 16px 40px rgba(20, 30, 50, .14); padding: 8px; }
.menu nav a { padding: 10px 12px; border-radius: 8px; font-size: 15px; text-decoration: none; color: var(--ink); }
.menu nav a[aria-current="page"] { color: var(--flame); font-weight: 600; background: var(--paper-2); }

/* ---------- 面包屑与正文容器 ---------- */
.crumbs { margin: 22px 0 0; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--flame); }
.crumbs .sep { margin: 0 6px; color: var(--rule); }
main { padding-bottom: 40px; }

/* ---------- 首页主视觉 ---------- */
.hero { margin-top: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: center; padding: 52px 0 10px; }
.hero h1 { font: 900 clamp(28px, 4.2vw, 44px)/1.22 var(--serif); margin: 8px 0 26px; letter-spacing: .5px; text-wrap: balance; }
.kicker { margin: 0; color: var(--flame); font-size: 13px; letter-spacing: .22em; font-weight: 600; }
.hero-work h2 { font: 900 24px/1.3 var(--serif); margin: 0 0 4px; }
.hero-work .sub { margin: 0; color: var(--muted); font-size: 14px; }
.hero-work .desc { margin: 10px 0 22px; color: var(--ink-2); font-size: 16px; }
.hero-media { margin: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--rule); background: var(--paper-2); }
.hero-media img { display: block; width: 100%; height: auto; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn { display: inline-block; padding: 12px 20px; border-radius: 10px; border: 1px solid var(--ink); text-decoration: none; font-weight: 600; font-size: 15.5px; transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s; }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--flame); border-color: var(--flame); color: #fff; }
.btn:hover { transform: translateY(-1px); }
.hint { color: var(--muted); font-size: 13px; }

/* ---------- 区块与列表 ---------- */
section { margin-top: 64px; }
h2 { font: 900 clamp(23px, 2.6vw, 30px)/1.3 var(--serif); margin: 0 0 8px; text-wrap: balance; }
.lead { color: var(--ink-2); margin: 0 0 22px; max-width: 780px; }
.more { margin: 18px 0 0; }
.more a, .link-strong { font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--flame); padding-bottom: 1px; }
.more a:hover, .link-strong:hover { color: var(--flame); }

.feed { list-style: none; margin: 18px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.feed li { border-bottom: 1px solid var(--rule); }
.feed a { display: grid; grid-template-columns: 92px 104px minmax(0, 1fr); gap: 14px; align-items: baseline; padding: 14px 4px; text-decoration: none; }
.feed .tag { justify-self: start; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--flame); border: 1px solid currentColor; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.feed time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed b { font: 600 17px/1.4 var(--sans); }
.feed .sum { display: block; margin-top: 2px; color: var(--ink-2); font-size: 14.5px; }
.feed a:hover b { color: var(--flame); }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }
.card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; }
.card > img { display: block; width: 100%; height: auto; background: var(--paper-2); border-bottom: 1px solid var(--rule); }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; }
.card h3 { font: 900 21px/1.3 var(--serif); margin: 0; }
.card .q { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.65; }
.card .first { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; font-size: 14.5px; }
.card .first .dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--c, #2a5f9e); }
.card .first small { color: var(--muted); }
.card .links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: auto; padding-top: 6px; }
.card .links a { font-weight: 600; font-size: 14.5px; text-decoration: none; border-bottom: 2px solid var(--flame); padding-bottom: 1px; }
.card .links a:hover { color: var(--flame); }

.page-title { font: 900 clamp(28px, 4vw, 40px)/1.25 var(--serif); margin: 8px 0 12px; }

.work-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 18px; }
.work-card { display: block; color: inherit; text-decoration: none; background: #fff; border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.work-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(29, 34, 48, .12); }
.work-card img { display: block; width: 100%; height: auto; background: var(--paper-2); }
.work-card div { padding: 14px 16px 16px; }
.work-card b { display: block; font-size: 18px; }
.work-card small { color: var(--muted); font-size: 13px; }
.work-card p { margin: 8px 0 0; font-size: 15px; color: var(--ink-2); line-height: 1.6; }

/* ---------- 作品列表 ---------- */
.work-list { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 26px; }
.work-item { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0; align-items: start; background: #fff; border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; }
.work-item .work-cover { display: block; }
.work-item img { display: block; width: 100%; height: auto; }
.work-item > div { padding: 18px 22px 22px; }
.work-item h2 { font-size: 22px; margin: 0 0 4px; }
.work-item h2 a { text-decoration: none; }
.work-item h2 a:hover { color: var(--flame); }
.work-item .sub { margin: 0; color: var(--muted); font-size: 14px; }
.work-item .desc { margin: 10px 0 0; color: var(--ink-2); font-size: 15.5px; }
.work-item .meta { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.work-item .links { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0 0; }
.work-item .links a { font-weight: 600; font-size: 14.5px; text-decoration: none; border-bottom: 2px solid var(--flame); padding-bottom: 1px; }
.work-item .links a:hover { color: var(--flame); }

/* ---------- 正文页（方法、关于、作品介绍、404） ---------- */
.prose { max-width: 820px; padding-top: 44px; }
.prose h1 { font: 900 clamp(28px, 4vw, 40px)/1.25 var(--serif); margin: 8px 0 14px; }
.prose h2 { font: 900 24px/1.35 var(--serif); margin: 44px 0 10px; }
.prose h3 { font: 900 19px/1.4 var(--serif); margin: 26px 0 6px; }
.prose p { margin: 0 0 14px; color: var(--ink-2); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 1.25em; color: var(--ink-2); }
.prose li { margin: 6px 0; }
.prose a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--copper); }
.prose a:hover { color: var(--flame); border-color: var(--flame); }
.prose .lead { font-size: 18px; color: var(--ink); }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: var(--paper-2); padding: 1px 5px; border-radius: 4px; }
.prose .note { background: #fff; border: 1px solid var(--rule); border-left: 4px solid var(--copper); border-radius: 0 10px 10px 0; padding: 14px 16px; font-size: 15px; }
.table-wrap { overflow-x: auto; margin: 16px 0 22px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose td { hyphens: none; }
.prose thead th { font-size: 13px; color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.prose .meta-table th { width: 9em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.prose .stations th { white-space: nowrap; }

.video { margin: 22px 0 10px; border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; background: var(--night); }
.video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: var(--night); }
.video figcaption { padding: 10px 14px; font-size: 13.5px; color: var(--muted); background: #fff; }

.plain-list { list-style: none; margin: 22px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.plain-list li { border-bottom: 1px solid var(--rule); }
.plain-list a { display: block; padding: 13px 2px; text-decoration: none; font-weight: 600; }
.plain-list a:hover { color: var(--flame); }

/* ---------- 页脚 ---------- */
.site-foot { margin-top: 80px; border-top: 2px solid var(--ink); padding: 26px 0 40px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 24px; }
.foot-brand b { display: block; font: 900 18px var(--serif); }
.foot-brand span { color: var(--muted); font-size: 13.5px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; font-size: 14px; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--flame); }
.foot-note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; margin-top: 22px; color: var(--muted); font-size: 13px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 34px; }
  .hero-media { order: -1; }
  .work-item { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  /* 窄屏表格改成纵向排列：两列表格在 390px 里挤成竖排字，读起来比横向滚动更差 */
  .prose table, .prose tbody, .prose tr, .prose th, .prose td { display: block; }
  .prose thead { display: none; }
  .prose tr { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .prose tr:first-child { padding-top: 0; }
  .prose th, .prose td { border: 0; padding: 2px 0; }
  .prose .meta-table th, .prose .stations th { width: auto; white-space: normal; font-size: 13px; }
  .prose .stations td:first-child { font-size: 16px; color: var(--ink); }
  .prose .stations td:first-child strong { font-size: 17px; }
  .prose .stations td:last-child { margin-top: 4px; }
  .table-wrap { overflow: visible; }
  .nav { display: none; }
  .menu { display: block; }
  .brand .name { font-size: 17px; }
  .feed a { grid-template-columns: 1fr; gap: 4px; }
  .feed time { order: 2; }
  .prose { padding-top: 30px; }
  .foot-note { flex-direction: column; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
