/* ================================================================
   启动器下载站 · 样式表
   方向：WinUI 3 / Fluent Design（深色 + 浅色双主题，可跟随系统）

   设计立场：直接采用 WinUI 3 的真实设计令牌。两套主题不是「反相」关系，
   而是各自独立的一组值：深色底是 #202020、浅色底是 #F3F3F3（不是纯白）；
   卡片在深色下是白色 5% 叠加、浅色下是白色 70% 叠加；强调色深色下是
   亮蓝 #60CDFF 配黑字、浅色下是深蓝 #005FB8 配白字。
   层次一律来自材质与描边，不来自阴影和渐变。
   ================================================================ */

/* ══════════════════════════════════════════════════════════
   深色主题（默认）
   ══════════════════════════════════════════════════════════ */
:root {
  color-scheme: dark;

  --bg-base: #202020;          /* SolidBackgroundFillColorBase */
  --bg-secondary: #1c1c1c;
  --bg-tertiary: #282828;

  --layer: rgba(255, 255, 255, 0.0538);          /* LayerFillColorDefault */
  --layer-alt: rgba(255, 255, 255, 0.0326);
  --ctl-fill: rgba(255, 255, 255, 0.0605);       /* ControlFillColorDefault */
  --ctl-fill-hover: rgba(255, 255, 255, 0.0837);
  --ctl-fill-pressed: rgba(255, 255, 255, 0.0326);
  --ctl-fill-disabled: rgba(255, 255, 255, 0.0412);
  --ctl-stroke: rgba(255, 255, 255, 0.0698);     /* ControlStrokeColorDefault */
  --ctl-stroke-strong: rgba(255, 255, 255, 0.0930);
  --divider: rgba(255, 255, 255, 0.0837);
  --card-stroke: rgba(255, 255, 255, 0.0698);
  --subtle-hover: rgba(255, 255, 255, 0.0605);   /* SubtleFillColorSecondary */
  --subtle-pressed: rgba(255, 255, 255, 0.0412);

  --text: #ffffff;                               /* TextFillColorPrimary */
  --text-2: rgba(255, 255, 255, 0.786);
  --text-3: rgba(255, 255, 255, 0.5442);
  --text-disabled: rgba(255, 255, 255, 0.3628);

  --accent: #60cdff;                             /* AccentFillColorDefault */
  --accent-hover: #58c6f7;
  --accent-pressed: #50beef;
  --on-accent: #000000;
  --on-accent-2: rgba(0, 0, 0, 0.55);
  --on-accent-pressed: rgba(0, 0, 0, 0.62);
  --accent-stroke-top: rgba(255, 255, 255, 0.08);
  --accent-stroke-bottom: rgba(0, 0, 0, 0.25);
  --accent-text: #99ebff;                        /* AccentTextFillColorPrimary */

  --sys-ok: #6ccb5f;
  --sys-warn: #fce100;
  --sys-err: #ff99a4;

  /* 材质与装饰：随主题翻转的部分 */
  --mica-1: rgba(255, 255, 255, 0.032);
  --mica-2: rgba(255, 255, 255, 0.018);
  --acrylic: rgba(32, 32, 32, 0.72);
  --acrylic-strong: rgba(44, 44, 44, 0.72);
  --scroll-thumb: rgba(255, 255, 255, 0.26);
  --scroll-thumb-hover: rgba(255, 255, 255, 0.42);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.36);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 4.6L6 8.4l3.8-3.8' fill='none' stroke='%23a8a8a8' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.4 2.4 4.6-5' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='%236ccb5f' stroke-width='1.3'/%3E%3Cpath d='M4.8 8.2l2.2 2.2 4.2-4.6' fill='none' stroke='%236ccb5f' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-err: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='%23ff99a4' stroke-width='1.3'/%3E%3Cpath d='M8 4.6v4.2M8 11.2v.1' stroke='%23ff99a4' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");

  /* ── 几何与字体（两套主题共用）────────────────────────── */
  --r-ctl: 4px;      /* ControlCornerRadius */
  --r-card: 8px;     /* OverlayCornerRadius */

  --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui,
    -apple-system, "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI Variable", "Segoe UI",
    system-ui, -apple-system, "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, Menlo, monospace;

  --maxw: 1000px;
  --nav-h: 48px;
  --ease: cubic-bezier(0.1, 0.9, 0.2, 1);   /* Fluent fast-out slow-in */
}

/* ══════════════════════════════════════════════════════════
   浅色主题（WinUI 3 Light 的真实值）
   ══════════════════════════════════════════════════════════ */
:root[data-theme="light"] {
  color-scheme: light;

  --bg-base: #f3f3f3;          /* 浅色底不是纯白 */
  --bg-secondary: #eeeeee;
  --bg-tertiary: #f9f9f9;

  --layer: rgba(255, 255, 255, 0.70);            /* CardBackgroundFillColorDefault */
  --layer-alt: rgba(255, 255, 255, 0.50);
  --ctl-fill: rgba(255, 255, 255, 0.70);         /* ControlFillColorDefault */
  --ctl-fill-hover: rgba(249, 249, 249, 0.50);
  --ctl-fill-pressed: rgba(249, 249, 249, 0.30);
  --ctl-fill-disabled: rgba(249, 249, 249, 0.30);
  --ctl-stroke: rgba(0, 0, 0, 0.06);
  --ctl-stroke-strong: rgba(0, 0, 0, 0.16);
  --divider: rgba(0, 0, 0, 0.06);
  --card-stroke: rgba(0, 0, 0, 0.06);
  --subtle-hover: rgba(0, 0, 0, 0.037);          /* SubtleFillColorSecondary */
  --subtle-pressed: rgba(0, 0, 0, 0.024);

  --text: rgba(0, 0, 0, 0.89);                   /* TextFillColorPrimary */
  --text-2: rgba(0, 0, 0, 0.62);
  --text-3: rgba(0, 0, 0, 0.45);
  --text-disabled: rgba(0, 0, 0, 0.36);

  --accent: #005fb8;                             /* 浅色强调色是深蓝 + 白字 */
  --accent-hover: #0057a8;
  --accent-pressed: #004e96;
  --on-accent: #ffffff;
  --on-accent-2: rgba(255, 255, 255, 0.78);
  --on-accent-pressed: rgba(255, 255, 255, 0.72);
  --accent-stroke-top: rgba(255, 255, 255, 0.10);
  --accent-stroke-bottom: rgba(0, 0, 0, 0.16);
  --accent-text: #005fb8;

  --sys-ok: #0f7b0f;
  --sys-warn: #9d5d00;
  --sys-err: #c42b1c;

  --mica-1: rgba(0, 0, 0, 0.010);
  --mica-2: rgba(0, 0, 0, 0.005);
  --acrylic: rgba(243, 243, 243, 0.74);
  --acrylic-strong: rgba(252, 252, 252, 0.74);
  --scroll-thumb: rgba(0, 0, 0, 0.28);
  --scroll-thumb-hover: rgba(0, 0, 0, 0.44);
  --shadow-float: 0 8px 24px rgba(0, 0, 0, 0.14);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 4.6L6 8.4l3.8-3.8' fill='none' stroke='%235c5c5c' stroke-width='1.1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --check-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.4 2.4 4.6-5' fill='none' stroke='%23fff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-ok: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='%230f7b0f' stroke-width='1.3'/%3E%3Cpath d='M4.8 8.2l2.2 2.2 4.2-4.6' fill='none' stroke='%230f7b0f' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --icon-err: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='%23c42b1c' stroke-width='1.3'/%3E%3Cpath d='M8 4.6v4.2M8 11.2v.1' stroke='%23c42b1c' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;

  /* Mica 模拟：底色之上极淡的一层光，几乎没有对比 */
  background-color: var(--bg-base);
  background-image:
    radial-gradient(1400px 900px at 12% -8%, var(--mica-1), transparent 62%),
    radial-gradient(1000px 700px at 88% 4%, var(--mica-2), transparent 60%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

.wrap { width: min(100% - 48px, var(--maxw)); margin: 0 auto; }

.num, .specs dd, .ledger td { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }

/* ── WinUI 细滚动条 ───────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: var(--scroll-thumb);
  border: 5px solid transparent;
  background-clip: content-box;
  border-radius: 7px;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }

/* ── 焦点视觉 ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 1px;
  border-radius: var(--r-ctl);
}

/* ── 卡片 ─────────────────────────────────────────────── */
.card {
  background: var(--layer);
  border: 1px solid var(--card-stroke);
  border-radius: var(--r-card);
  padding: 24px;
  margin: 0 0 16px;
}

/* ── 导航（Acrylic）───────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: var(--acrylic);
  backdrop-filter: blur(30px) saturate(125%);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
  border-bottom: 1px solid var(--divider);
}
.nav__inner { height: var(--nav-h); display: flex; align-items: center; gap: 28px; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand__logo { height: 22px; width: auto; border-radius: var(--r-ctl); }
.brand__mark {
  height: 24px; width: 24px; flex: none; border-radius: var(--r-ctl);
  background: var(--accent); color: var(--on-accent);
  font-weight: 600; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.brand__text { font-size: 14px; font-weight: 600; white-space: nowrap; }

.nav__links { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav__links a {
  position: relative;
  font-size: 14px; font-weight: 400; color: var(--text-2);
  padding: 6px 12px; border-radius: var(--r-ctl);
  transition: background .12s var(--ease), color .12s var(--ease);
}
.nav__links a:hover { background: var(--subtle-hover); color: var(--text); }
.nav__links a:active { background: var(--subtle-pressed); color: var(--text-3); }
.nav__links a.is-active { color: var(--text); font-weight: 600; }
.nav__links a.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: -1px;
  transform: translateX(-50%);
  width: 16px; height: 3px; border-radius: 2px; background: var(--accent);
}

/* ── 主题切换按钮 ─────────────────────────────────────── */
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; flex: none; padding: 0;
  border: 1px solid transparent; border-radius: var(--r-ctl);
  background: transparent; color: var(--text-2);
  transition: background .12s var(--ease), color .12s var(--ease);
}
.theme-btn:hover { background: var(--subtle-hover); color: var(--text); }
.theme-btn:active { background: var(--subtle-pressed); }
.theme-btn__icon { display: none; width: 16px; height: 16px; }
/* 无脚本时兜底显示深色图标；有 data-theme-mode 时交还给下面三条规则 */
.theme-btn__icon[data-icon="dark"] { display: block; }
:root[data-theme-mode] .theme-btn__icon[data-icon="dark"] { display: none; }
:root[data-theme-mode="system"] .theme-btn__icon[data-icon="system"],
:root[data-theme-mode="light"] .theme-btn__icon[data-icon="light"],
:root[data-theme-mode="dark"] .theme-btn__icon[data-icon="dark"] { display: block; }
.theme-btn--float { position: fixed; top: 14px; right: 16px; z-index: 60; }

/* ── 版本主区 ─────────────────────────────────────────── */
.sheet { padding: 40px 0 8px; }
.sheet__head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sheet__kicker { margin: 0; font-size: 12px; font-weight: 400; color: var(--text-3); }

/* 版本号原样显示，不自动加 v 之类的前缀——需要前缀由填写版本号的人自己写 */
.sheet__version {
  margin: 0 0 28px;
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 8.5vw, 4.5rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--text);
  word-break: break-word;
}

.specs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 0 0 20px;
  background: var(--layer);
  border: 1px solid var(--card-stroke);
  border-radius: var(--r-card);
  overflow: hidden;
}
.specs__cell { padding: 14px 20px; min-width: 0; }
.specs__cell + .specs__cell { box-shadow: inset 1px 0 0 var(--divider); }
.specs dt { margin: 0 0 4px; font-size: 12px; font-weight: 400; color: var(--text-3); }
.specs dd {
  margin: 0; font-size: 16px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.specs dd.is-hash { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--text-2); }

/* ── 按钮 ─────────────────────────────────────────────── */
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.dl, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 32px; padding: 5px 12px;
  font-size: 14px; font-weight: 600;
  border-radius: var(--r-ctl);
  background: var(--ctl-fill);
  border: 1px solid var(--ctl-stroke);
  border-bottom-color: var(--ctl-stroke-strong);
  color: var(--text);
  transition: background .1s var(--ease), color .1s var(--ease), border-color .1s var(--ease);
}
.dl:hover, .btn:hover { background: var(--ctl-fill-hover); }
.dl:active, .btn:active {
  background: var(--ctl-fill-pressed);
  color: var(--text-3);
  border-bottom-color: var(--ctl-stroke);
}

.dl--primary, .btn-primary {
  background: var(--accent);
  border-color: var(--accent-stroke-top);
  border-bottom-color: var(--accent-stroke-bottom);
  color: var(--on-accent);
  font-weight: 600;
}
.dl--primary:hover, .btn-primary:hover { background: var(--accent-hover); }
.dl--primary:active, .btn-primary:active {
  background: var(--accent-pressed); color: var(--on-accent-pressed);
}

.dl__size { font-size: 12px; font-weight: 400; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dl--primary .dl__size { color: var(--on-accent-2); }
.dl__icon { width: 16px; height: 16px; flex: none; }

/* 人机验证卡片：默认不占位，点下载后才展开，把下方内容整体推开。
   注意不能放进 .actions —— flex 行会把其它子项拉伸到同高。 */
.dl-verify {
  margin-top: 16px;
  padding: 16px 18px;
  background: var(--layer);
  border: 1px solid var(--card-stroke);
  border-radius: var(--r-card);
  width: fit-content;
  animation: fluentIn .24s var(--ease) backwards;
}
.dl-verify[hidden] { display: none; }
#cf-widget { display: block; }

/* ── 标签：3px 竖色条 ─────────────────────────────────── */
.tag-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 400; color: var(--text-2);
  vertical-align: middle;
}
.tag-badge::before {
  content: ""; width: 3px; height: 12px; flex: none; border-radius: 2px;
  background: var(--tag, currentColor);
}

/* ── 区块 ─────────────────────────────────────────────── */
.section { padding: 26px 0; }
.section__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.section__head h2 {
  margin: 0; font-family: var(--font-display);
  font-size: 20px; font-weight: 600; letter-spacing: -0.01em;
}
.section__note { margin: 0; font-size: 12px; color: var(--text-3); }

/* ── 版本列表（ListView）─────────────────────────────── */
.ledger { width: 100%; border-collapse: separate; border-spacing: 0; }
.ledger th {
  text-align: left; font-size: 12px; font-weight: 400; color: var(--text-3);
  padding: 0 14px 8px; white-space: nowrap;
}
.ledger td {
  position: relative;
  padding: 12px 14px; font-size: 14px; color: var(--text-2);
  border-top: 1px solid var(--divider);
  vertical-align: middle;
  transition: background .12s var(--ease);
}
.ledger tbody tr:hover td { background: var(--subtle-hover); }
.ledger tbody tr:hover td:first-child { border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.ledger tbody tr:hover td:last-child { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }

.ledger tbody tr.is-current td { background: var(--subtle-hover); }
.ledger tbody tr.is-current:hover td { background: var(--ctl-fill-hover); }
.ledger tbody tr.is-current td:first-child { border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.ledger tbody tr.is-current td:last-child { border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.ledger tbody tr.is-current td:first-child::before {
  content: ""; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 16px; border-radius: 2px; background: var(--accent);
}
.ledger tbody tr.is-current .ledger__v { color: var(--text); font-weight: 600; }

.ledger__v { font-size: 15px; font-weight: 400; color: var(--text); white-space: nowrap; }
.ledger__go { text-align: right; white-space: nowrap; }
.ledger__go a {
  font-size: 14px; font-weight: 400; color: var(--accent-text);
  padding: 3px 8px; border-radius: var(--r-ctl);
  transition: background .12s var(--ease);
}
.ledger__go a:hover { background: var(--subtle-hover); }
.ledger__here { font-size: 12px; color: var(--text-3); }

/* ── 正文 ─────────────────────────────────────────────── */
.prose, .changelog { color: var(--text-2); font-size: 14px; line-height: 20px; max-width: 72ch; }
.prose p, .changelog p { margin: 0 0 12px; }
.prose p:last-child, .changelog p:last-child { margin-bottom: 0; }
.prose a, .changelog a { color: var(--accent-text); }
.prose a:hover, .changelog a:hover { text-decoration: underline; }

/* ── 截图 ─────────────────────────────────────────────── */
/* 一图一行、占满内容区宽度，与规格带/卡片同宽。
   截图多为界面长图，压缩到多列会让界面文字无法辨认。 */
.shots { display: grid; grid-template-columns: 1fr; gap: 16px; }
.shot {
  margin: 0; overflow: hidden;
  background: var(--layer);
  border: 1px solid var(--card-stroke);
  border-radius: var(--r-card);
}
.shot img { width: 100%; height: auto; display: block; }
.shot figcaption { padding: 10px 14px; font-size: 12px; color: var(--text-2); border-top: 1px solid var(--divider); }

/* ── 空状态 ───────────────────────────────────────────── */
.empty { padding: 44px 0; color: var(--text-3); }
.empty__title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 6px; }

/* ── 页脚 ─────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--divider); margin-top: 32px; }
.footer__inner {
  padding: 18px 0 40px; display: flex; align-items: baseline;
  justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.footer p { margin: 0; font-size: 12px; color: var(--text-3); }
.footer__links { display: flex; gap: 4px; align-items: center; }
.footer__links a {
  font-size: 12px; color: var(--text-2); padding: 4px 8px; border-radius: var(--r-ctl);
  transition: background .12s var(--ease);
}
.footer__links a:hover { background: var(--subtle-hover); color: var(--text); }

/* ══════════════════════════════════════════════════════════
   后台
   ══════════════════════════════════════════════════════════ */
.admin-nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: var(--acrylic);
  backdrop-filter: blur(30px) saturate(125%);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
  border-bottom: 1px solid var(--divider);
}
.admin-nav__inner { height: var(--nav-h); display: flex; align-items: center; gap: 2px; }
.admin-nav__brand {
  font-size: 14px; font-weight: 600; color: var(--text);
  margin-right: 14px; padding-right: 14px; border-right: 1px solid var(--divider);
}
.admin-nav a.admin-nav__link, .admin-nav button.admin-nav__link {
  position: relative; font-size: 14px; font-weight: 400; color: var(--text-2);
  padding: 6px 12px; border: none; background: none; border-radius: var(--r-ctl);
  transition: background .12s var(--ease), color .12s var(--ease);
}
.admin-nav a.admin-nav__link:hover, .admin-nav button.admin-nav__link:hover {
  background: var(--subtle-hover); color: var(--text);
}
.admin-nav a.admin-nav__link.is-active { color: var(--text); font-weight: 600; }
.admin-nav a.admin-nav__link.is-active::after {
  content: ""; position: absolute; left: 50%; bottom: -1px;
  transform: translateX(-50%);
  width: 16px; height: 3px; border-radius: 2px; background: var(--accent);
}
.admin-nav__spacer { margin-left: auto; }
.admin-nav__user { font-size: 12px; color: var(--text-3); margin-right: 8px; }
.admin-body { padding-top: 24px; padding-bottom: 56px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--layer); border: 1px solid var(--card-stroke);
  border-radius: var(--r-card); padding: 16px 18px;
}
.stat__label { font-size: 12px; font-weight: 400; color: var(--text-3); }
.stat__value {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat__hint { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* 表单 */
.field { margin-bottom: 18px; }
.field__label { display: block; font-size: 14px; font-weight: 400; margin-bottom: 6px; color: var(--text-2); }
.field__hint { font-size: 12px; color: var(--text-3); margin-top: 5px; line-height: 18px; }

.input, .textarea, .select {
  width: 100%; min-height: 32px; padding: 5px 11px;
  font-size: 14px; font-family: var(--font); line-height: 20px;
  color: var(--text);
  background: var(--ctl-fill);
  border: 1px solid var(--ctl-stroke);
  border-bottom-color: var(--ctl-stroke-strong);
  border-radius: var(--r-ctl);
  transition: background .12s var(--ease), border-color .12s var(--ease);
}
.input:hover, .textarea:hover, .select:hover { background: var(--ctl-fill-hover); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  background: var(--ctl-fill-hover);
  border-bottom: 2px solid var(--accent);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { min-height: 116px; padding: 8px 11px; resize: vertical; }
.textarea--tall { min-height: 210px; }
.select {
  appearance: none; padding-right: 32px;
  background-image: var(--chevron);
  background-repeat: no-repeat; background-position: right 9px center;
}
.select option { background: var(--bg-tertiary); color: var(--text); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.checkbox input {
  appearance: none; -webkit-appearance: none;
  width: 20px; height: 20px; flex: none; margin: 0;
  border-radius: var(--r-ctl);
  background: var(--ctl-fill);
  border: 1px solid var(--ctl-stroke-strong);
  transition: background .12s var(--ease), border-color .12s var(--ease);
}
.checkbox input:hover { background: var(--ctl-fill-hover); }
.checkbox input:checked {
  background: var(--accent); border-color: var(--accent);
  background-image: var(--check-mark);
  background-repeat: no-repeat; background-position: center;
}
input[type="color"] {
  width: 100%; height: 32px; padding: 2px; cursor: pointer;
  border-radius: var(--r-ctl); background: var(--ctl-fill);
  border: 1px solid var(--ctl-stroke-strong);
}

/* 表格 */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th {
  text-align: left; font-size: 12px; font-weight: 400; color: var(--text-3);
  padding: 0 14px 8px 0; white-space: nowrap;
}
.table td {
  padding: 12px 14px 12px 0; font-size: 14px; color: var(--text-2);
  border-top: 1px solid var(--divider); vertical-align: middle;
  transition: background .12s var(--ease);
}
.table tbody tr:hover td { background: var(--subtle-hover); }
.table .mono { font-family: var(--font); font-weight: 600; color: var(--text); }
.table .num { color: var(--text-2); }
.table__actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table__actions form { display: inline; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 400; color: var(--text-2);
}
.status-pill::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; flex: none;
}
.status-pill--on { color: var(--sys-ok); }
.status-pill--off { color: var(--text-3); }
.status-pill--wait { color: var(--sys-warn); }
.status-pill--err { color: var(--sys-err); }

.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; margin-bottom: 16px; font-size: 14px;
  border-radius: var(--r-ctl); border: 1px solid;
}
.flash::before {
  content: ""; width: 14px; height: 14px; flex: none; margin-top: 3px;
  background-repeat: no-repeat; background-position: center; background-size: contain;
}
.flash--ok { color: var(--sys-ok); border-color: color-mix(in srgb, var(--sys-ok) 32%, transparent); background: color-mix(in srgb, var(--sys-ok) 8%, transparent); }
.flash--ok::before { background-image: var(--icon-ok); }
.flash--error { color: var(--sys-err); border-color: color-mix(in srgb, var(--sys-err) 32%, transparent); background: color-mix(in srgb, var(--sys-err) 8%, transparent); }
.flash--error::before { background-image: var(--icon-err); }

.drop {
  border: 1px dashed var(--ctl-stroke-strong);
  border-radius: var(--r-card);
  padding: 24px; cursor: pointer; text-align: left;
  background: var(--layer-alt);
  transition: background .12s var(--ease), border-color .12s var(--ease);
}
.drop:hover, .drop.is-over {
  background: var(--subtle-hover);
  border-color: var(--accent);
  border-style: solid;
}
.drop__title { font-size: 14px; font-weight: 600; color: var(--text); }
.drop__hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.drop input[type="file"] { display: none; }

.progress { height: 4px; border-radius: 2px; background: var(--ctl-fill); margin-top: 10px; overflow: hidden; }
.progress__bar {
  height: 100%; width: 0; border-radius: 2px; background: var(--accent);
  transition: width .2s var(--ease);
}

.upload-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  margin-top: 10px;
  background: var(--layer); border: 1px solid var(--card-stroke);
  border-radius: var(--r-card);
}
.upload-item__name {
  font-size: 14px; font-weight: 600; color: var(--text);
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.upload-item__meta { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.tag-row {
  display: grid; grid-template-columns: 24px 1fr 112px 78px auto;
  gap: 10px; align-items: center; padding: 10px 0;
  border-top: 1px solid var(--divider);
}
.tag-row:first-of-type { border-top: none; }
.tag-row__swatch { width: 16px; height: 16px; border-radius: var(--r-ctl); }

/* 登录 / 安装（Acrylic 对话框：浮层是全站唯一用投影的地方）*/
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card {
  width: 100%; max-width: 400px; padding: 28px;
  background: var(--acrylic-strong);
  backdrop-filter: blur(30px) saturate(125%);
  -webkit-backdrop-filter: blur(30px) saturate(125%);
  border: 1px solid var(--card-stroke);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-float);
}
.auth-card__title {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px;
}
.auth-card__sub { color: var(--text-2); font-size: 14px; margin: 0 0 22px; }
.auth-card__foot { margin-top: 20px; font-size: 12px; color: var(--text-3); text-align: center; }
.auth-card__foot a { color: var(--accent-text); font-weight: 600; }
.auth-card__foot a:hover { text-decoration: underline; }

.invite-code {
  font-family: var(--mono); font-size: 13px; letter-spacing: .04em;
  color: var(--text); background: var(--ctl-fill);
  border: 1px solid var(--ctl-stroke);
  padding: 4px 10px; border-radius: var(--r-ctl); display: inline-block;
}

.shot-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.shot-admin__item {
  background: var(--layer); border: 1px solid var(--card-stroke);
  border-radius: var(--r-card); overflow: hidden;
}
.shot-admin__item img { width: 100%; height: 100px; object-fit: cover; border-bottom: 1px solid var(--divider); }
.shot-admin__bar { padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.shot-admin__cap { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn-secondary { color: var(--text-2); }
.btn-secondary:hover { color: var(--text); }
.btn-danger { color: var(--sys-err); }
.btn-danger:hover { background: color-mix(in srgb, var(--sys-err) 12%, transparent); color: var(--sys-err); }
.btn-ghost {
  background: none; border-color: transparent; color: var(--accent-text);
  padding: 5px 10px; font-weight: 400;
}
.btn-ghost:hover { background: var(--subtle-hover); color: var(--accent-text); }
.btn-sm { min-height: 26px; padding: 3px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled, .dl:disabled { background: var(--ctl-fill-disabled); color: var(--text-disabled); cursor: not-allowed; }

.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.spacer { flex: 1; }

@keyframes fluentIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.sheet__head, .sheet__version, .specs, .actions {
  animation: fluentIn .28s var(--ease) backwards;
}
.sheet__version { animation-delay: .03s; }
.specs { animation-delay: .06s; }
.actions { animation-delay: .09s; }

/* ── 主题切换：新主题从切换按钮位置圆形扩散铺满整屏 ─────────
   走 View Transitions，仅对新快照做 clip-path 动画；
   旧快照保持不淡出，作为扩散的底。 */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
@keyframes theme-reveal {
  from { clip-path: circle(0px at var(--theme-x, 50%) var(--theme-y, 50%)); }
  to { clip-path: circle(var(--theme-r, 150vmax) at var(--theme-x, 50%) var(--theme-y, 50%)); }
}
::view-transition-new(root) {
  animation: theme-reveal .5s var(--ease) forwards;
}

/* 切换过程中禁用元素自身过渡，避免颜色各自渐变 */
.theme-switching * { transition: none !important; }

@media (max-width: 860px) {
  .field-row { grid-template-columns: 1fr; }
  .admin-nav__inner { overflow-x: auto; }
  .admin-nav__user { display: none; }
  .tag-row { grid-template-columns: 20px 1fr 100px 70px auto; gap: 8px; }
}

@media (max-width: 560px) {
  :root { --nav-h: 44px; }
  .wrap { width: min(100% - 32px, var(--maxw)); }
  .brand__text { display: none; }
  .nav__inner { gap: 12px; }
  .nav__links { gap: 0; }
  .nav__links a { padding: 6px 8px; font-size: 13px; }
  .sheet { padding: 26px 0 6px; }
  .sheet__version { margin-bottom: 22px; }
  .specs { grid-template-columns: 1fr 1fr; }
  .specs__cell { padding: 12px 16px; }
  .specs__cell + .specs__cell { box-shadow: none; }
  .specs__cell:nth-child(2n) { box-shadow: inset 1px 0 0 var(--divider); }
  .specs__cell:nth-child(n+3) { border-top: 1px solid var(--divider); }
  .actions { flex-direction: column; align-items: stretch; }
  .card { padding: 18px; }
  .ledger th:nth-child(3), .ledger td:nth-child(3),
  .ledger th:nth-child(4), .ledger td:nth-child(4) { display: none; }
  .ledger th, .ledger td { padding-left: 8px; padding-right: 8px; }
  .ledger th:first-child, .ledger td:first-child { padding-left: 14px; }
  .section { padding: 22px 0; }
  .footer__inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .auth-card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  /* 通配选择器不匹配伪元素，这里单独关掉主题扩散动画 */
  ::view-transition-new(root) { animation: none; }
}
