:root {
  --blue: #2f7fc1;
  --blue-600: #256fa9;
  --blue-700: #1f5f92;
  --blue-50: #eef6fc;
  --blue-100: #dcecf8;
  --ink: #1f2937;
  --ink-2: #374151;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --line: #e5e7eb;
  --line-2: #eef0f3;
  --bg: #f4f6f9;
  --white: #ffffff;
  --green: #16a34a;
  --green-50: #ecfdf3;
  --amber: #d97706;
  --amber-50: #fffbeb;
  --red: #dc2626;
  --red-50: #fef2f2;
  --indigo: #4f46e5;
  --indigo-50: #eef2ff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 8px 24px rgba(15, 35, 60, .08);
  --shadow-lg: 0 24px 60px rgba(15, 35, 60, .2);
  --radius: 10px;
  --radius-sm: 7px;
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
button { cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.icon { flex: 0 0 auto; vertical-align: -3px; }
.mono { font-family: "Cascadia Mono", "SFMono-Regular", Consolas, "Courier New", monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.ellipsis { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.break { word-break: break-all; }
.inline-form { display: inline-flex; margin: 0; }

/* ---------- 顶栏 / 布局 ---------- */
.admin-body { background: var(--bg); min-height: 100vh; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 54px; flex: 0 0 54px; background: linear-gradient(90deg, #2f7fc1 0%, #3b8bca 100%);
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 2px 10px rgba(20,60,100,.12);
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; font-weight: 700; letter-spacing: .5px; }
.brand-mark { width: 26px; height: 26px; display: grid; place-items: center; background: rgba(255,255,255,.18); border-radius: 7px; }
.brand-name { font-size: 16px; white-space: nowrap; }
.brand-version { font-size: 11px; font-weight: 400; opacity: .7; margin-left: 2px; }
.device-pill { font-size: 12px; color: rgba(255,255,255,.9); background: rgba(255,255,255,.12); padding: 4px 10px; border-radius: 20px; white-space: nowrap; }
.device-pill b { color: #fff; }
.top-sep { width: 1px; height: 18px; background: rgba(255,255,255,.25); }
.top-user { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #fff; white-space: nowrap; }
.logout-btn { background: transparent; border: 0; color: rgba(255,255,255,.9); padding: 5px; border-radius: 6px; display: grid; place-items: center; }
.logout-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.icon-btn { border: 0; background: transparent; color: inherit; padding: 6px; border-radius: 6px; display: inline-grid; place-items: center; }
.menu-btn { display: none; color: #fff; }

.app-body { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: 218px; flex: 0 0 218px; background: var(--white); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between; padding: 14px 10px 16px;
  position: sticky; top: 54px; height: calc(100vh - 54px); overflow-y: auto;
}
.nav-group { margin-bottom: 16px; }
.nav-caption { font-size: 11px; color: var(--muted-2); letter-spacing: 1px; padding: 0 12px 7px; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 7px; color: var(--ink-2); font-size: 13.5px; margin-bottom: 2px; transition: .15s; }
.nav-item:hover { background: #f5f8fb; color: var(--blue); }
.nav-item.active { background: var(--blue-50); color: var(--blue-600); font-weight: 600; box-shadow: inset 3px 0 0 var(--blue); }
.nav-item .icon { opacity: .85; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line-2); }
.side-status { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot-green { background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }
.side-version { font-size: 11px; color: var(--muted-2); margin-top: 6px; }

.main { flex: 1; min-width: 0; padding: 20px 22px 40px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { margin: 2px 0 2px; font-size: 23px; line-height: 1.25; letter-spacing: .3px; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 2px; color: var(--blue); opacity: .8; }
.page-sub { margin: 0; color: var(--muted); font-size: 13px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 15px; border-radius: 7px; border: 1px solid transparent; font-size: 13px; font-weight: 500; white-space: nowrap; transition: .15s; line-height: 1; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); box-shadow: 0 1px 2px rgba(47,127,193,.25); }
.btn-primary:hover { background: var(--blue-600); border-color: var(--blue-600); }
.btn-light { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-light:hover { border-color: #cbd5e1; background: #fafbfc; color: var(--blue-600); }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-ghost:hover { color: var(--blue); background: var(--blue-50); }
.btn-danger-light { background: #fff; color: #c24141; border-color: #f0caca; }
.btn-danger-light:hover { background: var(--red-50); border-color: #e7a9a9; }
.btn-block { width: 100%; }
.btn-lg { height: 44px; font-size: 15px; border-radius: 8px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-mini { height: 28px; padding: 0 9px; font-size: 12px; border-radius: 5px; }
.mini-icon { border: 0; background: transparent; color: var(--muted); padding: 3px; border-radius: 4px; display: inline-grid; place-items: center; }
.mini-icon:hover { color: var(--blue); background: var(--blue-50); }
.link-more { color: var(--blue); font-size: 12.5px; display: inline-flex; align-items: center; gap: 2px; }
.link-more:hover { color: var(--blue-700); text-decoration: underline; }

/* ---------- 卡片 / 表单 ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head p { margin: 3px 0 0; font-size: 12px; }
.card-head .badge { margin-top: 2px; }
.form-card { padding-bottom: 4px; }
.form-card .form-stack { padding: 18px 20px 20px; }
.form-stack { display: flex; flex-direction: column; gap: 15px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field-label i { color: var(--red); font-style: normal; }
.field-help { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }
.field input, .field select, .field textarea, .filter-item input, .filter-item select {
  width: 100%; border: 1px solid #dce1e7; border-radius: 7px; background: #fff; color: var(--ink);
  padding: 8px 11px; height: 36px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus, .filter-item input:focus, .filter-item select:focus {
  border-color: #7fb4dc; box-shadow: 0 0 0 3px rgba(47,127,193,.12);
}
.field input:disabled, .field select:disabled { background: #f7f8fa; color: var(--muted); }
.code-input { font-family: "Cascadia Mono", Consolas, monospace !important; font-size: 12.5px !important; }
.form-actions { display: flex; justify-content: flex-end; padding-top: 2px; }
.form-hint { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: #8a6d3b; background: #fffaf0; border: 1px solid #f5e5c8; padding: 9px 11px; border-radius: 7px; line-height: 1.55; }
.form-hint .icon { margin-top: 1px; color: #c08a2e; }

/* ---------- 徽标 / 状态 ---------- */
.badge { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 4px; font-size: 11.5px; line-height: 1; white-space: nowrap; }
.badge-soft { background: #f1f4f7; color: #5b6b7b; }
.badge-blue { background: var(--blue-50); color: var(--blue-600); }
.status { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 11.5px; white-space: nowrap; font-weight: 500; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-right: 5px; opacity: .85; }
.status-submitted { background: var(--blue-50); color: #2471a3; }
.status-processing { background: var(--amber-50); color: #b45309; }
.status-completed, .status-active { background: var(--green-50); color: #15803d; }
.status-failed { background: var(--red-50); color: #b91c1c; }
.status-cancelled, .status-disabled { background: #f3f4f6; color: #6b7280; }
.status-link-unused { background: var(--green-50); color: #15803d; }
.status-link-used { background: #f3f4f6; color: #6b7280; }
.status-link-disabled { background: #f3f4f6; color: #6b7280; }
.status-link-expired { background: var(--red-50); color: #b91c1c; }

/* ---------- 过滤 / 工具栏 ---------- */
.filter-card { padding: 14px 16px; margin-bottom: 14px; }
.filter-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.filter-form-wrap { row-gap: 10px; }
.filter-item { display: flex; flex-direction: column; gap: 5px; min-width: 145px; }
.filter-item.grow { flex: 1 1 260px; min-width: 220px; }
.filter-item label { font-size: 12px; color: var(--muted); font-weight: 500; }
.filter-item input, .filter-item select { height: 35px; background: #fbfcfd; }
.filter-actions { display: flex; align-items: center; gap: 6px; padding-bottom: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.toolbar-left { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar-right { font-size: 12.5px; }
.toolbar-right b { color: var(--ink); }

/* ---------- 表格 ---------- */
.table-card { overflow: hidden; }
.table-card.flush { padding: 0; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.data-table th { background: #f8fafc; color: #5c6b7a; font-weight: 600; text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 12px; }
.data-table td { padding: 12px 13px; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--ink-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fbfcfe; }
.data-table .check-col { width: 38px; padding-left: 14px; padding-right: 4px; }
.data-table input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--blue); cursor: pointer; }
.table-links { min-width: 1320px; }
.table-orders { min-width: 1260px; }
.cell-strong { color: var(--ink); font-weight: 600; }
.link-id-cell { display: inline-flex; align-items: center; gap: 4px; }
.quota { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; color: var(--ink-2); }
.sticky-col { position: sticky; right: 0; background: #fff; box-shadow: -6px 0 10px -8px rgba(15,35,60,.18); }
.data-table th.sticky-col { background: #f8fafc; z-index: 2; }
.data-table tr:hover td.sticky-col { background: #fbfcfe; }
.row-actions { display: flex; align-items: center; gap: 5px; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; flex-wrap: wrap; }
.pager { display: flex; align-items: center; gap: 4px; }
.pager-btn { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-2); font-size: 12.5px; background: #fff; }
.pager-btn:hover { border-color: #9dc6e5; color: var(--blue); }
.pager-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.pager-btn.disabled { pointer-events: none; opacity: .45; }
.pager-dots { color: var(--muted-2); padding: 0 3px; }
.pager-info { margin-left: 6px; color: var(--muted); font-size: 12px; }
.empty { padding: 42px 10px; text-align: center; color: var(--muted-2); }
.empty .icon { opacity: .5; }
.empty p { margin: 9px 0 0; font-size: 13px; }

/* ---------- 仪表盘 ---------- */
.action-hero { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 21px 24px; margin-bottom: 14px; border-radius: 12px; color: #fff; background: linear-gradient(120deg, #246a9f 0%, #2f7fc1 58%, #4f9dd6 100%); box-shadow: 0 10px 24px rgba(37,111,169,.2); position: relative; overflow: hidden; }
.action-hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -70px; top: -120px; border-radius: 50%; background: rgba(255,255,255,.08); }
.action-hero-text { position: relative; z-index: 1; max-width: 720px; }
.action-kicker { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: rgba(255,255,255,.8); background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.16); padding: 3px 9px; border-radius: 20px; margin-bottom: 8px; }
.action-hero h2 { margin: 0 0 5px; font-size: 19px; line-height: 1.45; letter-spacing: .3px; }
.action-hero p { margin: 0; font-size: 12.5px; color: rgba(255,255,255,.78); line-height: 1.7; }
.action-buttons { position: relative; z-index: 1; display: flex; gap: 9px; flex: 0 0 auto; }
.action-hero .btn-primary { background: #fff; border-color: #fff; color: #1f5f92; box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.action-hero .btn-primary:hover { background: #f2f8fd; border-color: #f2f8fd; color: #174b73; }
.action-hero .btn-light { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); color: #fff; }
.action-hero .btn-light:hover { background: rgba(255,255,255,.2); color: #fff; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin-bottom: 14px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px 13px; box-shadow: var(--shadow-sm); display: grid; grid-template-columns: 42px 1fr; grid-template-rows: auto auto; column-gap: 12px; }
.stat-icon { grid-row: 1 / 3; width: 42px; height: 42px; border-radius: 9px; display: grid; place-items: center; align-self: center; }
.stat-icon.blue { background: var(--blue-50); color: var(--blue); }
.stat-icon.green { background: var(--green-50); color: var(--green); }
.stat-icon.indigo { background: var(--indigo-50); color: var(--indigo); }
.stat-icon.amber { background: var(--amber-50); color: var(--amber); }
.stat-icon.red { background: var(--red-50); color: var(--red); }
.stat-icon.slate { background: #f1f5f9; color: #475569; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: .3px; color: var(--ink); }
.stat-foot { grid-column: 2; font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }
.stat-foot b { color: var(--ink-2); font-weight: 600; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .9fr); gap: 14px; margin-bottom: 14px; }
.chart-card { padding-bottom: 10px; }
.bar-chart { display: flex; align-items: flex-end; gap: 16px; height: 210px; padding: 16px 22px 8px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; }
.bar-value { font-size: 11.5px; color: var(--muted); height: 16px; }
.bar-track { width: 100%; max-width: 38px; flex: 1; display: flex; align-items: flex-end; background: #f5f7fa; border-radius: 5px 5px 2px 2px; overflow: hidden; }
.bar-fill { width: 100%; background: linear-gradient(180deg, #63a9dc, #2f7fc1); border-radius: 5px 5px 2px 2px; transition: height .3s; min-height: 3px; }
.bar-label { font-size: 11.5px; color: var(--muted); }
.guide-card { padding-bottom: 16px; }
.steps { list-style: none; margin: 0; padding: 16px 20px 8px; display: flex; flex-direction: column; gap: 15px; }
.steps li { display: flex; gap: 11px; }
.step-no { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; background: var(--blue-50); color: var(--blue-600); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.steps b { font-size: 13px; }
.steps p { margin: 2px 0 0; font-size: 12px; color: var(--muted); line-height: 1.55; }
.guide-actions { display: flex; gap: 7px; padding: 10px 20px 0; }

/* ---------- 通知 / 提示 ---------- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.flash { display: flex; align-items: center; gap: 8px; padding: 10px 13px; border-radius: 7px; font-size: 13px; border: 1px solid; }
.flash-success { background: var(--green-50); border-color: #bbf7d0; color: #15803d; }
.flash-error { background: var(--red-50); border-color: #fecaca; color: #b91c1c; }
.notice-banner { display: flex; gap: 11px; align-items: flex-start; background: #fffaf0; border: 1px solid #f3e2bf; border-radius: 9px; padding: 13px 15px; margin-bottom: 14px; color: #795b25; font-size: 12.5px; line-height: 1.6; }
.notice-icon { color: #c08a2e; margin-top: 1px; }
.notice-banner b { color: #6b4c18; }

/* ---------- 下拉菜单 ---------- */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 5px); min-width: 150px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 5px; z-index: 20; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 7px; width: 100%; padding: 8px 9px; border: 0; background: transparent; border-radius: 5px; text-align: left; font-size: 12.5px; color: var(--ink-2); }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: #f5f8fb; color: var(--blue); }
.dropdown-menu button.danger { color: var(--red); }
.dropdown-menu button.danger:hover { background: var(--red-50); }

/* ---------- 弹窗 ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 28, 45, .46); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(2px); }
.modal { width: 100%; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); max-height: 90vh; display: flex; flex-direction: column; animation: modalIn .12s ease-out; }
@keyframes modalIn { from { transform: translateY(6px) scale(.995); opacity: .7; } to { transform: none; opacity: 1; } }
.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 780px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 17px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head p { margin: 3px 0 0; font-size: 12px; }
.modal-close { border: 0; background: transparent; color: var(--muted); padding: 4px; border-radius: 5px; display: grid; place-items: center; }
.modal-close:hover { background: #f3f4f6; color: var(--ink); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line-2); background: #fcfdfe; border-radius: 0 0 12px 12px; }
.result-summary { display: flex; gap: 34px; padding: 4px 0 14px; }
.result-summary div { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.result-summary b { font-size: 15px; }
.result-list { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; padding: 5px; }
.result-line { display: flex; align-items: center; gap: 8px; padding: 6px 7px; border-radius: 5px; font-size: 12px; }
.result-line:hover { background: #f1f6fa; }
.result-line .idx { width: 30px; color: var(--muted-2); flex: 0 0 30px; }
.result-line code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #334155; }
.result-line .result-open { flex: 0 0 auto; font-size: 11.5px; color: var(--blue); padding: 2px 5px; }
.result-line .result-open:hover { text-decoration: underline; }
.result-line .mini-icon { flex: 0 0 auto; }

/* ---------- 订单详情 ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.detail-item { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); font-size: 12.5px; }
.detail-item:nth-last-child(-n+2) { border-bottom: 0; }
.detail-item span { color: var(--muted); flex: 0 0 auto; }
.detail-item b { text-align: right; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.ck-panel { margin-top: 16px; border: 1px solid #f0d7a8; background: #fffdf7; border-radius: 8px; overflow: hidden; }
.ck-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 11px 13px; border-bottom: 1px solid #f3e6c9; }
.ck-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; color: #8a6320; }
.ck-head p { margin: 3px 0 0; font-size: 11.5px; color: #a58a5b; }
.ck-actions { display: flex; gap: 5px; }
.ck-value { margin: 0; padding: 12px 13px; min-height: 48px; max-height: 130px; overflow: auto; white-space: pre-wrap; word-break: break-all; font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; color: #4b3a1c; background: transparent; }
.detail-meta { margin-top: 12px; font-size: 11.5px; color: var(--muted-2); overflow-wrap: anywhere; }
.raw-panel { margin-top: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; }
.raw-panel summary { cursor: pointer; padding: 9px 11px; font-size: 12px; color: #566475; user-select: none; }
.raw-panel pre { margin: 0; padding: 0 12px 12px; max-height: 180px; overflow: auto; font-family: "Cascadia Mono", Consolas, monospace; font-size: 11px; line-height: 1.6; color: #526172; white-space: pre-wrap; word-break: break-all; }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 14px; align-items: start; }
.settings-main { display: flex; flex-direction: column; gap: 14px; }
.settings-side { display: flex; flex-direction: column; gap: 14px; }
.info-card { padding-bottom: 16px; }
.info-card .card-head { padding-bottom: 12px; }
.info-card > .btn, .info-card > .info-row, .info-card > p { margin-left: 20px; margin-right: 20px; }
.info-row { display: flex; flex-direction: column; gap: 3px; margin-top: 12px; font-size: 12px; }
.info-row > span:first-child { color: var(--muted); }
.info-row b, .info-row code { font-size: 12.5px; color: var(--ink-2); }
.info-row code { background: #f6f8fa; border: 1px solid var(--line-2); border-radius: 5px; padding: 6px 8px; line-height: 1.5; }
.info-card > .btn { margin-top: 8px; }
.info-card > p { margin-top: 12px; margin-bottom: 0; }
.tip-card { padding: 16px 18px; background: #f8fbfe; border-color: #dbeaf6; }
.tip-title { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--blue-700); font-size: 13px; margin-bottom: 8px; }
.tip-card ul { margin: 0; padding-left: 18px; color: #526579; font-size: 12px; line-height: 1.8; }

/* ---------- 登录 ---------- */
.login-body { min-height: 100vh; background: #eef3f8; }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; }
.login-visual { position: relative; overflow: hidden; background: linear-gradient(145deg, #1e5f93 0%, #2f7fc1 55%, #4a9ad6 100%); color: #fff; display: flex; align-items: center; padding: 64px; }
.login-visual::before, .login-visual::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.07); }
.login-visual::before { width: 420px; height: 420px; right: -120px; top: -100px; }
.login-visual::after { width: 300px; height: 300px; left: -90px; bottom: -90px; background: rgba(255,255,255,.05); }
.login-visual-inner { position: relative; z-index: 1; max-width: 470px; }
.login-logo { width: 52px; height: 52px; border-radius: 13px; background: rgba(255,255,255,.16); display: grid; place-items: center; margin-bottom: 28px; box-shadow: 0 8px 22px rgba(0,0,0,.1); }
.login-visual h1 { font-size: 38px; line-height: 1.35; margin: 0 0 18px; letter-spacing: 1px; font-weight: 700; }
.login-visual > .login-visual-inner > p { color: rgba(255,255,255,.82); font-size: 15px; line-height: 1.9; margin: 0 0 26px; max-width: 420px; }
.login-points { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 11px; color: rgba(255,255,255,.92); font-size: 13.5px; }
.login-points li { display: flex; align-items: center; gap: 9px; }
.login-points .icon { color: #b8eccb; }
.login-visual-foot { margin-top: 54px; font-size: 12px; color: rgba(255,255,255,.55); letter-spacing: .5px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: #fff; }
.login-box { width: 100%; max-width: 360px; }
.login-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 2.5px; color: var(--blue); opacity: .7; }
.login-box h2 { font-size: 26px; margin: 7px 0 4px; }
.login-sub { color: var(--muted); font-size: 13px; margin: 0 0 26px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.input-wrap { display: flex; align-items: center; gap: 9px; border: 1px solid #dce1e7; border-radius: 8px; padding: 0 11px; height: 44px; background: #fbfcfd; transition: .15s; }
.input-wrap:focus-within { border-color: #7fb4dc; box-shadow: 0 0 0 3px rgba(47,127,193,.12); background: #fff; }
.input-wrap .icon { color: var(--muted-2); }
.input-wrap input { border: 0; outline: none; background: transparent; flex: 1; height: 42px; font-size: 14px; color: var(--ink); }
.login-tip { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--muted-2); line-height: 1.7; }

/* ---------- 错误页 ---------- */
.error-body { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.error-card { text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 42px 52px; box-shadow: var(--shadow); max-width: 440px; }
.error-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--red-50); color: var(--red); display: grid; place-items: center; margin: 0 auto 12px; }
.error-code { font-size: 42px; font-weight: 800; color: var(--ink); line-height: 1; letter-spacing: 2px; }
.error-card h1 { font-size: 15px; font-weight: 500; color: var(--muted); margin: 12px 0 24px; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; top: 68px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { min-width: 220px; max-width: 380px; background: #1f2937; color: #fff; padding: 10px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow-lg); animation: toastIn .18s ease-out; display: flex; align-items: center; gap: 8px; }
.toast.success { background: #166534; }
.toast.error { background: #991b1b; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .menu-btn { display: inline-grid; }
  .sidebar { position: fixed; left: 0; top: 54px; z-index: 60; transform: translateX(-100%); transition: transform .18s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .main { padding: 16px 14px 30px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { padding: 28px 20px; background: #f7fafc; }
  .login-box { background: #fff; padding: 28px 24px; border-radius: 14px; box-shadow: var(--shadow); }
  .device-pill, .top-sep { display: none; }
  .form-row, .detail-grid { grid-template-columns: 1fr; }
  .detail-item:nth-last-child(-n+2) { border-bottom: 1px solid var(--line-2); }
  .detail-item:last-child { border-bottom: 0; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .action-hero { flex-direction: column; align-items: flex-start; padding: 18px; }
  .action-buttons { width: 100%; }
  .action-buttons .btn { flex: 1; }
  .bar-chart { gap: 7px; padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 10px; }
  .brand-name { font-size: 14px; }
  .brand-version { display: none; }
  .top-user { font-size: 12px; }
  .stat-grid { grid-template-columns: 1fr; }
  .filter-item, .filter-item.grow { min-width: 100%; flex-basis: 100%; }
  .filter-actions { width: 100%; }
  .filter-actions .btn { flex: 1; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .modal-backdrop { padding: 12px; }
  .modal { max-height: 94vh; }
}
