/* ============================================================
   QMT Bridge Site — Feihong Design System 主题层
   基于 Feihong Design System v8.0 (DNA.md) · 三色基因：
   皇家蓝 #0A2463 (55%) · 复古金 #F4D35E (30%) · 酒红 #D8315B (15%)
   暖米白 #FDFBF6 底 · 墨黑 #0D1225 字 · 衬线+无衬线混搭
   保留原有类名/变量名，全站模板自动继承新视觉。
   ============================================================ */

:root {
  /* === 品牌三色基因 === */
  --royal: #0A2463;
  --royal-50: #F0F4FA;
  --royal-100: #B8C9EB;
  --royal-600: #0F3480;
  --royal-700: #081C4F;
  --royal-800: #061842;
  --royal-900: #040F2A;

  --gold: #F4D35E;
  --gold-300: #FAECB8;
  --gold-500: #F4D35E;
  --gold-600: #DDB835;
  --gold-700: #B8951F;
  --gold-800: #8F7018;

  --wine: #D8315B;
  --wine-600: #B02448;
  --wine-700: #851A36;

  /* === 暖调中性色 === */
  --cream: #FDFBF6;
  --cream-100: #F8F4EB;
  --cream-200: #F0EAD9;
  --surface: #F7F8FA;
  --ink: #0D1225;
  --ink-200: #3D4358;
  --ink-300: #6B7288;
  --ink-400: #9CA3B5;
  --border: #D8DCE8;
  --divider: #E8EAF0;

  /* === 语义功能色 === */
  --success: #2D9B5E;
  --warning: #E6A23C;
  --error: #D8315B;
  --info: #0A2463;
  --terminal: #4ADE80;

  /* === 字体 === */
  --font-serif: 'Playfair Display', 'Noto Serif SC', 'Songti SC', Georgia, serif;
  --font-display: 'Cormorant Garamond', 'Noto Serif SC', Georgia, serif;
  --font-sans: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* === 阴影（蓝色调，非黑色） === */
  --shadow-sm: 0 2px 8px rgba(10, 36, 99, 0.06);
  --shadow-md: 0 8px 24px rgba(10, 36, 99, 0.08);
  --shadow-lg: 0 16px 48px rgba(10, 36, 99, 0.12);
  --shadow-gold: 0 8px 24px rgba(244, 211, 94, 0.22);
  --shadow-wine: 0 8px 24px rgba(216, 49, 91, 0.18);

  /* === 圆角 === */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* === 动效 === */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 200ms var(--ease);
  --t-base: 350ms var(--ease);

  /* === 兼容旧变量名（映射到新色板，模板内联引用自动生效） === */
  --bg-primary: var(--cream);
  --bg-card: #FFFFFF;
  --border-subtle: var(--border);
  --border-hover: var(--royal-100);
  --text-primary: var(--ink);
  --text-secondary: var(--ink-300);
  --accent-1: var(--royal);     /* 皇家蓝（原 indigo） */
  --accent-2: var(--gold-700);  /* 深金（原 purple，浅底可读） */
  --accent-3: var(--wine);      /* 酒红（原 violet） */
}

/* ============================================================
   基础重置
   ============================================================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 暖色径向渐变底纹，制造层次而非纯平色 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 88% -5%, rgba(244, 211, 94, 0.10), transparent 42%),
    radial-gradient(circle at 5% 0%, rgba(10, 36, 99, 0.05), transparent 38%);
  pointer-events: none;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-serif); color: var(--ink); letter-spacing: -0.01em; }
h1 { font-weight: 900; letter-spacing: -0.025em; }
h2, h3 { font-weight: 700; }
h4, h5, h6 { font-weight: 600; }

a { color: var(--royal); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--wine); }

::selection { background: var(--gold); color: var(--royal); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--cream-100); }
::-webkit-scrollbar-thumb { background: var(--royal-100); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--royal); }

/* 焦点可见（金色描边） */
:focus-visible { outline: 2.5px solid var(--gold-600); outline-offset: 2px; border-radius: 2px; }

/* ============================================================
   排版工具类（Feihong 签名细节）
   ============================================================ */
.serif { font-family: var(--font-serif); }
.italic { font-family: var(--font-display); font-style: italic; }

/* 眉标：全大写、宽字距 */
.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-700);
}

/* 金色装饰线（标题下方签名细节，长度约 1/3） */
.gold-rule {
  display: block;
  width: 56px;
  height: 2px;
  background: var(--gold);
  border: 0;
  margin: 0;
}
.gold-rule.center { margin-left: auto; margin-right: auto; }
.gold-rule.wide { width: 96px; }

/* 装饰性大数字/大英文（视觉锚点） */
.numeral {
  font-family: var(--font-serif);
  font-weight: 900;
  color: var(--royal);
  opacity: 0.07;
  line-height: 1;
  letter-spacing: -0.04em;
}

/* ============================================================
   卡片 —— .glass 由玻璃拟态改为实体品牌卡片
   ============================================================ */
.glass {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: none;
}

.glass-hover { transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base); }
.glass-hover:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: var(--shadow-lg);
}

/* 深色面板（打破浅色节奏，金/酒红在其上表现最佳） */
.panel-dark {
  background: linear-gradient(135deg, var(--royal-900), var(--royal-700));
  color: #E8EAF0;
  border: 1px solid var(--royal-800);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
}
.panel-dark h1, .panel-dark h2, .panel-dark h3, .panel-dark h4, .panel-dark h5, .panel-dark h6 { color: #FFFFFF; }
.panel-dark .text-secondary { color: var(--gold-300) !important; }

/* ============================================================
   导航栏 —— 皇家蓝实体，金色品牌点缀
   ============================================================ */
.navbar-blur {
  padding: clamp(0.35rem, 0.3rem + 0.15vw, 0.5rem) 0;
  background: linear-gradient(135deg, var(--royal), var(--royal-700));
  border-bottom: 0.125rem solid var(--gold);
  backdrop-filter: none;
  box-shadow: 0 0.25rem 1.25rem rgba(10, 36, 99, 0.18);
}
.navbar-blur .site-header__inner,
.navbar-blur .site-header__brand,
.navbar-blur .brand-lockup,
.navbar-blur .site-header__nav { min-width: 0; }
.navbar-blur .site-header__brand {
  margin-right: clamp(1rem, 2vw, 2rem);
  padding: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.05rem, 1rem + 0.15vw, 1.2rem);
  letter-spacing: 0.01em;
  color: #FFFFFF;
}
.navbar-blur .brand-lockup { gap: 0.45em; }
.navbar-blur .navbar-brand .text-accent { color: var(--gold) !important; }
.navbar-blur .navbar-brand .brand-mark {
  width: 1.2em;
  height: 1.2em;
}
.site-header__title,
.site-header__username {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.navbar-blur .site-header__menu { gap: 0.125rem; }
.navbar-blur .nav-link {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 0.55em 0.72em;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
  font-size: clamp(0.82rem, 0.79rem + 0.08vw, 0.91rem);
  line-height: 1.25;
  position: relative;
  transition: color var(--t-fast), background-color var(--t-fast);
}
.navbar-blur .nav-link .icon,
.navbar-blur .dropdown-item .icon {
  width: 0.95em;
  height: 0.95em;
}
.navbar-blur .nav-link:hover,
.navbar-blur .nav-link:focus,
.navbar-blur .nav-link.active { color: var(--gold); }
.navbar-blur .nav-link:not(.dropdown-toggle)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0.12em;
  width: 0;
  height: 0.1rem;
  background: var(--gold);
  transition: width var(--t-fast), left var(--t-fast);
}
.navbar-blur .nav-link:not(.dropdown-toggle):hover::after,
.navbar-blur .nav-link.active:not(.dropdown-toggle)::after { width: 60%; left: 20%; }
.navbar-blur .dropdown-toggle { max-width: 13rem; }
.navbar-blur .dropdown-toggle::after { flex: 0 0 auto; margin-left: 0.45em; }
.navbar-blur .site-header__cta-item { margin-left: 0.4rem; }
.navbar-blur .site-header__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5em 0.9em;
  font-size: clamp(0.82rem, 0.79rem + 0.08vw, 0.91rem);
  line-height: 1.25;
}
.navbar-blur .site-header__cta .icon { width: 0.95em; height: 0.95em; }
.navbar-blur .navbar-toggler-icon { display: none; }

/* 下拉菜单（用户菜单） */
.navbar-blur .dropdown-menu {
  background: #FFFFFF;
  border: 0.0625rem solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 0.4rem;
  font-size: 0.9rem;
}
.navbar-blur .dropdown-item {
  display: flex;
  align-items: center;
  color: var(--ink-200);
  border-radius: var(--r-sm);
  padding: 0.55em 0.9em;
}
.navbar-blur .dropdown-item:hover { background: var(--royal-50); color: var(--royal); }

/* ============================================================
   按钮
   ============================================================ */
.btn { font-family: var(--font-sans); font-weight: 500; border-radius: var(--r-md); transition: all var(--t-fast); }

/* 主行动按钮 —— 酒红 CTA（最高优先级） */
.btn-accent {
  background: var(--wine);
  border: 1.5px solid var(--wine);
  color: #FFFFFF;
  box-shadow: var(--shadow-wine);
}
.btn-accent:hover, .btn-accent:focus {
  background: var(--wine-600);
  border-color: var(--wine-600);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(216, 49, 91, 0.32);
}

/* 描边按钮 —— 皇家蓝，低调次要 */
.btn-outline-subtle {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--royal);
  font-weight: 500;
}
.btn-outline-subtle:hover, .btn-outline-subtle:focus {
  background: var(--royal);
  border-color: var(--royal);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* 金色按钮（强调/高亮） */
.btn-gold {
  background: var(--gold);
  border: 1.5px solid var(--gold);
  color: var(--royal);
  font-weight: 600;
}
.btn-gold:hover { background: var(--gold-600); border-color: var(--gold-600); color: #FFFFFF; transform: translateY(-1px); }

/* 皇家蓝主按钮 */
.btn-royal {
  background: var(--royal);
  border: 1.5px solid var(--royal);
  color: #FFFFFF;
  box-shadow: var(--shadow-md);
}
.btn-royal:hover { background: var(--royal-700); border-color: var(--royal-700); color: #FFFFFF; transform: translateY(-1px); }

/* ============================================================
   文字强调 —— 实体色，禁用渐变文字
   ============================================================ */
.text-accent {
  background: none;
  -webkit-text-fill-color: initial;
  color: var(--royal);
}
.text-gold { color: var(--gold-700); }
.text-wine { color: var(--wine); }
.text-secondary { color: var(--ink-300) !important; }

/* ============================================================
   徽章 / 标签
   ============================================================ */
.badge-accent {
  background: var(--royal);
  color: #FFFFFF;
  border-radius: var(--r-sm);
}
.badge { font-weight: 500; letter-spacing: 0.02em; }

/* 语义徽章（模板内联使用） */
.badge-success { background: rgba(45, 155, 94, 0.12); color: var(--success); }
.badge-wine    { background: rgba(216, 49, 91, 0.10); color: var(--wine); }
.badge-royal   { background: rgba(10, 36, 99, 0.08); color: var(--royal); }
.badge-gold    { background: var(--gold); color: var(--royal); }
.badge-muted   { background: var(--surface); color: var(--ink-300); border: 1px solid var(--border); }

/* 编号徽章（衬线斜体，金线皇家蓝字） */
.number-badge {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: transparent;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--royal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.number-badge.solid { background: var(--royal); border-color: var(--royal); color: var(--gold); }

/* 圆点指示器 */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.5rem; }
.dot-gold { background: var(--gold); }
.dot-royal { background: var(--royal); }
.dot-wine { background: var(--wine); }

/* ============================================================
   表格
   ============================================================ */
.table-glow {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-striped-bg: var(--cream-100);
  margin: 0;
}
.table-glow thead th {
  background: var(--royal);
  color: var(--gold-300);
  border: none;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 0.85rem 1rem;
  white-space: nowrap;
}
.table-glow thead th:first-child { border-top-left-radius: var(--r-md); }
.table-glow thead th:last-child { border-top-right-radius: var(--r-md); }
.table-glow td {
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
  padding: 0.8rem 1rem;
  color: var(--ink-200);
}
.table-glow tbody tr { transition: background var(--t-fast); }
.table-glow tbody tr:hover { background: var(--royal-50); }
.table-glow tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   表单
   ============================================================ */
.form-control, .form-select {
  background: #FFFFFF;
  border: 1.5px solid var(--border);
  color: var(--ink);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-control:focus, .form-select:focus {
  background: #FFFFFF;
  border-color: var(--royal);
  box-shadow: 0 0 0 3px rgba(10, 36, 99, 0.12);
  color: var(--ink);
}
.form-control::placeholder { color: var(--ink-400); }
.form-label { color: var(--ink-200); font-weight: 500; }

/* ============================================================
   代码 / 终端（深色面板，允许深色）
   ============================================================ */
pre, .terminal {
  background: var(--ink);
  color: #D8DCE8;
  border: 1px solid var(--royal-900);
  border-radius: var(--r-md);
  padding: 1rem 1.15rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.65;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}
pre code, .terminal code { color: inherit; background: none; padding: 0; }

code {
  font-family: var(--font-mono);
  background: var(--royal-50);
  color: var(--royal);
  padding: 0.12rem 0.4rem;
  border-radius: var(--r-sm);
  font-size: 0.85em;
}
.panel-dark code, .terminal code, pre code { background: rgba(244, 211, 94, 0.12); color: var(--gold-300); }

/* 终端窗口头部（三点 + 标题） */
.terminal-window { border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-md); border: 1px solid var(--royal-900); }
.terminal-bar {
  background: var(--royal-900);
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-400);
}
.terminal-bar::before,
.terminal-bar::after,
.terminal-bar .tdot {
  content: ""; width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.terminal-bar { }
.terminal-bar .tdot { background: var(--gold); }
.terminal-window pre { border: none; border-radius: 0; margin: 0; box-shadow: none; }

/* ============================================================
   Hero / 页面区
   ============================================================ */
.hero-section { padding: clamp(3rem, 8vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem); }
.page-section { padding: clamp(1.5rem, 3vw, 2.5rem) 0; }

.section-title {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ============================================================
   页脚
   ============================================================ */
.footer {
  border-top: 0.125rem solid var(--gold);
  background: linear-gradient(135deg, var(--royal), var(--royal-700));
  color: rgba(255, 255, 255, 0.72);
  padding: clamp(1.15rem, 1rem + 0.5vw, 1.55rem) 0;
  margin-top: clamp(2.5rem, 2rem + 2vw, 4rem);
}
.footer .footer__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.8rem, 0.65rem + 0.45vw, 1.2rem);
  min-width: 0;
}
.footer .footer__brand { min-width: 0; }
.footer .footer__brand-lockup {
  gap: 0.42em;
  color: var(--gold) !important;
  font-size: clamp(0.95rem, 0.91rem + 0.12vw, 1.05rem);
  white-space: nowrap;
}
.footer .footer__brand-lockup .icon {
  width: 1.05em;
  height: 1.05em;
}
.footer .footer__meta {
  color: rgba(255, 255, 255, 0.68);
  font-size: clamp(0.72rem, 0.69rem + 0.08vw, 0.78rem);
  line-height: 1.5;
  white-space: nowrap;
}
.footer a { color: var(--gold-300); }
.footer a:hover { color: var(--gold); }

/* ============================================================
   Flash 消息（Feihong 语义色）
   ============================================================ */
.flash-message { animation: slideDown 0.35s var(--ease); border-radius: var(--r-md) !important; border: 1px solid var(--border) !important; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.alert-success { background: rgba(45, 155, 94, 0.10); border-color: rgba(45, 155, 94, 0.25) !important; color: var(--success); }
.alert-danger  { background: rgba(216, 49, 91, 0.08); border-color: rgba(216, 49, 91, 0.25) !important; color: var(--wine-600); }
.alert-warning { background: rgba(230, 162, 60, 0.10); border-color: rgba(230, 162, 60, 0.25) !important; color: var(--warning); }
.alert-info    { background: var(--royal-50); border-color: var(--royal-100) !important; color: var(--royal); }

/* ============================================================
   滚动揭示（轻、慢、克制）
   ============================================================ */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 600px) {
  .hero-section { padding: 2.5rem 0 2rem; }
  .numeral { display: none; }
}

/* ============================================================
   无障碍：减弱动效
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* 打印 */
@media print {
  body::before, .navbar, .footer { display: none; }
  body { background: #FFFFFF; }
}

/* ============================================================
   增强层：导航激活态 / 签名组件 / 页头一致性
   ============================================================ */
/* 页头：标题 + 金色装饰线（全站一致节奏） */
.page-header { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.page-header h1, .page-header h2, .page-header h3, .page-header h4, .page-header h5 { margin: 0; }
.page-header .gold-rule { width: 48px; flex-shrink: 0; }

/* 首字下沉（签名组件 · 编辑质感） */
.drop-cap::first-letter {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 3.4rem;
  line-height: 0.82;
  float: left;
  margin: 0.18rem 0.6rem 0 0;
  color: var(--wine);
}

/* 花饰分隔（签名组件 · ❦） */
.fleuron {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--gold);
  letter-spacing: 0.3em;
  line-height: 1;
}
.footer .footer__fleuron {
  display: inline-flex;
  align-items: center;
  color: var(--gold);
  font-size: clamp(0.8rem, 0.76rem + 0.1vw, 0.9rem);
  letter-spacing: 0;
  opacity: 0.6;
}
.footer .footer__fleuron::before,
.footer .footer__fleuron::after {
  content: "";
  width: clamp(1.1rem, 0.9rem + 0.6vw, 1.55rem);
  height: 0.0625rem;
  background: currentColor;
  margin: 0 0.45rem;
  opacity: 0.65;
}

/* 统计卡（管理后台）：顶部金线 + 衬线大数字 */
.stat-card { position: relative; overflow: hidden; }
.stat-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
  opacity: 0.85;
}
.stat-num {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-label { font-size: 0.8rem; letter-spacing: 0.04em; color: var(--ink-300); margin-top: 0.3rem; }

/* 火漆印章式徽记（签名组件） */
.wax-seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--wine), var(--wine-700));
  color: var(--gold-300);
  font-family: var(--font-serif); font-weight: 900; font-size: 1.15rem;
  box-shadow: 0 4px 12px rgba(216, 49, 91, 0.30), inset 0 0 0 2px rgba(244, 211, 94, 0.45);
  flex-shrink: 0;
}

/* ============================================================
   衡涨图标系统：本地 SVG、统一尺度与可访问交互
   ============================================================ */
.icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  overflow: visible;
  color: inherit;
  vertical-align: -0.16em;
}
.icon-14 { width: 12px; height: 12px; }
.icon-16 { width: 14px; height: 14px; }
.icon-18 { width: 15px; height: 15px; }
.icon-20 { width: 17px; height: 17px; }
.icon-24 { width: 20px; height: 20px; }
.icon-28 { width: 24px; height: 24px; }
.icon-32 { width: 27px; height: 27px; }
.icon-40 { width: 34px; height: 34px; }

.brand-lockup { display: inline-flex; align-items: center; gap: 0.55rem; }
.brand-mark { color: var(--gold); vertical-align: middle; }
.brand-mark-light { color: var(--gold); }
.page-brand-mark { color: var(--royal); margin-right: 0.3rem; vertical-align: -0.18em; }

.product-icon-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(46px, 4vw, 52px);
  height: clamp(46px, 4vw, 52px);
  border-radius: var(--r-md);
  background: var(--royal);
  color: var(--gold);
  box-shadow: var(--shadow-sm);
}
.product-icon-frame.compact { width: 38px; height: 38px; }
.product-icon-market { background: var(--gold); color: var(--royal); }
.product-icon-bridge { background: var(--wine); color: #FFFFFF; }
.product-icon-strategy { background: var(--royal-50); color: var(--royal); border: 1px solid var(--royal-100); }

.auth-icon-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: #FFFFFF;
  color: var(--royal);
  transition: color var(--t-fast), background-color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.icon-button:hover, .icon-button:focus-visible { color: #FFFFFF; background: var(--royal); border-color: var(--royal); transform: translateY(-1px); }
.icon-button-danger { color: var(--wine-700); border-color: rgba(216, 49, 91, 0.35); }
.icon-button-danger:hover, .icon-button-danger:focus-visible { background: var(--wine); border-color: var(--wine); }
.icon-button-toggle { color: var(--royal); border-color: var(--royal-100); }
.icon-button-success { color: var(--success); border-color: rgba(45, 155, 94, 0.35); }
.btn-copy[data-icon-state="success"] { color: var(--success); border-color: rgba(45, 155, 94, 0.45); background: rgba(45, 155, 94, 0.08); }
.btn-copy .icon-success-state { display: none; }
.btn-copy[data-icon-state="success"] .icon-copy-state { display: none; }
.btn-copy[data-icon-state="success"] .icon-success-state { display: inline-block; }

.flash-message { display: flex; align-items: center; gap: 0.55rem; }
.flash-message .alert-close { margin-left: auto; width: 36px; min-width: 36px; height: 36px; background: transparent; border-color: transparent; color: currentColor; }
.flash-message .alert-close:hover { background: rgba(10, 36, 99, 0.08); color: currentColor; border-color: currentColor; transform: none; }

.navbar-blur .navbar-toggler {
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.75rem;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: var(--r-md);
  color: #FFFFFF;
  transition: color var(--t-fast), background-color var(--t-fast);
}
.navbar-blur .navbar-toggler:hover,
.navbar-blur .navbar-toggler:focus-visible { color: var(--gold); background: rgba(255, 255, 255, 0.1); }
.navbar-blur .navbar-toggler .icon { width: 1.25rem; height: 1.25rem; color: currentColor; }

@media (max-width: 991.98px) {
  .navbar-blur { padding: 0.3rem 0; }
  .navbar-blur .navbar-toggler { display: inline-flex; }
  .navbar-blur .site-header__inner { flex-wrap: wrap; }
  .navbar-blur .site-header__brand {
    max-width: calc(100% - 3.5rem);
    margin-right: auto;
  }
  .navbar-blur .site-header__nav {
    flex-basis: 100%;
    width: 100%;
    margin-top: 0.35rem;
    padding-top: 0.45rem;
    border-top: 0.0625rem solid rgba(244, 211, 94, 0.24);
  }
  .navbar-blur .site-header__menu {
    align-items: stretch;
    gap: 0.2rem;
    padding-bottom: 0.35rem;
  }
  .navbar-blur .nav-link {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.65rem 0.8rem;
    border-radius: var(--r-sm);
  }
  .navbar-blur .nav-link:hover,
  .navbar-blur .nav-link:focus,
  .navbar-blur .nav-link.active { background: rgba(255, 255, 255, 0.08); }
  .navbar-blur .nav-link:not(.dropdown-toggle)::after { display: none; }
  .navbar-blur .dropdown-toggle { max-width: none; }
  .site-header__username {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }
  .navbar-blur .site-header__cta-item { margin: 0.2rem 0 0; }
  .navbar-blur .site-header__cta {
    width: 100%;
    min-height: 2.75rem;
  }
  .navbar-blur .dropdown-menu {
    position: static;
    width: 100%;
    margin: 0.2rem 0 0;
    border-color: rgba(244, 211, 94, 0.28);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: none;
  }
}

@media (max-width: 47.98rem) {
  .footer .footer__inner { flex-direction: column; gap: 0.45rem; text-align: center; }
  .footer .footer__meta { white-space: normal; }
}

.architecture-node {
  padding: clamp(0.9rem, 2vw, 1.5rem);
  border: 1.5px solid rgba(244, 211, 94, 0.35);
  border-radius: var(--r-md);
  background: rgba(244, 211, 94, 0.06);
}
.architecture-node.bridge { border-color: rgba(216, 49, 91, 0.4); background: rgba(216, 49, 91, 0.08); }
.architecture-node.windows { border-color: rgba(184, 201, 235, 0.42); background: rgba(10, 36, 99, 0.28); }
.architecture-flow-arrow { color: var(--gold); }

.admin-section-icon { color: var(--royal); }
.empty-state-icon { color: var(--ink-400); opacity: 0.45; }
.status-success { color: var(--success); }
.status-danger { color: var(--wine-700); }
.badge-warning { background: rgba(244, 211, 94, 0.38); color: var(--royal-700); }

@media (max-width: 767.98px) {
  .hero-section .row { --bs-gutter-x: 1.5rem; }
  .page-section { padding-right: 0.75rem; padding-left: 0.75rem; }
  .architecture-flow-arrow { transform: rotate(90deg); }
  .admin-page-heading { align-items: flex-start !important; }
}

/* ============================================================
   QMT 云端控制面：仅作用于 /dashboard
   ============================================================ */
.qmt-cloud-console {
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 2.5vw, 2.5rem) 3rem;
  color: var(--ink);
}

.qmt-cloud-console button,
.qmt-cloud-console a.btn { min-height: 44px; }

.qmt-console-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  padding: 0.45rem 0 1.25rem;
  border-bottom: 1px solid var(--border);
}
.qmt-console-header h1 {
  margin: 0.2rem 0 0.25rem;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
}
.qmt-console-header p,
.qmt-section-heading p,
.qmt-panel-heading p,
.qmt-danger-zone p,
.qmt-installer-panel p,
.qmt-history-details > p {
  margin: 0;
  color: var(--ink-300);
  font-size: 0.9rem;
}
.qmt-header-actions,
.qmt-detail-actions,
.qmt-inline-actions,
.qmt-service-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.qmt-sync-state {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: #FFFFFF;
  color: var(--ink-200);
  font-size: 0.82rem;
  white-space: nowrap;
}

.qmt-console-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.qmt-console-sidebar {
  position: sticky;
  top: 86px;
  min-height: calc(100vh - 118px);
  padding: 1rem;
  border: 1px solid var(--royal-800);
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, var(--royal-900), var(--royal-700));
  box-shadow: var(--shadow-md);
  color: #FFFFFF;
}
.qmt-sidebar-title {
  padding: 0.25rem 0.7rem 0.7rem;
  color: var(--gold-300);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.qmt-workspace-nav { display: grid; gap: 0.3rem; }
.qmt-nav-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: rgba(255, 255, 255, 0.76);
  font: 500 0.9rem var(--font-sans);
  text-align: left;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.qmt-nav-item:hover,
.qmt-nav-item:focus-visible {
  border-color: rgba(244, 211, 94, 0.3);
  background: rgba(244, 211, 94, 0.08);
  color: #FFFFFF;
}
.qmt-nav-item.is-active {
  border-color: rgba(244, 211, 94, 0.48);
  background: var(--gold);
  color: var(--royal-900);
  box-shadow: var(--shadow-gold);
}
.qmt-nav-count {
  min-width: 24px;
  padding: 0.08rem 0.4rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.7rem;
  text-align: center;
}
.qmt-nav-item.is-active .qmt-nav-count { background: rgba(10, 36, 99, 0.12); }
.qmt-sidebar-note {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding: 0.9rem 0.75rem 0;
  border-top: 1px solid rgba(244, 211, 94, 0.18);
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  line-height: 1.55;
}
.qmt-sidebar-note .icon { color: var(--gold); margin-top: 0.15rem; }

.qmt-console-main { min-width: 0; }
.qmt-workspace { animation: qmtWorkspaceIn 0.24s var(--ease); }
.qmt-workspace[hidden] { display: none !important; }
@keyframes qmtWorkspaceIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.qmt-section-heading,
.qmt-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.qmt-section-heading { margin-bottom: 1rem; }
.qmt-section-heading h2 {
  margin: 0.15rem 0 0.2rem;
  font-size: clamp(1.45rem, 2.4vw, 1.9rem);
}
.qmt-panel-heading {
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--divider);
}
.qmt-panel-heading h3,
.qmt-danger-zone h3,
.qmt-installer-panel h3 {
  margin: 0 0 0.2rem;
  font-size: 1.02rem;
}
.qmt-panel {
  padding: clamp(1rem, 2vw, 1.35rem);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
}
.qmt-panel + .qmt-panel,
.qmt-workspace > .qmt-panel + .qmt-danger-zone,
.qmt-enrollment-grid + .qmt-panel,
.qmt-panel + .qmt-history-details { margin-top: 1rem; }

.qmt-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.qmt-metric-card {
  position: relative;
  min-height: 132px;
  padding: 1rem 1.1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
}
.qmt-metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--gold);
}
.qmt-metric-card strong {
  display: block;
  margin: 0.45rem 0 0.25rem;
  color: var(--royal);
  font: 700 clamp(1.8rem, 4vw, 2.4rem)/1 var(--font-serif);
}
.qmt-metric-card > span:last-child { color: var(--ink-300); font-size: 0.75rem; }
.qmt-metric-label {
  color: var(--ink-200);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.qmt-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 1rem;
}
.qmt-text-action {
  min-height: 44px;
  padding: 0 0.3rem;
  border: 0;
  background: transparent;
  color: var(--royal);
  font: 600 0.78rem var(--font-sans);
}
.qmt-text-action:hover { color: var(--wine); }

.qmt-device-summary-list,
.qmt-device-list { display: grid; gap: 0.65rem; }
.qmt-device-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qmt-device-summary,
.qmt-device-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  min-height: 64px;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--divider);
  border-radius: var(--r-md);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  text-align: left;
  transition: border-color var(--t-fast), background-color var(--t-fast), box-shadow var(--t-fast);
}
.qmt-device-card { min-height: 88px; padding: 1rem; }
.qmt-device-summary:hover,
.qmt-device-card:hover,
.qmt-device-summary:focus-visible,
.qmt-device-card:focus-visible,
.qmt-device-card.is-selected {
  border-color: var(--gold-600);
  background: #FFFFFF;
  box-shadow: var(--shadow-sm);
}
.qmt-device-identity,
.qmt-device-card-status,
.qmt-device-copy { display: flex; }
.qmt-device-identity { align-items: center; gap: 0.75rem; min-width: 0; }
.qmt-device-copy,
.qmt-device-card-status { flex-direction: column; }
.qmt-device-copy { min-width: 0; }
.qmt-device-copy strong,
.qmt-device-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qmt-device-copy strong { font-size: 0.86rem; }
.qmt-device-copy span { color: var(--ink-300); font-size: 0.7rem; }
.qmt-device-card-status { align-items: flex-end; gap: 0.25rem; flex: 0 0 auto; }
.qmt-device-icon,
.qmt-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--royal);
  color: var(--gold);
  font: 700 1rem var(--font-serif);
}
.qmt-panel-icon { width: 52px; height: 52px; }

.qmt-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--ink-400);
}
.qmt-status-dot.is-online,
.qmt-state-badge.is-online .qmt-status-dot,
.qmt-state-badge.is-running .qmt-status-dot { background: var(--success); }
.qmt-status-dot.is-offline,
.qmt-state-badge.is-offline .qmt-status-dot,
.qmt-state-badge.is-stopped .qmt-status-dot { background: var(--ink-400); }
.qmt-status-dot.is-degraded,
.qmt-status-dot.is-stale,
.qmt-state-badge.is-degraded .qmt-status-dot,
.qmt-state-badge.is-stale .qmt-status-dot,
.qmt-state-badge.is-unknown .qmt-status-dot { background: var(--warning); }
.qmt-status-dot.is-revoked,
.qmt-state-badge.is-revoked .qmt-status-dot,
.qmt-state-badge.is-error .qmt-status-dot,
.qmt-state-badge.is-failed .qmt-status-dot { background: var(--wine); }
.qmt-state-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 26px;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-200);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.qmt-state-badge.is-online,
.qmt-state-badge.is-running,
.qmt-state-badge.is-succeeded { border-color: rgba(45, 155, 94, 0.26); background: rgba(45, 155, 94, 0.08); color: var(--success); }
.qmt-state-badge.is-degraded,
.qmt-state-badge.is-stale,
.qmt-state-badge.is-unknown,
.qmt-state-badge.is-indeterminate { border-color: rgba(230, 162, 60, 0.3); background: rgba(230, 162, 60, 0.08); color: #956416; }
.qmt-state-badge.is-revoked,
.qmt-state-badge.is-error,
.qmt-state-badge.is-failed { border-color: rgba(216, 49, 91, 0.26); background: rgba(216, 49, 91, 0.07); color: var(--wine-700); }

.qmt-activity-list { list-style: none; margin: 0; padding: 0; }
.qmt-activity-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--divider);
}
.qmt-activity-item:last-child { border-bottom: 0; }
.qmt-activity-marker {
  width: 9px;
  height: 9px;
  margin-top: 0.42rem;
  border: 2px solid var(--gold-600);
  border-radius: 50%;
  background: #FFFFFF;
}
.qmt-activity-item > span:last-child { display: flex; flex-direction: column; }
.qmt-activity-item strong { font-size: 0.8rem; }
.qmt-activity-item span span { color: var(--ink-300); font-size: 0.7rem; }
.qmt-empty-state,
.qmt-table-empty { color: var(--ink-300); font-size: 0.84rem; text-align: center; }
.qmt-empty-state { padding: 1.4rem 0.75rem; border: 1px dashed var(--border); border-radius: var(--r-md); }

.qmt-device-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.qmt-device-facts > div {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--royal-50);
}
.qmt-device-facts span,
.qmt-device-facts strong { display: block; }
.qmt-device-facts span { color: var(--ink-300); font-size: 0.68rem; }
.qmt-device-facts strong { margin-top: 0.18rem; color: var(--royal); font-size: 0.82rem; }

.qmt-data-table {
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8rem;
}
.qmt-data-table th {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--royal-50);
  color: var(--royal-700);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.qmt-data-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--divider);
  color: var(--ink-200);
  vertical-align: middle;
}
.qmt-data-table tbody tr:last-child td { border-bottom: 0; }
.qmt-data-table tbody tr:hover { background: var(--cream); }
.qmt-data-table code { white-space: nowrap; }
.qmt-small-button {
  min-height: 36px !important;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--royal-100);
  border-radius: var(--r-sm);
  background: #FFFFFF;
  color: var(--royal);
  font: 600 0.72rem var(--font-sans);
}
.qmt-small-button:hover:not(:disabled) { background: var(--royal); color: #FFFFFF; }
.qmt-small-button:disabled,
.qmt-cloud-console .btn:disabled { cursor: not-allowed; opacity: 0.48; transform: none; box-shadow: none; }
.qmt-muted { color: var(--ink-300); font-size: 0.7rem; }
.qmt-mono { font-family: var(--font-mono); font-size: 0.72rem; }

.qmt-command-banner {
  position: sticky;
  top: 74px;
  z-index: 20;
  margin-bottom: 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--royal-100);
  border-radius: var(--r-md);
  background: var(--royal-50);
  box-shadow: var(--shadow-sm);
  color: var(--royal);
  font-size: 0.8rem;
}
.qmt-command-banner.is-success { border-color: rgba(45, 155, 94, 0.3); background: rgba(45, 155, 94, 0.09); color: var(--success); }
.qmt-command-banner.is-warning { border-color: rgba(230, 162, 60, 0.32); background: rgba(230, 162, 60, 0.1); color: #956416; }
.qmt-command-banner.is-error { border-color: rgba(216, 49, 91, 0.3); background: rgba(216, 49, 91, 0.08); color: var(--wine-700); }

.qmt-danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(216, 49, 91, 0.28);
  border-radius: var(--r-lg);
  background: rgba(216, 49, 91, 0.04);
}
.qmt-danger-button {
  flex: 0 0 auto;
  border: 1px solid var(--wine);
  background: #FFFFFF;
  color: var(--wine-700);
}
.qmt-danger-button:hover:not(:disabled) { background: var(--wine); color: #FFFFFF; }

.qmt-enrollment-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 1rem;
}
.qmt-installer-panel { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 1rem; }
.qmt-installer-panel .qmt-inline-actions { margin-top: 1rem; }
.qmt-security-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: max-content;
  min-height: 30px;
  padding: 0.28rem 0.55rem;
  border-radius: var(--r-pill);
  background: var(--royal-50);
  color: var(--royal);
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}
.qmt-pairing-status { min-height: 24px; margin-top: 0.6rem; color: var(--ink-300); font-size: 0.76rem; }
.qmt-pairing-status.is-success { color: var(--success); }
.qmt-pairing-status.is-error { color: var(--wine-700); }
.qmt-pairing-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.65rem;
  padding: 0.75rem;
  border: 1px solid var(--gold-600);
  border-radius: var(--r-md);
  background: rgba(244, 211, 94, 0.1);
}
.qmt-pairing-code[hidden] { display: none; }
.qmt-pairing-code code { font-size: 1.05rem; letter-spacing: 0.09em; text-align: center; }
.qmt-pairing-code > span { grid-column: 1 / -1; color: var(--ink-300); font-size: 0.7rem; text-align: center; }
.qmt-inline-message { margin: 0.65rem 0 0; color: var(--wine-700); font-size: 0.75rem; }
.qmt-history-details > summary {
  min-height: 44px;
  color: var(--royal);
  cursor: pointer;
  font-weight: 600;
}
.qmt-history-details > p { margin: 0.25rem 0 0.75rem; }

.qmt-cloud-console + * { margin-top: 0; }
body:has(.qmt-cloud-console) .footer { margin-top: 0; }

@media (max-width: 1199.98px) {
  .qmt-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qmt-overview-grid,
  .qmt-enrollment-grid { grid-template-columns: 1fr; }
  .qmt-device-list { grid-template-columns: 1fr; }
}

@media (max-width: 899.98px) {
  .qmt-cloud-console { padding: 1rem 0.75rem 2rem; }
  .qmt-console-header { align-items: flex-start; }
  .qmt-console-shell { display: block; }
  .qmt-console-sidebar {
    position: sticky;
    top: 58px;
    z-index: 30;
    min-height: 0;
    margin-bottom: 1rem;
    padding: 0.45rem;
    overflow-x: auto;
    scrollbar-width: none;
    border-radius: var(--r-md);
  }
  .qmt-console-sidebar::-webkit-scrollbar { display: none; }
  .qmt-sidebar-title,
  .qmt-sidebar-note { display: none; }
  .qmt-workspace-nav {
    display: flex;
    width: max-content;
    min-width: 100%;
  }
  .qmt-nav-item {
    display: inline-flex;
    width: auto;
    min-width: max-content;
    min-height: 44px;
    padding: 0.5rem 0.72rem;
  }
  .qmt-command-banner { top: 114px; }
}

@media (max-width: 639.98px) {
  .qmt-console-header,
  .qmt-section-heading,
  .qmt-panel-heading,
  .qmt-danger-zone { align-items: stretch; flex-direction: column; }
  .qmt-header-actions,
  .qmt-detail-actions { width: 100%; }
  .qmt-header-actions .btn,
  .qmt-detail-actions .btn,
  .qmt-danger-button { flex: 1 1 auto; }
  .qmt-sync-state { width: 100%; justify-content: center; }
  .qmt-metric-grid { grid-template-columns: 1fr 1fr; gap: 0.55rem; }
  .qmt-metric-card { min-height: 116px; padding: 0.8rem; }
  .qmt-device-facts { grid-template-columns: 1fr 1fr; }
  .qmt-device-summary,
  .qmt-device-card { align-items: flex-start; }
  .qmt-device-card-status { align-items: flex-end; }
  .qmt-installer-panel { grid-template-columns: 1fr; }
  .qmt-data-table th,
  .qmt-data-table td { padding: 0.65rem; }
}

@media (max-width: 399.98px) {
  .qmt-metric-grid,
  .qmt-device-facts { grid-template-columns: 1fr; }
  .qmt-device-summary,
  .qmt-device-card { flex-direction: column; }
  .qmt-device-card-status { align-items: flex-start; padding-left: 3.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .qmt-workspace { animation: none; }
}

