:root {
  --bg: #0b0e14;
  --surface: #151a25;
  --surface-2: #1c2230;
  --muted: #7d879c;
  --text: #e6edf3;
  --text-2: #c9d1d9;
  --accent: #58a6ff;
  --accent-2: #79c0ff;
  --long: #3fb950;
  --long-soft: rgba(63,185,80,0.12);
  --short: #f85149;
  --short-soft: rgba(248,81,73,0.12);
  --warn: #d29922;
  --warn-soft: rgba(210,153,34,0.12);
  --info: #a371f7;
  --border: rgba(255,255,255,0.08);
  --border-2: rgba(255,255,255,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 14px; line-height: 1.5; }
body { min-height: 100vh; padding: 12px; }

/* Header */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.page-header h1 { margin: 0; font-size: 20px; font-weight: 600; }
.page-header .subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); transition: all .3s; }
.status-dot.active { background: var(--long); box-shadow: 0 0 8px var(--long); }
.status-dot.error { background: var(--short); box-shadow: 0 0 8px var(--short); }

/* Navigation */
.top-nav { display: flex; gap: 6px; align-items: center; }
.top-nav a { color: var(--text-2); text-decoration: none; font-size: 13px; padding: 6px 10px; border-radius: var(--radius-sm); transition: .2s; }
.top-nav a:hover { background: var(--surface); color: var(--accent); }

/* Mobile bottom nav */
.mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 8px 0; justify-content: space-around; z-index: 200; }
.mobile-nav a { color: var(--muted); text-decoration: none; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mobile-nav a.active { color: var(--accent); }
@media (max-width: 900px) {
  .mobile-nav { display: flex; }
  body { padding-bottom: 64px; }
  .top-nav { display: none; }
}

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 14px; font-weight: 600; margin: 0; }
.card-body { padding: 14px; }

/* Toolbar */
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 500; }
input, select, button, textarea {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
.btn { background: var(--accent); border: none; color: #fff; font-weight: 600; cursor: pointer; transition: .2s; display: inline-flex; align-items: center; gap: 5px; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary { background: transparent; border: 1px solid var(--border-2); color: var(--text-2); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); background: rgba(88,166,255,0.05); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.link { color: var(--accent); text-decoration: none; font-size: 13px; }
.link:hover { text-decoration: underline; }

/* Tags */
.tag { padding: 2px 8px; border-radius: 4px; font-size: 11px; color: #fff; font-weight: 600; display: inline-block; }
.tag.long { background: var(--long); }
.tag.short { background: var(--short); }
.tag.add { background: var(--accent); }
.tag.close { background: var(--warn); }
.tag.flat { background: var(--muted); }
.pill { padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.pill-long { background: var(--long-soft); color: var(--long); }
.pill-short { background: var(--short-soft); color: var(--short); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-neutral { background: rgba(125,135,156,0.12); color: var(--muted); }
.up { color: var(--long); } .down { color: var(--short); }

/* Tables */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; background: rgba(255,255,255,0.02); }
tr:hover { background: rgba(255,255,255,0.03); }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* Utility */
.loading { background: linear-gradient(90deg, var(--bg) 25%, var(--surface-2) 50%, var(--bg) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; color: transparent; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
