/* ==========================================================================
   GIGICLOUD 云控制台门户（Cloudflare 实用工程风）
   硬朗工程灰画布 + 1px 实线白底面板 + 6px 紧凑圆角 + 纯正工程蓝交互
   零背景光斑、零糖果药丸堆砌、零营销口号冗余
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: light;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC",
    "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas,
    monospace;

  /* 浅色控制台工程色板 */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-subtle: #f8f9fb;
  --surface-control: #f1f3f6;
  --row-hover: #f7f9fc;
  --border: #d8dde6;
  --border-strong: #c2c9d6;
  --divider: #e9edf3;
  --scrim: rgba(15, 23, 42, 0.50);

  --text: #111827;
  --text-secondary: #374151;
  --muted: #5b6472;

  /* Cloudflare 实用风工程蓝主色 */
  --primary: #0051c3;
  --primary-hover: #003f9a;
  --primary-soft: #ebf2ff;
  --primary-border: #bfd4fa;
  --primary-text: #0047ab;
  --brand-stripe: #f6821f;

  /* 极简状态点颜色 */
  --dot-live: #10b981;
  --dot-soon: #a95105;
  --dot-hot: #0051c3;

  --radius-panel: 8px;
  --radius-box: 6px;
  --radius-control: 5px;
  --shadow-modal: 0 16px 40px rgba(15, 23, 42, 0.22);
}

/* 深色控制台工程色板 */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1017;
  --surface: #151922;
  --surface-subtle: #1a1f2b;
  --surface-control: #1f2533;
  --row-hover: #1a202d;
  --border: #262c3a;
  --border-strong: #363f52;
  --divider: #202634;
  --scrim: rgba(2, 6, 14, 0.72);

  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --muted: #8b95a7;

  /* 深色工程蓝：主操作保持 AA+ 对比度，边线与指示色采用 #3B82F6 */
  --primary: #2563eb;
  --primary-hover: #245acf;
  --primary-soft: rgba(59, 130, 246, 0.14);
  --primary-border: rgba(59, 130, 246, 0.36);
  --primary-text: #60a5fa;
  --brand-stripe: #f6821f;

  --dot-live: #34d399;
  --dot-soon: #fbbf24;
  --dot-hot: #3b82f6;

  --shadow-modal: 0 20px 56px rgba(0, 0, 0, 0.64);
}

html {
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: clip;
  transition: background-color 160ms ease, color 160ms ease;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
a {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary-hover);
  outline-offset: 2px;
}

.console-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.console-container {
  width: 100%;
  max-width: 1264px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ==========================================================================
   顶部紧凑控制台栏（56px，实色 1px 底边）
   ========================================================================== */
.console-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1264px;
  min-height: 54px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
  flex-shrink: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
}

.brand-bar {
  width: 4px;
  height: 18px;
  border-radius: 1px;
  background: var(--brand-stripe);
  flex-shrink: 0;
}

.brand-fallback-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.brand-mark.has-logo-img {
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--divider);
  background: #ffffff;
}

html[data-theme="dark"] .brand-mark.has-logo-img {
  background: #eef2f7;
  border-color: var(--border-strong);
}

.brand-logo-img {
  display: block;
  height: 20px;
  width: auto;
  max-width: 96px;
  object-fit: contain;
}

.brand-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  flex-shrink: 0;
}

.brand-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* 顶部搜索框 */
.search-wrap {
  position: relative;
  width: 296px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 34px;
  padding: 0 34px 0 31px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--text);
  font-size: 13px;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-soft);
}

.search-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 19px;
  height: 19px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.search-wrap:focus-within .search-kbd,
.search-wrap.has-value .search-kbd {
  opacity: 0;
}

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 0;
  background: var(--surface-control);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-clear[hidden] {
  display: none;
}

.search-clear:hover {
  color: var(--text);
}

/* 三档紧凑主题切换器 */
.theme-seg {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 2px;
  border-radius: var(--radius-control);
  background: var(--surface-control);
  border: 1px solid var(--border);
  gap: 2px;
  flex-shrink: 0;
}

.theme-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  height: 28px;
  padding: 0 9px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}

.theme-btn:hover {
  color: var(--text);
}

.theme-btn.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* 控制台按钮体系 */
.btn-console {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn-console:hover {
  background: var(--surface-subtle);
  border-color: var(--muted);
}

.btn-support {
  height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #ffffff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

/* ==========================================================================
   主体双栏控制台布局（左侧产品树 214px + 右侧主目录工作区）
   ========================================================================== */
.console-layout {
  padding-top: 16px;
  padding-bottom: 18px;
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  flex: 1 0 auto;
}

.console-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 76px;
}

.side-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  overflow: hidden;
}

.side-panel-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.03em;
  padding: 9px 12px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--divider);
}

.cat-tree {
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: var(--radius-control);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  transition: background-color 120ms ease, color 120ms ease;
}

.nav-item:hover {
  background: var(--surface-subtle);
  color: var(--text);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary-hover);
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  flex-shrink: 0;
}

.nav-item.active .nav-count {
  color: var(--primary-text);
}

/* 侧栏控制台信息小面板 */
.info-list {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12.5px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--divider);
}

.info-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.info-row dt {
  color: var(--muted);
  white-space: nowrap;
}

.info-row dd {
  color: var(--text);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.mono-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.status-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.dot-live { background: var(--dot-live); }
.dot-soon { background: var(--dot-soon); }
.dot-hot { background: var(--dot-hot); }

.inline-link {
  color: var(--primary-text);
  text-decoration: none;
  font-weight: 600;
}

.inline-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   右侧主目录工作区
   ========================================================================== */
.console-main {
  min-width: 0;
}

.workspace-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.workspace-title-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.workspace-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.3;
}

.workspace-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.reset-link {
  border: 0;
  background: transparent;
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px;
}

.reset-link:hover {
  text-decoration: underline;
}

.workspace-meta {
  font-size: 12px;
  color: var(--muted);
}

/* 4 列产品目录表 */
.catalog-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
  overflow: hidden;
}

.catalog-head,
.catalog-row {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 152px 206px;
  align-items: center;
  gap: 14px;
  padding-left: 16px;
  padding-right: 16px;
}

.catalog-head {
  padding-top: 8px;
  padding-bottom: 8px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.head-actions {
  text-align: right;
}

.catalog-row {
  padding-top: 11px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--divider);
  transition: background-color 110ms ease;
}

.catalog-row:last-child {
  border-bottom: 0;
}

.catalog-row:hover {
  background: var(--row-hover);
}

/* 第 1 列：产品 / 模块 */
.col-product {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.prod-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-control);
  background: var(--surface-subtle);
  border: 1px solid var(--divider);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.prod-heading {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.prod-name {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
}

.prod-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
}

.prod-domain {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.prod-status-group {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.prod-status-text {
  color: var(--muted);
  white-space: nowrap;
}

.prod-status-text.tone-hot {
  color: var(--primary-text);
  font-weight: 600;
}

.prod-status-text.tone-soon {
  color: var(--dot-soon);
  font-weight: 600;
}

/* 第 2 列：功能与技术规格 */
.col-specs {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prod-desc {
  font-size: 12.5px;
  line-height: 1.48;
  color: var(--text-secondary);
}

.spec-line {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 第 3 列：计费标准 */
.col-pricing {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-val {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.4;
  white-space: nowrap;
}

.price-label {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
  white-space: nowrap;
}

/* 第 4 列：操作入口 */
.col-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
}

.col-actions .btn-console {
  padding: 0 10px;
}

.col-actions a.btn-console {
  min-width: 72px;
}

/* 空态与配置降级错误提示 */
.empty-state,
.config-error {
  padding: 40px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.config-error {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid #dc2626;
  border-radius: var(--radius-box);
}

.empty-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.empty-desc {
  font-size: 13px;
  color: var(--muted);
  max-width: 440px;
}

.empty-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* ==========================================================================
   页脚
   ========================================================================== */
.console-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-inner {
  padding-top: 14px;
  padding-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}

.footer-left,
.footer-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.footer-left strong {
  color: var(--text);
  font-weight: 700;
}

.footer-sep {
  opacity: 0.45;
}

/* ==========================================================================
   控制台风格详情弹窗（8px 圆角 + 1px 边框 + 等宽对比表）
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--scrim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 150ms ease;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop.open {
  opacity: 1;
}

.modal-panel {
  width: 100%;
  max-width: 720px;
  max-height: min(86dvh, 740px);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(8px);
  opacity: 0;
  transition: transform 170ms ease-out, opacity 150ms ease;
}

.modal-backdrop.open .modal-panel {
  transform: translateY(0);
  opacity: 1;
}

.modal-header {
  padding: 14px 18px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-heading {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--surface-control);
  color: var(--text);
}

.modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.modal-specs {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface-subtle);
  border: 1px solid var(--divider);
  border-radius: var(--radius-control);
  padding: 8px 12px;
  line-height: 1.55;
}

.modal-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-box);
}

.modal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.5;
}

.modal-table th,
.modal-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--divider);
  text-align: left;
  vertical-align: top;
}

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

.modal-table th {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-subtle);
  white-space: nowrap;
}

.modal-table td {
  color: var(--text-secondary);
}

.modal-table td:first-child {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.modal-table td.cell-nowrap {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.modal-table td.cell-price {
  font-weight: 600;
  color: var(--text);
}

.modal-footer {
  padding: 12px 18px;
  background: var(--surface-subtle);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.modal-price {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.modal-actions .btn-console {
  height: 32px;
  padding: 0 13px;
}

/* ==========================================================================
   响应式适配：平板（<= 960px / 820px）与移动端（<= 720px / 640px）
   ========================================================================== */
@media (max-width: 1180px) {
  .catalog-row {
    padding-block: 10px;
  }

  .console-layout {
    grid-template-columns: 184px minmax(0, 1fr);
    gap: 14px;
  }

  .catalog-head,
  .catalog-row {
    grid-template-columns: 188px minmax(0, 1fr) 136px 198px;
    gap: 12px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .col-actions .btn-console {
    padding: 0 8px;
  }

  .col-actions a.btn-console {
    min-width: 68px;
  }

  .spec-line,
  .price-val,
  .price-label {
    white-space: normal;
  }
}

@media (max-width: 1023px) {
  .catalog-head,
  .catalog-row {
    grid-template-columns: 184px minmax(0, 1fr) 130px 142px;
    gap: 12px;
  }

  .col-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 960px) {
  .catalog-head {
    display: none;
  }

  .catalog-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .prod-name,
  .prod-meta,
  .spec-line,
  .price-val,
  .price-label {
    white-space: normal;
  }

  .col-pricing {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--divider);
  }

  .col-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .col-actions .btn-console {
    height: 34px;
    padding: 0 12px;
  }
}

@media (max-width: 820px) {
  .console-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding-top: 14px;
  }

  .console-sidebar {
    position: static;
    gap: 10px;
  }

  .side-nav .side-panel-title {
    display: none;
  }

  .cat-tree {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 5px;
    gap: 4px;
  }

  .cat-tree::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    width: auto;
    flex-shrink: 0;
    padding: 6px 10px;
    gap: 6px;
  }

  .nav-item.active {
    box-shadow: inset 0 -2px 0 var(--primary-hover);
  }

  .side-info {
    display: none;
  }

  .topbar-inner {
    flex-wrap: wrap;
    row-gap: 8px;
  }

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

  .search-wrap {
    flex: 1 1 180px;
    width: auto;
  }
}

@media (max-width: 720px) {
  .console-container,
  .topbar-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand-sep,
  .brand-sub {
    display: none;
  }

  .topbar-right {
    flex-wrap: wrap;
    gap: 8px;
  }

  .search-wrap {
    order: 3;
    flex: 1 0 100%;
  }

  .search-kbd {
    display: none;
  }

  .catalog-head {
    display: none;
  }

  .catalog-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .prod-name,
  .prod-meta,
  .spec-line,
  .price-val,
  .price-label {
    white-space: normal;
  }

  .col-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .col-pricing {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px dashed var(--divider);
  }

  .col-actions .btn-console {
    flex: 1 1 auto;
    height: 36px;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: flex-end;
  }

  .modal-panel {
    max-height: 88dvh;
  }

  .modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-actions {
    width: 100%;
  }

  .modal-actions .btn-console {
    flex: 1 1 auto;
    height: 38px;
  }
}

/* 无障碍动态偏好 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .modal-panel {
    transform: none !important;
  }
}
