:root {
  --bg: #080c12;
  --panel: #111821;
  --panel-2: #17212d;
  --line: #263445;
  --text: #d9e2ec;
  --muted: #8fa1b5;
  --blue: #3b82f6;
  --blue-2: #60a5fa;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --radius: 10px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at 80% -20%, #142b4a 0, var(--bg) 35%); color: var(--text); min-height: 100vh; }
a { color: var(--blue-2); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { background: rgba(12, 18, 27, .96); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 20px; font-weight: 750; font-size: 19px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: white; background: linear-gradient(135deg, #2563eb, #7c3aed); }
.nav { display: grid; gap: 5px; }
.nav button { width: 100%; color: var(--muted); text-align: left; border: 1px solid transparent; background: transparent; padding: 10px 12px; border-radius: 8px; }
.nav button:hover, .nav button.active { color: white; background: #172334; border-color: #26384e; }
.main { min-width: 0; }
.topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 12px 24px; background: rgba(8, 12, 18, .78); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 10; }
.content { padding: 24px; max-width: 1500px; margin: auto; }
.page-title { margin: 0; font-size: 22px; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: linear-gradient(145deg, rgba(23,33,45,.96), rgba(15,23,33,.96)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: 0 12px 36px rgba(0,0,0,.18); }
.metric { font-size: 30px; font-weight: 750; margin: 8px 0 0; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.input, input, select, textarea { background: #0b1119; color: var(--text); border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(59,130,246,.28); border-color: var(--blue); }
label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.btn { border: 1px solid var(--line); border-radius: 7px; padding: 9px 13px; background: #1b2735; color: var(--text); }
.btn:hover { border-color: var(--blue-2); }
.btn-primary { background: var(--blue); color: white; border-color: var(--blue); }
.btn-danger { color: #fecaca; border-color: #7f1d1d; background: #321417; }
.btn-sm { padding: 6px 9px; font-size: 12px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
th { color: var(--muted); background: #101822; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
.tag { display: inline-flex; border-radius: 999px; padding: 3px 8px; font-size: 11px; background: #243244; color: #cbd5e1; }
.tag.normal, .tag.active, .tag.published { color: #bbf7d0; background: #12321f; }
.tag.disabled, .tag.locked, .tag.expired, .tag.deleted { color: #fecaca; background: #3a1719; }
.tag.draft { color: #fef08a; background: #342d0c; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(430px, 100%); padding: 28px; }
.login-card form { display: grid; gap: 15px; }
.mfa-help { color: var(--muted); font-size: 13px; line-height: 1.7; }
.mfa-help summary { color: var(--blue-2); cursor: pointer; }
.mfa-help ol { margin: 8px 0 0; padding-left: 22px; }
.error { color: #fca5a5; min-height: 20px; }
.notice { border-left: 3px solid var(--blue); background: #101d2d; padding: 12px; border-radius: 6px; }
.danger-zone { border-color: #642026; }
.hidden { display: none !important; }
dialog { color: var(--text); background: #121b26; border: 1px solid var(--line); border-radius: 12px; width: min(640px, calc(100% - 24px)); padding: 0; }
dialog::backdrop { background: rgba(0,0,0,.72); }
.dialog-head, .dialog-foot { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.dialog-foot { border: 0; border-top: 1px solid var(--line); justify-content: flex-end; }
.dialog-body { padding: 18px; display: grid; gap: 14px; max-height: 65vh; overflow: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mobile-nav { display: none; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.usage-filters { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.usage-filters .wide { grid-column: span 2; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.detail-item { background: #0b1119; border: 1px solid var(--line); border-radius: 7px; padding: 10px; }
.detail-item span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.content-viewer { min-height: 140px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.usage-original { min-width: 320px; max-width: 620px; }
.usage-original-text {
  max-height: 150px;
  overflow: auto;
  margin: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #080d14;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.55;
  user-select: text;
}
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .usage-filters { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}
@media (max-width: 720px) {
  .shell { display: block; }
  .sidebar { position: fixed; z-index: 30; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .mobile-nav { display: inline-flex; }
  .content, .topbar { padding: 14px; }
  .grid-4, .grid-2, .form-grid { grid-template-columns: 1fr; }
  .usage-filters, .detail-grid { grid-template-columns: 1fr; }
  .usage-filters .wide { grid-column: auto; }
  .page-title { font-size: 19px; }
}
