/* Trace Browser — Baseline UI · 干净中性底 + 单一强调色 + 强排版层次 */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-mute: #eef0f4;
  --ink: #1a1d24;
  --ink-strong: #0f1117;
  --muted: #555c68;
  --subtle: #8a9099;
  --accent: #1e3a8a;          /* 单一强调色：深靛蓝 */
  --accent-ink: #ffffff;
  --accent-soft: #eef2fb;
  --line: #e6e8ee;
  --line-strong: #d3d7df;
  --rule: #1a1d24;
  --ok: #166534;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  font-family: var(--sans);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.sr-only,
.skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link:focus {
  position: fixed; top: 14px; left: 14px; z-index: 100;
  padding: 10px 16px; color: #fff; background: var(--accent); font-weight: 600;
}

/* ===== 顶部强调线 ===== */
.topline {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 90;
  background: var(--accent);
}

/* ===== Header ===== */
.site-header {
  position: sticky; top: 3px; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  padding: 0 clamp(24px, calc((100vw - 1280px) / 2 + 24px), 24px);
  background: rgba(255,255,255,0.88);
  backdrop-filter: saturate(160%) blur(16px);
}

.brand {
  display: inline-flex; align-items: center; gap: 11px;
  color: var(--ink-strong); font-size: 19px; font-weight: 600;
  letter-spacing: 0.01em; font-family: var(--serif);
}

.brand img { width: 24px; height: 24px; filter: grayscale(1) contrast(1.1); }
.brand-name em { font-style: normal; color: var(--accent); font-weight: 600; }

.site-nav {
  display: flex; gap: 42px; color: var(--muted);
  font-size: 14px; font-weight: 500; letter-spacing: 0.02em;
}

.site-nav a {
  display: inline-flex; align-items: center; min-height: 68px;
  border-bottom: 2px solid transparent; transition: color 160ms ease, border-color 160ms ease;
}

.site-nav a:hover, .site-nav a.is-active { color: var(--ink-strong); border-color: var(--accent); }

.nav-toggle {
  display: none; width: 44px; height: 44px;
  border: 1px solid var(--line-strong); border-radius: 50%; background: transparent;
}
.nav-toggle span:not(.sr-only) { display: block; width: 16px; height: 2px; margin: 4px auto; background: var(--ink); }

/* ===== 容器 ===== */
.hero, .figures, .section-features, .section-cases, .section-it, .section-gallery,
.section-cta, .site-footer {
  width: min(1280px, 100%); margin: 0 auto;
  padding-left: clamp(24px, calc((100vw - 1280px) / 2 + 24px), 24px);
  padding-right: clamp(24px, calc((100vw - 1280px) / 2 + 24px), 24px);
}

/* ===== Reveal ===== */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Hero ===== */
.hero { position: relative; padding: 60px 24px 88px; }

.hero-meta {
  display: flex; justify-content: space-between; margin-bottom: 46px;
  color: var(--subtle); font-size: 11px; font-weight: 600;
  letter-spacing: 0.22em; text-transform: uppercase; font-variant-numeric: tabular-nums;
}

.hero-grid {
  display: grid; grid-template-columns: minmax(0,1.08fr) minmax(0,0.92fr);
  gap: 56px; align-items: center;
}

.hero-copy { border-top: 3px solid var(--accent); padding-top: 30px; }

.hero-title {
  margin: 0; color: var(--ink-strong); font-family: var(--serif);
  font-size: clamp(44px, 6vw, 82px); line-height: 1.1; font-weight: 500;
  letter-spacing: 0.02em; text-wrap: balance;
}

.hero-underline { color: var(--accent); }

.hero-desc {
  max-width: 500px; margin: 28px 0 0; color: var(--muted);
  font-size: 17px; line-height: 1.85; text-wrap: pretty;
}

.hero-visual { position: relative; }

.hero-figure { position: relative; margin: 0; }
.hero-figure img {
  width: 100%; height: clamp(280px,34vw,440px); object-fit: cover; object-position: top center;
  filter: grayscale(0.2); border: 1px solid var(--line-strong); background: var(--bg-soft);
}
.hero-figure::before {
  content: ""; position: absolute; inset: 12px -12px -12px 12px;
  border: 1px solid var(--line-strong); z-index: -1;
}
.hero-figure figcaption {
  position: absolute; bottom: 14px; left: 14px; padding: 6px 12px;
  color: #fff; background: var(--accent); font-size: 11px; font-weight: 600;
  letter-spacing: 0.16em; text-transform: uppercase;
}

.hero-index {
  position: absolute; right: clamp(24px, calc((100vw - 1280px) / 2 + 24px), 24px); bottom: 26px;
  display: flex; gap: 22px; color: var(--subtle); font-family: var(--serif);
  font-size: 13px; letter-spacing: 0.14em; font-variant-numeric: tabular-nums;
}

/* ===== Figures ===== */
.figures {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr));
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--line);
}
.figure-item { padding: 38px 28px; border-left: 1px solid var(--line); }
.figure-item:first-child { border-left: 0; }
.figure-item strong {
  display: block; color: var(--ink-strong); font-family: var(--serif);
  font-size: clamp(30px,3.4vw,46px); font-weight: 500; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.figure-item span { display: block; margin-top: 12px; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0.04em; }

/* ===== Section head ===== */
.section-head {
  display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 20px; align-items: end;
  padding: 88px 0 40px;
}
.section-index {
  color: var(--subtle); font-family: var(--mono); font-size: 13px;
  letter-spacing: 0.14em; padding-top: 14px; font-variant-numeric: tabular-nums;
}
.section-head h2 {
  margin: 0; color: var(--ink-strong); font-family: var(--serif);
  font-size: clamp(32px,4.4vw,56px); line-height: 1.16; font-weight: 500;
  letter-spacing: 0.01em; text-wrap: balance;
}

/* ===== Feature list ===== */
.feature-list { border-top: 1px solid var(--rule); }
.feature-row {
  display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 30px;
  padding: 44px 0; border-bottom: 1px solid var(--line); transition: background 160ms ease;
}
.feature-row:hover { background: var(--bg-soft); }
.feature-num { color: var(--accent); font-family: var(--serif); font-size: 15px; letter-spacing: 0.2em; padding-top: 8px; }
.feature-body h3 {
  margin: 0; color: var(--ink-strong); font-family: var(--serif);
  font-size: clamp(24px,3vw,32px); font-weight: 500; letter-spacing: 0.01em; text-wrap: balance;
}
.feature-body p { max-width: 720px; margin: 12px 0 0; color: var(--muted); font-size: 16px; line-height: 1.82; text-wrap: pretty; }

/* ===== Case tabs ===== */
.case-tabs {
  display: flex; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.case-tabs::-webkit-scrollbar { display: none; }
.case-tabs button {
  flex: 1 0 auto; min-height: 52px; border: 0; border-right: 1px solid var(--line);
  padding: 0 30px; color: var(--muted); background: transparent;
  font-family: var(--serif); font-size: 17px; font-weight: 500; letter-spacing: 0.02em;
  white-space: nowrap; transition: color 160ms ease, background 160ms ease;
}
.case-tabs button:last-child { border-right: 0; }
.case-tabs .is-active { color: #fff; background: var(--accent); }

.case-panel[hidden] { display: none; }

.case-row {
  display: grid; grid-template-columns: 190px minmax(0,1fr) 220px; gap: 40px; align-items: center;
  padding: 46px 10px; border-bottom: 1px solid var(--rule);
}
.case-title { color: var(--ink-strong); font-family: var(--serif); font-size: clamp(24px,3vw,32px); font-weight: 500; letter-spacing: 0.02em; }
.case-row p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.82; text-wrap: pretty; }
.case-code { color: var(--subtle); font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-align: right; font-variant-numeric: tabular-nums; }

/* ===== IT grid ===== */
.it-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr));
  border-top: 1px solid var(--rule); border-left: 1px solid var(--line);
}
.it-cell { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 38px 34px; transition: background 160ms ease; }
.it-cell:hover { background: var(--bg-soft); }
.it-tag { color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.it-cell h3 { margin: 14px 0 0; color: var(--ink-strong); font-family: var(--serif); font-size: clamp(22px,2.6vw,28px); font-weight: 500; letter-spacing: 0.01em; line-height: 1.24; text-wrap: balance; }
.it-cell p { margin: 14px 0 0; color: var(--muted); font-size: 15px; line-height: 1.82; text-wrap: pretty; }
.it-mono { display: inline-block; margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; color: var(--subtle); font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }

/* ===== Gallery ===== */
.gallery-stage { position: relative; overflow: hidden; border: 1px solid var(--line-strong); background: var(--bg-soft); }
.gallery-slide { margin: 0; }
.gallery-slide img { width: 100%; height: clamp(360px,46vw,600px); object-fit: cover; object-position: top center; filter: grayscale(0.1); }
.gallery-slide figcaption {
  display: grid; grid-template-columns: auto minmax(0,1fr); gap: 0 24px; align-items: end;
  padding: 20px 26px; background: var(--bg); border-top: 1px solid var(--line);
}
.gallery-count { grid-column: 1; grid-row: 1; color: var(--subtle); font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; font-variant-numeric: tabular-nums; }
.gallery-slide figcaption strong { grid-column: 1; grid-row: 2; margin-top: 4px; color: var(--ink-strong); font-family: var(--serif); font-size: 24px; font-weight: 500; letter-spacing: 0.02em; }
.gallery-slide figcaption p { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; text-wrap: pretty; }

.gallery-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 1px solid var(--line-strong); border-radius: 50%;
  color: var(--ink); background: #fff; font-size: 20px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.gallery-arrow:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.gallery-arrow-prev { left: 16px; }
.gallery-arrow-next { right: 16px; }

.gallery-progress { height: 2px; background: var(--line); }
.gallery-progress span { display: block; height: 100%; width: 0; background: var(--accent); }
.gallery-showcase.is-playing .gallery-progress span { width: 100%; transition: width 5600ms linear; }

.gallery-thumbs { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.gallery-thumb {
  position: relative; overflow: hidden; border: 1px solid var(--line); padding: 0;
  color: var(--ink); background: var(--bg-soft); transition: border-color 160ms ease, transform 160ms ease;
  aspect-ratio: 16 / 9;
}
.gallery-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.35); opacity: 0.6; }
.gallery-thumb span { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px; color: var(--ink); background: rgba(255,255,255,0.92); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.gallery-thumb:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.gallery-thumb.is-active { border-color: var(--accent); }
.gallery-thumb.is-active img { filter: none; opacity: 1; }
.gallery-showcase.is-swapping .gallery-slide img { opacity: 0.3; transition: opacity 120ms ease; }

/* ===== CTA ===== */
.section-cta { padding: 100px 24px; text-align: center; }
.cta-inner { max-width: 760px; margin: 0 auto; border-top: 3px solid var(--accent); border-bottom: 1px solid var(--rule); padding: 64px 20px; }
.section-cta .section-index { display: block; margin-bottom: 24px; }
.cta-inner h2 { margin: 0; color: var(--ink-strong); font-family: var(--serif); font-size: clamp(34px,5vw,56px); line-height: 1.18; font-weight: 500; letter-spacing: 0.01em; text-wrap: balance; }
.cta-link {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 36px;
  border-bottom: 2px solid var(--accent); padding-bottom: 6px;
  color: var(--accent); font-size: 16px; font-weight: 600; letter-spacing: 0.02em;
  transition: gap 160ms ease;
}
.cta-link:hover { gap: 18px; }

/* ===== Footer ===== */
.site-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 30px; padding-bottom: 38px;
  color: var(--muted); font-size: 13px;
}
.site-footer strong { display: block; color: var(--ink-strong); font-family: var(--serif); font-weight: 500; letter-spacing: 0.02em; margin-bottom: 4px; }
.site-footer span { color: var(--subtle); }
.site-footer a { color: var(--accent); font-weight: 500; letter-spacing: 0.02em; }
.site-footer a:hover { text-decoration: underline; }

/* ===== Responsive ===== */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .figures { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .case-row { grid-template-columns: 1fr; gap: 16px; }
  .case-code { text-align: left; }
  .gallery-thumbs { grid-template-columns: repeat(3, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 68px; left: 0; right: 0; display: none;
    flex-direction: column; gap: 0; padding: 10px 20px 18px;
    background: rgba(255,255,255,0.97); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line-strong);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { justify-content: flex-start; min-height: 50px; padding: 0 10px; }
  .it-grid { grid-template-columns: 1fr; }
  .section-head { grid-template-columns: 1fr; gap: 6px; }
}

@media (max-width: 560px) {
  .figures { grid-template-columns: 1fr; }
  .feature-row { grid-template-columns: 1fr; gap: 10px; }
  .gallery-thumbs { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .gallery-slide figcaption { grid-template-columns: 1fr; gap: 4px; }
  .gallery-slide figcaption p { grid-column: 1; grid-row: auto; }
}
