:root {
  color-scheme: light;
  --canvas: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --ink: #202723;
  --muted: #6f7b72;
  --faint: #9aa59d;
  --line: #dfe5df;
  --accent: #e26754;
  --accent-dark: #ad4538;
  --accent-soft: #fff0eb;
  --success: #237c58;
  --warning: #a36b16;
  --danger: #b54848;
  --shadow: 0 18px 44px rgba(29, 40, 32, .07), 0 2px 8px rgba(29, 40, 32, .04);
  font-family: "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
.app-shell { min-height: 100vh; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 42px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent-dark); font-size: 18px; font-weight: 750; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.01em; }
.brand small { margin-top: 2px; color: var(--faint); font-size: 11px; }
.topbar-actions, .auth-controls, .result-actions, .table-tools, .pagination { display: flex; align-items: center; gap: 10px; }
.connection-state { color: var(--muted); font-size: 12px; }
.connection-state::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--faint); vertical-align: 1px; }
.connection-ok { color: var(--success); }.connection-ok::before { background: var(--success); }.connection-error { color: var(--danger); }.connection-error::before { background: var(--danger); }
.main-content { width: min(1420px, calc(100% - 64px)); margin: 0 auto; padding: 44px 0 70px; }
.intro-row { display: flex; align-items: end; justify-content: space-between; margin-bottom: 27px; }
.eyebrow, .section-kicker { margin: 0 0 9px; color: var(--accent-dark); font-size: 10px; font-weight: 750; letter-spacing: .11em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(30px, 4vw, 42px); letter-spacing: -.04em; line-height: 1.08; }
h2 { margin-bottom: 0; font-size: 19px; letter-spacing: -.025em; }
h3 { margin: 3px 0 0; font-size: 17px; }
.intro-copy { margin: 0; color: var(--muted); font-size: 14px; }
.environment-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--accent); }
.auth-strip { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.auth-copy { min-width: 240px; }.auth-copy p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }.auth-controls { flex: 1; justify-content: end; }.compact-field { min-width: 245px; }.key-field { min-width: 230px; }
.field { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }.field em { color: var(--faint); font-size: 11px; font-style: normal; }
input, select { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7px; outline: none; background: var(--surface-soft); color: var(--ink); transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
input:focus, select:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px rgba(226,103,84,.13); }
.remember-key { display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--faint); font-size: 11px; cursor: pointer; }.remember-key input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }
.button { min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 7px; white-space: nowrap; font-size: 12px; font-weight: 650; transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease; }.button:hover:not(:disabled) { transform: translateY(-1px); }.button:active:not(:disabled) { transform: translateY(0); }
.button:focus-visible { outline: 3px solid rgba(226,103,84,.3); outline-offset: 2px; }
.button-primary { background: var(--accent); color: #fff; box-shadow: 0 5px 14px rgba(226,103,84,.2); }.button-primary:hover:not(:disabled) { background: var(--accent-dark); }
.button-quiet { border-color: var(--line); background: var(--surface); color: var(--muted); }.button-quiet:hover:not(:disabled) { border-color: #c8d2c9; background: var(--surface-soft); color: var(--ink); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 15px 0; }
.metric-card { min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; padding: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }.metric-card-accent { border-color: #f2c2b9; background: var(--accent-soft); }.metric-label { color: var(--muted); font-size: 12px; }.metric-card strong { margin: 3px 0; font-size: 34px; letter-spacing: -.05em; line-height: 1; }.metric-note { color: var(--faint); font-size: 11px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 15px; margin-bottom: 15px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }.create-panel, .service-panel, .license-panel { padding: 23px 24px; }.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }.panel-index { color: var(--faint); font: 600 12px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }.create-form { display: grid; grid-template-columns: 150px 120px minmax(160px, 1fr) auto; align-items: end; gap: 11px; }.create-button { height: 40px; }
.generated-result { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }.result-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; }.code-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 13px; }.code-item { padding: 11px 12px; border: 1px solid #f0c4bb; border-radius: 7px; background: var(--accent-soft); color: var(--accent-dark); font: 650 12px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .03em; user-select: all; }.result-warning { margin: 12px 0 0; color: var(--warning); font-size: 11px; }
.state-label { padding: 5px 8px; border-radius: 5px; font-size: 11px; }.state-muted { background: var(--surface-soft); color: var(--muted); }.state-ok { background: #eaf7ef; color: var(--success); }.state-error { background: #fff0ef; color: var(--danger); }
.service-list { margin: 0; }.service-list div { display: flex; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 12px; }.service-list div:last-child { border-bottom: 0; }.service-list dt { color: var(--muted); }.service-list dd { max-width: 230px; margin: 0; overflow: hidden; color: var(--ink); font: 600 11px ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }.service-footnote { margin-top: 9px; color: var(--faint); font-size: 11px; }
.table-heading { align-items: end; }.panel-subcopy { margin: 7px 0 0; color: var(--muted); font-size: 11px; }.table-tools { justify-content: end; }.filter-field { min-width: 130px; }.filter-field input, .filter-field select { height: 36px; padding: 0 10px; font-size: 12px; }.table-wrap { overflow-x: auto; margin: 0 -24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }table { width: 100%; min-width: 1060px; border-collapse: collapse; text-align: left; }th, td { padding: 13px 14px; border-bottom: 1px solid #edf0ed; font-size: 12px; }th { color: var(--faint); font-size: 10px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }td { color: var(--muted); }tbody tr:last-child td { border-bottom: 0; }tbody tr:hover { background: var(--surface-soft); }.license-code { display: inline-block; max-width: 360px; overflow: hidden; color: var(--ink); font: 650 11px ui-monospace, SFMono-Regular, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; user-select: all; }.license-code-missing { color: var(--faint); font-family: inherit; font-weight: 500; user-select: none; }.status-badge { display: inline-flex; padding: 5px 8px; border-radius: 5px; font-size: 11px; }.status-unused { background: #edf7f1; color: var(--success); }.status-active { background: #fff3e3; color: var(--warning); }.status-expired, .status-revoked { background: #f3f4f3; color: var(--muted); }.actions-column { width: 220px; }.row-actions { display: flex; gap: 6px; }.row-actions .button { min-height: 30px; padding: 0 9px; font-size: 11px; }.button-danger { border-color: #e7b4ad; background: #fff5f2; color: var(--danger); }.button-danger:hover:not(:disabled) { border-color: var(--danger); background: #ffece8; color: #8e3535; }.empty-state { padding: 35px 14px; color: var(--faint); text-align: center; }.table-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 17px; color: var(--muted); font-size: 11px; }.pagination span { min-width: 54px; text-align: center; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 10; max-width: min(390px, calc(100vw - 48px)); padding: 12px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--ink); color: #fff; box-shadow: var(--shadow); font-size: 12px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .18s ease, transform .18s ease; }.toast.show { opacity: 1; transform: translateY(0); }.toast.error { background: var(--danger); border-color: var(--danger); }.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.admin-login-dialog { width: min(420px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: 0 28px 80px rgba(29,40,32,.2); }.admin-login-dialog::backdrop { background: rgba(32,39,35,.46); backdrop-filter: blur(3px); }.admin-login-form { display: grid; gap: 14px; padding: 30px; }.login-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 750; }.login-copy { margin: -5px 0 5px; color: var(--muted); font-size: 12px; line-height: 1.55; }.login-error { margin: -2px 0 0; padding: 9px 10px; border: 1px solid #efc3bc; border-radius: 6px; background: #fff5f2; color: var(--danger); font-size: 12px; }.login-submit { width: 100%; margin-top: 3px; }.admin-login-dialog .field { gap: 7px; }.admin-login-dialog .field input { background: var(--surface-soft); }.row-actions { flex-wrap: wrap; }
@media (max-width: 980px) { .topbar { padding: 0 22px; }.main-content { width: min(100% - 32px, 760px); padding-top: 30px; }.auth-strip, .intro-row { align-items: start; flex-direction: column; }.auth-controls { width: 100%; justify-content: stretch; }.compact-field, .key-field { flex: 1; min-width: 0; }.metric-grid { grid-template-columns: repeat(2, 1fr); }.content-grid { grid-template-columns: 1fr; }.create-form { grid-template-columns: 1fr 1fr; }.create-form .field:nth-child(3) { grid-column: span 2; }.create-button { width: 100%; } }
@media (max-width: 620px) { .topbar { height: 68px; }.topbar-actions .connection-state { display: none; }.main-content { width: calc(100% - 24px); padding: 25px 0 45px; }.intro-row { margin-bottom: 20px; }.environment-chip { align-self: stretch; justify-content: center; }.auth-strip, .create-panel, .service-panel, .license-panel { padding: 18px 16px; }.auth-controls { align-items: stretch; flex-direction: column; }.compact-field, .key-field { width: 100%; }.metric-grid { gap: 8px; }.metric-card { min-height: 110px; padding: 14px; }.metric-card strong { font-size: 28px; }.create-form { grid-template-columns: 1fr; }.create-form .field:nth-child(3) { grid-column: auto; }.table-heading { align-items: start; flex-direction: column; }.table-tools { width: 100%; align-items: stretch; flex-wrap: wrap; justify-content: start; }.filter-field { flex: 1; min-width: 120px; }.table-footer { align-items: start; flex-direction: column; gap: 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
