:root {
  --bg: #070a0f;
  --bg-soft: #0b0f16;
  --panel: #101722;
  --panel-2: #141c28;
  --panel-3: #18212f;
  --border: #1c2534;
  --border-soft: #161e2b;
  --text: #e8eff7;
  --muted: #8697ac;
  --dim: #5b6a7e;
  --brand: #f0b90b;
  --brand-dim: rgba(240, 185, 11, 0.14);
  --up: #f6465d;
  --down: #0ecb81;
  --info: #4c8dff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }

:root { color-scheme: dark; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(900px 500px at 12% -10%, rgba(240, 185, 11, 0.07), transparent 65%),
    radial-gradient(800px 480px at 100% 0%, rgba(76, 141, 255, 0.07), transparent 60%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #223046; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #2d3e58; }

/* ===================== 登录页 ===================== */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.login-visual {
  position: relative;
  overflow: hidden;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid var(--border-soft);
  background:
    radial-gradient(600px 400px at 20% 20%, rgba(240, 185, 11, 0.12), transparent 70%),
    radial-gradient(500px 400px at 80% 80%, rgba(76, 141, 255, 0.1), transparent 70%),
    #080b11;
}
.login-visual .grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(600px 500px at 40% 40%, #000 20%, transparent 85%);
  pointer-events: none;
}
.login-brand { display: flex; align-items: center; gap: 12px; position: relative; }
.login-brand .mark { width: 40px; height: 40px; }
.login-brand h1 { font-size: 17px; margin: 0; letter-spacing: 0.4px; font-weight: 600; }
.login-brand span { display: block; font-size: 11px; color: var(--dim); letter-spacing: 1.6px; text-transform: uppercase; margin-top: 2px; }

.login-hero { position: relative; max-width: 460px; }
.login-hero h2 {
  font-size: 34px;
  line-height: 1.28;
  margin: 0 0 16px;
  font-weight: 650;
  letter-spacing: -0.4px;
}
.login-hero h2 em { font-style: normal; color: var(--brand); }
.login-hero p { color: var(--muted); line-height: 1.85; margin: 0; font-size: 13.5px; }
.login-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 26px; position: relative; }
.login-chips span {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
}
.login-foot { position: relative; font-size: 12px; color: var(--dim); }

.login-form-side { display: flex; align-items: center; justify-content: center; padding: 40px 32px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h3 { font-size: 22px; margin: 0 0 6px; font-weight: 600; }
.login-card .sub { color: var(--dim); font-size: 13px; margin-bottom: 28px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.2px; }
.input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input::placeholder { color: #4a5769; }
.input:focus { border-color: #3a4c66; box-shadow: 0 0 0 3px rgba(76, 141, 255, 0.12); background: var(--panel-2); }
.input:disabled { color: var(--dim); background: #0d1219; }

/* 深色主题下强制表单文字为浅色，避免浏览器默认黑字看不清 */
input, textarea, select {
  color: var(--text);
  caret-color: var(--brand);
  background-color: transparent;
}
input[type="text"], input[type="password"], input[type="number"], input[type="search"],
input[type="email"], input[type="url"], input:not([type]), textarea, select {
  color: var(--text);
}
.input, .input:focus, .input:hover { color: var(--text); }
textarea.input { color: var(--text); }
.input::placeholder, textarea::placeholder, input::placeholder {
  color: #6d7f96;
  opacity: 1;
}
select.input option, select option {
  background-color: #101722;
  color: #e8eff7;
}
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus,
textarea:-webkit-autofill, select:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #101722 inset;
  box-shadow: 0 0 0 1000px #101722 inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-out 0s;
}
.input.mono { letter-spacing: 0.5px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, border-color 0.15s, transform 0.08s, opacity 0.15s;
  white-space: nowrap;
  font-size: 13px;
}
.btn:hover { background: var(--panel-3); border-color: #2a3850; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #f7c62b, #e0a900);
  border-color: #d9a400;
  color: #1a1400;
  font-weight: 600;
}
.btn-primary:hover { background: linear-gradient(180deg, #ffd34d, #e8b000); border-color: #e8b000; }
.btn-block { width: 100%; padding: 12px; font-size: 14px; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--panel-2); }
.btn-danger { color: #ff8b98; border-color: #3a2029; background: rgba(246, 70, 93, 0.08); }
.btn-danger:hover { background: rgba(246, 70, 93, 0.16); border-color: #5a2a36; }
.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 7px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

.alert {
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 12.5px;
  line-height: 1.6;
  margin-bottom: 14px;
  border: 1px solid #4a222b;
  background: rgba(246, 70, 93, 0.1);
  color: #ff9aa5;
}
.alert.ok { border-color: #1c3b2e; background: rgba(14, 203, 129, 0.08); color: #6fe3b0; }

/* ===================== 应用框架 ===================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 226px;
  flex: 0 0 226px;
  border-right: 1px solid var(--border-soft);
  background: rgba(9, 13, 19, 0.86);
  backdrop-filter: blur(14px);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  z-index: 20;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.side-brand .mark { width: 32px; height: 32px; }
.side-brand b { font-size: 14.5px; font-weight: 650; letter-spacing: 0.2px; display: block; }
.side-brand small { color: var(--dim); font-size: 10.5px; letter-spacing: 1.3px; text-transform: uppercase; }

.nav-label { font-size: 10.5px; color: var(--dim); letter-spacing: 1.4px; text-transform: uppercase; padding: 12px 10px 8px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 2px;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s;
  width: 100%;
  background: transparent;
  text-align: left;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.035); color: var(--text); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(240, 185, 11, 0.13), rgba(240, 185, 11, 0.02));
  border-color: rgba(240, 185, 11, 0.18);
  color: #ffd85e;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: 0.9; }
.nav-item .badge { margin-left: auto; font-size: 10.5px; background: rgba(255, 255, 255, 0.07); padding: 1px 7px; border-radius: 20px; color: var(--muted); }

.side-foot { margin-top: auto; border-top: 1px solid var(--border-soft); padding-top: 12px; }
.side-status { display: flex; flex-direction: column; gap: 6px; padding: 4px 8px 10px; }
.status-line { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--dim); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #445066; flex: 0 0 6px; }
.dot.on { background: var(--down); box-shadow: 0 0 8px rgba(14, 203, 129, 0.7); }
.dot.off { background: var(--up); box-shadow: 0 0 8px rgba(246, 70, 93, 0.55); }
.dot.warn { background: var(--brand); box-shadow: 0 0 8px rgba(240, 185, 11, 0.6); }

.user-box { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 10px; }
.user-box:hover { background: rgba(255, 255, 255, 0.035); }
.avatar {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #f0b90b, #b98600);
  color: #1a1400; font-weight: 700; font-size: 12.5px;
  display: flex; align-items: center; justify-content: center;
}
.user-box .u-name { font-size: 12.5px; }
.user-box .u-role { font-size: 10.5px; color: var(--dim); }
.user-box .u-out { margin-left: auto; color: var(--dim); background: none; border: 0; padding: 4px; }
.user-box .u-out:hover { color: var(--up); }

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

.topbar {
  height: 62px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  background: rgba(7, 10, 15, 0.78);
  backdrop-filter: blur(16px);
  z-index: 15;
}
.topbar h2 { font-size: 15px; margin: 0; font-weight: 600; }
.topbar .crumb { color: var(--dim); font-size: 12px; }
.topbar .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.02);
  padding: 5px 10px; border-radius: 999px; font-size: 11.5px; color: var(--muted);
}
.pill b { color: var(--text); font-weight: 600; }

.view { padding: 20px 24px 48px; }

/* ===================== 卡片 ===================== */
.card {
  background: linear-gradient(180deg, rgba(20, 28, 40, 0.9), rgba(13, 18, 26, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border-soft);
}
.card-head h3 { font-size: 13.5px; margin: 0; font-weight: 600; letter-spacing: 0.2px; }
.card-head .hint { color: var(--dim); font-size: 11.5px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px; }

/* ===================== 行情看板 ===================== */
.dash { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 16px; align-items: start; }

.watchlist { position: sticky; top: 78px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; }
.wl-items { overflow-y: auto; padding: 6px; }
.wl-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px; cursor: pointer;
  border: 1px solid transparent; width: 100%; background: transparent; text-align: left;
}
.wl-item:hover { background: rgba(255, 255, 255, 0.035); }
.wl-item.active { background: rgba(240, 185, 11, 0.09); border-color: rgba(240, 185, 11, 0.2); }
.wl-item .sym { font-size: 12.5px; font-weight: 600; letter-spacing: 0.3px; }
.wl-item .sub { font-size: 10.5px; color: var(--dim); margin-top: 2px; }
.wl-item .right { margin-left: auto; text-align: right; }
.wl-item .p { font-size: 12.5px; }
.wl-item .c { font-size: 10.5px; margin-top: 2px; }
.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }

.chart-card { display: flex; flex-direction: column; min-height: 520px; }
.chart-head { display: flex; align-items: flex-start; gap: 20px; padding: 16px 18px 8px; flex-wrap: wrap; }
.sym-block .s { font-size: 20px; font-weight: 650; letter-spacing: 0.3px; display: flex; align-items: center; gap: 8px; }
.sym-block .s small { font-size: 11px; color: var(--dim); font-weight: 400; letter-spacing: 0.4px; }
.tag.kind-spot {
  color: #7fb3ff; background: rgba(76, 141, 255, 0.12); border: 1px solid rgba(76, 141, 255, 0.25);
  padding: 1px 6px; border-radius: 5px; font-size: 10.5px; font-weight: 500; margin-left: 6px;
}
.tag.kind-tradfi-spot {
  color: #ffd85e; background: rgba(240, 185, 11, 0.12); border: 1px solid rgba(240, 185, 11, 0.28);
  padding: 1px 6px; border-radius: 5px; font-size: 10.5px; font-weight: 500; margin-left: 6px;
}
.wl-item .sym .tag { vertical-align: middle; }
.sym-block .tag {
  font-size: 10px; padding: 2px 7px; border-radius: 5px; background: var(--brand-dim);
  color: var(--brand); border: 1px solid rgba(240, 185, 11, 0.25); font-weight: 500;
}
.price-block { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.price-block .price { font-size: 30px; font-weight: 600; letter-spacing: -0.5px; }
.price-block .chg { font-size: 13px; font-weight: 500; }
.stat-grid { display: flex; gap: 26px; margin-left: auto; flex-wrap: wrap; }
.stat-item { font-size: 11px; color: var(--dim); }
.stat-item b { display: block; font-size: 12.5px; color: var(--text); font-weight: 500; margin-top: 4px; }

.chart-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 18px; border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.012);
}
.seg { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--muted); padding: 5px 10px;
  border-radius: 6px; font-size: 12px; transition: background 0.12s, color 0.12s;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--panel-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset; }

.tool-group { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.spacer { flex: 1; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track {
  width: 34px; height: 19px; border-radius: 999px; background: #23304a;
  position: relative; transition: background 0.16s; flex: 0 0 34px;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #8b9ab0; transition: transform 0.16s, background 0.16s;
}
.switch input:checked + .track { background: rgba(14, 203, 129, 0.28); }
.switch input:checked + .track::after { transform: translateX(15px); background: var(--down); }
.switch .label { font-size: 12px; color: var(--muted); }

.chart { width: 100%; height: clamp(380px, calc(100vh - 372px), 620px); padding: 4px 6px 0; }
.chart-foot {
  display: flex; align-items: center; gap: 14px; padding: 8px 18px 12px;
  font-size: 11px; color: var(--dim); border-top: 1px solid var(--border-soft);
}
.chart-foot .src { color: var(--muted); }
.src-badge {
  font-size: 10.5px; padding: 2px 7px; border-radius: 5px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, 0.03); color: var(--muted);
}

.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 70px 20px; color: var(--dim); gap: 10px; text-align: center;
}
.empty svg { width: 42px; height: 42px; opacity: 0.5; }
.empty b { color: var(--muted); font-weight: 500; font-size: 13.5px; }
.empty span { font-size: 12px; }

/* ===================== 表格 / 表单 ===================== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  text-align: left; font-size: 11px; color: var(--dim); font-weight: 500;
  letter-spacing: 0.6px; text-transform: uppercase; padding: 10px 14px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tbody tr:hover { background: rgba(255, 255, 255, 0.018); }
tbody tr:last-child td { border-bottom: 0; }
td .sym-cell { display: flex; align-items: center; gap: 10px; }
td .coin {
  width: 28px; height: 28px; border-radius: 8px; background: var(--panel-3);
  display: flex; align-items: center; justify-content: center; font-size: 10.5px;
  color: var(--muted); font-weight: 600; letter-spacing: 0.2px;
  overflow: hidden; flex-shrink: 0;
}
td .coin img, .wl-item .coin img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.wl-item .coin {
  width: 24px; height: 24px; border-radius: 7px; background: var(--panel-3);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--muted); overflow: hidden; flex-shrink: 0; margin-right: 8px;
}
.wl-item .sym-row { display: flex; align-items: center; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.tnum { font-variant-numeric: tabular-nums; }
.tag-ok { color: var(--down); background: rgba(14, 203, 129, 0.1); border: 1px solid rgba(14, 203, 129, 0.2); padding: 2px 8px; border-radius: 5px; font-size: 11px; }
.tag-off { color: var(--muted); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); padding: 2px 8px; border-radius: 5px; font-size: 11px; }
.tag-mongo { color: #7ee2a8; background: rgba(14, 203, 129, 0.09); border: 1px solid rgba(14, 203, 129, 0.2); padding: 2px 8px; border-radius: 5px; font-size: 11px; }
.tag-mysql { color: #7fb3ff; background: rgba(76, 141, 255, 0.1); border: 1px solid rgba(76, 141, 255, 0.22); padding: 2px 8px; border-radius: 5px; font-size: 11px; }

.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.form-row .field { margin-bottom: 0; flex: 1; min-width: 220px; }
.hint-box {
  border: 1px dashed var(--border); border-radius: 10px; padding: 12px 14px;
  background: rgba(255, 255, 255, 0.015); font-size: 12px; color: var(--muted); line-height: 1.8;
}
.hint-box code {
  background: var(--panel-3); border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; color: #ffd85e; font-size: 11.5px;
}
.example-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.example-chips button {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--muted);
  border-radius: 6px; padding: 3px 9px; font-size: 11.5px;
}
.example-chips button:hover { color: var(--brand); border-color: rgba(240, 185, 11, 0.35); }

/* ===================== 存储页 ===================== */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.stat-card { padding: 16px 18px; }
.stat-card .k { font-size: 11.5px; color: var(--dim); display: flex; align-items: center; gap: 7px; }
.stat-card .v { font-size: 24px; font-weight: 600; margin-top: 8px; letter-spacing: -0.3px; }
.stat-card .v small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.stat-card .meta { font-size: 11.5px; color: var(--dim); margin-top: 8px; line-height: 1.7; word-break: break-all; }

/* ===================== 风险监控 ===================== */
.risk-banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px;
  border-left: 3px solid var(--border);
}
.risk-banner.level-ok { border-left-color: #3ecf8e; }
.risk-banner.level-warn { border-left-color: #f0b90b; }
.risk-banner.level-critical { border-left-color: #f6465d; }
.risk-banner-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.risk-banner-title { font-size: 14px; font-weight: 600; }
.risk-level-pill {
  flex-shrink: 0; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.06); color: var(--muted);
}
.risk-banner.level-ok .risk-level-pill { background: rgba(62,207,142,.15); color: #3ecf8e; }
.risk-banner.level-warn .risk-level-pill { background: rgba(240,185,11,.15); color: #f0b90b; }
.risk-banner.level-critical .risk-level-pill { background: rgba(246,70,93,.15); color: #f6465d; }
.risk-alert {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 0;
  border-bottom: 1px dashed var(--border-soft); font-size: 12.5px;
}
.risk-alert:last-child { border-bottom: 0; }
.risk-alert .tag-lv {
  flex-shrink: 0; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px;
}
.risk-alert .tag-lv.warn { background: rgba(240,185,11,.14); color: #f0b90b; }
.risk-alert .tag-lv.critical { background: rgba(246,70,93,.14); color: #f6465d; }
.risk-alert .tag-lv.ok { background: rgba(62,207,142,.14); color: #3ecf8e; }
.nav-item .badge.risk-ok { background: rgba(62,207,142,.18); color: #3ecf8e; }
.nav-item .badge.risk-warn { background: rgba(240,185,11,.18); color: #f0b90b; }
.nav-item .badge.risk-critical { background: rgba(246,70,93,.18); color: #f6465d; }
.bar { height: 5px; border-radius: 4px; background: var(--panel-3); overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #f0b90b, #ffd85e); border-radius: 4px; }

/* ===================== 设置页 ===================== */
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--border-soft); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--dim); }
.kv .v { color: var(--text); text-align: right; word-break: break-all; }
.code-box {
  background: #080b11; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11.5px; color: #9fb2c8; line-height: 1.85; overflow-x: auto; white-space: pre;
}
.code-box .c { color: #55637a; }
.code-box .g { color: #7ee2a8; }
.code-box .y { color: #ffd85e; }

/* ===================== 弹窗 / 提示 ===================== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(3, 5, 8, 0.72);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  z-index: 80; padding: 20px;
}
.modal {
  width: 100%; max-width: 470px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 30px 80px -30px #000; animation: pop 0.16s ease-out;
}
@keyframes pop { from { transform: translateY(8px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 16px 18px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.modal-head button { margin-left: auto; background: none; border: 0; color: var(--dim); font-size: 18px; line-height: 1; }
.modal-body { padding: 18px; }
.modal-foot { padding: 0 18px 18px; display: flex; gap: 10px; justify-content: flex-end; }

.toast-wrap { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast {
  background: var(--panel-2); border: 1px solid var(--border); border-left: 3px solid var(--brand);
  padding: 11px 14px; border-radius: 9px; font-size: 12.5px; color: var(--text);
  box-shadow: 0 12px 30px -12px #000; min-width: 220px; animation: slidein 0.18s ease-out;
}
.toast.err { border-left-color: var(--up); }
.toast.ok { border-left-color: var(--down); }
@keyframes slidein { from { transform: translateX(14px); opacity: 0; } to { transform: none; opacity: 1; } }

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  background-size: 200% 100%; animation: shine 1.2s infinite; border-radius: 6px; color: transparent;
}
@keyframes shine { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

@media (max-width: 1180px) {
  .dash { grid-template-columns: 1fr; }
  .watchlist { position: static; max-height: none; }
  .wl-items { display: flex; gap: 8px; overflow-x: auto; padding: 8px; }
  .wl-item { min-width: 168px; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .view { padding: 14px; }
  .topbar { padding: 0 14px; }
  .stat-grid { margin-left: 0; gap: 18px; width: 100%; }
}

/* ===================== 运行日志看板 ===================== */
.log-stats {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 10px 18px; border-bottom: 1px solid var(--border-soft);
  font-size: 11.5px; color: var(--dim); background: rgba(255, 255, 255, 0.012);
}
.log-stats b { color: var(--text); font-weight: 600; }
.log-stats .lv-error-count b { color: var(--up); }
.log-stats .lv-warn-count b { color: var(--brand); }

.log-view {
  height: clamp(360px, calc(100vh - 320px), 720px);
  overflow: auto;
  background: #05080c;
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px; line-height: 1.7;
  padding: 8px 14px 16px;
}
.log-row {
  display: grid; grid-template-columns: 68px 58px 148px minmax(0, 1fr);
  gap: 10px; padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.018);
}
.log-row .t { color: #4a5769; }
.log-row .lv {
  font-size: 10px; letter-spacing: 0.5px; text-align: center;
  border-radius: 4px; height: 17px; line-height: 17px; margin-top: 2px;
  overflow: hidden;
}
.log-row .lg { color: #6f819a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-row .m { color: #b9c7d8; white-space: pre-wrap; word-break: break-word; }
.lv-info .lv { color: #7fb3ff; background: rgba(76, 141, 255, 0.1); }
.lv-warning .lv { color: #ffd85e; background: rgba(240, 185, 11, 0.12); }
.lv-error .lv, .lv-critical .lv { color: #ff8b98; background: rgba(246, 70, 93, 0.14); }
.lv-debug .lv { color: #7b8ca3; background: rgba(255, 255, 255, 0.04); }
.log-row.lv-error { background: rgba(246, 70, 93, 0.045); }
.log-row.lv-warning { background: rgba(240, 185, 11, 0.03); }

@media (max-width: 860px) {
  .log-row { grid-template-columns: 56px 50px minmax(0, 1fr); }
  .log-row .lg { display: none; }
}
.log-manager { margin-top: 16px; }
.log-retention-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 18px 14px; color: var(--muted); font-size: 12px; }
.log-retention-row .input { width: 90px; padding: 6px 9px; }
.log-files-table { max-height: 410px; overflow: auto; }
.log-files-table table { min-width: 760px; }
.log-files-table td:first-child, .log-files-table th:first-child { text-align: center; }
.log-file-active { color: var(--brand); }
.log-file-name { color: var(--text); }

/* ===================== 密钥管理 ===================== */
.key-cell { display: flex; align-items: center; gap: 8px; }
.key-cell code {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 11.5px; color: #9fb2c8; letter-spacing: 0.3px;
}
.icon-btn {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--muted);
  width: 24px; height: 24px; border-radius: 6px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0; font-size: 11px;
}
.icon-btn:hover { color: var(--brand); border-color: rgba(240, 185, 11, 0.35); }
.usage-bar { width: 96px; height: 4px; background: var(--panel-3); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.usage-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #f0b90b, #ffd85e); border-radius: 3px; }
.usage-bar.full > i { background: linear-gradient(90deg, #f6465d, #ff8b98); }
.key-result {
  border: 1px dashed rgba(240, 185, 11, 0.4); background: rgba(240, 185, 11, 0.06);
  border-radius: 10px; padding: 12px 14px; margin-top: 12px;
}
.key-result code {
  display: block; margin-top: 6px; font-family: Consolas, Menlo, monospace;
  font-size: 12.5px; color: #ffd85e; word-break: break-all; line-height: 1.7;
}

/* ===================== 接口文档 ===================== */
.doc-public-card { margin-bottom: 16px; }
.doc-public-card .card-body { padding: 14px 18px 16px; }
.doc-public-row, .doc-public-controls { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.doc-public-row .input { flex: 1 1 360px; padding: 8px 10px; }
.doc-public-controls { margin-top: 12px; }
.doc-public-controls .hint { flex: 1; }
.doc-grid { display: grid; gap: 16px; }
.doc-grid .card-body { padding: 16px 18px 18px; }
.doc-line { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.doc-method {
  font-size: 10.5px; letter-spacing: 0.6px; padding: 2px 8px; border-radius: 5px;
  background: rgba(14, 203, 129, 0.12); color: #6fe3b0; border: 1px solid rgba(14, 203, 129, 0.25);
}
.doc-path {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  color: #ffd85e; font-size: 12.5px; word-break: break-all; line-height: 1.7;
}
.doc-desc { color: var(--muted); font-size: 12.5px; line-height: 1.95; margin: 0 0 12px; }
.doc-desc code, .alert code {
  background: var(--panel-3); border: 1px solid var(--border); border-radius: 4px;
  padding: 1px 5px; color: #ffd85e; font-size: 11.5px;
}
.doc-grid .code-box { margin: 0 0 12px; }
.doc-grid .code-box:last-child { margin-bottom: 0; }
.doc-grid table { font-size: 12px; }
.doc-grid table th, .doc-grid table td { padding: 8px 10px; }

.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1400px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid-4 { grid-template-columns: 1fr; } }

/* ===================== 安全中心 ===================== */
.tag-ban { color: #ff8b98; background: rgba(246, 70, 93, 0.12); border: 1px solid rgba(246, 70, 93, 0.25); padding: 2px 8px; border-radius: 5px; font-size: 11px; }
.tag-scan { color: #ffd85e; background: rgba(240, 185, 11, 0.1); border: 1px solid rgba(240, 185, 11, 0.25); padding: 2px 8px; border-radius: 5px; font-size: 11px; }
.tag-rate { color: #ffb27a; background: rgba(255, 145, 80, 0.1); border: 1px solid rgba(255, 145, 80, 0.25); padding: 2px 8px; border-radius: 5px; font-size: 11px; }
.tag-ok { color: #6fe3b0; background: rgba(14, 203, 129, 0.1); border: 1px solid rgba(14, 203, 129, 0.22); padding: 2px 8px; border-radius: 5px; font-size: 11px; }
