:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  color: #17221f;
  background: #eef2f0;
  --ink: #17221f;
  --muted: #697570;
  --line: #d7dfdb;
  --line-strong: #c4d0ca;
  --surface: #ffffff;
  --soft: #f5f8f6;
  --nav: #e6eeea;
  --green: #13785b;
  --green-dark: #0d5f49;
  --green-soft: #e1f1eb;
  --blue: #346e9b;
  --blue-soft: #e7f0f7;
  --amber: #a86a05;
  --amber-soft: #fff2d7;
  --red: #bf473d;
  --red-soft: #fae9e5;
  --shadow: 0 18px 46px rgba(28, 48, 40, .13);
}
* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body { min-height: 100vh; background: var(--soft); }
button, input, textarea, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 18px; letter-spacing: 0; }
h2 { font-size: 25px; letter-spacing: 0; }
h3 { font-size: 14px; letter-spacing: 0; }
.overline { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.muted { color: var(--muted); font-size: 11px; }
.admin-login-screen { display: grid; min-height: 100vh; place-items: center; padding: 28px; background: #edf3f0; }
.login-panel { width: min(450px, 100%); padding: 28px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.login-brand, .brand-lockup, .header-actions, .section-heading, .panel-heading, .dialog-header, .dialog-footer { display: flex; align-items: center; }
.login-brand { gap: 13px; }
.brand-mark { display: grid; flex: 0 0 auto; width: 40px; height: 40px; place-items: center; color: #fff; background: var(--green); font-size: 13px; font-weight: 800; }
.login-brand h1 { margin-top: 3px; font-size: 24px; }
.login-brand > div > p:last-child { margin-top: 5px; color: var(--muted); font-size: 12px; }
.login-rule { height: 1px; margin: 28px 0 24px; background: var(--line); }
.login-form { display: grid; gap: 16px; }
.login-form h2 { font-size: 19px; }
.login-form > div > p { max-width: 38ch; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.55; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }
input, textarea, select { width: 100%; min-height: 36px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 3px; color: var(--ink); background: #fff; }
textarea { resize: vertical; }
.button { min-height: 34px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); font-size: 12px; font-weight: 700; }
.button:hover { background: var(--soft); }
.button.primary { color: #fff; border-color: var(--green); background: var(--green); }
.button.primary:hover { border-color: var(--green-dark); background: var(--green-dark); }
.button:disabled { cursor: wait; opacity: .65; }
.button.wide { width: 100%; min-height: 40px; }
.icon-button { min-width: 64px; }
.login-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 26px; color: var(--muted); font-size: 10px; }
.mode-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 8px; border: 1px solid #bfd4e2; border-radius: 3px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 750; white-space: nowrap; }
.form-error { min-height: 16px; color: var(--red); font-size: 11px; }
.admin-app-shell { min-height: 100vh; }
.admin-app-shell[hidden], .admin-login-screen[hidden] { display: none; }
.admin-header { display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 13px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand-lockup { gap: 11px; }
.brand-lockup .brand-mark { width: 36px; height: 36px; font-size: 12px; }
.brand-lockup h1 { margin-top: 2px; }
.header-actions { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.session-label { color: var(--muted); font-size: 11px; }
.admin-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: calc(100vh - 72px); }
.admin-nav { display: flex; flex-direction: column; gap: 3px; padding: 20px 12px; border-right: 1px solid var(--line); background: var(--nav); }
.nav-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 0 10px 11px; color: var(--ink); font-size: 11px; font-weight: 800; }
.nav-heading small { color: var(--muted); font-size: 9px; font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 9px; min-height: 39px; padding: 8px 10px; border: 0; border-radius: 3px; background: transparent; text-align: left; font-size: 12px; font-weight: 700; }
.nav-item:hover { background: rgba(255,255,255,.62); }
.nav-item.active { color: var(--green); background: var(--surface); box-shadow: 0 1px 3px rgba(30, 55, 45, .1); }
.nav-index { width: 22px; color: #8a9992; font-size: 9px; font-variant-numeric: tabular-nums; }
.nav-item.active .nav-index { color: var(--green); }
.nav-note { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line-strong); color: var(--muted); font-size: 10px; line-height: 1.6; }
.nav-note strong, .nav-note span { display: block; color: var(--ink); }
.nav-note strong { margin-bottom: 4px; font-size: 11px; }
.nav-note span { margin-top: 8px; color: var(--amber); }
.admin-main { min-width: 0; padding: 20px 25px 44px; overflow-x: hidden; }
.notice-band { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: 21px; padding: 10px 12px; border: 1px solid #bdd4e4; background: var(--blue-soft); color: var(--blue); font-size: 11px; }
.notice-band > div { display: flex; flex-wrap: wrap; gap: 4px 9px; align-items: baseline; min-width: 0; }
.notice-band strong { white-space: nowrap; }
.notice-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(19,120,91,.12); }
.api-status { margin-left: auto; color: var(--muted); font-size: 10px; white-space: nowrap; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.section-heading { justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-heading h2 { margin-top: 4px; }
.section-heading > div > p:last-child { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.section-hint { color: var(--muted); font-size: 11px; }
.summary-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1px; margin-bottom: 18px; border: 1px solid var(--line); background: var(--line); }
.summary-item { min-width: 0; padding: 14px; border-top: 2px solid var(--line-strong); background: var(--surface); }
.summary-item.green { border-top-color: var(--green); }
.summary-item.blue { border-top-color: var(--blue); }
.summary-item.amber { border-top-color: var(--amber); }
.summary-item span, .summary-item strong, .summary-item small { display: block; }
.summary-item span { color: var(--muted); font-size: 11px; }
.summary-item strong { margin-top: 7px; font-size: 25px; font-variant-numeric: tabular-nums; }
.summary-item small { margin-top: 6px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.lower-grid { margin-bottom: 0; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--surface); }
.panel-heading { justify-content: space-between; gap: 12px; padding: 15px 16px 12px; border-bottom: 1px solid var(--line); }
.panel-heading p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.status { display: inline-flex; align-items: center; width: fit-content; min-height: 22px; padding: 3px 7px; border-radius: 3px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.status.normal { color: var(--green); background: var(--green-soft); }
.status.suspended { color: var(--amber); background: var(--amber-soft); }
.status.expired, .status.disabled { color: var(--red); background: var(--red-soft); }
.switch-list, .role-list, .activity-list, .next-actions { padding: 4px 16px 10px; }
.switch-row, .role-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.switch-row:last-child, .role-row:last-child { border-bottom: 0; }
.switch-row strong, .switch-row span, .role-row strong, .role-row span { display: block; }
.switch-row div span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.switch-state { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.switch-state i { width: 7px; height: 7px; border-radius: 50%; background: #9aa7a1; }
.switch-state.on { color: var(--green); }
.switch-state.on i { background: var(--green); }
.switch-state.off { color: var(--amber); }
.switch-state.off i { background: var(--amber); }
.role-row strong { min-width: 54px; }
.role-row span { flex: 1; color: var(--muted); text-align: right; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 700; }
.text-button:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
.activity-item { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-mark { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--blue); }
.activity-item strong { font-size: 11px; }
.activity-item p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.empty-state { padding: 20px 0; color: var(--muted); font-size: 11px; text-align: center; }
.action-link { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.action-link:last-child { border-bottom: 0; }
.action-link strong { font-size: 11px; }
.action-link span { color: var(--muted); font-size: 10px; }
.action-link:hover strong { color: var(--green); }
.toolbar { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.toolbar label { width: 240px; }
.toolbar .select-field { width: 150px; }
.toolbar-count { margin-left: auto; padding-bottom: 9px; color: var(--muted); font-size: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); }
table { width: 100%; min-width: 960px; border-collapse: collapse; font-size: 11px; }
th, td { padding: 12px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: var(--soft); font-size: 10px; font-weight: 750; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfb; }
.table-link { display: block; padding: 0; border: 0; background: transparent; text-align: left; }
.table-link strong, .table-link small, .table-subline { display: block; }
.table-link:hover strong { color: var(--green); }
.table-link small, .table-subline { margin-top: 4px; color: var(--muted); font-size: 10px; }
.numeric, .limit-value { font-variant-numeric: tabular-nums; }
.feature-list { max-width: 210px; color: var(--muted); line-height: 1.55; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.small-button { padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); font-size: 10px; font-weight: 650; white-space: nowrap; }
.small-button:hover { background: var(--soft); }
.empty-cell { padding: 36px 12px; color: var(--muted); text-align: center; }
.source-label { color: var(--blue); font-size: 10px; }
.audit-detail { display: block; max-width: 300px; overflow: hidden; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.feature-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-bottom: 14px; border: 1px solid var(--line); background: var(--line); }
.feature-summary > div { padding: 13px 15px; background: var(--surface); }
.feature-summary strong, .feature-summary span { display: block; }
.feature-summary strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.feature-summary span { margin-top: 4px; color: var(--muted); font-size: 10px; }
dialog { width: min(520px, calc(100vw - 28px)); max-height: calc(100vh - 28px); padding: 0; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow); }
dialog.wide-dialog { width: min(700px, calc(100vw - 28px)); }
dialog::backdrop { background: rgba(23,34,31,.34); }
.dialog-content { max-height: calc(100vh - 28px); overflow: auto; padding: 21px; }
.dialog-header { justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.dialog-header h2 { margin-top: 4px; font-size: 20px; }
.dialog-header .muted { margin-top: 5px; }
.close-button { min-height: 30px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); font-size: 10px; }
.close-button:hover { background: var(--soft); }
.dialog-footer { justify-content: flex-end; gap: 8px; margin-top: 20px; }
.form-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
fieldset { min-width: 0; margin: 16px 0 0; padding: 11px; border: 1px solid var(--line); }
legend { padding: 0 5px; color: var(--muted); font-size: 10px; }
.feature-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.page-selection { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.check-row { display: flex; grid-template-columns: none; align-items: flex-start; gap: 8px; margin: 0; color: var(--ink); font-size: 11px; line-height: 1.4; }
.check-row input { flex: 0 0 auto; width: 15px; height: 15px; min-height: 15px; margin: 1px 0 0; }
.check-row span { display: grid; gap: 3px; }
.check-row small { color: var(--muted); font-size: 10px; }
.field-help { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; font-weight: 400; }
.dialog-note { margin-top: 14px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.generated-license { display: grid; gap: 8px; margin-top: 14px; padding: 12px; border: 1px solid #b9d9c9; background: var(--green-soft); color: var(--ink); font-size: 10px; }
.generated-license code { padding: 9px 10px; border: 1px solid #c5ded3; background: #fff; color: var(--green); font: 700 13px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .04em; word-break: break-all; user-select: all; }
.generated-license .button { justify-self: start; }
.locked-settings { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 11px; background: var(--soft); color: var(--muted); font-size: 10px; }
.locked-settings strong { color: var(--amber); font-weight: 700; }
.detail-hero { display: grid; grid-template-columns: 1.6fr .8fr .8fr; gap: 1px; margin-bottom: 14px; border: 1px solid var(--line); background: var(--line); }
.detail-hero > div { min-width: 0; padding: 13px; background: var(--soft); }
.detail-hero span, .detail-hero strong, .detail-block span, .detail-block strong { display: block; }
.detail-hero span, .detail-block span { color: var(--muted); font-size: 10px; }
.detail-hero strong { margin-top: 6px; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.detail-block { padding: 12px; border: 1px solid var(--line); background: var(--surface); }
.detail-block strong { margin-top: 7px; font-size: 12px; }
.detail-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-columns > section { min-width: 0; border: 1px solid var(--line); }
.detail-feature-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 14px 16px 16px; }
.feature-tag { padding: 6px 8px; border: 1px solid #c5ded3; border-radius: 3px; color: var(--green); background: var(--green-soft); font-size: 10px; }
.entitlement-preview { display: grid; gap: 5px; min-height: 85px; padding: 15px 16px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.entitlement-preview strong { color: var(--green); font-size: 13px; }
.entitlement-preview small { color: var(--muted); font-size: 9px; }
.danger-text { color: var(--red) !important; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 5; max-width: min(380px, calc(100vw - 40px)); padding: 11px 14px; border: 1px solid #afd7c7; border-radius: 3px; color: var(--green); background: var(--green-soft); box-shadow: 0 10px 28px rgba(21, 55, 42, .12); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity 160ms ease, transform 160ms ease; }
.toast[data-kind="error"] { border-color: #e2bcb6; color: var(--red); background: var(--red-soft); }
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 1120px) { .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .admin-header { align-items: flex-start; gap: 12px; padding: 13px 15px; } .header-actions { gap: 6px; } .session-label { display: none; } .admin-layout { grid-template-columns: 1fr; align-content: start; } .admin-nav { align-self: start; flex-direction: row; align-items: center; overflow-x: auto; padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); } .nav-heading, .nav-note { display: none; } .nav-item { flex: 0 0 auto; min-height: 34px; white-space: nowrap; } .nav-index { display: none; } .admin-main { padding: 15px 12px 35px; } .notice-band { align-items: flex-start; } .api-status { display: none; } .dashboard-grid { grid-template-columns: 1fr; } .section-heading { align-items: flex-start; flex-direction: column; gap: 12px; } .section-heading .button { align-self: stretch; } }
@media (max-width: 560px) { .login-panel { padding: 21px; } .login-footer { align-items: flex-start; flex-direction: column; } .brand-lockup h1 { font-size: 15px; } .brand-lockup .overline { display: none; } .header-actions .mode-chip { display: none; } .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .summary-item { padding: 12px; } .summary-item strong { font-size: 22px; } .toolbar { align-items: stretch; flex-direction: column; } .toolbar label, .toolbar .select-field { width: 100%; } .toolbar-count { margin-left: 0; padding-bottom: 0; } .form-two, .feature-checks, .detail-columns { grid-template-columns: 1fr; } .detail-hero { grid-template-columns: 1fr 1fr; } .detail-hero > div:first-child { grid-column: 1 / -1; } .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .locked-settings { align-items: flex-start; flex-direction: column; } }
