:root {
  --bg: #f3f5f9;
  --side: #ffffff;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #8b95a8;
  --line: #e8ecf3;
  --blue: #4f8cff;
  --blue-soft: #eaf2ff;
  --green: #22c55e;
  --red: #ef4444;
  --orange: #f59e0b;
  --purple: #8b5cf6;
  --teal: #14b8a6;
  --radius: 10px;
  --shadow: 0 4px 12px rgba(31, 41, 55, 0.05);
  --font: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 12px;
}
.app-bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #0f172a;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.06);
  transform-origin: center center;
}
html.has-custom-bg,
html.has-custom-bg body {
  background: transparent;
}
html.has-custom-bg .app {
  position: relative;
  z-index: 1;
}
button, input { font: inherit; }
b { font-weight: 700; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 148px; flex-shrink: 0; background: var(--side);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 8px 6px;
  position: sticky; top: 0; height: 100vh; z-index: 30;
  transition: width .18s ease;
}
.sidebar.collapsed { width: 52px; padding: 8px 4px; }
.brand {
  display: flex; gap: 6px; align-items: center;
  padding: 2px 4px 8px; min-height: 32px;
}
.brand-icon {
  width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
  background: linear-gradient(145deg, #5b8def, #7aa2f7);
  color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 12px;
}
.brand-text { min-width: 0; flex: 1; overflow: hidden; }
.brand-name { font-weight: 800; font-size: 13px; white-space: nowrap; }
.brand-sub { color: var(--muted); font-size: 9px; margin-top: 0; white-space: nowrap; }
.collapse-btn {
  width: 20px; height: 20px; border: 0; border-radius: 6px;
  background: #f1f5f9; color: #64748b; cursor: pointer;
  font-size: 11px; line-height: 1; flex-shrink: 0; padding: 0;
}
.collapse-btn:hover { background: var(--blue-soft); color: var(--blue); }
.menu { display: grid; gap: 2px; flex: 1; align-content: start; }
.menu-item {
  display: flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: #64748b;
  padding: 6px 7px; border-radius: 7px; cursor: pointer; text-align: left;
  font-size: 12px; width: 100%;
}
.menu-item .ico {
  width: 16px; text-align: center; opacity: .9; font-size: 12px; flex-shrink: 0;
}
.menu-item .label { white-space: nowrap; overflow: hidden; }
.menu-item:hover { background: #f5f7fb; color: var(--text); }
.menu-item.active { background: var(--blue-soft); color: var(--blue); font-weight: 650; }
.side-foot {
  display: flex; align-items: center; gap: 5px;
  color: var(--muted); font-size: 10px; padding: 6px 4px 2px;
  white-space: nowrap; overflow: hidden;
}
.svc-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 2px rgba(34,197,94,.18); flex-shrink: 0;
}

/* collapsed: icons only */
.sidebar.collapsed .brand-text,
.sidebar.collapsed .menu-item .label,
.sidebar.collapsed .side-foot .label { display: none; }
.sidebar.collapsed .brand { justify-content: center; flex-wrap: wrap; gap: 4px; }
.sidebar.collapsed .collapse-btn { width: 100%; height: 18px; }
.sidebar.collapsed .collapse-btn::before { content: none; }
.sidebar.collapsed .menu-item { justify-content: center; padding: 7px 0; }
.sidebar.collapsed .side-foot { justify-content: center; }

.content {
  flex: 1; min-width: 0; padding: 14px 16px 28px;
  background:
    radial-gradient(ellipse 70% 40% at 100% -10%, rgba(79,140,255,0.07), transparent 55%),
    var(--bg);
}
html.has-custom-bg .content {
  background: rgba(243, 245, 249, var(--custom-bg-veil, 0.22));
}
html.has-custom-bg .sidebar {
  background: rgba(255, 255, 255, var(--custom-side-alpha, 0.72));
}
/* 半透明面板：不加 backdrop-filter，避免卡片发糊 */
html.has-custom-bg .card,
html.has-custom-bg .accel-bar,
html.has-custom-bg .accel-summary,
html.has-custom-bg .accel-panel,
html.has-custom-bg .accel-stats,
html.has-custom-bg .accel-result-card,
html.has-custom-bg .dev-bar,
html.has-custom-bg .dev-form,
html.has-custom-bg .scanqr-bar,
html.has-custom-bg .scanqr-drop,
html.has-custom-bg .scanqr-side,
html.has-custom-bg .scanqr-result,
html.has-custom-bg .lic-card,
html.has-custom-bg .dropzone {
  background: rgba(255, 255, 255, var(--custom-card-alpha, 0.55)) !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}
html.has-custom-bg .accel-panel-hd,
html.has-custom-bg .accel-lv-block {
  background: rgba(248, 250, 252, var(--custom-card-alpha, 0.55)) !important;
  border-color: rgba(232, 236, 243, 0.5);
}
html.has-custom-bg .table th {
  background: rgba(250, 251, 255, var(--custom-card-alpha, 0.55));
}
html.has-custom-bg .table td,
html.has-custom-bg .accel-task,
html.has-custom-bg .accel-list .empty {
  background: transparent;
}
html.has-custom-bg .accel-task:hover {
  background: rgba(248, 250, 252, 0.45);
}
html.has-custom-bg .icon-btn,
html.has-custom-bg .btn.ghost {
  background: rgba(255, 255, 255, 0.55);
}
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 28px; }
.top-stats { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.top-spacer { flex: 1; }
.stat-dot {
  font-size: 12px; color: var(--text);
  display: inline-flex; align-items: center; gap: 5px;
}
.stat-dot.muted { color: var(--muted); }
.stat-dot.muted b { color: var(--text); }
.stat-dot i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.stat-dot i.g { background: var(--green); }
.stat-dot i.r { background: var(--red); }
.icon-btn {
  display: none; border: 1px solid var(--line); background: #fff;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
}

.page { display: none; }
.page.active { display: block; }

.card {
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 12px;
}
.panel { padding: 16px 18px 18px; }
.panel-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 13px; margin-bottom: 16px; color: var(--text);
}
.panel-title i {
  width: 3px; height: 12px; border-radius: 2px;
  background: #6d7cff; display: inline-block;
}

.gauges-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.gauge-item { text-align: center; }
.gauge-wrap { position: relative; width: 110px; height: 110px; margin: 0 auto 6px; }
.gauge { width: 110px; height: 110px; transform: rotate(-90deg); }
.gauge .track { fill: none; stroke: #eef1f8; stroke-width: 9; }
.gauge .bar {
  fill: none; stroke: #6d7cff; stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 301.6; stroke-dashoffset: 301.6;
  transition: stroke-dashoffset .45s ease;
}
.gauge-center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.gauge-center .pct { font-size: 16px; font-weight: 750; color: #334155; }
.gauge-name { font-size: 12px; color: #64748b; margin-top: 2px; }
.gauge-foot { color: var(--muted); font-size: 11px; margin-top: 2px; min-height: 16px; }

.traffic-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 8px; gap: 12px;
}
.traffic-metric { display: flex; flex-direction: column; gap: 2px; }
.traffic-metric.right { text-align: right; align-items: flex-end; }
.traffic-metric .tm-label { color: var(--muted); font-size: 12px; }
.traffic-metric b { font-size: 20px; font-weight: 750; color: #1e293b; letter-spacing: -.02em; }
.traffic-chart-wrap {
  width: 100%; height: 220px; position: relative;
  border-radius: 8px; background: #fafbff;
}
html.has-custom-bg .traffic-chart-wrap {
  background: transparent;
}
.traffic-chart-wrap canvas { width: 100% !important; height: 220px !important; display: block; }
.traffic-legend {
  display: flex; gap: 16px; justify-content: flex-end;
  margin-top: 8px; color: var(--muted); font-size: 11px;
}
.traffic-legend span { display: inline-flex; align-items: center; gap: 5px; }
.traffic-legend i {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.traffic-legend i.up { background: #4f6ef7; }
.traffic-legend i.down { background: #93b4ff; }

.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 12px; gap: 12px; flex-wrap: wrap;
}
.page-head h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }

.btn {
  border: 0; border-radius: 9px; padding: 7px 13px; cursor: pointer; font-size: 12px;
  transition: background .15s ease, border-color .15s ease, color .15s ease, filter .15s ease;
}
.btn.primary {
  background: linear-gradient(180deg, #5b97ff 0%, #4f8cff 100%);
  color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset;
}
.btn.primary:hover { filter: brightness(1.04); }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--muted); }
.btn.ghost:hover { background: #f8fafc; color: var(--text); border-color: #d5dde9; }
.btn.sm { padding: 3px 8px; font-size: 11px; border-radius: 6px; }
.btn.danger { background: #fef2f2; color: var(--red); border: 1px solid #fecaca; }

.table-card { padding: 0; overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.table th { color: var(--muted); font-weight: 600; font-size: 11px; background: #fafbff; }

/* 消息列表：内容列更宽，点击看全文；自动跟随最新 */
.log-wrap { position: relative; }
.log-card { max-height: calc(100vh - 120px); }
.log-table { table-layout: fixed; }
.log-table thead th {
  position: sticky; top: 0; z-index: 1;
  box-shadow: 0 1px 0 var(--line);
}
.log-table th, .log-table td { max-width: none; }
.log-table .col-time, .log-table td:nth-child(1) { width: 78px; }
.log-table .col-type, .log-table td:nth-child(2) { width: 64px; }
.log-table .col-src, .log-table td:nth-child(3) { width: 110px; }
.log-table .col-body, .log-table td:nth-child(4) {
  width: auto; max-width: none;
}
.log-table tbody tr {
  cursor: pointer;
}
.log-table tbody tr:hover td {
  background: #f5f8ff;
}
.log-table tbody tr.log-flash td {
  background: #eaf2ff;
  transition: background .8s ease;
}
.log-table td.log-preview {
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.log-jump {
  position: absolute; right: 14px; bottom: 14px; z-index: 2;
  border: 0; border-radius: 999px; padding: 7px 12px;
  background: var(--blue); color: #fff; cursor: pointer;
  font-size: 12px; box-shadow: 0 6px 16px rgba(79,140,255,.35);
}
.log-jump:hover { filter: brightness(1.06); }
.log-jump span {
  display: inline-block; margin-left: 4px;
  background: rgba(255,255,255,.22); border-radius: 999px;
  padding: 0 6px; font-size: 11px; min-width: 16px; text-align: center;
}
.muted-inline { color: var(--muted); font-size: 11px; margin-right: 8px; }
.head-actions { display: flex; align-items: center; gap: 8px; }

.modal.modal-log {
  width: min(720px, 96vw);
  max-height: min(86vh, 900px);
  display: flex; flex-direction: column;
  padding: 12px 14px 14px;
}
.modal-title-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.modal-title-row .modal-title { margin: 0; }
.log-meta {
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  color: var(--muted); font-size: 11px;
  padding: 6px 8px; background: #f8fafc; border-radius: 8px;
  border: 1px solid var(--line); margin-bottom: 8px;
}
.log-meta b { color: var(--text); font-weight: 650; }
.log-body {
  flex: 1; min-height: 160px; max-height: min(56vh, 560px);
  margin: 0; padding: 10px 12px;
  overflow: auto; white-space: pre-wrap; word-break: break-word;
  background: #0f172a; color: #e2e8f0;
  border-radius: 8px; font-family: Consolas, "Sarasa Mono SC", "Cascadia Mono", monospace;
  font-size: 12px; line-height: 1.55;
  border: 1px solid #1e293b;
}
.modal-log .modal-actions {
  margin-top: 10px; align-items: center;
}
.modal-log .cfg-msg { margin-right: auto; }
.log-media-bar {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin: 0 0 8px; padding: 6px 8px;
  background: #f1f5f9; border: 1px solid var(--line); border-radius: 8px;
}
.log-media-bar .media-label {
  color: var(--muted); font-size: 11px; margin-right: 2px;
}
.log-media-bar .btn { font-size: 11px; padding: 3px 8px; }

.modal.modal-browser {
  width: min(960px, 98vw);
  height: min(86vh, 820px);
  max-height: 90vh;
  display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
}
.browser-chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  background: #f8fafc; flex-shrink: 0;
}
.browser-url {
  flex: 1; min-width: 0;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; font-size: 12px; outline: none;
  background: #fff; color: #334155;
}
.browser-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 6px 10px; border-bottom: 1px solid var(--line);
  background: #fff; flex-shrink: 0;
}
.browser-tabs .tab {
  border: 1px solid var(--line); background: #f8fafc; color: #64748b;
  border-radius: 999px; padding: 3px 10px; font-size: 11px; cursor: pointer;
}
.browser-tabs .tab.active {
  background: var(--blue-soft); color: var(--blue); border-color: #bfdbfe;
}
.browser-stage {
  flex: 1; min-height: 0; position: relative;
  background: #0b1220; display: grid; place-items: center;
  overflow: hidden;
}
.browser-frame {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; background: #fff;
}
.browser-img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  display: block;
}
.browser-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  background: #000; outline: none;
}
.browser-audio {
  width: min(92%, 520px);
  z-index: 1;
}
.browser-img[hidden],
.browser-video[hidden],
.browser-audio[hidden],
.browser-frame[hidden],
.browser-empty[hidden],
.browser-tabs[hidden] {
  display: none !important;
}
.browser-empty {
  color: #94a3b8; font-size: 13px; padding: 24px; text-align: center;
}
.browser-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-top: 1px solid var(--line);
  background: #fff; flex-shrink: 0;
}
.browser-foot .cfg-msg { margin-right: auto; }
.table td .dot {
  width: 6px; height: 6px; border-radius: 50%; display: inline-block;
  margin-right: 5px; background: #cbd5e1;
}
.table td .dot.on { background: var(--green); }
.ops { display: flex; gap: 4px; flex-wrap: wrap; }
.empty { display: none; padding: 24px; text-align: center; color: var(--muted); }
.empty.show { display: block; }

.form-card { max-width: 420px; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 960px;
  align-items: stretch;
}
#page-settings .form-card {
  max-width: none;
  width: 100%;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
#page-settings .form-card > .cfg-actions {
  margin-top: auto;
  padding-top: 12px;
}
#page-settings .settings-span { grid-column: 1 / -1; }
.bg-preview {
  margin-top: 10px;
  height: 88px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background-size: cover;
  background-position: center;
  background-color: #e8ecf3;
}
@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* ---- 等级加速页 ---- */
.accel-shell {
  display: grid;
  gap: 12px;
}
.accel-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.accel-account {
  margin: 0;
  min-width: 200px;
  flex: 0 1 280px;
}
.accel-account select {
  margin-top: 5px;
  border-radius: 8px;
  padding: 8px 10px;
}
.accel-hint {
  margin: 0;
  flex: 1 1 200px;
  padding-bottom: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.accel-bar .cfg-msg {
  flex: 1 1 100%;
  margin: 0;
}

.accel-summary {
  display: grid;
  grid-template-columns: minmax(160px, 200px) 1fr;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
@media (max-width: 720px) {
  .accel-summary { grid-template-columns: 1fr; }
}
.accel-lv-block {
  padding: 16px 18px;
  background: #f8fafc;
  border-right: 1px solid var(--line);
}
@media (max-width: 720px) {
  .accel-lv-block { border-right: 0; border-bottom: 1px solid var(--line); }
}
.accel-lv-label {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.accel-lv-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--text);
}
.accel-lv-prefix {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.accel-progress { margin-top: 12px; }
.accel-progress-track {
  height: 6px;
  border-radius: 99px;
  background: #e8ecf3;
  overflow: hidden;
}
.accel-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: var(--blue);
  transition: width .3s ease;
}
.accel-progress-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

.accel-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 4px 0;
}
@media (max-width: 560px) {
  .accel-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.accel-stats > div {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.accel-stats > div:nth-child(3n) { border-right: 0; }
@media (max-width: 560px) {
  .accel-stats > div:nth-child(3n) { border-right: 1px solid var(--line); }
  .accel-stats > div:nth-child(2n) { border-right: 0; }
}
.accel-stats > div:nth-last-child(-n+3) { border-bottom: 0; }
@media (max-width: 560px) {
  .accel-stats > div:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .accel-stats > div:nth-last-child(-n+2) { border-bottom: 0; }
}
.accel-stats dt {
  margin: 0 0 4px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}
.accel-stats dd {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
}

.accel-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 820px) {
  .accel-cols { grid-template-columns: 1fr; }
}
.accel-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  margin-bottom: 0;
}
.accel-panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  background: #fafbfd;
}
.accel-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--blue-soft);
  color: #1d4ed8;
}
.accel-count.done {
  background: #ecfdf5;
  color: #047857;
}

.accel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 440px;
  overflow: auto;
}
.accel-panel .empty {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 36px 16px;
  color: var(--muted);
}
.accel-task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background .12s ease;
}
.accel-task:last-child { border-bottom: 0; }
.accel-task:hover { background: #f8fafc; }
.accel-task-mark {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--blue);
}
.accel-task.done .accel-task-mark { background: var(--green); }
.accel-task-body { flex: 1; min-width: 0; }
.accel-task-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}
.accel-task-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}
.accel-task-days {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.accel-task.done .accel-task-days { color: #047857; }
.accel-pend-item .accel-one-btn {
  flex-shrink: 0;
  background: transparent;
  border-color: var(--line);
  color: var(--blue);
  font-weight: 650;
}
.accel-pend-item .accel-one-btn:hover {
  background: var(--blue-soft);
  border-color: #bfdbfe;
  color: #1d4ed8;
}
.accel-pend-item .accel-one-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn.tiny {
  padding: 5px 11px;
  font-size: 11px;
  border-radius: 8px;
  flex-shrink: 0;
}
.accel-result-card { margin-bottom: 0; }
.accel-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0;
  border-top: 0;
}
.accel-chip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: transparent;
  font-size: 12px;
}
.accel-chip .accel-chip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.accel-chip.ok { color: #047857; }
.accel-chip.fail { color: #b91c1c; }
.accel-chip b { font-weight: 700; }
.accel-chip small {
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.9;
  font-weight: 400;
  color: var(--muted);
}

/* ---- 设备指纹 ---- */
.dev-shell { display: grid; gap: 12px; }
.dev-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px;
  padding: 12px 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px;
}
.dev-meta {
  flex: 1 1 160px; color: var(--muted); font-size: 11px;
  padding-bottom: 8px; line-height: 1.4;
}
.dev-bar .cfg-msg { flex: 1 1 100%; margin: 0; }
.dev-form {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px 16px;
}
.dev-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  max-width: 560px;
}
@media (max-width: 720px) {
  .dev-grid { grid-template-columns: 1fr; }
}
.dev-hint { margin: 12px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }

/* ---- 扫码测试 ---- */
.scanqr-shell { display: grid; gap: 12px; }
.scanqr-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px;
  padding: 12px 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px;
}
.scanqr-bar .field { margin: 0; min-width: 160px; }
.scanqr-bar .cfg-msg { flex: 1 1 100%; margin: 0; }
.scanqr-main {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr);
  gap: 12px;
}
@media (max-width: 860px) {
  .scanqr-main { grid-template-columns: 1fr; }
}
.scanqr-drop {
  position: relative;
  min-height: 240px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  outline: none;
  overflow: hidden;
  transition: border-color .15s, background .15s;
  cursor: default;
}
.scanqr-drop:hover, .scanqr-drop:focus, .scanqr-drop.dragover {
  border-color: #64748b;
  background: #f8fafc;
}
.scanqr-drop.has-img { border-style: solid; }
.scanqr-drop-wrap { display: grid; gap: 8px; }
.scanqr-drop-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.modal.modal-scanqr-paste { width: min(420px, 94vw); }
.scanqr-paste-catch {
  min-height: 120px; margin: 8px 0 4px; padding: 14px;
  border: 1.5px dashed var(--line); border-radius: 10px;
  background: #f8fafc; color: var(--muted); font-size: 13px; line-height: 1.5;
  outline: none; cursor: text;
  text-align: center;
  display: flex; align-items: center; justify-content: center;
}
.scanqr-paste-catch:focus {
  border-color: #64748b; background: #fff; color: var(--text);
}
.scanqr-drop-hint {
  text-align: center;
  padding: 16px 20px;
  pointer-events: none;
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
}
.scanqr-drop-title { font-weight: 700; font-size: 14px; margin-bottom: 6px; text-align: center; }
.scanqr-drop-sub { color: var(--muted); font-size: 12px; line-height: 1.4; text-align: center; }
.scanqr-preview {
  max-width: 100%; max-height: 320px; object-fit: contain;
  display: block; margin: 0 auto;
}
/* 必须压过 .scanqr-preview 的 display:block，否则空 img 仍占 flex 位、文字被挤偏 */
.scanqr-preview[hidden] {
  display: none !important;
}
.scanqr-side {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
}
.scanqr-side textarea {
  display: block; width: 100%; margin-top: 4px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font: inherit; line-height: 1.4; resize: vertical;
}
.scanqr-side .hint { margin: 8px 0 10px; }
.scanqr-result {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
}
.scanqr-result-hd { font-weight: 700; font-size: 12px; margin-bottom: 8px; }
.scanqr-result pre {
  margin: 0; white-space: pre-wrap; word-break: break-all;
  font-size: 12px; line-height: 1.45; color: #334155;
  max-height: 280px; overflow: auto;
}

.modal.modal-app-update {
  width: min(520px, 94vw);
  max-height: 86vh;
  overflow: auto;
}
.update-ver-line {
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 10px;
  color: var(--text, #111827);
}
.update-notes-label {
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-bottom: 6px;
  font-weight: 600;
}
.update-notes {
  margin: 0 0 12px;
  padding: 10px 12px;
  max-height: 280px;
  min-height: 72px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #0f172a;
}
/* 自定义背景：与输入框同透明度，避免实心白块和半透明卡片打架 */
html.has-custom-bg .update-notes {
  background: rgba(255, 255, 255, var(--custom-input-alpha, 0.42)) !important;
  border-color: rgba(148, 163, 184, 0.55) !important;
  color: #0f172a !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* 弹窗白底：日志框保持实心，保证可读 */
html.has-custom-bg .modal .update-notes {
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}
html.has-custom-bg .update-notes-label {
  color: #334155 !important;
}
html.has-custom-bg .update-progress-track {
  background: rgba(232, 236, 243, var(--custom-input-alpha, 0.42));
}
.update-progress {
  margin: 0 0 12px;
}
.update-progress-track {
  height: 8px;
  border-radius: 99px;
  background: #e8ecf3;
  overflow: hidden;
}
.update-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #3b82f6, #2563eb);
  transition: width .18s ease;
}
.update-progress-bar.indeterminate {
  width: 36% !important;
  animation: updateProgSlide 1.1s ease-in-out infinite;
}
@keyframes updateProgSlide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}
.update-notes-inline {
  max-height: 180px;
  margin-bottom: 10px;
  min-height: 96px;
}
.update-progress-inline {
  margin: 0 0 4px;
}
.modal.modal-license-wide { width: min(520px, 96vw); max-height: 90vh; overflow: auto; margin: 0 auto; }
#modalLicense { z-index: 10050; }
#modalBuy { z-index: 10060; }

.lic-shell { display: grid; gap: 12px; max-width: 720px; }
.lic-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
}

/* —— 购买弹窗 —— */
.modal.buy-modal {
  width: min(560px, 96vw); max-height: 92vh; overflow: auto;
  padding: 18px 18px 16px; border-radius: 16px;
  animation: buyPop .22s ease-out;
}
@keyframes buyPop {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.buy-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.buy-x {
  width: 32px; height: 32px; border: 0; border-radius: 10px; background: #f1f5f9;
  color: #64748b; font-size: 20px; line-height: 1; cursor: pointer;
}
.buy-x:hover { background: #e2e8f0; color: #0f172a; }
.buy-steps {
  display: flex; align-items: center; gap: 0; margin: 16px 0 14px; padding: 0 4px;
}
.buy-step {
  display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap;
}
.buy-step i {
  width: 22px; height: 22px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: #eef2f7; color: #94a3b8; font-style: normal; font-size: 11px; font-weight: 700;
  transition: .2s ease;
}
.buy-step.on { color: #1d4ed8; font-weight: 600; }
.buy-step.on i { background: #2563eb; color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.28); }
.buy-step.done { color: #059669; }
.buy-step.done i { background: #10b981; color: #fff; }
.buy-step-line { flex: 1; height: 2px; background: #e8ecf3; margin: 0 8px; border-radius: 2px; }
.buy-panel { display: none; animation: buyFade .2s ease; }
.buy-panel.on { display: block; }
@keyframes buyFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.buy-kind-tabs {
  display: flex; gap: 8px; margin: 0 0 10px; padding: 4px;
  background: #f1f5f9; border-radius: 12px;
}
.buy-kind {
  flex: 1; border: 0; border-radius: 10px; padding: 8px 10px;
  background: transparent; color: #64748b; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: .15s ease;
}
.buy-kind.on { background: #fff; color: #1d4ed8; box-shadow: 0 2px 8px rgba(15,23,42,.08); }
.buy-pkg-grid { display: grid; gap: 8px; max-height: 280px; overflow: auto; padding-right: 2px; }
.buy-pkg {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff;
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.buy-pkg:hover { border-color: #bfdbfe; box-shadow: 0 4px 14px rgba(37,99,235,.08); transform: translateY(-1px); }
.buy-pkg.on {
  border-color: #2563eb; background: linear-gradient(180deg, #eff6ff 0%, #fff 70%);
  box-shadow: 0 6px 18px rgba(37,99,235,.12);
}
.buy-pkg h4 { margin: 0 0 2px; font-size: 14px; }
.buy-pkg p { margin: 0; color: var(--muted); font-size: 12px; }
.buy-pkg .price { font-weight: 800; font-size: 18px; color: #0f172a; white-space: nowrap; }
.buy-pkg .price small { font-size: 11px; color: var(--muted); font-weight: 500; display: block; text-align: right; }
.buy-note { margin-top: 10px; }
.buy-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.buy-pay-layout {
  display: grid; grid-template-columns: 210px 1fr; gap: 18px; align-items: center;
}
@media (max-width: 560px) {
  .buy-pay-layout { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .buy-actions { justify-content: center; }
}
.buy-qr-wrap {
  position: relative; width: 200px; height: 200px; margin: 0 auto;
  border-radius: 16px; background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.buy-qr-glow {
  position: absolute; inset: -20%; background: radial-gradient(circle, rgba(37,99,235,.16), transparent 60%);
  animation: buyGlow 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes buyGlow {
  0%, 100% { opacity: .45; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1.05); }
}
.buy-qr-wrap canvas, .buy-qr-wrap img { position: relative; z-index: 1; border-radius: 8px; }
.buy-qr-mask {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.82); color: #64748b; font-size: 13px;
}
.buy-pay-meta { min-width: 0; }
.buy-pay-status {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 999px;
  background: #fffbeb; color: #b45309; font-size: 12px; font-weight: 600;
}
.buy-pay-status.ok { background: #ecfdf5; color: #059669; }
.buy-pay-status.err { background: #fef2f2; color: #dc2626; }
.buy-pulse {
  width: 8px; height: 8px; border-radius: 50%; background: currentColor;
  box-shadow: 0 0 0 0 currentColor; animation: buyPulse 1.4s infinite;
}
.buy-pay-status.ok .buy-pulse, .buy-pay-status.err .buy-pulse { animation: none; }
@keyframes buyPulse {
  0% { box-shadow: 0 0 0 0 rgba(180,83,9,.45); }
  70% { box-shadow: 0 0 0 8px rgba(180,83,9,0); }
  100% { box-shadow: 0 0 0 0 rgba(180,83,9,0); }
}
.buy-amount { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 2px; }
.buy-pkg-name { font-size: 14px; color: #334155; margin-bottom: 6px; }
.buy-wait-tip { color: var(--muted); font-size: 12px; margin: 8px 0 12px; }
.buy-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.buy-done { text-align: center; padding: 10px 0 4px; }
.buy-done-icon {
  width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%;
  background: linear-gradient(145deg, #34d399, #059669); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700;
  box-shadow: 0 10px 24px rgba(5,150,105,.28); animation: buyPop .28s ease;
}
.buy-done h3 { margin: 0 0 4px; font-size: 18px; }
.buy-card-box {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding: 12px; border-radius: 12px; background: #f8fafc; border: 1px dashed #cbd5e1;
}
.buy-card-box code { font-size: 14px; word-break: break-all; }

.lic-pkg-list { display: grid; gap: 8px; }
.lic-pkg {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff;
}
.lic-pkg h4 { margin: 0 0 2px; font-size: 14px; }
.lic-pkg p { margin: 0; color: var(--muted); font-size: 12px; }
.lic-pkg .price { font-weight: 700; font-size: 16px; white-space: nowrap; }
.lic-pay-box { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; }
.lic-pay-box canvas, .lic-pay-box img {
  background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 10px; margin: 8px auto;
  display: block;
}
.lic-buy-box { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; }
.lic-status-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.lic-meta { margin: 0; display: grid; gap: 10px; }
.lic-meta > div {
  display: grid; grid-template-columns: 88px 1fr; gap: 8px; align-items: center;
  font-size: 12px;
}
.lic-meta dt { margin: 0; color: var(--muted); }
.lic-meta dd { margin: 0; display: flex; align-items: center; gap: 8px; word-break: break-all; }
.lic-meta code { font-size: 12px; }
.btn.tiny { padding: 2px 8px; font-size: 11px; }

.form-group { margin-bottom: 12px; }
.form-title { font-weight: 700; margin-bottom: 6px; font-size: 12px; }
.cfg-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.cfg-msg { font-size: 12px; color: var(--muted); }
.cfg-msg.ok { color: #059669; }
.cfg-msg.err { color: var(--red); }
.switch, .field { display: block; margin: 6px 0; color: var(--text); }
.field[hidden], .switch[hidden], .lic-pay-box[hidden], .cfg-msg[hidden], .hint[hidden],
.buy-qr-mask[hidden], .buy-panel[hidden], .update-progress[hidden] { display: none !important; }
.switch { display: flex; align-items: center; gap: 6px; color: #475569; font-size: 12px; }
.field input {
  display: block; width: 100%; margin-top: 4px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; outline: none;
  background: #fff; color: var(--text);
}
.field input:focus { border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(79,140,255,.12); }
.field input.no-spin::-webkit-outer-spin-button,
.field input.no-spin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field input.no-spin { -moz-appearance: textfield; appearance: textfield; }
.field select {
  display: block; width: 100%; margin-top: 4px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; outline: none;
  background: #fff; color: var(--text);
}
.field select:focus { border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(79,140,255,.12); }

/* 自定义背景下：输入框/下拉也半透明 */
html.has-custom-bg .field input,
html.has-custom-bg .field select,
html.has-custom-bg .field textarea,
html.has-custom-bg input[type="text"],
html.has-custom-bg input[type="password"],
html.has-custom-bg input[type="number"],
html.has-custom-bg input[type="url"],
html.has-custom-bg input:not([type]),
html.has-custom-bg select,
html.has-custom-bg textarea {
  background: rgba(255, 255, 255, var(--custom-input-alpha, 0.42)) !important;
  border-color: rgba(148, 163, 184, 0.55) !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html.has-custom-bg .field input:focus,
html.has-custom-bg .field select:focus,
html.has-custom-bg .field textarea:focus,
html.has-custom-bg select:focus,
html.has-custom-bg textarea:focus {
  background: rgba(255, 255, 255, 0.62) !important;
  border-color: #93c5fd !important;
}

/* 弹窗是白底：输入框必须实心底+深色描边，否则白边白底看不见 */
html.has-custom-bg .modal .field input,
html.has-custom-bg .modal .field select,
html.has-custom-bg .modal .field textarea,
html.has-custom-bg .modal input[type="text"],
html.has-custom-bg .modal input[type="password"],
html.has-custom-bg .modal input[type="number"],
html.has-custom-bg .modal input[type="url"],
html.has-custom-bg .modal input:not([type]),
html.has-custom-bg .modal select,
html.has-custom-bg .modal textarea {
  background: #fff !important;
  border: 1px solid #cbd5e1 !important;
  color: var(--text, #0f172a) !important;
}
html.has-custom-bg .modal .field input:focus,
html.has-custom-bg .modal .field select:focus,
html.has-custom-bg .modal .field textarea:focus,
html.has-custom-bg .modal select:focus,
html.has-custom-bg .modal textarea:focus {
  background: #fff !important;
  border-color: #93c5fd !important;
  box-shadow: 0 0 0 2px rgba(79,140,255,.12);
}

.modal-add .add-avatar-wrap {
  width: 72px; height: 72px; margin: 4px auto 14px; position: relative;
}
.add-avatar, .add-avatar-ph {
  width: 72px; height: 72px; border-radius: 50%;
  border: 2px solid #e8ecf3; background: #eaf0fb;
}
.add-avatar {
  display: block; object-fit: cover;
}
.add-avatar[hidden] { display: none !important; }
.add-avatar-ph {
  display: grid; place-items: center;
  color: #6b8cc8; font-weight: 800; font-size: 14px;
}
.add-avatar-ph[hidden] { display: none !important; }

.acc-cell { display: flex; align-items: center; gap: 8px; }
.acc-avatar {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
  background: #eaf0fb; border: 1px solid #e8ecf3; flex-shrink: 0;
}
.acc-avatar.broken { opacity: .35; }

/* 授权到期悬浮窗 */
.lic-float {
  position: fixed; left: 50%; top: 50%; z-index: 10040;
  width: min(360px, calc(100vw - 28px));
  transform: translate(-50%, -50%);
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, .16);
  padding: 12px 12px 10px;
  animation: licFloatIn .22s ease-out;
}
.lic-float[hidden] { display: none !important; }
.lic-float.warn { border-color: #fcd34d; background: linear-gradient(180deg, #fffbeb 0%, #fff 55%); }
.lic-float.urgent { border-color: #fdba74; background: linear-gradient(180deg, #fff7ed 0%, #fff 55%); }
.lic-float.expired { border-color: #fecaca; background: linear-gradient(180deg, #fef2f2 0%, #fff 55%); }
@keyframes licFloatIn {
  from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(.98); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}
.lic-float-inner { display: flex; gap: 10px; align-items: flex-start; }
.lic-float-ico {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff; background: #d97706;
}
.lic-float.warn .lic-float-ico { background: #d97706; }
.lic-float.urgent .lic-float-ico { background: #ea580c; }
.lic-float.expired .lic-float-ico { background: #dc2626; }
.lic-float-body { flex: 1; min-width: 0; }
.lic-float-title { font-size: 13px; font-weight: 750; margin-bottom: 2px; }
.lic-float-text { font-size: 12px; color: var(--muted); line-height: 1.4; word-break: break-word; }
.lic-float-x {
  width: 26px; height: 26px; border: 0; border-radius: 8px; background: transparent;
  color: #94a3b8; font-size: 18px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.lic-float-x:hover { background: #f1f5f9; color: #0f172a; }
.lic-float-actions { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }

.top-user {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted, #64748b);
}
.top-user-name {
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 650; color: var(--text, #0f172a);
}
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .28);
  display: flex; align-items: center; justify-content: center;
  z-index: 10050; padding: 16px;
}
.modal-mask[hidden] { display: none !important; }
#modalWebAuth { z-index: 12000; }
body.need-web-auth .app { filter: blur(2px); pointer-events: none; user-select: none; }
.modal {
  width: 340px; max-width: 92vw; background: #fff; border-radius: 12px;
  padding: 14px 16px; box-shadow: 0 12px 32px rgba(15,23,42,.16);
  margin: 0 auto;
}
.modal.modal-login { width: min(560px, 96vw); }
#modalLicense .modal-actions,
#modalBuy .modal-actions {
  justify-content: center;
}
.slider-frame {
  width: 100%; height: 520px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; margin: 6px 0 4px; display: block;
}
.verify-qr-wrap {
  display: flex; justify-content: center; align-items: center;
  margin: 8px 0 4px; padding: 12px; background: #f8fafc;
  border: 1px solid var(--line); border-radius: 12px;
}
.verify-qr {
  width: 280px; height: 280px; image-rendering: pixelated;
  background: #fff; border-radius: 8px;
}
.modal-title { font-size: 14px; font-weight: 750; margin-bottom: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 12px; }
.hint { color: var(--muted); font-size: 12px; margin: 0 0 10px; white-space: pre-line; }
.warn-tip { color: #d97706; font-size: 12px; margin: 0 0 8px; font-weight: 600; }
.ok-tip { color: var(--green); font-size: 13px; margin: 8px 0 4px; font-weight: 650; }
.err {
  color: var(--red); font-size: 12px; margin: 6px 0;
}
.err[hidden] { display: none !important; }
.prog-track {
  height: 6px; background: var(--line); border-radius: 99px; overflow: hidden;
}
.prog-fill {
  height: 100%; width: 0; background: var(--blue); border-radius: 99px;
  transition: width .3s ease;
}
.link { color: var(--blue); display: inline-block; margin: 4px 0 8px; font-size: 12px; }

.hint { color: var(--muted); margin: 0 0 10px; line-height: 1.5; }
.hint code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; font-size: 11px; }
.head-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.head-actions a.btn { text-decoration: none; display: inline-flex; align-items: center; }

.dropzone {
  padding: 28px 16px; margin-bottom: 12px; text-align: center;
  border: 1.5px dashed #c5d0e0; background: #f8fafc; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.dropzone:hover, .dropzone:focus {
  border-color: var(--blue); background: var(--blue-soft); outline: none;
}
.dropzone.dragover {
  border-color: var(--blue); background: #e8f0ff;
  box-shadow: 0 0 0 3px rgba(79,140,255,.18);
}
.dropzone-ico { font-size: 22px; color: var(--blue); margin-bottom: 6px; opacity: .85; }
.dropzone-title { font-weight: 700; font-size: 13px; color: #1e293b; }
.dropzone-sub { margin-top: 4px; color: var(--muted); font-size: 11px; }
.dropzone-status { margin-top: 10px; font-size: 12px; color: #059669; }
.dropzone-status.err { color: var(--red); }

.plugin-list { display: grid; gap: 10px; }
.plugin-card { padding: 12px 14px; }
.plugin-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plugin-meta { margin-top: 4px; font-size: 11px; }
.plugin-desc { margin: 8px 0; color: #475569; line-height: 1.45; }
.plugin-err { color: var(--red); font-size: 11px; margin: 6px 0; word-break: break-all; }
.plugin-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.modal.modal-plugin-settings {
  width: min(440px, 94vw);
  max-height: min(80vh, 640px);
  display: flex; flex-direction: column;
}
.plugin-settings-form {
  overflow: auto; flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 2px 0 4px;
}
.plugin-settings-form .field textarea {
  display: block; width: 100%; margin-top: 4px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
  min-height: 72px; resize: vertical; font: inherit;
}
.plugin-settings-form .switch { margin: 2px 0; }
.btn.ghost.danger { color: var(--red); border-color: #fecaca; }
.btn.ghost.danger:hover { background: #fef2f2; }
.badge {
  font-size: 10px; padding: 2px 7px; border-radius: 99px; background: #eef2f7; color: #64748b;
}
.badge.ok { background: #ecfdf5; color: #059669; }
.badge.err { background: #fef2f2; color: #dc2626; }
.badge.muted { background: #f1f5f9; color: #94a3b8; }

.sdk-root { display: grid; gap: 12px; min-width: 0; }
.sdk-hero { padding: 18px 22px; }
.sdk-hero-title { font-size: 18px; font-weight: 750; display: flex; align-items: center; gap: 8px; }
.sdk-hero-arch { margin: 10px 0 6px; color: #334155; line-height: 1.65; font-size: 14px; }
.sdk-hero-hint { margin: 0; color: var(--muted); line-height: 1.55; font-size: 13px; }
.sdk-block { padding: 16px 20px; }
.sdk-block-title { font-weight: 700; margin-bottom: 10px; color: #1e293b; font-size: 15px; }
.sdk-block-body { margin: 0; color: #475569; line-height: 1.7; font-size: 14px; }
.sdk-items { display: grid; gap: 14px; }
.sdk-item-name { margin-bottom: 4px; }
.sdk-item-name code {
  background: #eef2f7; padding: 3px 8px; border-radius: 5px; font-size: 13px; color: #1d4ed8;
}
.sdk-item-desc { color: #64748b; line-height: 1.55; font-size: 13px; }
.sdk-code {
  margin: 10px 0 0; padding: 14px 16px; background: #0f172a; color: #e2e8f0;
  border-radius: 10px; overflow: auto; font-size: 13px; line-height: 1.55;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap;
}
.sdk-example { max-height: min(70vh, 720px); }

.sdk-fold { padding: 0; overflow: hidden; }
.sdk-fold-summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; font-weight: 650; color: #0f172a; font-size: 14px;
}
.sdk-fold-summary::-webkit-details-marker { display: none; }
.sdk-fold-summary:hover { background: #f8fafc; }
.sdk-fold-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; font-weight: 650; word-break: break-all;
}
.sdk-fold-chevron {
  flex: 0 0 auto; width: 8px; height: 8px;
  border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8;
  transform: rotate(-45deg); transition: transform .15s ease; margin-top: -2px;
}
.sdk-fold[open] > .sdk-fold-summary .sdk-fold-chevron {
  transform: rotate(45deg); margin-top: 2px;
}
.sdk-fold-body { padding: 0 18px 16px; border-top: 1px solid #e2e8f0; }

.sdk-expand-bar {
  display: inline-flex; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden;
}
.sdk-expand-btn {
  border: 0 !important; border-radius: 0 !important; margin: 0 !important;
  padding: 6px 10px !important; font-size: 12px !important;
  background: #fff !important; color: #64748b !important;
}
.sdk-expand-btn + .sdk-expand-btn { border-left: 1px solid #e2e8f0 !important; }
.sdk-expand-btn.active {
  background: var(--blue-soft) !important; color: var(--blue) !important; font-weight: 650;
}

body.sdk-page {
  background: linear-gradient(180deg, #eef3fb 0%, var(--bg) 160px);
  min-height: 100vh;
  font-size: 14px;
}
.sdk-shell {
  width: min(1480px, calc(100vw - 48px));
  max-width: none;
  margin: 0 auto;
  padding: 28px 0 56px;
  box-sizing: border-box;
}
.sdk-top {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(240px, 420px) minmax(160px, 1fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.sdk-top-left { min-width: 0; }
.sdk-top-center {
  display: flex; justify-content: center; align-items: center; min-width: 0;
}
.sdk-top h1 {
  margin: 8px 0 0; font-size: 28px; font-weight: 800; color: #0f172a;
}
.sdk-back {
  color: var(--blue); text-decoration: none; font-size: 13px;
}
.sdk-back:hover { text-decoration: underline; }
.sdk-top-right {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
}
.sdk-search {
  position: relative; display: flex; align-items: center; gap: 8px;
  width: 100%; max-width: 420px; margin: 0; box-sizing: border-box;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 8px 0 12px; height: 36px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.sdk-search:hover { border-color: #d7dee8; }
.sdk-search:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(79, 140, 255, .14);
}
.sdk-search-ico {
  flex: 0 0 auto; color: #94a3b8; display: block;
}
.sdk-search:focus-within .sdk-search-ico { color: var(--blue); }
.sdk-search input,
.sdk-search input[type="text"],
.sdk-search input[type="search"] {
  flex: 1 1 auto; min-width: 0; width: 100%;
  border: 0 !important; outline: none !important; box-shadow: none !important;
  background: transparent !important; color: var(--text);
  font-size: 13px; height: 100%; padding: 0; margin: 0;
  -webkit-appearance: none; appearance: none;
}
.sdk-search input::placeholder { color: #94a3b8; }
.sdk-search input::-webkit-search-decoration,
.sdk-search input::-webkit-search-cancel-button,
.sdk-search input::-webkit-search-results-button,
.sdk-search input::-webkit-search-results-decoration {
  -webkit-appearance: none; display: none;
}
.sdk-search-clear {
  border: 0; background: transparent; color: #94a3b8; cursor: pointer;
  width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto;
  font-size: 15px; line-height: 1; padding: 0;
  display: grid; place-items: center;
}
.sdk-search-clear:hover { background: #f1f5f9; color: #475569; }
.sdk-search-meta {
  margin: 0 0 10px; color: var(--muted); font-size: 13px;
}
.sdk-hit {
  padding: 14px 16px; cursor: pointer; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; text-align: left; width: 100%;
  display: grid; gap: 4px; transition: border-color .15s ease, background .15s ease;
}
.sdk-hit:hover { border-color: #bfdbfe; background: #f8fbff; }
.sdk-hit-cat {
  font-size: 12px; color: #94a3b8; font-weight: 650;
}
.sdk-hit-name {
  font-size: 14px; font-weight: 700; color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.sdk-hit-desc { font-size: 13px; color: #64748b; line-height: 1.5; }
.sdk-hit mark {
  background: #fef08a; color: inherit; padding: 0 1px; border-radius: 2px;
}
.sdk-nav-empty {
  padding: 10px 12px; color: var(--muted); font-size: 13px;
}

.sdk-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px; align-items: start;
  min-height: calc(100vh - 150px);
}
.sdk-nav { padding: 14px 12px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.sdk-nav-title {
  font-size: 12px; color: var(--muted); font-weight: 700;
  padding: 2px 10px 10px; letter-spacing: .02em;
}
.sdk-nav-group {
  margin: 0; list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 10px 6px; font-size: 11px; font-weight: 700;
  color: #94a3b8; letter-spacing: .06em; text-transform: uppercase;
}
.sdk-nav-group::-webkit-details-marker { display: none; }
.sdk-nav-group:hover { color: #64748b; }
.sdk-nav-group-label { min-width: 0; }
.sdk-nav-group-chevron {
  flex: 0 0 auto; width: 7px; height: 7px;
  border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8;
  transform: rotate(-45deg); transition: transform .15s ease; margin-top: -2px;
}
.sdk-nav-fold { margin: 4px 0 2px; }
.sdk-nav-fold[open] > .sdk-nav-group .sdk-nav-group-chevron {
  transform: rotate(45deg); margin-top: 2px;
}
.sdk-nav-group-body { display: grid; gap: 2px; padding: 0 0 4px; }
.sdk-nav-fold:first-child { margin-top: 0; }
.sdk-nav-list { display: grid; gap: 2px; }
.sdk-nav-item {
  border: 0; background: transparent; text-align: left;
  padding: 9px 12px; border-radius: 9px; cursor: pointer;
  color: #64748b; font-size: 13.5px; width: 100%;
}
.sdk-nav-item:hover { background: #f1f5f9; color: var(--text); }
.sdk-nav-item.active {
  background: var(--blue-soft); color: var(--blue); font-weight: 650;
}
.sdk-cat-head { padding: 22px 24px; }
.sdk-cat-title { font-size: 24px; font-weight: 750; color: #0f172a; }
.sdk-cat-summary { margin: 12px 0 0; color: #475569; line-height: 1.7; font-size: 15px; }

@media (max-width: 960px) {
  .sdk-shell {
    width: calc(100% - 20px);
    max-width: 100%;
    padding: 12px 0 28px;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }
  .sdk-layout {
    grid-template-columns: 1fr;
    gap: 12px;
    min-height: 0;
  }
  /* 移动端保持单列导航，避免 chip 换行错位 */
  .sdk-nav {
    position: static;
    max-height: none;
    padding: 10px 8px;
  }
  .sdk-nav-list {
    display: grid;
    gap: 2px;
  }
  .sdk-nav-fold { width: 100%; margin: 2px 0; }
  .sdk-nav-group {
    width: 100%;
    margin: 0;
    padding: 10px 10px 8px;
    font-size: 12px;
    letter-spacing: .02em;
    text-transform: none;
    color: #64748b;
  }
  .sdk-nav-group-body {
    display: grid;
    gap: 2px;
    padding: 0 0 6px;
  }
  .sdk-nav-item {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.35;
    word-break: break-word;
  }
  .sdk-top {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .sdk-top-center { order: 2; }
  .sdk-top-right {
    order: 3;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
  }
  .sdk-top-right .badge {
    flex: 0 0 auto;
  }
  .sdk-expand-bar {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
  }
  .sdk-expand-btn {
    flex: 1 1 0;
    padding: 7px 6px !important;
    white-space: nowrap;
  }
  .sdk-top-right > .btn {
    flex: 0 0 auto;
    padding: 7px 10px;
    font-size: 12px;
  }
  .sdk-top h1 { font-size: 22px; margin-top: 4px; }
  .sdk-cat-head { padding: 16px 16px; }
  .sdk-cat-title { font-size: 20px; }
  .sdk-cat-summary { font-size: 14px; margin-top: 8px; }
  .sdk-search { max-width: none; }
  .sdk-root {
    scroll-margin-top: 12px;
    gap: 10px;
  }
  .sdk-fold-summary { padding: 12px 14px; }
  .sdk-fold-body { padding: 0 14px 14px; }
  .sdk-code {
    font-size: 12px;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
  }
  .sdk-example { max-height: min(60vh, 520px); }
}

.backdrop {
  display: none; position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 25;
}
.backdrop.show { display: block; }

@media (max-width: 980px) {
  .gauges-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed; left: 0; top: 0; transform: translateX(-105%);
    transition: transform .2s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .icon-btn { display: inline-grid; place-items: center; }
  .gauges-row { grid-template-columns: 1fr 1fr; }
  .traffic-metric b { font-size: 16px; }
  .content { padding: 8px 10px 12px; }
}
