:root {
  color-scheme: light;
  --ink: #20252d;
  --muted: #68717e;
  --line: #e5e8ed;
  --accent: #245dd9;
  --bg: #f6f7f9;
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip-link { position: fixed; top: -60px; left: 16px; padding: 10px 16px; background: white; z-index: 20; }
.skip-link:focus { top: 12px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 208px; background: white; border-right: 1px solid var(--line); }
.brand { height: 72px; display: flex; align-items: center; padding: 0 28px; font-size: 18px; font-weight: 650; color: var(--ink); letter-spacing: .5px; }
.brand:hover { text-decoration: none; }
nav { display: grid; gap: 6px; padding: 24px 14px; }
nav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 14px; color: #535d6a; border-radius: 4px; }
nav a:hover { background: #f6f7f9; text-decoration: none; }
nav a[aria-current="page"] { color: var(--accent); background: #edf3ff; font-weight: 600; }
nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.workspace { margin-left: 208px; }
.topbar { height: 72px; display: flex; align-items: center; padding: 0 36px; background: white; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
main { max-width: 1420px; margin: 0 auto; padding: 32px 36px 64px; }
h1 { font-size: 26px; line-height: 1.4; font-weight: 650; margin: 0 0 8px; letter-spacing: -.5px; }
h2 { font-size: 16px; font-weight: 600; line-height: 1.5; margin: 0 0 20px; }
p { margin: 8px 0 20px; }
.muted, .note { color: var(--muted); }
.note { font-size: 12px; line-height: 1.8; }
.page-heading { margin-bottom: 28px; }
.page-heading p { margin: 6px 0 0; }
.heading-row { display: flex; align-items: center; gap: 14px; }
.heading-row h1 { margin-bottom: 0; }
.panel { background: white; border: 1px solid var(--line); border-radius: 5px; padding: 24px; margin: 20px 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; }
.section-heading .note { margin: 4px 0 0; }
.grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.grid .panel { margin: 0; min-width: 0; }
label { display: block; font-size: 13px; font-weight: 500; margin: 20px 0 8px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #cdd3dc; border-radius: 4px; background: white; color: var(--ink); }
input::placeholder { color: #89929e; }
input[readonly], textarea[readonly] { background: #f8f9fb; color: #4b5563; }
textarea { resize: vertical; font: 13px/1.8 ui-monospace, Consolas, monospace; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 16px; border: 1px solid #cdd3dc; border-radius: 4px; background: white; color: var(--ink); cursor: pointer; white-space: nowrap; }
button:hover, .button:hover { background: #f5f7fa; border-color: #adb7c5; text-decoration: none; }
.primary { background: var(--accent); border-color: var(--accent); color: white; font-weight: 500; }
.primary:hover { background: #1c4fbf; border-color: #1c4fbf; }
button:disabled { opacity: .45; cursor: default; }
.full { width: 100%; margin-top: 24px; }
.narrow { max-width: 440px; margin: 56px auto; }
.auth-panel { padding: 32px; }
.auth-panel h1 { font-size: 23px; }
.auth-panel > p { margin: 8px 0 28px; font-size: 13px; }
.auth-panel form > label:first-child { margin-top: 0; }
.auth-panel .note { margin: 12px 0 0; }
.auth-footer { text-align: center; font-size: 13px; margin: 22px 0 0; }
.tools { display: flex; gap: 16px; align-items: end; flex-wrap: wrap; }
.tools > div { flex: 1; min-width: 120px; max-width: 260px; }
.tools .quantity { max-width: 160px; }
.tools label { margin-top: 0; }
.tools button { flex-shrink: 0; }
#generated { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 4px; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel > .section-heading { padding: 20px 24px; margin: 0; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
th, td { padding: 16px 20px; text-align: left; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 24px; }
th { padding-top: 12px; padding-bottom: 12px; font-size: 12px; font-weight: 500; color: #65707e; background: #f8f9fb; }
tbody tr:hover { background: #fafbfc; }
td small, td code { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
td .row-id { font-weight: 600; }
.row-actions { display: flex; align-items: center; gap: 12px; }
td button { min-height: 36px; padding: 5px 0; border: 0; background: transparent; color: var(--accent); font-size: 13px; }
td button:hover { background: transparent; text-decoration: underline; }
td button[data-action="delete"] { color: #b73c3c; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 3px; background: #f0f2f5; color: #5f6976; font-size: 12px; font-weight: 500; }
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.active { color: #21754c; background: #edf7f0; }
.banned { color: #b03838; background: #fceeee; }
.expired { color: #946119; background: #fcf5e8; }
.deleted { color: #6b7280; background: #f1f2f4; }
.table-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 24px; }
.pagination { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; }
.pagination button { min-height: 36px; padding: 6px 12px; }
.table-note { margin: 0; padding: 0 24px 20px; }
.empty { text-align: center; color: var(--muted); padding: 48px; }
.meta { display: grid; grid-template-columns: 1.3fr 1.2fr 1fr; background: white; border: 1px solid var(--line); border-radius: 5px; margin: 24px 0; padding: 24px 0; }
.meta > div { padding: 0 24px; border-right: 1px solid var(--line); min-width: 0; }
.meta > div:last-child { border: 0; }
.meta b { display: block; font-size: 18px; font-weight: 600; margin-top: 7px; font-variant-numeric: tabular-nums; }
.meta small { color: var(--muted); font-size: 12px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); gap: 24px; margin: 0 0 24px; }
.tabs button { padding: 10px 0 12px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-size: 13px; color: var(--muted); white-space: normal; }
.tabs button:hover { background: transparent; color: var(--accent); }
.tabs .selected { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.connection { display: flex; gap: 20px; align-items: center; }
.qr { display: block; width: 180px; height: 180px; background: white; flex-shrink: 0; border: 1px solid var(--line); padding: 8px; }
.connection-info { min-width: 0; flex: 1; }
.connection-info label { margin-top: 0; }
.connection-info .note { margin: 0 0 14px; }
.copyrow { display: flex; gap: 8px; }
.copyrow input { font: 12px/1.6 ui-monospace, Consolas, monospace; min-width: 0; }
.copyrow button { padding: 9px 12px; }
.connection .copyrow { flex-wrap: wrap; }
.connection .copyrow input { flex-basis: 100%; }
.connection .actions { margin-top: 10px; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.actions .button { font-size: 13px; }
.service-note { border-top: 1px solid var(--line); padding-top: 18px; margin: 20px 0 0; }
details { margin: 20px 0 0; }
summary { cursor: pointer; font-size: 13px; color: #535d6a; }
details p { margin: 12px 0 0; }
#password-form { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 4px; }
#password-form .note { margin: 10px 0 16px; }
.error { color: #b03838; background: #fceeee; padding: 12px 16px; border-radius: 4px; }
#notice:not(:empty) { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); padding: 12px 20px; background: #252b35; color: white; border-radius: 4px; max-width: 90vw; z-index: 100; font-size: 13px; }
@media (max-width: 1200px) {
  .connection { flex-direction: column; align-items: stretch; }
  .qr { align-self: center; }
  .connection .copyrow { flex-wrap: nowrap; }
  .connection .copyrow input { flex-basis: auto; }
  .meta b { font-size: 16px; }
}
@media (max-width: 900px) {
  .sidebar { width: 176px; }
  .brand { padding: 0 22px; }
  nav { padding: 20px 10px; }
  .workspace { margin-left: 176px; }
  main { padding: 28px 24px 48px; }
  .topbar { padding: 0 24px; }
  .grid { grid-template-columns: 1fr; }
  .connection { flex-direction: row; align-items: center; }
  .meta { grid-template-columns: 1fr; padding: 0 20px; }
  .meta > div { padding: 16px 0; border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .sidebar { position: static; width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { height: 56px; padding: 0 20px; font-size: 17px; }
  nav { display: flex; gap: 4px; padding: 0 12px 10px; }
  nav a { flex: 1; justify-content: center; padding: 8px; gap: 7px; font-size: 13px; }
  nav svg { width: 16px; height: 16px; }
  .workspace { margin-left: 0; }
  .topbar { display: none; }
  main { padding: 24px 16px 40px; }
  h1 { font-size: 23px; }
  .page-heading { margin-bottom: 24px; }
  .page-heading p { font-size: 13px; }
  .panel { padding: 20px; }
  .narrow { margin: 16px auto; }
  .auth-panel { padding: 26px 22px; }
  .tools { gap: 14px; }
  .tools > div, .tools .quantity { min-width: 100px; max-width: none; }
  .tools > button { width: 100%; }
  .section-heading { align-items: flex-start; }
  .table-panel { padding: 0; }
  .table-panel > .section-heading { padding: 20px; }
  .table-footer { padding: 16px 20px; align-items: flex-start; flex-direction: column; }
  .table-note { padding: 0 20px 20px; }
  .meta { margin: 20px 0; }
  .connection { flex-direction: column; align-items: stretch; }
  .qr { width: 200px; height: 200px; }
  .tabs { gap: 20px; }
  .grid { gap: 20px; }
}
