/* Shared console tokens and components. The base sheet retains page-specific
   editor/USB behavior; this layer supplies the management system's visual rules. */
:root {
  --nav-width: 244px;
  --green: #2563eb;
  --accent: #245fe0;
  --line: #e1e7ef;
  --muted: #65758b;
  --gold: #83b8ff;
  --red: #c23e49;
  --shadow: 0 8px 30px #1731510c;
  --canvas: #f3f6fa;
  --surface: #fff;
  --ink: #17263d;
  --nav-bg: #101c30;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  font-synthesis: none;
}
body { background: var(--canvas); color: var(--ink); }
button, .button-link { min-height: 38px; border-radius: 7px; font-weight: 500; color: #33445e; }
button:hover, .button-link:hover { background: #f2f6ff; border-color: #b9cbed; color: #1b4fbf; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #83b6ff; outline-offset: 3px; }
button:disabled { opacity: .6; }
.primary { background: #2563eb; border-color: #2563eb; color: #fff; box-shadow: 0 2px 4px #2563eb18; }
.primary:hover { background: #1d50ca; border-color: #1d50ca; color: #fff; }
.danger { color: var(--red); border-color: #efcbd1; }
.small { min-height: 32px; padding: 6px 10px; }
.link { min-height: 30px; color: var(--accent); box-shadow: none; }
.link:hover { background: #edf3ff; }
.shell { grid-template-columns: var(--nav-width) minmax(0,1fr); }
.sidebar { width: var(--nav-width); background: var(--nav-bg); color: #d5e1f4; padding: 24px 14px 18px; border-right: 1px solid #ffffff08; }
.brand { padding: 0 12px 24px; gap: 12px; border-bottom-color: #ffffff10; }
.brand-mark { width: 38px; height: 38px; border: 1px solid #6ca4ff40; border-radius: 10px; background: #2c63ca20; color: #88b9ff; }
.brand-mark .icon, .brand-mark svg { width: 22px; height: 22px; }
.brand strong { font-size: 22px; line-height: 1.3; font-weight: 600; font-family: inherit; letter-spacing: 2px; color: #f0f6ff; }
.brand small { font-size: 9px; color: #8c9eb8; letter-spacing: 1.6px; }
.nav { padding-top: 18px; scrollbar-width: thin; scrollbar-color: #34445d transparent; }
.nav a, .nav-section summary { min-height: 40px; color: #b6c5dd; font-size: 13px; border-radius: 7px; padding: 10px 12px; }
.nav a:hover, .nav-section summary:hover { color: #fff; background: #ffffff07; }
.nav a.active { background: #244f873f; color: #e1efff; box-shadow: inset 3px 0 #659cff; }
.nav-section { margin: 5px 0; }
.nav-section summary { font-weight: 500; gap: 12px; }
.nav-section summary .icon { color: #8b9fbe; }
.nav-section.active-group > summary { color: #eef5ff; }
.nav-section.active-group > summary .icon { color: #8bbaff; }
.nav-chevron { color: #7087a7; }
.nav-children { margin: 1px 0 9px 21px; padding-left: 10px; border-color: #ffffff10; }
.nav-children a { min-height: 36px; font-size: 12px; padding: 8px 12px; margin: 2px 0; }
.sidebar-foot { border-color: #ffffff10; color: #8c9fb9; font-size: 11px; }
.dot { background: #3ed1ae; box-shadow: 0 0 0 3px #3ed1ae12; }
.sidebar-backdrop { left: var(--nav-width); }
.workspace { min-width: 0; }
.topbar { min-height: 68px; height: 68px; padding: 0 32px; background: #ffffffed; border-color: var(--line); }
.breadcrumb { color: #6d7b90; font-size: 12px; }
.breadcrumb span { color: #24354d; }
.topbar-right { gap: 16px; }
.avatar { background: #edf3ff; color: #2f62c8; border: 1px solid #dfe8fc; border-radius: 9px; }
.account .name { color: #334663; font-weight: 500; }
.account .role, .date-label { color: var(--muted); }
.content { max-width: 1760px; padding: 30px 32px 40px; }
.page-heading { align-items: flex-start; gap: 24px; margin-bottom: 24px; }
.eyebrow { color: #4874bf; font-weight: 600; letter-spacing: 1.5px; margin-bottom: 7px; }
h1 { font-size: 27px; line-height: 1.35; font-weight: 650; color: #17263d; letter-spacing: -.4px; }
h2 { color: #25364f; font-size: 15px; line-height: 1.5; }
h3 { color: #334765; }
.page-description { font-size: 13px; line-height: 1.7; color: var(--muted); margin-top: 7px; }
.actions { padding-top: 7px; }
.panel { border-color: var(--line); border-radius: 10px; background: var(--surface); padding: 24px; box-shadow: 0 2px 6px #132a4803; margin-bottom: 20px; }
.panel-head { margin-bottom: 20px; gap: 16px; }
.subtle { color: var(--muted); font-size: 12px; line-height: 1.7; }
.metrics { gap: 18px; margin-bottom: 20px; }
.metric { padding: 22px; border-color: var(--line); border-radius: 10px; background: #fff; }
.metric:first-child { background: #1b386c; border-color: #1b386c; }
.metric-top { color: #667992; font-size: 12px; }
.metric-value { font-size: 32px; letter-spacing: -.8px; color: #172b4d; }
.metric:first-child .metric-value { color: #f5f9ff; }
.metric:first-child .metric-top, .metric:first-child .metric-bottom { color: #ccdcf5; }
.metric:first-child .icon { color: #a9cbff; }
.metric-icon { background: #edf3ff; color: #3467c9; }
.metric-bottom, .metric-value small { color: #687b96; }
.metric:first-child .metric-value small { color: #ccdcf5; }
.metric-link:hover { border-color: #a3bff0; box-shadow: 0 4px 16px #244d8d08; }
.two-column { grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); gap: 20px; }
.three-column { gap: 18px; }
.chart-label { fill: #657991; font-size: 11px; }
.chart-grid { stroke: #e8eef6; }
.chart rect { fill: #5c8dec; }
.legend { color: #657991; }
.legend:before { background: #5c8dec; }
.status-row { border-color: #edf0f5; font-size: 13px; min-height: 46px; padding: 12px 0; }
.status-symbol { background: #edf3ff; color: #4875c4; }
.status-row strong { color: #253b5b; font-weight: 500; }
.badge { border-radius: 5px; min-height: 24px; padding: 3px 8px; font-size: 11px; font-weight: 500; }
.badge.good { background: #eaf7f0; color: #177451; }
.badge.warning { background: #fff5de; color: #956315; }
.badge.bad { background: #fff0f1; color: #ba3e4e; }
.badge.neutral { background: #edf1f7; color: #5f718a; }
.toolbar { align-items: center; gap: 10px; margin-bottom: 20px; }
.toolbar input, .toolbar select { flex: 1 1 180px; width: auto; max-width: 290px; min-width: 150px; min-height: 40px; height: 40px; font-size: 13px; }
.toolbar button { flex: 0 0 auto; min-height: 40px; }
.table-wrap { margin: 0 -24px; scrollbar-width: thin; scrollbar-color: #c6d2e4 transparent; }
table { font-size: 13px; }
th { padding: 13px 20px; background: #f7f9fc; color: #65758c; font-size: 12px; font-weight: 500; border-color: var(--line); }
td { padding: 16px 20px; color: #465b77; border-color: #edf1f6; }
tbody tr:hover { background: #f8faff; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; font-variant-numeric: tabular-nums; }
.cell-title { color: #283d5b; font-weight: 500; }
.cell-secondary { color: #6d7f97; font-size: 11px; line-height: 1.6; }
.pagination { color: #687c96; font-size: 12px; flex-wrap: wrap; gap: 12px; }
.empty { color: #788ba5; padding: 44px 20px; }
.empty .icon { background: #edf3ff; color: #789bcf; }
.empty strong { color: #4e6584; font-size: 14px; }
.empty p { font-size: 12px; }
.notice { border-color: #dfe8f6; background: #f1f6ff; color: #4b668e; border-radius: 8px; font-size: 12px; padding: 13px 16px; line-height: 1.75; }
.notice.warning { background: #fff9ec; color: #916126; border-color: #f3e4c1; }
.notice.error { background: #fff2f3; color: #ae3e50; border-color: #f1d5da; }
.form-grid { gap: 20px; }
.field { gap: 8px; font-size: 13px; min-width: 0; }
.field label { color: #4e627f; font-size: 12px; font-weight: 500; line-height: 18px; }
input, select, textarea { border-color: #d8e1ee; border-radius: 6px; background: #fff; color: #263e5e; padding: 10px 12px; font-size: 13px; line-height: 20px; }
input, select { min-height: 42px; }
input::placeholder, textarea::placeholder { color: #8a98ac; opacity: 1; }
input:focus, select:focus, textarea:focus { border-color: #6c9af0; outline: 3px solid #dce9ff; }
input:disabled, select:disabled, textarea:disabled { background: #f7f9fc; color: #61758f; border-color: #e4eaf3; opacity: 1; cursor: not-allowed; }
input[type=checkbox] { min-height: 17px; accent-color: #2563eb; }
.form-hint { font-size: 11px; line-height: 18px; color: #71829a; }
.form-footer { margin-top: 22px; gap: 10px; }
.section-divider { border-color: var(--line); }
.section-tabs { background: #eaf0f8; padding: 4px; border: 1px solid #dfe7f2; border-radius: 8px; }
.section-tabs a { color: #5d718d; font-size: 13px; border-radius: 5px; padding: 8px 14px; }
.section-tabs a[aria-current=page] { background: #fff; color: #2459b8; box-shadow: 0 1px 5px #193c7012; }
.section-tabs a:hover { background: #f7faff; }
.tabs button { background: #f0f4fa; color: #617594; }
.tabs button.active { color: #245ed0; background: #eaf1ff; border-color: #cadbfb; }
.editor-list { border-color: var(--line); }
.editor-list button.selected { background: #edf3ff; color: #255bc0; }
.line-editor { background: #fafcff; border-color: var(--line); }
.line-editor .line-label, .detail-label, .timeline-meta { color: #657b99; font-size: 12px; }
.json { background: #f6f9fe; color: #365172; border-color: #e1e8f2; }
.detail-value { font-size: 13px; color: #304762; }
.timeline { border-color: #dbe6f6; }
dialog { border-color: #dbe4f1; border-radius: 12px; color: var(--ink); box-shadow: 0 24px 90px #0f27482e; }
dialog::backdrop { background: #0f1e3866; }
.dialog-header, .dialog-body { padding: 22px 26px; }
#toast { background: #183763; border-radius: 8px; }
#toast.error { background: #af3b4d; }
.action-card { border-color: var(--line); border-radius: 8px; padding: 16px; }
.action-card .icon { color: #4f7dc9; }
.action-card strong { font-size: 13px; color: #324b70; }
.action-card small { font-size: 11px; color: #73869f; }
.action-card .arrow { color: #7692b8; }
.upload-zone { background: #f6f9ff; border-color: #b9cdee; }
.footer-note { color: #73849d; font-size: 11px; letter-spacing: .2px; }
.activation-code-full { color: #2457a9; }
.membership-fields h3, .plan-comparison th:nth-child(3) { color: #2f63b7; }
.usb-help, .usb-identity span, .usb-identity small { color: #687d99; }
.usb-log { background: #f4f7fc; color: #405b7c; border-color: var(--line); }
#usb-flasher progress { accent-color: #3978ed; }
.usb-error { color: #b43f4c; }
.login-art { background: #101c30; color: #f2f7ff; background-image: linear-gradient(#8aaeff08 1px,transparent 1px),linear-gradient(90deg,#8aaeff08 1px,transparent 1px); background-size: 44px 44px; }
.login-art:after { border-color: #7caeff30; box-shadow: 0 0 0 70px #5c93ed07,0 0 0 140px #5c93ed04; }
.login-word, .login-copy h1 { font-family: inherit; font-weight: 500; }
.login-copy p, .login-footer { color: #9fb1cd; }
.boot { color: #617895; }

/* Equal semantic rows keep provider forms aligned, including optional metadata. */
.console-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 12px 16px; margin-bottom: 20px; }
.console-notice strong { color: #2b568d; font-size: 12px; }
.console-notice span { flex: 1 1 450px; }
.qwen-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); align-items: stretch; gap: 20px; }
.settings-card { margin: 0; padding: 22px; display: flex; flex-direction: column; min-width: 0; }
.settings-card-header { display: flex; align-items: center; gap: 11px; min-height: 40px; }
.settings-card-icon { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #dce8fc; background: #edf4ff; color: #3976db; border-radius: 9px; flex: 0 0 36px; }
.settings-card-title { flex: 1; min-width: 0; }
.settings-card-title h2 { font-size: 16px; margin: 0; line-height: 23px; }
.settings-card-code { display: block; font: 9px/16px Consolas,monospace; letter-spacing: .6px; color: #7890b0; }
.settings-card-header .badge { margin-left: auto; }
.settings-card-description { font-size: 12px; line-height: 20px; color: #687c97; min-height: 40px; margin: 14px 0 8px; }
.settings-card-summary { margin-bottom: 18px; }
.provider-model-row, .provider-key-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; border-bottom: 1px solid #edf1f7; font-size: 12px; color: #657995; }
.provider-model-row { min-height: 60px; }
.provider-model-row > div { text-align: right; }
.provider-model-row strong { display: block; color: #29446b; font-weight: 500; }
.provider-model-row small { display: block; min-height: 18px; font-size: 10px; line-height: 18px; color: #6d85a6; }
.provider-key-row { min-height: 42px; }
.provider-key-row strong { color: #357562; font-size: 11px; font-weight: 500; }
.settings-form { display: flex; flex: 1; }
.settings-form > .qwen-fields { display: flex; flex-direction: column; flex: 1; gap: 16px; width: 100%; }
.settings-form .qwen-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
.settings-form [data-qwen-custom] { display: grid; gap: 16px; }
.settings-form .qwen-fields .field { margin: 0; }
.settings-form .form-hint { min-height: 18px; font-size: 10px; white-space: nowrap; letter-spacing: -.1px; }
.settings-form .form-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid #edf1f7; }
.settings-form .primary { width: 100%; min-height: 40px; }
.settings-card-footer { font-size: 10px; line-height: 18px; color: #7a8ca5; margin-top: 12px; }
.console-help { border: 1px solid var(--line); background: #f9fbfe; padding: 14px 18px; border-radius: 8px; margin-top: 20px; color: #637895; font-size: 12px; line-height: 1.8; }
.console-help summary { color: #4f6a91; font-weight: 500; cursor: pointer; }
.console-help p { margin: 10px 0; }

@media(max-width:1399px) { .qwen-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:1100px) { .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); } .two-column { grid-template-columns: minmax(0,1fr); } .content { padding: 28px; } .topbar { padding-inline: 28px; } }
@media(max-width:760px) {
  .shell { grid-template-columns: minmax(0,1fr); }
  .workspace { grid-column: 1; }
  .sidebar { width: var(--nav-width); }
  .sidebar-backdrop { left: var(--nav-width); background: #101c3066; }
  .topbar { min-height: 62px; height: 62px; padding: 0 18px; }
  .content { padding: 24px 16px 30px; }
  h1 { font-size: 24px; }
  .page-heading { gap: 12px; margin-bottom: 20px; }
  .actions { padding-top: 0; }
  .panel { padding: 20px 16px; }
  .table-wrap { margin: 0 -16px; }
  .qwen-grid, .form-grid, .detail-grid, .three-column { grid-template-columns: minmax(0,1fr); }
  .qwen-grid { gap: 16px; }
  .settings-card { padding: 20px; }
  .settings-card-description { min-height: 0; }
  .settings-form .form-hint { white-space: normal; }
  .toolbar { gap: 8px; }
  .toolbar input, .toolbar select { max-width: none; }
  .console-notice { gap: 3px; }
  .topbar-right { gap: 8px; }
  .section-tabs { width: 100%; }
  .dialog-header, .dialog-body { padding: 20px; }
  .login-main { padding: 28px; }
}
@media(prefers-reduced-motion:reduce) { *, *:before, *:after { scroll-behavior: auto!important; transition-duration: .01ms!important; animation-duration: .01ms!important; } }
