/* ==========================================================================
   储能平台 — 设计系统
   浅色主题 / 响应式（≥1200 桌面，768–1199 平板，<768 移动）
   ========================================================================== */

:root {
  /* ============================================================
     Material Design 3 色彩系统
     种子色 seed = #0e9d70（品牌绿）
     采用 MD3 HCT 色调调色板：浅色主色 tone 40，暗色 tone 80
     保证 on-primary / on-surface 对比度 ≥ 4.5:1
     ============================================================ */
  /* —— 主色 Primary（品牌绿）—— */
  --md-primary:               #006C4B;
  --md-on-primary:            #FFFFFF;
  --md-primary-container:     #8FF6C9;
  --md-on-primary-container:  #002115;

  /* —— 次色 Secondary（灰绿）—— */
  --md-secondary:               #4D6357;
  --md-on-secondary:            #FFFFFF;
  --md-secondary-container:     #CFE9D9;
  --md-on-secondary-container:  #0A2016;

  /* —— 第三色 Tertiary（蓝绿）—— */
  --md-tertiary:               #3D6373;
  --md-on-tertiary:            #FFFFFF;
  --md-tertiary-container:     #C1E8FC;
  --md-on-tertiary-container:  #001F28;

  /* —— 错误色 Error —— */
  --md-error:               #BA1A1A;
  --md-on-error:            #FFFFFF;
  --md-error-container:     #FFDAD6;
  --md-on-error-container:  #410002;

  /* —— 中性面 Surface / Outline —— */
  --md-surface:                   #F6FBF5;
  --md-on-surface:                #171D1A;
  --md-surface-variant:           #DBE5DD;
  --md-on-surface-variant:        #3F4944;
  --md-outline:                   #6F7974;
  --md-outline-variant:           #BFC9C2;
  --md-surface-container-lowest:  #FFFFFF;
  --md-surface-container-low:     #F0F5F0;
  --md-surface-container:         #EAF0EA;
  --md-surface-container-high:    #E4EAE4;
  --md-surface-container-highest: #DFE5DF;
  --md-inverse-surface:           #2C322F;
  --md-inverse-on-surface:        #EDF2EE;
  --md-inverse-primary:           #6FDBB0;
  --md-scrim:                     #000000;
  --md-shadow:                    #000000;

  /* —— 状态层透明度（State Layer Opacity）—— */
  --md-hover-opacity:   0.08;
  --md-focus-opacity:   0.12;
  --md-pressed-opacity: 0.12;
  --md-dragged-opacity: 0.16;

  /* —— MD3 动效缓动曲线（Easing）—— */
  --md-ease-standard:   cubic-bezier(0.2, 0, 0, 1);
  --md-ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
  --md-ease-accelerate: cubic-bezier(0.3, 0, 0.8, 0.15);
  --md-ease-decelerate: cubic-bezier(0.05, 0.7, 0.1, 1);
  --md-duration-short:  200ms;
  --md-duration-medium: 250ms;
  --md-duration-long:   350ms;

  /* —— MD3 形状（Shape Scale）—— */
  --md-shape-xs:   4px;
  --md-shape-sm:   8px;
  --md-shape-md:   12px;
  --md-shape-lg:   16px;
  --md-shape-xl:   28px;
  --md-shape-full: 999px;

  /* —— MD3 高度（Elevation）—— */
  --md-elev-1: 0 1px 2px rgba(0,0,0,.30), 0 1px 3px 1px rgba(0,0,0,.15);
  --md-elev-2: 0 1px 2px rgba(0,0,0,.30), 0 2px 6px 2px rgba(0,0,0,.15);
  --md-elev-3: 0 4px 8px 3px rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.30);

  /* ============================================================
     兼容别名（现有组件引用，映射到 MD3 角色色）
     ============================================================ */
  --brand:        var(--md-primary);
  --brand-dark:   #004D37;                       /* primary tone 30，用于 hover 加深 */
  --brand-light:  var(--md-primary-container);   /* 选中底 / avatar 底 */
  --brand-fade:   #E4F5EC;                       /* primary-container 更浅，用于大面积底 */
  --accent:       #1F6FEB;                       /* 次要操作蓝 */
  --accent-light: #EAF2FE;

  --ink-1: var(--md-on-surface);
  --ink-2: #3C4A45;                              /* on-surface 次级 */
  --ink-3: var(--md-on-surface-variant);         /* 辅助文字 */
  --ink-4: var(--md-outline);                    /* 弱化文字 */

  --line:   var(--md-outline-variant);
  --line-2: var(--md-surface-container-high);    /* 次级边框/底纹 */
  --bg:     var(--md-surface);
  --panel:  var(--md-surface-container-lowest);

  --ok:     var(--md-primary);
  --warn:   #D98A06;
  --danger: var(--md-error);
  --info:   #1F6FEB;
  --muted:  #5F6F69;

  /* 圆角（映射到 MD3 shape scale）*/
  --r-s: var(--md-shape-sm);   /* 8px */
  --r-m: var(--md-shape-md);   /* 12px */
  --r-l: var(--md-shape-lg);   /* 16px */

  --shadow-1: var(--md-elev-1);
  --shadow-2: var(--md-elev-2);
  --shadow-3: 0 12px 32px rgba(16, 32, 27, .14);

  --maxw: 1240px;
  --nav-h: 64px;                                  /* MD3 top app bar 高度 */
  color-scheme: light;
  --transition-theme: background-color var(--md-duration-long) var(--md-ease-standard), color var(--md-duration-long) var(--md-ease-standard), border-color var(--md-duration-long) var(--md-ease-standard), box-shadow var(--md-duration-long) var(--md-ease-standard);
}

/* ====== 暗色模式 ====== */
[data-theme="dark"] {
  /* —— MD3 暗色色彩角色（主色 tone 80）—— */
  --md-primary:               #6FDBB0;
  --md-on-primary:            #003826;
  --md-primary-container:     #00513C;
  --md-on-primary-container:  #8FF6C9;
  --md-secondary:             #B3CCBF;
  --md-on-secondary:          #1E352B;
  --md-secondary-container:   #354B40;
  --md-on-secondary-container:#CFE9D9;
  --md-tertiary:              #A5CCE0;
  --md-on-tertiary:           #083544;
  --md-tertiary-container:    #244C5B;
  --md-on-tertiary-container: #C1E8FC;
  --md-error:                 #FFB4AB;
  --md-on-error:              #690005;
  --md-error-container:       #93000A;
  --md-on-error-container:    #FFDAD6;
  --md-surface:                   #0F1512;
  --md-on-surface:                #DFE4E0;
  --md-surface-variant:           #3F4944;
  --md-on-surface-variant:        #BFC9C2;
  --md-outline:                   #89938D;
  --md-outline-variant:           #3F4944;
  --md-surface-container-lowest:  #0A100D;
  --md-surface-container-low:     #0F1512;
  --md-surface-container:         #131A16;
  --md-surface-container-high:    #1D2521;
  --md-surface-container-highest: #28302B;
  --md-inverse-surface:           #DFE4E0;
  --md-inverse-on-surface:        #2C322F;
  --md-inverse-primary:           #006C4B;
  --md-scrim:                     #000000;
  --md-shadow:                    #000000;

  --brand:        var(--md-primary);
  --brand-dark:   #8FF6C9;                       /* 暗色 hover 用亮绿 */
  --brand-light:  var(--md-primary-container);   /* #00513C 深绿容器 */
  --brand-fade:   #0E231A;
  --accent:       #60A5FA;
  --accent-light: #1A2A40;
  --ink-1: var(--md-on-surface);
  --ink-2: #B8C5BF;
  --ink-3: var(--md-on-surface-variant);
  --ink-4: var(--md-outline);
  --line:   var(--md-outline-variant);
  --line-2: var(--md-surface-container-high);
  --bg:     var(--md-surface);
  --panel:  var(--md-surface-container-lowest);
  --ok:    var(--md-primary);
  --warn:  #F0B848;
  --danger: var(--md-error);
  --info:  #60A5FA;
  --muted: #82918B;
  --shadow-1: 0 1px 2px rgba(0,0,0,.30), 0 1px 3px 1px rgba(0,0,0,.15);
  --shadow-2: 0 1px 2px rgba(0,0,0,.30), 0 2px 6px 2px rgba(0,0,0,.15);
  --shadow-3: 0 12px 32px rgba(0,0,0,.40);
  color-scheme: dark;
}

/* ============================================================
   Material Design 3 排版（Type Scale）
   五级字号（Display/Headline/Title/Body/Label），响应式 clamp
   ============================================================ */
:root {
  --md-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                     "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --md-mono: "SF Mono", "JetBrains Mono", Consolas, monospace;

  --md-display-lg:  clamp(36px, 5vw, 57px);
  --md-display-md: clamp(32px, 4.4vw, 45px);
  --md-display-sm: clamp(28px, 3.6vw, 36px);

  --md-headline-lg: clamp(26px, 3.4vw, 32px);
  --md-headline-md: clamp(23px, 3vw, 28px);
  --md-headline-sm: clamp(20px, 2.6vw, 24px);

  --md-title-lg: clamp(19px, 2.4vw, 22px);
  --md-title-md: 16px;
  --md-title-sm: 14px;

  --md-body-lg: 16px;
  --md-body-md: 14px;
  --md-body-sm: 12px;

  --md-label-lg: 14px;
  --md-label-md: 12px;
  --md-label-sm: 11px;

  --md-lh-tight: 1.25;
  --md-lh-base: 1.5;
  --md-lh-loose: 1.6;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--md-font-family);
  font-size: clamp(13px, 1vw + 12px, var(--md-body-md));
  line-height: var(--md-lh-base);
  color: var(--ink-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: var(--transition-theme);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }

/* ============================================================
   Material Design 3 状态层（State Layer）
   统一用 ::after 覆盖层实现 hover/focus/pressed，currentColor 自适应
   ============================================================ */
.btn, .chip, .nav-links a, .side a, .pager button, .tabs button,
.bottom-bar .btab, .pchip, .eq-card, .mt-card-mobile, .pw-toggle, .theme-btn {
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.btn::after, .chip::after, .nav-links a::after, .side a::after,
.pager button::after, .tabs button::after, .bottom-bar .btab::after,
.pchip::after, .eq-card::after, .mt-card-mobile::after, .pw-toggle::after, .theme-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--md-duration-short) var(--md-ease-standard);
  pointer-events: none;
}

/* ============================================================
   Material Design 3 涟漪（Ripple）
   由 api.js 全局委托注入 .ripple 元素，从触点向外扩散
   ============================================================ */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.22;
  transform: scale(0);
  animation: md-ripple var(--md-duration-long) var(--md-ease-standard) forwards;
  pointer-events: none;
}
@keyframes md-ripple {
  to { transform: scale(4); opacity: 0; }
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(14px, 3vw, 20px); }
.hide { display: none !important; }
.mono { font-family: var(--md-mono); }
.tar { text-align: right; }
.tac { text-align: center; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row-b { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; }
.wrap-flex { flex-wrap: wrap; }

/* ---------------- 顶栏 ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: var(--transition-theme);
}
[data-theme="dark"] .nav { background: rgba(26, 38, 34, .94); }
.nav .wrap { height: 100%; display: flex; align-items: center; gap: 22px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.logo .logo-img { height: 38px; width: 38px; border-radius: 50%; flex: none; object-fit: contain; }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-title { font-size: 15px; font-weight: 700; color: var(--ink-1); white-space: nowrap; }
.logo small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; }
.nav .logo-img { height: 38px; width: 38px; border-radius: 50%; }
.auth-form .logo-img { height: auto; width: 280px; max-width: 100%; border-radius: 0; object-fit: contain; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a {
  padding: 7px 13px; border-radius: var(--r-s); color: var(--ink-2);
  font-weight: 500; transition: color var(--md-duration-short) var(--md-ease-standard);
}
.nav-links a:hover { color: var(--ink-1); }
.nav-links a:hover::after { opacity: var(--md-hover-opacity); }
.nav-links a.on { background: var(--brand-light); color: var(--md-on-primary-container); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--brand-light);
  color: var(--md-on-primary-container); display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.menu-btn { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }
.menu-btn span { display: block; width: 20px; height: 2px; background: var(--ink-1); margin: 4px 0; border-radius: 2px; }
.theme-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--panel); cursor: pointer; font-size: 16px;
  display: grid; place-items: center; transition: border-color var(--md-duration-short) var(--md-ease-standard), var(--transition-theme);
  -webkit-tap-highlight-color: transparent;
}
.theme-btn:hover { border-color: var(--brand); }
.theme-btn:hover::after { opacity: var(--md-hover-opacity); }

/* ---------------- 按钮（MD3 Filled/Outlined/Text + 状态层） ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--r-s); border: 1px solid var(--line);
  background: var(--panel); color: var(--ink-1); font-weight: 550; cursor: pointer;
  transition: border-color var(--md-duration-short) var(--md-ease-standard), var(--transition-theme);
  white-space: nowrap; line-height: 1.4;
}
.btn:hover { border-color: var(--ink-4); }
.btn:hover::after { opacity: var(--md-hover-opacity); }
.btn:active { transform: scale(.97); }
.btn:active::after { opacity: var(--md-pressed-opacity); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; pointer-events: none; }
.btn:disabled::after { opacity: 0; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--md-on-primary); }
.btn-primary:hover::after { opacity: var(--md-hover-opacity); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover::after { opacity: var(--md-hover-opacity); }
.btn-danger { color: var(--danger); border-color: #f0cfcf; background: var(--panel); }
[data-theme="dark"] .btn-danger { border-color: #4a2020; }
.btn-danger:hover { border-color: var(--danger); }
.btn-danger:hover::after { opacity: var(--md-hover-opacity); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover::after { opacity: var(--md-hover-opacity); }
.btn-lg { padding: 13px 30px; font-size: 15.5px; border-radius: var(--md-shape-sm); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-block { display: flex; width: 100%; }

/* ---------------- 卡片 / 面板 ---------------- */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-m); box-shadow: var(--shadow-1);
  transition: var(--transition-theme), transform .18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.card-pad { padding: 18px 20px; }
/* 用户端 · 设备维保状态卡片网格 */
.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
@media (max-width: 767px) { .eq-grid { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; transition: var(--transition-theme); }
.panel-hd {
  padding: 14px 20px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  transition: border-color .3s;
}
.panel-hd h3 { font-size: 15px; }
.panel-bd { padding: 18px 20px; }

/* ---------------- 标签 ---------------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 100px; font-size: 12px; font-weight: 600;
  background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.tag-ok     { background: #e4f7ef; color: #0a7a56; }
.tag-warn   { background: #fdf3e0; color: #a86c05; }
.tag-danger { background: #fdeaea; color: #b93a3a; }
.tag-info   { background: #e9f1fe; color: #1a5fcc; }
.tag-muted  { background: #f0f3f2; color: var(--ink-3); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 15px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--ink-4); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--r-s); background: var(--panel); color: var(--ink-1); transition: border-color var(--md-duration-short) var(--md-ease-standard), box-shadow var(--md-duration-short) var(--md-ease-standard), var(--transition-theme); outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--md-primary); box-shadow: 0 0 0 3px var(--md-primary-container);
}
.textarea { min-height: 82px; resize: vertical; }
.select { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' stroke='%236b7a74' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }

/* ---------------- 底部 TabBar（移动端） ---------------- */
.bottom-bar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  height: 60px; padding: 0 env(safe-area-inset-bottom, 8px);
  background: var(--panel);
  border-top: 1px solid var(--line);
  transition: var(--transition-theme);
}
.bottom-bar-inner {
  display: flex; height: 100%; align-items: center; gap: 2px;
}
.bottom-bar .btab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 10px; font-weight: 500;
  color: var(--ink-3); padding: 4px 0; transition: color var(--md-duration-short) var(--md-ease-standard); border-radius: var(--md-shape-sm);
  min-height: 44px; -webkit-tap-highlight-color: transparent;
}
.bottom-bar .btab.on { color: var(--brand); font-weight: 700; }
.bottom-bar .btab:hover::after { opacity: var(--md-hover-opacity); }
.bottom-bar .btab:active::after { opacity: var(--md-pressed-opacity); }
.bottom-bar .btab .btab-icon { font-size: 20px; line-height: 1; transition: transform var(--md-duration-short) var(--md-ease-standard); }
.bottom-bar .btab:active .btab-icon { transform: scale(.85); }

/* 移动端 body 留出底部空间 */
.has-bottom-bar { padding-bottom: 68px; }

/* 移动端底部模块弹出子项面板 */
.btab-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, .35); }
.btab-sheet {
  position: fixed; left: 0; right: 0; bottom: 60px; z-index: 71;
  background: var(--panel); border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0; padding: 10px 12px calc(14px + env(safe-area-inset-bottom, 8px));
}
.btab-sheet-head { font-size: 12px; color: var(--ink-4); padding: 4px 6px 10px; font-weight: 700; letter-spacing: .04em; }
.btab-sheet-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btab-sheet-item {
  display: flex; align-items: center; gap: 6px; padding: 12px 11px;
  border: 0; background: var(--md-secondary-container, var(--panel));
  border-radius: var(--md-shape-sm); font-family: inherit; font-size: 13px;
  color: var(--ink-2); text-align: left; cursor: pointer; font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}
.btab-sheet-item.on { color: var(--brand); font-weight: 700; }
.btab-sheet-item .side-ico { flex: 0 0 20px; display: flex; align-items: center; justify-content: center; }

/* ---------------- 卡片式移动表格（<768px 替代 table） ---------------- */
.mobile-cards { display: none; flex-direction: column; gap: 10px; }
@media (max-width: 767px) {
  .field .chips { flex-wrap: wrap; white-space: normal; row-gap: 8px; }
  .field .chips .chip { flex: 0 0 auto; }
  .table-scroll.desktop-only { display: none; }
  .mobile-cards { display: flex; }
}
.mt-card-mobile {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-m); padding: 14px; transition: var(--transition-theme), transform .15s;
  box-shadow: var(--shadow-sm);
}
.mt-card-mobile:active { transform: scale(.98); }
.mt-card-mobile .mtm-hd {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.mt-card-mobile .mtm-name { font-weight: 650; font-size: 13.5px; }
.mt-card-mobile .mtm-code { font-size: 11px; color: var(--ink-4); font-family: monospace; margin-left: 8px; }
.mt-card-mobile .mtm-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px;
  font-size: 12px; margin-bottom: 10px;
}
.mt-card-mobile .mtm-body .l { color: var(--ink-3); }
.mt-card-mobile .mtm-body .v { font-weight: 500; }
.mt-card-mobile .mtm-act {
  display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line-2);
}
.mt-card-mobile .mtm-act button {
  flex: 1; padding: 8px 0; border-radius: var(--r-s); border: 1px solid var(--line);
  background: var(--panel); font-size: 12px; font-weight: 600; cursor: pointer;
  color: var(--ink-2); transition: .15s;
}
.mt-card-mobile .mtm-act button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.mt-card-mobile .mtm-act button.primary:hover { background: var(--brand-dark); }
.mt-card-mobile .mtm-act button:hover { border-color: var(--brand); color: var(--brand-dark); }

/* 密码框 + 明文切换 */
.pw { position: relative; }
.pw .input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; background: none; cursor: pointer; color: var(--ink-3);
  border-radius: var(--r-s); transition: .15s;
}
.pw-toggle:hover { color: var(--brand-dark); background: var(--brand-light); }
.pw-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.pw-toggle svg { width: 19px; height: 19px; }

/* ---------------- 表格 ---------------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.2px; }
table.tbl th {
  text-align: left; padding: 10px 12px; background: var(--line-2); color: var(--ink-3);
  font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; transition: var(--transition-theme);
}
table.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.tbl tr:hover td { background: var(--brand-fade); }
table.tbl tr:last-child td { border-bottom: 0; }

/* ---------------- 首页 Hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #0b3f30 0%, #0e6b4e 45%, #12a578 100%);
  color: #fff;
}
.hero::after {
  content: ''; position: absolute; inset: 0; opacity: .16;
  background-image:
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.55) 0, transparent 42%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.10) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.10) 0 1px, transparent 1px 46px);
}
.hero .wrap { position: relative; z-index: 1; padding-top: clamp(34px, 6vw, 58px); padding-bottom: clamp(34px, 5vw, 54px); }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px;
  border: 1px solid rgba(255,255,255,.3); border-radius: 100px;
  font-size: 12.5px; letter-spacing: .04em; background: rgba(255,255,255,.1);
}
.hero h1 { font-size: var(--md-display-md); line-height: var(--md-lh-tight); margin: 18px 0 12px; font-weight: 700; letter-spacing: -.01em; }
.hero p.sub { font-size: var(--md-body-lg); color: rgba(255,255,255,.85); max-width: 640px; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-hero {
  background: #fff; color: var(--brand-dark); border: 0; font-weight: 700;
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.btn-hero:hover { background: #f2fffa; }
.btn-hero-2 { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn-hero-2:hover { background: rgba(255,255,255,.2); }
.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-top: 38px; padding-top: 26px; border-top: 1px solid rgba(255,255,255,.18);
}
.hero-stats .n { font-size: 27px; font-weight: 700; letter-spacing: -.02em; }
.hero-stats .l { font-size: 12.5px; color: rgba(255,255,255,.75); }

/* 流程条 */
.flowbar { background: var(--panel); border-bottom: 1px solid var(--line); transition: var(--transition-theme); }
.flowbar .wrap { display: flex; gap: 6px; padding-top: 16px; padding-bottom: 16px; overflow-x: auto; }
.flowstep { display: flex; align-items: center; gap: 9px; flex: none; padding-right: 6px; }
.flowstep .i {
  width: 24px; height: 24px; border-radius: 50%; background: var(--brand-light);
  color: var(--brand-dark); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}
.flowstep .t { font-size: 13px; color: var(--ink-2); font-weight: 550; white-space: nowrap; }
.flowstep .arrow { color: var(--ink-4); margin: 0 12px 0 6px; }
/* 移动端：流程步骤换行成网格，避免横向滚动溢出 */
@media (max-width: 767px) {
  .flowbar .wrap { flex-wrap: wrap; overflow-x: visible; gap: 10px 8px; padding-top: 13px; padding-bottom: 13px; }
  .flowstep { flex: 0 0 calc(50% - 4px); padding-right: 0; }
  .flowstep .arrow { display: none; }
  .flowstep .t { white-space: normal; }
}

/* 校企联合 · 合作企业滚动展览 */
.partners { background: var(--panel); border-bottom: 1px solid var(--line); padding: clamp(22px, 3vw, 30px) 0 clamp(24px, 3vw, 34px); transition: var(--transition-theme); }
.partners-hd { margin-bottom: 22px; }
.partners-hd h2 { font-size: var(--md-headline-sm); margin: 10px 0 4px; }
.partners-hd .desc { color: var(--ink-3); font-size: 13.5px; margin-top: 4px; }
.marquee {
  position: relative; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee-track {
  display: flex; gap: 18px; width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* 干房有毒有害实验警示横幅（首页顶部循环滚动标语） */
.warn-banner { position: relative; overflow: hidden; background: #b0473f; color: #fff; z-index: 5; }
.warn-banner-track {
  display: inline-block; white-space: nowrap; padding: 9px 0;
  font-size: 14px; font-weight: 700; letter-spacing: .03em;
  animation: warn-scroll 14s linear infinite;
}
@keyframes warn-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.pchip {
  flex: none;
  width: 220px; height: 80px;
  padding: 12px 14px;
  border-radius: var(--r-m);
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow-1); overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  transition: .18s, var(--transition-theme);
}
.pchip:hover { border-color: #cfe3db; box-shadow: var(--shadow-2); transform: translateY(-2px); }
.p-logo {
  flex: none;
  width: 52px; height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.p-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-fallback-text {
  font-weight: 600; font-size: 20px; line-height: 1;
}
.p-text {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
}
.p-name {
  font-weight: 600; color: var(--ink-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.p-en {
  color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------------- 设备卡片网格 ---------------- */
.sec-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 34px 0 16px; flex-wrap: wrap; }
.sec-hd h2 { font-size: var(--md-headline-sm); }
.sec-hd .desc { color: var(--ink-3); font-size: 13.5px; margin-top: 4px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.chip {
  padding: 6px 14px; border-radius: var(--md-shape-full); border: 1px solid var(--line);
  background: var(--panel); color: var(--ink-2); cursor: pointer; font-size: 13px; transition: border-color var(--md-duration-short) var(--md-ease-standard), var(--transition-theme); font-weight: 500;
}
.chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.chip:hover::after { opacity: var(--md-hover-opacity); }
.chip.on { background: var(--md-secondary-container); border-color: var(--md-secondary-container); color: var(--md-on-secondary-container); font-weight: 600; }
.chip.on::after { opacity: 0; }
.chip .c { opacity: .65; font-size: 12px; margin-left: 3px; }

.grid-eq { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.eq-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m);
  overflow: hidden; display: flex; flex-direction: column; transition: .18s, var(--transition-theme); cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.eq-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--brand); }
.eq-card:active { transform: scale(.98); }
.eq-thumb {
  position: relative; aspect-ratio: 4 / 3; background: var(--line-2) center/contain no-repeat;
  display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line-2);
  transition: var(--transition-theme);
}
.eq-thumb img { width: 100%; height: 100%; object-fit: contain; object-position: center; padding: 8px; display: block; }
.eq-thumb .ph { color: var(--ink-4); font-size: 12px; }
.eq-cat {
  position: absolute; left: 9px; top: 9px; padding: 3px 9px; border-radius: 100px;
  background: rgba(255,255,255,.94); font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  border: 1px solid var(--line);
}
.eq-body { padding: 13px 14px 14px; display: flex; flex-direction: column; flex: 1; gap: 7px; }
.eq-code { font-size: 11.5px; color: var(--ink-4); letter-spacing: .04em; font-weight: 600; }
.eq-name { font-size: 14.5px; font-weight: 650; line-height: 1.4; }
.eq-purpose {
  font-size: 12.5px; color: var(--ink-3); line-height: 1.55; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.eq-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 9px; border-top: 1px solid var(--line-2); }

/* ---------------- 设备详情 ---------------- */
.crumb { padding: 16px 0 4px; font-size: 13px; color: var(--ink-3); }
.crumb a:hover { color: var(--brand-dark); }
.crumb span { margin: 0 6px; color: var(--ink-4); }

.detail-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; padding: 18px 0 40px; align-items: start; }
.gallery-main {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m);
  aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; object-position: center; padding: 12px; display: block; }
.gallery-thumbs { display: flex; gap: 9px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumbs div {
  width: 62px; height: 50px; border: 1px solid var(--line); border-radius: var(--r-s);
  overflow: hidden; cursor: pointer; background: var(--panel); padding: 3px; transition: .15s, var(--transition-theme);
}
.gallery-thumbs div.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-light); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: contain; object-position: center; padding: 2px; display: block; }
.image-fit-stage { position:relative; width:100%; max-width:640px; margin:0 auto; aspect-ratio:4/3; overflow:hidden; background:#f4f7f5; border:1px solid var(--line); border-radius:8px; cursor:grab; touch-action:none; }
.image-fit-stage:active { cursor:grabbing; }
.image-fit-stage canvas { width:100%; height:100%; display:block; }
.image-fit-guide { position:absolute; inset:0; display:grid; place-items:end center; padding:8px; color:rgba(30,50,42,.6); font-size:11px; pointer-events:none; }
.image-fit-scale { display:flex; align-items:center; gap:10px; margin:14px auto 4px; max-width:640px; font-size:13px; }
.image-fit-scale input { flex:1; accent-color:var(--brand); }
.image-fit-scale b { min-width:42px; text-align:right; color:var(--brand-dark); }

.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.spec-item { padding: 11px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; }
.spec-item .k { color: var(--ink-3); font-size: 13px; flex: none; width: 96px; }
.spec-item .v { font-size: 13px; font-weight: 550; word-break: break-word; }

/* 设备详情补充：位置元信息 / 预约单元卡片（原缺样式，统一补入） */
.eq-loc { font-size: 12.5px; color: var(--ink-3); }
.book-box { background: var(--brand-fade); border: 1px solid var(--line); border-radius: var(--r-m); padding: 16px; }
.big { font-size: 22px; font-weight: 700; color: var(--ink-1); line-height: 1.2; }

/* ---------------- 预约日历 ---------------- */
.cal-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; padding-bottom: 44px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; touch-action: pan-y; user-select: none; }
.cal-dow {
  text-align: center; font-size: 12px; color: var(--ink-3); font-weight: 600;
  padding: 4px 0;
}
.cal-dow.wknd { color: #b95d2f; }
.cal-day {
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
  padding: 4px 4px 5px; min-height: 84px; display: flex; flex-direction: column; gap: 3px;
  position: relative; transition: var(--transition-theme), transform .12s;
  overflow: hidden;
}
.cal-day.empty { border: 0; background: transparent; }
.cal-day.today { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-light); }
.cal-day.today .num { color: var(--brand); font-weight: 700; }
.cal-day .dnum {
  font-size: 12.5px; font-weight: 650; color: var(--ink-2);
  display: flex; justify-content: center; align-items: center;
  position: relative; min-height: 20px;
}
.cal-day .dnum .num { font-size: 13px; line-height: 1; }
.cal-day.weekend .dnum .num { color: #b95d2f; }
.cal-day .dnum .holiday-tag {
  position: absolute; top: -2px; right: -2px;
  font-size: 9.5px; font-weight: 700; line-height: 1;
  padding: 2px 5px; border-radius: 100px;
  background: var(--danger); color: #fff;
  max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(214,69,69,.3);
}
.cal-day .dnum .holiday-tag.lunar { background: #d97757; }
.cal-day .dnum .holiday-tag.legal { background: var(--danger); }
.cal-day .dnum .holiday-tag.solar { background: #6a9bcc; }
.cal-day.holiday { background: #fff8f6; }
[data-theme="dark"] .cal-day.holiday { background: #2a1a18; border-color: #b93a3a; }
.slot {
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 5px;
  font-size: 11px; cursor: pointer; transition: .12s; display: flex;
  align-items: center; justify-content: center; gap: 3px; background: var(--panel); line-height: 1.5;
  min-height: 22px;
}
.slot .lb { font-weight: 600; }
.slot.available:hover { border-color: var(--brand); background: var(--brand-fade); }
.slot.picked { background: var(--brand); border-color: var(--brand); color: #fff; }
.slot.occupied { background: #fdeaea; border-color: #f6d5d5; color: #b93a3a; cursor: not-allowed; }
.slot.blocked  { background: #fdf3e0; border-color: #f4e3c0; color: #a86c05; cursor: not-allowed; }
.slot.past, .slot.closed { background: #f5f7f6; border-color: var(--line-2); color: var(--ink-4); cursor: not-allowed; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); align-items: center; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; border: 1px solid var(--line); }
.legend .holiday-key { display: inline-flex; align-items: center; gap: 5px; }
.legend .holiday-key .lk-dot { width: 8px; height: 8px; border-radius: 100px; background: var(--danger); display: inline-block; }

.cart { position: sticky; top: calc(var(--nav-h) + 16px); }
.cart-items { max-height: 260px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.cart-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px;
}
.cart-item .x { color: var(--ink-4); cursor: pointer; padding: 0 4px; font-size: 15px; line-height: 1; }
.cart-item .x:hover { color: var(--danger); }

/* 批量预约清单（多设备） */
.batch-dev { padding: 11px 0; border-bottom: 1px dashed var(--line); }
.batch-dev:first-child { padding-top: 4px; }
.batch-dev:last-child { border-bottom: 0; }
.batch-dev-hd { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.batch-dev-hd .eqnm { font-size: 13px; font-weight: 600; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-dev-hd .x { color: var(--ink-4); cursor: pointer; padding: 0 5px; font-size: 17px; line-height: 1; border-radius: 6px; }
.batch-dev-hd .x:hover { color: var(--danger); background: #fdf3f3; }
.batch-dev .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-sm {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px 3px 10px; border-radius: 100px; border: 1px solid var(--line);
  background: var(--brand-fade); color: var(--brand-dark); font-size: 11.5px; font-weight: 600;
}
.chip-sm .xc { cursor: pointer; width: 15px; height: 15px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--md-primary-container); color: var(--md-on-primary-container); font-size: 11px; line-height: 1; }
.chip-sm .xc:hover { background: var(--brand); color: var(--md-on-primary); }

/* 批量预约结果弹窗 */
.batch-result { display: flex; flex-direction: column; gap: 9px; }
.batch-result .res-sec { margin-top: 4px; border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; }
.batch-result .res-h { padding: 8px 12px; font-size: 12.5px; font-weight: 700; }
.batch-result .res-h.ok { background: #e4f7ef; color: #0a7a56; }
.batch-result .res-h.bad { background: #fdeaea; color: #b93a3a; }
.batch-result .res-list { padding: 8px 12px; display: flex; flex-direction: column; gap: 7px; max-height: 220px; overflow-y: auto; }
.batch-result .res-list .row-b { font-size: 13px; gap: 10px; }
.batch-result .align-start { align-items: flex-start; }
.batch-result .fail-reason { max-width: 230px; white-space: normal; text-align: left; line-height: 1.4; }

/* ---------------- 状态 / 空态 ---------------- */
.empty { text-align: center; padding: 54px 20px; color: var(--ink-3); }
.empty .ico { font-size: 34px; opacity: .35; margin-bottom: 10px; }
.skeleton { background: linear-gradient(90deg, #eef2f0 25%, #f7faf9 50%, #eef2f0 75%);
  background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: var(--r-s); }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-card { height: 250px; border-radius: var(--r-m); }

/* ---------------- Toast / Modal ---------------- */
.toast-box { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 18px; border-radius: 8px; background: #16241f; color: #fff;
  font-size: 13.5px; box-shadow: var(--shadow-3); animation: tin .22s ease;
  max-width: 90vw; text-align: center;
}
.toast.ok { background: #0a7a56; }
.toast.err { background: #b93a3a; }
@keyframes tin { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

.mask { position: fixed; inset: 0; background: rgba(16,32,27,.42); z-index: 200; display: grid; place-items: center; padding: 20px; animation: fin .16s; }
@keyframes fin { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--panel); border-radius: var(--r-l); width: 100%; max-width: 520px;
  box-shadow: var(--shadow-3); max-height: 88vh; display: flex; flex-direction: column; animation: min .2s; transition: var(--transition-theme);
}
@keyframes min { from { transform: translateY(14px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-hd { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; }
.modal-hd h3 { font-size: 16px; }
.modal-bd { padding: 18px 20px; overflow-y: auto; }
.modal-ft { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 10px; }
.close-x { background: none; border: 0; font-size: 20px; color: var(--ink-4); cursor: pointer; line-height: 1; padding: 2px 4px; }
.close-x:hover { color: var(--ink-1); }

/* ---------------- 页脚 ---------------- */
.foot { border-top: 1px solid var(--line); background: var(--panel); margin-top: 40px; padding: 26px 0; color: var(--ink-3); font-size: 12.5px; transition: var(--transition-theme); }
.foot .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-icp { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 8px; width: 100%; }
.foot-icp a { color: var(--ink-3); text-decoration: none; }
.foot-icp a:hover { color: var(--brand); text-decoration: underline; }
.foot-icp .beian-link { display: inline-flex; align-items: center; gap: 4px; }

/* ---------------- 管理后台 ---------------- */
.admin-layout { display: grid; grid-template-columns: 208px 1fr; min-height: calc(100vh - var(--nav-h)); }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 16px 12px; transition: var(--transition-theme); }
.side .g { font-size: 11px; color: var(--ink-4); font-weight: 700; letter-spacing: .06em; padding: 12px 10px 6px; }
.side a {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: var(--md-shape-full);
  color: var(--ink-2); font-size: 13.5px; cursor: pointer; font-weight: 500; transition: color var(--md-duration-short) var(--md-ease-standard);
}
.side a .side-ico { flex: 0 0 22px; display: flex; align-items: center; justify-content: center; }
.side a:hover { color: var(--ink-1); }
.side a:hover::after { opacity: var(--md-hover-opacity); }
.side a.on { background: var(--md-secondary-container); color: var(--md-on-secondary-container); font-weight: 650; }
.side a.on::after { opacity: 0; }
.side a:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: var(--md-shape-full); }
.admin-main { padding: 22px 24px 50px; overflow-x: hidden; background: var(--bg); transition: var(--transition-theme); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-m); padding: 15px 16px; transition: box-shadow .18s, var(--transition-theme); }
.kpi:hover { box-shadow: 0 2px 12px rgba(0,0,0,.06); }
[data-theme="dark"] .kpi:hover { box-shadow: var(--shadow-2); }
.kpi .l { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi .n { font-size: 25px; font-weight: 700; letter-spacing: -.02em; margin-top: 5px; }
.kpi .s { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }
.kpi.hl { background: linear-gradient(135deg, var(--brand-fade), var(--panel)); border-color: var(--brand-light); }
.kpi.hl .n { color: var(--brand-dark); }

.bar-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 12.5px; }
.bar-row .nm { width: 168px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 9px; background: var(--line-2); border-radius: 100px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), #2fc795); border-radius: 100px; transition: width .5s; }
.bar-row .vl { width: 92px; text-align: right; flex: none; color: var(--ink-2); font-weight: 600; }

.pager { display: flex; gap: 6px; justify-content: center; padding: 16px 0 4px; align-items: center; }
.pager button { min-width: 32px; height: 32px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 13px; transition: border-color var(--md-duration-short) var(--md-ease-standard), var(--transition-theme); }
.pager button:hover::after { opacity: var(--md-hover-opacity); }
.pager button.on { background: var(--brand); border-color: var(--brand); color: var(--md-on-primary); font-weight: 600; }
.pager button:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  padding: 9px 15px; border: 0; background: none; cursor: pointer; color: var(--ink-3);
  font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color var(--md-duration-short) var(--md-ease-standard), border-color var(--md-duration-short) var(--md-ease-standard);
}
.tabs button:hover { color: var(--ink-1); }
.tabs button:hover::after { opacity: var(--md-hover-opacity); }
.tabs button.on { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 650; }

/* 迷你折线图 */
.spark { width: 100%; height: 132px; display: block; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1199px) {
  .grid-eq { grid-template-columns: repeat(3, 1fr); }
  .cal-wrap { grid-template-columns: 1fr; }
  .cart { position: static; }
  .admin-layout { grid-template-columns: 176px 1fr; }
}
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .spec-list { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .wrap { padding: 0 clamp(12px, 3vw, 14px); }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0; background: var(--panel);
    flex-direction: column; padding: 8px 14px 14px; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-2); display: none; gap: 2px;
    transition: var(--transition-theme);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 12px; }
  .menu-btn { display: block; }
  /* 导航栏移动端收窄：避免 nav-right 溢出导致页面横向滚动 */
  .nav-right { gap: 4px; }
  .nav-right .small.muted { display: none; }
  .nav-right #logoutBtn { display: inline-flex; padding: 6px 8px; min-height: 32px; }
  .nav-right a.btn[href*="tab=reg"] { display: none; }
  .logo-text { font-size: 13px; }
  .logo-text small { display: none; }
  .hero .wrap { padding-top: clamp(28px, 6vw, 34px); padding-bottom: clamp(28px, 5vw, 34px); }
  .hero h1 { font-size: clamp(22px, 5.5vw, 26px); }
  .hero p.sub { font-size: clamp(12.5px, 2.5vw, 14px); }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 16px 10px; margin-top: 26px; }
  .hero-stats .n { font-size: clamp(18px, 5vw, 22px); }
  .grid-eq { grid-template-columns: repeat(2, 1fr); gap: clamp(10px, 2vw, 12px); }
  .eq-body { padding: 10px 11px 12px; }
  .eq-name { font-size: 13.5px; }
  .eq-purpose { -webkit-line-clamp: 2; font-size: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .cal-grid { gap: 4px; }
  .cal-day { min-height: 72px; padding: 3px 3px 4px; gap: 2px; }
  .cal-day .dnum .num { font-size: 12px; }
  .cal-day .dnum .holiday-tag { font-size: 8.5px; padding: 1px 4px; max-width: 90%; }
  .slot { font-size: 10px; padding: 2px 3px; min-height: 20px; }
  .sec-hd h2 { font-size: clamp(16px, 3.5vw, 18px); }
  .admin-layout { grid-template-columns: 1fr; }
  .side { display: none; }
  .admin-main { padding: 16px clamp(12px, 3vw, 14px) 40px; }
  .modal { max-width: 100%; }
  .btn-lg { padding: 11px 22px; font-size: 14.5px; }
  .bottom-bar { display: block; }
  .table-scroll .tbl th:nth-child(n+5),
  .table-scroll .tbl td:nth-child(n+5) {
    display: none;
  }
  .table-scroll .tbl th:nth-child(1),
  .table-scroll .tbl th:nth-child(2),
  .table-scroll .tbl td:nth-child(1),
  .table-scroll .tbl td:nth-child(2) {
    display: table-cell;
  }
}
@media (max-width: 380px) {
  .grid-eq { grid-template-columns: 1fr; }
}
/* ---------------- 图片管理器 ---------------- */
.btn-xs { font-size: 11px; padding: 3px 8px; border-radius: 4px; line-height: 1.4; }
.img-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.img-cell {
  position: relative; aspect-ratio: 4/3;
  border: 1px solid var(--line); border-radius: var(--r-s);
  overflow: hidden; background: var(--panel);
}
.img-cell img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.img-cover { position: absolute; top: 5px; left: 5px; font-size: 10px; z-index: 1; }
.img-mask {
  position: absolute; inset: 0;
  background: rgba(16, 32, 27, .55);
  display: flex; align-items: center; justify-content: center; gap: 5px;
  opacity: 0; transition: opacity .15s; flex-wrap: wrap; padding: 8px;
}
.img-cell:hover .img-mask { opacity: 1; }
/* 触屏设备无 hover：遮罩常显，仅底部渐变加深 + 按钮靠下，图片主体保持清晰 */
@media (hover: none) {
  .img-mask {
    opacity: 1;
    background: linear-gradient(180deg, rgba(16, 32, 27, 0) 50%, rgba(16, 32, 27, .78) 100%);
    align-items: flex-end;
  }
}
@media (max-width: 600px) { .img-grid { grid-template-columns: repeat(2, 1fr); } }

/* ================= 无障碍与交互增强 ================= */
/* MD3 焦点环：2px primary + 2px surface 间隙（双层 box-shadow，WCAG 2.4.7） */
:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--md-surface-container-lowest), 0 0 0 4px var(--md-primary);
  border-radius: var(--md-shape-sm);
}
a:focus-visible, button:focus-visible, .btn:focus-visible, .chip:focus-visible,
.side a:focus-visible, .tabs button:focus-visible, .pager button:focus-visible,
.pw-toggle:focus-visible, .theme-btn:focus-visible, .btab:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--md-surface-container-lowest), 0 0 0 4px var(--md-primary);
}
/* 文本输入：focus 用 primary 边框 + 柔和光环（MD3 文本字段 focus 态） */
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--md-primary);
  box-shadow: 0 0 0 3px var(--md-primary-container);
}

/* 跳到主要内容（WCAG 2.4.1）：键盘 Tab 首个可聚焦元素 */
.skip-link {
  position: absolute; left: 14px; top: -60px; z-index: 300;
  background: var(--brand); color: #fff; padding: 10px 18px;
  border-radius: 8px; font-weight: 600; transition: top .2s ease;
  box-shadow: var(--shadow-2);
}
.skip-link:focus { top: 12px; }

/* 滚动渐显（趋势：motion as meaning；无 JS / 减少动效时不隐藏内容） */
.reveal-ready .reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal-ready .reveal.in { opacity: 1; transform: none; }

/* 触控命中区 ≥ 40px（趋势：可点性） */
.btn { min-height: 40px; }

/* 尊重用户的「减少动效」偏好（WCAG 2.3.3 / 性能） */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .marquee-track { animation: none !important; }
  .reveal-ready .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
/* 升级/重启提示横幅 */
.note-restart { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:4px;
  padding:10px 16px; background:var(--brand-fade); border-bottom:1px solid var(--line-2);
  color:var(--ink-2); font-size:13px; text-align:center; }
.note-restart code { background:#fff; padding:3px 8px; border-radius:4px; font-size:11px; border:1px solid var(--line-2); }
.note-restart button { border:none; background:var(--brand); color:#fff; padding:4px 12px; border-radius:4px; font-size:12px; cursor:pointer; }

/* 通知轮播条 */
.notify-bar { background:var(--brand-fade); border-bottom:1px solid var(--md-outline-variant); overflow:hidden; position:relative; }
.notify-bar:empty { display:none; }
.notify-track { display:flex; gap:12px; padding:7px 16px; white-space:nowrap; }
.notify-item { display:inline-flex; align-items:center; gap:5px; background:#fff; border:1px solid var(--line-2);
  padding:4px 10px; border-radius:16px; font-size:12.5px; color:var(--ink-2); text-decoration:none;
  transition:background .2s; flex-shrink:0; position:relative; }
.notify-item:hover { background:var(--brand); color:#fff; border-color:var(--brand); }
.notify-icon { font-size:14px; }
.notify-badge { background:var(--danger,#e05050); color:#fff; font-size:10.5px; font-weight:700;
  min-width:17px; height:17px; line-height:17px; text-align:center; border-radius:9px; padding:0 4px; }
.notify-item:hover .notify-badge { background:#fff; color:var(--danger); }
/* 横向溢出时启用原生滑动（无重复内容，纯单向手势/鼠标拖动） */
.notify-track { overflow-x:auto; -webkit-overflow-scrolling:touch;
  scrollbar-width:thin; scrollbar-color:var(--line-2) transparent; }
.notify-track::-webkit-scrollbar { height:4px; }
.notify-track::-webkit-scrollbar-thumb { background:var(--line-2); border-radius:2px; }
.notify-track::-webkit-scrollbar-track { background:transparent; }
/* 少量项时居中，不启用滚动 */
.notify-track:not(:has(.notify-item:nth-child(6))) { justify-content:center; }
.notify-track:has(.notify-item:nth-child(6)) { justify-content:flex-start; }

/* ---------- 登录页公告栏（后台可配置） ---------- */
.login-announce{
  margin:18px 0 0;
  padding:13px 15px;
  background:var(--brand-fade);
  border:1px solid var(--line);
  border-left:3px solid var(--brand);
  border-radius:var(--r-m);
  color:var(--ink-2);
}
.login-announce .la-head{ display:flex; align-items:center; gap:7px; margin-bottom:6px; }
.login-announce .la-ico{ font-size:15px; line-height:1; }
.login-announce .la-title{ font-size:13px; font-weight:650; color:var(--brand-dark); }
.login-announce .la-body{
  font-size:13px; line-height:1.85;
  white-space:pre-wrap; word-break:break-word;
}
@media (prefers-reduced-motion:reduce){
  .login-announce{ transition:none; }
}

/* ---------------- UI 优化（2026-08-10）：排版、布局与操作一致性 ---------------- */
/* 按钮组 / 筛选工具栏：统一间距、窄屏自动换行 */
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dryroom-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); gap:8px; }
.dryroom-option { display:flex; align-items:center; gap:7px; min-height:40px; padding:8px 10px; border:1px solid var(--line); border-radius:var(--r-s); background:var(--panel); }
.dryroom-option input { flex:none; }
.radio-stack { display:grid; gap:8px; }
.radio-stack label { display:flex; align-items:flex-start; gap:8px; line-height:1.5; }
.dryroom-record { display:grid; grid-template-columns:140px 1.2fr 1.5fr auto; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); align-items:center; }
.cal-day.past { background:var(--bg); color:var(--ink-4); }
.dryroom-my-list { display:grid; gap:12px; }
.dryroom-my-card { overflow:hidden; }
.dryroom-my-head { gap:12px; align-items:flex-start; }
.dryroom-my-detail { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 24px; margin:16px 0 0; }
.dryroom-my-detail > div { min-width:0; }
.dryroom-my-detail .wide { grid-column:1/-1; }
.dryroom-my-detail dt { margin:0 0 4px; color:var(--ink-3); font-size:12px; }
.dryroom-my-detail dd { margin:0; line-height:1.65; overflow-wrap:anywhere; }
.dryroom-type-list { display:flex; flex-wrap:wrap; gap:6px; }
.dryroom-admin-cards { display:none; }
.dryroom-admin-stats { grid-template-columns:repeat(3,minmax(0,1fr)); margin-bottom:16px; }
.dryroom-popular { font-size:20px!important; overflow-wrap:anywhere; }
.dryroom-admin-card-head { gap:12px; align-items:flex-start; }
.dryroom-admin-detail { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 18px; margin:15px 0 0; }
.dryroom-admin-detail > div { min-width:0; }
.dryroom-admin-detail .wide { grid-column:1/-1; }
.dryroom-admin-detail dt { margin:0 0 3px; color:var(--ink-3); font-size:12px; }
.dryroom-admin-detail dd { margin:0; line-height:1.65; overflow-wrap:anywhere; }
.dryroom-admin-actions { margin-top:14px; padding-top:12px; border-top:1px solid var(--line); }
@media(max-width:767px){.dryroom-options{grid-template-columns:repeat(2,minmax(0,1fr))}.dryroom-record{grid-template-columns:1fr;gap:4px}}
@media(max-width:520px){.dryroom-my-detail{grid-template-columns:1fr;gap:10px}.dryroom-my-detail .wide{grid-column:auto}.dryroom-option{padding:7px 8px}.dryroom-option span{overflow-wrap:anywhere}.dryroom-admin-table{display:none}.dryroom-admin-cards{display:grid;gap:12px}.dryroom-admin-detail{grid-template-columns:1fr}.dryroom-admin-detail .wide{grid-column:auto}.dryroom-admin-actions .btn{flex:1}.dryroom-admin-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.dryroom-admin-stats .kpi:last-child{grid-column:1/-1}.admin-main{padding-bottom:92px}}
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
/* 移动卡片操作栏：按钮多时自动换行，避免挤压 */
.mt-card-mobile .mtm-act { flex-wrap: wrap; }
.mt-card-mobile .mtm-act button { flex: 1 1 86px; }
/* 移动端 KPI 卡：4 列 → 2 列，间距收紧 */
@media (max-width: 767px) {
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi .n { font-size: 21px; }
}
/* 表格操作列：按钮紧凑排布 */
.tbl td.nowrap .btn + .btn { margin-left: 2px; }
/* 弹窗标题与正文区对齐 */
.modal-hd { align-items: center; }
.modal-bd { padding-top: 2px; }
/* 表单网格在弹窗内统一左右对齐 */
.modal .form-grid .field { min-width: 0; }
/* 设备状态卡网格：卡片内部纵向对齐 */
.eq-grid .card { display: flex; flex-direction: column; }
.eq-grid .card > div:last-child { margin-top: auto; display: flex; justify-content: center; align-items: center; gap: 8px; padding-top: 10px; }
/* 移动端：无卡片替代的表格隐藏非关键列（用户管理/角色权限等） */
@media (max-width: 767px) {
  .table-scroll .tbl th.hide-m, .table-scroll .tbl td.hide-m { display: none; }
}
