/* MP Tool 设计系统 — 松绿色种子 / 产品向（Register: product）
   桌面侧边栏 + 移动 Tabbar；白底、单一主色、克制语义色。 */

:root {
  --bg: #ffffff;
  --surface: oklch(0.985 0.004 130);
  --panel: oklch(0.970 0.008 130);
  --ink: oklch(0.24 0.014 130);
  --muted: oklch(0.47 0.018 130);
  --faint: oklch(0.55 0.016 130);
  --border: oklch(0.905 0.008 130);
  --border-strong: oklch(0.86 0.012 130);

  --primary: oklch(0.52 0.105 128);
  --primary-hover: oklch(0.46 0.105 128);
  --primary-soft: oklch(0.955 0.026 130);
  --primary-soft-hover: oklch(0.93 0.035 130);
  --on-primary: #ffffff;

  --danger: oklch(0.55 0.185 27);
  --danger-soft: oklch(0.962 0.02 27);
  --warn: oklch(0.60 0.125 70);
  --warn-soft: oklch(0.962 0.035 80);
  --gold: oklch(0.68 0.115 82);
  --gold-soft: oklch(0.965 0.045 90);
  --gold-fg: oklch(0.5 0.11 75);
  --gold-border: oklch(0.9 0.05 90);

  /* 半透明/实心浮层与提示（深色模式下由 [data-mode="dark"] 覆盖） */
  --bar-bg: oklch(1 0 0 / 0.92);
  --mask: oklch(0.2 0.02 150 / 0.35);
  --overlay: oklch(0.2 0.02 130 / 0.4);
  --solid: var(--ink);
  --solid-fg: #ffffff;
  --solid-btn: oklch(1 0 0 / 0.14);
  --solid-btn-hover: oklch(1 0 0 / 0.24);
  --on-accent: #ffffff;

  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 1px 2px oklch(0.2 0.02 130 / 0.04), 0 4px 14px oklch(0.2 0.02 130 / 0.05);
  --z-modal: 50; --z-toast: 60; --z-tabbar: 40;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, "JetBrains Mono", monospace;
}

/* 墨蓝：与松绿同结构，主色改为蓝 */
html[data-theme="ink"] {
  --surface: oklch(0.985 0.004 250);
  --panel: oklch(0.970 0.008 250);
  --ink: oklch(0.24 0.016 255);
  --muted: oklch(0.47 0.02 255);
  --faint: oklch(0.55 0.018 255);
  --border: oklch(0.905 0.01 250);
  --border-strong: oklch(0.86 0.014 250);
  --primary: oklch(0.48 0.13 255);
  --primary-hover: oklch(0.42 0.13 255);
  --primary-soft: oklch(0.955 0.024 250);
  --primary-soft-hover: oklch(0.93 0.034 250);
  --shadow: 0 1px 2px oklch(0.2 0.02 255 / 0.04), 0 4px 14px oklch(0.2 0.02 255 / 0.05);
}

/* 深色模式：用户可在侧栏/顶栏自行切换（localStorage: mp_mode） */
html[data-mode="dark"] {
  --bg: oklch(0.185 0.010 130);
  --surface: oklch(0.215 0.012 130);
  --panel: oklch(0.245 0.014 130);
  --ink: oklch(0.93 0.006 130);
  --muted: oklch(0.73 0.012 130);
  --faint: oklch(0.61 0.012 130);
  --border: oklch(0.315 0.014 130);
  --border-strong: oklch(0.40 0.016 130);
  --primary: oklch(0.74 0.13 128);
  --primary-hover: oklch(0.80 0.13 128);
  --primary-soft: oklch(0.30 0.05 130);
  --primary-soft-hover: oklch(0.35 0.06 130);
  --on-primary: oklch(0.16 0.02 130);
  --danger: oklch(0.70 0.17 27);
  --danger-soft: oklch(0.30 0.07 27);
  --warn: oklch(0.79 0.13 70);
  --warn-soft: oklch(0.33 0.06 80);
  --gold: oklch(0.79 0.12 85);
  --gold-soft: oklch(0.32 0.06 90);
  --gold-fg: oklch(0.86 0.10 85);
  --gold-border: oklch(0.42 0.07 90);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.45), 0 6px 20px oklch(0 0 0 / 0.35);
  --bar-bg: oklch(0.175 0.010 130 / 0.92);
  --mask: oklch(0 0 0 / 0.55);
  --overlay: oklch(0 0 0 / 0.62);
  --solid: oklch(0.90 0.006 130);
  --solid-fg: oklch(0.22 0.015 130);
  --solid-btn: oklch(0 0 0 / 0.12);
  --solid-btn-hover: oklch(0 0 0 / 0.20);
  --on-accent: oklch(0.18 0.02 130);
  color-scheme: dark;
}
html[data-theme="ink"][data-mode="dark"] {
  --surface: oklch(0.205 0.014 258);
  --panel: oklch(0.235 0.016 258);
  --ink: oklch(0.93 0.008 255);
  --muted: oklch(0.74 0.014 255);
  --faint: oklch(0.62 0.014 255);
  --border: oklch(0.31 0.018 258);
  --border-strong: oklch(0.40 0.020 258);
  --primary: oklch(0.74 0.13 255);
  --primary-hover: oklch(0.80 0.13 255);
  --primary-soft: oklch(0.30 0.055 258);
  --primary-soft-hover: oklch(0.35 0.065 258);
  --shadow: 0 1px 2px oklch(0 0 0 / 0.45), 0 6px 20px oklch(0 0 0 / 0.38);
  --bar-bg: oklch(0.19 0.014 258 / 0.92);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.6;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3 { margin: 0; line-height: 1.35; text-wrap: balance; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
img { display: block; }

/* ---------- Shell：桌面侧边栏 / 移动端顶栏+Tabbar ---------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 232px; z-index: 30;
  background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--primary);
  color: var(--on-primary); display: grid; place-items: center; flex: none;
}
.brand-name { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: -2px; }
.nav { display: flex; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-radius: var(--radius-s); color: var(--muted); font-weight: 500;
  transition: background .18s ease, color .18s ease; cursor: pointer;
}
.nav a:hover { background: var(--panel); color: var(--ink); }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.nav a svg { flex: none; }
.side-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--border); }

.main { margin-left: 232px; padding: 28px 32px 48px; max-width: 1180px; }
.topbar { display: none; }

.tabbar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-tabbar);
  background: var(--bar-bg); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-inner { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; height: 56px; }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0;
  color: var(--faint); font-size: 10.5px; cursor: pointer; transition: color .18s ease;
}
.tab.active { color: var(--primary); }

.menu-btn { display: none; }
.menu-mask { display: none; }
@media (max-width: 1023px) {
  .menu-btn { display: grid; }
  .menu-mask { display: block; position: fixed; inset: 0; z-index: 25; background: var(--mask); }
  .sidebar {
    display: flex; transform: translateX(-100%);
    transition: transform .2s ease; z-index: 35;
    padding-top: calc(16px + env(safe-area-inset-top));
  }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; padding: 16px 16px 96px; max-width: 100%; }
  .topbar {
    display: flex; align-items: center; gap: 10px; padding: 10px 16px;
    position: sticky; top: 0; z-index: 20; background: var(--bar-bg);
    backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
  }
  .topbar .brand-name { font-size: 15px; }
  .tabbar { display: block; }
}
@media (min-width: 1024px) { .tabbar { display: none; } }

/* 顶部导航：同一套颜色，导航从左侧改到顶栏 */
.shell-top .sidebar {
  inset: 0 0 auto 0; width: auto; height: 64px; flex-direction: row; align-items: center;
  padding: 0 18px; gap: 8px; border-right: none; border-bottom: 1px solid var(--border);
}
.shell-top .brand { padding: 0 8px 0 0; }
.shell-top .nav { flex-direction: row; flex: 1; min-width: 0; overflow-x: auto; gap: 2px; }
.shell-top .nav a { white-space: nowrap; padding: 7px 10px; }
.shell-top .side-foot { margin-top: 0; padding: 0 0 0 8px; border-top: none; flex: none; }
.shell-top .side-foot .btn { margin-bottom: 0 !important; }
.shell-top .main { margin-left: 0; padding-top: 88px; }
@media (max-width: 1023px) {
  .shell-top .sidebar { height: auto; flex-direction: column; align-items: stretch; border-bottom: none; }
  .shell-top .nav { flex-direction: column; overflow: visible; }
  .shell-top .side-foot { padding: 10px; border-top: 1px solid var(--border); }
  .shell-top .side-foot .btn { margin-bottom: 10px !important; }
  .shell-top .main { padding-top: 16px; }
}

/* 墨蓝：与松绿同一套侧栏，整栏贴底，贴住屏幕右边缘 */
@media (min-width: 1024px) {
  html[data-theme="ink"] .sidebar {
    left: auto; right: 0;
    border-right: none; border-left: 1px solid var(--border);
  }
  html[data-theme="ink"] .main { margin-left: 0; margin-right: 232px; max-width: none; }
  html[data-theme="ink"] .batch-bar {
    left: 0; right: 232px; transform: none; margin: 0 auto; width: max-content;
  }
}
@media (max-width: 1023px) {
  html[data-theme="ink"] .sidebar { inset: 0 0 0 auto; transform: translateX(100%); }
  html[data-theme="ink"] .sidebar.open { transform: none; }
  html[data-theme="ink"] .main { margin-left: 0; margin-right: 0; }
}

/* 墨蓝即维吾尔语：整站从右到左，菜单仍在右侧 */
@font-face {
  font-family: "Alpsoft Tor";
  src: url("/static/fonts/AlpsoftTor.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
html[data-theme="ink"] { direction: rtl; }
html[data-theme="ink"] body {
  font-family: "Alpsoft Tor", "UKIJ Tuz Tom", "Microsoft Uighur", var(--font);
}

/* ---------- 站点未授权全屏遮罩 ---------- */
.auth-overlay {
  position: fixed; inset: 0; z-index: 55;   /* 盖过页面全部元件，低于 toast(60) 以便反馈可见 */
  background: var(--surface);
  display: grid; place-items: center; padding: 24px;
}
.auth-overlay-card {
  width: 100%; max-width: 400px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 34px 28px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  animation: pop .2s cubic-bezier(0, 0, 0.2, 1);
}
.auth-overlay-icon {
  width: 54px; height: 54px; border-radius: 14px; margin-bottom: 14px;
  background: var(--danger-soft); color: var(--danger);
  display: grid; place-items: center;
}
.auth-overlay-card h2 { font-size: 18px; font-weight: 680; letter-spacing: -0.01em; }
.auth-overlay-card p { color: var(--muted); font-size: 13.5px; margin-top: 7px; line-height: 1.7; }
.auth-overlay-card p b { color: var(--ink); font-weight: 620; }
.auth-overlay-btns { display: flex; gap: 10px; margin-top: 22px; width: 100%; }
.auth-overlay-btns .btn, .auth-overlay-btns a.btn { flex: 1; }

/* ---------- 通用元件 ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 650; letter-spacing: -0.015em; }
.page-desc { color: var(--muted); font-size: 13px; margin-top: 3px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 15px; border-radius: var(--radius-s);
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--ink);
  font-size: 13.5px; font-weight: 550; cursor: pointer; user-select: none;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface); border-color: var(--faint); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn.soft:hover { background: var(--primary-soft-hover); }
.btn.danger-soft { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-s); border: none; background: transparent;
  color: var(--muted); display: inline-grid; place-items: center; cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.icon-btn:hover { background: var(--panel); color: var(--ink); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 550; color: var(--ink); }
.input, .select {
  height: 38px; padding: 0 12px; border-radius: var(--radius-s); border: 1px solid var(--border-strong);
  background: var(--bg); color: var(--ink); font-size: 14px; font-family: inherit; width: 100%;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
textarea.input { height: auto; padding: 10px 12px; min-height: 72px; }

.card {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
}
.card.pad { padding: 20px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 550;
}
.chip.gray { background: var(--panel); color: var(--muted); }
.chip.green { background: var(--primary-soft); color: var(--primary); }
.chip.red { background: var(--danger-soft); color: var(--danger); }
.chip.gold { background: var(--gold-soft); color: var(--gold-fg); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: start; font-size: 12px; font-weight: 600; color: var(--faint);
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }

.mono { font-family: var(--mono); font-size: 12.5px; }
html[data-theme="ink"] .mono,
html[data-theme="ink"] code,
html[data-theme="ink"] .demo-link,
html[data-theme="ink"] .demo-row {
  direction: ltr; unicode-bidi: isolate; text-align: left;
}
.demo-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.demo-link { flex: 1; min-width: 220px; background: var(--panel); padding: 9px 12px; border-radius: 8px; word-break: break-all; }

/* ---------- 骨架/空态 ---------- */
.skel {
  border-radius: var(--radius-s); background: linear-gradient(90deg, var(--panel) 25%, var(--surface) 45%, var(--panel) 65%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 56px 20px; color: var(--muted); text-align: center;
}
.empty svg { color: var(--border-strong); }
.empty .btn { margin-top: 6px; }

/* ---------- 弹窗 / 提示 ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: var(--z-modal); background: var(--overlay);
  display: grid; place-items: center; padding: 20px; animation: fade .18s ease;
}
.modal {
  width: 100%; max-width: 420px; background: var(--bg); border-radius: 14px;
  box-shadow: var(--shadow); padding: 22px; animation: pop .2s cubic-bezier(0, 0, 0.2, 1);
  max-height: 86vh; overflow: auto;
}
.modal h3 { font-size: 16px; font-weight: 650; margin-bottom: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }

.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: var(--z-toast); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 550;
  background: var(--solid); color: var(--solid-fg); box-shadow: var(--shadow);
  animation: pop .2s cubic-bezier(0, 0, 0.2, 1); max-width: 86vw;
}
.toast.err { background: var(--danger); color: var(--on-accent); }
.toast.ok { background: var(--primary); color: var(--on-accent); }

/* ---------- 登录页 ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 28px 16px;
  background:
    radial-gradient(900px 420px at 50% -10%, var(--primary-soft), transparent 70%),
    var(--surface);
}
.auth-card { width: 100%; max-width: 420px; background: var(--bg); border: 1px solid var(--border); border-radius: 18px; padding: 32px 28px 26px; box-shadow: var(--shadow); }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 22px; text-align: center; }
.auth-brand .brand-mark { width: 48px; height: 48px; border-radius: 15px; box-shadow: 0 8px 18px oklch(0.52 0.105 128 / 0.22); }
.auth-brand h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.auth-brand p { color: var(--muted); font-size: 13px; }
.auth-note { margin: -6px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--panel); border-radius: 12px; padding: 4px; margin-bottom: 20px; gap: 2px; }
.seg button {
  height: 32px; border: none; background: transparent; border-radius: 7px; font-size: 13px;
  font-weight: 550; color: var(--muted); cursor: pointer; transition: all .18s ease;
}
.seg button.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px oklch(0.2 0.02 130 / 0.1); }
.auth-foot { display: flex; justify-content: flex-end; margin: -4px 0 14px; }
.auth-link {
  border: none; background: none; padding: 0; color: var(--primary); font-size: 13px;
  font-weight: 560; cursor: pointer;
}
.auth-link:hover { text-decoration: underline; }
.code-row { display: flex; gap: 8px; align-items: center; }
.code-row .input { flex: 1; min-width: 0; }
.code-row .btn { flex: none; min-width: 108px; }
.auth-qrbox {
  width: 220px; height: 220px; margin: 4px auto 14px; border: 1px solid var(--border);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  background: var(--bg); box-shadow: inset 0 0 0 8px var(--surface);
}
.auth-qrbox img { width: 188px; height: 188px; border-radius: 8px; background: #fff; object-fit: contain; }
.auth-qr { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 6px 0 2px; }
.auth-qr img { width: 190px; height: 190px; border-radius: 10px; border: 1px solid var(--border); }
.qr-tip { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.qr-tip.ok { color: var(--primary); font-weight: 600; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ---------- 账号卡片 ---------- */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.acc-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; transition: border-color .18s ease, box-shadow .18s ease; cursor: pointer; }
.acc-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.acc-top { display: flex; gap: 12px; align-items: center; }
.avatar { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--panel); flex: none; }
.avatar.ph { display: grid; place-items: center; color: var(--on-primary); font-weight: 650; font-size: 20px; background: var(--primary); }
.acc-name { font-weight: 620; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-alias { color: var(--faint); font-size: 12.5px; margin-top: 1px; }
.acc-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 76px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 1px;
}
.stat b { font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--faint); }
.acc-foot { display: flex; align-items: center; gap: 8px; }

/* ---------- 资源列表 ---------- */
.res-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.type-seg { display: inline-flex; background: var(--panel); border-radius: 10px; padding: 3px; }
.type-seg button {
  height: 32px; padding: 0 16px; border: none; background: transparent; border-radius: 8px;
  font-size: 13px; font-weight: 550; color: var(--muted); cursor: pointer; transition: all .18s ease;
}
.type-seg button.on { background: var(--bg); color: var(--ink); box-shadow: 0 1px 3px oklch(0.2 0.02 130 / 0.1); }
.res-search { flex: 1; min-width: 180px; max-width: 340px; }
.res-list { display: flex; flex-direction: column; }
.res-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border-bottom: 1px solid var(--border); transition: background .15s ease;
}
.res-row:hover { background: var(--surface); }
.res-row:last-child { border-bottom: none; }
.res-check { flex: none; width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.res-cover {
  width: 76px; height: 43px; border-radius: 8px; object-fit: cover; background: var(--panel); flex: none;
  display: grid; place-items: center; color: var(--border-strong); overflow: hidden;
}
.res-body { flex: 1; min-width: 0; }
.res-title { font-weight: 560; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-meta { display: flex; gap: 10px; color: var(--faint); font-size: 12px; margin-top: 2px; align-items: center; }
.res-vid { font-family: var(--mono); font-size: 11.5px; color: var(--faint); cursor: pointer; }
.res-vid:hover { color: var(--primary); }
.res-actions { display: flex; gap: 6px; flex: none; }
.res-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; color: var(--muted); font-size: 13px; }
.pager { display: flex; gap: 8px; align-items: center; }
.batch-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 72px; z-index: 35;
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--solid); color: var(--solid-fg); border-radius: 12px; box-shadow: var(--shadow);
  animation: pop .2s ease; max-width: 94vw; flex-wrap: wrap;
}
.batch-bar .btn { border-color: transparent; background: var(--solid-btn); color: var(--solid-fg); }
.batch-bar .btn:hover { background: var(--solid-btn-hover); }
.batch-bar .cnt { font-size: 13px; font-weight: 600; padding: 0 4px; }
@media (min-width: 1024px) { .batch-bar { bottom: 24px; } }
@media (max-width: 640px) {
  .res-actions { flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
  .res-actions .btn { padding: 0 8px; height: 26px; font-size: 11px; }
  .res-cover { width: 64px; height: 38px; }
  .res-title { font-size: 12.5px; }
  .res-row { padding: 8px 10px; gap: 8px; }
}

/* ---------- 电影团队海报 ---------- */
.movie-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.movie-card { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.movie-poster { position: relative; aspect-ratio: 16 / 9; background: var(--panel); display: grid; place-items: center; overflow: hidden; }
.movie-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.movie-fallback { font-size: 42px; font-weight: 700; color: var(--faint); }
.movie-price { position: absolute; inset-inline-start: 8px; bottom: 8px; background: oklch(0.2 0.02 130 / 0.82); color: #fff; border-radius: 8px; padding: 2px 7px; font-size: 12px; }
.movie-body { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.movie-body h3 { margin: 0; font-size: 13px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.movie-body p { margin: 0; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.movie-actions { display: flex; gap: 6px; }
.movie-body .input { height: 32px; }
.movie-card { transition: transform .16s ease, box-shadow .16s ease; }
.movie-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.movie-poster { background: linear-gradient(180deg, var(--surface), var(--panel)); }
.movie-poster::after { content: ""; position: absolute; inset: auto 0 0; height: 42%; background: linear-gradient(transparent, oklch(0.16 0.02 130 / 0.55)); pointer-events: none; }
.movie-actions .btn { flex: 1; }
.pay-modal { max-width: 360px; text-align: center; }
.pay-modal h3 { margin: 12px 0 4px; }
.pay-qr { width: 220px; height: 220px; display: block; margin: 0 auto; background: #fff; border-radius: 12px; padding: 8px; }
.pay-amount { display: block; color: var(--primary); font-size: 22px; margin-bottom: 6px; }
.pay-modal p { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.team-mine { display: flex; flex-direction: column; gap: 14px; }
.team-add { display: grid; grid-template-columns: minmax(180px, 1fr) 180px auto; gap: 8px; align-items: center; }
.team-accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.team-account { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
.team-account.on { border-color: var(--primary); }
.team-account b { grid-column: 1 / -1; }
.team-account span { color: var(--muted); font-size: 12.5px; }
.team-note { margin: 0; color: var(--muted); font-size: 12.5px; }
.movie-edit .movie-poster { aspect-ratio: 16 / 10; }
.movie-edit .movie-body { gap: 5px; padding: 7px; }
.movie-edit .input { height: 30px; font-size: 12.5px; padding: 0 8px; }
.movie-edit .btn { height: 30px; }
.movie-code { margin: 0; color: var(--faint); font-size: 11px; font-family: var(--mono, monospace); }
.market-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); }
.market-balance { display: flex; flex-direction: column; min-width: 92px; }
.market-balance span { color: var(--faint); font-size: 11px; }
.market-balance b { font-size: 16px; }
.market-tabs { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface); }
.market-tabs button { height: 30px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.market-tabs button.on { background: var(--bg); color: var(--ink); box-shadow: var(--shadow); }
.market-bar .btn { margin-left: auto; }
.market-card .movie-body { min-height: 86px; }
.team-notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--gold-border); border-radius: 12px; background: var(--gold-soft); color: var(--gold-fg); }
.res-offline { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--gold-border); border-radius: 12px; background: var(--gold-soft); color: var(--gold-fg); margin-bottom: 12px; }
.res-offline p { margin: 0; font-size: 12.5px; line-height: 1.7; }
.team-notice p { margin: 0; font-size: 12.5px; line-height: 1.7; }
.team-notice b { font-weight: 650; }
.team-join-card { border-color: var(--gold-border); background: var(--gold-soft); color: var(--gold-fg); }
.team-join-card p { color: var(--gold-fg); opacity: 0.85; }
.market-search { display: flex; gap: 8px; align-items: center; }
.market-search .input { max-width: 360px; }
@media (max-width: 680px) {
  .market-bar { flex-wrap: wrap; }
  .market-tabs { order: 3; width: 100%; }
  .market-tabs button { flex: 1; }
  .team-add { grid-template-columns: 1fr; }
  .movie-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .movie-body { padding: 6px; }
}
@media (min-width: 1280px) {
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}

/* ---------- 添加方式三卡片 ---------- */
.add-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 480px) { .add-cards { grid-template-columns: 1fr 1fr 1fr; } }
.add-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 16px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: border-color .18s ease, background .18s ease;
}
.add-card:hover { border-color: var(--primary); background: var(--primary-soft); }
.add-card b { font-size: 14px; }
.add-card p { font-size: 12px; color: var(--muted); line-height: 1.55; }

/* ---------- 批量复制 ---------- */
.batch-types { display: flex; flex-direction: column; gap: 7px; }
.batch-type {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.batch-type:hover { border-color: var(--primary); }
.batch-type.on { border-color: var(--primary); background: var(--primary-soft); }
.batch-type input { margin-top: 3px; accent-color: var(--primary); }
.batch-type b { font-size: 13px; display: block; }
.batch-type code {
  display: block; font-size: 11px; color: var(--faint); margin-top: 2px;
  word-break: break-all; font-family: var(--mono);
}
.chip.gold-soft { background: var(--gold-soft); color: var(--gold-fg); }

/* ---------- 自定义模板拖拽排版 ---------- */
.fchip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px;
  border-radius: 999px; font-size: 12.5px; user-select: none;
}
.fchip.add { border: 1px dashed var(--border-strong); color: var(--muted); cursor: pointer; transition: all .18s ease; }
.fchip.add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.fchip.sel {
  border: 1px solid var(--primary); background: var(--primary-soft); color: var(--primary);
  cursor: grab; font-weight: 550;
}
.fchip.sel:active { cursor: grabbing; }
.fchip.sel .mv, .fchip.sel .rm {
  cursor: pointer; opacity: .65; padding: 0 2px; font-size: 11px; line-height: 1;
}
.fchip.sel .mv:hover { opacity: 1; color: var(--ink); }
.fchip.sel .rm:hover { opacity: 1; color: var(--danger); }
.drop-zone {
  min-height: 42px; padding: 8px; border: 1.5px dashed var(--border-strong);
  border-radius: 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  background: var(--surface);
}

/* ---------- 公告条 ---------- */
.ann-bar {
  display: flex; align-items: center; gap: 9px; padding: 11px 14px; margin-bottom: 16px;
  background: var(--primary-soft); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--primary); font-size: 13px; cursor: pointer; transition: background .18s ease;
}
.ann-bar:hover { background: var(--primary-soft-hover); }
.ann-bar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 播放链接弹窗行 ---------- */
.link-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 10px; margin-bottom: 9px;
  transition: border-color .18s ease;
}
.link-row:hover { border-color: var(--primary); }

/* ---------- 设置/表单面板 ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.form-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

.vip-banner {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--gold-soft); border: 1px solid var(--gold-border); color: var(--gold-fg);
  font-size: 13px; margin-bottom: 16px;
}

/* ---------- 无障碍与动效 ---------- */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
.fade-enter-active, .fade-leave-active { transition: opacity .18s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

/* ---------- 网盘 ---------- */
.cloud-avatar {
  width: 52px; height: 52px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 650;
  background: linear-gradient(135deg, oklch(0.62 0.11 235), oklch(0.55 0.13 260));
}
.folder-cover { color: oklch(0.72 0.12 85); }
.media-cover { color: var(--primary); }
.crumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px;
  padding: 10px 14px; margin-bottom: 12px; font-size: 13px; color: var(--faint);
}
.crumb a { cursor: pointer; padding: 2px 4px; border-radius: 6px; transition: all .15s ease; white-space: nowrap; }
.crumb a:hover { color: var(--primary); background: var(--surface); }
.crumb a.cur { color: var(--ink); font-weight: 600; cursor: default; }
.crumb a.cur:hover { background: none; }
.crumb-sep { color: var(--border-strong); user-select: none; }
.cloud-space-bar {
  height: 8px; border-radius: 6px; background: var(--surface); overflow: hidden;
  border: 1px solid var(--border);
}
.cloud-space-bar i {
  display: block; height: 100%; border-radius: 6px;
  background: linear-gradient(90deg, oklch(0.62 0.13 145), oklch(0.68 0.12 110));
  transition: width .3s ease;
}
.cloud-space-bar i.full { background: oklch(0.62 0.19 25); }
.cloud-space-txt {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--muted); margin-top: 5px;
}
.cloud-space-txt b { color: var(--ink); font-variant-numeric: tabular-nums; }
.cloud-avatar-139 {
  width: 52px; height: 52px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 650;
  background: linear-gradient(135deg, oklch(0.6 0.13 250), oklch(0.52 0.15 280));
}
.cloud-avatar-123 {
  width: 52px; height: 52px; border-radius: 12px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 650;
  background: linear-gradient(135deg, oklch(0.66 0.14 55), oklch(0.58 0.16 30));
}
.switch-row {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); font-size: 13.5px; font-weight: 560;
  transition: border-color .15s ease;
}
.switch-row:hover { border-color: var(--primary); }
.switch-row input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }

/* ---------- 图片网格（公众号图片素材） ---------- */
.img-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; padding: 12px;
}
.img-card {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  cursor: pointer; background: var(--panel); transition: border-color .15s ease, transform .15s ease;
}
.img-card:hover { border-color: var(--primary); }
.img-card img { width: 100%; height: 96px; object-fit: cover; display: block; background: var(--surface); }
.img-card .nm {
  font-size: 11.5px; color: var(--muted); padding: 6px 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 640px) {
  .img-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px; }
  .img-card img { height: 72px; }
  .img-card .nm { font-size: 10.5px; padding: 4px 6px; }
}

/* ---------- 维吾尔语（墨蓝）主题美化 ---------- */
html[data-theme="ink"] body { line-height: 1.8; }
html[data-theme="ink"] .sidebar {
  background: linear-gradient(180deg, var(--panel) 0%, var(--surface) 58%, var(--panel) 100%);
}
html[data-theme="ink"] .brand-mark {
  background: linear-gradient(140deg, var(--primary) 0%, oklch(0.42 0.15 280) 100%);
  box-shadow: 0 6px 16px oklch(0.45 0.15 265 / 0.30);
}
html[data-theme="ink"] .brand-name { letter-spacing: 0; }
html[data-theme="ink"] .nav a { position: relative; }
html[data-theme="ink"] .nav a.active::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 999px; background: var(--primary);
}
html[data-theme="ink"] .page-title { font-weight: 700; letter-spacing: 0; }
html[data-theme="ink"] .card,
html[data-theme="ink"] .movie-card,
html[data-theme="ink"] .auth-card,
html[data-theme="ink"] .modal,
html[data-theme="ink"] .acc-card { border-radius: 14px; }
html[data-theme="ink"] .auth-wrap {
  background:
    radial-gradient(900px 420px at 50% -10%, var(--primary-soft), transparent 70%),
    radial-gradient(640px 360px at 100% 105%, var(--primary-soft), transparent 72%),
    var(--surface);
}
html[data-theme="ink"] .tabbar,
html[data-theme="ink"] .topbar { box-shadow: 0 8px 26px oklch(0 0 0 / 0.06); }
html[data-theme="ink"] .tab { font-size: 11px; }
html[data-theme="ink"] .chip { font-weight: 600; }

/* 深色模式：二维码一律白底，保证可扫 */
html[data-mode="dark"] .auth-qrbox img,
html[data-mode="dark"] .auth-qr img,
html[data-mode="dark"] .pay-qr { background: #fff; }


