:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color: #203431;
  background: #f6f8f7;
  font-synthesis: none;
  --accent: #187861;
  --border: #dfe7e3;
  --muted: #71807a;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}
a {
  color: var(--accent);
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 16px;
  background: white;
  color: #29463c;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
button:hover,
.button:hover {
  background: #eff5f1;
  border-color: #b6ccc0;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #6fbc9d;
  outline-offset: 3px;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.primary:hover {
  background: #105c49;
  color: white;
  border-color: #105c49;
}
.text-button {
  background: none;
  border: 0;
  padding: 7px 0;
  color: var(--accent);
}
.danger {
  color: #a93632;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  line-height: 1.4;
  letter-spacing: -1px;
  margin-bottom: 8px;
}
h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}
h3 {
  font-size: 14px;
}
.muted,
.footnote {
  color: var(--muted);
}
.footnote {
  font-size: 12px;
  margin: 18px 0 0;
}
.eyebrow,
.nav-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1.6px;
  margin-bottom: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #214a3e;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.5px;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: white;
  font-size: 24px;
  font-family: Georgia, serif;
}
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: 0 3px 12px #173e2603;
}
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-intro {
  background: #eaf1ec;
  padding: 55px 12%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-intro > .brand {
  position: absolute;
  top: 42px;
}
.auth-intro h1 {
  font-size: 44px;
  line-height: 1.5;
  margin: 16px 0 22px;
}
.intro-text {
  color: #687c72;
  max-width: 320px;
  font-size: 16px;
}
.status-link {
  margin-top: 36px;
}
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 36px;
}
.auth-panel form {
  width: 390px;
  padding: 36px;
}
.auth-panel button {
  width: 100%;
  margin-top: 9px;
}
.auth-panel h2 {
  font-size: 25px;
  margin-bottom: 6px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 550;
  margin: 16px 0;
}
input,
select,
textarea {
  padding: 10px 12px;
  border: 1px solid #d6e0da;
  border-radius: 7px;
  background: white;
  color: #243c31;
  min-width: 0;
  width: 100%;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #18786113;
}
input:disabled {
  background: #f4f6f4;
  color: #77847c;
}
.error {
  color: #ae3932;
  font-size: 13px;
  margin: 12px 0 0;
}
.sidebar {
  width: 240px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 30px 22px;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  margin-bottom: 50px;
  font-size: 16px;
}
.nav-label {
  padding-left: 13px;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
nav button {
  justify-content: flex-start;
  border: 0;
  background: transparent;
  color: #66786e;
  padding: 12px 15px;
}
nav button.selected {
  background: #eaf4ee;
  color: #116445;
  font-weight: 600;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 22px 10px 0;
  font-size: 12px;
}
#account-label {
  margin-top: 20px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.sidebar-bottom a {
  color: var(--muted);
}
main {
  margin-left: 240px;
  padding: 44px 4%;
  max-width: 1600px;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
.page-header p {
  margin-bottom: 0;
}
.page-header .eyebrow {
  margin-bottom: 8px;
}
.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.toolbar label {
  margin: 0;
  min-width: 160px;
  max-width: 250px;
}
.toolbar .button {
  margin-left: auto;
  height: 42px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.stat {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}
.stat p {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}
.stat strong {
  font-size: 30px;
  font-weight: 550;
  letter-spacing: -0.8px;
}
.stat small {
  font-size: 13px;
  color: var(--muted);
  margin-left: 4px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
}
.section-heading h2 {
  margin-bottom: 0;
}
.section-heading p {
  margin: 6px 0 0;
  font-size: 12px;
}
.chart {
  height: 175px;
}
.chart svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.chart rect {
  fill: #429a7d;
}
.chart text {
  fill: #829187;
  font-size: 11px;
}
.chart line {
  stroke: #e8eeea;
  stroke-width: 1;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 13px;
}
th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  background: #fafbf9;
}
th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid #edf1ed;
  vertical-align: middle;
}
td.numeric,
th.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table-wrap {
  overflow-x: auto;
}
td .text-button {
  font-size: 12px;
  margin-right: 10px;
}
td code {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 5px;
  background: #eef3f0;
  font-size: 11px;
  white-space: nowrap;
}
.badge.active {
  color: #25704f;
  background: #eaf5ee;
}
.badge.pending {
  color: #9b6b0c;
  background: #fdf5df;
}
.badge.disabled,
.badge.deleted,
.badge.revoked,
.badge.rejected,
.badge.expired {
  color: #94625a;
  background: #f7efed;
}
.empty {
  padding: 40px 18px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}
.tool-row {
  border-bottom: 1px solid #edf1ed;
}
.tool-row summary {
  cursor: pointer;
  padding: 13px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.tool-row summary span:last-child {
  color: var(--muted);
  font-size: 12px;
}
.tool-row summary strong {
  font-weight: 500;
}
.tool-row summary strong:before {
  content: "▸";
  color: #9aaa9f;
  margin-right: 10px;
}
.tool-row[open] summary strong:before {
  content: "▾";
}
.endpoint {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #f6f8f5;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 22px 0;
  color: var(--muted);
  font-size: 12px;
  flex-wrap: wrap;
}
.endpoint code {
  color: #315240;
  overflow-wrap: anywhere;
}
.endpoint button {
  margin-left: auto;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
#notice {
  position: fixed;
  z-index: 10;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e5140;
  color: white;
  padding: 12px 22px;
  border-radius: 9px;
  box-shadow: 0 5px 20px #143c3225;
  max-width: 90vw;
}
dialog {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 520px;
  max-width: 94vw;
  color: #203431;
  box-shadow: 0 20px 90px #1c332030;
}
dialog::backdrop {
  background: #172d2755;
}
dialog p {
  font-size: 13px;
  color: var(--muted);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
textarea {
  resize: vertical;
  min-height: 90px;
  word-break: break-all;
}
.secret-warning {
  background: #fff8e6;
  border-radius: 8px;
  padding: 12px;
  color: #8a631e !important;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}
.small {
  font-size: 11px;
  color: var(--muted);
}
@media (max-width: 1100px) {
  .sidebar {
    width: 205px;
    padding: 25px 16px;
  }
  main {
    margin-left: 205px;
    padding: 30px 24px;
  }
  .stats-grid {
    gap: 10px;
  }
  .stat {
    padding: 16px;
  }
  .stat strong {
    font-size: 25px;
  }
  .toolbar .button {
    margin-left: 0;
  }
  .auth-intro h1 {
    font-size: 34px;
  }
}
@media (max-width: 760px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .auth-intro {
    padding: 28px;
    min-height: 0;
  }
  .auth-intro > .brand {
    position: static;
  }
  .auth-intro .eyebrow,
  .auth-intro h1,
  .intro-text,
  .status-link {
    display: none;
  }
  .auth-panel {
    padding: 20px;
  }
  .auth-panel form {
    width: 100%;
    max-width: 440px;
  }
  .sidebar {
    position: static;
    height: auto;
    width: auto;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .sidebar .brand {
    margin-bottom: 20px;
  }
  .nav-label,
  .sidebar-bottom {
    display: none;
  }
  nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  nav button {
    padding: 8px 12px;
  }
  main {
    margin-left: 0;
    padding: 24px 18px;
  }
  .page-header {
    margin-bottom: 22px;
  }
  h1 {
    font-size: 26px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .toolbar {
    gap: 10px;
  }
  .toolbar label {
    min-width: 130px;
    flex: 1;
    max-width: none;
  }
  .toolbar .button {
    height: 40px;
  }
  .card {
    padding: 18px;
  }
  .section-heading {
    align-items: flex-start;
  }
  .section-heading > span {
    font-size: 10px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .tool-row summary {
    align-items: flex-start;
  }
  .tool-row summary span:last-child {
    font-size: 10px;
  }
  .page-header > .muted {
    font-size: 12px;
  }
  .endpoint {
    padding: 12px;
    gap: 8px;
  }
  .endpoint code {
    font-size: 10px;
  }
  .small {
    max-width: 130px;
    overflow-wrap: anywhere;
  }
}
@media (max-width: 760px) {
  .sidebar-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0 0;
    margin-top: 14px;
  }
  .sidebar-bottom #account-label {
    margin: 0;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sidebar-bottom a {
    display: none;
  }
}

/* OAuth 页面与控制台共享颜色、表单和按钮；独立页面无需脚本。 */
.oauth-body .oauth-shell {
  margin: 0 auto;
  padding: 36px 20px;
  max-width: 680px;
}
.oauth-shell > .brand { margin-bottom: 28px; }
.oauth-card { padding: 32px; }
.oauth-card h1 { font-size: 26px; margin: 10px 0 24px; }
.oauth-card h2 { font-size: 17px; }
.oauth-app-name { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.oauth-client-id, .oauth-callback, .oauth-scope, .oauth-app h3 {
  overflow-wrap: anywhere;
  word-break: normal;
}
.oauth-permissions { padding-left: 22px; }
.oauth-permissions li { padding: 6px 0; }
.oauth-permissions code { color: var(--muted); font-size: 12px; }
.oauth-callback { margin: 18px 0; }
.oauth-callback summary { cursor: pointer; }
.oauth-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 12px; }
.oauth-app { border-top: 1px solid var(--border); padding: 24px 0 12px; }
.oauth-app h3 { margin: 0 0 8px; }
.oauth-app .section-heading { align-items: flex-start; gap: 16px; }
.oauth-app .section-heading > div { min-width: 0; }
.oauth-app .badge { margin-right: 6px; }
.oauth-scope { line-height: 2; }
.oauth-scope code { font-size: 11px; color: var(--muted); }
@media (max-width: 600px) {
  .oauth-card { padding: 22px; }
  .oauth-body .oauth-shell { padding: 24px 12px; }
  .oauth-app .section-heading { flex-wrap: wrap; }
}
