/* ============================================================
   TEMPLATE 09 — Blueprint Tech
   图纸感:蓝灰纸面、藏青细线网格、indigo 主体、橘色旗标、
   FIG 编号标注、mono 注记。
   适用:开发者工具 / MCP / API / SaaS 基础设施 niche。
   字体:Instrument Sans(body)+ Space Mono(mono 注记)。
   ============================================================ */

:root {
  --paper: #edf1f8;
  --paper-raised: #f7f9fc;
  --ink: #10243f;
  --muted: #4c6076;
  --faint: #5a6c7f;
  --indigo: #3b5bdb;
  --indigo-deep: #2c4394;
  --indigo-tint: #e3e9fb;
  --flag: #e8590c;
  --line: #ccd6e6;
  --line-navy: rgba(16, 36, 63, 0.14);
  --font-body: "Instrument Sans", "Segoe UI", Arial, sans-serif;
  --font-mono: "Space Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-padding-top: 80px; }
body {
  font-family: var(--font-body); color: var(--ink); line-height: 1.66; font-size: 16.5px;
  background:
    linear-gradient(var(--line-navy) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-navy) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px, 36px 36px, auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--indigo); text-decoration: none; }
a:hover { color: var(--flag); }
h1, h2, h3 { font-family: var(--font-body); font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); }
h2 { font-size: 1.55rem; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 770px; }
.mono { font-family: var(--font-mono); }

/* ---------- 顶栏:图纸标题栏(title block) ---------- */
.topbar { background: var(--paper-raised); border-bottom: 2px solid var(--ink); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; }
.brand { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.brand::before { content: "◈ "; color: var(--indigo); }
.brand:hover { color: var(--indigo); }
.topnav { display: flex; gap: 22px; font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
.topnav a { color: var(--muted); }
.topnav a:hover { color: var(--indigo); }
@media (max-width: 720px) { .topnav { display: none; } }

/* ---------- Hero:图纸边框 + 角标 ---------- */
.hero { padding: 52px 0 44px; }
.sheet {
  border: 1.5px solid var(--ink); background: var(--paper-raised);
  padding: 44px 44px 38px; position: relative;
}
.sheet::before, .sheet::after {
  content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--indigo);
}
.sheet::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.sheet::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.fig { font-family: var(--font-mono); font-size: 0.74rem; color: var(--flag); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 14px; }
.fig b { color: var(--ink); font-weight: 400; }
.hero h1 { margin-bottom: 14px; }
.hero h1 .u { box-shadow: inset 0 -0.28em 0 var(--indigo-tint); }
.hero .lede { color: var(--muted); max-width: 64ch; font-size: 1.07rem; }
.specs { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line); background: var(--paper); }
.spec { flex: 1 1 150px; padding: 12px 16px; border-right: 1px solid var(--line); }
.spec:last-child { border-right: 0; }
.spec .k { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; color: var(--faint); letter-spacing: 0.08em; }
.spec .v { font-weight: 700; font-size: 1.05rem; }
.spec .v b { color: var(--indigo); }

/* ---------- 排名:SPEC 行 ---------- */
.board { padding: 36px 0; display: grid; gap: 14px; }
.row-card {
  display: grid; grid-template-columns: 76px 1fr 190px;
  border: 1px solid var(--line); background: var(--paper-raised);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.row-card:hover { border-color: var(--indigo); box-shadow: 4px 4px 0 var(--indigo-tint); }
@media (max-width: 860px) { .row-card { grid-template-columns: 60px 1fr; } .row-card .r-metrics { grid-column: 2; border-left: 0; border-top: 1px dashed var(--line); } }
.rc-no {
  display: grid; place-items: center; border-right: 1px dashed var(--line);
  font-family: var(--font-mono); font-size: 1.5rem; font-weight: 700; color: var(--indigo);
}
.rc-no.top { color: var(--flag); }
.rc-body { padding: 22px 26px; }
.rc-body h3 { font-size: 1.25rem; margin-bottom: 7px; }
.rc-body h3 .flagtag { font-family: var(--font-mono); font-size: 0.66rem; color: #fff; background: var(--flag); padding: 3px 9px; margin-left: 10px; vertical-align: 2px; letter-spacing: 0.06em; }
.rc-body p { color: var(--muted); font-size: 0.95rem; }
.rc-metrics {
  border-left: 1px dashed var(--line); padding: 20px;
  font-family: var(--font-mono); display: flex; flex-direction: column; gap: 8px; justify-content: center;
}
.rm { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); }
.rm b { color: var(--ink); font-weight: 400; }
.rm-score { font-size: 1.8rem; color: var(--indigo); text-align: right; line-height: 1.1; }
.rm-score small { display: block; font-size: 0.66rem; color: var(--faint); letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- 表格 ---------- */
.compare-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 24px 0; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.compare-table th, .compare-table td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; background: var(--paper-raised); }
.compare-table th { background: var(--indigo); color: #fff; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.compare-table td:first-child { color: var(--muted); }

/* ---------- 正文 ---------- */
.prose { padding: 46px 0 62px; }
.prose h2::before { content: "§ "; color: var(--indigo); }
.prose h2 { margin: 38px 0 14px; }
.prose p { margin-bottom: 16px; color: #1c3049; }
.anno { border-left: 3px solid var(--flag); background: var(--paper-raised); padding: 16px 20px; margin: 26px 0; font-family: var(--font-mono); font-size: 0.85rem; color: var(--muted); }
.anno .a-label { color: var(--flag); font-weight: 700; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; display: block; margin-bottom: 6px; }

/* ---------- 页脚 ---------- */
.footer { border-top: 2px solid var(--ink); background: var(--paper-raised); font-size: 0.86rem; }
.footer-inner { padding: 32px 0; display: grid; gap: 12px; color: var(--muted); }
.related-note { font-family: var(--font-mono); font-size: 0.74rem; color: var(--faint); border-top: 1px dashed var(--line); padding-top: 12px; }

/* ---- micro-interactions / a11y / motion ---- */
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; }
::selection { background: rgba(59, 91, 219, 0.2); }
a { text-underline-offset: 3px; }
.back-top { position: fixed; right: 18px; bottom: 18px; z-index: 30; width: 42px; height: 42px;
  display: grid; place-items: center; background: var(--ink); color: #fff; font-size: 1.05rem;
  opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 18px; font-weight: 600; }
.skip-link:focus { left: 8px; }
[data-animate] { opacity: 0; transform: translateY(14px); transition: opacity 0.65s cubic-bezier(0.22,1,0.36,1), transform 0.65s cubic-bezier(0.22,1,0.36,1); transition-delay: inherit; will-change: opacity, transform; }
[data-animate].in { opacity: 1; transform: none; }
.rc-metrics a::after { content: " →"; display: inline-block; transition: transform 0.2s ease; }
.rc-metrics a:hover::after { transform: translateX(4px); }
.row-card:hover .rc-no { letter-spacing: 0.05em; }
.rc-no { transition: letter-spacing 0.2s ease; }
.topbar.scrolled { box-shadow: 0 6px 24px -10px rgba(16, 36, 63, 0.3); }
.topbar { transition: box-shadow 0.25s ease; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  [data-animate] { opacity: 1; transform: none; transition: none; }
}

/* R5 hero specialization */
.sheet::before, .sheet::after { opacity: 0; animation: tickin 0.5s ease 0.4s forwards; }
@keyframes tickin { to { opacity: 1; } }
.fig b { animation: figstamp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s backwards; display: inline-block; }
@keyframes figstamp { from { opacity: 0; transform: scale(1.3); } }
@media (prefers-reduced-motion: reduce) { .sheet::before, .sheet::after, .fig b { animation: none; opacity: 1; transform: none; } }

/* R8 score underline growth */
.rm-score { position: relative; display: inline-block; margin-bottom: 8px; }
.rm-score::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--indigo); transform: scaleX(0); transform-origin: right;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.35s; }
[data-animate].in .rm-score::after, .in .rm-score::after { transform: scaleX(1); }

/* R9 tables on narrow screens */
@media (max-width: 640px) {
  .compare-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .compare-table tbody { display: table; width: 100%; min-width: 480px; }
}

/* R10 mobile rhythm */
@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .sheet { padding: 28px 22px; }
  .hero { padding-top: 48px; }
}

/* R14 hover signature */
.row-card:hover .rc-body h3 .flagtag { background: var(--indigo); transition: background 0.2s ease; }
.flagtag { transition: background 0.2s ease; }

/* R1 typography features */
body { font-feature-settings: "kern" 1, "liga" 1, "calt" 1; -webkit-tap-highlight-color: transparent; }

/* R2 editorial measure */
.prose p { text-wrap: pretty; orphans: 3; widows: 3; }
.prose { hyphens: auto; }

/* R3 mono numerals */
[class*="mono"], .term-body, .t-output, .idx-tags, .hero-meta { font-variant-numeric: slashed-zero; }

/* R5 hover inner response */
.row-card:hover .rc-no { transform: translateX(3px); } .rc-no { transition: transform 0.25s ease; }

/* R6 prose link underline grow */
.prose p a {
  background: linear-gradient(currentColor, currentColor) bottom left / 0% 1px no-repeat;
  transition: background-size 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: 2px;
}
.prose p a:hover { background-size: 100% 1px; }

/* R7 themed scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3b5bdb55; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #3b5bdb; border: 2px solid transparent; background-clip: content-box; }

/* R8 touch feedback */
.row-card:active { transform: scale(0.995); }

/* R9 back-top smooth elevator */
.back-top { transform: translateY(10px); transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
.back-top[style*="opacity: 1"], .back-top:hover { transform: translateY(0); }
.back-top:active { transform: translateY(2px); }

/* R3 footer two-column */
@media (min-width: 860px) {
  .footer-inner { grid-template-columns: 1fr auto; align-items: start; }
  .footer-inner > div:first-child { order: 1; }
  .related-note { order: 2; max-width: 56ch; border-top: 0; padding-top: 0; text-align: right; }
}

/* R4 current page nav state */
.topnav a[aria-current='page'] { color: var(--indigo); border-bottom: 2px solid var(--indigo); }
