:root {
  --ink: #20231f;
  --ink-soft: #343933;
  --paper: #ffffff;
  --canvas: #f2f4f3;
  --line: #dfe4e1;
  --line-strong: #cbd2ce;
  --muted: #69726c;
  --teal: #137a6e;
  --teal-soft: #dff3ee;
  --red: #d95745;
  --red-soft: #fde9e5;
  --amber: #b7791f;
  --amber-soft: #fff3d6;
  --violet: #7158a6;
  --violet-soft: #eee9f8;
  --shadow: 0 10px 28px rgba(28, 35, 31, .08);
  --sidebar-width: 232px;
  --shell-menu-height: 0px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  letter-spacing: 0;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); font-size: 14px; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
.hidden { display: none !important; }
svg { width: 18px; height: 18px; stroke-width: 1.8; }
.emoji-icon, .field-emoji, .stat-emoji { font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; font-style: normal; font-weight: 400; line-height: 1; }
.emoji-icon { width: 1.2em; display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; font-size: 16px; }
.emoji-button > svg { display: none; }
.icon-button .emoji-icon { width: auto; font-size: 17px; }
.icon-button.small .emoji-icon { font-size: 15px; }
.nav-item .emoji-icon { width: 22px; font-size: 18px; }
.emoji-field > svg { display: none; }
.field-emoji { position: absolute; left: 11px; top: 50%; z-index: 1; width: 18px; transform: translateY(-50%); font-size: 16px; text-align: center; pointer-events: none; }
.stat-icon .stat-emoji { font-size: 22px; }
.stat-icon[data-emoji-ready="true"] svg { display: none; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 520px);
  background: var(--canvas);
}
.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  color: var(--paper);
  background: var(--ink);
  border-right: 8px solid var(--teal);
}
.brand-name { font-size: 32px; font-weight: 750; }
.brand-subtitle { margin-top: 7px; color: #aeb8b2; font-size: 12px; }
.brand-symbol { width: 34px; height: 34px; flex: 0 0 auto; display: block; overflow: hidden; border-radius: 8px; background: #9bd9ee; }
.brand-symbol img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-symbol-large { width: 62px; height: 62px; border-radius: 14px; }
.login-panel { width: min(390px, calc(100vw - 48px)); align-self: center; justify-self: center; display: grid; gap: 18px; }
.login-heading { margin-bottom: 8px; }
.login-heading h1 { margin: 7px 0 0; font-size: 27px; line-height: 1.25; }
.eyebrow, .section-kicker { color: var(--teal); font-size: 11px; font-weight: 750; }
.login-button { width: 100%; height: 46px; justify-content: center; margin-top: 5px; }
.form-error { min-height: 20px; color: var(--red); font-size: 13px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--ink); color: var(--paper); display: flex; flex-direction: column; padding: 20px 14px 14px; z-index: 20; }
.sidebar-brand { display: flex; gap: 12px; align-items: center; min-height: 50px; padding: 0 10px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { font-size: 17px; }
.sidebar-brand small { color: #9da7a1; margin-top: 3px; font-size: 11px; }
.nav-list { display: grid; gap: 5px; margin-top: 22px; }
.nav-item { min-height: 42px; display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 6px; padding: 0 12px; color: #b9c1bc; background: transparent; text-align: left; }
.nav-item:hover { color: var(--paper); background: rgba(255,255,255,.07); }
.nav-item.active { color: var(--paper); background: var(--teal); }
.sidebar-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.1); }
.service-state { min-width: 0; display: flex; gap: 9px; align-items: center; }
.service-state strong, .service-state small { display: block; }
.service-state strong { font-size: 12px; }
.service-state small { margin-top: 2px; color: #9da7a1; font-size: 10px; }
.status-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #38b98b; box-shadow: 0 0 0 3px rgba(56,185,139,.15); }
.status-dot.down { background: var(--red); box-shadow: 0 0 0 3px rgba(217,87,69,.15); }

.main-area { min-width: 0; }
.mobile-menu-bar { display: none; }
.menu-button { display: none !important; }
.menu-label { font-size: 12px; }
.workspace { padding: 24px 26px 34px; }
.page { display: none; }
.page.active { display: block; }
.page.quxiang-page { min-height: calc(100dvh - var(--shell-menu-height)); margin: -24px -26px -34px; padding: 0; }
/* Short shop windows scroll navigation inside the sidebar, not below the page. */
#app-shell:has(#page-shop-native.active) > .sidebar { overflow-y: auto; }
.quxiang-embedded-shell { min-height: calc(100dvh - var(--shell-menu-height)); position: relative; }
.quxiang-embedded-overlay { position: relative; z-index: 30; }
.quxiang-embedded-toast { position: fixed; right: 18px; top: calc(var(--shell-menu-height) + 10px); z-index: 110; }
.quxiang-load-error { min-height: 300px; display: grid; place-items: center; align-content: center; gap: 10px; padding: 28px; color: var(--muted); text-align: center; background: var(--paper); }
.quxiang-load-error strong { color: var(--ink); font-size: 16px; }
.quxiang-load-error span { max-width: 600px; overflow-wrap: anywhere; font-size: 12px; }

.stats-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--paper); border-radius: 8px; overflow: hidden; }
.stat-block { min-width: 0; display: flex; align-items: center; gap: 13px; min-height: 102px; padding: 18px; border-right: 1px solid var(--line); }
.stat-block:last-child { border-right: 0; }
.stat-block span { color: var(--muted); font-size: 12px; }
.stat-block strong { display: block; margin-top: 7px; font-size: 26px; line-height: 1; }
.stat-icon { width: 39px; height: 39px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 6px; }
.stat-icon.ink { color: var(--paper); background: var(--ink); }
.stat-icon.gray { color: #59635d; background: #e8ecea; }
.stat-icon.teal { color: var(--teal); background: var(--teal-soft); }
.stat-icon.amber { color: var(--amber); background: var(--amber-soft); }
.stat-icon.red { color: var(--red); background: var(--red-soft); }
.stat-icon.violet { color: var(--violet); background: var(--violet-soft); }
.dashboard-grid { margin-top: 18px; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr); gap: 18px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 73px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.section-header h3, .settings-copy h3 { margin: 5px 0 0; font-size: 17px; }
.text-button { display: inline-flex; gap: 6px; align-items: center; border: 0; color: var(--teal); background: transparent; font-weight: 650; }
.text-button svg { width: 15px; }
.timeline { min-height: 340px; padding: 8px 18px 14px; }
.timeline-item { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 11px; min-height: 65px; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; color: var(--teal); background: var(--teal-soft); }
.timeline-icon svg { width: 15px; }
.timeline-item strong, .timeline-item span { display: block; }
.timeline-item strong { font-size: 13px; }
.timeline-item span { color: var(--muted); font-size: 11px; margin-top: 3px; }
.timeline-item time { color: var(--muted); font-size: 11px; }
.product-stack { min-height: 340px; padding: 8px 18px 14px; }
.product-line { padding: 15px 0; border-bottom: 1px solid var(--line); }
.product-line:last-child { border-bottom: 0; }
.product-line-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.product-line strong { font-size: 13px; }
.product-line span { color: var(--muted); font-size: 11px; }
.product-progress { height: 4px; margin-top: 10px; overflow: hidden; background: #e8ecea; border-radius: 2px; }
.product-progress span { display: block; height: 100%; background: var(--teal); }

.section-toolbar { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 2px; }
.toolbar-title span, .toolbar-title small { display: block; }
.toolbar-title span { font-size: 18px; font-weight: 750; }
.toolbar-title small { color: var(--muted); margin-top: 4px; font-size: 11px; }
.toolbar-actions { display: flex; gap: 8px; align-items: center; }
.selection-actions { display: flex; gap: 5px; align-items: center; padding-right: 8px; border-right: 1px solid var(--line); }
.filter-band { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--paper); }
.filter-fields { min-width: 0; flex: 1; display: grid; grid-template-columns: minmax(240px,1.55fr) repeat(7,minmax(128px,1fr)); gap: 9px; }
.filter-fields select, .search-box { width: 100%; height: 38px; }
.filter-tools { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding-left: 12px; border-left: 1px solid var(--line); }
.search-box { position: relative; }
.search-box svg { position: absolute; top: 10px; left: 11px; width: 17px; color: var(--muted); }
.search-box input { width: 100%; height: 100%; padding-left: 36px; }
input, select, textarea { min-width: 0; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: var(--paper); outline: none; }
input, select { height: 38px; padding: 0 11px; }
textarea { padding: 10px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(19,122,110,.1); }
.table-wrap { overflow: auto; border: 1px solid var(--line); background: var(--paper); }
.data-table { width: 100%; min-width: 1050px; border-collapse: collapse; table-layout: fixed; }
.data-table th { height: 44px; padding: 0 11px; color: var(--muted); background: #f7f8f7; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; font-weight: 700; white-space: nowrap; }
.data-table td { height: 58px; padding: 8px 11px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table tbody tr:hover { background: #f8faf9; }
.data-table tbody tr.selected { background: #edf7f4; }
[data-column].column-hidden { display: none !important; }
.license-table { min-width: 1470px; }
.license-table .index-header, .license-table .index-cell { width: 50px; text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.license-table .key-header, .license-table .key-cell { width: 160px; }
.license-table [data-column="product"] { width: 136px; }
.license-table [data-column="version"] { width: 108px; }
.license-table [data-column="status"] { width: 82px; }
.license-table [data-column="online"] { width: 100px; }
.license-table [data-column="heartbeat"], .license-table [data-column="expiry"] { width: 126px; }
.license-table [data-column="device"] { width: 180px; }
.license-table [data-column="ip"] { width: 118px; }
.license-table [data-column="note"] { width: 120px; }
.license-table [data-column="actions"] { width: 150px; position: sticky; right: 0; z-index: 2; background: var(--paper); box-shadow: -8px 0 12px rgba(32,35,31,.05); }
.license-table th[data-column="actions"] { z-index: 3; background: #f7f8f7; }
.license-table tbody tr:hover td[data-column="actions"] { background: #f8faf9; }
.check-cell { width: 38px; text-align: center !important; }
.check-cell input { width: 15px; height: 15px; accent-color: var(--teal); }
.actions-cell { text-align: right !important; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.key-cell strong, .product-cell strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.key-cell code { font-size: 11px; color: var(--ink); }
.key-copy { display: block; max-width: 100%; overflow: hidden; padding: 0; border: 0; color: var(--ink); background: transparent; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; }
.key-copy:hover code { color: var(--teal); text-decoration: underline; }
.product-cell span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.version-cell strong, .version-cell span { display: block; overflow: hidden; text-overflow: ellipsis; }
.version-cell strong { color: var(--teal); font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.version-cell span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.device-meta strong, .device-meta span { display: block; overflow: hidden; text-overflow: ellipsis; }
.device-meta span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.ip-line { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.ip-location { display: block; max-width: 100%; margin-top: 4px; overflow: hidden; color: var(--teal); font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 0 7px; border-radius: 5px; font-size: 10px; font-weight: 700; }
.badge.active { color: #0b6b54; background: var(--teal-soft); }
.badge.unused { color: #52615a; background: #e9eeeb; }
.badge.expired { color: #a43c2f; background: var(--red-soft); }
.badge.disabled { color: #654693; background: var(--violet-soft); }
.badge.risk { color: #a43c2f; background: var(--red-soft); }
.online-indicator { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.online-indicator::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #aeb7b2; }
.online-indicator.online { color: var(--teal); }
.online-indicator.online::before { background: #27a77f; box-shadow: 0 0 0 3px rgba(39,167,127,.13); }
.lease-meta, .heartbeat-meta { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.lease-meta.active { color: var(--teal); }
.table-footer { min-height: 54px; display: flex; justify-content: space-between; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; background: var(--paper); color: var(--muted); font-size: 11px; }
.pagination { display: flex; align-items: center; gap: 7px; }
.pagination select { width: 72px; height: 34px; }
.empty-state { min-height: 280px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); }
.empty-state svg { width: 34px; height: 34px; color: #9eaaa4; }
.empty-state strong { color: var(--ink); }
.empty-state span { font-size: 12px; }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.product-card { min-height: 178px; display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.product-card-head { display: flex; align-items: flex-start; gap: 12px; }
.product-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 6px; color: var(--teal); background: var(--teal-soft); }
.product-card h3 { margin: 0; font-size: 15px; }
.product-code { margin-top: 4px; color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.product-description { flex: 1; margin: 14px 0; color: var(--muted); line-height: 1.6; font-size: 12px; }
.product-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.muted-text { color: var(--muted); font-size: 11px; }
.device-directory { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.device-license { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.device-license-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.device-license h3 { margin: 0; font-size: 14px; }
.device-license p { color: var(--muted); font-size: 11px; }
.device-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.device-row span { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.device-card-summary { padding-top: 10px; border-top: 1px solid var(--line); color: var(--teal); font-size: 11px; font-weight: 700; }

.settings-layout { display: grid; gap: 14px; max-width: 820px; }
.settings-section { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.settings-copy { margin-bottom: 16px; }
.setting-row { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); }
.setting-row strong, .setting-row span { display: block; }
.setting-row strong { font-size: 13px; }
.setting-row span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.danger-setting strong { color: var(--red); }
.number-unit { display: flex; align-items: center; }
.number-unit input { width: 110px; border-radius: 6px 0 0 6px; }
.number-unit span { height: 38px; display: grid; place-items: center; margin: 0; padding: 0 12px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 6px 6px 0; background: #f6f8f7; }
.switch { appearance: none; width: 42px; height: 23px; position: relative; padding: 0; border: 0; border-radius: 12px; background: #c8d0cc; transition: .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.2); transition: .2s; }
.switch:checked { background: var(--red); }
.switch:checked::after { transform: translateX(19px); }
.metadata-list { margin: 0; }
.metadata-list div { min-height: 44px; display: grid; grid-template-columns: 160px 1fr; align-items: center; border-top: 1px solid var(--line); }
.metadata-list dt { color: var(--muted); font-size: 11px; }
.metadata-list dd { margin: 0; font-family: ui-monospace, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.settings-button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.payment-fee-credentials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0 8px; }
.payment-fee-credentials .field span { color: var(--muted); font-size: 11px; }
.setting-status { min-height: 18px; margin: 10px 0 12px; color: var(--muted); font-size: 11px; }
.setting-status.is-error { color: var(--red); }
.signing-key-list { display: grid; gap: 7px; margin-top: 14px; }
.signing-key-row { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #f8faf9; }
.signing-key-row strong, .signing-key-row code { display: block; }
.signing-key-row strong { font-size: 11px; }
.signing-key-row code { margin-top: 3px; color: var(--muted); font-size: 11px; }
.tls-pin-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.tls-pin-groups > div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #f8faf9; }
.tls-pin-groups strong { display: block; margin-bottom: 8px; font-size: 11px; }
.pin-list { display: grid; gap: 6px; }
.pin-list code, .pin-list span { display: block; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.runtime-config-section { max-width: 820px; }
.runtime-config-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.runtime-config-toolbar select { min-width: 240px; }
.runtime-config-toolbar span { color: var(--muted); font-size: 11px; }
.config-editor { width: 100%; min-height: 260px; margin-bottom: 12px; font-family: ui-monospace, Consolas, monospace; line-height: 1.55; }
.two-factor-secret { display: grid; grid-template-columns: 1fr auto; gap: 7px 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #f8faf9; }
.two-factor-secret span { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.two-factor-secret strong { overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; }
.replacement-wrap .data-table { min-width: 920px; }

.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 6px; padding: 0 14px; font-weight: 700; font-size: 12px; }
.button.primary { color: var(--paper); background: var(--teal); border-color: var(--teal); }
.button.primary:hover { background: #0d685e; }
.button.secondary { color: var(--ink); background: var(--paper); border-color: var(--line-strong); }
.button.secondary:hover, .button.subtle:hover { background: #f1f4f2; }
.button.subtle { color: var(--teal); background: var(--teal-soft); border-color: transparent; }
.button.danger { color: var(--paper); background: var(--red); }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--paper); padding: 0; }
.icon-button:hover { color: var(--teal); border-color: #a9c8c0; background: #f0f8f5; }
.icon-button.dark { color: #c9d0cc; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); }
.icon-button.small { width: 30px; height: 30px; }
.icon-button.small svg { width: 15px; }
.icon-button.danger { color: var(--red); }
.input-with-icon { position: relative; }
.input-with-icon svg { position: absolute; left: 12px; top: 11px; width: 17px; color: var(--muted); }
.input-with-icon input { width: 100%; padding-left: 38px; }
.field { display: grid; gap: 7px; }
.field > span { color: var(--muted); font-size: 11px; font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; }
.field textarea { min-height: 86px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.field.full { grid-column: 1 / -1; }

.modal { width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 26px 70px rgba(15,20,17,.28); color: var(--ink); }
.modal::backdrop { background: rgba(21,25,23,.62); }
.small-modal { width: min(440px, calc(100vw - 32px)); }
.wide-modal { width: min(820px, calc(100vw - 32px)); }
.modal-shell { margin: 0; display: grid; gap: 18px; padding: 20px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.modal-header h3 { margin: 5px 0 0; font-size: 19px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding-top: 16px; }
.column-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.column-options label { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #f8faf9; }
.column-options input { width: 16px; height: 16px; accent-color: var(--teal); }
.key-result-meta { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; }
.key-result-meta strong { color: var(--red); }
.key-output { width: 100%; min-height: 330px; font-family: ui-monospace, Consolas, monospace; line-height: 1.75; }
.detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--line); }
.detail-item { min-height: 70px; padding: 12px; background: var(--paper); }
.detail-item span, .detail-item strong { display: block; }
.detail-item span { color: var(--muted); font-size: 10px; }
.detail-item strong { margin-top: 7px; font-size: 12px; overflow-wrap: anywhere; }
.detail-note { padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: #f8faf9; }
.detail-note strong { font-size: 11px; }
.detail-note p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.device-list { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.device-list-head { padding: 11px 13px; background: #f5f7f6; font-size: 11px; font-weight: 700; }
.device-list-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 80px; gap: 10px; padding: 12px 13px; border-top: 1px solid var(--line); font-size: 11px; }
.device-list-row span { color: var(--muted); }
.audit-json { display: block; max-width: 300px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }

.toast-region { position: fixed; top: 18px; right: 18px; z-index: 100; display: grid; gap: 8px; }
.toast { width: min(360px, calc(100vw - 36px)); display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 6px; color: var(--paper); background: var(--ink); box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast.success { background: #176f62; }
.toast.error { background: #b64436; }
.toast svg { flex: 0 0 auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
/* 全局加载指示：顶部细进度条，不再整屏灰幕 */
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 120; background: transparent; pointer-events: none; overflow: hidden; }
.loading-overlay .spinner { display: none; }
.loading-overlay::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: linear-gradient(90deg, rgba(59,130,246,0), #3b82f6, rgba(59,130,246,0)); animation: quxiang-loading-slide 1.1s ease-in-out infinite; }
@keyframes quxiang-loading-slide { from { transform: translateX(-100%); } to { transform: translateX(350%); } }
.spinner { width: 32px; height: 32px; border: 3px solid #cbd5d0; border-top-color: var(--teal); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1600px) {
  .filter-band { align-items: flex-start; }
  .filter-fields { grid-template-columns: repeat(5,minmax(140px,1fr)); }
  .filter-fields .primary-search { grid-column: span 2; }
}
@media (max-width: 1350px) {
  .license-table { min-width: 1180px; }
  .license-table [data-column="ip"], .license-table [data-column="note"] { display: none; }
}
@media (max-width: 1250px) {
  .stats-grid { grid-template-columns: repeat(3,1fr); }
  .stat-block:nth-child(3) { border-right: 0; }
  .stat-block:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .filter-band { align-items: stretch; flex-direction: column; }
  .filter-tools { align-self: flex-end; padding: 0; border-left: 0; }
}
@media (max-width: 900px) {
  :root { --sidebar-width: 78px; }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .sidebar-brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .sidebar-brand > div:last-child, .nav-item span, .service-state > div { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .sidebar-footer { justify-content: center; }
  .service-state { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .filter-fields { grid-template-columns: 1fr 1fr; }
  .filter-fields .primary-search { grid-column: 1 / -1; }
  .filter-tools { width: 100%; justify-content: flex-end; padding-top: 10px; border-top: 1px solid var(--line); }
  .device-directory { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  :root { --shell-menu-height: 56px; }
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { min-height: 190px; border-right: 0; border-bottom: 7px solid var(--teal); }
  .login-panel { padding: 36px 0; }
  .brand-name { font-size: 25px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -244px; width: 232px; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 12px 0 40px rgba(0,0,0,.22); }
  .sidebar-brand { justify-content: flex-start; padding-left: 10px; }
  .sidebar-brand > div:last-child, .nav-item span, .service-state > div { display: block; }
  .nav-item { justify-content: flex-start; padding: 0 12px; }
  .sidebar-footer { justify-content: space-between; }
  .service-state { display: flex; }
  .mobile-menu-bar { height: var(--shell-menu-height); display: flex; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 15; }
  .menu-button { display: inline-flex !important; align-items: center; justify-content: center; width: auto; min-width: 64px; padding: 0 10px; gap: 6px; }
  .workspace { padding: 16px 12px 26px; }
  .page.quxiang-page { margin: -16px -12px -26px; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .stat-block { min-height: 88px; padding: 13px; border-bottom: 1px solid var(--line); }
  .stat-block:nth-child(2n) { border-right: 0; }
  .stat-block:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .stat-block:nth-last-child(-n+2) { border-bottom: 0; }
  .stat-icon { width: 34px; height: 34px; }
  .stat-block strong { font-size: 22px; }
  .timeline, .product-stack { min-height: 0; }
  .section-toolbar { align-items: flex-start; flex-direction: column; padding: 8px 0 12px; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .button { flex: 1; }
  .selection-actions { flex: 1 1 100%; justify-content: space-between; padding: 0 0 8px; border: 0; border-bottom: 1px solid var(--line); }
  .filter-fields { grid-template-columns: 1fr; }
  .filter-fields .primary-search { grid-column: auto; }
  .filter-tools { justify-content: stretch; }
  .filter-tools .icon-button { width: auto; flex: 1; }
  .product-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .detail-item:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .device-list-row { grid-template-columns: 1fr 1fr; }
  .device-list .empty-state { min-height: 180px; }
  .table-wrap { overflow: visible; border: 0; background: transparent; }
  .responsive-table, .license-table { min-width: 0; border-collapse: separate; border-spacing: 0 10px; }
  .replacement-wrap .data-table { min-width: 0; }
  #page-audit .table-wrap { overflow: auto; border: 1px solid var(--line); background: var(--paper); }
  .responsive-table thead, .license-table thead { display: none; }
  .responsive-table tbody, .license-table tbody { display: grid; gap: 10px; }
  .responsive-table tbody tr, .license-table tbody tr { display: grid; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: 0 4px 14px rgba(28,35,31,.05); }
  .responsive-table tbody td, .license-table tbody td,
  .license-table tbody td:nth-child(n) { width: auto; min-height: 39px; height: auto; display: grid; grid-template-columns: 104px minmax(0,1fr); align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); position: static; overflow: visible; white-space: normal; box-shadow: none; text-align: left !important; }
  .responsive-table tbody td:last-child, .license-table tbody td:last-child { border-bottom: 0; }
  .responsive-table tbody td::before, .license-table tbody td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 700; }
  .license-table .check-cell { grid-template-columns: 104px 1fr; }
  .license-table .actions-cell, .responsive-table .actions-cell { background: transparent !important; }
  .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .table-footer { align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px; }
  .runtime-config-toolbar { align-items: stretch; flex-direction: column; }
  .runtime-config-toolbar select { min-width: 0; width: 100%; }
  .settings-section { padding: 16px; }
  .setting-row { align-items: flex-start; padding: 14px 0; }
  .payment-fee-credentials { grid-template-columns: 1fr; }
  .metadata-list div { grid-template-columns: 110px 1fr; }
  .tls-pin-groups, .column-options { grid-template-columns: 1fr; }
  .key-result-meta { flex-direction: column; gap: 5px; }
}

.shop-order-stats { grid-template-columns: repeat(6,minmax(0,1fr)); }
.shop-order-toolbar { margin-top: 16px; }
.shop-order-filters .filter-fields { grid-template-columns: minmax(300px,2fr) repeat(2,minmax(150px,1fr)) repeat(2,minmax(150px,1fr)); }
.compact-date { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; height: 38px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper); }
.compact-date span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.compact-date input { height: 34px; padding: 0; border: 0; box-shadow: none; }
.shop-order-error { margin-bottom: 10px; padding: 11px 13px; border: 1px solid #efb9b0; border-radius: 6px; color: #943529; background: var(--red-soft); font-size: 12px; }
.shop-order-table { min-width: 2010px; }
.shop-order-table th:nth-child(1), .shop-order-table td:nth-child(1) { width: 278px; }
.shop-order-table th:nth-child(2), .shop-order-table td:nth-child(2) { width: 168px; }
.shop-order-table th:nth-child(3), .shop-order-table td:nth-child(3),
.shop-order-table th:nth-child(4), .shop-order-table td:nth-child(4) { width: 96px; }
.shop-order-table th:nth-child(5), .shop-order-table td:nth-child(5) { width: 210px; }
.shop-order-table th:nth-child(6), .shop-order-table td:nth-child(6) { width: 126px; }
.shop-order-table th:nth-child(7), .shop-order-table td:nth-child(7) { width: 230px; }
.shop-order-table th:nth-child(8), .shop-order-table td:nth-child(8),
.shop-order-table th:nth-child(9), .shop-order-table td:nth-child(9),
.shop-order-table th:nth-child(10), .shop-order-table td:nth-child(10) { width: 154px; }
.shop-order-table th:nth-child(11), .shop-order-table td:nth-child(11) { width: 190px; }
.shop-order-table th:nth-child(12), .shop-order-table td:nth-child(12) { width: 90px; text-align: right; }
.shop-retry-button { min-width: 72px; justify-content: center; }
.shop-order-no { position: sticky; left: 0; z-index: 2; background: var(--paper); box-shadow: 8px 0 12px rgba(32,35,31,.05); }
.shop-order-table th.shop-order-no { z-index: 3; background: #f7f8f7; }
.shop-order-table tbody tr:hover .shop-order-no { background: #f8faf9; }
.mono-cell, .shop-license-cell code { font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.shop-license-cell { white-space: nowrap; }
.shop-license-cell code { display: inline-block; max-width: 158px; overflow: hidden; vertical-align: middle; text-overflow: ellipsis; }
.shop-license-cell .icon-button { display: inline-grid; margin-left: 6px; vertical-align: middle; }
.shop-order-issue { color: var(--red); }
.shop-order-amounts { display: grid; gap: 2px; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; white-space: normal; }
.shop-order-amounts strong { color: var(--teal); font-size: 11px; }
.shop-reconciliation-toolbar { margin-top: 22px; }
.shop-reconciliation-table-wrap { overflow: auto; }
.shop-reconciliation-table { min-width: 1120px; }
.shop-reconciliation-table th, .shop-reconciliation-table td { white-space: nowrap; }

@media (max-width: 1250px) {
  .shop-order-stats { grid-template-columns: repeat(3,1fr); }
  .shop-order-stats .stat-block:nth-child(3) { border-right: 0; }
  .shop-order-stats .stat-block:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 900px) {
  .shop-order-filters .filter-fields { grid-template-columns: 1fr 1fr; }
  .shop-order-filters .search-box { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .shop-order-stats { grid-template-columns: repeat(2,1fr); }
  .shop-order-filters .filter-fields { grid-template-columns: 1fr; }
  .shop-order-filters .search-box { grid-column: auto; }
  .shop-order-filters .filter-tools .button { flex: 3; justify-content: center; }
  .shop-order-table-wrap { overflow: auto; border: 1px solid var(--line); background: var(--paper); }
  .shop-order-table { min-width: 2010px; border-collapse: collapse; }
  .shop-order-table thead { display: table-header-group; }
  .shop-order-table tbody { display: table-row-group; }
  .shop-order-table tbody tr { display: table-row; }
  .shop-order-table tbody td { display: table-cell; height: 58px; padding: 8px 11px; white-space: nowrap; }
}

/* quxiang admin nav group */
.nav-group .nav-caret { margin-left: auto; width: 16px; height: 16px; transition: transform .15s ease; }
.nav-group.open .nav-item .nav-caret { transform: rotate(180deg); }
.nav-sub { display: none; flex-direction: column; }
.nav-sub.open { display: flex; }
.nav-item.sub { padding-left: 38px; font-size: 13px; opacity: .92; }

/* QuXiang sidebar palette: matches the selected blue admin reference. */
.sidebar { background: #21374c; }

/* QuXiang outer sidebar alignment with the blue reference. */
:root { font-family: "DM Sans", "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif; }
.sidebar { background: #21374c; }
.nav-item { color: #b8c9d9; }
.nav-item:hover { color: #ffffff; background: rgba(255,255,255,.08); }
.nav-item.active { color: #ffffff; background: #3b68e8; }
.nav-section-label { color: #9db8ce; font-size: 10px; letter-spacing: .04em; padding: 12px 12px 2px; }
.nav-sub .nav-section-label:first-child { padding-top: 8px; }
@media (min-width: 901px) {
  :root { --sidebar-width: 232px; }
  .sidebar { width: auto; position: sticky; left: auto; }
  .sidebar-brand > div:last-child, .nav-item span, .service-state > div { display: block; }
  .nav-item { justify-content: flex-start; padding: 0 12px; }
}
@media (max-width: 640px) {
  .nav-section-label { display: block; }
}

/* QuXiang sidebar final visual alignment. */
.nav-item.active { background: #3b68e8; box-shadow: inset 3px 0 0 #ffffff; }
.button.primary { background: #3b68e8; border-color: #3b68e8; }
.button.primary:hover { background: #3159d1; border-color: #3159d1; }
.button.subtle { color: #3159d1; background: #edf2ff; }

/* Scheme A shop navigation inside the existing License Hub sidebar. */
#shop-nav-group { display: flex; flex-direction: column; gap: 2px; }
/* Horizontal padding matches .nav-item (12px) so the toggle label aligns with 系统设置 and siblings. */
#shop-nav-group > .shop-nav-toggle { min-height: 48px; padding: 10px 12px; gap: 12px; border-radius: 9px; }
#shop-nav-group > .shop-nav-toggle span { white-space: nowrap; }
#shop-nav-group > .shop-nav-toggle .nav-caret { opacity: .65; }
#shop-nav-group.active-parent > .shop-nav-toggle { color: #dce9f8; background: rgba(87,129,194,.18); }
#shop-nav-sub { gap: 2px; margin-left: 14px; padding-left: 18px; border-left: 1px solid rgba(255,255,255,.08); }
#shop-nav-sub .nav-item { min-height: 48px; margin: 2px 0; padding: 10px 11px; gap: 11px; border-radius: 9px; font-size: 14px; opacity: .88; }
#shop-nav-sub .nav-item.active { color: #fff; background: rgba(59,104,232,.18); box-shadow: 0 5px 14px rgba(0,0,0,.16); }

/* 启动遮罩：body 加 boot-done 后整体消失 */
body.boot-done .boot-mask { display: none !important; }

/* 启动遮罩转圈动画（放在同源 CSS，规避 CSP 对内联 <style> 的限制） */
@keyframes quxiang-boot-spin { to { transform: rotate(360deg); } }

/* 圈像模块挂载盖板：深色风格与启动遮罩一致，遮住模块无样式首帧，挂载成功后由 app.js 移除 */
.quxiang-embedded-shell { position: relative; }
.quxiang-boot-cover { position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: #141a1e; }
.quxiang-boot-card { display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(255,255,255,.92); }
.quxiang-boot-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); border-top-color: #7fd6c8; animation: quxiang-boot-spin 1s linear infinite; }
