/* ============================================================
   UI 素材库 · 设计系统
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* ---------- 色板 ---------- */
:root {
  --h: 232;

  --bg: #fbfbfd;
  --bg-elev: #ffffff;
  --bg-sunken: #f4f5f9;
  --fg: #08090c;
  --fg-2: #3d434f;
  --muted: #6b7280;
  --faint: #9ca3af;

  --line: rgba(8, 9, 12, .07);
  --line-2: rgba(8, 9, 12, .11);
  --line-3: rgba(8, 9, 12, .18);

  --card: #ffffff;
  --card-hover: #ffffff;

  --accent: #2f4f8f;
  --accent-2: #3f6cb5;
  --accent-fg: #ffffff;
  --accent-soft: rgba(79, 70, 229, .08);
  --accent-line: rgba(79, 70, 229, .25);

  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;

  --r-xs: 7px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  --sh-1: 0 1px 2px rgba(8,9,12,.04), 0 1px 3px rgba(8,9,12,.03);
  --sh-2: 0 1px 2px rgba(8,9,12,.04), 0 8px 20px -8px rgba(8,9,12,.12);
  --sh-3: 0 2px 4px rgba(8,9,12,.04), 0 20px 48px -20px rgba(8,9,12,.24);
  --sh-pop: 0 4px 12px rgba(8,9,12,.08), 0 32px 80px -24px rgba(8,9,12,.32);

  --glass: rgba(255, 255, 255, .72);
  --glass-line: rgba(8, 9, 12, .06);

  --ease: cubic-bezier(.32, .72, 0, 1);
  --fast: 140ms;
  --norm: 240ms;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #07080b;
  --bg-elev: #0e1015;
  --bg-sunken: #0a0b0f;
  --fg: #f5f6f8;
  --fg-2: #c3c8d2;
  --muted: #8b93a2;
  --faint: #5c6373;

  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --line-3: rgba(255, 255, 255, .2);

  --card: #0e1015;
  --card-hover: #13161d;

  --accent: #8fa8d8;
  --accent-2: #a8bce0;
  --accent-fg: #07080b;
  --accent-soft: rgba(129, 140, 248, .12);
  --accent-line: rgba(129, 140, 248, .32);

  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;

  --sh-1: 0 1px 2px rgba(0,0,0,.5);
  --sh-2: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -8px rgba(0,0,0,.7);
  --sh-3: 0 2px 4px rgba(0,0,0,.5), 0 24px 56px -20px rgba(0,0,0,.9);
  --sh-pop: 0 8px 24px rgba(0,0,0,.6), 0 40px 100px -24px rgba(0,0,0,1);

  --glass: rgba(12, 14, 19, .68);
  --glass-line: rgba(255, 255, 255, .07);

  color-scheme: dark;
}

/* ---------- 基础 ---------- */
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 背景光晕 */
body::before {
  content: "";
  position: fixed; inset: -20% -10% auto -10%; height: 70vh;
  z-index: -1; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 0%, rgba(47, 79, 143, .05), transparent 72%);
  filter: blur(20px);
}
html[data-theme="dark"] body::before {
  background: radial-gradient(60% 50% at 50% 0%, rgba(143, 168, 216, .07), transparent 72%);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; margin: 0; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent-line); }

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

/* 滚动条 */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2); border-radius: 6px;
  border: 3px solid transparent; background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--line-3); background-clip: content-box; }

/* ============================================================
   顶栏
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 18px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--glass-line);
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 660; font-size: 14.5px; letter-spacing: -.28px;
  white-space: nowrap; flex: none;
}
.brand .mark {
  width: 27px; height: 27px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: -.3px;
  color: var(--fg);
  background: var(--bg-elev);
  border: 1px solid var(--line-3);
  box-shadow: var(--sh-1);
}
.brand .ver {
  font-size: 10px; font-weight: 700; letter-spacing: .2px;
  color: var(--accent); background: var(--accent-soft);
  padding: 1px 5px; border-radius: 5px;
}

.grow { flex: 1; }

/* 搜索按钮（其实是个假输入框，点了开命令面板） */
.searchbtn {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 8px 0 11px;
  min-width: 210px; max-width: 300px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--bg-elev); color: var(--faint);
  font-size: 13px; cursor: text; flex: none;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.searchbtn:hover { border-color: var(--line-3); color: var(--muted); }
.searchbtn svg { flex: none; opacity: .8; }
.searchbtn .txt { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 4px;
  border: 1px solid var(--line-2); border-radius: 5px;
  background: var(--bg-sunken); color: var(--faint);
  font: 600 10.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  flex: none;
}

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--bg-elev); color: var(--fg);
  font-size: 13px; font-weight: 550; letter-spacing: -.1px;
  cursor: pointer; white-space: nowrap; flex: none;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast),
              background var(--fast), border-color var(--fast), opacity var(--fast);
}
.btn:hover { background: var(--card-hover); border-color: var(--line-3); }
.btn:active { transform: scale(.975); }

/* 描边揭示按钮 —— 手法取自库内「按钮 · slimy stingray」(eduardo-amaro-maciel) */
.btn.reveal {
  position: relative; overflow: hidden; z-index: 0;
  background: transparent; border-color: var(--line-3);
  transition: color var(--norm) var(--ease), border-color var(--norm), letter-spacing var(--norm) var(--ease);
}
.btn.reveal::before {
  content: ""; position: absolute; z-index: -1;
  left: 50%; top: 100%;
  width: 160px; height: 160px; border-radius: 50%;
  background: var(--fg);
  transform: translate(-50%, 0);
  transition: top 380ms var(--ease);
}
.btn.reveal:hover { color: var(--bg); border-color: var(--fg); }
.btn.reveal:hover::before { top: 50%; transform: translate(-50%, -50%); }
.btn.primary {
  background: var(--fg); border-color: transparent; color: var(--bg);
  box-shadow: var(--sh-1);
}
.btn.primary:hover { background: var(--fg); opacity: .88; }
html[data-theme="dark"] .btn.primary { background: var(--fg); color: #07080b; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--fg); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.icon { width: 34px; padding: 0; }
.btn.icon.sm { width: 28px; }
.btn[disabled] { opacity: .45; pointer-events: none; }


/* 主题开关 —— 结构取自库内「开关 · bitter hound」(G4b413l)，配色改为本站中性色 */
.sw {
  position: relative; width: 40px; height: 22px;
  flex: none; cursor: pointer; user-select: none;
  display: inline-block;
}
.sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw .track {
  position: absolute; inset: 0;
  border-radius: 34px;
  background: var(--line-2);
  transition: background var(--norm) var(--ease);
}
.sw .knob {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.28), 0 0 0 1px rgba(0,0,0,.06);
  transition: transform var(--norm) var(--ease), box-shadow var(--norm);
}
html[data-theme="dark"] .sw .knob { background: #e8eaf0; }
.sw input:checked ~ .track { background: var(--accent); }
.sw input:checked ~ .knob { transform: translateX(18px); box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.sw input:focus-visible ~ .track { box-shadow: 0 0 0 3px var(--accent-soft); }
.sw .dot {
  position: absolute; top: 8px; left: 8px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--faint);
  transition: opacity var(--fast);
  pointer-events: none;
}
.sw .dot.on { opacity: 0; }

/* ============================================================
   布局
   ============================================================ */
.shell {
  display: flex; gap: 26px;
  max-width: 1560px; margin: 0 auto;
  padding: 22px 22px 80px;
}

.side {
  width: 196px; flex: none;
  position: sticky; top: 78px; align-self: flex-start;
  max-height: calc(100vh - 100px); overflow-y: auto;
  padding-right: 4px;
}
.side::-webkit-scrollbar { width: 0; }

.side h4 {
  margin: 0 0 6px; padding: 0 10px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .7px;
  color: var(--faint); text-transform: uppercase;
}
.side h4:not(:first-child) { margin-top: 18px; }

.cat {
  position: relative;
  display: flex; align-items: center; gap: 9px;
  height: 32px; padding: 0 10px; margin-bottom: 1px;
  border-radius: 8px;
  font-size: 13px; color: var(--muted);
  cursor: pointer; user-select: none;
  transition: background var(--fast), color var(--fast);
}
.cat::before {
  content: ""; position: absolute; left: -8px; top: 50%;
  width: 3px; height: 0; border-radius: 0 3px 3px 0;
  background: var(--accent); transform: translateY(-50%);
  transition: height var(--norm) var(--ease);
}
.cat:hover { background: var(--accent-soft); color: var(--fg); }
.cat.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cat.on::before { height: 17px; }
.cat .ico { width: 15px; display: grid; place-items: center; opacity: .75; flex: none; }
.cat.on .ico { opacity: 1; }
.cat .n {
  margin-left: auto;
  font-size: 11px; font-variant-numeric: tabular-nums;
  color: var(--faint); font-weight: 500;
}
.cat.on .n { color: var(--accent); }

.side .sep {
  height: 1px; margin: 12px 10px;
  background: var(--line);
}

.main { flex: 1; min-width: 0; }

/* ============================================================
   工具栏
   ============================================================ */
.bar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.bar .head { display: flex; align-items: baseline; gap: 9px; min-width: 0; }
.bar h1 {
  margin: 0; font-size: 22px; font-weight: 680;
  letter-spacing: -.7px; line-height: 1.2;
}
.bar .count {
  font-size: 12.5px; color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.segmented {
  display: inline-flex; align-items: center;
  padding: 2px; gap: 1px;
  border: 1px solid var(--line-2); border-radius: 9px;
  background: var(--bg-sunken);
}
.segmented .chip {
  height: 26px; padding: 0 11px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted);
  font-size: 12.5px; font-weight: 550; cursor: pointer;
  transition: background var(--fast), color var(--fast), box-shadow var(--fast);
}
.segmented .chip:hover { color: var(--fg); }
.segmented .chip.on {
  background: var(--bg-elev); color: var(--fg);
  box-shadow: var(--sh-1);
}

/* ============================================================
   网格
   ============================================================ */
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  align-items: stretch;
}

.tile {
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  transition: transform var(--norm) var(--ease),
              box-shadow var(--norm) var(--ease),
              border-color var(--norm);
  animation: tileIn 420ms var(--ease) both;
}
@keyframes tileIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.tile::after {
  content: ""; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none; z-index: 3;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
  opacity: 1;
}
html[data-theme="dark"] .tile::after {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--sh-2), 0 0 0 3px var(--accent-soft);
}

.tile .frame {
  position: relative; height: 152px; flex: none;
  overflow: hidden;
  background-color: var(--bg-sunken);
  background-image:
    linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%),
    linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}
.tile .frame iframe {
  width: 100%; height: 100%; border: 0; display: block;
  pointer-events: none;
}
.tile .frame.dark {
  background-color: #0b0d12;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.05) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.05) 75%),
    linear-gradient(45deg, rgba(255,255,255,.05) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.05) 75%);
}

/* 悬停操作层 */
.tile .acts {
  position: absolute; inset: auto 0 0 0; z-index: 4;
  display: flex; gap: 6px; padding: 8px;
  background: linear-gradient(to top, rgba(0,0,0,.5), transparent);
  opacity: 0; transform: translateY(6px);
  transition: opacity var(--fast), transform var(--fast) var(--ease);
}
.tile:hover .acts { opacity: 1; transform: none; }
.tile .acts .btn {
  height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 7px;
  background: rgba(255,255,255,.94); color: #0b0d12;
  border-color: transparent; backdrop-filter: blur(8px);
  font-weight: 600;
}
.tile .acts .btn:hover { background: #fff; }
.tile .acts .spacer { flex: 1; }

.tile .info {
  padding: 10px 12px 11px;
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
  min-height: 54px; justify-content: center;
}
.tile .title {
  font-size: 12.8px; font-weight: 570; letter-spacing: -.15px;
  line-height: 1.35; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile .by {
  font-size: 11px; color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.tile .badge {
  position: absolute; top: 8px; left: 8px; z-index: 4;
  display: inline-flex; align-items: center; gap: 3px;
  height: 19px; padding: 0 7px; border-radius: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .1px;
  background: var(--fg); color: var(--bg);
  box-shadow: var(--sh-1);
}
.tile .badge.tw {
  left: auto; right: 8px;
  background: var(--bg-elev); color: var(--muted);
  border: 1px solid var(--line-2); box-shadow: var(--sh-1);
}

/* ============================================================
   骨架屏
   ============================================================ */
.skel {
  height: 208px; border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--card);
  position: relative; overflow: hidden;
}
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ============================================================
   详情页
   ============================================================ */
.detail { animation: fadeUp 380ms var(--ease) both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.detail-head { margin-bottom: 18px; }
.detail-head h1 {
  margin: 0 0 8px;
  font-size: 27px; font-weight: 700;
  letter-spacing: -.9px; line-height: 1.25;
}
.detail-head .sub {
  display: flex; align-items: center; gap: 9px;
  flex-wrap: wrap; font-size: 12.5px; color: var(--muted);
}
.detail-head .sub .dot { opacity: .4; }
.detail-head .tags {
  display: flex; gap: 5px; flex-wrap: wrap; margin-top: 11px;
}
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 600; letter-spacing: -.1px;
}

/* 宽屏双栏 */
.detail-body { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 1180px) {
  .detail-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .detail-body .col-preview { position: sticky; top: 78px; }
}

.stage {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; background: var(--card); box-shadow: var(--sh-1);
}
.stage-bar {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--faint); font-weight: 550;
}
.stage-bar .grow { flex: 1; }
.stage-frame {
  height: 400px;
  background-color: var(--bg-sunken);
  background-image:
    linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%),
    linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}
.stage-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* 代码区 */
.codepane {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--card); box-shadow: var(--sh-1);
  overflow: hidden;
}
.code-tabs {
  display: flex; align-items: center; gap: 2px;
  padding: 0 8px; height: 40px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-sunken);
}
.code-tab {
  height: 26px; padding: 0 11px; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted);
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.code-tab:hover { color: var(--fg); background: var(--line); }
.code-tab.on {
  background: var(--bg-elev); color: var(--accent);
  box-shadow: var(--sh-1);
}

.code-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px 7px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.code-bar .grow { flex: 1; }

.codepane pre {
  margin: 0; padding: 16px 18px;
  overflow: auto; max-height: 520px;
  font: 12.3px/1.72 ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  color: var(--fg-2); tab-size: 2;
  background: var(--bg-elev);
}
.codepane pre::-webkit-scrollbar { width: 9px; height: 9px; }

/* ============================================================
   表单
   ============================================================ */
.panel {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--card); box-shadow: var(--sh-1);
  overflow: hidden;
}
.panel .hd { padding: 20px 22px 0; }
.panel .hd h2 {
  margin: 0 0 5px; font-size: 18px; font-weight: 680; letter-spacing: -.4px;
}
.panel .hd p { margin: 0; color: var(--muted); font-size: 13px; }
.panel .bd { padding: 18px 22px 22px; }

.fld { display: block; margin-bottom: 15px; }
.fld > .lbl {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--fg-2);
}
.fld > .lbl em {
  font-style: normal; font-weight: 450;
  color: var(--faint); font-size: 11.5px;
}
.fld > .lbl .req { color: var(--danger); }

.inp, .fld input[type=text], .fld input[type=email], .fld input[type=password],
.fld textarea, .fld select {
  width: 100%; height: 36px; padding: 0 11px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--bg-elev); color: var(--fg);
  font: inherit; font-size: 13px;
  outline: none;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.fld textarea {
  height: auto; padding: 10px 12px; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.3px; line-height: 1.7; tab-size: 2;
}
.fld input:focus, .fld textarea:focus, .fld select:focus, .inp:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--bg-elev);
}
.fld input::placeholder, .fld textarea::placeholder { color: var(--faint); }

.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

.err { color: var(--danger); font-size: 12.5px; min-height: 18px; margin-top: 8px; }
.hint { font-size: 11.5px; color: var(--faint); }

/* ============================================================
   审核台
   ============================================================ */
.rev-item {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); margin-bottom: 12px;
  overflow: hidden;
  transition: border-color var(--fast), box-shadow var(--fast);
  animation: fadeUp 340ms var(--ease) both;
}
.rev-item:hover { border-color: var(--line-2); box-shadow: var(--sh-1); }
.rev-item .top {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
}
.rev-item .top .t { font-weight: 620; font-size: 13.5px; letter-spacing: -.15px; }
.rev-item .top .grow { flex: 1; }
.rev-item .pv {
  height: 128px; overflow: hidden;
  background-color: var(--bg-sunken);
  background-image:
    linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%),
    linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
}
.rev-item .pv iframe { width: 100%; height: 128px; border: 0; display: block; pointer-events: none; }
.rev-item .acts {
  display: flex; gap: 8px; padding: 10px 14px;
  border-top: 1px solid var(--line); background: var(--bg-sunken);
}
.rev-item .acts .grow { flex: 1; }

.status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .2px;
  padding: 2px 7px; border-radius: 5px;
}
.status::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}
.status.pending { background: rgba(217,119,6,.12); color: var(--warn); }
.status.approved { background: rgba(5,150,105,.12); color: var(--ok); }
.status.rejected { background: rgba(220,38,38,.1); color: var(--danger); }

/* ============================================================
   命令面板
   ============================================================ */
.palette-mask {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  background: rgba(8, 9, 12, .42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity var(--norm);
}
.palette-mask.on { opacity: 1; pointer-events: auto; }

.palette {
  width: min(620px, calc(100vw - 32px));
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background: var(--bg-elev); box-shadow: var(--sh-pop);
  overflow: hidden;
  transform: scale(.97) translateY(-8px);
  transition: transform var(--norm) var(--ease);
}
.palette-mask.on .palette { transform: none; }

.palette .in {
  display: flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 16px;
  border-bottom: 1px solid var(--line);
}
.palette .in svg { color: var(--faint); flex: none; }
.palette .in input {
  flex: 1; height: 100%; border: 0; background: none; outline: none;
  color: var(--fg); font: inherit; font-size: 15px; letter-spacing: -.2px;
}
.palette .in input::placeholder { color: var(--faint); }

.palette .res { max-height: 380px; overflow-y: auto; padding: 6px; }
.palette .res .empty-p { padding: 30px; text-align: center; color: var(--faint); font-size: 13px; }

.pitem {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 13px;
  transition: background var(--fast);
}
.pitem:hover, .pitem.sel { background: var(--accent-soft); }
.pitem .pn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem .pk { font-size: 11px; color: var(--faint); flex: none; }
.pitem .picon {
  width: 22px; height: 22px; border-radius: 6px; flex: none;
  display: grid; place-items: center; font-size: 11px;
  background: var(--accent-soft); color: var(--accent);
}
.palette .foot {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; border-top: 1px solid var(--line);
  background: var(--bg-sunken);
  font-size: 11px; color: var(--faint);
}
.palette .foot .grow { flex: 1; }

/* ============================================================
   杂项
   ============================================================ */
.empty {
  text-align: center; padding: 80px 20px; color: var(--faint);
  animation: fadeUp 400ms var(--ease) both;
}
.empty .big {
  font-size: 34px; margin-bottom: 14px;
  filter: grayscale(.3); opacity: .8;
}
.empty .t { font-size: 14px; color: var(--muted); margin: 0 0 4px; }
.empty .s { font-size: 12.5px; margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 400;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--glass); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--line-2);
  box-shadow: var(--sh-pop);
  font-size: 13px; font-weight: 550; letter-spacing: -.1px;
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 14px) scale(.96);
  transition: opacity var(--norm), transform var(--norm) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.toast .tick { color: var(--ok); font-weight: 800; }

.loadmore { display: flex; justify-content: center; padding: 28px 0; }

/* 进度条（顶部） */
#nprogress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 500;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  opacity: 0;
  transition: transform .4s var(--ease), opacity .3s;
}
#nprogress.on { opacity: 1; transform: scaleX(.7); }
#nprogress.done { opacity: 0; transform: scaleX(1); transition: transform .2s, opacity .3s .15s; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1100px) {
  .shell { gap: 18px; padding: 18px 18px 60px; }
  .side { width: 172px; }
}

@media (max-width: 880px) {
  .shell { padding: 16px 14px 50px; gap: 0; }
  .side {
    display: none;
    position: fixed; top: 56px; left: 0; right: 0; z-index: 55;
    width: auto; max-height: 70vh;
    padding: 14px; margin: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--sh-2);
  }
  .side.open { display: block; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(154px, 1fr)); gap: 10px; }
  .tile .frame { height: 122px; }
  .tile .acts { display: none; }
  .stage-frame { height: 300px; }
  .detail-head h1 { font-size: 21px; }
  .bar h1 { font-size: 19px; }
}

@media (max-width: 680px) {
  .topbar { height: auto; padding: 9px 12px; flex-wrap: wrap; row-gap: 9px; }
  .topbar .grow { display: none; }
  .searchbtn {
    order: 10; flex-basis: 100%; min-width: 0; max-width: none;
  }
  .searchbtn .kbd { display: none; }
  .shell { padding: 12px 12px 44px; }
  .panel .hd, .panel .bd { padding-left: 16px; padding-right: 16px; }
  .rev-item .pv, .rev-item .pv iframe { height: 104px; }
  .palette-mask { padding-top: 6vh; }
}

/* 减少动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
