/* Prism 分站 — 自主设计的界面（暗色棱镜风格） */
:root {
  --bg: #0d1020;
  --bg2: #131730;
  --panel: #181d3a;
  --panel2: #1f2548;
  --line: #2a3158;
  --text: #e7e9f5;
  --muted: #9aa1c7;
  --accent: #a78bfa;
  --accent2: #22d3ee;
  --grad: linear-gradient(135deg, #a78bfa, #22d3ee);
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #f87171;
  --radius: 12px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}
#app { display: flex; min-height: 100vh; }
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── 侧栏 ── */
.sidebar {
  width: 220px; flex: 0 0 220px;
  background: var(--bg2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  transition: margin .2s;
}
.sidebar.hidden { display: none; }
.brand {
  font-size: 20px; font-weight: 700; padding: 18px 16px 12px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  display: flex; align-items: center; gap: 6px;
}
.brand-prism { -webkit-text-fill-color: var(--accent); }
.brand-sub { font-size: 12px; -webkit-text-fill-color: var(--muted); font-weight: 400; }
.nav { flex: 1; overflow-y: auto; padding: 6px 8px; }
.nav-group { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 14px 8px 4px; }
.nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin: 2px 0; border-radius: 8px;
  color: var(--text); font-size: 14px;
}
.nav a:hover { background: var(--panel); text-decoration: none; }
.nav a.active { background: var(--panel2); color: var(--accent); font-weight: 600; }
.nav a .ico { width: 18px; text-align: center; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ── 顶栏 ── */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; background: var(--bg2);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar.hidden { display: none; }
.page-title { font-size: 16px; font-weight: 600; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.icon-btn {
  background: none; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 4px 9px; cursor: pointer; font-size: 15px;
}
.icon-btn:hover { border-color: var(--accent); }
.avatar-chip { display: flex; align-items: center; gap: 7px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.avatar-chip:hover { background: var(--panel); }
.avatar-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--grad); display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #101020;
}

/* ── 内容区 ── */
.view { padding: 20px; max-width: 1200px; width: 100%; margin: 0 auto; }
@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .sidebar.hidden { display: flex; transform: translateX(-100%); }
}

h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 22px 0 10px; }
.hint { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.card-title { font-weight: 600; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.grid { display: grid; gap: 14px; }
.grid.cols2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.cols3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .num { font-size: 26px; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── 表单 ── */
label.field { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
label.field > input, label.field > select, label.field > textarea {
  display: block; width: 100%; margin-top: 5px;
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 9px 12px; font-size: 14px; font-family: inherit;
}
label.field > input:focus, label.field > select:focus, label.field > textarea:focus {
  outline: none; border-color: var(--accent);
}
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 16px; font-size: 14px; cursor: pointer; font-family: inherit;
  transition: all .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--grad); color: #0d1020; border: none; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { background: #3b1420; border-color: #7f1d1d; color: #fca5a5; }
.btn.danger:hover { border-color: var(--err); }
.btn.sm { padding: 4px 10px; font-size: 13px; border-radius: 7px; }
.btn.ghost { background: transparent; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* ── 表格 ── */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: rgba(255,255,255,.02); }

/* ── 徽章/标签 ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px; background: var(--panel2); border: 1px solid var(--line); }
.badge.ok { color: var(--ok); border-color: #14532d; background: #052e1c; }
.badge.warn { color: var(--warn); border-color: #713f12; background: #291d05; }
.badge.err { color: var(--err); border-color: #7f1d1d; background: #2a0c0c; }
.badge.acc { color: var(--accent); border-color: #4c1d95; background: #1e1040; }

/* ── Tab ── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  background: none; border: none; color: var(--muted); font-family: inherit;
  padding: 9px 14px; font-size: 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tabs button:hover { color: var(--text); }

/* ── Toast ── */
#toast-root { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow);
  font-size: 14px; max-width: 340px; animation: slidein .2s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Modal ── */
#modal-root:empty { display: none; }
.modal-mask {
  position: fixed; inset: 0; background: rgba(5,7,18,.7); z-index: 100;
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 14px; font-size: 17px; }
.modal .close { float: right; background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; }

/* ── 登录页 ── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 16px; padding: 30px 26px;
  box-shadow: var(--shadow);
}
.auth-card .logo { text-align: center; margin-bottom: 6px; font-size: 34px; }
.auth-card h1 { text-align: center; font-size: 21px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.auth-links { display: flex; justify-content: space-between; font-size: 13px; margin-top: 14px; }
.captcha-row { display: flex; gap: 8px; }
.captcha-row input { flex: 1; }
.captcha-img { width: 120px; height: 40px; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); background: var(--bg2); }

/* ── 分段控件 ── */
.seg { display: inline-flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 3px; margin-bottom: 14px; flex-wrap: wrap; }
.seg button { background: none; border: none; color: var(--muted); font-family: inherit; padding: 6px 14px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.seg button.active { background: var(--panel2); color: var(--accent); font-weight: 600; }

/* ── 列表项 ── */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .d { font-size: 12px; color: var(--muted); }
.thumb { width: 54px; height: 54px; border-radius: 9px; object-fit: cover; background: var(--bg2); border: 1px solid var(--line); flex: 0 0 54px; }

/* ── 杂项 ── */
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.loading { text-align: center; color: var(--muted); padding: 30px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.muted { color: var(--muted); }
.mt { margin-top: 14px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex.between { justify-content: space-between; }
.flex.wrap { flex-wrap: wrap; }
.right { margin-left: auto; }
.code-box {
  background: var(--bg2); border: 1px dashed var(--line); border-radius: 8px;
  padding: 10px 12px; font-family: ui-monospace, monospace; font-size: 13px;
  word-break: break-all; user-select: all;
}
.progress { height: 6px; background: var(--bg2); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--grad); }
img.preview { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.skeleton { background: linear-gradient(90deg, var(--panel) 25%, var(--panel2) 50%, var(--panel) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; height: 16px; margin-bottom: 10px; }
@keyframes sk { to { background-position: -200% 0; } }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 40px; }
.switch input { display: none; }
.switch i { position: absolute; inset: 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; cursor: pointer; transition: .2s; }
.switch i::before { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: var(--muted); border-radius: 50%; transition: .2s; }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::before { transform: translateX(18px); background: #fff; }
