/* ============================================================================
 * app_system.css — 神州科技设备管理 权威收敛层 v1
 * ----------------------------------------------------------------------------
 * 定位：在 30+ 历史补丁之上做「最后一道收敛」，统一为克制专业的深色设计。
 * 原则（参考 Linear / Vercel / Arc）：
 *   - 一个主色 #4da3ff，灰度体系，不做多彩渐变/霓虹发光
 *   - 三级文字 #f7f7f8 / #a0a6b0 / #6b7280
 *   - 三档字重 400/500/600，标题 600，不堆 700+
 *   - 圆角 按钮8px / 卡片12px / 弹窗12px / 输入8px（去 999px 滥用）
 *   - 阴影只做「压低层次」，禁止彩色发光
 *   - 过渡 120~180ms ease-out，只动 背景色/边框色/transform/opacity
 * 去 AI 味要点：
 *   - 移除霓虹 text-shadow、无限动画、玻璃拟态滥用、渐变文字
 *   - 主按钮单一实心主色，无渐变、无彩色投影
 * ========================================================================== */

/* ---------------------------------------------------------------------------
 * 1. 令牌归一（把历史 4 套竞争主题变量全部钉死为同一套值）
 * ------------------------------------------------------------------------- */
html:root,
html:root[data-theme],
html:root[data-theme="dark"] {
  --app-primary:      #4da3ff;
  --app-primary-hi:   #6db0ff;
  --app-primary-lo:   #3a8fe6;
  --app-bg:           #0a0c0f;
  --app-surface:      #111418;
  --app-surface-hi:   #171a1f;
  --app-overlay:      #1b1e24;
  --app-text:         #e6e8eb;
  --app-text-2:       #a6adba;
  --app-text-3:       #6b7280;
  --app-border:       rgba(255,255,255,.08);
  --app-border-hi:    rgba(255,255,255,.14);
  --app-success:      #46c07a;
  --app-warn:         #e6b15d;
  --app-danger:       #f65b5b;
  --app-radius-sm:    6px;
  --app-radius-md:    8px;
  --app-radius-lg:    12px;
  --app-radius-xl:    14px;
  --app-shadow-sm:    0 1px 2px rgba(0,0,0,.4);
  --app-shadow-md:    0 2px 8px rgba(0,0,0,.35);
  --app-shadow-lg:    0 8px 24px rgba(0,0,0,.45);
  --app-t-fast:       120ms;
  --app-t-base:       180ms;
  --app-ease:         cubic-bezier(.2, 0, 0, 1);
}

/* ---------------------------------------------------------------------------
 * 2. 去 AI 味：全局移除霓虹发光与无限动画
 *    （保留 antd 一次性入场动画，避免误伤弹窗/下拉）
 * ------------------------------------------------------------------------- */
html body * {
  text-shadow: none !important;
  -webkit-text-stroke: 0 !important;
}

html body *:not([class*="ant-"]) {
  animation: none !important;
}

/* 移除玻璃拟态滥用：固定 chrome 用低半径 blur 兜底，内容区用实色 */
html body .ant-layout-sider,
html body .ant-layout-header {
  backdrop-filter: blur(8px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(8px) saturate(1.2) !important;
}

/* 渐变文字 → 纯色 */
html body [class*="gradient-text"],
html body [style*="background-clip"] {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
}

/* ---------------------------------------------------------------------------
 * 3. 主按钮统一：单一实心主色，去渐变去彩影
 * ------------------------------------------------------------------------- */
html body .ant-btn-primary,
html body .login-button,
html body .sidebar-btn,
html body .ctrl-qbtn {
  background: var(--app-primary) !important;
  background-image: none !important;
  border: 1px solid transparent !important;
  color: #fff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,.35) !important;
  border-radius: var(--app-radius-md) !important;
  transition: background-color var(--app-t-base) var(--app-ease),
              box-shadow var(--app-t-base) var(--app-ease) !important;
}
html body .ant-btn-primary:hover,
html body .login-button:hover,
html body .sidebar-btn:hover,
html body .ctrl-qbtn:hover {
  background: var(--app-primary-hi) !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.4) !important;
}
html body .ant-btn-primary:active {
  background: var(--app-primary-lo) !important;
  transform: scale(.98);
}

/* 次按钮：透明底 + 细边框 */
html body .ant-btn-default,
html body .ant-btn:not(.ant-btn-primary):not(.ant-btn-text):not(.ant-btn-link) {
  background: transparent !important;
  border: 1px solid var(--app-border) !important;
  color: var(--app-text) !important;
  border-radius: var(--app-radius-md) !important;
}

/* ---------------------------------------------------------------------------
 * 4. 圆角收敛：去 999px 滥用
 * ------------------------------------------------------------------------- */
html body button,
html body .ant-btn {
  border-radius: var(--app-radius-md) !important;
}
html body .ant-card,
html body [class*="card"],
html body [class*="panel"] {
  border-radius: var(--app-radius-lg) !important;
}
html body input,
html body .ant-input,
html body .ant-select-selector,
html body .ant-input-affix-wrapper {
  border-radius: var(--app-radius-md) !important;
}
html body .ant-modal-content,
html body .ant-dropdown-menu,
html body .ant-select-dropdown {
  border-radius: var(--app-radius-lg) !important;
}

/* ---------------------------------------------------------------------------
 * 5. 卡片：纯净深色 + 中性边框 + 真实短投影（去渐变去光晕）
 * ------------------------------------------------------------------------- */
html body .ant-card,
html body [class*="card"],
html body [class*="panel"] {
  background: var(--app-surface) !important;
  background-image: none !important;
  border: 1px solid var(--app-border) !important;
  box-shadow: var(--app-shadow-sm) !important;
}

/* ---------------------------------------------------------------------------
 * 6. 流畅性：滚动与渲染
 * ------------------------------------------------------------------------- */
/* 内容区平滑滚动 */
html body .ant-layout-content {
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

/* 过渡收敛：只动合成器属性，避免 reflow */
html body .ant-menu-item,
html body .ant-btn,
html body .ant-tag,
html body .ant-segmented-item,
html body [class*="nav-item"] {
  transition: color var(--app-t-base) var(--app-ease),
              background-color var(--app-t-base) var(--app-ease),
              border-color var(--app-t-base) var(--app-ease),
              transform var(--app-t-fast) var(--app-ease) !important;
}

/* 长列表/表格：让浏览器按需绘制视口外内容 */
html body .ant-table-wrapper,
html body [class*="device-list"],
html body [class*="timeline"] {
  content-visibility: auto;
  contain-intrinsic-size: auto 480px;
}

/* 滚动期间降级玻璃模糊（重绘减负） */
html body.is-scrolling .ant-layout-sider,
html body.is-scrolling .ant-layout-header {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* 减少过度模糊：顶栏/侧栏背景兜底实色 */
html body .ant-layout-sider,
html body .ant-layout-header {
  background-color: rgba(17,20,24,.92) !important;
}

/* ---------------------------------------------------------------------------
 * 7. 文字层级统一
 * ------------------------------------------------------------------------- */
html body {
  color: var(--app-text) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html body h1, html body h2, html body h3 {
  font-weight: 600 !important;
  letter-spacing: -0.01em;
}
html body .ant-menu-item,
html body .ant-menu-submenu-title {
  color: var(--app-text-2) !important;
}
html body .ant-menu-item-selected {
  color: var(--app-text) !important;
  background: rgba(77,163,255,.12) !important;
}

/* ---------------------------------------------------------------------------
 * 8. 焦点环：1px 主色实线，无发光
 * ------------------------------------------------------------------------- */
html body *:focus-visible {
  outline: 1px solid var(--app-primary) !important;
  outline-offset: 2px;
  box-shadow: none !important;
}

/* ---------------------------------------------------------------------------
 * 9. 滚动条：克制细窄
 * ------------------------------------------------------------------------- */
html body ::-webkit-scrollbar { width: 8px; height: 8px; }
html body ::-webkit-scrollbar-track { background: transparent; }
html body ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12);
  border-radius: 4px;
}
html body ::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.2);
}

/* ---------------------------------------------------------------------------
 * 10. 状态点/徽章：去脉冲动画，用静态色
 * ------------------------------------------------------------------------- */
html body [class*="heartbeat-dot"],
html body [class*="status-dot"],
html body [class*="pulse"] {
  animation: none !important;
}

/* ---------------------------------------------------------------------------
 * 11. 减少动效偏好兜底
 * ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html body *, html body *::before, html body *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
