:root {
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif;
  color: #172033;
  background: #f3f6fa;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 980px; }
button, input, textarea { font: inherit; }
button { height: 36px; border: 1px solid #1769e0; border-radius: 6px; padding: 0 16px; color: #fff; background: #1769e0; cursor: pointer; }
button:hover { background: #0f58c3; }
button:disabled { opacity: .55; cursor: not-allowed; }
button.quiet { color: #d7e5ff; background: transparent; border-color: #52617a; }
.topbar { height: 64px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; color: #fff; background: #101b2d; }
.topbar div { display: flex; align-items: baseline; gap: 14px; }
.topbar strong { font-size: 20px; }
.topbar span { color: #9fb0c9; font-size: 13px; }
main { padding: 24px 28px 56px; }
.loginView { min-height: calc(100vh - 112px); display: grid; place-items: center; }
.loginPanel { width: 400px; padding: 28px; border: 1px solid #d6deea; border-radius: 8px; background: #fff; box-shadow: 0 12px 36px rgba(20, 35, 60, .12); }
.loginPanel h1 { margin: 0 0 22px; font-size: 22px; }
label { display: grid; gap: 7px; color: #526077; font-size: 13px; }
input, textarea { width: 100%; border: 1px solid #c9d3e1; border-radius: 5px; padding: 9px 10px; color: #172033; background: #fff; outline: none; }
input:focus, textarea:focus { border-color: #1769e0; box-shadow: 0 0 0 3px rgba(23, 105, 224, .1); }
.loginPanel label { margin-bottom: 16px; }
.loginPanel button { width: 100%; }
.captchaRow { display: grid; grid-template-columns: minmax(0, 1fr) 156px; align-items: stretch; gap: 10px; }
.loginPanel .captchaRefresh { width: 156px; height: 42px; padding: 0; overflow: hidden; border-color: #c9d3e1; background: #eef4ff; }
.loginPanel .captchaRefresh:hover { border-color: #1769e0; background: #eef4ff; }
.captchaRefresh img { display: block; width: 100%; height: 100%; object-fit: cover; }
.message { min-height: 20px; color: #b42318; }
.statsBand { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; border: 1px solid #d7dfeb; border-radius: 8px; overflow: hidden; background: #d7dfeb; }
.statsBand div { padding: 18px 20px; background: #fff; }
.statsBand span { display: block; margin-bottom: 7px; color: #66758c; font-size: 13px; }
.statsBand strong { font-size: 25px; }
.sectionBand { margin-top: 18px; border-top: 1px solid #d5deeb; border-bottom: 1px solid #d5deeb; background: #fff; }
.sectionHeading { min-height: 78px; padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.sectionHeading h2 { margin: 0 0 5px; font-size: 18px; }
.sectionHeading p { margin: 0; color: #6a7890; font-size: 13px; }
.inlineForm { display: flex; align-items: end; gap: 10px; }
.inlineForm label { width: 130px; }
.createdCode { margin: 0 18px 16px; padding: 12px 14px; border-left: 4px solid #20a36b; color: #145f42; background: #eefaf5; font-weight: 700; }
.tableWrap { overflow: auto; border-top: 1px solid #e1e7f0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 11px 12px; text-align: left; color: #56667e; background: #f6f8fb; white-space: nowrap; }
td { padding: 12px; border-top: 1px solid #e5eaf1; vertical-align: top; }
td input[type="number"] { width: 82px; }
.status { font-weight: 700; }
.status.active { color: #168758; }
.status.disabled { color: #b42318; }
.validity { min-width: 190px; display: grid; gap: 7px; }
.validity strong { color: #1f4f91; }
.validity label { grid-template-columns: auto 72px; align-items: center; gap: 8px; }
.validity input[type="number"] { width: 72px; }
.validity.permanent strong { color: #168758; }
.validity.permanent span { color: #66758c; font-size: 12px; }
.validity.expired strong { color: #b42318; }
.storeItem { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.storeItem button, .actions button { height: 30px; padding: 0 10px; color: #1f4f91; background: #fff; border-color: #b9cae3; }
.licenseCode { display: flex; align-items: center; gap: 8px; min-width: 190px; }
.licenseCode strong { white-space: nowrap; }
.licenseCode .codeReveal { width: 30px; height: 30px; padding: 0; color: #1f4f91; background: #fff; border-color: #b9cae3; line-height: 1; }
.licenseCode .codeReveal:hover { color: #fff; background: #1769e0; }
.actions button.danger { color: #b42318; border-color: #efb0aa; }
.actions button.danger:hover { color: #fff; background: #b42318; border-color: #b42318; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 230px; }
.versionForm { padding: 0 18px 20px; display: grid; grid-template-columns: 160px minmax(320px, 1fr) 2fr auto; gap: 12px; align-items: end; }
.notes textarea { resize: vertical; }
.empty { padding: 30px; text-align: center; color: #77859a; }
.diagnosticsDialog { width: min(1480px, calc(100vw - 64px)); max-height: calc(100vh - 64px); padding: 0; border: 1px solid #b9cae3; border-radius: 8px; color: #172033; background: #fff; box-shadow: 0 24px 70px rgba(16, 27, 45, .28); }
.diagnosticsDialog::backdrop { background: rgba(16, 27, 45, .46); }
.diagnosticsDialog > header { min-height: 72px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #d9e2ef; }
.diagnosticsDialog h2 { margin: 0 0 5px; font-size: 19px; }
.diagnosticsDialog header p { margin: 0; color: #66758c; font-size: 13px; }
.diagnosticsDialog .dialogClose { width: 36px; padding: 0; color: #526077; border-color: #c9d3e1; background: #fff; font-size: 25px; line-height: 1; }
.diagnosticsToolbar { min-height: 56px; padding: 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: #66758c; font-size: 13px; background: #f6f8fb; }
.diagnosticsTableWrap { max-height: calc(100vh - 230px); overflow: auto; }
.diagnosticsTableWrap th { position: sticky; top: 0; z-index: 1; }
.diagnosticsTableWrap td { white-space: nowrap; }
.diagnosticsTableWrap .diagnosticMessage { min-width: 280px; max-width: 460px; white-space: normal; }
.diagnosticStatus { font-weight: 700; }
.diagnosticStatus.success { color: #168758; }
.diagnosticStatus.warning { color: #a15c00; }
.diagnosticStatus.error { color: #b42318; }
.diagnosticsTableWrap code { font-family: Consolas, monospace; color: #1f4f91; }
@media (max-width: 1100px) {
  .versionForm { grid-template-columns: 1fr 2fr; }
  .statsBand { grid-template-columns: repeat(2, 1fr); }
}
