:root {
  --bg: #06101c;
  --bg-deep: #030a12;
  --surface: #0a1928;
  --surface-raised: #0d2133;
  --surface-soft: #102a3d;
  --line: rgba(120, 181, 207, 0.18);
  --line-strong: rgba(89, 217, 223, 0.38);
  --text: #eef9fb;
  --text-muted: #8ca8b7;
  --cyan: #4ee1d3;
  --cyan-strong: #18bfb6;
  --blue: #3d8df5;
  --warning: #ffd166;
  --danger: #ff7188;
  --success: #67e39e;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --font:
    "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", "Segoe UI Variable",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg-deep);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 82% 0%, rgba(24, 191, 182, 0.1), transparent 28rem),
    linear-gradient(145deg, #071522 0%, #030a12 55%, #061522 100%);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

[hidden] {
  display: none !important;
}

.page-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(95, 174, 198, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(95, 174, 198, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.center-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.startup-card {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
}

.startup-card p {
  margin: 0;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(78, 225, 211, 0.18);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.login-shell {
  width: min(100%, 460px);
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(150deg, rgba(18, 45, 65, 0.96), rgba(5, 15, 25, 0.98)),
    var(--surface);
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-lockup--large {
  align-items: flex-start;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.brand-lockup h1 {
  overflow: hidden;
  margin: 1px 0 0;
  font-size: 18px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-lockup--large h1 {
  margin-top: 5px;
  font-size: 27px;
  white-space: normal;
}

.brand-subtitle {
  margin: 8px 0 0;
  color: var(--text-muted);
}

.eyebrow,
.section-index {
  margin: 0;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.panda-mark {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(78, 225, 211, 0.45);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(78, 225, 211, 0.17), rgba(61, 141, 245, 0.1));
  box-shadow: inset 0 0 20px rgba(78, 225, 211, 0.08);
}

.panda-mark::before,
.panda-mark::after {
  position: absolute;
  top: 10px;
  width: 12px;
  height: 13px;
  border-radius: 7px 7px 5px 5px;
  background: var(--text);
  content: "";
}

.panda-mark::before {
  left: 9px;
  transform: rotate(-13deg);
}

.panda-mark::after {
  right: 9px;
  transform: rotate(13deg);
}

.panda-mark i {
  position: absolute;
  top: 21px;
  left: 14px;
  width: 18px;
  height: 14px;
  border: 2px solid var(--text);
  border-top: 0;
  border-radius: 4px 4px 11px 11px;
}

.panda-mark b {
  position: absolute;
  top: 24px;
  left: 20px;
  width: 6px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
}

.login-form {
  margin-top: 28px;
}

.login-footnote {
  margin: 18px 0 0;
  color: #708d9c;
  font-size: 12px;
  text-align: center;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 13, 22, 0.88);
  backdrop-filter: blur(18px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.connection-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(103, 227, 158, 0.08);
}

.workspace {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 34px clamp(20px, 4vw, 64px) 64px;
}

.overview-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 42px;
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.overview-copy h2 {
  margin: 8px 0 7px;
  font-size: clamp(25px, 3vw, 40px);
  line-height: 1.15;
}

.overview-copy > p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--text-muted);
}

.metrics {
  display: flex;
  gap: 34px;
}

.metrics article {
  min-width: 92px;
}

.metrics span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
}

.metrics strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
}

.management-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}

.tool-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(150deg, rgba(13, 33, 51, 0.95), rgba(6, 19, 31, 0.98));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
}

.issue-panel {
  position: sticky;
  top: 98px;
  padding: 24px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading h2 {
  margin: 5px 0 0;
  font-size: 19px;
}

.panel-signal {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 18px var(--cyan);
}

.issue-form {
  display: grid;
  gap: 17px;
  margin-top: 24px;
}

.field,
.field-group {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.field > span,
.field-group legend {
  color: #b6cbd5;
  font-size: 12px;
  font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="datetime-local"],
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  color: var(--text);
  background: rgba(3, 13, 22, 0.78);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="datetime-local"] {
  padding: 9px 12px;
}

select {
  padding: 8px 34px 8px 12px;
}

input::placeholder {
  color: #547080;
}

input:focus,
select:focus,
button:focus-visible {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(78, 225, 211, 0.11);
}

.field input:invalid:not(:placeholder-shown) {
  border-color: rgba(255, 113, 136, 0.6);
}

.field-group {
  grid-template-columns: 1fr 1fr;
}

.field-group legend {
  grid-column: 1 / -1;
  margin-bottom: 8px;
}

.check-tile {
  position: relative;
  display: block;
}

.check-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-tile > span {
  display: grid;
  gap: 2px;
  min-height: 68px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(3, 13, 22, 0.55);
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.check-tile strong {
  font-size: 12px;
}

.check-tile small {
  overflow: hidden;
  color: #668493;
  font-size: 9px;
  text-overflow: ellipsis;
}

.check-tile input:checked + span {
  border-color: rgba(78, 225, 211, 0.62);
  background: rgba(32, 147, 148, 0.13);
}

.check-tile input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(78, 225, 211, 0.11);
}

.check-tile:hover > span {
  transform: translateY(-1px);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
}

.switch-line input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-control {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #06111d;
  transition: 0.16s ease;
}

.switch-control::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #78909c;
  content: "";
  transition: 0.16s ease;
}

.switch-line input:checked + .switch-control {
  border-color: var(--cyan-strong);
  background: rgba(78, 225, 211, 0.2);
}

.switch-line input:checked + .switch-control::after {
  left: 21px;
  background: var(--cyan);
}

.switch-line input:focus-visible + .switch-control {
  box-shadow: 0 0 0 3px rgba(78, 225, 211, 0.11);
}

.switch-line > span:last-child {
  display: grid;
}

.switch-line strong {
  font-size: 12px;
}

.switch-line small {
  color: var(--text-muted);
  font-size: 10px;
}

.notice-line,
.sensitive-notice {
  display: flex;
  gap: 10px;
  border: 1px solid rgba(255, 209, 102, 0.19);
  border-radius: 10px;
  color: #c8b783;
  background: rgba(255, 209, 102, 0.055);
}

.notice-line {
  align-items: flex-start;
  padding: 10px 11px;
}

.notice-line > span {
  display: grid;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid rgba(255, 209, 102, 0.38);
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.notice-line p {
  margin: 0;
  font-size: 11px;
}

.button {
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  font-weight: 700;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.button:not(:disabled):hover {
  transform: translateY(-1px);
}

.button--wide {
  width: 100%;
}

.button--primary {
  border-color: rgba(78, 225, 211, 0.68);
  color: #021716;
  background: linear-gradient(135deg, #73eadf, #37c9c0);
  box-shadow: 0 8px 22px rgba(55, 201, 192, 0.13);
}

.button--primary:not(:disabled):hover {
  background: linear-gradient(135deg, #89f3e9, #4edbd0);
}

.button--ghost {
  border-color: var(--line);
  background: rgba(14, 37, 54, 0.62);
}

.button--ghost:not(:disabled):hover {
  border-color: var(--line-strong);
  background: rgba(18, 52, 70, 0.8);
}

.button--quiet {
  color: var(--text-muted);
}

.button--quiet:not(:disabled):hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.button--danger {
  border-color: rgba(255, 113, 136, 0.3);
  color: #ff9aac;
  background: rgba(255, 113, 136, 0.07);
}

.button--small {
  min-height: 31px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 11px;
}

.form-message {
  margin: 0;
  font-size: 12px;
}

.form-message--error {
  color: #ff9aac;
}

.license-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 22px;
}

.issued-result,
.list-section {
  padding: 24px;
}

.count-chip,
.security-chip {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(3, 13, 22, 0.45);
  font-size: 10px;
}

.security-chip {
  color: var(--success);
}

.sensitive-notice {
  align-items: center;
  margin-top: 18px;
  padding: 11px 13px;
}

.sensitive-notice strong {
  flex: 0 0 auto;
  color: var(--warning);
}

.sensitive-notice span {
  color: #c8b783;
  font-size: 12px;
}

.issued-code-list {
  display: grid;
  gap: 8px;
  max-height: 310px;
  margin-top: 14px;
  overflow: auto;
  scrollbar-color: #21495b transparent;
}

.issued-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(3, 13, 22, 0.58);
}

.issued-code code {
  overflow-wrap: anywhere;
  color: #cbfffa;
  font-family: "Cascadia Mono", "Microsoft YaHei UI", monospace;
  font-size: 13px;
}

.issued-code-meta {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.list-heading {
  align-items: center;
}

.filters {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) 170px 150px;
  gap: 10px;
  margin-top: 20px;
}

.search-field {
  position: relative;
}

.search-field i {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 11px;
  height: 11px;
  border: 1.5px solid #6d8998;
  border-radius: 50%;
}

.search-field i::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 1.5px;
  background: #6d8998;
  content: "";
  transform: rotate(45deg);
}

.search-field input {
  padding-left: 36px;
}

.list-state {
  display: grid;
  min-height: 170px;
  place-items: center;
  color: var(--text-muted);
  text-align: center;
}

.state-content {
  display: grid;
  justify-items: center;
  gap: 10px;
  max-width: 380px;
}

.state-content strong {
  color: var(--text);
  font-size: 15px;
}

.state-content p {
  margin: 0;
}

.table-wrap {
  position: relative;
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.license-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.license-table th,
.license-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.license-table th {
  color: #7893a2;
  background: rgba(3, 13, 22, 0.6);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.license-table tr:last-child td {
  border-bottom: 0;
}

.license-table tbody tr {
  transition: background 0.14s ease;
}

.license-table tbody tr:hover {
  background: rgba(78, 225, 211, 0.025);
}

.license-name {
  display: block;
  max-width: 210px;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-hint {
  display: block;
  margin-top: 4px;
  color: #7896a5;
  font-family: "Cascadia Mono", monospace;
  font-size: 10px;
}

.tag-list {
  display: flex;
  max-width: 190px;
  flex-wrap: wrap;
  gap: 5px;
}

.product-tag,
.status-tag {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid rgba(61, 141, 245, 0.25);
  border-radius: 6px;
  color: #9dc8ff;
  background: rgba(61, 141, 245, 0.08);
  font-size: 9px;
}

.product-tag--watermark {
  border-color: rgba(78, 225, 211, 0.28);
  color: #94eee6;
  background: rgba(78, 225, 211, 0.07);
}

.status-tag {
  border-radius: 999px;
}

.status-tag--active {
  border-color: rgba(103, 227, 158, 0.28);
  color: var(--success);
  background: rgba(103, 227, 158, 0.07);
}

.status-tag--revoked {
  border-color: rgba(255, 113, 136, 0.28);
  color: #ff9aac;
  background: rgba(255, 113, 136, 0.07);
}

.status-tag--expired {
  border-color: rgba(255, 209, 102, 0.28);
  color: var(--warning);
  background: rgba(255, 209, 102, 0.07);
}

.date-primary {
  display: block;
  color: #c9dce4;
  font-size: 11px;
  white-space: nowrap;
}

.date-secondary {
  display: block;
  margin-top: 3px;
  color: #688594;
  font-size: 9px;
}

.binding-list {
  display: grid;
  gap: 8px;
  min-width: 140px;
}

.binding-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.binding-copy {
  min-width: 0;
}

.binding-copy strong {
  display: block;
  overflow: hidden;
  color: #c4d8e1;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.binding-copy small,
.no-binding {
  display: block;
  color: #607e8d;
  font-size: 9px;
}

.row-actions {
  display: flex;
  min-width: 104px;
  flex-direction: column;
  gap: 6px;
}

.modal {
  width: min(92vw, 480px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(0, 5, 10, 0.72);
  backdrop-filter: blur(5px);
}

.modal-card {
  display: grid;
  gap: 20px;
  padding: 24px;
}

.modal-context {
  margin: -4px 0 0;
  color: var(--text-muted);
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text-muted);
  background: rgba(3, 13, 22, 0.5);
  font-size: 22px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
  background: rgba(10, 31, 46, 0.96);
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
}

.toast--error {
  border-color: rgba(255, 113, 136, 0.45);
  color: #ffd3db;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 1080px) {
  .management-grid {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .search-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 840px) {
  .topbar {
    position: static;
  }

  .connection-state {
    display: none;
  }

  .overview-band {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 22px;
  }

  .metrics {
    width: 100%;
    justify-content: space-between;
  }

  .management-grid {
    grid-template-columns: 1fr;
  }

  .issue-panel {
    position: static;
  }
}

@media (max-width: 600px) {
  .center-view {
    padding: 14px;
  }

  .login-shell {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .topbar {
    align-items: flex-start;
    padding: 13px 16px;
  }

  .topbar .brand-lockup h1 {
    max-width: 170px;
    font-size: 14px;
  }

  .topbar .eyebrow,
  .topbar-actions .button--ghost {
    display: none;
  }

  .panda-mark {
    width: 42px;
    height: 42px;
  }

  .workspace {
    padding: 24px 14px 50px;
  }

  .overview-copy h2 {
    font-size: 28px;
  }

  .metrics {
    gap: 12px;
  }

  .metrics article {
    min-width: 0;
  }

  .metrics strong {
    font-size: 25px;
  }

  .issue-panel,
  .issued-result,
  .list-section {
    padding: 19px;
  }

  .field-group,
  .form-row,
  .filters {
    grid-template-columns: 1fr;
  }

  .search-field {
    grid-column: auto;
  }

  .sensitive-notice {
    align-items: flex-start;
    flex-direction: column;
  }

  .issued-code {
    grid-template-columns: 1fr;
  }

  .issued-code .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
