:root {
  font-family: "IBM Plex Sans", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  color-scheme: dark;
  background: #0c1220;
  color: #eef2ff;
  line-height: 1.45;
  --subtle: #a0acc2;
  --border: #29354b;
  --surface: #151e30;
  --accent: #b2b3ff;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.topbar { display: flex; align-items: baseline; gap: 18px; padding: 18px clamp(18px, 4vw, 62px); border-bottom: 1px solid var(--border); }
.brand { color: #fff; font-size: 20px; font-weight: 750; text-decoration: none; }
.topbar span, .muted { color: var(--subtle); }
.topbar #logout { margin-left: auto; }
.login-main { max-width: 480px; padding-top: 8vh; }
.login-card { display: grid; gap: 14px; padding: 26px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.login-card label { margin-bottom: -8px; }
.login-card .muted { font-size: 13px; }
.login-code { display: flex; gap: 10px; }
.login-code input { width: 100%; }
main { max-width: 1500px; margin: auto; padding: 22px clamp(16px, 4vw, 62px) 55px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 26px; letter-spacing: -.025em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.tabs button { border: 0; border-radius: 6px 6px 0 0; background: transparent; color: var(--subtle); margin-bottom: -1px; }
.tabs button[aria-current] { border-bottom: 2px solid var(--accent); color: #fff; }
.page-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 28px 0 15px; }
.page-heading p { margin-top: 5px; font-size: 13px; }
.tools { display: flex; align-items: center; gap: 8px; }
input, select, textarea, button { font: inherit; }
button { cursor: pointer; color: #edf1ff; border: 1px solid #344259; border-radius: 7px; background: #212d44; min-height: 36px; padding: 6px 12px; white-space: nowrap; }
button:hover { background: #303c57; }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: #5655b5; border-color: #7572d4; }
button.primary:hover { background: #6866ca; }
button.minimal { background: none; }
button.link { border-color: transparent; background: transparent; color: var(--accent); padding-inline: 5px; }
input, select, textarea { min-width: 0; color: #f5f7ff; border: 1px solid #3a465f; border-radius: 7px; background: #11192a; padding: 8px 10px; min-height: 38px; }
textarea { resize: vertical; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tools input { width: min(290px, 64vw); }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; min-width: 850px; font-size: 14px; background: var(--surface); }
th, td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: #bcc8e2; background: #1c273c; font-size: 12px; font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #1a2539; }
td small { display: block; margin-top: 3px; color: var(--subtle); }
code, output { font-family: "IBM Plex Mono", Consolas, monospace; }
.state { display: inline-block; padding: 2px 7px; border-radius: 5px; color: #ffe0a8; background: #3a2e1f; white-space: nowrap; }
.state[data-status=active] { color: #a2e7c9; background: #153d36; }
.state[data-status=disabled], .state[data-status=expired] { color: #ffc5c5; background: #502d37; }
.empty { padding: 28px 12px; text-align: center; color: var(--subtle); }
.plan-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%, 255px), 1fr)); gap: 13px; }
.plan-card { padding: 15px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.plan-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-card p { color: var(--subtle); font-size: 13px; margin: 7px 0; }
dialog { width: min(580px, calc(100% - 24px)); max-height: 91vh; padding: 0; border: 1px solid #3c4963; border-radius: 13px; background: var(--surface); color: inherit; box-shadow: 0 18px 70px #06080dc0; }
dialog::backdrop { background: #0a101cb8; }
.dialog-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); padding: 12px 17px; border-bottom: 1px solid var(--border); }
#edit-content { padding: 16px 17px; }
#notice, #edit-error { margin-block: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 7px; color: #d7e4ff; }
#edit-error { margin: 0 17px 15px; border-color: #693947; color: #ffd3d8; }
form { display: grid; gap: 14px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 13px; }
.field { display: grid; gap: 4px; font-size: 13px; color: #c8d3e8; }
.policy { display: grid; gap: 6px; }
.policy-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; min-height: 33px; font-size: 13px; }
.policy-row input { min-height: 18px; }
.policy-row select { min-height: 34px; padding-block: 4px; }
.subsection { border-top: 1px solid var(--border); display: grid; gap: 12px; padding-top: 13px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.secret { padding: 8px 10px; color: #eff0ff; background: #11192a; border-radius: 6px; overflow-wrap: anywhere; }
