/* ---------- 主题变量：浅色为默认，深色可手动选择或跟随系统 ---------- */
:root {
  --bg: #f2f4f1;
  --panel: #ffffff;
  --panel-2: #f6f8f5;
  --ink: #10231f;
  --ink-2: #4c5f59;
  --ink-3: #7a8a85;
  --line: #d9e0da;
  --accent: #0e8a6a;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe7;
  --dep: #a86a12;
  --dep-soft: #fbf0dc;
  --danger: #b4372f;
  --shadow: 0 1px 2px rgb(16 35 31 / 6%), 0 12px 32px -12px rgb(16 35 31 / 18%);
  --dots: rgb(16 35 31 / 9%);
  --g-core: #24433b;
  --g-lang: #8a9a63;
  --g-network: #2f6fdb;
  --g-tunnel: #7a4fd6;
  --g-web: #0c8c8c;
  --g-storage: #c27a12;
  --g-tools: #c2417a;
  --g-system: #56677a;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0e1714;
  --panel: #15211d;
  --panel-2: #1a2824;
  --ink: #e4eeea;
  --ink-2: #a9b9b3;
  --ink-3: #7d8e88;
  --line: #26352f;
  --accent: #3fd2a2;
  --accent-ink: #06221a;
  --accent-soft: #163a2f;
  --dep: #e6a84d;
  --dep-soft: #33281a;
  --danger: #f07c72;
  --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 16px 40px -16px rgb(0 0 0 / 60%);
  --dots: rgb(228 238 234 / 7%);
  --g-core: #cfe3db;
  --g-lang: #b9c98f;
  --g-network: #6ea0ff;
  --g-tunnel: #a98bff;
  --g-web: #3cc9c9;
  --g-storage: #f0b04d;
  --g-tools: #f07aae;
  --g-system: #9dafc2;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #0e1714;
    --panel: #15211d;
    --panel-2: #1a2824;
    --ink: #e4eeea;
    --ink-2: #a9b9b3;
    --ink-3: #7d8e88;
    --line: #26352f;
    --accent: #3fd2a2;
    --accent-ink: #06221a;
    --accent-soft: #163a2f;
    --dep: #e6a84d;
    --dep-soft: #33281a;
    --danger: #f07c72;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 16px 40px -16px rgb(0 0 0 / 60%);
    --dots: rgb(228 238 234 / 7%);
    --g-core: #cfe3db;
    --g-lang: #b9c98f;
    --g-network: #6ea0ff;
    --g-tunnel: #a98bff;
    --g-web: #3cc9c9;
    --g-storage: #f0b04d;
    --g-tools: #f07aae;
    --g-system: #9dafc2;
    color-scheme: dark;
  }
}

/* ---------- 基础 ---------- */
* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  /* 滚动定位时避开吸顶栏 */
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "PingFang TC", "Hiragino Sans GB", "Microsoft YaHei", "Microsoft JhengHei", sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

button,
select {
  font: inherit;
  color: inherit;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  padding: 6px 12px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 6px;
  z-index: 50;
}

.skip:focus {
  top: 12px;
}

/* ---------- 顶栏 ---------- */
.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(20px, calc((100vw - 1240px) / 2));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.brand-name {
  font-weight: 750;
  font-size: 18px;
}

.brand-sub {
  padding-left: 10px;
  border-left: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
  white-space: nowrap;
}

.bar-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-link {
  color: var(--ink-2);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.bar-link:hover {
  color: var(--ink);
}

.lang select {
  appearance: none;
  padding: 6px 30px 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a8a85' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 9px center / 14px no-repeat;
  font-size: 14px;
  cursor: pointer;
}

.theme {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
}

.theme button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.theme button svg {
  width: 17px;
  height: 17px;
}

.theme button[aria-checked="true"] {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ---------- 主体布局 ---------- */
.shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px 64px;
  /* 背景点阵向两侧伸出，在这里裁掉横向溢出；clip 不形成滚动容器，不影响右侧卡片吸顶 */
  overflow-x: clip;
}

.intro {
  position: relative;
  padding: 56px 0 36px;
}

/* 背景点阵，像电路板上的焊点，只铺在开头一小块 */
.intro::before {
  content: "";
  position: absolute;
  inset: 0 -40px;
  z-index: -1;
  background-image: radial-gradient(var(--dots) 1.2px, transparent 1.3px);
  background-size: 18px 18px;
  mask-image: radial-gradient(ellipse 70% 90% at 20% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 20% 30%, #000 30%, transparent 75%);
}

/* 鼠标经过时，光标附近的点阵亮起 */
.intro::after {
  content: "";
  position: absolute;
  inset: 0 -40px;
  z-index: -1;
  background-image: radial-gradient(var(--accent) 1.4px, transparent 1.5px);
  background-size: 18px 18px;
  opacity: 0;
  transition: opacity 0.4s;
  mask-image: radial-gradient(circle 130px at var(--mx, 50%) var(--my, 50%), #000, transparent);
  -webkit-mask-image: radial-gradient(circle 130px at var(--mx, 50%) var(--my, 50%), #000, transparent);
}

.intro.lit::after {
  opacity: 0.35;
}

h1 {
  margin: 0 0 16px;
  max-width: 14em;
  font-size: clamp(34px, 5.4vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.lead {
  max-width: 40em;
  margin: 0;
  color: var(--ink-2);
  font-size: 17px;
}

.banner {
  margin: 0 0 24px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--dep-soft);
  color: var(--dep);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 392px;
  gap: 48px;
  align-items: start;
}

/* ---------- 步骤 ---------- */
.step {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.step h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.step-no {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  font-weight: 750;
}

.hint {
  margin: 12px 0 0;
  color: var(--ink-3);
  font-size: 13px;
}

.hint.center {
  text-align: center;
}

.select-wrap {
  position: relative;
  display: inline-block;
}

/* 原生 select 仅保留为表单值载体，界面由自绘下拉呈现 */
.select-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 260px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.select::after {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  background: currentColor;
  opacity: 0.5;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.2s;
}

.select:hover {
  border-color: var(--accent);
}

.select:focus-visible,
.select[aria-expanded="true"] {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.select[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  max-height: 280px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  outline: none;
}

.select-menu[hidden] {
  display: none;
}

.select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.select-option.active {
  background: var(--accent-soft);
}

.select-option[aria-selected="true"] {
  color: var(--accent);
  font-weight: 700;
}

.select-option[aria-selected="true"]::after {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* 平台 */
.platforms {
  display: grid;
  gap: 14px;
}

.platform-group {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.platform-group > span {
  padding-top: 7px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.18s, background 0.18s, transform 0.12s;
}

.chip:hover {
  border-color: var(--ink-3);
}

.chip:active {
  transform: scale(0.96);
}

.chip svg {
  width: 0;
  height: 14px;
  stroke-width: 2.6;
  transition: width 0.18s;
}

.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}

.chip[aria-pressed="true"] svg {
  width: 14px;
  color: var(--accent);
}

/* 预设 */
.presets {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.preset {
  padding: 7px 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.preset:hover {
  color: var(--ink);
}

.preset[aria-pressed="true"] {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 3px rgb(0 0 0 / 12%);
}

/* 功能模块：按分组排列，分组色与存储条一致 */
.modules {
  display: grid;
  gap: 22px;
}

.mgroup h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink-2);
}

.mgroup h3::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--gc);
}

.mgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.mod {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, opacity 0.18s;
}

.mod:hover,
.mod.hl {
  border-color: var(--gc);
}

.mod input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mod:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 自绘复选框：选中时填充分组色并画出对勾 */
.box {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  border: 1.8px solid var(--ink-3);
  border-radius: 6px;
  transition: background 0.18s, border-color 0.18s;
}

.box svg {
  width: 14px;
  height: 14px;
  color: #fff;
  stroke-width: 3;
  stroke-dasharray: 20;
  stroke-dashoffset: 20;
  transition: stroke-dashoffset 0.25s ease-out 0.05s;
}

.mod.on .box {
  background: var(--gc);
  border-color: var(--gc);
}

.mod.on .box svg {
  stroke-dashoffset: 0;
}

.mod:not(.on) {
  background: transparent;
}

.mod:not(.on) .mod-title,
.mod:not(.on) .mod-size {
  color: var(--ink-3);
}

.mod.locked {
  cursor: default;
}

.mod.locked .box {
  opacity: 0.35;
}

.mod-title {
  font-weight: 650;
}

.mod-desc {
  display: block;
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.45;
}

.mod-size {
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  vertical-align: 1px;
}

.tag.core {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag.dep {
  background: var(--dep-soft);
  color: var(--dep);
  animation: tag-in 0.35s ease-out;
}

@keyframes tag-in {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}

/* 语言档位 */
.languages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lang-opt {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.lang-opt input {
  position: absolute;
  opacity: 0;
}

.lang-opt:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.lang-opt:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-name {
  font-weight: 650;
}

.lang-save {
  color: var(--ink-3);
  font-size: 13px;
}

/* ---------- 右侧安装包卡片 ---------- */
.pack {
  position: sticky;
  top: 76px;
}

.pack-card {
  position: relative;
  padding: 26px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.pack-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pack-head h2 {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 650;
}

.pack-close {
  display: none;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--panel-2);
  cursor: pointer;
}

.pack-close svg {
  width: 18px;
  height: 18px;
}

.readout {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.readout-num {
  font-size: 64px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.readout-unit {
  color: var(--ink-2);
  font-size: 20px;
  font-weight: 700;
}

.delta {
  min-height: 2.9em;
  margin: 8px 0 16px;
  color: var(--ink-2);
  font-size: 13px;
}

.delta strong {
  color: var(--accent);
}

/* 存储条：满宽代表完整版，每段是一个模块，取消勾选的模块收缩消失，空出的部分显示为斜纹 */
.storage {
  position: relative;
  display: flex;
  gap: 2px;
  height: 40px;
  padding: 4px;
  border-radius: 12px;
  background:
    repeating-linear-gradient(-45deg, var(--line) 0 1.5px, transparent 1.5px 7px),
    var(--panel-2);
  border: 1px solid var(--line);
  overflow: hidden;
}

.seg {
  /* 允许按宽度比例收缩：极小的段有最小宽度，加上间隙后总宽可能略超容器 */
  flex: 0 1 auto;
  min-width: 0;
  height: 100%;
  border-radius: 4px;
  background: var(--gc);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1), margin 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s, filter 0.2s;
}

.seg.off {
  opacity: 0;
  margin-left: -2px;
}

.storage:hover .seg:not(:hover) {
  filter: saturate(0.6) opacity(0.75);
}

.seg.hl {
  filter: brightness(1.15) !important;
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px var(--gc);
}

.storage-tip {
  position: absolute;
  z-index: 5;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -100%);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-3);
  font-size: 12px;
}

.legend li::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 2px;
  background: var(--gc);
}

.summary {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 14px;
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
  font-size: 14px;
}

.summary dt {
  color: var(--ink-3);
}

.summary dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.note {
  margin: 14px 0 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--dep-soft);
  color: var(--dep);
  font-size: 13px;
  animation: note-in 0.3s ease-out;
}

@keyframes note-in {
  from {
    transform: translateY(-4px);
    opacity: 0;
  }
}

.actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 22px;
}

.primary {
  position: relative;
  overflow: hidden;
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, filter 0.2s, opacity 0.2s;
}

.primary:hover:not(:disabled) {
  filter: brightness(1.07);
}

.primary:active:not(:disabled) {
  transform: scale(0.98);
}

.primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 提交中：按钮上掠过一道光 */
.primary.busy::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 35%) 50%, transparent 70%);
  animation: sweep 1.1s linear infinite;
}

@keyframes sweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
}

.ghost:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}

.ghost svg {
  width: 16px;
  height: 16px;
}

.error {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 13px;
}

/* 构建进度 */
.job {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.job h3 {
  margin: 0 0 12px;
  font-size: 15px;
}

.job-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.job-item {
  position: relative;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.job-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.pill {
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  background: var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}

.pill.done {
  background: var(--accent-soft);
  color: var(--accent);
}

.pill.failed {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}

.job-meta {
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 12px;
}

/* 构建中的进度条：不知道确切进度，用流动的条纹表示仍在进行 */
.progress {
  height: 4px;
  margin-top: 10px;
  border-radius: 2px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 6px, color-mix(in srgb, var(--accent) 35%, transparent) 6px 12px);
  background-size: 34px 100%;
  animation: flow 0.9s linear infinite;
}

.progress.queued {
  opacity: 0.45;
}

@keyframes flow {
  to {
    background-position: 34px 0;
  }
}

.files {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  transition: border-color 0.18s;
}

.file:hover {
  border-color: var(--accent);
}

.file svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.file-name {
  display: flex;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.file-base {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-ext {
  flex: none;
  font-weight: 700;
}

.file-size {
  color: var(--ink-3);
  font-size: 12px;
}

/* 定制镜像的拉取命令 */
.pull {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  margin-top: 10px;
}

.pull-cmd {
  display: block;
  padding: 9px 10px;
  border-radius: 9px;
  background: var(--panel);
  overflow-x: auto;
  white-space: nowrap;
  font-size: 12px;
}

.pull-copy {
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.pull-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink-3);
  font-size: 12px;
}

/* 构建完成时从状态标记处迸出的小方块 */
.spark {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  pointer-events: none;
  animation: spark 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

@keyframes spark {
  to {
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot));
    opacity: 0;
  }
}

/* ---------- 页脚与提示 ---------- */
.foot {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
}

.foot p {
  margin: 0 0 6px;
}

.foot a {
  margin-right: 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 60;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.dock,
.backdrop {
  display: none;
}

/* 主题切换的圆形展开（View Transitions） */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* ---------- 平板与手机 ---------- */
@media (max-width: 1080px) {
  .grid {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
  }

  .mgrid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .bar-link,
  .brand-sub {
    display: none;
  }

  .intro {
    padding: 32px 0 20px;
  }

  .lead {
    font-size: 16px;
  }

  .grid {
    display: block;
  }

  .platform-group {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .platform-group > span {
    padding-top: 0;
  }

  .languages {
    grid-template-columns: minmax(0, 1fr);
  }

  .select {
    width: 100%;
  }

  .select-wrap {
    display: block;
  }

  /* 安装包卡片变成底部抽屉 */
  .pack {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 40;
    max-height: 88vh;
    overflow-y: auto;
    transform: translateY(105%);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    overscroll-behavior: contain;
  }

  .pack.open {
    transform: none;
  }

  .pack-card {
    border-radius: 22px 22px 0 0;
    padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
  }

  .pack-card::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 10px;
    border-radius: 2px;
    background: var(--line);
  }

  .pack-close {
    display: grid;
    place-items: center;
  }

  .readout-num {
    font-size: 52px;
  }

  .backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgb(0 0 0 / 40%);
    animation: fade 0.25s ease-out;
  }

  @keyframes fade {
    from {
      opacity: 0;
    }
  }

  .dock {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 8px 16px;
    border-radius: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .dock-info {
    display: grid;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
  }

  .dock-size {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .dock-sub {
    overflow: hidden;
    color: var(--ink-3);
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .dock-go {
    padding: 11px 16px;
    font-size: 15px;
  }

  .foot {
    padding-bottom: 110px;
  }

  /* 手机上滚动定位时同时避开底部常驻条 */
  html {
    scroll-padding-bottom: 100px;
  }

  .toast {
    bottom: 96px;
  }
}

@media (max-width: 420px) {
  .presets {
    display: flex;
  }

  .preset {
    flex: 1;
    padding: 7px 8px;
  }

  .actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .ghost {
    justify-content: center;
    padding: 10px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .spark {
    display: none;
  }
}
