/* ============================================================
   ENGINEERING ARCHIVE — 暗底暖光 · 工程档案式静态站
   纯 CSS，无外部字体 / 无 CDN / 断网可开
   ============================================================ */

:root {
  --bg:        #0d0f12;
  --bg-2:      #11141a;
  --panel:     #14181f;
  --panel-2:   #181d25;
  --ink:       #e8e4dc;
  --ink-soft:  #b6b1a8;
  --muted:     #7c8189;
  --faint:     #4a5058;
  --line:      #262b33;
  --line-2:    #1d222a;
  --amber:     #e0a458;
  --amber-2:   #c9813c;
  --amber-dim: rgba(224, 164, 88, .10);
  --green:     #8bbf94;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --wrap: min(92vw, 1400px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; }
::selection { background: rgba(224, 164, 88, .28); color: #fff; }

.wrap { width: var(--wrap); margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--amber); color: #14100a; padding: 10px 16px;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- 细网格背景（纯 CSS，无图片） ---------- */
.grid-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.020) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.020) 1px, transparent 1px),
    radial-gradient(1100px 520px at 62% -8%, rgba(224,164,88,.075), transparent 70%),
    radial-gradient(700px 420px at 4% 34%, rgba(201,129,60,.035), transparent 72%);
  background-size: 48px 48px, 48px 48px, 100% 100%, 100% 100%;
  mask-image: linear-gradient(to bottom, #000 0%, #000 42%, rgba(0,0,0,.35) 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 42%, rgba(0,0,0,.35) 100%);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(13, 15, 18, .88);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar__in {
  display: flex; align-items: center; gap: 28px;
  height: 60px;
}
.brand {
  font-size: 12.5px; letter-spacing: .16em; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.brand__mark { color: var(--amber); margin-right: 9px; font-size: 11px; }
.nav { display: flex; gap: 24px; margin-left: auto; }
.nav a {
  color: var(--muted); text-decoration: none; font-size: 12.5px;
  letter-spacing: .04em; padding: 4px 0; border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.nav a:hover, .nav a:focus-visible, .nav a.is-active {
  color: var(--amber); border-bottom-color: var(--amber-2);
}
.topbar__build { color: var(--faint); font-size: 11px; white-space: nowrap; }

/* ---------- Hero ---------- */
.hero { padding: 96px 0 76px; border-bottom: 1px solid var(--line); }
.kicker {
  color: var(--amber); font-size: 12px; letter-spacing: .13em;
  margin: 0 0 22px; text-transform: uppercase;
}
.kicker__bar { color: var(--faint); margin-right: 8px; }
.hero h1 {
  font-family: var(--sans);
  font-size: clamp(34px, 5.4vw, 62px);
  line-height: 1.18; letter-spacing: -.025em;
  font-weight: 650; margin: 0 0 26px;
}
.hero h1 .hl {
  color: var(--amber);
  background: linear-gradient(180deg, transparent 62%, rgba(224,164,88,.16) 62%);
  padding: 0 4px;
}
.hero__sub {
  max-width: 780px; color: var(--ink-soft); font-size: 14px;
  line-height: 1.95; margin: 0;
}
.hero__sub code, .note-box code {
  font-family: var(--mono); font-size: .92em;
  color: var(--amber); background: var(--amber-dim);
  padding: 1px 6px; border: 1px solid rgba(224,164,88,.16); border-radius: 3px;
}
.stats {
  display: flex; flex-wrap: wrap; gap: 0;
  margin-top: 44px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.014), transparent);
}
.stat {
  flex: 1 1 150px; padding: 18px 22px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.stat:last-child { border-right: 0; }
.stat__n { font-size: 27px; color: var(--amber); line-height: 1.2; letter-spacing: -.02em; }
.stat__l { font-size: 11px; color: var(--muted); letter-spacing: .06em; }
.hero__note { margin: 26px 0 0; color: var(--faint); font-size: 12px; }
.amber { color: var(--amber); }

/* ---------- Section 通用 ---------- */
.section { padding: 74px 0; border-bottom: 1px solid var(--line); }
.section__head { margin-bottom: 30px; }
.section__head h2 {
  font-family: var(--sans); font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 620; letter-spacing: -.01em; margin: 0 0 8px;
}
.section__no { color: var(--amber); font-family: var(--mono); font-size: .62em; letter-spacing: .08em; margin-right: 12px; font-weight: 400; }
.section__hint { color: var(--faint); font-size: 12px; margin: 0; }

/* ---------- 技术栈 ---------- */
.stack-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  display: inline-block; font-size: 11.5px; line-height: 1.4;
  color: var(--ink-soft); background: var(--panel);
  border: 1px solid var(--line); border-radius: 3px;
  padding: 4px 10px; white-space: nowrap;
}
.tag--big { font-size: 12.5px; padding: 7px 14px; color: var(--ink); }
.tag--big:hover { border-color: rgba(224,164,88,.4); color: var(--amber); }

/* ---------- 项目索引 ---------- */
.idx {
  list-style: none; margin: 0; padding: 0;
  border-top: 1px solid var(--line);
}
.idx li { border-bottom: 1px solid var(--line-2); }
.idx a {
  display: grid; grid-template-columns: 54px 1fr auto auto;
  align-items: center; gap: 16px;
  padding: 13px 12px; text-decoration: none;
  transition: background .16s, padding-left .16s;
}
.idx a:hover { background: rgba(224,164,88,.045); padding-left: 20px; }
.idx__no { color: var(--faint); font-size: 12px; }
.idx__name { font-size: 14px; color: var(--ink); }
.idx__status {
  font-size: 10px; letter-spacing: .1em; padding: 2px 9px;
  border: 1px solid var(--line); border-radius: 2px; color: var(--muted);
}
.idx__status::before { content: ""; }
.idx a:has(.idx__status) .idx__status { justify-self: end; }
.idx li a .idx__status:last-child { grid-column: auto; }

/* ---------- 档案条目（工程档案式，不是卡片墙） ---------- */
.archive__legend { display: flex; gap: 24px; margin-bottom: 22px; font-size: 12px; color: var(--muted); }
.legend { display: inline-flex; align-items: center; gap: 8px; }
.legend__dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend__dot--live { background: var(--green); box-shadow: 0 0 0 3px rgba(139,191,148,.12); }
.legend__dot--draft { background: var(--faint); border: 1px solid var(--muted); }

/* JS 渐进增强：状态过滤条（无 JS 时不存在，页面照样完整） */
.filterbar { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 26px; }
.filterbar__btn {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  background: transparent; border: 1px solid var(--line); border-radius: 3px;
  padding: 5px 12px; cursor: pointer;
  transition: color .16s, border-color .16s, background .16s;
}
.filterbar__btn:hover { color: var(--ink); border-color: var(--faint); }
.filterbar__btn.is-active {
  color: var(--amber); border-color: rgba(224,164,88,.45); background: var(--amber-dim);
}
.filterbar__btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.entry[hidden] { display: none; }

.archive { border-top: 1px solid var(--line); }
.entry {
  position: relative;
  display: grid; grid-template-columns: 84px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
  padding: 0;
  scroll-margin-top: 80px;
}
.entry::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: transparent;
}
.entry[data-status="live"]::before { background: linear-gradient(to bottom, var(--amber), transparent 62%); }
.entry:hover { background: rgba(255,255,255,.010); }

.entry__head {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 84px 1fr auto;
  align-items: center; gap: 0;
  border-bottom: 1px solid var(--line-2);
  min-height: 66px;
}
.entry__no {
  color: var(--faint); font-size: 15px; letter-spacing: .08em;
  padding-left: 22px; align-self: stretch; display: flex; align-items: center;
  border-right: 1px solid var(--line-2);
}
.entry[data-status="live"] .entry__no { color: var(--amber); }
.entry__titlewrap {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 24px;
}
.entry__title {
  font-family: var(--sans); font-size: clamp(18px, 2vw, 23px);
  font-weight: 620; letter-spacing: -.01em; margin: 0;
}
.badge {
  font-size: 10.5px; letter-spacing: .05em; padding: 3px 10px;
  border-radius: 2px; border: 1px solid; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.badge--live { color: var(--green); border-color: rgba(139,191,148,.35); background: rgba(139,191,148,.07); }
.badge--draft { color: var(--muted); border-color: var(--line); background: rgba(255,255,255,.02); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.entry__meta {
  display: flex; gap: 18px; padding-right: 24px;
  color: var(--faint); font-size: 11px; white-space: nowrap;
}
.meta-comment { color: var(--faint); }

.entry__body {
  grid-column: 2;
  padding: 26px 24px 34px;
  min-width: 0;
}
.entry__desc {
  margin: 0 0 24px; max-width: 900px;
  color: var(--ink-soft); font-size: 14px; line-height: 1.9;
}
.entry__field {
  display: grid; grid-template-columns: 110px minmax(0, 1fr);
  gap: 16px; padding: 14px 0;
  border-top: 1px dashed var(--line-2);
  align-items: start;
}
.field__key {
  color: var(--faint); font-size: 11px; letter-spacing: .08em;
  padding-top: 4px; text-transform: uppercase;
}
.entry__field--tradeoff .field__key { color: var(--amber-2); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tradeoff {
  margin: 0; padding: 4px 0 4px 18px;
  border-left: 2px solid rgba(224,164,88,.35);
  color: var(--ink); font-size: 13.5px; line-height: 1.95;
  max-width: 900px;
}
.tradeoff cite {
  display: block; margin-top: 10px;
  color: var(--faint); font-size: 11px; font-style: normal;
}

.shots {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.shot { margin: 0; border: 1px solid var(--line); background: var(--bg-2); min-width: 0; }
.shot img {
  display: block; width: 100%; height: auto;
  background: #0a0c0f;
  border-bottom: 1px solid var(--line);
}
.shot figcaption {
  padding: 9px 12px; font-size: 11px; color: var(--muted);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.shot__tag { color: var(--faint); }

.entry__actions {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line-2);
}
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em;
  padding: 10px 18px; border-radius: 3px; text-decoration: none;
  border: 1px solid var(--amber-2);
  transition: background .18s, border-color .18s, transform .18s;
}
.btn svg { width: 14px; height: 14px; }
.btn--primary { background: var(--amber-dim); color: var(--amber); }
.btn--primary:hover, .btn--primary:focus-visible {
  background: rgba(224,164,88,.2); border-color: var(--amber); transform: translateY(-1px);
}
.btn--disabled {
  color: var(--faint); border: 1px dashed var(--line);
  background: transparent; cursor: not-allowed;
}
.btn__note { color: var(--faint); font-size: 11px; }

/* ---------- 状态边界说明 ---------- */
.section--draft { border-bottom: 0; }
.note-box {
  border: 1px solid var(--line); background: var(--panel);
  padding: 24px 28px; max-width: 980px;
}
.note-box p { margin: 0 0 12px; color: var(--ink-soft); font-size: 13px; line-height: 1.9; }
.note-box p:last-child { margin-bottom: 0; }
.note-box__sub { color: var(--faint) !important; font-size: 12px !important; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--faint); font-size: 11px; }
.footer__in { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .entry__meta { display: none; }
  .topbar__build { display: none; }
}
@media (max-width: 760px) {
  :root { --wrap: 92vw; }
  body { font-size: 13.5px; }
  .hero { padding: 64px 0 54px; }
  .hero__sub { font-size: 13px; }
  .section { padding: 54px 0; }
  .topbar__in { gap: 12px; }
  .brand { font-size: 11px; letter-spacing: .1em; }
  .nav { gap: 14px; }
  .nav a { font-size: 11.5px; }
  .stat { flex: 1 1 45%; border-bottom: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-last-child(-n+2) { border-bottom: 0; }
  .stat__n { font-size: 22px; }

  .entry { grid-template-columns: 1fr; }
  .entry__head { grid-template-columns: 1fr; }
  .entry__no {
    padding: 8px 16px; border-bottom: 1px solid var(--line-2);
    color: var(--amber); font-size: 11px; letter-spacing: .1em;
  }
  .entry__titlewrap { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .entry__title { font-size: 19px; }
  .entry__body { grid-column: 1; padding: 20px 16px 28px; }
  .entry__field { grid-template-columns: 1fr; gap: 6px; }
  .field__key { padding-top: 0; }
  .shots { grid-template-columns: 1fr; }
  .idx a { grid-template-columns: 40px 1fr auto; gap: 10px; padding: 11px 6px; }
  .idx__name { font-size: 13px; }
  .footer__in { flex-direction: column; }
}

@media (min-width: 1200px) {
  :root { --wrap: min(92vw, 1400px); }
  .entry { grid-template-columns: 96px minmax(0, 1fr); }
  .entry__body { padding-right: 40px; }
  .hero { padding: 110px 0 88px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
