:root {
  color-scheme: light;
  --canvas: #f5f7fa;
  --surface: #fff;
  --ink: #192536;
  --muted: #627084;
  --line: #dfe5ed;
  --control-line: #9caabc;
  --blue: #245bd6;
  --blue-hover: #194bb8;
  --blue-soft: #edf3ff;
  --danger: #b42332;
  --danger-soft: #fff2f3;
  --warning: #895b16;
  --warning-soft: #fff7e8;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .6; }
button[aria-busy="true"] { cursor: wait; }
input:disabled, select:disabled, textarea:disabled { background: var(--canvas); color: var(--muted); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
:target { scroll-margin-top: 20px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 29px; line-height: 1.3; font-weight: 650; letter-spacing: -.8px; }
h2 { font-size: 21px; line-height: 1.4; font-weight: 650; }
h3 { font-size: 17px; font-weight: 650; }
svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 13px; line-height: 1.65; }
.mono, code, pre { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.break-word { overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; top: 10px; left: 12px; z-index: 50; padding: 10px 16px; background: var(--surface); transform: translateY(-160%); border: 1px solid var(--blue); border-radius: 6px; }
.skip-link:focus { transform: translateY(0); }
.boot, .noscript { padding: 20vh 24px; text-align: center; color: var(--muted); }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 220px; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); padding: 30px 18px 22px; z-index: 10; }
.brand { display: flex; gap: 12px; align-items: center; color: var(--ink); font-size: 18px; font-weight: 650; padding: 0 8px; }
.brand:hover { text-decoration: none; }
.brand small { display: block; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: 1.65px; line-height: 1.8; }
.brand-mark { flex-shrink: 0; display: inline-grid; place-items: center; width: 37px; height: 39px; border-radius: 10px; background: var(--blue); color: white; font-size: 24px; font-weight: 650; }
.nav-label { margin: 45px 15px 12px; color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.main-nav { display: grid; gap: 8px; }
.main-nav a { display: flex; align-items: center; gap: 13px; min-height: 48px; padding: 11px 15px; border-radius: 8px; color: var(--muted); font-size: 15px; font-weight: 550; transition: background .15s, color .15s; }
.main-nav a:hover { background: var(--canvas); color: var(--ink); text-decoration: none; }
.main-nav a[aria-current="page"] { color: var(--blue); background: var(--blue-soft); }
.sidebar-foot { margin-top: auto; padding: 20px 10px 0; color: var(--muted); font-size: 12px; }
.workspace { margin-left: 220px; }
.topbar { min-height: 77px; display: flex; align-items: center; justify-content: space-between; padding: 12px 40px; border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-label { color: var(--muted); font-size: 13px; }
.account { display: flex; align-items: center; gap: 18px; font-size: 13px; min-width: 0; }
#admin-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#main { max-width: 1560px; margin: 0 auto; padding: 38px 40px 64px; }
#main:focus { outline: none; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; }
.page-heading .subtitle { color: var(--muted); margin-top: 9px; font-size: 14px; }
.heading-actions { display: flex; gap: 8px; flex-shrink: 0; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 44px; padding: 9px 16px; border: 1px solid var(--control-line); border-radius: 7px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 550; text-decoration: none; line-height: 1.6; transition: background .15s, border-color .15s; }
.button:hover { background: var(--canvas); text-decoration: none; }
.button:active { background: var(--line); }
.button.primary { background: var(--blue); border-color: var(--blue); color: white; }
.button.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.button.quiet { background: transparent; border-color: transparent; color: var(--muted); padding-inline: 10px; }
.button.quiet:hover { background: var(--canvas); color: var(--ink); }
.button.link { border-color: transparent; background: transparent; color: var(--blue); padding: 9px 10px; }
.button.link:hover { background: var(--blue-soft); }
.button.danger { color: var(--danger); border-color: var(--danger); }
.button.danger:hover { background: var(--danger-soft); }
.button[aria-busy="true"]::before { content: ""; width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; background: var(--surface); }
.filters .field { margin: 0; min-width: 160px; max-width: 250px; flex: 1 1 180px; }
.filters label { font-size: 12px; color: var(--muted); font-weight: 500; margin-bottom: 5px; }
.filters .inline-error { flex-basis: 100%; margin: 0; }
.list-region { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.filters + .list-region { border-top: 0; border-radius: 0 0 var(--radius) var(--radius); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left; table-layout: fixed; }
th { font-size: 12px; font-weight: 500; color: var(--muted); background: #fafbfc; padding: 13px 20px; border-bottom: 1px solid var(--line); }
td { padding: 20px; vertical-align: middle; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcff; }
td.actions-cell, th.actions-cell { width: 76px; padding-left: 8px; padding-right: 12px; text-align: right; }
.cell-primary { font-weight: 600; }
.cell-secondary { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.sms-table th:nth-child(1) { width: 17%; }
.sms-table th:nth-child(2) { width: 30%; }
.sms-table th:nth-child(3) { width: 14%; }
.sms-table th:nth-child(4) { width: 13%; }
.sms-table th:nth-child(5) { width: 18%; }
.sms-preview, .email-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.75; white-space: pre-wrap; }
.email-table th:nth-child(1) { width: 27%; }
.email-table th:nth-child(2) { width: 32%; }
.email-table th:nth-child(3) { width: 16%; }
.email-filters .field { max-width: 340px; }
.mail-permission { margin: -4px 0 20px; }
.email-preview + .email-preview { margin-top: 4px; }
.list-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.list-footer .inline-error { width: 100%; margin: 0; }
.empty-state { padding: 76px 24px; text-align: center; }
.empty-symbol { display: inline-flex; justify-content: center; align-items: center; width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); margin-bottom: 20px; }
.empty-symbol svg { width: 25px; height: 25px; }
.empty-state h2 { font-size: 17px; }
.empty-state p { color: var(--muted); font-size: 14px; margin: 9px auto 22px; max-width: 420px; }
.loading-state { padding: 64px 24px; text-align: center; color: var(--muted); font-size: 14px; }
.error-panel { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.error-panel p { margin-bottom: 16px; color: var(--danger); overflow-wrap: anywhere; }
.exception { display: inline-block; color: var(--warning); background: var(--warning-soft); border-radius: 4px; padding: 1px 6px; font-size: 12px; margin: 4px 6px 0 0; }
.field { display: flex; flex-direction: column; margin-bottom: 20px; min-width: 0; }
label, legend { font-size: 14px; font-weight: 550; }
.field > label { margin-bottom: 7px; }
input:not([type="checkbox"]), select, textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--control-line); border-radius: 6px; color: var(--ink); background: var(--surface); font-size: 16px; line-height: 1.5; }
textarea { resize: vertical; min-height: 110px; }
input[type="checkbox"] { width: 18px; height: 18px; flex-shrink: 0; margin: 0; accent-color: var(--blue); }
.field .hint { margin-top: 7px; }
input[readonly], textarea[readonly] { background: var(--canvas); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 7px 0; font-weight: 400; overflow-wrap: anywhere; }
.check span { min-width: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
legend { margin-bottom: 8px; padding: 0; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; max-height: 250px; overflow-y: auto; padding: 2px 5px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
form > h3 { margin-bottom: 20px; }
.inline-error { padding: 12px 14px; border-left: 3px solid var(--danger); border-radius: 4px; color: var(--danger); background: var(--danger-soft); font-size: 14px; margin: 16px 0; overflow-wrap: anywhere; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--line); }
.form-actions .hint { margin-right: auto; }
dialog { width: min(620px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 90px #18294326; overscroll-behavior: contain; }
dialog::backdrop { background: #18243666; }
body:has(dialog[open]) { overflow: hidden; }
dialog.wide { width: min(840px, calc(100% - 32px)); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 19px 24px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { overflow-wrap: anywhere; }
.dialog-header h2:focus { outline: none; }
.dialog-close { flex-shrink: 0; font-size: 23px; min-width: 44px; padding: 2px 10px !important; font-weight: 400; }
.dialog-body { padding: 24px; }
.dialog-body > .muted:first-child { margin-bottom: 20px; }
details { margin-top: 20px; border-top: 1px solid var(--line); }
summary { cursor: pointer; padding: 16px 0; font-size: 14px; font-weight: 550; min-height: 48px; }
summary:hover { color: var(--blue); }
.details-content { padding: 4px 0 4px; }
.details-content > .hint { margin-bottom: 16px; }
.details-content > .list-region { margin-bottom: 24px; }
.details-content .empty-state { padding: 24px 16px; }
.details-content .empty-symbol { display: none; }
.details-content table { font-size: 13px; }
.details-content td, .details-content th { padding: 12px; }
.metadata { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; margin: 0 0 24px; }
.metadata div { min-width: 0; }
.metadata dt { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.metadata dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 16px; line-height: 1.9; padding: 20px; margin: 12px 0 24px; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); }
.key-value { font-size: 14px; min-height: 110px; word-break: break-all; }
.key-notice { color: var(--warning); background: var(--warning-soft); border-radius: 6px; padding: 12px 14px; font-size: 14px; margin-bottom: 20px; }
.subnav { display: flex; gap: 24px; margin: -3px 0 28px; border-bottom: 1px solid var(--line); }
.subnav a { min-height: 44px; padding: 8px 0 12px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.subnav a[aria-current="page"] { color: var(--blue); border-color: var(--blue); }
.settings-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; max-width: 720px; }
.settings-panel h2 { font-size: 18px; margin-bottom: 8px; }
.settings-panel > .muted { margin-bottom: 28px; font-size: 14px; }
.settings-panel input { max-width: 240px; }
.settings-panel .form-actions { justify-content: flex-start; }
.api-docs { max-width: 900px; }
.api-intro { margin-bottom: 24px; }
.api-intro p { margin: 12px 0; font-size: 14px; color: var(--muted); }
pre { background: #f0f3f8; border: 1px solid var(--line); border-radius: 7px; padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.75; margin: 10px 0 20px; }
.endpoint { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 0 20px; margin-top: 12px; }
.endpoint summary { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; list-style: none; }
.endpoint summary::-webkit-details-marker { display: none; }
.endpoint summary::after { content: "+"; margin-left: auto; font-size: 20px; font-weight: 400; color: var(--muted); }
.endpoint[open] summary::after { content: "−"; }
.endpoint .method { font-size: 11px; color: var(--blue); min-width: 38px; font-weight: 650; }
.endpoint .endpoint-title { color: var(--muted); font-size: 13px; font-weight: 400; }
.endpoint p { font-size: 14px; margin: 10px 0 16px; }
.endpoint h3 { font-size: 13px; }
.endpoint code { overflow-wrap: anywhere; }
.login-dialog { padding: 36px; width: min(420px, calc(100% - 32px)); }
.login-brand { display: flex; align-items: center; gap: 11px; font-weight: 600; margin-bottom: 32px; }
.login-dialog h1 { font-size: 25px; }
.login-dialog #login-description { font-size: 14px; margin: 10px 0 26px; }
.login-submit { width: 100%; margin-top: 6px; }
.login-foot { margin-top: 24px; color: var(--muted); font-size: 12px; text-align: center; }
.toast { position: fixed; inset: auto auto 28px 50%; transform: translateX(-50%); max-width: min(500px, calc(100% - 32px)); padding: 11px 18px; color: white; background: #243449; border-radius: 8px; font-size: 14px; box-shadow: 0 4px 20px #19253624; z-index: 100; text-align: center; pointer-events: none; }
@media (max-width: 1150px) {
  .sidebar { width: 192px; padding-inline: 14px; }
  .workspace { margin-left: 192px; }
  #main { padding: 30px 24px 48px; }
  .topbar { padding-inline: 24px; }
  td, th { padding-inline: 14px; }
  .sms-table th:nth-child(2) { width: 25%; }
}
@media (max-width: 820px) {
  .sidebar { position: static; width: auto; padding: max(8px, env(safe-area-inset-top)) 12px 8px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); }
  .sidebar .brand, .nav-label, .sidebar-foot { display: none; }
  .main-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .main-nav a { padding: 9px 4px; min-height: 44px; justify-content: center; gap: 7px; font-size: 13px; line-height: 1.5; }
  .main-nav svg { width: 21px; height: 21px; }
  .workspace { margin-left: 0; }
  .topbar { min-height: 64px; padding: 10px 20px; }
  .topbar-label { font-size: 14px; color: var(--ink); font-weight: 600; }
  #main { padding: 28px 20px calc(40px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }
}
@media (max-width: 680px) {
  h1 { font-size: 25px; }
  .page-heading { gap: 16px; margin-bottom: 22px; }
  .page-heading .subtitle { font-size: 13px; max-width: 29ch; }
  .heading-actions .button { padding-inline: 12px; }
  .filters { padding: 16px; gap: 12px 8px; }
  .filters .field { min-width: 0; max-width: none; flex-basis: calc(50% - 8px); }
  .filters > .button { flex: 0 1 auto; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 18px; border-bottom: 1px solid var(--line); gap: 7px 12px; }
  tbody tr:last-child { border-bottom: 0; }
  td { display: flex; align-items: baseline; gap: 14px; grid-column: 1 / -1; padding: 0 !important; border: 0; font-size: 13px; min-width: 0; }
  td::before { content: attr(data-label); flex: 0 0 66px; font-size: 12px; color: var(--muted); }
  td > * { min-width: 0; }
  td:first-child { grid-column: 1; font-size: 15px; font-weight: 600; margin-bottom: 7px; }
  td:first-child::before { display: none; }
  td.actions-cell { display: block; grid-row: 1; grid-column: 2; width: auto; margin-top: -8px; }
  td.actions-cell::before { display: none; }
  .cell-secondary { font-weight: 400; }
  .sms-preview, .email-preview { -webkit-line-clamp: 3; }
  .empty-state { padding: 52px 20px; }
  .list-footer { padding: 13px 18px; }
  .account { gap: 5px; }
  #admin-name { max-width: 110px; }
  dialog, dialog.wide { width: calc(100% - 20px); max-height: calc(100dvh - 24px); border-radius: 12px; }
  .dialog-header { padding: 16px 20px; }
  .dialog-header h2 { font-size: 19px; }
  .dialog-body { padding: 20px; }
  .dialog-body .form-grid { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
  .metadata { gap: 18px 16px; }
  .settings-panel { padding: 22px 20px; }
  .endpoint { padding: 0 16px; }
  .endpoint summary { gap: 7px; }
  .endpoint summary code { font-size: 12px; }
  .endpoint-title { flex-basis: 80%; padding-left: 45px; }
  .login-dialog { padding: 28px; width: min(420px, calc(100% - 28px)); }
}
@media (max-width: 460px) {
  .page-heading { flex-direction: column; gap: 18px; }
  .page-heading .subtitle { max-width: none; }
  .heading-actions { align-self: flex-end; }
  .metadata { grid-template-columns: 1fr; }
  .form-actions { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
