[hidden] { display: none !important; }
html.i18n-pending body,
html.boot-pending body { visibility: hidden; }
:root {
  color-scheme: dark;
  --bg: #0e141b;
  --card: #171f2a;
  --ink: #e6edf5;
  --muted: #8a9bb0;
  --line: #2a3848;
  --brand: #3d7eb8;
  --brand-2: #4d90cc;
  --ok: #3dce7a;
  --bad: #f07167;
  --warn: #e6b450;
  --fill: #121a24;
  --fill-2: #1e2a38;
  --on-brand: #fff;
  --shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; scrollbar-color: #3a4d63 var(--fill); }
html, body { margin: 0; min-height: 100%; font: 14px/1.5 "Segoe UI", "Microsoft YaHei", sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: var(--ink); }
button { background: var(--brand); color: var(--on-brand); border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
button:hover:not(:disabled) { background: var(--brand-2); }
button.ghost { background: var(--fill); color: var(--ink); border: 1px solid var(--line); }
button.ghost:hover:not(:disabled) { background: var(--fill-2); }
.muted { color: var(--muted); }
.error { color: var(--bad); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; }
.login-card a { color: var(--brand-2); text-decoration: none; }
.login-card a:hover { text-decoration: underline; }
button.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--brand-2);
  cursor: pointer;
  font: inherit;
}
button.linkish:hover:not(:disabled) { text-decoration: underline; background: none; }
.foot-contact { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }

.login-split {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  height: 100vh;
  background:
    radial-gradient(900px 420px at 12% 0%, rgba(61, 126, 184, .22), transparent 60%),
    var(--bg);
}
.login-bg {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: min(72vw, 1040px);
  height: auto;
  max-height: 74vh;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
  opacity: .38;
  -webkit-mask-image: radial-gradient(ellipse 68% 72% at 50% 50%, #000 8%, rgba(0, 0, 0, .55) 48%, transparent 78%);
  mask-image: radial-gradient(ellipse 68% 72% at 50% 50%, #000 8%, rgba(0, 0, 0, .55) 48%, transparent 78%);
}
.login-brand {
  position: absolute;
  z-index: 1;
  top: 28px;
  left: 36px;
  right: 36px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.lang-switch {
  color: var(--ink);
  background: var(--fill);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font: inherit;
  cursor: pointer;
}
.login-brand a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
}
.login-brand a:hover { text-decoration: none; color: var(--ink); }
.login-brand img { width: 32px; height: 32px; border-radius: 8px; }
.login-brand .kicker {
  margin: 8px 0 0;
  font-size: 13px;
  letter-spacing: .08em;
  color: #c5d6ea;
}
.login-foot {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  padding: 0 16px;
}
.login-foot a { color: var(--muted); }
.login-foot a:hover { color: var(--ink); }
.login-panel {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 16vw;
  transform: translateY(-50%);
  padding: 0;
}
.login-panel .login-card {
  width: 360px;
}
.login-panel .login-card > button[type="submit"] { width: 100%; padding: 10px 14px; }
@media (max-width: 860px) {
  .login-split {
    height: auto;
    min-height: 100vh;
    padding: 88px 0 56px;
  }
  .login-bg {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    display: block;
    width: 100%;
    max-height: 36vh;
    margin: 0 auto;
    -webkit-mask-image: linear-gradient(180deg, #000 0 55%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0 55%, transparent 100%);
  }
  .login-brand { top: 16px; left: 20px; right: 20px; }
  .login-brand a { font-size: 16px; }
  .login-panel {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    margin: 12px auto 0;
    padding: 0 20px;
  }
  .login-foot { bottom: 12px; }
}

.login-card { width: 360px; background: var(--card); padding: 28px; border-radius: 12px; box-shadow: var(--shadow); display: grid; gap: 12px; border: 1px solid var(--line); }
.login-card h1 { margin: 0; font-size: 22px; }
.login-card h2 { margin: 0; font-size: 16px; font-weight: 600; }
.account-card { width: min(400px, 92vw); }
.account-section { display: grid; gap: 12px; margin: 0; }
.account-sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.captcha-row { display: flex; gap: 8px; align-items: stretch; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-row button {
  padding: 0; background: var(--fill); color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; line-height: 0;
}
.captcha-row button:hover { background: var(--fill-2); }
.captcha-row img { display: block; width: 140px; height: 44px; border-radius: 6px; }
.login-card label, .grid label, .scheme-tools label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.login-card input, .login-card select, .login-card textarea,
.grid input, .scheme-tools input, .scheme-tools textarea,
table input, table select {
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--fill); color: var(--ink);
}
.login-card select { width: 100%; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
select option { background: var(--card); color: var(--ink); }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--fill) inset;
  transition: background-color 9999s ease-out;
}

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: #152536; color: var(--on-brand); border-bottom: 1px solid var(--line); }
.topbar-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
a.topbar-brand { color: var(--on-brand); text-decoration: none; border-radius: 8px; }
a.topbar-brand:hover { text-decoration: none; opacity: .85; }
.topbar-brand img { width: 28px; height: 28px; border-radius: 6px; }
.login-logo { width: 48px; height: 48px; border-radius: 12px; }
.topbar .muted { color: #9bb4c9; margin-left: 10px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topbar-actions .lang-switch { background: transparent; color: var(--on-brand); border-color: rgba(255, 255, 255, .28); }
.account-label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px;
  font-size: 13px; color: var(--on-brand); white-space: nowrap;
}
.account-label::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok);
}
.topbar button.ghost,
.topbar a.ghost {
  background: transparent; color: var(--on-brand); border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 6px; padding: 8px 14px; text-decoration: none; display: inline-block;
}
.topbar button.ghost:hover,
.topbar a.ghost:hover { background: rgba(255, 255, 255, .1); }
.trial-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
  background: #3d2e12;
  color: var(--warn);
  border-bottom: 1px solid #6b5420;
  font-size: 13px;
}
.trial-banner p { margin: 0; flex: 1; }
.trial-banner-ops { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.trial-banner .trial-apply {
  font-size: 13px;
  padding: 4px 10px;
  border: 1px solid #6b5420;
  border-radius: 6px;
  background: transparent;
  color: var(--warn);
  cursor: pointer;
}
.trial-banner .trial-apply:hover { background: rgba(230, 180, 80, .16); }
.trial-banner-ops > button:last-child {
  flex-shrink: 0;
  background: transparent;
  color: var(--warn);
  border: 0;
  font-size: 20px;
  line-height: 1;
  padding: 0 6px;
}
.trial-banner-ops > button:last-child:hover { background: rgba(230, 180, 80, .16); }
.trial-nag-card { width: 400px; gap: 8px; }
.trial-nag-card h1 { font-size: 18px; }
.trial-nag-card .trial-nag-text { margin: 0; line-height: 1.7; }
.trial-nag-card #trial-nag-hint { margin: 0; font-size: 13px; line-height: 1.6; }
.trial-nag-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.trial-nag-foot button { flex: none; padding: 8px 18px; }
.trial-nag-ops { display: flex; gap: 8px; align-items: center; }
.trial-nag-foot label.trial-nag-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.trial-nag-check input { margin: 0; accent-color: var(--brand); cursor: pointer; }
.layout { display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 52px); }
aside { background: var(--card); border-right: 1px solid var(--line); padding: 16px; }
aside h2 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
aside h2:first-child { margin-top: 0; }
#module-nav { display: grid; gap: 6px; }
#module-nav .nav-group { display: grid; gap: 6px; }
#module-nav .nav-group h3 {
  margin: 10px 0 0; font-size: 11px; letter-spacing: .06em; color: var(--muted); font-weight: 600;
}
#module-nav .nav-group:first-child h3 { margin-top: 0; }
#module-nav button { text-align: left; background: var(--fill-2); color: var(--ink); }
#module-nav button:hover { background: #263445; }
#module-nav button.active { background: var(--brand); color: var(--on-brand); }
#module-nav button.locked { color: var(--muted); opacity: .75; }
#module-nav button.locked:hover { background: var(--fill-2); }
#license-overlay { position: fixed; inset: 0; z-index: 20; background: rgba(8, 12, 18, .72); }
#password-overlay { position: fixed; inset: 0; z-index: 20; background: rgba(8, 12, 18, .72); }
#trial-nag-overlay { position: fixed; inset: 0; z-index: 21; background: rgba(8, 12, 18, .72); }
#support-overlay {
  position: fixed;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 12, 18, .72);
}
.support-card {
  width: min(440px, 92vw);
  max-height: 90vh;
  overflow: auto;
}
.support-card h1 { font-size: 18px; }
.support-card label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.support-card input,
.support-card select,
.support-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--fill);
  color: var(--ink);
  font: inherit;
}
.support-actions { display: flex; gap: 10px; }
.support-actions button { flex: 1; }
.contact-block p { margin: 0 0 6px; }
.admin-subhead { margin: 16px 0 4px; font-size: 14px; }
.admin-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}
.admin-subtabs button {
  background: var(--fill);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 14px;
}
.admin-subtabs button:hover:not(:disabled) { background: var(--fill-2); }
.admin-subtabs button.active {
  background: var(--brand);
  color: var(--on-brand);
  border-color: transparent;
}
.settings-pane { display: grid; gap: 12px; }
.settings-pane[hidden] { display: none !important; }
.admin-support-table td { vertical-align: top; }
#license-form textarea { width: 100%; min-height: 88px; resize: vertical; }
.scheme-tools { display: grid; gap: 8px; }
.row { display: flex; gap: 8px; }
.row button { flex: 1; }
.scheme-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; max-height: 36vh; overflow: auto; }
.scheme-list li { border: 1px solid var(--line); border-radius: 6px; padding: 8px; display: flex; justify-content: space-between; gap: 8px; background: var(--fill); }
.scheme-list button.link { background: none; color: var(--brand); padding: 0; }
.scheme-list button.danger { background: none; color: var(--bad); padding: 0; }

main { padding: 20px 24px 48px; }
section { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
section h3 { margin: 0 0 12px; font-size: 16px; }
section h4 { margin: 12px 0 8px; font-size: 13px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 12px; }
table.plain { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.plain th, table.plain td { border: 1px solid var(--line); padding: 6px; text-align: left; }
table.plain th { background: var(--fill-2); font-weight: 600; font-size: 12px; }
.actions { display: flex; gap: 10px; margin: 8px 0 20px; }
.summary { background: var(--fill-2); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.summary p { margin: 4px 0; }
.result table { font-variant-numeric: tabular-nums; }
.ok { color: var(--ok); font-weight: 600; }
.bad { color: var(--bad); font-weight: 600; }

@media print {
  :root {
    color-scheme: light;
    --bg: #fff;
    --card: #fff;
    --ink: #1c2a3a;
    --muted: #66768a;
    --line: #d5dee8;
    --fill: #fff;
    --fill-2: #f4f7fb;
  }
  aside, .topbar, .trial-banner, .actions, #calc-form { display: none !important; }
  .layout { display: block; }
  section { break-inside: avoid; }
}

.admin-page { max-width: 1280px; margin: 0 auto; padding: 20px 24px 48px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.admin-tabs button {
  background: var(--fill-2); color: var(--ink);
}
.admin-tabs button.active { background: var(--brand); color: var(--on-brand); }
.admin-panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.admin-form { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: end; margin: 12px 0 16px; }
.admin-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); min-width: 180px; }
.admin-form input, .admin-form select, .admin-form textarea {
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: var(--fill); color: var(--ink);
}
.admin-form-stack { display: grid; }
.admin-form-stack label { min-width: 0; }
.admin-table { margin-top: 8px; }
.admin-table input {
  width: 200px; max-width: 28vw; padding: 6px 8px;
  background: var(--fill); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px;
}
.admin-ver-table thead tr:first-child th { text-align: center; font-size: 14px; }
.admin-ver-table tbody td:first-child,
.admin-ver-table tbody td:nth-child(2),
.admin-ver-table tbody td:nth-child(4) { white-space: nowrap; }
#license-rows td:first-child { white-space: nowrap; }
.admin-ver-table thead tr:first-child th:first-child { text-align: left; font-size: 12px; }
.admin-ver-table thead tr:first-child th:nth-child(3),
.admin-ver-table thead tr:last-child th:nth-child(3),
.admin-ver-table tbody td:nth-child(4) { border-left-width: 2px; }
.admin-notes { white-space: pre-wrap; max-width: 36em; font-size: 13px; }
.admin-ops { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-code {
  background: var(--fill); border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; white-space: pre-wrap; word-break: break-all;
}
.admin-upload-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-preview { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--fill); }
.admin-preview-wide { width: 100%; height: 96px; }
.ghost-file {
  display: inline-flex; align-items: center; margin-top: 8px; cursor: pointer;
  background: var(--fill); color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px 14px;
}
.ghost-file input { display: none; }
@media (max-width: 720px) {
  .admin-upload-row { grid-template-columns: 1fr; }
}