/* ============================================================
   REST Debugger — 深色科技风
   基础色板：近黑蓝底 + 靛紫强调 + 青色辅助
   ============================================================ */
:root {
  --bg: #070b14;
  --bg-2: #0b1120;
  --panel: rgba(17, 25, 42, 0.72);
  --panel-solid: #101828;
  --panel-hi: rgba(28, 39, 63, 0.9);
  --line: rgba(148, 163, 184, 0.11);
  --line-2: rgba(148, 163, 184, 0.2);
  --text: #e7ecf8;
  --text-2: #a9b6cd;
  --muted: #7d8ba6;
  --dim: #55627c;
  --accent: #8b5cf6;
  --accent-2: #6366f1;
  --cyan: #22d3ee;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --pink: #f472b6;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --r: 12px;
  --shadow: 0 18px 42px -18px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; }
/* 元素自带 display（flex/grid）会盖掉 UA 的 [hidden]，必须强制 */
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(99, 102, 241, 0.16), transparent 60%),
    radial-gradient(760px 420px at 92% 4%, rgba(34, 211, 238, 0.09), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
::selection { background: rgba(139, 92, 246, 0.35); }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.18);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.32); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.shell { display: flex; height: 100vh; }

/* ============================== 左侧导航 ============================== */
.rail {
  width: 228px;
  flex: 0 0 228px;
  padding: 18px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 19, 33, 0.9), rgba(7, 11, 20, 0.6));
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 8px; }
.logo {
  width: 32px; height: 32px; border-radius: 10px;
  overflow: hidden;
  /* ORYXON logo 为自带圆角底的 PNG（内联 base64），不再叠加渐变背景 */
  box-shadow: 0 6px 18px -8px rgba(37, 99, 235, 0.55);
}
.logo-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 14px; letter-spacing: 0.2px; }
.brand-text span { font-size: 11px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 13px;
  text-align: left;
  transition: background .16s, color .16s;
  position: relative;
}
.nav-item svg { width: 16px; height: 16px; opacity: .8; }
.nav-item span { flex: 1; }
.nav-item em {
  font-style: normal;
  font-size: 11px;
  color: var(--dim);
  font-family: var(--mono);
  background: rgba(148, 163, 184, 0.08);
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}
.nav-item:hover { background: rgba(148, 163, 184, 0.06); color: var(--text); }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.18), rgba(99, 102, 241, 0.06));
  color: #fff;
}
.nav-item.is-active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px;
  border-radius: 2px; background: linear-gradient(var(--cyan), var(--accent));
}
.nav-item.is-active em { color: var(--cyan); background: rgba(34, 211, 238, 0.12); }

.listen-card {
  margin-top: auto;
  padding: 12px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(34, 211, 238, 0.07), rgba(139, 92, 246, 0.07));
}
.lc-top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.lc-top b { font-size: 12px; font-weight: 600; }
.lc-port { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--cyan); }
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2s infinite;
}
.is-off .pulse { background: var(--dim); animation: none; box-shadow: none; }
.is-err .pulse { background: var(--red); animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.lc-url {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
  background: rgba(3, 7, 15, 0.6);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 8px;
}
.lc-copy {
  width: 100%; padding: 6px; border-radius: 7px;
  font-size: 11.5px; color: var(--text-2);
  border: 1px solid var(--line-2);
  background: rgba(148, 163, 184, 0.06);
  transition: .16s;
}
.lc-copy:hover { color: #fff; border-color: rgba(139, 92, 246, 0.5); background: rgba(139, 92, 246, 0.14); }
.rail-foot { font-size: 10.5px; color: var(--dim); text-align: center; }

/* ============================== 主区域 ============================== */
.main { flex: 1; min-width: 0; display: flex; overflow: hidden; }
.view { display: none; flex-direction: column; width: 100%; padding: 20px 24px 16px; min-height: 0; }
.view.is-active { display: flex; }

.view-head { display: flex; align-items: flex-start; gap: 20px; margin-bottom: 14px; }
.view-head > div:first-child { flex: 1; min-width: 0; }
.view-head h1 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: .2px; }
.view-head .sub { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); }
.head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.search {
  display: flex; align-items: center; gap: 7px;
  padding: 0 10px; height: 32px;
  border: 1px solid var(--line-2); border-radius: 9px;
  background: rgba(9, 14, 25, 0.7);
  color: var(--dim);
  transition: border-color .16s;
}
.search:focus-within { border-color: rgba(139, 92, 246, 0.55); }
.search input {
  border: none; outline: none; background: none;
  width: 190px; font-size: 12px;
}
.search input::placeholder { color: var(--dim); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 13px;
  border-radius: 9px;
  font-size: 12.5px;
  border: 1px solid transparent;
  transition: .16s;
  white-space: nowrap;
}
.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 8px 22px -10px rgba(124, 92, 246, 0.95);
}
.btn.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.primary:active { transform: none; }
.btn.ghost { color: var(--text-2); border-color: var(--line-2); background: rgba(148, 163, 184, 0.05); }
.btn.ghost:hover { color: #fff; border-color: rgba(139, 92, 246, 0.42); background: rgba(139, 92, 246, 0.12); }
.btn.tiny { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 7px; }
.btn.block { width: 100%; justify-content: center; }
.btn.danger { color: #fca5a5; border-color: rgba(248, 113, 113, 0.3); background: rgba(248, 113, 113, 0.1); }
.btn.danger:hover { background: rgba(248, 113, 113, 0.18); color: #fecaca; }
.btn[disabled] { opacity: .38; pointer-events: none; }
.btn.is-busy { pointer-events: none; opacity: .7; }

.mini-field {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--muted);
  border: 1px solid var(--line-2); border-radius: 9px;
  height: 32px; padding: 0 10px;
}
.mini-field input {
  width: 46px; border: none; outline: none; background: none;
  font-family: var(--mono); color: var(--text); text-align: right;
}

/* 开关 */
.switch { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch i {
  width: 28px; height: 16px; border-radius: 99px;
  background: rgba(148, 163, 184, 0.2);
  position: relative; transition: .2s;
}
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #cbd5e1; transition: .2s;
}
.switch input:checked + i { background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.switch input:checked + i::after { left: 14px; background: #fff; }
.switch input:checked ~ span, .switch input:checked ~ * { color: var(--text-2); }

/* ============================== 捕获：分栏 ============================== */
.split { flex: 1; display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 14px; min-height: 0; }
.list-col, .detail-col {
  min-height: 0; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel);
  overflow: hidden;
}
.list-meta {
  padding: 9px 13px; font-size: 11px; color: var(--dim);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 14, 25, 0.4);
  display: flex; justify-content: space-between;
}
.cap-list { flex: 1; overflow-y: auto; padding: 6px; }

.cap-item {
  width: 100%;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 3px 9px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: background .14s, border-color .14s;
  text-align: left;
}
.cap-item:hover { background: rgba(148, 163, 184, 0.06); }
.cap-item.is-active {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.16), rgba(99, 102, 241, 0.04));
  border-color: rgba(139, 92, 246, 0.32);
}
.cap-item.is-new { animation: flash 1.1s ease-out; }
@keyframes flash {
  0% { background: rgba(34, 211, 238, 0.22); }
  100% { background: transparent; }
}
.cap-method {
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .3px;
  padding: 2px 0; text-align: center; border-radius: 5px;
  background: rgba(148, 163, 184, 0.1);
}
.cap-path {
  font-family: var(--mono); font-size: 11.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cap-sub { grid-column: 2; font-size: 10.5px; color: var(--dim); display: flex; gap: 8px; min-width: 0; overflow: hidden; }
.cap-sub .q { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.cap-sub time { flex: 0 0 auto; font-family: var(--mono); }

[data-m="GET"] { color: var(--cyan); }
[data-m="POST"] { color: var(--green); }
[data-m="PUT"] { color: var(--amber); }
[data-m="PATCH"] { color: var(--pink); }
[data-m="DELETE"] { color: var(--red); }
[data-m="HEAD"] { color: #94a3b8; }
[data-m="OPTIONS"] { color: #a78bfa; }

/* 空状态 */
.empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--dim); text-align: center; padding: 30px;
}
.empty svg { opacity: .4; }
.empty p { margin: 6px 0 0; font-size: 13px; color: var(--text-2); }
.empty span { font-size: 11.5px; max-width: 320px; line-height: 1.7; }
.empty code {
  font-family: var(--mono); font-size: 11px; color: var(--cyan);
  background: rgba(34, 211, 238, 0.08); padding: 2px 6px; border-radius: 5px;
}

/* ============================== 捕获详情 ============================== */
.d-head {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(9, 14, 25, 0.35);
}
.d-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.d-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.d-method {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(148, 163, 184, 0.1);
  flex: 0 0 auto;
}
.d-path {
  font-family: var(--mono); font-size: 12.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.d-sub { font-size: 10.5px; color: var(--dim); font-family: var(--mono); display: flex; gap: 12px; flex-wrap: wrap; }
.d-actions { display: flex; gap: 6px; flex: 0 0 auto; }

.tabs {
  display: flex; gap: 2px; padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 14, 25, 0.25);
  overflow-x: auto;
}
.tab {
  padding: 9px 11px; font-size: 12px; color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap;
  transition: color .14s, border-color .14s;
  display: inline-flex; align-items: center; gap: 5px;
}
.tab:hover { color: var(--text-2); }
.tab.is-active { color: #fff; border-bottom-color: var(--accent); }
.tab .cnt {
  font-style: normal; font-size: 10px; font-family: var(--mono);
  background: rgba(148, 163, 184, 0.12); color: var(--muted);
  padding: 0 5px; border-radius: 20px; min-width: 15px; text-align: center;
}
.tab.is-active .cnt { background: rgba(139, 92, 246, 0.22); color: #d8ceff; }

.tab-body { flex: 1; overflow: auto; min-height: 0; }
.tab-pane { display: none; padding: 14px; }
.tab-pane.is-active { display: block; }

/* 概览 */
/* 概览：用小卡片而不是"表格线"——末行不满时不会露出灰色底块 */
.overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.ov-item {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
}
.ov-item span { font-size: 10.5px; color: var(--dim); }
.ov-item b { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 键值表 */
.kv-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kv-line { display: grid; grid-template-columns: minmax(140px, 240px) minmax(0, 1fr); gap: 1px; background: var(--line); }
.kv-line > div { background: var(--panel-solid); padding: 8px 12px; font-family: var(--mono); font-size: 11.5px; word-break: break-all; }
.kv-line .k { color: #a5b4fc; }
.kv-line .v { color: var(--text-2); }

.ov-preview { margin-top: 12px; }
.ov-preview h4 {
  margin: 0 0 7px; font-size: 11px; font-weight: 500; color: var(--dim);
  display: flex; align-items: center; gap: 8px;
}
.ov-preview h4 span { color: var(--muted); font-family: var(--mono); font-size: 10.5px; }

/* 报文 */
pre.raw {  margin: 0; padding: 14px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.65;
  color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
  background: rgba(3, 7, 15, 0.55);
  border: 1px solid var(--line); border-radius: 10px;
}
pre.raw .hl { color: var(--cyan); }

.body-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.body-toolbar .tag {
  font-size: 10.5px; color: var(--muted); font-family: var(--mono);
  border: 1px solid var(--line-2); padding: 2px 7px; border-radius: 5px;
}

/* JSON 高亮 */
.json .k { color: #a5b4fc; }
.json .s { color: #6ee7b7; }
.json .n { color: #fcd34d; }
.json .b { color: #f9a8d4; }
.json .z { color: var(--dim); }

/* ============================== 请求调试 ============================== */
.composer { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 256px; gap: 14px; min-height: 0; }
.work-col { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.panel {
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel);
  overflow: hidden;
}
.req-panel { flex: 0 0 auto; display: flex; flex-direction: column; }
.resp-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.urlbar { display: flex; gap: 8px; padding: 12px; }
.method-select {
  width: 96px; height: 36px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: 9px;
  background: rgba(9, 14, 25, 0.9);
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--cyan); outline: none;
  appearance: none; cursor: pointer;
}
.method-select:focus { border-color: rgba(139, 92, 246, 0.5); }
.url-input {
  flex: 1; min-width: 0; height: 36px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: 9px;
  background: rgba(9, 14, 25, 0.9);
  font-family: var(--mono); font-size: 12.5px; outline: none;
  transition: border-color .16s;
}
.url-input:focus { border-color: rgba(139, 92, 246, 0.55); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.08); }
.url-input::placeholder { color: var(--dim); font-family: var(--sans); }
.urlbar .btn.primary { height: 36px; padding: 0 18px; }

.tab-body.req-body { flex: 0 0 auto; }

/* KV 编辑器 */
.kv { display: flex; flex-direction: column; gap: 6px; }
.kv-row { display: grid; grid-template-columns: 18px minmax(90px, 1fr) minmax(120px, 1.6fr) 26px; gap: 7px; align-items: center; }
.kv-row input[type="text"], .kv-row input:not([type]) {
  height: 30px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 7px;
  background: rgba(9, 14, 25, 0.65);
  font-family: var(--mono); font-size: 11.5px; outline: none;
  min-width: 0;
}
.kv-row input:focus { border-color: rgba(139, 92, 246, 0.45); }
.kv-row input::placeholder { color: var(--dim); }
.kv-row input[type="checkbox"] {
  width: 13px; height: 13px; accent-color: var(--accent); cursor: pointer;
}
.kv-del {
  width: 24px; height: 24px; border-radius: 6px;
  color: var(--dim); font-size: 15px; line-height: 1;
  transition: .14s;
}
.kv-del:hover { color: var(--red); background: rgba(248, 113, 113, 0.12); }
.add-row {
  margin-top: 9px; font-size: 11.5px; color: var(--muted);
  padding: 5px 9px; border-radius: 7px;
  border: 1px dashed var(--line-2);
  transition: .14s;
}
.add-row:hover { color: var(--accent); border-color: rgba(139, 92, 246, 0.5); background: rgba(139, 92, 246, 0.07); }

.body-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.body-bar select {
  height: 30px; padding: 0 9px; border-radius: 7px;
  border: 1px solid var(--line-2); background: rgba(9, 14, 25, 0.9);
  font-size: 11.5px; color: var(--text-2); outline: none; cursor: pointer;
}
.code {
  width: 100%; min-height: 130px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 9px;
  background: rgba(3, 7, 15, 0.65);
  font-family: var(--mono); font-size: 11.5px; line-height: 1.7;
  color: var(--text-2); outline: none; resize: vertical;
}
.code:focus { border-color: rgba(139, 92, 246, 0.42); }

/* 响应区 */
.resp-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--dim); text-align: center; padding: 24px; }
.resp-empty svg { opacity: .35; }
.resp-empty p { margin: 4px 0 0; font-size: 13px; color: var(--text-2); }
.resp-empty span { font-size: 11.5px; }
.resp-content { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.resp-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: rgba(9, 14, 25, 0.3);
}
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 6px;
  font-family: var(--mono); font-size: 11.5px;
  border: 1px solid var(--line-2);
  color: var(--text-2);
}
.chip.status { font-weight: 700; }
.st-2 { color: #6ee7b7; border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.1); }
.st-3 { color: #93c5fd; border-color: rgba(147, 197, 253, 0.3); background: rgba(59, 130, 246, 0.1); }
.st-4 { color: #fcd34d; border-color: rgba(251, 191, 36, 0.32); background: rgba(251, 191, 36, 0.1); }
.st-5 { color: #fca5a5; border-color: rgba(248, 113, 113, 0.34); background: rgba(248, 113, 113, 0.12); }
.st-x { color: #c4b5fd; border-color: rgba(167, 139, 250, 0.34); background: rgba(139, 92, 246, 0.12); }
.resp-meta .spacer { flex: 1; }

.resp-body .tab-pane { padding: 12px 14px; }
pre.pretty {
  margin: 0; font-family: var(--mono); font-size: 11.5px; line-height: 1.6;
  color: var(--text-2); white-space: pre-wrap; word-break: break-word;
}

/* 历史 */
.side-col {
  display: flex; flex-direction: column; gap: 8px; min-height: 0;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); padding: 10px;
}
.side-head { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); padding: 0 2px; }
.hist-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.hist-item {
  border: 1px solid transparent; border-radius: 8px;
  padding: 7px 8px; cursor: pointer; transition: .14s;
  display: flex; flex-direction: column; gap: 3px;
}
.hist-item:hover { background: rgba(148, 163, 184, 0.06); }
.hist-item.is-sel { border-color: rgba(139, 92, 246, 0.4); background: rgba(139, 92, 246, 0.1); }
.hist-top { display: flex; align-items: center; gap: 6px; }
.hist-m { font-family: var(--mono); font-size: 10px; font-weight: 700; }
.hist-st { font-family: var(--mono); font-size: 10.5px; margin-left: auto; }
.hist-url { font-family: var(--mono); font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-sub { font-size: 10px; color: var(--dim); display: flex; gap: 8px; }
.hist-check { width: 12px; height: 12px; accent-color: var(--accent); }

/* ============================== 设置 ============================== */
.settings-grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 14px; align-content: start; }
.settings-grid .panel { padding: 16px 18px; }
.settings-grid h2 { margin: 0 0 4px; font-size: 13.5px; font-weight: 600; }
.hint { margin: 0 0 14px; font-size: 11px; color: var(--dim); line-height: 1.6; }
.field { margin-bottom: 13px; display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 11.5px; color: var(--text-2); }
.field input, .field textarea {
  height: 34px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: rgba(9, 14, 25, 0.75);
  font-family: var(--mono); font-size: 12px; outline: none;
}
.field textarea { height: auto; padding: 9px 10px; }
.field input:focus, .field textarea:focus { border-color: rgba(139, 92, 246, 0.5); }
.field small { font-size: 10.5px; color: var(--dim); }
.field.row { flex-direction: row; gap: 10px; }
.field.row > div { display: flex; flex-direction: column; gap: 5px; }
.field.row > div:first-child { width: 110px; }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; }
.field.inline > label { font-size: 12.5px; }

.status-rows { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.srow { display: flex; align-items: center; gap: 10px; background: var(--panel-solid); padding: 9px 12px; font-size: 11.5px; }
.srow span { color: var(--dim); width: 76px; flex: 0 0 auto; }
.srow b { font-family: var(--mono); font-weight: 500; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .ok { color: var(--green); }

/* ============================== 弹层 ============================== */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 30px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(3, 6, 12, 0.72); backdrop-filter: blur(3px); }
.modal-box {
  position: relative; z-index: 1;
  width: min(1100px, 100%); max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--panel-solid);
  border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: var(--shadow);
  animation: pop .18s ease-out;
}
.modal-box.small { width: min(440px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 14px; font-weight: 600; flex: 1; }
.modal-body { padding: 16px 18px; overflow: auto; min-height: 0; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { width: 26px; height: 26px; border-radius: 7px; color: var(--muted); font-size: 16px; }
.modal-close:hover { background: rgba(148, 163, 184, 0.12); color: #fff; }

/* 对比 */
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-col { min-width: 0; }
.cmp-title { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.cmp-title b { font-family: var(--mono); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-meta { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.diff {
  border: 1px solid var(--line); border-radius: 9px; overflow: auto;
  max-height: 46vh; background: rgba(3, 7, 15, 0.55);
  font-family: var(--mono); font-size: 11px; line-height: 1.6;
}
.diff-line { padding: 0 9px; white-space: pre-wrap; word-break: break-word; border-left: 2px solid transparent; }
.diff-line.add { background: rgba(52, 211, 153, 0.15); border-left-color: var(--green); color: #b9f6dc; }
.diff-line.del { background: rgba(248, 113, 113, 0.15); border-left-color: var(--red); color: #ffd4d4; }
.diff-line.eq { color: var(--dim); }
.diff-line.mute { color: var(--dim); padding: 6px 9px; font-size: 10.5px; }

/* Toast */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 9px 16px; border-radius: 9px; font-size: 12px;
  background: rgba(17, 25, 42, 0.96);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  animation: toast-in .2s ease-out;
  color: var(--text);
}
.toast.err { border-color: rgba(248, 113, 113, 0.45); color: #fecaca; }
.toast.ok { border-color: rgba(52, 211, 153, 0.4); color: #a7f3d0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* 窄屏 */
@media (max-width: 1180px) {
  .composer { grid-template-columns: 1fr; }
  .side-col { display: none; }
  .split { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .rail { width: 64px; flex-basis: 64px; padding: 14px 8px; }
  .brand-text, .nav-item span, .listen-card, .rail-foot { display: none; }
  .nav-item { justify-content: center; }
  .nav-item em { display: none; }
  .split { grid-template-columns: 1fr; }
  .list-col { max-height: 40vh; }
}
