/* Rustorage 官网的全部样式。
 *
 * 硬约束（改了会破）：没有内联 style=，没有 <style> 块，没有外部字体，
 * 没有一个位图。所有图形都是这里的 CSS 盒子 + 内联 SVG 画的。
 * 令牌集中在下面这一段，改色改字号只应该动它。
 */

:root {
  /* 色板 —— 亮色文档风（规格 §4） */
  --bg: #ffffff;
  --bg-soft: #f8f9fb;
  --text: #1a1a1a;
  --text-dim: #5c6370;
  --line: #e6e8ec;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --ok: #15803d;
  --ok-soft: #eaf6ee;
  --warn: #b45309;
  --warn-soft: #fdf1e3;

  /* 字号刻度：13 / 15 / 17 / 22 / 32 / 48，不散落魔法数字 */
  --fs-xs: 13px;
  --fs-sm: 15px;
  --fs-md: 17px;
  --fs-lg: 22px;
  --fs-xl: 32px;
  --fs-2xl: 48px;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas,
    "Liberation Mono", Menlo, monospace;

  --radius: 12px;
  --wrap: 1080px;
}

/* ── 基础 ──────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.25; }
p { margin: 0; }
img { display: block; max-width: 100%; }
pre { margin: 0; }
table { border-collapse: collapse; }

a { color: var(--accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-sm);
  border-radius: 0 0 8px 0;
  text-decoration: none;
}
.skip:focus { left: 0; }

/* ── 顶栏 ──────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 58px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.nav a:hover { color: var(--accent); }

.nav-toggle {
  display: none;
  margin-left: auto;
  padding: 6px;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; display: block; }

.lang {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  flex: none;
}

.lang-btn {
  padding: 5px 10px;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--line); }
.lang-btn:hover { color: var(--accent); }
.lang-btn.is-on {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* ── 首屏 ──────────────────────────────────────────────────── */

.hero {
  padding: 88px 0 76px;
  border-bottom: 1px solid var(--line);
}

.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.hero h1 {
  margin-top: 22px;
  font-size: clamp(38px, 7vw, 60px);
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.tagline {
  margin-top: 14px;
  font-size: clamp(19px, 3vw, 26px);
  font-weight: 500;
  letter-spacing: -0.015em;
  max-width: 720px;
}

.hero-sub {
  margin-top: 18px;
  max-width: 620px;
  font-size: var(--fs-md);
  line-height: 1.75;
  color: var(--text-dim);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 44px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat { background: var(--bg); padding: 22px 20px 20px; }

.stat-v {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.stat-x { font-size: var(--fs-lg); margin-left: 1px; }

.stat-l {
  margin-top: 6px;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--text-dim);
}

.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.btn {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { color: #fff; opacity: 0.92; }

/* ── 区块 ──────────────────────────────────────────────────── */

.section {
  padding: 88px 0;
  border-bottom: 1px solid var(--line);
}
.section:last-of-type { border-bottom: 0; }
.section.soft { background: var(--bg-soft); }

.section h2 {
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.025em;
}

.lead {
  margin-top: 16px;
  max-width: 740px;
  font-size: var(--fs-md);
  line-height: 1.75;
  color: var(--text-dim);
}

/* ── 能力格 ────────────────────────────────────────────────── */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(262px, 100%), 1fr));
  gap: 16px;
  margin-top: 40px;
}

.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  border-color: #d6dae2;
  box-shadow: 0 6px 20px rgba(20, 30, 60, 0.05);
}
.card h3 { margin-top: 14px; font-size: var(--fs-md); }
.card p { margin-top: 8px; font-size: var(--fs-sm); line-height: 1.65; color: var(--text-dim); }

.ico { width: 22px; height: 22px; color: var(--accent); }

/* ── 三个设计取舍 ──────────────────────────────────────────── */

.decisions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr));
  gap: 18px;
  margin-top: 40px;
}

.decision {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.dnum {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.12em;
  color: var(--accent);
}

.decision h3 { margin-top: 10px; font-size: 19px; }
.decision p { margin-top: 10px; font-size: var(--fs-sm); line-height: 1.72; color: var(--text-dim); }

/* `margin-top: auto` 把这块顶到卡片底部：三张卡的「代价」文字于是对齐 */
.detail {
  margin: auto 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
}

.detail.mono {
  margin-top: auto;
  padding: 14px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  line-height: 1.8;
  white-space: pre;
  overflow-x: auto;
}

.detail.warnbox {
  margin-top: auto;
  padding: 0 0 0 14px;
  border-top: 0;
  border-left: 3px solid var(--warn);
}

/* ── 图解 ──────────────────────────────────────────────────── */

.fig {
  margin: 40px 0 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.fig figcaption h3 { font-size: var(--fs-md); }
.fig figcaption p {
  margin-top: 8px;
  max-width: 720px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
}

.chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 14px;
}

.node {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-soft);
  font-weight: 500;
}
.node.mono { font-family: var(--mono); font-size: var(--fs-xs); font-weight: 400; }

.arw { color: var(--text-dim); font-size: var(--fs-xs); }

.files { display: flex; flex-wrap: wrap; gap: 8px; }

.file {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
}
.file.meta {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.file.dim { border-style: dashed; color: var(--text-dim); }

.steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  font-size: var(--fs-xs);
}

.step {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  white-space: nowrap;
}
.step.mono { font-family: var(--mono); font-size: 12px; }

.matrix { display: grid; gap: 10px; margin-bottom: 22px; }

.mrow {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  gap: 16px;
}

.rlabel { font-size: var(--fs-xs); color: var(--text-dim); }

.disks { display: flex; gap: 8px; flex-wrap: wrap; }

.d {
  width: 40px;
  height: 26px;
  border: 1.5px solid var(--accent);
  border-radius: 5px;
  background: var(--accent-soft);
}
.d.dead {
  position: relative;
  border: 1.5px dashed var(--line);
  background: var(--bg-soft);
}
.d.dead::after {
  content: "✕";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--text-dim);
}

.verdict {
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}
.verdict.ok { background: var(--ok-soft); color: var(--ok); }
.verdict.bad { background: var(--warn-soft); color: var(--warn); }

/* 注意：这一族类名以 `rbar-` 开头。顶栏那一行用的是 `.bar`，
   两边不要互相蹭——这里曾经叫 `.bar`，把顶栏的 flex 布局覆盖掉了。 */
.bars { display: grid; gap: 12px; margin-bottom: 22px; }

.rbar-row {
  display: grid;
  grid-template-columns: 210px 1fr auto;
  align-items: center;
  gap: 16px;
}

.rbar-label { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }

.rbar-track {
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-soft);
  overflow: hidden;
}

.rbar { display: block; height: 100%; }
.rbar-old { width: 100%; background: #c9d3e6; }
/* 按真实比例：1.573056 / 100.676742 ≈ 1.563%。留 5px 最小宽度只为看得见。 */
.rbar-new { width: 1.563%; min-width: 5px; background: var(--accent); }

.rbar-val {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fig-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ── 性能表 ────────────────────────────────────────────────── */

.table-wrap {
  margin-top: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  overflow-x: auto;
}

.bench { width: 100%; font-size: 14px; }

.bench th {
  padding: 12px 18px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.bench td {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.bench tbody tr:last-child td { border-bottom: 0; }

.bench td.val {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}
.bench td.dim { font-size: var(--fs-xs); color: var(--text-dim); }

.callout {
  margin-top: 20px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: 10px;
  background: var(--bg);
}
.callout.plain { border-left-color: var(--accent); }
.callout h3 { font-size: 16px; }
.callout p {
  margin-top: 8px;
  font-size: var(--fs-sm);
  line-height: 1.72;
  color: var(--text-dim);
}

/* ── 边界与路线图 ──────────────────────────────────────────── */

.scopelist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 14px 30px;
  margin: 38px 0 0;
  padding: 0;
  list-style: none;
}

.scopelist li {
  position: relative;
  padding-left: 26px;
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--text-dim);
}
.scopelist li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 8px;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--text-dim);
  border-radius: 2px;
}

.roadmaplist {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: rm;
}

.roadmaplist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 14px;
  counter-increment: rm;
}
.roadmaplist li::before {
  content: counter(rm, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
}

/* ── 页脚 ──────────────────────────────────────────────────── */

.footer {
  padding: 34px 0 52px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.foot-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--text-dim);
}
.foot-note .sep { color: var(--line); }

.foot-links { display: flex; flex-wrap: wrap; gap: 20px; font-size: var(--fs-xs); }
.foot-links a { color: var(--text-dim); text-decoration: none; }
.foot-links a:hover { color: var(--accent); }

/* ── 进场动效 ──────────────────────────────────────────────
   初始隐藏态挂在 `html.js` 下：脚本没跑起来时（file:// 下被拦、JS 关掉），
   `[data-reveal]` 就是普通可见元素，绝不会留下一张白页。 */

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s cubic-bezier(0.2, 0.7, 0.3, 1),
              transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}
html.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── 响应式 ────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .wrap { padding: 0 18px; }

  .nav-toggle { display: block; }

  /* 折叠后的导航变成顶栏下面的一块面板 */
  .nav {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 4px 18px 10px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: 0 12px 24px rgba(20, 30, 60, 0.07);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 12px 0; font-size: var(--fs-sm); border-bottom: 1px solid var(--line); }
  .nav a:last-child { border-bottom: 0; }

  .lang { margin-left: 8px; }

  .hero { padding: 62px 0 56px; }
  .section { padding: 62px 0; }

  .stats { grid-template-columns: 1fr; margin-top: 36px; }

  .fig { padding: 20px; }

  .mrow { grid-template-columns: 88px 1fr auto; gap: 10px; }
  .d { width: 30px; height: 22px; }

  .rbar-row { grid-template-columns: 1fr auto; gap: 6px 12px; }
  .rbar-label { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 34px; }
  .tagline { font-size: 18px; }
  .stat-v { font-size: 26px; }
  .stat-x { font-size: 18px; }

  .chain, .steps { font-size: 12px; }
  .file { font-size: 11px; }
  .d { width: 24px; height: 18px; }
  .mrow { grid-template-columns: 1fr auto; }
  .rlabel { grid-column: 1 / -1; }

  /* 表格改成横向滚动，不挤成三行字 */
  .bench { min-width: 560px; }
}
