:root {
  --ink: #0b0d0f;
  --panel: #171a1d;
  --panel-raised: #1d2124;
  --line: #343b40;
  --line-soft: #262c30;
  --text: #e6eaed;
  --muted: #98a2aa;
  --quiet: #6f7a82;
  --cyan: #69bdc4;
  --cyan-soft: rgba(74, 145, 151, .16);
  --amber: #e1ad68;
  --amber-soft: rgba(165, 112, 48, .16);
  --good: #75bd8a;
  --danger: #df7771;
  --danger-soft: rgba(151, 61, 56, .16);
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--ink); }
body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px),
    #101315;
  background-size: 26px 26px;
  color: var(--text);
  font-family: "Segoe UI Variable", "Microsoft YaHei UI", "Segoe UI", sans-serif;
  font-size: 14px;
}

a { color: inherit; }
button, input { font: inherit; }
button, .button { -webkit-tap-highlight-color: transparent; }

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 max(18px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid #2b3135;
  background: rgba(18, 21, 23, .96);
  backdrop-filter: blur(12px);
}

.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font: 700 15px "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif; letter-spacing: .03em; }
.brand small { color: var(--quiet); font: 9px Consolas, monospace; letter-spacing: .18em; text-transform: uppercase; }
.radar-mark { position: relative; width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid #46666a; border-radius: 4px; background: #111719; overflow: hidden; }
.radar-mark::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(105, 189, 196, .28); border-radius: 50%; }
.radar-mark i { position: absolute; display: block; background: var(--cyan); }
.radar-mark i:nth-child(1) { width: 15px; height: 1px; }
.radar-mark i:nth-child(2) { width: 1px; height: 15px; }
.radar-mark i:nth-child(3) { width: 9px; height: 1px; transform: rotate(-35deg) translate(3px, -2px); transform-origin: right center; }

.shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 34px 0 70px; }
.shell-narrow { width: min(560px, calc(100% - 32px)); padding-top: min(11vh, 90px); }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 18px; }
h1, h2 { margin: 0; font-family: "Bahnschrift SemiCondensed", "Arial Narrow", "Microsoft YaHei UI", sans-serif; }
h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 650; letter-spacing: -.025em; }
h2 { font-size: 17px; font-weight: 650; }
.eyebrow { margin: 0 0 7px; color: var(--cyan); font: 10px Consolas, monospace; letter-spacing: .14em; }
.muted { margin: 0; color: var(--muted); line-height: 1.6; }

.panel {
  margin-top: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(24, 28, 31, .96);
  box-shadow: 0 1px 0 rgba(255,255,255,.02) inset;
}
.service-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; align-items: center; border-left: 3px solid var(--cyan); }
.service-panel h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.service-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(117,189,138,.12); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-heading > span { color: var(--quiet); font: 11px Consolas, monospace; }
.section-heading .eyebrow { margin-bottom: 4px; }

.button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid #41494f;
  border-radius: 5px;
  background: #22272b;
  color: #dce2e6;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.button:hover { border-color: #667078; background: #292f34; }
.button:active { transform: translateY(1px); }
.button:focus-visible, input:focus-visible, .text-link:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.button-primary { border-color: #5b9da3; background: #315e63; color: #f5ffff; font-weight: 650; }
.button-primary:hover { border-color: #73c6cd; background: #397077; }
.button-danger { border-color: #704541; background: #312221; color: #efaaa6; }
.button-danger:hover { border-color: #a55c57; background: #432826; }
.button-quiet { min-height: 32px; padding: 5px 10px; background: transparent; color: var(--muted); }
.action-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.action-grid form { margin: 0; }

.form-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(170px, .6fr) auto; gap: 10px; align-items: end; }
.form-stack { display: grid; gap: 13px; margin-top: 22px; }
label { display: grid; gap: 7px; color: #b9c1c7; font-size: 11px; font-weight: 650; }
input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #3a4248;
  border-radius: 5px;
  background: #101315;
  color: var(--text);
}
input:hover { border-color: #4d575e; }
.date-control { gap: 6px; }
.date-control small {
  color: var(--quiet);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.4;
}
.date-input {
  color-scheme: dark;
  cursor: pointer;
  font-family: Consolas, "Cascadia Mono", monospace;
  letter-spacing: .025em;
}
.date-input::-webkit-calendar-picker-indicator {
  width: 20px;
  height: 20px;
  padding: 5px;
  border: 1px solid #46666a;
  border-radius: 4px;
  background-color: var(--cyan-soft);
  cursor: pointer;
  filter: invert(78%) sepia(18%) saturate(721%) hue-rotate(135deg) brightness(91%);
  opacity: 1;
}
.date-input::-webkit-calendar-picker-indicator:hover {
  background-color: rgba(74, 145, 151, .3);
}

.table-panel { padding: 0; overflow: hidden; }
.table-panel .section-heading { padding: 18px 20px 3px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 9px 13px; border-block: 1px solid var(--line-soft); background: #141719; color: var(--quiet); font: 9px Consolas, monospace; letter-spacing: .09em; text-align: left; text-transform: uppercase; }
td { position: relative; padding: 13px; border-bottom: 1px solid var(--line-soft); color: #cbd2d7; }
tbody tr:last-child td { border-bottom: 0; }
.license-row { --row-state: var(--quiet); }
.license-row.status-active { --row-state: var(--good); }
.license-row.status-expired { --row-state: var(--amber); }
.license-row.status-disabled { --row-state: var(--danger); }
.license-row td:first-child { padding-left: 20px; }
.license-row td:first-child::before { content: ""; position: absolute; left: 7px; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--row-state); }
.license-row:hover { background: rgba(255,255,255,.018); }
code, .issued-code { font-family: Consolas, "Cascadia Mono", monospace; }
td code { color: #b6c0c7; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active { color: var(--good); }
.status-expired { color: var(--amber); }
.status-disabled { color: var(--danger); }
.operation-links { white-space: nowrap; }
.text-link { color: var(--cyan); text-decoration: none; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-danger { margin-left: 10px; color: var(--danger); }
.back-link { display: inline-flex; margin-bottom: 18px; }
.empty { padding: 30px; color: var(--quiet); text-align: center; }

.alert { margin: 12px 0 0; padding: 10px 12px; border-left: 3px solid var(--danger); background: var(--danger-soft); color: #e9b8b5; line-height: 1.5; }
.alert-success { border-color: var(--good); background: rgba(78,137,94,.15); color: #b9dfc4; }
.alert-warning { border-color: var(--amber); background: var(--amber-soft); color: #e8c99d; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; padding: 1px; background: var(--line-soft); }
.detail-grid > div { min-height: 88px; display: grid; align-content: center; gap: 7px; padding: 15px; background: var(--panel); }
.detail-grid span { color: var(--quiet); font-size: 10px; }
.detail-grid strong { overflow-wrap: anywhere; font-size: 13px; }
.extend-form { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line-soft); }

.login-panel { position: relative; overflow: hidden; padding: 30px; box-shadow: var(--shadow); }
.login-scan { position: absolute; top: 0; right: 0; width: 120px; height: 100%; overflow: hidden; opacity: .32; pointer-events: none; }
.login-scan::before, .login-scan::after { content: ""; position: absolute; border: 1px solid var(--cyan); border-radius: 50%; }
.login-scan::before { width: 170px; height: 170px; top: -55px; right: -75px; }
.login-scan::after { width: 92px; height: 92px; top: -16px; right: -36px; }
.login-scan span { position: absolute; top: 58px; right: 0; width: 95px; height: 1px; background: var(--cyan); transform-origin: right center; }
.login-scan span:nth-child(2) { transform: rotate(34deg); }
.login-scan span:nth-child(3) { transform: rotate(68deg); }
.login-panel h1 { max-width: 390px; margin-bottom: 8px; font-size: 34px; }
.login-panel .form-stack { position: relative; }
.login-panel .button { width: 100%; margin-top: 3px; }
.issued-panel h1, .confirm-panel h1 { margin-bottom: 9px; }
.issued-code { display: block; margin: 16px 0; padding: 18px; border: 1px dashed #927044; border-radius: 5px; background: #12110f; color: #ffd697; font-size: clamp(17px, 5vw, 25px); letter-spacing: .055em; text-align: center; overflow-wrap: anywhere; user-select: all; }
.confirm-panel { border-color: #68413e; }

@media (max-width: 780px) {
  .shell { width: min(100% - 22px, 1180px); padding-top: 22px; }
  .topbar { padding-inline: 12px; }
  .service-panel, .form-row { grid-template-columns: 1fr; }
  .service-panel .action-grid { justify-content: flex-start; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  th, td { padding-inline: 10px; }
}

@media (max-width: 520px) {
  .page-heading { align-items: flex-start; flex-direction: column; }
  .panel { padding: 16px; }
  .table-panel { padding: 0; }
  .detail-grid { grid-template-columns: 1fr; }
  .brand small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
