:root {
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
  color: #203137;
  background: #f4f6f6;
  font-size: 14px;
  line-height: 1.6;
  --accent: #087e78;
  --muted: #53686a;
  --line: #d8e0e0;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button { padding: 9px 15px; cursor: pointer; border: 1px solid transparent; border-radius: 7px; background: var(--accent); color: white; }
button:hover { background: #066762; }
button:disabled { opacity: .5; cursor: wait; }
button.secondary { color: #203137; background: white; border-color: var(--line); }
button.danger { color: #a03324; background: #fff1ed; border-color: #e7c5bd; }
button.link { color: #08736e; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
button:focus-visible, input:focus, textarea:focus, select:focus, a:focus-visible { outline: 2px solid #087e78; outline-offset: 3px; }
input, select, textarea { padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; min-width: 0; color: #203137; background: white; caret-color: var(--accent); }
textarea { min-height: 110px; resize: vertical; }
label { display: grid; gap: 6px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; }
label.check input { width: auto; }
fieldset { border: 1px solid var(--line); padding: 18px; }
legend { padding: 0 8px; }
h1 { font-size: 24px; line-height: 1.3; font-weight: 650; margin: 0; }
h2 { font-size: 18px; line-height: 1.4; margin: 28px 0 14px; }
h3 { font-size: 15px; margin: 22px 0 10px; }
p { max-width: 75ch; overflow-wrap: anywhere; }
a { color: #08736e; text-underline-offset: 3px; }
small, .muted { color: var(--muted); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; }
::selection { background: #bce3de; color: #123b39; }
* { scrollbar-color: #a2b8b5 #eef3f2; scrollbar-width: thin; }
[hidden] { display: none !important; }
#login-view { min-height: 100vh; display: grid; place-items: center; background: #102e35; padding: 20px; }
#login-form { width: min(420px, 100%); background: white; padding: 36px; border-radius: 12px; display: grid; gap: 20px; }
#login-form p { margin: 0; color: var(--muted); }
aside { position: fixed; width: 210px; inset: 0 auto 0 0; background: #102e35; color: #e6f1f0; padding: 26px 18px; display: flex; flex-direction: column; }
.brand { color: white; text-decoration: none; font-size: 22px; font-weight: 650; margin-bottom: 32px; }
nav { display: grid; gap: 5px; }
nav button { text-align: left; background: transparent; color: #b9d0ce; }
nav button.active { background: #22514f; color: white; }
.account { display: grid; gap: 14px; margin-top: auto; padding-top: 20px; }
main { margin-left: 210px; padding: 28px 32px 60px; max-width: 1600px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.toolbar label { flex: 1 1 150px; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; min-width: 760px; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th { color: #40595c; background: #eef3f2; font-size: 12px; font-weight: 600; }
th, td { padding: 12px 14px; border-bottom: 1px solid #e6eceb; vertical-align: top; overflow-wrap: anywhere; }
td { min-width: 95px; }
td:first-child { min-width: 250px; max-width: 380px; }
td button.link { max-width: 340px; text-align: left; overflow-wrap: anywhere; }
.domain-row { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: 14px; margin: 18px 0; }
td.actions { min-width: 175px; }
td.actions button { padding: 5px 9px; margin: 0 6px 6px 0; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f6faf9; }
.empty { padding: 36px 20px; background: white; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; }
.status { display: inline-block; padding: 2px 7px; border-radius: 4px; background: #e7efed; color: #304f4d; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; max-width: 900px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid button { justify-self: start; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); background: white; border: 1px solid var(--line); border-radius: 8px; }
.stats div { padding: 22px; }
.stats dt { color: var(--muted); }
.stats dd { margin: 8px 0 0; font-size: 28px; font-variant-numeric: tabular-nums; }
.notice { padding: 14px 18px; background: #e6f2ef; color: #234e49; border-radius: 6px; }
#notice { position: fixed; bottom: 18px; left: max(18px, calc(50% - 250px)); max-width: min(600px, 90vw); margin: 0; padding: 14px 20px; background: #173e40; color: white; border-radius: 7px; box-shadow: 0 8px 24px #102e3526; z-index: 10; }
#notice.error { background: #862f24; }
dialog { color: #203137; width: min(960px, 94vw); max-height: 90vh; border: 0; border-radius: 12px; padding: 26px; box-shadow: 0 16px 60px #102e3533; }
dialog::backdrop { background: #102e3580; }
dialog header h2 { margin: 0; }
iframe { width: 100%; min-height: 260px; border: 1px solid var(--line); background: white; }
.metadata { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.metadata dt { color: var(--muted); }
.metadata dd { margin: 0; overflow-wrap: anywhere; }
.scopes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.token { overflow-wrap: anywhere; padding: 15px; background: #edf4f2; user-select: all; font-family: ui-monospace, monospace; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } main { padding: 22px; } }
@media (max-width: 650px) {
  aside { position: static; width: 100%; padding: 16px; }
  .brand { margin-bottom: 14px; }
  nav { display: flex; overflow-x: auto; }
  nav button { white-space: nowrap; }
  .account { display: flex; align-items: center; justify-content: space-between; }
  main { margin: 0; padding: 20px 16px; }
  .form-grid, .scopes { grid-template-columns: 1fr; }
  .domain-row { grid-template-columns: 1fr; }
  .metadata { grid-template-columns: 80px 1fr; }
  .toolbar { align-items: stretch; }
  .toolbar button { align-self: end; }
}
