:root { color: #edf4f5; background: #061014; font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: #061014; color: #edf4f5; letter-spacing: 0; }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
[hidden] { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: linear-gradient(135deg, #071519 0%, #0a1720 52%, #11131b 100%); }
.login-panel { width: min(920px, 100%); min-height: 560px; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; border: 1px solid #25383c; border-radius: 8px; background: #091418; box-shadow: 0 26px 80px rgba(0, 0, 0, .38); }
.login-brand { display: flex; align-items: flex-start; justify-content: flex-end; flex-direction: column; gap: 13px; padding: 54px; background: linear-gradient(180deg, rgba(12, 28, 33, .1), rgba(4, 13, 16, .82)), url("/admin/assets/logo.png") center 42% / 250px no-repeat, #0b2025; }
.login-brand img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; }
.login-brand div, .brand-lockup div { display: grid; gap: 2px; }
.login-brand strong { font-size: 18px; }
.login-brand span, .brand-lockup span { color: #82969b; font-size: 12px; }
.login-form { display: flex; flex-direction: column; justify-content: center; gap: 20px; padding: 54px; background: #0b1519; }
.login-form header { margin-bottom: 14px; }
.eyebrow { margin: 0 0 7px; color: #5fd0bc; font-size: 11px; font-weight: 700; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; line-height: 1.2; }
h2 { margin-bottom: 0; font-size: 19px; }
label { display: grid; gap: 8px; color: #aebdc0; font-size: 13px; }
input, select { width: 100%; height: 42px; border: 1px solid #2a3a3e; border-radius: 6px; outline: none; background: #071115; color: #edf4f5; padding: 0 12px; }
input:focus, select:focus { border-color: #55c9b4; box-shadow: 0 0 0 3px rgba(85, 201, 180, .12); }
.primary-button, .secondary-button, .danger-button, .icon-button { min-height: 40px; border: 1px solid transparent; border-radius: 6px; padding: 0 15px; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.primary-button { background: #55c9b4; color: #04100f; font-weight: 750; }
.primary-button:hover { background: #73d8c5; }
.primary-button.small { min-height: 38px; display: inline-flex; align-items: center; gap: 7px; }
.secondary-button { border-color: #314247; background: #101c20; color: #d7e1e3; }
.secondary-button:hover { background: #17262b; }
.danger-button { background: #cc5b61; color: #fff; font-weight: 700; }
.danger-button:hover { background: #dd6b71; }
.icon-button { width: 40px; padding: 0; border-color: #314247; background: #101c20; color: #c8d6d8; font-size: 21px; }
.icon-button:hover { background: #19282c; color: #fff; }
.form-error { min-height: 18px; margin: -4px 0 0; color: #ef888d; font-size: 12px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid #203136; background: #071115; padding: 22px 14px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 0 8px 24px; border-bottom: 1px solid #1e2c30; }
.brand-lockup img { width: 36px; height: 36px; border-radius: 7px; object-fit: cover; }
.brand-lockup strong { font-size: 15px; }
.sidebar nav { margin-top: 18px; }
.nav-item { width: 100%; height: 42px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 6px; background: transparent; color: #8fa2a6; padding: 0 12px; text-align: left; }
.nav-item.active { background: #13272a; color: #ddf7f1; }
.nav-item span { width: 18px; color: #61cfbb; font-size: 18px; }
.service-indicator { margin-top: auto; display: flex; align-items: center; gap: 10px; border-top: 1px solid #1e2c30; padding: 20px 8px 4px; }
.service-indicator > i { width: 8px; height: 8px; border-radius: 50%; background: #5dd29a; box-shadow: 0 0 0 4px rgba(93, 210, 154, .1); }
.service-indicator div { display: grid; gap: 2px; }
.service-indicator strong { font-size: 12px; }
.service-indicator small { color: #708488; font-size: 11px; }
.workspace { min-width: 0; background: #0a1418; }
.topbar { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #213136; padding: 18px 30px; background: #0b161a; }
.topbar h1 { font-size: 23px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.stats-band { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); border-bottom: 1px solid #213136; background: #0d191d; padding: 0 30px; }
.stats-band > div { min-height: 126px; display: grid; align-content: center; gap: 5px; border-right: 1px solid #213136; padding: 20px 24px; }
.stats-band > div:first-child { border-left: 1px solid #213136; }
.stats-band span { color: #8ea1a5; font-size: 12px; }
.stats-band strong { font-size: 28px; font-variant-numeric: tabular-nums; }
.stats-band small { color: #5f7478; font-size: 11px; }
.license-section { padding: 28px 30px 34px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-heading p { margin: 5px 0 0; color: #71868a; font-size: 12px; }
.filters { display: flex; align-items: center; gap: 8px; }
.filters select { width: 128px; }
.search-field { position: relative; display: block; }
.search-field span { position: absolute; left: 12px; top: 10px; color: #6d8185; font-size: 19px; }
.search-field input { width: 260px; padding-left: 37px; }
.table-wrap { overflow-x: auto; border: 1px solid #26363a; border-radius: 7px; background: #0b161a; }
table { width: 100%; min-width: 1040px; border-collapse: collapse; }
th { height: 42px; border-bottom: 1px solid #2a3a3e; background: #101d21; color: #82969a; font-size: 11px; font-weight: 650; text-align: left; padding: 0 14px; }
td { height: 68px; border-bottom: 1px solid #1c2a2e; color: #c8d5d7; font-size: 12px; padding: 10px 14px; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #0f1d21; }
.reference { display: grid; gap: 4px; }
.reference strong { color: #e5efef; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.reference span, .date-stack span { color: #657a7e; font-size: 10px; }
.date-stack { display: grid; gap: 4px; white-space: nowrap; }
.date-stack strong { font-size: 11px; font-weight: 600; }
.plan-badge, .status-badge { display: inline-flex; min-width: 54px; height: 25px; align-items: center; justify-content: center; border: 1px solid #33484c; border-radius: 5px; padding: 0 8px; font-size: 11px; white-space: nowrap; }
.plan-badge.permanent { border-color: #765e28; background: #261f10; color: #edc96e; }
.status-badge.active { border-color: #2b674f; background: #10291f; color: #72d9a8; }
.status-badge.unused { border-color: #3a5365; background: #12222c; color: #82b7d4; }
.status-badge.disabled { border-color: #6a383c; background: #2b1518; color: #ec878c; }
.status-badge.expired { border-color: #655238; background: #251f16; color: #dcb77c; }
.device-state { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.device-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #50666a; }
.device-state.bound::before { background: #5dd29a; }
.row-actions { display: flex; align-items: center; gap: 6px; }
.row-actions button { height: 30px; border: 1px solid #304247; border-radius: 5px; background: #111f23; color: #afbec1; padding: 0 9px; font-size: 11px; }
.row-actions button:hover { background: #1a2b30; color: #fff; }
.row-actions button.danger { border-color: #5f363a; color: #e88489; }
.empty-state { min-height: 260px; display: grid; place-content: center; gap: 8px; text-align: center; }
.empty-state strong { font-size: 14px; }
.empty-state span { color: #6e8387; font-size: 12px; }
.pagination { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; color: #6f8488; font-size: 12px; }
.pagination > div { display: flex; gap: 7px; }
.pagination .icon-button { width: 34px; min-height: 34px; height: 34px; }
.modal { width: min(620px, calc(100vw - 32px)); border: 1px solid #33464a; border-radius: 8px; background: #0c171b; color: #edf4f5; padding: 0; box-shadow: 0 24px 90px rgba(0, 0, 0, .58); }
.modal::backdrop { background: rgba(2, 7, 9, .72); backdrop-filter: blur(4px); }
.modal form, .modal > section { display: grid; gap: 20px; padding: 24px; }
.modal header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.modal footer { display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid #243438; padding-top: 18px; }
.segmented-control { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border: 1px solid #2b3d41; border-radius: 7px; background: #071115; padding: 4px; }
.segmented-control button { height: 36px; border: 0; border-radius: 5px; background: transparent; color: #85999d; }
.segmented-control button.selected { background: #1a3435; color: #75dfca; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: 150px 1fr; gap: 14px; }
.one-time-notice { display: grid; gap: 5px; border-left: 3px solid #e0ad52; background: #201b11; padding: 13px 14px; }
.one-time-notice strong { color: #efc46f; font-size: 12px; }
.one-time-notice span { color: #a89878; font-size: 11px; }
.issued-list { max-height: 330px; overflow: auto; display: grid; gap: 7px; }
.issued-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid #293c40; border-radius: 6px; background: #071115; padding: 11px 13px; }
.issued-item code { color: #d7f4ed; font-size: 13px; }
.issued-item span { color: #788d91; font-size: 10px; }
.confirm-modal { width: min(430px, calc(100vw - 32px)); }
.confirm-modal > section > p { color: #9badaf; line-height: 1.7; font-size: 13px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: min(380px, calc(100vw - 44px)); transform: translateY(18px); border: 1px solid #36514f; border-radius: 6px; background: #102321; color: #daf3ed; padding: 12px 15px; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.error { border-color: #663a3e; background: #281619; color: #f2b2b5; }
@media (max-width: 1100px) {
  .stats-band { grid-template-columns: repeat(3, 1fr); }
  .stats-band > div:first-child { border-left: 0; }
  .stats-band > div:nth-child(3) { border-right: 0; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .filters { flex-wrap: wrap; }
  .search-field { flex: 1 1 260px; }
  .search-field input { width: 100%; }
}
@media (max-width: 760px) {
  .login-shell { padding: 14px; }
  .login-panel { min-height: 0; grid-template-columns: 1fr; }
  .login-brand { min-height: 180px; padding: 28px; background-size: 120px; }
  .login-form { padding: 30px 24px; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px; }
  .sidebar nav, .service-indicator { display: none; }
  .brand-lockup { border: 0; padding: 0; }
  .topbar { align-items: flex-start; padding: 18px; }
  .topbar .secondary-button { display: none; }
  .stats-band { grid-template-columns: repeat(2, 1fr); padding: 0 18px; }
  .stats-band > div { min-height: 104px; padding: 15px; }
  .stats-band > div:nth-child(2n) { border-right: 0; }
  .license-section { padding: 22px 18px; }
  .filters select { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .table-wrap { overflow: visible; border: 0; background: transparent; }
  table { min-width: 0; }
  thead { display: none; }
  tbody { display: grid; gap: 10px; }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 18px; border: 1px solid #26363a; border-radius: 7px; background: #0b161a; padding: 14px; }
  tbody tr:hover { background: #0f1d21; }
  td { height: auto; min-width: 0; border: 0; padding: 0; }
  td:nth-child(1) { grid-column: 1; }
  td:nth-child(2) { grid-column: 2; grid-row: 1; align-self: center; }
  td:nth-child(3) { grid-column: 1 / -1; color: #8fa2a6; overflow-wrap: anywhere; }
  td:nth-child(3)::before { content: "备注："; color: #607579; }
  td:nth-child(4) { grid-column: 1; }
  td:nth-child(5) { grid-column: 2; justify-self: end; }
  td:nth-child(6) { grid-column: 1 / -1; border-top: 1px solid #1f3034; padding-top: 11px; }
  td:nth-child(7) { grid-column: 1 / -1; }
  .row-actions { justify-content: flex-end; }
  .row-actions button { height: 34px; }
  .empty-state { border: 1px solid #26363a; border-radius: 7px; }
}
