/* ============================================================
   步跃 Step 授权中心 · 2.0 设计系统
   Aurora Rail — 深色直立导航 + 浅色工作区 + 冷蓝/青玉双主色
   说明：保留既有全部类名，页面无需改动即可继承新版外观
   ============================================================ */

:root {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --panel: rgba(255, 255, 255, .86);
  --panel-solid: #ffffff;
  --panel-2: #f5f7fc;
  --line: rgba(15, 23, 42, .08);
  --line-strong: rgba(15, 23, 42, .16);
  --txt: #0f172a;
  --txt-2: #475569;
  --muted: #5b6a82;
  --accent: #2f6bff;
  --accent-2: #00c2a8;
  --accent-soft: rgba(47, 107, 255, .10);
  --ok: #0ea472;
  --warn: #d97706;
  --bad: #e11d48;
  --shadow: 0 14px 34px rgba(15, 23, 42, .07);
  --radius: 16px;
  --radius-sm: 11px;
  --nav-w: 240px;
  --nav-mini: 76px;
  --sitebar-h: 56px;
  --rail-bg: #0d1626;
  --rail-bg-2: #12203a;
  --rail-line: rgba(255, 255, 255, .07);
  --rail-txt: #a7b6ce;
  --rail-txt-2: #6f8099;
  --rail-txt-strong: #f2f6ff;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

/* 主题变量同时挂在 body 上，便于设置页实时覆盖 */
body {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --panel: rgba(255, 255, 255, .86);
  --panel-solid: #ffffff;
  --line: rgba(15, 23, 42, .08);
  --line-strong: rgba(15, 23, 42, .16);
  --txt: #0f172a;
  --txt-2: #475569;
  --muted: #5b6a82;
  --accent: #2f6bff;
  --accent-2: #00c2a8;
  --accent-soft: rgba(47, 107, 255, .10);
  --ok: #0ea472;
  --warn: #d97706;
  --bad: #e11d48;
  --shadow: 0 14px 34px rgba(15, 23, 42, .07);
  margin: 0; min-height: 100vh; font-family: var(--font); color: var(--txt);
  background: var(--bg); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
::selection { background: rgba(47, 107, 255, .18); }
.skip-link { position: absolute; left: -999px; top: 0; background: #fff; color: #000; padding: 8px; z-index: 99; }
.skip-link:focus { left: 8px; }

/* ---------------- 背景光晕 ---------------- */
.bg-aura {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(880px 520px at 4% -12%, var(--accent-soft), transparent 62%),
    radial-gradient(720px 460px at 102% -8%, rgba(0, 194, 168, .10), transparent 62%),
    var(--bg);
}
.bg-aura::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .028) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 26% 0%, #000 0%, transparent 68%);
  mask-image: radial-gradient(ellipse at 26% 0%, #000 0%, transparent 68%);
}

/* ---------------- 吸顶工具条 ---------------- */
.site-bar {
  position: sticky; top: 0; z-index: 55; height: var(--sitebar-h);
  margin-left: var(--nav-w);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--panel); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  transition: margin-left .22s ease;
}
body.nav-mini .site-bar { margin-left: var(--nav-mini); }
.site-bar .nav-fab { display: none; }
.site-bar-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.site-bar .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
.site-bar .brand-mark .ico { width: 16px; height: 16px; }
.site-bar-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.site-bar-name { font-size: 14px; font-weight: 700; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-bar-txt em { font-style: normal; font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.site-bar-sep { width: 1px; height: 20px; background: var(--line-strong); opacity: .6; flex: 0 0 auto; }
.site-bar-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.live-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--txt-2);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.live-chip .dot { width: 6px; height: 6px; border-radius: 99px; background: var(--ok); box-shadow: 0 0 0 3px rgba(14, 164, 114, .16); }
body[data-poll="0"] .live-chip .dot { background: var(--muted); box-shadow: none; }
.tool-btn {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--txt-2); cursor: pointer;
  transition: .16s;
}
.tool-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.tool-btn .ico { width: 16px; height: 16px; }

/* ---------------- 直立式导航栏 ---------------- */
.app-nav {
  display: flex; gap: 8px; z-index: 70;
}
body.nav-side .app-nav {
  position: fixed; left: 0; top: 0; width: var(--nav-w); height: 100vh; height: 100dvh;
  padding: 16px 12px 14px; flex-direction: column; gap: 4px;
  background: linear-gradient(185deg, var(--rail-bg) 0%, var(--rail-bg-2) 100%);
  border-right: 1px solid var(--rail-line); border-radius: 0;
  color: var(--rail-txt);
  box-shadow: 12px 0 46px -30px rgba(2, 8, 23, .75);
  transition: width .22s ease, padding .22s ease, transform .26s ease;
}
.nav-head { display: flex; align-items: center; gap: 6px; min-width: 0; margin-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px; flex: 1; min-width: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 22px rgba(47, 107, 255, .38);
}
.brand-mark .ico { width: 19px; height: 19px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text b, .brand-text em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text b { font-size: 14.5px; letter-spacing: .3px; color: var(--rail-txt-strong); }
.brand-text em { font-style: normal; font-size: 10px; letter-spacing: .9px; text-transform: uppercase; color: var(--rail-txt-2); margin-top: 3px; }
.nav-toggle {
  display: none; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; padding: 0; cursor: pointer;
  border: 1px solid var(--rail-line); border-radius: 9px; background: rgba(255, 255, 255, .05);
  color: var(--rail-txt); transition: .18s;
}
.nav-toggle .ico { width: 15px; height: 15px; transition: transform .24s ease; }
.nav-toggle:hover { color: #fff; border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .1); }
.nav-fab, .nav-scrim { display: none; }
.nav-links {
  display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; padding: 0 4px;
}
.nav-links::-webkit-scrollbar { width: 6px; }
.nav-links::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 99px; }
.nav-links::-webkit-scrollbar-track { background: transparent; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group + .nav-group { margin-top: 4px; }
.nav-group-title {
  padding: 11px 10px 4px; font-size: 9.5px; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--rail-txt-2); white-space: nowrap;
}
.nav-item {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
  color: var(--rail-txt); font-size: 13px; transition: background .16s, color .16s; white-space: nowrap;
}
.nav-item .ico { width: 17px; height: 17px; flex: 0 0 auto; opacity: .85; }
.nav-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: var(--rail-txt-strong); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(47, 107, 255, .30), rgba(0, 194, 168, .12));
  color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.nav-item.active .ico { opacity: 1; }
.nav-item.active::before {
  content: ""; position: absolute; left: -4px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 99px; background: linear-gradient(180deg, #6da3ff, var(--accent-2));
  box-shadow: 0 0 12px rgba(0, 194, 168, .7);
}
.nav-extra { display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 8px; }
.nav-user {
  display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 12px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--rail-line);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); flex: 0 0 auto; font-size: 13px;
}
.nav-user-txt { display: flex; flex-direction: column; line-height: 1.2; overflow: hidden; flex: 1; }
.nav-user-txt b { font-size: 12.5px; color: var(--rail-txt-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user-txt em { font-style: normal; font-size: 10px; color: var(--rail-txt-2); }
.nav-logout { color: var(--rail-txt-2); padding: 5px; border-radius: 8px; transition: .16s; }
.nav-logout:hover { color: #fb7185; background: rgba(225, 29, 72, .14); }
.nav-logout .ico { width: 16px; height: 16px; }

/* 收起态：只留图标 */
@media (min-width: 861px) {
  body.nav-side .nav-toggle { display: grid; }
  body.nav-side.nav-mini .app-nav { width: var(--nav-mini); padding-left: 8px; padding-right: 8px; }
  body.nav-side.nav-mini .nav-head { flex-direction: column; gap: 10px; }
  body.nav-side.nav-mini .brand { justify-content: center; padding: 2px 0; }
  body.nav-side.nav-mini .brand-text,
  body.nav-side.nav-mini .nav-group-title,
  body.nav-side.nav-mini .nav-user-txt,
  body.nav-side.nav-mini .nav-logout { display: none; }
  body.nav-side.nav-mini .nav-group { gap: 2px; }
  body.nav-side.nav-mini .nav-item { justify-content: center; padding: 9px 0; }
  body.nav-side.nav-mini .nav-item span { display: none; }
  body.nav-side.nav-mini .nav-item .ico { width: 19px; height: 19px; opacity: .95; }
  body.nav-side.nav-mini .nav-user { justify-content: center; padding: 0; background: transparent; border-color: transparent; }
  body.nav-side.nav-mini .nav-toggle .ico { transform: rotate(180deg); }
}

/* ---------------- 页面骨架 ---------------- */
.page-main {
  margin-left: var(--nav-w); padding: 18px 22px 30px;
  min-height: calc(100vh - var(--sitebar-h));
  transition: margin-left .22s ease;
}
body.nav-mini .page-main { margin-left: var(--nav-mini); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.page-title { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.page-eyebrow {
  display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent);
}
.page-eyebrow::before { content: ""; width: 14px; height: 2px; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.page-title h1 { margin: 0; font-size: 22px; line-height: 1.25; letter-spacing: -.3px; font-weight: 700; }
.page-title p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-body { display: flex; flex-direction: column; gap: 12px; }
.page-foot {
  display: flex; gap: 7px; justify-content: center; align-items: center; flex-wrap: wrap;
  color: var(--muted); font-size: 11px; margin-top: 22px; opacity: .85;
}
.foot-sep { opacity: .4; }

/* ---------------- 卡片与统计 ---------------- */
.card, .panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 15px; min-width: 0;
}
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -.1px; display: flex; align-items: center; gap: 8px; }
.card-head .dot-accent { width: 5px; height: 15px; border-radius: 99px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.card-head .sub { font-size: 11.5px; color: var(--muted); }
.card-head .sub.link { color: var(--accent); font-weight: 600; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; }
.kpi-grid.kpi-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-grid.kpi-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-card {
  position: relative; padding: 11px 13px 11px 16px; border-radius: 13px; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  background: var(--panel-solid); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--txt);
}
.stat-card::after {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 99px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.stat-card.ok::after { background: linear-gradient(180deg, #34d399, var(--ok)); }
.stat-card.warn::after { background: linear-gradient(180deg, #fbbf24, var(--warn)); }
.stat-card.bad::after { background: linear-gradient(180deg, #fb7185, var(--bad)); }
.stat-label { font-size: 11px; line-height: 1.35; color: var(--muted); font-weight: 600; letter-spacing: .2px; }
.stat-value { display: block; font-size: 19px; line-height: 1.25; font-weight: 700; letter-spacing: -.2px; margin: 1px 0 0; font-variant-numeric: tabular-nums; color: var(--txt); }
.stat-hint { font-size: 10.5px; line-height: 1.45; margin-top: 1px; color: var(--muted); }

/* 紧凑统计条：页头旁横向指标，替代大块卡片 */
.stat-strip {
  display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 13px;
  background: var(--panel-solid); box-shadow: var(--shadow); overflow: hidden;
}
.stat-strip .stat-card { border: 0; border-radius: 0; box-shadow: none; flex: 1 1 0; min-width: 118px; padding: 8px 14px; background: transparent; }
.stat-strip .stat-card::after { display: none; }
.stat-strip .stat-card + .stat-card { border-left: 1px dashed var(--line); }
.stat-strip .stat-value { font-size: 16px; }

/* 布局网格 */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.grid-equal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid-2 > *, .grid-equal > * { min-width: 0; }
.spacer { flex: 1; }

/* 分段切换 */
.seg-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--line); }
.seg-tab { padding: 6px 15px; border-radius: 8px; font-size: 12.5px; color: var(--txt-2); text-decoration: none; transition: .18s; }
.seg-tab.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 600; }

/* ---------------- 表单与按钮 ---------------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--txt-2); font-weight: 600; }
.field .help { font-size: 11px; color: var(--muted); }
.help { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.fold { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.fold > summary { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--txt-2); list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "+"; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 12px; line-height: 1; }
.fold[open] > summary::before { content: "−"; }
.fold .fold-body { margin-top: 10px; }
.secret-field { position: relative; display: flex; align-items: center; }
.secret-field .input { width: 100%; padding-right: 66px; letter-spacing: 1px; }
.secret-toggle { position: absolute; right: 6px; padding: 4px 9px; border: 0; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; cursor: pointer; transition: .16s; }
.secret-toggle:hover { background: rgba(47, 107, 255, .2); }
.input, .select, .textarea, .field input, .field select, .field textarea {
  width: 100%; min-width: 0; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--panel-solid); outline: none; transition: .18s; font-size: 13.5px;
}
.input:focus, .select:focus, .textarea:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.textarea { min-height: 96px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.form-grid .full { grid-column: 1 / -1; }

/* 拖拽上传 */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 20px 16px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); background: rgba(47, 107, 255, .03); text-align: center; cursor: pointer; outline: none; transition: border-color .18s, background .18s, box-shadow .18s; }
.dropzone:hover, .dropzone:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.dropzone .dz-icon { width: 30px; height: 30px; color: var(--accent); opacity: .9; }
.dropzone .dz-icon svg { width: 100%; height: 100%; }
.dropzone .dz-title { font-size: 13px; font-weight: 600; color: var(--txt); }
.dropzone .dz-title em { font-style: normal; color: var(--accent); }
.dropzone .dz-tip { font-size: 11.5px; color: var(--muted); }
.dz-files { margin-top: 8px; width: 100%; display: flex; flex-direction: column; gap: 6px; }
.dz-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); font-size: 12.5px; text-align: left; cursor: default; }
.dz-item .dz-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--txt); }
.dz-item .dz-size { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.dz-item .dz-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 6px; border-radius: 6px; transition: .16s; }
.dz-item .dz-del:hover { color: var(--bad); background: rgba(225, 29, 72, .1); }
.toolbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 9px; align-items: end; }
.toolbar .field.grow { grid-column: span 2; }
.toolbar .field-submit, .form-grid .field-submit { justify-content: flex-end; }
.toolbar .field-submit .btn, .form-grid .field-submit .btn { width: 100%; min-height: 38px; }
.toolbar .toolbar-note { align-self: end; padding-bottom: 10px; }
.toolbar-inline { margin: 0 0 11px; padding-bottom: 11px; border-bottom: 1px dashed var(--line); }
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; min-height: 24px; }
.filter-bar-txt { font-size: 12px; color: var(--muted); }
.filter-bar .btn { padding: 4px 10px; font-size: 11.5px; border-radius: 8px; }
.toolbar.is-collapsed { display: none; }
.filter-bar.is-open + .toolbar-inline { border-bottom: 1px dashed var(--line); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 8px 15px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: .16s; white-space: nowrap;
  background: var(--panel-solid); color: var(--txt); box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}
.btn .ico { width: 15px; height: 15px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  color: #fff; background: linear-gradient(135deg, #2f6bff, #1b4fd6 70%, #0f3fb5);
  box-shadow: 0 10px 22px rgba(47, 107, 255, .28);
}
.btn-primary:hover { box-shadow: 0 14px 28px rgba(47, 107, 255, .36); }
.btn-ghost { background: var(--panel-solid); border-color: var(--line-strong); color: var(--txt-2); box-shadow: none; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn-danger { background: rgba(225, 29, 72, .09); color: var(--bad); border-color: rgba(225, 29, 72, .24); box-shadow: none; }
.btn-ok { background: rgba(14, 164, 114, .1); color: var(--ok); border-color: rgba(14, 164, 114, .24); box-shadow: none; }
.btn-sm { min-height: 28px; padding: 4px 10px; font-size: 11.5px; border-radius: 8px; }
.btn-sm .ico { width: 13px; height: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* 切换 */
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 40px; height: 22px; border-radius: 99px; background: rgba(100, 116, 139, .32); transition: .2s; position: relative; flex: 0 0 auto; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 2px 6px rgba(0, 0, 0, .22); }
.switch input:checked + .track { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch input:checked + .track::after { left: 21px; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); border: 1px solid var(--line); min-width: 0; max-width: 100%; background: var(--panel-solid); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th {
  text-align: left; padding: 8px 11px; font-weight: 600; color: var(--muted); font-size: 11px;
  letter-spacing: .3px; background: var(--panel-2); white-space: nowrap; border-bottom: 1px solid var(--line);
}
tbody td { padding: 8px 11px; border-top: 1px solid var(--line); vertical-align: middle; line-height: 1.45; }
tbody tr:first-child td { border-top: 0; }
tbody tr:hover { background: rgba(47, 107, 255, .04); }
td .btn + .btn { margin-left: 4px; }
td .btn-sm { padding: 3px 8px; font-size: 11px; border-radius: 7px; min-height: 26px; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.searchbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sb-input { position: relative; flex: 1 1 auto; max-width: 380px; }
.sb-input svg {
  position: absolute; left: 11px; top: 50%; width: 15px; height: 15px;
  transform: translateY(-50%); color: var(--muted); pointer-events: none;
}
.sb-input .input { padding: 7px 12px 7px 33px; font-size: 12.5px; }
.sb-input .input::-webkit-search-cancel-button { cursor: pointer; }
.sb-count { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.plugin-list .p-code { font-size: 11px; }
.plugin-list .p-sum { font-size: 11.5px; margin-top: 1px; }
.mono { font-family: var(--mono); font-size: 12px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 600; letter-spacing: .1px; }
.badge.ok { background: rgba(14, 164, 114, .12); color: var(--ok); }
.badge.warn { background: rgba(217, 119, 6, .13); color: var(--warn); }
.badge.bad { background: rgba(225, 29, 72, .11); color: var(--bad); }
.badge.muted { background: rgba(100, 116, 139, .13); color: var(--muted); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

.empty-block { padding: 26px 16px; text-align: center; color: var(--muted); }
.empty-block .ico { width: 34px; height: 34px; margin: 0 auto 9px; opacity: .45; }
.empty-block p { margin: 0; font-size: 12.5px; }

.pager { display: flex; gap: 5px; justify-content: flex-end; align-items: center; padding: 10px 2px 0; flex-wrap: wrap; }
.pager-btn { padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; color: var(--txt-2); transition: .16s; }
.pager-btn:hover { border-color: var(--accent); color: var(--accent); }
.pager-btn.on { background: linear-gradient(135deg, var(--accent), #1b4fd6); border-color: transparent; color: #fff; }
.pager-btn.disabled { opacity: .4; pointer-events: none; }
.pager-dot { color: var(--muted); padding: 0 3px; }

/* ---------------- 提示与弹层 ---------------- */
.toast-wrap {
  position: fixed; top: 18px; top: calc(env(safe-area-inset-top, 0px) + 18px);
  left: 50%; transform: translateX(-50%); z-index: 999;
  display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none;
}
.toast {
  display: flex; gap: 9px; align-items: flex-start; padding: 11px 10px 11px 14px; border-radius: 12px;
  background: var(--panel-solid); border: 1px solid var(--line-strong); box-shadow: 0 18px 40px rgba(15, 23, 42, .14);
  font-size: 12.5px; animation: toastIn .3s ease; pointer-events: auto;
}
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; max-height: 32vh; overflow-y: auto; }
.toast-close {
  flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 7px; transition: .16s;
}
.toast-close:hover { background: rgba(100, 116, 139, .14); color: var(--txt); }
.toast.ok { border-left: 3px solid var(--ok); }
.toast.err { border-left: 3px solid var(--bad); }
.toast.warn { border-left: 3px solid var(--warn); }
.toast.info { border-left: 3px solid var(--accent); }
.toast.toast-bump { animation: toastBump .3s ease; }
@keyframes toastBump { 0% { transform: scale(1); } 45% { transform: scale(1.018); } 100% { transform: scale(1); } }
@media (max-width: 860px) {
  .toast-wrap { top: 66px; top: calc(env(safe-area-inset-top, 0px) + 66px); width: min(90vw, 380px); }
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.modal {
  position: fixed; inset: 0; z-index: 900; display: flex; align-items: center; justify-content: center;
  background: rgba(7, 13, 26, .52); backdrop-filter: blur(5px); padding: 20px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, visibility 0s linear .18s, backdrop-filter .18s ease;
}
.modal.open { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .18s ease, visibility 0s, backdrop-filter .18s ease; }
.modal-card {
  width: min(620px, 100%); max-height: 84vh; max-height: 84dvh; overflow: auto; background: var(--panel-solid);
  border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 30px 80px rgba(7, 13, 26, .34); padding: 22px;
  opacity: .55; transform: translateY(14px) scale(.985);
  transition: transform .24s cubic-bezier(.16, .84, .44, 1), opacity .2s ease;
}
.modal.open .modal-card { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .modal, .modal-card { transition: none; }
}
@keyframes pageFadeIn { from { opacity: .35; } to { opacity: 1; } }
.page-main.page-enter { animation: pageFadeIn .2s ease; }
@media (prefers-reduced-motion: reduce) {
  .page-main.page-enter { animation: none; }
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 16px; letter-spacing: -.2px; }
.modal-close { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; padding: 4px 6px; border-radius: 8px; }
.modal-close:hover { background: rgba(100, 116, 139, .12); color: var(--txt); }

.license-banner {
  display: flex; gap: 10px; align-items: center; padding: 11px 14px; border-radius: 12px;
  background: rgba(217, 119, 6, .09); border: 1px solid rgba(217, 119, 6, .26); color: var(--warn); font-size: 12.5px; margin-bottom: 14px;
}
.license-banner .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--warn); animation: pulse 1.6s infinite; }
.license-banner a { color: inherit; text-decoration: underline; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------------- 业务组件 ---------------- */
.segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.seg-card {
  padding: 13px 15px; border-radius: 13px; border: 1px solid var(--line-strong); cursor: pointer;
  background: var(--panel-solid); transition: .18s; position: relative;
}
.seg-card input { position: absolute; opacity: 0; }
.seg-card.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.seg-card b { display: block; font-size: 13.5px; }
.seg-card span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.seg-card .tag { position: absolute; right: 12px; top: 12px; font-size: 10px; padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

.result-panel { display: none; margin-top: 16px; }
.result-panel.show { display: block; animation: fadeUp .3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.result-head { display: flex; align-items: center; gap: 10px; }
.result-ok { color: var(--ok); font-weight: 700; }
.result-bad { color: var(--bad); font-weight: 700; }
.kv-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.kv { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; }
.kv span { display: block; font-size: 11px; color: var(--muted); }
.kv b { font-size: 13.5px; word-break: break-all; }
.code-block {
  background: #0c1628; color: #cbd5e1; border-radius: 11px; padding: 13px;
  font-family: var(--mono); font-size: 12px; overflow: auto; max-height: 320px; white-space: pre-wrap; word-break: break-all;
}

.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 136px; padding-top: 8px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 42px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); min-height: 4px; transition: height .5s ease; }
.chart-col .lbl { font-size: 11px; color: var(--muted); }
.chart-col .val { font-size: 11px; color: var(--txt-2); font-variant-numeric: tabular-nums; }

/* ---------------- 登录页 2.0 ---------------- */
.auth-stage {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  background: var(--bg);
}
.auth-brand {
  position: relative; overflow: hidden; padding: 46px 52px; display: flex; flex-direction: column; justify-content: space-between;
  color: #eaf0fb; background:
    radial-gradient(620px 420px at 12% 8%, rgba(47, 107, 255, .45), transparent 62%),
    radial-gradient(560px 420px at 92% 96%, rgba(0, 194, 168, .26), transparent 64%),
    linear-gradient(160deg, #0c1526, #122443 70%, #0f1c33);
}
.auth-brand::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 46px 46px; opacity: .5;
  -webkit-mask-image: radial-gradient(ellipse at 40% 30%, #000, transparent 72%);
  mask-image: radial-gradient(ellipse at 40% 30%, #000, transparent 72%);
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .brand { padding: 0; flex: 0 0 auto; }
.auth-brand .brand-text b { font-size: 16px; }
.auth-brand-hero { margin: 40px 0 auto; }
.auth-brand-hero h2 { margin: 0 0 12px; font-size: 30px; line-height: 1.25; letter-spacing: -.8px; color: #fff; }
.auth-brand-hero h2 em { font-style: normal; background: linear-gradient(90deg, #79a8ff, #2ce0c6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-brand-hero p { margin: 0; max-width: 420px; color: #9fb0cb; font-size: 13.5px; line-height: 1.75; }
.auth-points { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.auth-point { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #c6d3e8; }
.auth-point i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: rgba(255, 255, 255, .08); color: #6fe0cd; font-style: normal; flex: 0 0 auto; }
.auth-point i .ico { width: 13px; height: 13px; }
.auth-brand-foot { font-size: 11px; color: #7487a4; letter-spacing: .3px; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-panel-inner { width: min(392px, 100%); }
.auth-kicker { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.auth-panel h1 { margin: 14px 0 4px; font-size: 24px; letter-spacing: -.5px; }
.auth-panel .auth-sub { margin: 0 0 22px; color: var(--muted); font-size: 12.5px; }
.auth-panel form { display: flex; flex-direction: column; gap: 12px; }
.auth-panel .field label { font-size: 11.5px; letter-spacing: .2px; }
.auth-panel .btn-primary { min-height: 42px; font-size: 14px; margin-top: 4px; }
.auth-note { margin-top: 18px; font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.7; }
.auth-note b { color: var(--txt-2); }
@media (max-width: 900px) {
  .auth-stage { grid-template-columns: 1fr; }
  .auth-brand { padding: 26px 22px 22px; gap: 14px; }
  .auth-brand-hero { margin: 8px 0 0; }
  .auth-brand-hero h2 { font-size: 22px; }
  .auth-brand-hero p, .auth-points, .auth-brand-foot { display: none; }
  .auth-panel { padding: 26px 18px 40px; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  body.nav-side .app-nav { transform: translateX(-100%); box-shadow: none; }
  body.nav-side.nav-open .app-nav { transform: none; box-shadow: 0 30px 90px rgba(2, 8, 23, .55); }
  body.nav-side .nav-toggle { display: grid; }
  .site-bar { margin-left: 0; padding: 0 14px; gap: 9px; }
  body.nav-mini .site-bar { margin-left: 0; }
  .site-bar .nav-fab { display: grid; }
  .site-bar-txt em { display: none; }
  .page-main, body.nav-mini .page-main { margin-left: 0; padding: 14px 13px 26px; }
  .nav-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(8, 13, 25, .48); backdrop-filter: blur(2px); display: block; opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s; }
  body.nav-open .nav-scrim { opacity: 1; visibility: visible; }
  .page-title h1 { font-size: 19px; }
  .live-chip { display: none; }
}
@media (max-width: 640px) {
  .page-head { align-items: flex-start; gap: 10px; }
  .page-actions { width: 100%; }
  .form-grid, .grid-equal { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .toolbar .field.grow { grid-column: auto; }
  .segmented { grid-template-columns: 1fr; }
  .stat-strip .stat-card { min-width: 96px; padding: 7px 11px; }
  .stat-strip .stat-value { font-size: 15px; }
  .page-foot { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .nav-item, .site-bar, .page-main, .app-nav { transition: none; }
  .dash-bar, .chart-bar { transition: none; }
}

/* ===== 2.0 以下为页面级组件（沿用既有类名） ===== */


.list-row { display: flex; align-items: center; gap: 14px; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-main b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-main span { font-size: 12px; color: var(--muted); }

/* ---------------- 数据列表（授权端通用） ---------------- */
.dlist { display: flex; flex-direction: column; gap: 10px; }
.ditem {
  display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 15px;
  padding: 17px 18px; border: 1px solid var(--line); border-radius: 16px;
  background: rgba(127, 127, 127, .06);
  transition: border-color .18s ease, background .18s ease;
}
.ditem:hover { border-color: var(--line-strong); }
.ditem.picked { border-color: var(--accent); background: var(--accent-soft); }
.ditem.is-anim { animation: fadeUp .3s ease both; animation-delay: var(--i, 0s); }

.dico {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: var(--accent); background: var(--accent-soft);
}
.dico .ico, .dico > svg { width: 20px; height: 20px; }
.dico.ok { color: var(--ok); background: rgba(52, 211, 153, .14); }
.dico.bad { color: var(--bad); background: rgba(251, 113, 133, .14); }

.dbody { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.dtop { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.dhead { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dtitle {
  font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--txt);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.dops { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 7px; margin-left: auto; }
.dops .btn { padding: 6px 13px; font-size: 12.5px; border-radius: 9px; }
.dops .help { font-size: 12px; }

.dmeta { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 11px 24px; margin: 0; padding: 0; }
.dmeta > div { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dmeta dt { margin: 0; font-size: 11.5px; line-height: 1.25; color: var(--muted); }
.dmeta dd {
  margin: 0; font-size: 13px; font-weight: 600; line-height: 1.45; color: var(--txt);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dmeta dd.ok { color: var(--ok); }
.dmeta dd.bad { color: var(--bad); }
.dnote { font-size: 12.5px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }
.dnote.mono { font-size: 12px; }

@media (max-width: 720px) {
  .ditem { grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 14px; }
  .dico { width: 36px; height: 36px; border-radius: 11px; }
  .dico .ico, .dico > svg { width: 18px; height: 18px; }
  .dmeta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
  .dops { flex: 1 1 100%; margin-left: 0; padding-top: 2px; justify-content: flex-end; }
  .dops .btn { flex: 0 1 auto; }
  .dops .help { flex: 1 1 100%; text-align: right; }
}

/* ---------------- 授权卡密页 ---------------- */
.cards-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cards-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--panel-solid); color: var(--txt-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: .18s;
}
.cards-chip em { font-style: normal; font-size: 11px; opacity: .7; font-weight: 500; }
.cards-chip:hover { border-color: var(--accent); color: var(--accent); }
.cards-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cards-chip .tag {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px;
  background: rgba(225, 29, 72, .12); color: var(--bad);
}

.gen-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px;
  padding: 12px 14px; margin-top: 14px; border-radius: 12px;
  border: 1px dashed var(--line-strong); background: rgba(127, 127, 127, .04);
}
.gen-summary span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 3px; }
.gen-summary b { display: block; font-size: 13.5px; font-weight: 600; }
.gen-summary b.accent { color: var(--accent); }

.status-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.status-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--txt-2); font-size: 12.5px; font-weight: 600; text-decoration: none;
}
.status-tab b { font-variant-numeric: tabular-nums; }
.status-tab.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.codes-grid { display: grid; gap: 6px; max-height: 320px; overflow: auto; margin-top: 12px; }
.codes-grid div {
  font-family: ui-monospace, Consolas, monospace; font-size: 12px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: rgba(127, 127, 127, .06);
}
.cards-mobile { display: none; }
.cm-item { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); }
.cm-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.cm-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; margin: 9px 0; font-size: 12px; color: var(--muted); }
.cm-meta b { color: var(--txt); font-weight: 600; }
.cm-actions { display: flex; gap: 8px; justify-content: flex-end; }

@media (max-width: 720px) {
  .cards-mobile { display: grid; gap: 10px; }
  .cards-table-wrap { display: none; }
}
@media (max-width: 520px) {
  .gen-summary { gap: 8px; padding: 10px 12px; }
}

.hero-steps {
  display: flex; align-items: center; gap: 16px; padding: 15px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 91, 255, .12), rgba(14, 165, 233, .1)); border: 1px solid var(--line);
}
.hero-steps .big { font-size: 34px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.hero-steps .unit { font-size: 12px; color: var(--muted); }

.copy-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-bar .input { font-family: ui-monospace, monospace; font-size: 12px; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 30px 18px; }

.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.quick-action { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 13px; border: 1px solid var(--line); background: var(--panel-solid); transition: border-color .18s; }
.quick-action:hover { border-color: var(--accent); }
.quick-action .ico { width: 22px; height: 22px; color: var(--accent); }
.quick-action b { font-size: 13px; }
.quick-action span { font-size: 11.5px; color: var(--muted); }

.notice-box { padding: 10px 13px; border-radius: 12px; background: rgba(14, 165, 233, .08); border: 1px solid rgba(14, 165, 233, .2); color: var(--txt-2); font-size: 12.5px; line-height: 1.6; }

/* AI 对话 */
.chat-card { display: flex; flex-direction: column; }
.chat-log {
  display: flex; flex-direction: column; gap: 12px; padding: 14px; min-height: 320px; max-height: 480px;
  overflow-y: auto; border-radius: 14px; background: rgba(127, 127, 127, .06); border: 1px solid var(--line);
}
.chat-msg { display: flex; gap: 9px; align-items: flex-start; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-avatar {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.chat-msg.user .chat-avatar { background: linear-gradient(135deg, #0ea472, #0ea5e9); }
.chat-bubble {
  max-width: 78%; padding: 10px 13px; border-radius: 12px 12px 12px 4px; font-size: 13px; line-height: 1.7;
  background: var(--panel-solid); border: 1px solid var(--line); word-break: break-word;
}
.chat-msg.user .chat-bubble { border-radius: 12px 12px 4px 12px; background: var(--accent-soft); border-color: rgba(99, 91, 255, .28); }
.chat-quick { display: flex; gap: 7px; flex-wrap: wrap; margin: 12px 0; }
.chat-inputrow { display: flex; gap: 10px; align-items: flex-end; }
.chat-inputrow .input { flex: 1; min-height: 48px; max-height: 140px; resize: vertical; }


/* 响应式 */
@media (max-width: 980px) {
  .grid-2, .grid-equal { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar .field.grow { grid-column: auto; }
}
@media (max-width: 860px) {
  :root { --sitebar-h: 50px; }
  .site-bar { padding: 0 14px; }
  .site-bar-name { font-size: 14px; }
  .toast-wrap { top: calc(var(--sitebar-h) + 12px); }
  /* 侧边导航：抽屉式，展开后显示图标 + 文字 */
  body.nav-side .app-nav {
    position: fixed; left: 0; top: 0; right: auto; bottom: auto;
    width: min(80vw, 300px); height: 100vh; flex-direction: column;
    padding: 16px 14px; border: 0; border-right: 1px solid var(--line);
    border-radius: 0 18px 18px 0; box-shadow: var(--shadow); z-index: 60;
    transform: translateX(-102%); transition: transform .26s ease;
  }
  body.nav-side.nav-open .app-nav { transform: none; }
  body.nav-side.nav-open { overflow: hidden; }
  body.nav-side .nav-head { flex-direction: row; justify-content: space-between; }
  body.nav-side .app-nav .brand { display: flex; justify-content: flex-start; padding: 6px 8px; }
  body.nav-side .brand-text { display: flex; }
  body.nav-side .nav-toggle .ico { transform: rotate(0deg); }
  body.nav-side .nav-links { flex-direction: column; margin-top: 10px; flex: 1; overflow-y: auto; gap: 3px; }
  body.nav-side .nav-item { width: 100%; justify-content: flex-start; padding: 10px 12px; }
  body.nav-side .nav-item span { display: inline; }
  body.nav-side .nav-item .ico { width: 19px; height: 19px; }
  body.nav-side .nav-extra { margin-top: auto; flex-direction: column; gap: 10px; }
  body.nav-side .nav-user { padding: 9px 8px; background: rgba(127, 127, 127, .08); justify-content: flex-start; }
  body.nav-side .nav-user-txt { display: flex; }
  body.nav-side .nav-logout { display: inline-flex; }
  body.nav-side .page-main { margin-left: 0; padding-bottom: 24px; }
  /* 菜单按钮收纳进吸顶栏，不再悬浮遮挡正文 */
  body.nav-side .site-bar .nav-fab {
    display: grid; position: static; width: 36px; height: 36px; place-items: center; cursor: pointer;
    border: 1px solid var(--line); border-radius: 10px; background: rgba(127, 127, 127, .08);
    color: var(--txt); flex: 0 0 auto; transition: opacity .18s ease;
  }
  body.nav-side .nav-fab .ico { width: 20px; height: 20px; }
  body.nav-side.nav-open .site-bar .nav-fab { opacity: 0; pointer-events: none; }
  body.nav-side .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 59;
    background: rgba(9, 14, 26, .45); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  body.nav-side.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  .page-head { align-items: flex-start; }
  .page-actions { width: 100%; }
  .segmented { grid-template-columns: 1fr; }
  .perm-grid { grid-template-columns: 1fr; }
  .perm-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* 手机端通用自适应：内容留白、表单、弹层、对话 */
  .page-main { padding-left: 16px; padding-right: 16px; }
  .card-head { align-items: flex-start; }
  .toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal { padding: 12px; }
  .modal-card { width: 100%; max-height: 90vh; padding: 18px; border-radius: 16px; }
  .chat-inputrow { flex-direction: column; align-items: stretch; }
  .pager { justify-content: center; }
  .copy-bar .input { flex: 1 1 100%; }
  .kpi-grid.kpi-3 { grid-template-columns: 1fr 1fr; }
  .notice-box, .license-banner { word-break: break-word; }
  /* 手机端内容优先：标记 mobile-first 的卡片排到最前 */
  .page-body > .mobile-first { order: -1; }
}
@media (max-width: 520px) {
  .page-main { padding: 14px 12px 26px; }
  .page-title h1 { font-size: 18px; }
  .page-head { margin-bottom: 10px; }
  .page-body { gap: 11px; }
  .stat-value { font-size: 17px; }
  .stat-hint { font-size: 10.5px; }
  .card { padding: 13px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi-grid.kpi-3, .kpi-grid.kpi-2 { grid-template-columns: 1fr 1fr; }
  /* 紧凑统计卡：手机端进一步压缩，弱化次要说明 */
  .kpi-compact .stat-card { padding: 8px 10px; }
  .kpi-compact .stat-value { font-size: 15px; }
  .kpi-compact .stat-hint { display: none; }
  .table-wrap { font-size: 12px; }
  .hero-steps { flex-direction: column; align-items: flex-start; }
  .hero-steps .big { font-size: 32px; }
  .toolbar { grid-template-columns: 1fr; }
  .login-shell { padding: 22px 12px; }
  .login-card { padding: 24px 18px; border-radius: 18px; }
  .stat-card { padding: 9px 10px; }
  .chat-bubble { max-width: 88%; }
  .modal-card { padding: 16px; }
  .page-foot { margin-top: 14px; font-size: 11px; }
  /* 手机端：分段选项卡与表单操作按钮占满整行，方便单手操作 */
  .seg-tabs { display: flex; width: 100%; }
  .seg-tab { flex: 1; text-align: center; padding: 8px 6px; }
  .form-actions { flex-direction: column; align-items: stretch; gap: 8px; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .form-actions .help { text-align: center; }
  /* 手机端：拖拽区与已选文件行加大点按区域 */
  .dropzone { padding: 24px 14px; }
  .dz-files .dz-item { padding: 9px 10px; }
  .dz-item .dz-del { padding: 6px 10px; font-size: 16px; }
  /* 手机端：表格转卡片后操作按钮两列排布，避免挤成一团 */
  .table-wrap tbody td[data-label="操作"] .row { display: grid; grid-template-columns: 1fr 1fr; }
  .table-wrap tbody td[data-label="操作"] .btn { justify-content: center; }
}
@media (hover: none) {
  .dropzone:hover { border-color: var(--line-strong); background: rgba(99, 91, 255, .03); }
  .dropzone:active { border-color: var(--accent); background: var(--accent-soft); }
}
/* 发布更新：加密文件勾选列表 */
.enc-list {
  max-height: 264px; overflow: auto; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px;
  padding: 10px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(127, 127, 127, .04); align-content: start;
}
.enc-list label {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 7px 9px; border-radius: 9px; border: 1px solid transparent;
  font-size: 12.5px; color: var(--txt-2); cursor: pointer; transition: .16s;
}
.enc-list label:hover { background: rgba(124, 108, 255, .08); border-color: var(--line); }
.enc-list label:has(input:checked) { color: var(--txt); }
.enc-list input[type="checkbox"] {
  flex: 0 0 auto; width: 15px; height: 15px; min-width: 15px;
  margin: 0; padding: 0; border-radius: 4px; accent-color: var(--accent);
}
.enc-list label .mono { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select:disabled { opacity: .5; }

/* 更新说明条目编辑器：列表即编辑器（回车新建 / 行首退格合并 / 多行粘贴拆条 / 类型着色编号 / 草稿持久化） */
.line-edit { display: flex; flex-direction: column; gap: 8px; }
.line-list {
  display: flex; flex-direction: column; gap: 2px;
  padding: 7px; min-height: 86px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(127, 127, 127, .05);
  transition: border-color .15s ease;
}
.line-list:focus-within { border-color: rgba(124, 108, 255, .45); }
.line-row {
  display: flex; align-items: flex-start; gap: 8px; min-width: 0;
  padding: 5px 7px; border: 1px solid transparent; border-radius: 9px;
  transition: background .15s ease, border-color .15s ease;
}
.line-row:hover { background: rgba(124, 108, 255, .07); }
.line-row:focus-within { background: var(--accent-soft); border-color: rgba(124, 108, 255, .3); }
.line-no {
  flex: 0 0 auto; min-width: 22px; height: 20px; margin-top: 1px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); font-family: var(--mono, ui-monospace, monospace);
}
.line-no.fix { color: var(--bad); background: rgba(225, 29, 72, .12); }
.line-no.new { color: var(--ok); background: rgba(14, 164, 114, .12); }
.line-no.sec { color: var(--warn); background: rgba(217, 119, 6, .13); }
.line-no.opt { color: var(--txt-2); background: rgba(127, 127, 127, .16); }
.line-text {
  flex: 1; min-width: 0; min-height: 20px;
  font-size: 12.5px; line-height: 1.6; color: var(--txt);
  outline: none; white-space: pre-wrap; word-break: break-word; caret-color: var(--accent);
}
.line-row.is-empty .line-text::before { content: attr(data-ph); color: var(--muted); pointer-events: none; }
.line-ops { display: flex; gap: 2px; align-items: center; opacity: 0; transition: opacity .15s ease; }
.line-row:hover .line-ops, .line-row:focus-within .line-ops { opacity: 1; }
@media (hover: none) { .line-ops { opacity: 1; } }
.line-op {
  width: 22px; height: 22px; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font-size: 12px; line-height: 1;
  cursor: pointer; transition: .15s;
}
.line-op:hover { background: rgba(127, 127, 127, .16); color: var(--txt); }
.line-op.line-del:hover { background: rgba(225, 29, 72, .12); color: var(--bad); }
.line-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.line-chip {
  -webkit-appearance: none; appearance: none;
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 11px; margin: 0;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(127, 127, 127, .08); color: var(--txt-2);
  font: inherit; font-size: 11.5px; line-height: 1; white-space: nowrap;
  cursor: pointer; user-select: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.line-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.line-chip:active { transform: scale(.97); }
.line-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.line-chip[data-prefix^="新增"] { border-color: rgba(14, 164, 114, .32); color: var(--ok); }
.line-chip[data-prefix^="修复"] { border-color: rgba(225, 29, 72, .3); color: var(--bad); }
.line-chip[data-prefix^="安全"] { border-color: rgba(217, 119, 6, .34); color: var(--warn); }
.line-edit-foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.line-edit-foot .line-draft { display: inline-flex; align-items: center; gap: 5px; }
.line-edit-foot .line-draft::before { content: ''; width: 6px; height: 6px; border-radius: 99px; background: var(--ok); }

/* 未初始化前不显示（避免脚本未加载时出现点不动的空控件），改为提示强制刷新 */
.line-edit:not([data-ready]) .line-list,
.line-edit:not([data-ready]) .line-chips,
.line-edit:not([data-ready]) .line-edit-foot { display: none; }
.line-edit .line-fallback { display: none; }
.line-edit:not([data-ready]) .line-fallback {
  display: block; padding: 9px 12px; border-radius: 10px;
  border: 1px dashed rgba(217, 119, 6, .4); background: rgba(217, 119, 6, .08);
  font-size: 12px; color: var(--warn);
}

/* ===== 工作台 ===== */
.wb-card { padding: 13px 14px; }
.wb-card .card-head { margin-bottom: 9px; }
.wb-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 16px; flex-wrap: wrap;
  padding: 13px 16px; border-radius: 17px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 150% at 0% 0%, rgba(124, 108, 255, .20), transparent 56%),
    radial-gradient(110% 130% at 100% 0%, rgba(14, 165, 233, .14), transparent 60%),
    rgba(127, 127, 127, .04);
}
.wb-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .38;
  background-image: radial-gradient(rgba(127, 127, 127, .22) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 74%);
  mask-image: linear-gradient(to bottom, #000, transparent 74%);
}
.wb-hello { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wb-hello h2 { margin: 0; font-size: 18px; letter-spacing: -.3px; }
.wb-hello p { margin: 0; }
.wb-hello-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wb-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--ok);
}
.wb-live i {
  width: 6px; height: 6px; border-radius: 99px; background: var(--ok);
  box-shadow: 0 0 0 3px rgba(14, 164, 114, .16);
  animation: wbPulse 2s ease-in-out infinite;
}
@keyframes wbPulse { 50% { opacity: .3; } }
.wb-metrics { position: relative; display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.wb-metric { min-width: 0; padding: 0 15px; border-left: 1px solid var(--line); }
.wb-metric:first-child { padding-left: 0; border-left: 0; }
.wb-metric span { display: block; font-size: 10.5px; color: var(--muted); line-height: 1.4; white-space: nowrap; }
.wb-metric b { font-size: 17px; font-weight: 750; letter-spacing: -.4px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.wb-metric b .wb-pct { font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-left: 1px; }
.wb-metric.warn span { color: var(--warn); }
.wb-metric.warn b { color: var(--warn); }

.wb-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.wb-seg {
  display: inline-flex; padding: 3px; gap: 2px;
  border-radius: 11px; background: rgba(127, 127, 127, .1); border: 1px solid var(--line);
}
.wb-seg-btn {
  border: 0; background: transparent; color: var(--muted);
  font: inherit; font-size: 12px; padding: 4px 12px; border-radius: 8px;
  cursor: pointer; transition: background .15s ease, color .15s ease;
}
.wb-seg-btn.is-on { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(124, 108, 255, .3); }
.wb-bars {
  display: flex; align-items: flex-end; gap: 7px;
  height: 138px; padding: 12px 6px 0;
  border-radius: 11px;
  background-image: linear-gradient(to top, rgba(127, 127, 127, .13) 1px, transparent 1px);
  background-size: 100% 25%;
}
.wb-col {
  flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 6px; cursor: default;
}
.wb-val {
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
  transition: color .15s ease, font-weight .15s ease;
}
.wb-track { flex: 1; width: 100%; display: flex; align-items: flex-end; padding: 0 5px; }
.wb-bar {
  width: 100%; min-height: 4px; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--accent), rgba(124, 108, 255, .32));
  transition: height .38s cubic-bezier(.4, 0, .2, 1), background .2s ease;
}
#wbChart[data-mode="fail"] .wb-bar { background: linear-gradient(180deg, var(--bad), rgba(225, 29, 72, .28)); }
.wb-col:hover .wb-bar { filter: brightness(1.1); }
.wb-col:hover .wb-val { color: var(--txt); font-weight: 700; }
.wb-lbl { font-size: 10.5px; color: var(--muted); white-space: nowrap; }

.wb-health { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.wb-ring-wrap { position: relative; width: 92px; height: 92px; flex: 0 0 auto; display: grid; place-items: center; }
.wb-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p, 0) * 1%), rgba(127, 127, 127, .16) 0);
  -webkit-mask: radial-gradient(circle, transparent 55%, #000 56%);
  mask: radial-gradient(circle, transparent 55%, #000 56%);
  transition: background .3s ease;
}
.wb-ring-in { position: relative; text-align: center; line-height: 1.25; }
.wb-ring-in b { display: block; font-size: 18px; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.wb-ring-in b em { font-style: normal; font-size: 12px; color: var(--muted); margin-left: 1px; }
.wb-ring-in span { font-size: 11px; color: var(--muted); }
.wb-quota { height: 8px; border-radius: 99px; background: rgba(127, 127, 127, .14); overflow: hidden; margin-top: 7px; }
.wb-quota i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.wb-feed { display: flex; flex-direction: column; margin: -4px 0; }
.wb-feed-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 2px; border-bottom: 1px dashed var(--line);
}
.wb-feed-row:last-child { border-bottom: 0; }
.wb-dot { width: 7px; height: 7px; border-radius: 99px; flex: 0 0 auto; background: var(--ok); }
.wb-dot.warn { background: var(--warn); }
.wb-dot.bad { background: var(--bad); }
.wb-dot.muted { background: var(--muted); }
.wb-feed-main { flex: 1; min-width: 0; }
.wb-feed-main b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-feed-main span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

.wb-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 6px; }
.wb-tile {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 11px; text-decoration: none; color: inherit;
  border: 1px solid var(--line); background: rgba(127, 127, 127, .05);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.wb-tile:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.wb-tile-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 23px; height: 23px; border-radius: 8px; flex: 0 0 auto;
  background: var(--accent-soft); color: var(--accent);
}
.wb-tile-ico svg { width: 13px; height: 13px; }
.wb-tile b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 工作台内的表格更紧凑，减少行高与内边距占用 */
.wb-table th, .wb-table td { padding: 6px 9px; font-size: 12px; }
.wb-table th { font-size: 11px; font-weight: 600; }

@media (max-width: 720px) {
  .wb-hero { padding: 12px 14px; border-radius: 15px; }
  .wb-hello h2 { font-size: 16.5px; }
  .wb-metrics { width: 100%; gap: 12px 0; }
  .wb-metric { flex: 1 1 calc(50% - 6px); padding: 0; border-left: 0; }
  .wb-metric b { font-size: 15.5px; }
  .wb-bars { height: 124px; gap: 5px; }
  .wb-track { padding: 0 3px; }
  .wb-ring-wrap { width: 82px; height: 82px; }
}

/* ===== 发布更新页 ===== */
.pub-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px 18px; flex-wrap: wrap;
  padding: 15px 18px; border-radius: 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(124, 108, 255, .16), rgba(14, 165, 233, .08) 45%, transparent 78%),
    rgba(127, 127, 127, .04);
}
.pub-hero::after {
  content: ''; position: absolute; right: -50px; top: -70px; width: 190px; height: 190px;
  border-radius: 50%; background: radial-gradient(circle, rgba(124, 108, 255, .22), transparent 70%);
  pointer-events: none;
}
.pub-hero-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pub-hero-ver { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.pub-hero-ver b { font-size: 23px; line-height: 1.1; letter-spacing: -.6px; color: var(--txt); }
.pub-hero-ver .cap { font-size: 11.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.pub-hero-sub { margin: 0; }
.pub-metrics { display: flex; gap: 8px; flex-wrap: wrap; }
.pub-metric {
  min-width: 88px; padding: 7px 12px; border-radius: 12px;
  background: rgba(127, 127, 127, .09); border: 1px solid var(--line);
  backdrop-filter: blur(2px);
}
.pub-metric span { display: block; font-size: 11px; color: var(--muted); line-height: 1.4; }
.pub-metric b { font-size: 15.5px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.2px; }
.pub-metric b em { font-style: normal; font-size: 11px; font-weight: 500; color: var(--muted); }

.pub-inline { display: flex; gap: 8px; align-items: center; }
.pub-inline .input { flex: 1; min-width: 0; }
.pub-inline .btn { flex: 0 0 auto; white-space: nowrap; }

.pub-scan { display: flex; gap: 6px; flex-wrap: wrap; }
.pub-scan-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: 10px;
  background: rgba(127, 127, 127, .08); border: 1px solid var(--line);
  font-size: 12.5px; min-width: 0;
}
.pub-scan-item em { font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; }
.pub-scan-item b { font-variant-numeric: tabular-nums; }

.pub-enc {
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  margin-top: 14px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 13px;
  background: rgba(127, 127, 127, .04);
}
.pub-enc .switch { font-size: 13px; font-weight: 600; }
.pub-enc-grow { flex: 1; min-width: 180px; }
.pub-enc .help { font-size: 11.5px; }

.pub-adv {
  margin-top: 10px; border: 1px solid var(--line); border-radius: 13px;
  background: rgba(127, 127, 127, .04); overflow: hidden;
}
.pub-adv > summary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 600; color: var(--txt-2);
}
.pub-adv > summary::-webkit-details-marker { display: none; }
.pub-adv > summary::after {
  content: '▾'; margin-left: auto; font-size: 11px; color: var(--muted);
  transition: transform .18s ease;
}
.pub-adv[open] > summary::after { transform: rotate(180deg); }
.pub-adv > summary .help { font-weight: 400; }
.pub-adv .enc-list { margin: 0 12px 12px; }

.pub-submit {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 15px; padding-top: 13px; border-top: 1px dashed var(--line);
}

.pub-pkg { display: flex; flex-direction: column; gap: 9px; }
.pub-pkg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pub-pkg-head b { font-size: 16px; letter-spacing: -.3px; }

.pub-cl {
  white-space: pre-wrap; word-break: break-word;
  font-size: 12px; line-height: 1.75; color: var(--txt-2);
  padding: 2px 0 2px 10px; border-left: 2px solid var(--accent-soft);
}

@media (max-width: 720px) {
  .pub-hero { padding: 13px 14px; border-radius: 16px; }
  .pub-hero-ver b { font-size: 20px; }
  .pub-metrics { width: 100%; }
  .pub-metric { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .pub-inline { flex-wrap: wrap; }
  .pub-inline .input { flex: 1 1 100%; }
  .pub-inline .btn { width: 100%; }
  .pub-submit .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 管理员权限配置 */
.perm-section { margin-top: 16px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(127, 127, 127, .05); }
.perm-section.perm-locked { opacity: .55; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.perm-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.perm-item, .perm-op {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 9px;
  border: 1px solid var(--line); font-size: 12.5px; color: var(--txt-2); cursor: pointer; transition: .16s;
}
.perm-item:hover, .perm-op:hover { border-color: var(--line-strong); background: rgba(124, 108, 255, .07); }
.perm-item input, .perm-op input { width: 15px; height: 15px; min-width: 15px; margin: 0; accent-color: var(--accent); }
.perm-item input:disabled, .perm-op input:disabled { cursor: not-allowed; }
.perm-op { justify-content: flex-start; }
.perm-op em { font-style: normal; font-size: 11px; color: var(--muted); margin-left: auto; white-space: nowrap; }
.perm-op.off { opacity: .45; }
.perm-ops { display: grid; gap: 6px; max-height: 240px; overflow: auto; padding-right: 4px; overscroll-behavior: contain; }

/* 计费中心：固定高度容器内滚动查看（表头吸顶） */
.table-wrap.table-fixed-h {
  max-height: 380px; overflow-y: auto; overflow-x: auto;
  overscroll-behavior: contain;
}
.table-wrap.table-fixed-h table { min-width: 820px; }
.table-wrap.table-fixed-h thead th {
  position: sticky; top: 0; z-index: 2;
  background-color: var(--panel-solid, #fff);
  background-image: linear-gradient(rgba(127, 127, 127, .07), rgba(127, 127, 127, .07));
  border-bottom: 1px solid var(--line);
}
.table-wrap.table-fixed-h::-webkit-scrollbar { width: 8px; height: 8px; }
.table-wrap.table-fixed-h::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.table-wrap.table-fixed-h::-webkit-scrollbar-track { background: transparent; }
@media (max-width: 640px) {
  .table-wrap.table-fixed-h { max-height: 320px; }
  .table-wrap.table-fixed-h table { min-width: 720px; }
}

/* ================= 移动端：表格转卡片 / 页脚精简 ================= */
@media (max-width: 720px) {
  /* 页头保持普通流式布局，不再做悬浮吸顶条 */
  body.nav-side .page-main { padding-top: 12px; }
  .page-head { align-items: center; }
  .page-title h1 { font-size: 17px; }
  .page-title p { margin-top: 2px; font-size: 11.5px; }
  .page-actions { width: auto; margin-left: auto; }

  /* 页脚精简：只保留站点名与版本 */
  .page-foot { margin-top: 12px; font-size: 11px; gap: 4px; }
  .page-foot > *:not(:first-child) { display: none; }

  /* 表格转卡片：隐藏表头，单元格按两列键值对排列，彻底消除横向滚动 */
  .table-wrap:not(.table-mobile):not(.table-fixed-h) { border: 0; overflow: visible; }
  .table-wrap:not(.table-mobile):not(.table-fixed-h) table { display: block; width: 100%; }
  .table-wrap:not(.table-mobile):not(.table-fixed-h) thead { display: none; }
  .table-wrap:not(.table-mobile):not(.table-fixed-h) tbody { display: block; }
  .table-wrap:not(.table-mobile):not(.table-fixed-h) tbody tr {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px;
    padding: 11px 0; border-top: 1px dashed var(--line);
  }
  .table-wrap:not(.table-mobile):not(.table-fixed-h) tbody tr:first-child { border-top: 0; }
  .table-wrap:not(.table-mobile):not(.table-fixed-h) tbody td {
    display: block; padding: 0; border: 0; min-width: 0;
    font-size: 12.5px; word-break: break-word; overflow-wrap: anywhere;
  }
  .table-wrap:not(.table-mobile):not(.table-fixed-h) tbody td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 1px;
    font-size: 10.5px; line-height: 1.4; color: var(--muted); font-weight: 500;
  }
  .table-wrap:not(.table-mobile):not(.table-fixed-h) tbody td:first-child,
  .table-wrap:not(.table-mobile):not(.table-fixed-h) tbody td:last-child,
  .table-wrap:not(.table-mobile):not(.table-fixed-h) tbody td[colspan] { grid-column: 1 / -1; }
  .table-wrap:not(.table-mobile):not(.table-fixed-h) tbody td:first-child::before,
  .table-wrap:not(.table-mobile):not(.table-fixed-h) tbody td[colspan]::before { display: none; }
  .table-wrap:not(.table-mobile):not(.table-fixed-h) tbody td:first-child { font-size: 13.5px; font-weight: 600; }
  .table-wrap:not(.table-mobile):not(.table-fixed-h) tbody td[colspan] { text-align: center; }
  .table-wrap:not(.table-mobile):not(.table-fixed-h) tbody td:last-child .btn { margin-right: 6px; }
  /* 卡片内不再需要禁止换行，交给单元格自动折行 */
  .table-wrap:not(.table-mobile):not(.table-fixed-h) tbody td.nowrap { white-space: normal; }

  /* 插件目录：紧凑单行式，去掉键值标签，一屏可看更多插件（点整行打开编辑） */
  .table-wrap.plugin-list { border: 0; overflow: visible; }
  .table-wrap.plugin-list table,
  .table-wrap.plugin-list tbody { display: block; width: 100%; }
  .table-wrap.plugin-list thead { display: none; }
  .table-wrap.plugin-list tbody tr {
    display: block; position: relative;
    padding: 9px 0; border-top: 1px solid var(--line); cursor: pointer;
  }
  .table-wrap.plugin-list tbody tr:first-child { border-top: 0; }
  .table-wrap.plugin-list tbody tr:active { background: rgba(127, 127, 127, .06); }
  .table-wrap.plugin-list tbody td {
    display: inline; padding: 0; border: 0; min-width: 0;
    font-size: 11.5px; color: var(--txt-2); word-break: break-word;
  }
  .table-wrap.plugin-list tbody td:first-child {
    display: block; padding-right: 64px; font-size: 13.5px; font-weight: 600; color: var(--txt);
  }
  .table-wrap.plugin-list tbody td:nth-child(2) { display: none; }
  .table-wrap.plugin-list tbody td:nth-child(3),
  .table-wrap.plugin-list tbody td:nth-child(4),
  .table-wrap.plugin-list tbody td:nth-child(5),
  .table-wrap.plugin-list tbody td:nth-child(6) {
    font-size: 11px; color: var(--muted); white-space: nowrap;
  }
  .table-wrap.plugin-list tbody td:nth-child(4)::before,
  .table-wrap.plugin-list tbody td:nth-child(5)::before,
  .table-wrap.plugin-list tbody td:nth-child(6)::before { content: "·"; margin: 0 4px; opacity: .7; }
  .table-wrap.plugin-list tbody td:nth-child(7) { display: block; position: absolute; right: 0; top: 9px; }
  .table-wrap.plugin-list tbody td:nth-child(8) { display: block; margin-top: 6px; }
  .table-wrap.plugin-list .p-code { display: inline; margin-left: 6px; font-size: 10.5px; font-weight: 400; }
  .table-wrap.plugin-list .p-sum {
    display: block; margin-top: 1px; font-size: 11px; font-weight: 400; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .table-wrap.plugin-list tbody td[data-label] .plugin-ops {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px;
  }
  .table-wrap.plugin-list .plugin-ops .btn { justify-content: center; padding: 5px 0; font-size: 11px; }
  .table-wrap.plugin-list .pkg-meta { display: none; }
}
@media (max-width: 520px) {
  /* 手机竖屏：副标题收起，保证吸顶页头只有一行 */
  .page-title p { display: none; }
  .page-title h1 { font-size: 16px; }
  .page-actions .btn { padding: 5px 9px; font-size: 12px; }
}

/* Ajax 页面切换进度条 */
#pageProgress {
  position: fixed; left: 0; top: 0; z-index: 960; height: 2.5px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0; pointer-events: none;
  transition: width .28s ease, opacity .2s ease;
}
#pageProgress.on { opacity: 1; }

/* ================= 接口智能识别（authsrv/apis.php 新增接口，样式同主站 admin_apis.php） ================= */
.detect-box {
  padding: 12px 14px; margin-bottom: 16px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm, 12px);
  background: var(--accent-soft);
}
.detect-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.detect-head b { font-size: 13.5px; color: var(--txt); display: inline-flex; align-items: center; gap: 7px; }
.detect-head .dot-accent { width: 6px; height: 6px; border-radius: 99px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.detect-head .help { font-size: 12px; color: var(--muted); line-height: 1.5; }
.detect-row { display: flex; gap: 8px; }
.detect-row .input { flex: 1 1 auto; min-width: 0; }
.detect-row .btn { flex: 0 0 auto; }
.detect-result { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
/* hidden 属性必须能压过 flex/grid 这类 display 声明，否则带 hidden 的结果栏仍会显示 */
[hidden] { display: none !important; }
.detect-result[hidden] { display: none; }
.detect-result .help { font-size: 12px; line-height: 1.6; color: var(--txt-2); }
/* 粘贴区 / 提示行 / 高级设置折叠 / 占位符对照表 */
.detect-paste { margin-top: 8px; width: 100%; resize: vertical; min-height: 84px; }
.detect-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.detect-actions .help { font-size: 12px; color: var(--muted); }
.detect-result .ok { color: var(--ok, #16a34a); font-weight: 600; }
.detect-result .warn { color: #d97706; font-weight: 600; }
.tpl-tip { font-size: 12px; line-height: 1.7; color: var(--muted); margin-top: 6px; }
.tpl-tip .code { font-family: var(--mono, ui-monospace, monospace); color: var(--accent); }
.key-need { font-size: 12px; color: #d97706; margin-top: 6px; }
.field.is-need-key .input { border-color: #d97706; }
.adv-toggle {
  display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  margin: 14px 0 10px; padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--txt-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm, 12px); background: var(--panel-2, rgba(255, 255, 255, .04));
}
.adv-toggle i { font-style: normal; transition: transform .18s ease; display: inline-block; }
.adv-toggle.open i { transform: rotate(90deg); }
.adv-body { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm, 12px); padding: 12px 14px; }
.field-demo { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm, 12px); overflow: hidden; }
.field-demo .fd-title { padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--txt-2); background: var(--panel-2, rgba(255, 255, 255, .04)); }
.field-demo table { width: 100%; border-collapse: collapse; font-size: 12px; }
.field-demo th, .field-demo td { padding: 7px 12px; text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
.field-demo th { width: 92px; font-weight: 600; color: var(--accent); font-family: var(--mono, ui-monospace, monospace); }
.field-demo td { color: var(--txt-2); }
.field-demo .fd-note { padding: 8px 12px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); line-height: 1.7; }
@media (max-width: 640px) {
  .detect-row { flex-direction: column; }
  .detect-row .btn { width: 100%; }
}

/* 统一后台内容区紧凑规格（E）：只调间距与字号，不改页面结构，避免各页疏密不一致 */
.page-body .card { padding: 13px; }
.page-body .card-head { margin-bottom: 8px; }
.page-body .card-head h2,
.page-body .card-head h3 { font-size: 14px; }
.page-body .card-head .sub { font-size: 11px; }
.page-body .stack { gap: 10px; }
.page-body .btn-sm { height: 28px; font-size: 11.5px; }
@media (max-width: 640px) {
  .page-body .card { padding: 12px; }
}
@media (min-width: 1024px) {
  .page-body .card { padding: 14px; }
}

/* ---------------- 弹层统一规格：标题栏吸顶、关闭常驻、操作栏统一 ---------------- */
.modal-head {
  position: sticky; top: 0; z-index: 6;
  background: var(--panel-solid);
}
.modal-close {
  width: 34px; height: 34px; flex: none;
  display: inline-grid; place-items: center;
  padding: 0; border-radius: 9px;
  background: rgba(100, 116, 139, .1);
  font-size: 19px; line-height: 1;
}
.modal-close:hover { background: rgba(100, 116, 139, .18); color: var(--txt); }
.modal-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 8px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line);
}
.modal-foot .help { margin-right: auto; font-size: 10px; color: var(--muted); }
@media (max-width: 640px) {
  /* 手机端弹层字段双列展示，减少弹窗高度；整行字段仍占满 */
  .modal .form-grid { grid-template-columns: 1fr 1fr; }
  .modal .form-grid .field.full { grid-column: 1 / -1; }
  .modal-close { width: 38px; height: 38px; }
  .modal-foot .btn { min-height: 36px; padding: 8px 12px; font-size: 12px; }
}
@media (max-width: 380px) {
  .modal .form-grid { grid-template-columns: 1fr; }
}
