/* ==========================================================
   数字后端 PD 工作流 · 可视化教程
   深色 EDA 版图风格 —— 配色与层级关系贴近真实版图查看器
   ========================================================== */

:root {
  --bg:        #070b11;
  --panel:     #0f1620;
  --panel-2:   #121b26;
  --panel-3:   #16202d;
  --border:    #1d2937;
  --border-2:  #27394f;
  --text:      #d8e3ef;
  --dim:       #8296aa;
  --dim-2:     #7f91a5;
  --accent:    #ffd166;
  --accent-2:  #38d9d9;
  --ok:        #4ade80;
  --warn:      #ffa94d;
  --danger:    #ff6b6b;
  --purple:    #a78bfa;

  --sans: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(34, 211, 238, .09) 0%, transparent 32%),
    radial-gradient(circle at 88% 12%, rgba(167, 139, 250, .07) 0%, transparent 30%),
    radial-gradient(circle at 50% 95%, rgba(255, 209, 102, .05) 0%, transparent 28%),
    linear-gradient(rgba(120, 140, 170, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 140, 170, .03) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 44px 44px, 44px 44px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 12px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  max-width: calc(1680px - 48px);
  margin: 12px auto 20px;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  background: rgba(7, 11, 17, .78);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35), inset 0 1px 1px rgba(255, 255, 255, .06);
}
.site-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0.3px;
  background: linear-gradient(96deg, #ffffff 10%, var(--accent) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tagline { margin: 4px 0 0; color: var(--dim); font-size: 13px; }
.header-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip {
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: var(--dim);
  font-size: 12px;
  font-family: var(--mono);
  white-space: nowrap;
  transition: background .16s, border-color .16s, color .16s;
}
.chip-btn { cursor: pointer; }
.chip-btn:hover { background: rgba(255, 255, 255, .10); border-color: rgba(255, 255, 255, .18); color: var(--text); }

/* ---------------- 步骤条 ----------------
   15 步固定排成两行：第一行 8 个、第二行 7 个。
   第二行只有 7 个但列数仍是 8 —— 多出来的那列用「半个 gap」补齐：
   gap = 14px 时，右移 7px 恰好让 7 个方块与第一行的列边界完全对齐，
   整体左右边界也与上下其它面板一致。 */
.stepbar {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 14px;
  /* 左右各 17px = 24 - 7：让方块外边界与上下其它面板（padding 24px）对齐 */
  max-width: calc(1680px - 48px);
  margin: 0 auto 18px;
  padding: 0 17px;
}
/* 第二行（第 9~15 步）从第 1 列开始，占 7 列，并在右侧留出 1 列空位 */
.step-item:nth-child(n + 9) { grid-row: 2; grid-column: calc(var(--i) - 8); }
.step-item:nth-child(9)  { --i: 9; }
.step-item:nth-child(10) { --i: 10; }
.step-item:nth-child(11) { --i: 11; }
.step-item:nth-child(12) { --i: 12; }
.step-item:nth-child(13) { --i: 13; }
.step-item:nth-child(14) { --i: 14; }
.step-item:nth-child(15) { --i: 15; }

.step-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;                 /* 关键：允许 grid item 被压缩到 0 */
  width: 100%;
  box-sizing: border-box;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 11px;
  /* 极淡的顶光渐变：比纯 flat 更像"卡片"，也不会抢走 active 的视觉权重 */
  background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .025));
  color: #93a6ba;               /* 原 var(--dim) 在深底上偏灰，提一档对比度 */
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: background .18s cubic-bezier(.32,.72,0,1), border-color .18s, color .18s, transform .18s, box-shadow .18s;
  overflow: hidden;
}
.step-item:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .05));
  border-color: rgba(255, 255, 255, .18);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
/* 行导轨：在每个 chip 后面拉一条横线，把一行步骤串成"一条流水线"。
   之前试过用 ::after 在两块之间画 › 箭头，但方块本身要 overflow:hidden
   （防止内容溢出圆角），14px 的间隙里塞不下任何东西，箭头直接被裁掉。
   改用绝对定位的细线：left/right -10px 让它跨过间隙、首尾也各露 10px，
   第 8 / 15 个方块不画，避免导轨延伸到空白列。 */
.step-item:not(:nth-child(8)):not(:nth-child(15))::after {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, .07);
  pointer-events: none;
  z-index: -1;
}
.step-item .step-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  font-size: 10.5px;
  line-height: 1;
  opacity: .9;
}
.step-item .step-name {
  flex: 1 1 auto;               /* 占据剩余空间，避免被过度压缩 */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.step-item.done { color: var(--dim); border-color: rgba(74, 222, 128, .30); }
.step-item.done .step-idx { background: rgba(74, 222, 128, .14); color: var(--ok); }
.step-item.active {
  background: linear-gradient(180deg, rgba(255, 209, 102, .18), rgba(255, 209, 102, .06));
  border-color: rgba(255, 209, 102, .55);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 24px rgba(255, 209, 102, .16), inset 0 1px 1px rgba(255, 255, 255, .12);
}
.step-item.active .step-idx { background: rgba(255, 209, 102, .22); color: #2a1f00; opacity: 1; }

/* ---------------- Layout ---------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 470px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 24px 28px;
}

.col-explain {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 20px 20px 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.col-explain::-webkit-scrollbar { width: 8px; }
.col-explain::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

.col-visual { min-width: 0; }

/* ---------------- 讲解区 ---------------- */
.explain-head { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; }
.explain-icon {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(150deg, rgba(255,209,102,.2), rgba(255,209,102,.05));
  border: 1px solid rgba(255,209,102,.4);
  color: var(--accent);
  font-size: 19px;
}
.explain-head h2 { margin: 0; font-size: 19px; font-weight: 650; }
.explain-en { color: var(--dim-2); font-family: var(--mono); font-size: 11.5px; letter-spacing: .4px; }

.goal {
  margin: 0 0 16px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 209, 102, .22);
  border-radius: 12px;
  background: rgba(255, 209, 102, .06);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .06);
  color: #f2f6fb;
  font-size: 13.5px;
}

.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 6px; }
.io-card {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .06);
  backdrop-filter: blur(3px);
}
.io-label {
  margin-bottom: 7px;
  color: var(--dim-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.io-card ul { margin: 0; padding-left: 16px; }
.io-card li { margin-bottom: 3px; color: var(--dim); font-size: 12.5px; line-height: 1.55; }
.io-card code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(56, 217, 217, .12);
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 11.5px;
}

.sec-title {
  margin: 22px 0 9px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .6px;
}
.sec-title:first-of-type { margin-top: 18px; }

.actions { margin: 0; padding-left: 20px; }
.actions li { margin-bottom: 7px; color: #c4d2e0; font-size: 13.3px; line-height: 1.65; }
.actions li::marker { color: var(--accent); font-weight: 600; }

.explain-body p {
  margin: 0 0 11px;
  color: #c4d2e0;
  font-size: 13.3px;
  line-height: 1.78;
}
.explain-body b { color: #fff; font-weight: 650; }
/* explain / pitfalls 里的 <code>：与 io-card 的代码样式统一（此前完全没定义，
   靠浏览器默认等宽字体显示，和整体风格脱节） */
.explain-body code,
.pitfalls code,
.actions code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(56, 217, 217, .12);
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 11.8px;
  white-space: nowrap;
}

.pitfalls { margin: 0; padding: 0; list-style: none; }
.pitfalls li {
  position: relative;
  margin-bottom: 8px;
  padding: 9px 12px 9px 32px;
  border: 1px solid rgba(255,107,107,.18);
  border-radius: 7px;
  background: rgba(255,107,107,.045);
  color: #c9d6e4;
  font-size: 12.8px;
  line-height: 1.65;
}
.pitfalls li::before {
  content: "!";
  position: absolute;
  left: 11px; top: 9px;
  width: 15px; height: 15px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,107,107,.18);
  color: var(--danger);
  font-size: 11px;
  font-weight: 700;
}
.pitfalls b { color: #ffd7d7; }

/* ---------------- 命令框 ---------------- */
.cmd-box {
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: rgba(0, 0, 0, .22);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .05);
  overflow: hidden;
}
/* tab 名称可能较长（如「Calibre · 天线/密度」），窄屏横向滚动而不是撑破面板 */
.cmd-tabs { display: flex; border-bottom: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .04); overflow-x: auto; scrollbar-width: none; }
.cmd-tabs::-webkit-scrollbar { display: none; }
.cmd-tab {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--dim-2);
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.cmd-tab:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.cmd-tab.active { color: var(--accent-2); border-bottom-color: var(--accent-2); background: rgba(56, 217, 217, .08); }
.cmd-code {
  margin: 0;
  padding: 13px 15px;
  overflow-x: auto;
  color: #b8cadb;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.72;
  white-space: pre;
}
.cmd-code::-webkit-scrollbar { height: 7px; }
.cmd-code::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }

/* ---------------- 画布 ---------------- */
.canvas-wrap {
  position: relative;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 16px;
  background: rgba(7, 11, 17, .65);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, .55),
    inset 0 1px 1px rgba(255, 255, 255, .08);
  overflow: hidden;
  backdrop-filter: blur(8px);
}
#stage { display: block; width: 100%; aspect-ratio: 3 / 2; }
.stage-badge {
  position: absolute;
  top: 12px; right: 14px;
  padding: 5px 12px;
  border: 1px solid rgba(255, 209, 102, .35);
  border-radius: 999px;
  background: rgba(7, 11, 17, .85);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11.5px;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* ---------------- 控制条 ---------------- */
.controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .06);
  flex-wrap: wrap;
  backdrop-filter: blur(6px);
}
.spacer { flex: 1; }

/* 本步动画进度条：播满即表示这一步已完成，可进入下一步 */
.prog {
  flex: 0 0 100%;
  height: 3px;
  margin-top: 4px;
  background: rgba(255, 255, 255, .08);
  border-radius: 2px;
  overflow: hidden;
}
.prog i {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}
.btn {
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  cursor: pointer;
  transition: background .18s cubic-bezier(.32,.72,0,1), border-color .18s, transform .12s;
}
.btn:hover { background: rgba(255, 255, 255, .10); border-color: rgba(255, 255, 255, .18); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, rgba(255, 209, 102, .22), rgba(255, 209, 102, .08));
  border-color: rgba(255, 209, 102, .45);
  color: var(--accent);
  font-weight: 600;
  min-width: 92px;
}
.btn-primary:hover { background: linear-gradient(180deg, rgba(255, 209, 102, .30), rgba(255, 209, 102, .12)); border-color: rgba(255, 209, 102, .60); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.speed { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 12.5px; }
.speed select {
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
}

/* ---------------- 签核叠加层开关 ---------------- */
.overlays {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 9px 14px;
  border: 1px solid rgba(56,217,217,.22);
  border-radius: 10px;
  background: rgba(56,217,217,.04);
  font-size: 12.5px;
}
.ov-title { color: var(--accent-2); font-weight: 600; }
.overlays[hidden] { display: none; }
.overlays label { display: flex; align-items: center; gap: 6px; color: var(--dim); cursor: pointer; }
.overlays input { accent-color: var(--accent-2); cursor: pointer; }

/* ---------------- QA 检查 ---------------- */
.qa-head { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 10px; flex-wrap: wrap; }
.qa-head h3 { margin: 0; color: var(--accent); font-size: 13px; font-weight: 650; letter-spacing: .6px; }
.qa-hint { color: var(--dim-2); font-size: 12px; }
.qa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 9px; }
.qa-card {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--panel);
}
.qa-card.ok   { border-left-color: var(--ok); }
.qa-card.warn { border-left-color: var(--warn); }
.qa-card .qa-item { color: var(--text); font-size: 12.8px; font-weight: 600; }
.qa-card .qa-value { margin-top: 3px; color: var(--dim); font-family: var(--mono); font-size: 11.5px; }
.qa-card .qa-status { margin-top: 6px; font-size: 11px; font-weight: 600; letter-spacing: .3px; }
.qa-card.ok   .qa-status { color: var(--ok); }
.qa-card.warn .qa-status { color: var(--warn); }

/* ---------------- Footer ---------------- */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1680px;
  margin: 0 auto;
  padding: 16px 24px 30px;
  border-top: 1px solid var(--border);
  color: var(--dim-2);
  font-size: 12px;
}
kbd {
  padding: 1px 6px;
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
}
.disclaimer { font-style: italic; }

/* ---------------- 自媒体链接 ---------------- */
.footer-left { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* 通用社交链接卡片（深色玻璃风） */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: rgba(255,255,255,.04);
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
  line-height: 1.1;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s, color .15s;
}
.social-link:hover { transform: translateY(-1px); }

.social-link .sl-ico {
  width: 18px; height: 18px;
  border-radius: 4px;
  flex: 0 0 auto;
  background: rgba(255,255,255,.08);
  object-fit: contain;
}
.social-link .sl-id { color: var(--dim); font-family: var(--mono); font-size: 11px; }

/* 品牌色与悬停态（B站 #00A1D6 / 小红书 #FE2C55） */
.social-link.bili { border-color: rgba(0,161,214,.45); }
.social-link.bili:hover { background: rgba(0,161,214,.14); border-color:#00A1D6; color:#cdeefb; box-shadow:0 4px 14px rgba(0,161,214,.25); }
.social-link.xhs  { border-color: rgba(254,44,85,.45); }
.social-link.xhs:hover  { background: rgba(254,44,85,.14); border-color:#FE2C55; color:#ffd9e2; box-shadow:0 4px 14px rgba(254,44,85,.22); }

/* 封面：较大的双行卡片（图标 + 平台名 + ID） */
.cover-social .social-link { padding: 8px 14px; gap: 10px; }
.cover-social .sl-ico { width: 24px; height: 24px; }
.cover-social .sl-txt { display: flex; flex-direction: column; line-height: 1.25; }
.cover-social .sl-txt b { font-size: 13.5px; font-weight: 600; color: #eef4fb; }
.cover-social .sl-txt i { font-style: normal; font-size: 11px; color: var(--dim); }

/* 顶部常驻：紧凑，仅图标 + 平台名 */
.header-social { display: inline-flex; gap: 8px; align-items: center; }
.header-social .social-link { padding: 5px 10px; font-size: 12px; }
.header-social .sl-ico { width: 16px; height: 16px; }

.social-links { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------------- B站 Toy 互动 ---------------- */
/* 头部紧凑关注态按钮（非 Toy 环境隐藏） */
.toy-rel-chip {
  font: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 10px;
  border: 1px solid rgba(0,161,214,.45);
  background: rgba(0,161,214,.10); color: #cdeefb;
  font-size: 12px; line-height: 1; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s, color .15s;
}
.toy-rel-chip:hover { transform: translateY(-1px); background: rgba(0,161,214,.18); border-color:#00A1D6; box-shadow:0 4px 14px rgba(0,161,214,.25); }
.toy-rel-chip.following { border-color: rgba(34,211,166,.5); background: rgba(34,211,166,.12); color:#bdf5e4; }
.toy-rel-chip.following:hover { background: rgba(34,211,166,.2); border-color:#22d3a6; }
.toy-rel-chip[hidden] { display: none; }

/* 页脚 Toy 互动面板 */
.toy-panel {
  display: flex; gap: 14px; align-items: flex-start;
  margin-top: 14px; padding: 14px 16px;
  border: 1px solid var(--border-2); border-radius: 12px;
  background: rgba(255,255,255,.03);
}
.toy-panel.toy-offline { background: rgba(255,255,255,.02); }
.toy-logo { font-size: 22px; line-height: 1.2; filter: saturate(.9); }
.toy-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.toy-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.toy-head b { font-size: 13.5px; color: #eef4fb; font-weight: 600; }
.toy-sub { font-size: 12px; color: var(--dim); }
.toy-data { display: flex; flex-direction: column; gap: 8px; }
.toy-data[hidden] { display: none; }
.toy-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toy-label { flex: 0 0 56px; font-size: 12px; color: var(--dim); }
.toy-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.toy-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--border-2);
  background: rgba(255,255,255,.04); color: var(--dim);
}
.toy-badge.on { color: #0a0e14; font-weight: 600; }
.toy-badge.on.follow { background: #22d3a6; border-color: #22d3a6; }
.toy-badge.on.fan    { background: #ffd166; border-color: #ffd166; }
.toy-badge.on.medal  { background: #c084fc; border-color: #c084fc; }
.toy-badge.on.charge { background: #fe2c55; border-color: #fe2c55; color: #fff; }

.toy-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.toy-stat {
  display: inline-flex; flex-direction: column; align-items: center;
  min-width: 56px; padding: 6px 10px; border-radius: 9px;
  border: 1px solid var(--border-2); background: rgba(255,255,255,.03);
}
.toy-stat b { font-size: 16px; color: #eef4fb; font-family: var(--mono); }
.toy-stat span { font-size: 11px; color: var(--dim); }
.toy-stat.hot b { color: #7cff6b; }
.toy-muted { font-size: 12px; color: var(--dim); font-style: italic; }

.toy-hint { margin: 0; font-size: 12px; color: #ffcf6b; line-height: 1.5; }
.toy-hint[hidden] { display: none; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-explain { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 700px) {
  .io-grid { grid-template-columns: 1fr; }
  .site-header { padding: 18px 16px 14px; }
  .stepbar, .layout, .site-footer { padding-left: 16px; padding-right: 16px; }
  /* 原先这里把步骤名 display:none 只留图标、min-width 压到 46px ——
     结果是"15 个看不懂的圆圈"。步骤名是导航的核心信息，必须留着，
     放不下就横向滚动（见下面的 .stepbar 定高换行规则）。 */
  .step-item { min-width: 96px; }
}

/* ==================== 复审修复 ==================== */

/* 1) 键盘可见焦点：此前全站只有 hover 反馈，键盘用户看不到焦点在哪（skill 第 84 行要求） */
:where(a, button, select, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 1b) Toy 环境标记：toy.js 与宿主握手成功后给 <html> 加 .toy-env。
       这里曾经有一条 `html.toy-env .social-link.xhs { display: none; }`，
       本意是在 B站端内隐藏竞品外链（iframe 带 allow-popups-to-escape-sandbox，
       点外链会真的跳出 Toy）。但它的后果是：只要 window.toy 存在并握手成功，
       封面 / 顶栏 / 页脚三处的小红书链接会全部消失，页脚只剩 B站一个卡片，
       看起来像布局坏了。已移除 —— 三处链接在端内照常显示。
       若将来平台审核确实要求隐藏，请只隐藏"可点击性"而不是整块 display:none，例如：
         html.toy-env .social-link.xhs { pointer-events: none; text-decoration: line-through; } */

/* 2) 桌面双列：改用 dvh（端内工具栏会让 100vh 偏大，内部滚动区底部被压住）；vh 作为兜底保留 */
@media (min-width: 1181px) {
  .col-explain { max-height: calc(100dvh - 32px); }
}

/* 3) 单列（手机/平板）时把动画与控制条提到文字前面。
      否则 390 宽下控制条在 y≈2322、画布在 y≈2446，用户要滚 2.4 屏才看到动画 */
@media (max-width: 1180px) {
  .col-visual { order: -1; }

  /* 中等宽度（701~1180px）：原来的固定 8 列会被压到 70px 一个、标签全变省略号。
     改成"按可用宽度决定列数"的网格，保证顺序正确、不漏项、标签看得见。
     这里踩过三个坑，别再改回去：
       · flex column wrap：第一行变成第 0/2/4/6/8… 步，阅读顺序全乱；
       · flex row wrap + 定高：390px 宽只塞得下 3 个，多出来的行被 overflow 裁掉，
         15 步只剩 6 步可见；
       · 固定 8 列网格：每格只剩 ~40px，chip 实际宽 20px，步骤名被压成 0 宽全部消失。
     列数由 --sc 控制：每格要塞下 19px 序号 + 7px 间隙 + 最长 5 字（约 60px）
     ≈ 95px，所以 390px 用 4 列，宽一点用 5 列。grid-auto-rows 让每行等高等距，
     行数自然增长（15 步 → 4/5 列时是 4 行 / 3 行），一行一行读，顺序正确。 */
  .stepbar {
    display: grid;
    grid-template-columns: repeat(var(--sc, 5), minmax(0, 1fr));
    grid-auto-rows: 44px;
    gap: 8px;
    overflow: visible;
  }
  /* 基础规则里第 9~15 项被显式钉在 grid-row:2（那是桌面 8+7 用的），
     这里必须解除，否则多行网格只剩第一行能被自动填充，会堆成 7 列。 */
  .step-item:nth-child(n) { grid-row: auto; grid-column: auto; }
  .step-item,
  .step-item:nth-child(n + 9) {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }
  /* 网格里没有间隙可画导轨，去掉避免压字 */
  .step-item:not(:nth-child(8)):not(:nth-child(15))::after { display: none; }
}

/* 4) 步骤条：15 步固定两行（8 + 7），见文件顶部 .stepbar 规则。
      早期用 repeat(auto-fit, minmax(88px,1fr)) 自动排布，结果是第一行 14 个、
      第二行只剩 1 个（第 15 步掉到第三行）——既不对称，标签也被压成"流程…"。 */

@media (max-width: 700px) {
  /* ---------------- 手机端总原则 ----------------
     1) 首屏别再被"说明性信息"占掉：手机视口只有 844px，原来 header 一项就吃掉
        264px（31%），画布要滚到 y≈555 才出现。
     2) 砍掉 backdrop-filter：手机上每个模糊元素都要实时重算背后内容，而 canvas
        每帧都在重绘，canvas-wrap 的 blur(8px) 等于每帧做一次离屏模糊——这是"卡"
        的主因，不是画布本身（画布实测单帧仅 0.2~1.9ms）。 */

  /* 顶部信息栏不再常驻占用视口 */
  .site-header { position: static; padding: 14px 16px 12px; }
  .site-header h1 { font-size: 19px; }
  .tagline { font-size: 12px; margin-top: 2px; }
  .header-main { margin-bottom: 2px; }

  /* 设计名 / 统计两个 chip 在画布图例里已有等价信息（"示例设计" + 统计数字），
     手机上先让位给动画 */
  #chipDesign, #chipStats { display: none; }

  /* 步骤条：每格至少要 95px 才放得下"序号 + 5 字标签"（39+2×9 内边距 + 19 序号
     + 7 间隙 + 60 文字），360~430px 视口用 4 列。5 列会把标签压到省略号。 */
  .stepbar { --sc: 4; }

  /* 触控目标 ≥44px（Apple HIG / skill 第 92 行） */
  .btn, .cmd-tab, .chip-btn, .toy-rel-chip, #selSpeed { min-height: 44px; }
  .overlays label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
  .overlays input[type="checkbox"] { width: 20px; height: 20px; }

  /* 窄屏画布上那块"步骤徽章"会盖住画布自己的标题（徽章是固定字号，画布却缩到了
     390px 宽），而每步标题在左栏和徽章右侧都在显示 —— 这里直接隐掉，画面更干净 */
  .stage-badge { display: none; }
  /* 单列时画布更高一些，动画细节才看得清 */
  #stage { aspect-ratio: 4 / 3; }

  /* ---- 手机端去掉实时模糊：换成等效的深色实底，观感几乎无差 ---- */
  .site-header,
  .io-card,
  .controls,
  .canvas-wrap,
  .stage-badge,
  .step-item {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .site-header  { background: rgba(9, 13, 20, .96); box-shadow: 0 10px 28px rgba(0,0,0,.35); }
  .controls     { background: rgba(16, 22, 31, .92); }
  .io-card      { background: rgba(18, 25, 35, .85); }
  .canvas-wrap  { background: #070b11; box-shadow: 0 12px 30px rgba(0,0,0,.45); }

  /* 大阴影在手机上也要收着用（每帧重绘时合成成本不低） */
  .col-explain, .qa-card, .cmd-box, .toy-panel { box-shadow: none; }

  /* 控制条：四个按钮 + 速度挤成两行，收紧内边距 */
  .controls { padding: 8px 10px; margin-bottom: 10px; gap: 6px; }
  .btn { padding: 8px 12px; }
  .btn-primary { min-width: 84px; }
  /* 速度选择器可以并排放在按钮后面，不必单占一行 */
  .speed { margin-left: auto; }
  .qa-head { margin: 14px 0 8px; }
  .qa-grid { gap: 8px; }

  /* 封面统计小卡的 blur 在 cover.css 里（那个文件在本文件之后加载，同优先级会赢），
     已在 cover.css 内用同样的媒体查询去掉，这里不再重复。 */
  .splash-inner { padding-left: 18px; padding-right: 18px; }
}
