:root {
  color-scheme: light;
  --ink: #17211d;
  --muted: #65736c;
  --line: #d8dfdb;
  --surface: #ffffff;
  --canvas: #f1f4f2;
  --green: #087b5b;
  --green-dark: #075d47;
  --blue: #275f8f;
  --red: #b6423c;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font: 14px/1.5 "Microsoft YaHei", "PingFang SC", Arial, sans-serif; }
button, input { font: inherit; }
button, a { transition: background-color .15s ease, border-color .15s ease; }
button { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); cursor: pointer; }
button:hover { border-color: var(--green); }
a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; min-height: 58px; padding: 0 24px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.topbar strong { font-size: 17px; }
.topbar span { margin-left: 10px; color: var(--muted); }
.topbar nav { display: flex; gap: 18px; }
.admin-main { width: min(1440px, calc(100% - 32px)); margin: 22px auto 48px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.summary-grid article { min-height: 112px; padding: 16px 18px; border: 1px solid var(--line); border-top: 3px solid var(--green); border-radius: 6px; background: var(--surface); }
.summary-grid span, .summary-grid small { display: block; color: var(--muted); }
.summary-grid strong { display: block; margin: 7px 0 3px; font-size: 28px; line-height: 1.15; letter-spacing: 0; }

.tabs { display: flex; gap: 2px; margin-top: 20px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; }
.tabs button.active { border-bottom-color: var(--green); color: var(--green-dark); font-weight: 700; }
.tab-panel { min-height: 420px; padding: 18px; border: 1px solid var(--line); border-top: 0; background: var(--surface); }
.panel-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 14px; }
h2 { margin: 0; font-size: 17px; letter-spacing: 0; }
h3 { margin: 0 0 10px; font-size: 14px; letter-spacing: 0; }
.panel-toolbar p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.filters { display: flex; align-items: center; gap: 10px; }
.filters input[type="search"] { width: 180px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; }
.filters label { white-space: nowrap; color: var(--muted); font-size: 12px; }
.access-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; }
.access-layout aside { padding: 12px; border-left: 1px solid var(--line); }
.access-layout ol { margin: 0; padding-left: 26px; }
.access-layout li { margin: 5px 0; color: var(--muted); }
.access-layout li span { float: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { height: 38px; padding: 7px 10px; border-bottom: 1px solid #e9eeeb; text-align: left; }
th { position: sticky; top: 0; z-index: 1; background: #eef3f0; color: #425149; font-size: 12px; }
td { font-size: 12px; }
td.path { max-width: 520px; overflow: hidden; text-overflow: ellipsis; }
.method { color: var(--blue); font-weight: 700; }
.status-error { color: var(--red); font-weight: 700; }
.file-link, .detail-button { display: inline-flex; align-items: center; min-height: 28px; margin-right: 8px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 12px; }
.detail-button { cursor: pointer; }
pre { max-height: 650px; margin: 0; padding: 16px; overflow: auto; border: 1px solid var(--line); background: #17211d; color: #e6eee9; font: 12px/1.55 Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

dialog { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 1px solid var(--line); border-radius: 6px; }
dialog::backdrop { background: rgba(18, 29, 24, .48); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dialog-head button { width: 32px; min-height: 32px; padding: 0; font-size: 22px; }
dialog pre { max-height: calc(100vh - 125px); border: 0; }
#adminStatus { position: fixed; right: 18px; bottom: 18px; display: none; padding: 9px 13px; border-radius: 4px; background: var(--ink); color: #fff; font-size: 12px; }
#adminStatus.show { display: block; }

.login-page { display: grid; min-height: 100vh; place-items: center; background: #e9efec; }
.login-shell { width: min(380px, calc(100vw - 32px)); padding: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: 0 12px 35px rgba(19, 33, 27, .11); }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 4px; background: var(--green); color: #fff; font-weight: 800; }
.login-shell h1 { margin: 16px 0 0; font-size: 21px; letter-spacing: 0; }
.login-shell > p { margin: 2px 0 22px; color: var(--muted); }
.login-form { display: grid; gap: 9px; }
.login-form label { color: var(--muted); font-size: 12px; }
.login-form input { width: 100%; height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; }
.login-form button { margin-top: 8px; border-color: var(--green); background: var(--green); color: #fff; }
.login-form button:hover { background: var(--green-dark); }
.login-error { color: var(--red); font-size: 12px; }

@media (max-width: 900px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .access-layout { grid-template-columns: 1fr; }
  .access-layout aside { border-top: 1px solid var(--line); border-left: 0; }
  .panel-toolbar { align-items: start; flex-direction: column; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 14px; }
  .topbar span { display: none; }
  .admin-main { width: calc(100% - 18px); margin-top: 12px; }
  .summary-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .summary-grid article { min-height: 96px; padding: 12px; }
  .summary-grid strong { font-size: 22px; }
  .tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tabs button { min-width: 0; padding: 0 4px; font-size: 12px; white-space: normal; }
  .tab-panel { padding: 10px; }
  .filters { width: 100%; flex-wrap: wrap; }
  .filters input[type="search"] { flex: 1; min-width: 130px; }
}
.login-alt { margin: 10px 0 0; text-align: center; font-size: 12px; color: var(--muted, #666); }
.login-alt a { color: #2f7d4f; text-decoration: none; }
.login-alt a:hover { text-decoration: underline; }
