/* ==========================================================================
   Codex 工具箱

   Design read: a maker's software catalog read by people who want a tool and
   nothing else. Calm editorial light page, hairline structure, one accent.
   Dials: DESIGN_VARIANCE 7 / MOTION_INTENSITY 4 / VISUAL_DENSITY 3.

   Rules this file holds to:
   - Page Theme Lock: one theme for the whole page. Sections never invert.
     Dark mode swaps the tokens for the entire page at once.
   - Color Consistency Lock: one accent, saturation 70%, used identically in
     every section. `--accent` is the fill, `--accent-ink` is the readable
     accent for text and icons on the page background.
   - Shape Consistency Lock: one radius, 10px, on every surface and control.
     No pills.
   - No outer glows, no neon, no pure #000, no pure #fff.
   ========================================================================== */

@font-face {
  font-family: "Geist Variable";
  src: url("/static/fonts/GeistVariable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --bg: #f6f6f7;
  --surface: #fcfcfd;
  --surface-2: #f1f1f3;
  --ink: #18181b;
  --ink-2: #52525b;
  --ink-3: #6b6b74;
  --line: rgba(24, 24, 27, 0.1);
  --line-2: rgba(24, 24, 27, 0.18);

  --accent: #b8521f;
  --accent-hover: #a64818;
  --accent-ink: #a8491a;
  --accent-wash: rgba(192, 86, 33, 0.08);
  --on-accent: #fdfdfc;

  --ok-ink: #1f6b45;
  --ok-wash: rgba(31, 107, 69, 0.1);
  --danger: #b42318;
  --danger-wash: rgba(180, 35, 24, 0.08);

  --shadow-raise: 0 1px 2px rgba(24, 24, 27, 0.04), 0 12px 32px -24px rgba(24, 24, 27, 0.5);
  --radius: 10px;

  --font-sans: "Geist Variable", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
    "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;

  --shell: 1180px;
  --section-y: clamp(72px, 9vw, 120px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18181b;
    --surface: #212124;
    --surface-2: #27272b;
    --ink: #f4f4f5;
    --ink-2: #b4b4bd;
    --ink-3: #8b8b95;
    --line: rgba(244, 244, 245, 0.12);
    --line-2: rgba(244, 244, 245, 0.22);

    --accent: #b8521f;
    --accent-hover: #a64818;
    --accent-ink: #e8a184;
    --accent-wash: rgba(232, 161, 132, 0.12);

    --ok-ink: #6ee7b7;
    --ok-wash: rgba(110, 231, 183, 0.12);
    --danger: #fca5a5;
    --danger-wash: rgba(252, 165, 165, 0.12);

    --shadow-raise: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -28px rgba(0, 0, 0, 0.9);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.18; letter-spacing: -0.022em; font-weight: 620; }
p { margin: 0; }
::selection { background: var(--accent-wash); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 28px; }
.shell-text { max-width: 68ch; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.num { font-variant-numeric: tabular-nums; }
.icon { width: 1em; height: 1em; flex: 0 0 auto; display: block; }

/* ------------------------------------------------------------------- 顶栏 */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.topbar.is-scrolled { border-bottom-color: var(--line); background: var(--bg); }
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 28px; height: 28px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  display: grid; place-items: center;
  flex: 0 0 auto;
}
.brand-mark .icon { width: 17px; height: 17px; }
.brand-name { font-size: 15.5px; font-weight: 620; letter-spacing: -0.01em; white-space: nowrap; }

.topnav { display: flex; align-items: center; gap: 26px; }
.topnav a { font-size: 14.5px; color: var(--ink-2); }
.topnav a:hover { color: var(--ink); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none;
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  position: relative;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: ""; position: absolute; left: 50%; width: 15px; height: 1.5px;
  background: var(--ink); border-radius: 2px; transform: translateX(-50%);
}
.nav-toggle span { top: 17px; }
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }

/* ------------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 560;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease,
    transform 0.12s ease;
}
.btn .icon { width: 17px; height: 17px; }
.btn-lg { padding: 13px 22px; font-size: 15.5px; }
.btn-sm { padding: 6px 12px; font-size: 13.5px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--ink);
}
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-secondary:active { transform: translateY(1px); }

.btn-quiet { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-quiet:hover { border-color: var(--line-2); color: var(--ink); }

.btn-danger { background: transparent; border-color: var(--line); color: var(--danger); }
.btn-danger:hover { border-color: currentColor; background: var(--danger-wash); }

.btn-icon {
  padding: 5px 8px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
}
.btn-icon:hover { border-color: var(--line-2); color: var(--ink); }

/* ------------------------------------------------------------------- 版式 */

.section { padding: var(--section-y) 0; }
.section-tint { background: var(--surface-2); }

.section-title { max-width: 30ch; font-size: clamp(24px, 3vw, 34px); font-weight: 640; }
.section-note { margin-top: 14px; max-width: 56ch; color: var(--ink-2); font-size: 16px; }
.section-head { margin-bottom: 46px; }

.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

/* -------------------------------------------------------------------- hero */

.hero { padding: 82px 0 var(--section-y); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 6.5fr) minmax(0, 5.5fr);
  gap: 56px;
  align-items: center;
}
/* 没配首屏主图时首屏变成单栏宣言版式：正文收到好读的行长，不拉满整屏 */
.hero-grid--solo { grid-template-columns: minmax(0, 1fr); }
.hero-grid--solo > div { max-width: 46rem; }
.hero-title {
  font-size: clamp(32px, 4.2vw, 52px);
  font-weight: 660;
  letter-spacing: -0.035em;
  line-height: 1.12;
}
.hero-sub { margin-top: 20px; max-width: 34ch; color: var(--ink-2); font-size: 17px; }
.hero-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }

.hero-media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-raise); }
.hero-media img { width: 100%; }
.hero-media-empty {
  padding: 46px 28px;
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}

/* ------------------------------------------------- 单屏首页：卡片墙 */

/* -------------------------------------------------------------- 状态条 */

.metric-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.metric-grid[data-count="1"] { grid-template-columns: 1fr; }
.metric-grid[data-count="2"] { grid-template-columns: repeat(2, 1fr); }
.metric-grid[data-count="3"] { grid-template-columns: repeat(3, 1fr); }
.metric { padding: 26px 20px; text-align: center; border-right: 1px solid var(--line); }
.metric:last-child { border-right: none; }
.metric-value { font-size: 26px; font-weight: 640; letter-spacing: -0.03em; }
.metric-value .unit {
  margin-left: 3px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0;
}
.metric-label { margin-top: 5px; font-size: 13.5px; color: var(--ink-2); }

/* ---------------------------------------------------------- 工具索引列表 */

.tool-list { border-top: 1px solid var(--line); }
.tool-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1.35fr) minmax(0, 1.5fr) auto;
  gap: 22px;
  align-items: center;
  padding: 26px 0;
  border-bottom: 1px solid var(--line);
}
.tool-row--lead { grid-template-columns: 44px minmax(0, 1fr) auto; padding: 32px 0; }
.tool-row--lead .tool-blurb { grid-column: 2 / 3; }

/* 主打工具的产品图：截图留在软件自己的位置上，而不是占着首屏。
   窄屏不渲染（详情页「界面一览」里有完整的大图）。 */
.tool-row--lead.tool-row--shot {
  grid-template-columns: 44px minmax(0, 1fr) minmax(0, 300px) auto;
  grid-template-areas:
    "icon head  shot actions"
    "icon blurb shot facts";
}
.tool-row--lead.tool-row--shot .tool-icon { grid-area: icon; }
.tool-row--lead.tool-row--shot .tool-head { grid-area: head; }
.tool-row--lead.tool-row--shot .tool-blurb { grid-area: blurb; }
.tool-row--lead.tool-row--shot .tool-facts { grid-area: facts; justify-content: flex-end; }
.tool-row--lead.tool-row--shot .tool-actions { grid-area: actions; justify-content: flex-end; }
.tool-row--lead.tool-row--shot .tool-shot { grid-area: shot; }
.tool-shot {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-raise);
}
.tool-shot img { display: block; width: 100%; max-height: 200px; object-fit: contain; }
.tool-row:hover .tool-name a { color: var(--accent-ink); }
.tool-row--teaser .tool-icon { background: var(--surface-2); color: var(--ink-3); }

.tool-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  flex: 0 0 auto;
}
.tool-icon img { width: 100%; height: 100%; object-fit: cover; }
.tool-icon--letter { background: var(--ink); color: var(--bg); border-color: transparent; font-size: 17px; font-weight: 620; }
.tool-row--teaser .tool-icon--letter { background: var(--surface-2); color: var(--ink-3); border-color: var(--line); }

.tool-name { font-size: 17px; font-weight: 600; }
.tool-tagline { margin-top: 3px; font-size: 13.5px; color: var(--ink-3); }
.tool-blurb { font-size: 14.5px; color: var(--ink-2); }
.tool-facts { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-3); }
.tool-actions { display: flex; align-items: center; gap: 8px; }

.status-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-2);
}
.status-tag .icon { width: 13px; height: 13px; }

/* ------------------------------------------------------------ 两栏说明表 */

.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 56px;
  border-top: 1px solid var(--line);
}
.spec {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.spec .icon { width: 20px; height: 20px; color: var(--accent-ink); margin-top: 3px; }
.spec h3 { font-size: 15.5px; font-weight: 600; }
.spec p { margin-top: 6px; font-size: 14.5px; color: var(--ink-2); max-width: 46ch; }

/* ---------------------------------------------------------------- 场景 */

.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.flow-item { padding: 0 26px; border-left: 1px solid var(--line); }
.flow-item:first-child { padding-left: 0; border-left: none; }
.flow-item:last-child { padding-right: 0; }
.flow-item h3 { font-size: 16px; font-weight: 600; }
.flow-item p { margin-top: 10px; font-size: 14.5px; color: var(--ink-2); }

/* ------------------------------------------------------------------ FAQ */

.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  font-size: 15.5px;
  font-weight: 560;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "";
  width: 9px; height: 9px; flex: 0 0 auto;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-top: -4px;
}
.faq-item[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.faq-body { padding: 0 40px 22px 0; max-width: 68ch; color: var(--ink-2); font-size: 15px; }

/* ---------------------------------------------------------------- 画廊 */

.shot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.shot { margin: 0; }
.shot img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
.shot figcaption { margin-top: 9px; font-size: 13px; color: var(--ink-3); }

/* -------------------------------------------------------------- 更新日志 */

.log-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.log-entry { padding: 22px 0; border-bottom: 1px solid var(--line); }
.log-head { display: flex; align-items: baseline; gap: 12px; }
.log-version { font-size: 15.5px; font-weight: 600; }
.log-date { font-size: 13px; color: var(--ink-3); }
.log-body { margin-top: 8px; max-width: 68ch; font-size: 14.5px; color: var(--ink-2); }

/* ------------------------------------------------------------ 下载 / CTA */

.cta-band { background: var(--surface-2); border-top: 1px solid var(--line); }
.cta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 56px;
  align-items: center;
}
.cta-title { font-size: clamp(24px, 3vw, 34px); font-weight: 640; }
.cta-body { margin-top: 14px; max-width: 40ch; color: var(--ink-2); font-size: 16px; }
.cta-actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }

.fact-list { border-top: 1px solid var(--line-2); }
.fact {
  display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 14.5px;
}
.fact > span { color: var(--ink-3); flex: 0 0 auto; }
.fact strong { font-weight: 560; text-align: right; }
.fact code { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); word-break: break-all; text-align: right; }

/* ---------------------------------------------------------------- 页脚 */

.site-footer { border-top: 1px solid var(--line); padding: 56px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand p { margin-top: 14px; max-width: 34ch; font-size: 14px; color: var(--ink-3); }
.footer-col h4 { margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.footer-col ul { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 9px; }
.footer-col a { font-size: 14.5px; color: var(--ink-2); }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: 13px; color: var(--ink-3);
}

/* -------------------------------------------------------------- 空状态 */

.empty-state {
  padding: 60px 0;
  text-align: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.empty-state h3 { font-size: 17px; font-weight: 600; }
.empty-state p { margin-top: 10px; color: var(--ink-2); }
.empty-state .btn { margin-top: 22px; }

/* ---------------------------------------------------------------- 登录页 */

.auth-shell { min-height: 100dvh; display: grid; place-items: center; padding: 56px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 22px; font-weight: 640; }
.auth-sub { margin-top: 8px; font-size: 14.5px; color: var(--ink-2); }
.stack { margin-top: 26px; display: grid; gap: 16px; }
.error-code { font-size: 40px; font-weight: 680; letter-spacing: -0.04em; color: var(--accent-ink); }
.auth-card .btn { margin-top: 24px; }
.auth-card code {
  font-family: var(--font-mono); font-size: 12.5px;
  padding: 2px 6px; border-radius: 6px;
  background: var(--surface-2); color: var(--ink);
}

/* ------------------------------------------------------------------ 后台 */
/* 后台不是 landing page，本文件只复用同一套 token，不套用前台的版式规则。 */

.admin-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100dvh; }
.admin-sidebar {
  display: flex; flex-direction: column; gap: 3px;
  padding: 20px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  position: sticky; top: 0; height: 100dvh;
}
.admin-sidebar .brand { padding: 2px 8px 20px; }
.side-label {
  padding: 14px 8px 6px;
  font-size: 12px; font-weight: 560; color: var(--ink-3);
}
.side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: none;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s ease, color 0.15s ease;
}
.side-link .icon { width: 17px; height: 17px; }
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link.is-active { background: var(--accent-wash); color: var(--ink); font-weight: 560; }
.admin-sidebar-foot { margin-top: auto; display: grid; gap: 3px; padding-top: 16px; border-top: 1px solid var(--line); }

.admin-main { padding: 34px 36px 72px; min-width: 0; }
.admin-title-row {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  margin-bottom: 26px;
}
.admin-title-row h1 { font-size: 24px; font-weight: 660; }
.admin-sub { margin-top: 6px; font-size: 14px; color: var(--ink-3); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border-top: 1px solid var(--line); margin-bottom: 34px; }
.kpi { padding: 20px; text-align: center; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: none; }
.kpi-label { font-size: 13px; color: var(--ink-3); }
.kpi-value { margin-top: 8px; font-size: 26px; font-weight: 640; letter-spacing: -0.03em; }
.kpi-foot { margin-top: 5px; font-size: 12.5px; color: var(--ink-3); }

.panel { border-top: 1px solid var(--line); }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0;
}
.panel-head h2 { font-size: 15.5px; font-weight: 620; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 14px 18px 14px 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
  vertical-align: middle;
}
.admin-table th { font-size: 12.5px; font-weight: 560; color: var(--ink-3); }
.admin-table tbody tr:last-child td { border-bottom: none; }
.cell-tool { display: flex; flex-direction: column; gap: 2px; }
.cell-tool .path { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); }
.th-actions { width: 44%; }
.cell-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.inline-form { display: inline; margin: 0; }

.badge { display: inline-block; padding: 3px 9px; border-radius: var(--radius); font-size: 12.5px; border: 1px solid var(--line); }
.badge-live { background: var(--ok-wash); color: var(--ok-ink); border-color: transparent; }
.badge-teaser { background: var(--accent-wash); color: var(--accent-ink); border-color: transparent; }
.badge-draft { background: var(--surface-2); color: var(--ink-2); }

.notice { padding: 13px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14.5px; }
.notice-ok { background: var(--ok-wash); color: var(--ok-ink); }
.notice-error { background: var(--danger-wash); color: var(--danger); }

.admin-form { display: grid; gap: 28px; }
.form-card { border-top: 1px solid var(--line); padding-top: 22px; }
.form-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.form-card-head .idx {
  min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink-3);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600;
}
.form-card-head h2 { font-size: 15px; font-weight: 620; }
.legend-hint { margin: 0 0 12px; font-size: 12.5px; line-height: 1.75; color: var(--ink-3); font-family: var(--font-mono); }

.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 13px; font-weight: 560; color: var(--ink-2); }
.field-wide { grid-column: 1 / -1; }
.field-hint { font-size: 12.5px; line-height: 1.5; color: var(--ink-3); }

.field input, .field textarea, .form-card textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
}
.form-card textarea { font-family: var(--font-mono); font-size: 13px; line-height: 1.75; resize: vertical; }
.field input::placeholder, .form-card textarea::placeholder { color: var(--ink-3); }
.field input:focus, .field textarea:focus, .form-card textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.form-actions {
  position: sticky; bottom: 16px;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-raise);
}
.form-actions .spacer { margin-left: auto; font-size: 13px; color: var(--ink-3); }

/* ------------------------------------------------------------ 上传与版本 */

.drop-grid { display: grid; gap: 16px; }
.drop {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.drop:hover { border-color: var(--accent); }
.drop.is-over { border-color: var(--accent); background: var(--accent-wash); }
.drop.is-busy { cursor: progress; }
.drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-icon { display: grid; place-items: center; color: var(--accent-ink); }
.drop-icon .icon { width: 22px; height: 22px; }
.drop-text { display: grid; gap: 3px; min-width: 0; }
.drop-text strong { font-size: 14.5px; font-weight: 600; }
.drop-text small { font-size: 12.5px; color: var(--ink-3); }
.drop-progress { display: flex; align-items: center; gap: 10px; margin-left: auto; }
/* 类选择器和 UA 的 [hidden] 同权重，不显式写一遍就藏不住这条进度条。 */
.drop-progress[hidden] { display: none; }
.drop-track {
  display: block;
  width: 140px;
  height: 6px;
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}
.drop-bar { display: block; width: 0; height: 100%; background: var(--accent); transition: width 0.12s linear; }
.drop-percent { font-size: 12.5px; color: var(--ink-2); min-width: 38px; text-align: right; }
.drop-status { margin-top: 8px; font-size: 12.5px; line-height: 1.7; color: var(--ink-3); }
.drop-status.is-ok { color: var(--ok-ink); }
.drop-status.is-error { color: var(--danger); }

.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.check input { width: auto; }

.release-panel { margin-top: 22px; border-top: 1px solid var(--line); }
.release-panel-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 16px 0 10px;
}
.release-panel-head h3 { font-size: 14.5px; font-weight: 620; }
.release-empty { padding: 18px 0; font-size: 13.5px; color: var(--ink-3); }
.release-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.release-row.is-current .release-head strong { color: var(--accent-ink); }
.release-main { display: grid; gap: 5px; min-width: 0; }
.release-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.release-head strong { font-size: 15px; font-weight: 620; }
.release-meta { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.release-files { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.release-file {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere;
}
.release-file em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.release-file code { font-family: var(--font-mono); font-size: 12px; }
.release-hash { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); }
.release-notes { font-size: 13px; line-height: 1.75; color: var(--ink-2); max-width: 62ch; }
.release-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.release-tag { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* 输入框与预览里那块内容的互相定位：哪边被指到，两边同时亮。 */
.field.is-linked > span { color: var(--accent-ink); }
.field.is-linked input,
.field.is-linked textarea,
.form-card.is-linked textarea {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.form-card.is-linked { border-top-color: var(--accent); }
.form-card.is-linked .form-card-head h2 { color: var(--accent-ink); }

/* ------------------------------------------------------------ 编辑页预览 */

.edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 460px);
  gap: 28px;
  align-items: start;
}
.preview-pane { position: sticky; top: 18px; display: grid; gap: 10px; }
.preview-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.preview-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 560; color: var(--ink-2);
}
.preview-label .icon { width: 15px; height: 15px; }
.preview-switch { display: flex; margin-left: auto; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.preview-tab, .preview-device {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink-2);
  padding: 5px 10px;
  cursor: pointer;
}
.preview-tab + .preview-tab { border-left: 1px solid var(--line); }
.preview-tab.is-active { background: var(--accent-wash); color: var(--accent-ink); font-weight: 560; }
.preview-device { border: 1px solid var(--line); border-radius: var(--radius); padding: 5px 10px; }
.preview-device:hover { border-color: var(--line-2); color: var(--ink); }

.preview-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  justify-content: center;
  padding: 10px;
}
.preview-frame iframe {
  width: 100%;
  height: 620px;
  border: 0;
  border-radius: var(--radius);
  background: var(--bg);
  display: block;
  transition: width 0.2s ease;
}
.preview-frame[data-device="mobile"] iframe { width: 390px; }
.preview-note { font-size: 12.5px; color: var(--ink-3); }
.preview-target { line-height: 1.7; }
.preview-target.is-active { color: var(--accent-ink); font-weight: 560; }
html.js .preview-pane.is-stale .preview-note { color: var(--accent-ink); }

/* ------------------------------------------------------------------ 动效 */

.reveal { opacity: 1; transform: none; }
html.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------------------------------------------------------- 响应式 */

@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .cta-grid { grid-template-columns: 1fr; gap: 36px; }
  .spec-grid { column-gap: 40px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .shot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .topnav {
    position: absolute;
    left: 0; right: 0; top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 28px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .topnav.is-open { display: flex; }
  .topnav a { padding: 11px 0; font-size: 16px; }
  .nav-toggle { display: block; }
  .topbar-actions .btn-primary { display: none; }

  .metric-grid, .metric-grid[data-count="3"] { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2n) { border-right: none; }
  .metric:nth-child(-n + 2) { border-bottom: 1px solid var(--line); padding-bottom: 22px; }
  .metric:nth-child(n + 3) { padding-top: 22px; }

  .tool-row, .tool-row--lead { grid-template-columns: 44px 1fr; gap: 16px; padding: 22px 0; }
  .tool-row .tool-blurb { grid-column: 2 / 3; }
  .tool-row .tool-facts { grid-column: 2 / 3; }
  .tool-row .tool-actions { grid-column: 2 / 3; justify-content: flex-start; }
  /* 窄屏把主打行的产品图收掉，回到「图标 + 文字」的紧凑行 */
  .tool-row--lead.tool-row--shot { grid-template-columns: 44px 1fr; grid-template-areas: none; }
  .tool-row--lead.tool-row--shot .tool-icon,
  .tool-row--lead.tool-row--shot .tool-head { grid-area: auto; }
  /* grid-area 会把 grid-column 一起重置，所以这里必须重新指明列 */
  .tool-row--lead.tool-row--shot .tool-blurb,
  .tool-row--lead.tool-row--shot .tool-facts,
  .tool-row--lead.tool-row--shot .tool-actions {
    grid-area: auto;
    grid-column: 2 / 3;
  }
  .tool-row--lead.tool-row--shot .tool-actions { justify-content: flex-start; }
  .tool-shot { display: none; }
  .spec-grid { grid-template-columns: 1fr; }
  .flow { grid-template-columns: 1fr; }
  .flow-item { padding: 22px 0; border-left: none; border-top: 1px solid var(--line); }
  .flow-item:first-child { border-top: none; padding-top: 0; }

  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 6px; padding: 12px 16px;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .admin-sidebar .brand { padding: 0 10px 0 0; }
  .side-label { display: none; }
  .side-link { width: auto; }
  .admin-sidebar-foot { margin-top: 0; padding-top: 0; border-top: none; display: flex; gap: 4px; margin-left: auto; }
  .admin-main { padding: 24px 20px 64px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .edit-layout { grid-template-columns: 1fr; }
  .preview-pane { position: static; }
  .preview-frame iframe { height: 520px; }
}

@media (max-width: 640px) {
  .shell { padding: 0 20px; }
  .hero { padding-top: 56px; }
  .metric-grid, .metric-grid[data-count] { grid-template-columns: 1fr; }
  .metric { border-right: none; border-bottom: 1px solid var(--line); padding: 20px 0; }
  .metric:last-child { border-bottom: none; }
  .shot-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-brand { grid-column: 1 / -1; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
  .admin-title-row { flex-direction: column; align-items: stretch; }
  .kpi-grid { grid-template-columns: 1fr; }
  .form-actions { position: static; }
}
