/* ============================================================
   解析站设计系统 · Industrial / Utilitarian
   字体自托管槽位：把 rajdhani-*.woff2 / jetbrains-mono-*.woff2
   放进 assets/fonts/ 即自动启用，缺失时回退到系统字体。
   ============================================================ */

@font-face {
  font-family: 'Rajdhani';
  src: url('fonts/rajdhani-600.woff2') format('woff2');
  font-weight: 600; font-display: swap;
}
@font-face {
  font-family: 'Rajdhani';
  src: url('fonts/rajdhani-700.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono-400.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono-600.woff2') format('woff2');
  font-weight: 600; font-display: swap;
}

:root {
  --ink: #0a0b0d;
  --ink-2: #0e1013;
  --panel: #12141a;
  --panel-2: #191c23;
  --line: #272c36;
  --line-soft: #1d222b;
  --paper: #e9e6de;
  --muted: #7d8494;
  --accent: #ff5c1a;
  --accent-dim: #b23d0f;
  --data: #79e0d6;
  --ok: #5fd977;
  --warn: #ffc24d;
  --danger: #ff5a5a;

  --font-display: 'Rajdhani', 'Bahnschrift', 'DIN Alternate', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Mono', 'Consolas', 'Menlo', monospace;

  --rail: 72px;
  --r: 2px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.014) 0 1px, transparent 1px 3px),
    radial-gradient(900px 500px at 8% -10%, #1a1410 0%, transparent 62%),
    radial-gradient(700px 420px at 96% 4%, #0f1c22 0%, transparent 58%),
    var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #0a0b0d; }

/* ---------- 左侧导轨 ---------- */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail);
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #0d0f13 0%, #0a0b0d 100%);
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 0; gap: 4px; z-index: 40;
}
.rail .mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--accent); color: #0a0b0d;
  font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: .5px;
  margin-bottom: 22px;
  clip-path: polygon(0 0, 100% 0, 100% 74%, 74% 100%, 0 100%);
}
.rail .rnav { display: flex; flex-direction: column; gap: 2px; width: 100%; align-items: center; }
.rail .rnav a {
  width: 44px; height: 44px; display: grid; place-items: center;
  color: var(--muted); border-left: 2px solid transparent; transition: .14s;
  position: relative;
}
.rail .rnav a:hover { color: var(--paper); background: #14171d; }
.rail .rnav a.on { color: var(--accent); border-left-color: var(--accent); background: #17120e; }
.rail .rnav a svg { width: 18px; height: 18px; }
.rail .foot { margin-top: auto; font-family: var(--font-mono); font-size: 9px; color: #3b414d; letter-spacing: 1px; writing-mode: vertical-rl; }

.shell { margin-left: var(--rail); min-height: 100vh; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: baseline; gap: 16px;
  padding: 22px 34px 16px; border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.topbar h1 {
  font-family: var(--font-display); font-weight: 700; font-size: 26px;
  letter-spacing: 1.5px; text-transform: uppercase; line-height: 1;
}
.topbar .kicker {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--muted);
  letter-spacing: 2px; text-transform: uppercase;
}
.topbar .spacer { flex: 1; }
.crumb { font-family: var(--font-mono); font-size: 11px; color: var(--muted); letter-spacing: .5px; }

/* ---------- 内容区 ---------- */
.page { padding: 26px 34px 90px; max-width: 1500px; }

/* ---------- 面板 ---------- */
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  padding: 18px 20px;
}
.panel::before, .panel::after {
  content: ''; position: absolute; width: 9px; height: 9px; pointer-events: none;
}
.panel::before { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.panel::after { bottom: -1px; right: -1px; border-bottom: 2px solid #333b48; border-right: 2px solid #333b48; }

.panel-h {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.panel-h::after { content: ''; flex: 1; height: 1px; background: var(--line-soft); }

/* ---------- 表单 ---------- */
input[type=text], input[type=password], input[type=url], textarea, select {
  width: 100%; background: var(--ink-2); color: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 12px; font-size: 13.5px; font-family: var(--font-body);
  outline: none; transition: border-color .14s, background .14s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); background: #0b0c10; }
input::placeholder, textarea::placeholder { color: #4c5361; }
textarea { resize: vertical; min-height: 62px; font-family: var(--font-mono); font-size: 12.5px; }
label.field { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }
label.field:first-child { margin-top: 0; }
select { cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--r);
  padding: 11px 22px; font-size: 13px; font-weight: 600; letter-spacing: .4px;
  font-family: var(--font-body); transition: .14s; white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); color: #0a0b0d; }
.btn.primary:hover { background: #ff7238; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--paper); }
.btn.ghost:hover { border-color: #3a424f; background: var(--panel-2); }
.btn.danger { background: transparent; border-color: #4a2229; color: var(--danger); }
.btn.danger:hover { background: #2a1216; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.sm { padding: 7px 13px; font-size: 12px; }

/* ---------- 搜索台 ---------- */
.dock { display: flex; gap: 0; border: 1px solid var(--line); background: var(--panel); position: relative; }
.dock::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent);
}
.dock input { border: 0; background: transparent; padding: 17px 20px 17px 24px; font-size: 14.5px; }
.dock input:focus { background: transparent; }
.dock .btn { border-radius: 0; padding: 0 30px; }

/* ---------- 表格 ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-family: var(--font-mono); font-size: 10px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--muted); font-weight: 400;
  padding: 0 10px 9px; border-bottom: 1px solid var(--line);
}
.tbl td { padding: 11px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:hover td { background: #15181e; }
.tbl .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- 徽标 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .8px;
  padding: 3px 9px; border: 1px solid var(--line); color: var(--muted); border-radius: var(--r);
  text-transform: uppercase;
}
.chip.on { color: var(--ok); border-color: #24402c; background: #102015; }
.chip.off { color: #6b7280; border-color: #2a2f38; }
.chip.warn { color: var(--warn); border-color: #453616; background: #1d180b; }
.chip.bad { color: var(--danger); border-color: #4a2229; background: #1e1013; }
.chip.acc { color: var(--accent); border-color: #4a2a16; background: #1c120b; }

/* ---------- 数据行 ---------- */
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 7px 0; border-bottom: 1px dashed var(--line-soft); }
.kv:last-child { border-bottom: 0; }
.kv .k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.kv .v { font-family: var(--font-mono); font-size: 12.5px; color: var(--paper); font-variant-numeric: tabular-nums; }

.big-num { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1;
  font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.big-num.acc { color: var(--accent); }
.big-num.dat { color: var(--data); }

/* ---------- 提示 ---------- */
.note { font-size: 12.5px; color: var(--muted); line-height: 1.75; }
.note code, code.inline {
  font-family: var(--font-mono); font-size: 12px; color: #b9c2d0;
  background: var(--panel-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 2px;
}
.alert { padding: 11px 14px; font-size: 13px; border-left: 3px solid var(--accent);
  background: #1a1310; color: #f0c9b8; }
.alert.ok { border-color: var(--ok); background: #101a14; color: #b7e8c5; }
.alert.bad { border-color: var(--danger); background: #1a1013; color: #f0b8bd; }

/* ---------- 播放器 ---------- */
.stage-wrap { position: relative; }
.stage { width: 100%; aspect-ratio: 16/9; background: #000; border: 1px solid var(--line); }
.stage .ph { height: 100%; display: grid; place-items: center; color: var(--muted);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 1px; }

/* ---------- 直链行 ---------- */
.linkrow { display: flex; align-items: center; gap: 10px; background: var(--ink-2);
  border: 1px solid var(--line); padding: 8px 8px 8px 12px; margin-bottom: 7px; }
.linkrow .u { flex: 1; font-family: var(--font-mono); font-size: 11.5px; color: #8d97a8;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkrow .tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: .8px;
  color: var(--accent); border: 1px solid #4a2a16; padding: 2px 7px; white-space: nowrap; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: calc(50% + var(--rail) / 2); bottom: 34px; transform: translate(-50%, 14px);
  background: #16191f; border: 1px solid var(--line); border-left: 3px solid var(--accent);
  padding: 10px 20px; font-size: 13px; opacity: 0; pointer-events: none;
  transition: .2s; z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 布局网格 ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 344px; gap: 22px; align-items: start; }
.split .aside { margin-top: 46px; }
.split .aside > * + * { margin-top: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stack > * + * { margin-top: 18px; }
.rowline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* 斜切色带 */
.slash {
  height: 3px; background: linear-gradient(90deg, var(--accent) 0 22%, #2d333d 22% 100%);
  margin: 20px 0 22px;
}

@media (max-width: 1120px) {
  .split { grid-template-columns: 1fr; }
  .split .aside { margin-top: 0; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  :root { --rail: 0px; }
  .rail { display: none; }
  .topbar, .page { padding-left: 18px; padding-right: 18px; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .dock .btn { padding: 0 16px; }
  .toast { left: 50%; }
}
