:root {
  --bg: #0a1428;
  --panel: rgba(21, 34, 61, .58);
  --panel-solid: #16243f;
  --panel-2: rgba(31, 49, 84, .5);
  --line: rgba(122, 163, 255, .2);
  --line-strong: rgba(122, 163, 255, .38);
  --text: #eaf2ff;
  --muted: #9fb3d6;
  --accent: #3d8bff;
  --accent-2: #29d5ff;
  --accent-press: #2f74e8;
  --danger: #ff5d6c;
  --ok: #37d67a;
  --warn: #ffb02e;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(2, 8, 24, .5);
  --glow: 0 0 18px rgba(61, 139, 255, .45);
  --tap: 56px;
}

/* 统一兜底：组件里的 display 会盖掉浏览器默认的 [hidden]{display:none}
   （例如 .login-wrap{display:flex} 会让后台「登录成功后隐藏登录界面」失效，
    .toolbar{display:flex} 会让未登录时的标签栏照样显示） */
[hidden] { display: none !important; }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #0a1428;
}

body {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "苹方-简", "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(15px, 1.1vw + 8px, 19px);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  /* 科技蓝渐变底：深蓝底 + 三团柔光，给毛玻璃提供可透出的层次 */
  background:
    radial-gradient(1100px 760px at 12% -8%, rgba(61, 139, 255, .30), transparent 60%),
    radial-gradient(900px 680px at 100% 0%, rgba(41, 213, 255, .16), transparent 55%),
    radial-gradient(960px 760px at 50% 118%, rgba(120, 96, 255, .20), transparent 60%),
    linear-gradient(160deg, #0a1428 0%, #0b1830 45%, #0a1428 100%);
  background-attachment: fixed;
}

/* 毛玻璃通用质感：半透明面板 + 模糊 + 饱和度提升 */
.topbar, .sidebar, .card, .row, .login-card, .auth-card, .ota-card, .drawer, .modal,
.fw-modal, .menu-form, .menu-edit, .vin-card, .res-card {
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }

/* ---------- 布局：横屏左侧导航，竖屏顶部导航 ---------- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .5px;
}

.brand .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.cats .cat {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
  font-size: .95rem;
  cursor: pointer;
}

.cats .cat.on {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 14px rgba(61, 139, 255, .32);
}

.brand .brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--panel-2);
}

.topbar .spacer { flex: 1; }
.stat-chip {
  color: var(--muted);
  font-size: .85rem;
  white-space: nowrap;
}

.body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav button {
  min-width: 96px;
  height: var(--tap);
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.nav button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(61, 139, 255, .3);
}

.sidebar {
  width: 190px;
  flex: 0 0 190px;
  padding: 16px 12px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar button {
  height: var(--tap);
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  padding: 0 16px;
  cursor: pointer;
}

.sidebar button.active {
  background: linear-gradient(135deg, rgba(61,139,255,.22), rgba(41,213,255,.10));
  border-color: var(--line-strong);
  color: var(--text);
}

.main {
  flex: 1;
  min-width: 0;
  padding: 16px 18px 40px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search {
  flex: 1;
  min-width: 200px;
  height: var(--tap);
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  outline: none;
}

.search:focus { border-color: var(--accent); }

/* ---------- 卡片网格 ---------- */
.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}

.card:hover, .card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  outline: none;
  box-shadow: 0 8px 26px rgba(61, 139, 255, .22);
}

.thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb.wide { aspect-ratio: 16 / 9; }

.card .title {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.card .meta {
  color: var(--muted);
  font-size: .8rem;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card .desc {
  color: var(--muted);
  font-size: .82rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.btn {
  height: 48px;
  min-width: 96px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 4px 18px rgba(61, 139, 255, .35); }
.btn-primary:active { background: var(--accent-press); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-ghost { background: rgba(31, 49, 84, .4); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .15s linear;
}

/* ---------- 详情抽屉 ---------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  z-index: 40;
  display: none;
}
.drawer-mask.show { display: block; }

.drawer {
  position: fixed;
  z-index: 41;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  transform: translateY(100%);
  transition: transform .22s ease;
}

.drawer.show { transform: translateY(0); }

.drawer .head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer .head h2 {
  margin: 0;
  font-size: 1.3rem;
  flex: 1;
  min-width: 0;
}

.drawer .cover {
  width: 100%;
  border-radius: 12px;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 3rem;
  font-weight: 700;
}
.drawer .cover img { width: 100%; display: block; object-fit: contain; max-height: 42vh; }

.kv {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px 12px;
  color: var(--muted);
  font-size: .9rem;
}
.kv b { color: var(--text); font-weight: 600; }

.detail-desc {
  background: var(--panel-2);
  border-radius: 12px;
  padding: 14px;
  color: var(--muted);
  white-space: pre-wrap;
  max-height: 30vh;
  overflow: auto;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.actions .btn { flex: 1; min-width: 120px; }

/* 横屏：右侧抽屉 */
@media (orientation: landscape) and (min-width: 820px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
  .drawer {
    top: 0;
    right: 0;
    bottom: 0;
    width: 420px;
    border-radius: 14px 0 0 14px;
    transform: translateX(100%);
  }
  .drawer.show { transform: translateX(0); }
}

/* 竖屏：底部抽屉 */
@media (orientation: portrait), (max-width: 819px) {
  .drawer {
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 88vh;
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
  }
}

/* 横屏显示侧边栏，竖屏切换成顶部 tab */
.sidebar { display: none; }
@media (orientation: landscape) and (min-width: 900px) {
  .sidebar { display: flex; }
  .nav { display: none; }
}

/* ---------- 状态 ---------- */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
}
.empty .big { font-size: 3rem; margin-bottom: 10px; }

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: rgba(20, 22, 28, .96);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-width: 80vw;
}
.toast.err { border-color: var(--danger); color: #ffd9d9; }
.toast.ok { border-color: var(--ok); }

.skeleton {
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 37%, var(--panel) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
  border-radius: 12px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- 页面模块（后台可配置） ---------- */
.module { margin-bottom: 28px; }

.module-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.module-head h2 {
  margin: 0;
  font-size: 1.15rem;
  white-space: nowrap;
}
.module-head .line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.banner {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-2);
  cursor: pointer;
}
.banner .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .45s ease;
}
.banner .slide.active { opacity: 1; }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 20px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
  font-weight: 700;
  font-size: 1.05rem;
}
.banner .dots {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: flex;
  gap: 6px;
}
.banner .dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
}
.banner .dots i.on { background: #fff; }

.notice {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--muted);
  white-space: pre-wrap;
}
.notice.warn { border-left-color: var(--warn); }

.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.rank-item:hover, .rank-item:focus-visible { border-color: var(--accent); outline: none; }
.rank-item .no {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
  flex: 0 0 28px;
}
.rank-item.top1 .no { background: var(--accent); color: #fff; }
.rank-item .thumb-mini {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel-2);
  flex: 0 0 44px;
}
.rank-item .info { flex: 1; min-width: 0; }
.rank-item .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item .s { color: var(--muted); font-size: .8rem; }

.html-block { color: var(--text); }
.html-block img { max-width: 100%; }

/* ---------- 管理端 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.login-card h1 { margin: 0 0 6px; font-size: 1.4rem; }
.login-card p { margin: 0 0 20px; color: var(--muted); font-size: .9rem; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { color: var(--muted); font-size: .85rem; }
.field input, .field textarea, .field select {
  height: var(--tap);
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  outline: none;
}
.field textarea { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }

.dropzone {
  border: 2px dashed var(--line);
  border-radius: 14px;
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  background: var(--panel-2);
}
.dropzone.over { border-color: var(--accent); color: var(--text); background: rgba(79, 140, 255, .1); }

.table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.row .icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-weight: 700;
  flex: 0 0 52px;
}
.row .icon img { width: 100%; height: 100%; object-fit: cover; }
.row .info { flex: 1; min-width: 0; }
.row .info .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .info .s { color: var(--muted); font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .ops { display: flex; gap: 8px; }
.row .ops .btn { height: 44px; min-width: 68px; padding: 0 12px; font-size: .9rem; }

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 18, .55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: auto;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
}
.modal h3 { margin: 0 0 16px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* ---------- 注册 / 登录引导 ---------- */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(7, 14, 28, .86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
}
.auth-gate[hidden] { display: none; }
.auth-card {
  width: min(940px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 22px 20px;
}
.auth-head h1 { margin: 0 0 6px; font-size: 1.5rem; }
.auth-head p { margin: 0; color: var(--muted); font-size: .95rem; }
.auth-tabs { display: flex; gap: 10px; margin: 16px 0 12px; flex-wrap: wrap; }
.auth-steps { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.auth-steps[hidden] { display: none; }
.auth-steps .step {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font-size: .88rem;
}
.auth-steps .step.on { color: var(--text); border-color: var(--accent); background: rgba(79, 140, 255, .16); }
.auth-steps .step.done { color: var(--ok); border-color: rgba(53, 199, 89, .5); }
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  max-height: 48vh;
  overflow: auto;
  padding: 4px;
}
.pick {
  min-height: var(--tap);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
  text-align: left;
}
.pick span { color: var(--muted); font-size: .8rem; }
.pick.on { border-color: var(--accent); background: rgba(79, 140, 255, .16); }
.pick b { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
/* 智驾版筛选 chip 与徽标 */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: .86rem;
  cursor: pointer;
}
.chip.on { border-color: var(--accent); background: rgba(79, 140, 255, .16); color: var(--accent); }
.tag-adas,
.badge-adas {
  display: inline-block;
  font-style: normal;
  font-size: .66rem;
  line-height: 1.5;
  padding: 1px 6px;
  border-radius: 6px;
  color: #0b3d91;
  background: #d6e4ff;
  border: 1px solid #b8ccff;
  white-space: nowrap;
}
.badge-level {
  display: inline-block;
  font-size: .66rem;
  line-height: 1.5;
  padding: 1px 6px;
  border-radius: 6px;
  color: #155724;
  background: #d4edda;
  border: 1px solid #b7dfc4;
  white-space: nowrap;
}
.badge-level.low { color: #7a5b00; background: #fff3cd; border-color: #ffe08a; }
.auth-form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.auth-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.auth-actions .btn { min-width: 160px; }

/* 心灵净化模块 */
.mind-grid {
  display: grid;
  grid-template-columns: repeat(var(--mind-cols, 3), minmax(0, 1fr));
  gap: 14px;
}
.mind-card { cursor: pointer; }
.mind-card .thumb.wide { aspect-ratio: 16 / 9; }
.mind-none {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}
.mind-card:hover { border-color: var(--accent); }

/* 站内预览层：URL 在页面内嵌展示，不跳转 */
.mind-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  flex-direction: column;
  background: var(--panel);
}
.mind-viewer.show { display: flex; }
.mind-viewer-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.mind-viewer-bar .spacer { flex: 1; }
.mind-viewer-bar b { font-size: 1rem; }
.mind-viewer-bar .btn { height: 38px; min-width: 84px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.mind-viewer-body { position: relative; flex: 1; min-height: 0; }
.mind-viewer-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.mind-viewer-tip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 14px;
  font-size: .82rem;
  color: var(--muted);
  background: var(--panel-2);
  border-top: 1px solid var(--line);
}
.mind-viewer-text { padding: 28px; line-height: 1.9; white-space: pre-wrap; }

/* OTA 车辆查询 */
.ota-wrap { max-width: 1180px; margin: 0 auto; padding: 18px; }
.ota-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ota-head h1 { font-size: 1.25rem; margin: 0; }
.ota-head .spacer { flex: 1; }
.ota-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ota-bar .search { flex: 1; min-width: 200px; }
.ota-brands { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.ota-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ota-card:hover { border-color: var(--accent); }
.ota-card .t { font-weight: 600; font-size: .98rem; }
.ota-card .v { color: var(--accent); font-size: .95rem; font-weight: 600; }
.ota-card .m { color: var(--muted); font-size: .8rem; }
.ota-status {
  display: inline-block;
  font-size: .7rem;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.ota-status.done { color: #155724; background: #d4edda; border-color: #b7dfc4; }
.ota-status.pushing { color: #7a5b00; background: #fff3cd; border-color: #ffe08a; }
.ota-login { max-width: 380px; margin: 12vh auto; }
.ota-empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- 后台：子菜单管理 ---------- */
.menu-form {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
  margin-bottom: 16px;
}
.menu-form-title { font-weight: 700; margin-bottom: 12px; }
.menu-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.menu-form-grid .field { min-width: 0; }
/* 图标字段整行独占，避免输入框和「上传图标」按钮挤在一列里重叠 */
.menu-field-wide { grid-column: 1 / -1; }
.icon-edit { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; }
.icon-edit input { flex: 1 1 auto; min-width: 0; height: var(--tap); padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); outline: none; }
.icon-edit input:focus { border-color: var(--accent); }
.icon-edit .btn { flex: none; white-space: nowrap; }
@media (max-width: 560px) {
  .icon-edit { flex-wrap: wrap; }
  .icon-edit input { flex: 1 1 160px; }
}
.menu-icon {
  width: 40px; height: 40px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); font-size: 1.25rem; overflow: hidden;
}
.menu-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.menu-name { font-weight: 600; font-size: .95rem; }
.menu-sub { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.menu-tag {
  display: inline-block; font-size: .7rem; padding: 1px 8px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.menu-tag.link { color: var(--accent); border-color: rgba(79,140,255,.45); background: rgba(79,140,255,.12); }
.menu-edit {
  border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--panel-2); padding: 14px; margin: 0 0 4px;
}
.menu-edit-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 10px;
}
/* 前台分类条带图标 */
.cat { display: inline-flex; align-items: center; gap: 6px; }
.ci { font-size: 1rem; line-height: 1; display: inline-flex; align-items: center; }
.ci img { width: 18px; height: 18px; border-radius: 4px; object-fit: cover; display: block; }
.cat .ci img { width: 18px; height: 18px; }
.cat .arrow { color: var(--accent); font-size: .8rem; }
.nav button .ci img, .sidebar button .ci img { width: 18px; height: 18px; }

/* 通知铃铛角标 */
.notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
  padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: .68rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.notif-item { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-item:last-child { border-bottom: none; }
.notif-item .nt { font-weight: 600; font-size: .92rem; }
.notif-item .nb { color: var(--muted); font-size: .82rem; margin-top: 4px; white-space: pre-wrap; line-height: 1.6; }
.notif-item .nd { color: var(--muted); font-size: .72rem; margin-top: 6px; }
.notif-empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* ---------- 图表弹窗 ---------- */
.chart-mask {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(4, 8, 18, .6);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.chart-modal {
  width: min(860px, 100%); max-height: 92vh; overflow: auto;
  background: rgba(20, 33, 58, .88);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--line-strong); border-radius: 20px; padding: 18px 20px;
  box-shadow: var(--shadow), 0 0 40px rgba(61, 139, 255, .18);
}
.chart-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.chart-head h3 { margin: 0; flex: 1; font-size: 1.1rem; }
.chart-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chart-tabs .chip { cursor: pointer; }
.chart-body { min-height: 200px; }
.chart-flex { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.chart-svg { display: block; max-width: 340px; width: 100%; height: auto; }
.chart-svg-wide { max-width: 100%; }
.chart-center-num { fill: #fff; font-size: 26px; font-weight: 700; }
.chart-center-label { fill: var(--muted); font-size: 12px; }
.chart-axis { fill: var(--muted); font-size: 10px; }
.chart-legend { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; }
.legend-row { display: flex; align-items: center; gap: 10px; font-size: .86rem; }
.legend-row i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend-row .lg-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.legend-row .lg-val { color: var(--muted); white-space: nowrap; }
.chart-tip { color: var(--muted); font-size: .78rem; margin-top: 10px; }
.chart-empty { text-align: center; color: var(--muted); padding: 40px 0; }

.tree-node { font-size: .88rem; }
.tree-row { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; }
.tree-row:hover { background: rgba(61, 139, 255, .1); }
.tree-connector { color: var(--line-strong); font-family: ui-monospace, Consolas, monospace; }
.tree-label { color: var(--text); }
.tv-count { color: var(--accent-2); font-weight: 600; margin-left: 4px; font-size: .8rem; }

/* ---------- 固件分类规则编辑 ---------- */
.dims-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.dims-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: 14px 16px;
}
.dims-card h4 { margin: 0 0 4px; font-size: 1rem; }
.dims-card .dims-desc { color: var(--muted); font-size: .78rem; margin: 0 0 12px; line-height: 1.6; }
.kw-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.kw-item {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 6px 3px 12px; font-size: .82rem;
}
.kw-item button { border: none; background: transparent; color: var(--danger); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; }
.kw-add { display: flex; gap: 8px; }
.kw-add input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); outline: none; }
.kw-add input:focus { border-color: var(--accent); }
.kw-add .btn { height: 40px; min-width: 56px; }
.kw-sub { color: var(--muted); font-size: .75rem; margin-top: 4px; }

@media (max-width: 640px) {
  .row { flex-wrap: wrap; }
  .row .ops { width: 100%; }
  .row .ops .btn { flex: 1; }
  .mind-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============ 车辆固件查询 ============ */
.fw-sidebar { width: 260px; flex: 0 0 260px; overflow: auto; }

/* 同步状态条 */
.fw-syncbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel-2); padding: 10px 14px; margin-bottom: 14px; font-size: .86rem;
}
.fw-syncbar b { font-weight: 600; }
.c-add { color: var(--ok); }
.c-upd { color: var(--accent); }
.c-del { color: var(--danger); }

/* 品牌 / 车系标签 */
.fw-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.fw-chip {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  border-radius: 999px; padding: 6px 16px; font-size: .86rem; cursor: pointer;
}
.fw-chip:hover { border-color: var(--accent); }
.fw-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.fw-chip-n { font-size: .72rem; opacity: .75; }
.fw-chip-loading { font-size: .8rem; color: var(--muted); }

/* 工具条 */
.fw-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fw-toolbar .search { flex: 1; min-width: 200px; height: 40px; }
.fw-count { font-size: .84rem; color: var(--muted); white-space: nowrap; }
.fw-sortseg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.fw-sortseg button {
  border: 0; background: var(--panel-2); color: var(--muted); height: 40px;
  padding: 0 14px; cursor: pointer; font-size: .84rem; border-right: 1px solid var(--line);
}
.fw-sortseg button:last-child { border-right: 0; }
.fw-sortseg button.active { background: var(--accent); color: #fff; }

/* 更新徽标 */
.fw-badge {
  display: inline-block; font-size: .68rem; padding: 2px 8px;
  border-radius: 999px; margin-left: 6px; vertical-align: 1px; font-weight: 500;
}
.b-today { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.b-3d { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.b-7d { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }

/* 行右侧：大小 / 日期 */
.fw-iside { flex: 0 0 auto; text-align: right; min-width: 110px; }
.fw-isize { font-size: .84rem; }
.fw-idate { font-size: .74rem; color: var(--muted); margin-top: 2px; }
@media (max-width: 640px) { .fw-iside { display: none; } }
.fw-side-title { font-size: .82rem; color: var(--muted); padding: 4px 8px 8px; letter-spacing: .04em; }
.fw-tree { display: flex; flex-direction: column; gap: 2px; }
.fw-node {
  display: flex; align-items: center; gap: 6px; height: 34px;
  border-radius: 8px; cursor: pointer; color: var(--text);
  font-size: .86rem; padding-right: 8px; white-space: nowrap;
}
.fw-node:hover { background: var(--panel-2); }
.fw-node.open > .fw-caret { transform: rotate(90deg); }
.fw-caret { width: 12px; color: var(--muted); font-size: .7rem; transition: transform .15s; }
.fw-nicon { flex: 0 0 auto; }
.fw-nname { overflow: hidden; text-overflow: ellipsis; }
.fw-kids { display: flex; flex-direction: column; gap: 2px; }

.fw-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.fw-stat {
  flex: 1; min-width: 110px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel-2); padding: 10px 14px; display: flex; flex-direction: column; gap: 2px;
}
.fw-stat b { font-size: 1.05rem; }
.fw-stat span { font-size: .76rem; color: var(--muted); }

.fw-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fw-bar .search { flex: 1; min-width: 200px; }
.fw-bar select {
  height: 44px; min-width: 130px; padding: 0 10px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
}

.fw-crumbs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.fw-crumb {
  border: 0; background: transparent; color: var(--accent); cursor: pointer;
  font-size: .9rem; padding: 2px 4px; border-radius: 6px;
}
.fw-crumb:hover { background: var(--panel-2); }
.fw-sep { color: var(--muted); }

.fw-mode { font-size: .84rem; color: var(--muted); margin-bottom: 10px; }

.fw-list { display: flex; flex-direction: column; gap: 8px; }
.fw-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2);
  cursor: pointer;
}
.fw-item:hover { border-color: var(--accent); }
.fw-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fw-iicon { font-size: 1.3rem; flex: 0 0 auto; width: 28px; text-align: center; }
.fw-imain { flex: 1; min-width: 0; }
.fw-iname { font-weight: 600; font-size: .94rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fw-imeta { display: flex; gap: 12px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: 2px; }
.fw-iops { display: flex; gap: 8px; flex: 0 0 auto; }
.fw-iops .btn { height: 38px; min-width: 72px; }
.fw-empty { padding: 40px; text-align: center; color: var(--muted); }
.fw-more { padding: 16px; text-align: center; }

/* 批量选择 */
.fw-pick { flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.fw-item.is-picked { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel-2)); }
.fw-batchbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  border: 1px solid var(--accent); border-radius: var(--radius); background: var(--panel-2);
  font-size: .86rem;
}
.fw-batchbar span { font-weight: 600; }
.fw-batchbar .btn { height: 36px; }
#btnBatch.active { border-color: var(--accent); color: var(--accent); }

@media (max-width: 900px) {
  .fw-sidebar { display: none; }
}
@media (max-width: 640px) {
  .fw-item { flex-wrap: wrap; }
  .fw-iops { width: 100%; }
  .fw-iops .btn { flex: 1; }
}

/* 搜索结果里的目录路径 */
.fw-ipath {
  margin-top: 4px; font-size: .74rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 源站变更提醒弹窗 */
.fw-modal-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 50; }
.fw-modal {
  position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px)); max-height: min(72vh, 640px);
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.fw-modal[hidden], .fw-modal-mask[hidden] { display: none; }
/* 变更历史弹窗更宽：要同时放下筛选条和带路径的明细 */
.fw-modal-lg { width: min(780px, calc(100vw - 32px)); max-height: min(82vh, 760px); }
.fw-modal-head { display: flex; align-items: center; gap: 10px; }
.fw-modal-head h3 { margin: 0; font-size: 1rem; flex: 1; }
.fw-modal-body { flex: 1; min-height: 120px; overflow: auto; overscroll-behavior: contain; }
.fw-modal-foot { display: flex; justify-content: flex-end; gap: 10px; }

/* 变更历史筛选条 */
.fw-filter {
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px;
}
.fw-frow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fw-flabel { font-size: .78rem; color: var(--muted); flex: none; }
.fw-fsep { font-size: .78rem; color: var(--muted); }
.fw-chips.sm { margin-bottom: 0; gap: 6px; }
.fw-chips.sm .fw-chip { height: 28px; padding: 0 10px; font-size: .78rem; }
.fw-filter .search { flex: 1; min-width: 140px; height: 32px; }
.fw-filter input[type="date"] {
  height: 30px; padding: 0 8px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; font-size: .78rem;
}
.fw-filter input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.8); cursor: pointer; }
.fw-fsum { font-size: .76rem; color: var(--muted); }
.fw-ci.is-link { cursor: pointer; }
.fw-ci.is-link:hover { border-color: var(--accent); }
.fw-cg { margin-bottom: 12px; }
.fw-cg-t { font-size: .84rem; font-weight: 600; margin-bottom: 6px; }
.fw-ci {
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2);
  padding: 8px 10px; margin-bottom: 6px;
}
.fw-ci-n { font-size: .88rem; word-break: break-all; }
.fw-ci-old { color: var(--warn); font-size: .8rem; }
.fw-ci-p { font-size: .76rem; color: var(--muted); margin-top: 2px; word-break: break-all; }
.fw-ci-m { font-size: .72rem; color: var(--muted); margin-top: 2px; }
/* 天神之眼 / 年限 二级筛选条 */
.fw-filterbar { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.fw-filterbar .fw-frow { gap: 8px; }
.fw-synctip { font-size: .76rem; color: var(--muted); align-self: center; }
.fw-synctip.err { color: var(--danger); }

/* ===== 站点聚合页：便民查询 / 生活工具箱 ===== */
.sp-wrap { max-width: 1180px; margin: 0 auto; padding: 18px 18px 40px; }
.sp-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sp-head h1 { font-size: 1.3rem; margin: 0; }
.sp-head .spacer { flex: 1; }
.sp-stat { color: var(--muted); font-size: .85rem; }
.sp-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.sp-bar .search { flex: 1; min-width: 200px; }
.sp-cats { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.sp-cats .chip b { font-weight: 700; opacity: .75; margin-left: 2px; font-size: .78em; }
.sp-cats .chip.on { border-color: var(--cc, var(--accent)); color: var(--cc, var(--accent)); }
.sp-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.sp-card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  padding: 14px; display: flex; flex-direction: column; gap: 8px;
  cursor: pointer; transition: transform .12s ease, border-color .12s ease;
}
.sp-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 26px rgba(61,139,255,.18); }
.sp-card-top { display: flex; align-items: flex-start; gap: 10px; }
.sp-avatar {
  width: 40px; height: 40px; flex: none; border-radius: 10px; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; overflow: hidden;
}
.sp-avatar-img img { width: 100%; height: 100%; object-fit: contain; }
.sp-avatar-img.bad img { display: none; }
.sp-avatar-img.bad::after { content: '？'; opacity: .8; }
.sp-card-meta { flex: 1; min-width: 0; }
.sp-card-meta h3 { margin: 0; font-size: .98rem; font-weight: 700; line-height: 1.35; word-break: break-word; }
.sp-cat { display: block; font-size: .74rem; margin-top: 3px; opacity: .85; }
.sp-desc {
  margin: 0; font-size: .82rem; line-height: 1.6; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.sp-card-foot { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); }
.sp-open { color: var(--accent-2); }
.sp-flag { margin-left: auto; font-size: .68rem; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); }
.sp-empty { padding: 40px; text-align: center; color: var(--muted); }
.sp-loading { padding: 40px; text-align: center; color: var(--muted); }
/* 站内查看器 */
.sp-viewer-mask { position: fixed; inset: 0; background: rgba(4, 10, 24, .68); z-index: 60; }
.sp-viewer {
  position: fixed; z-index: 61; left: 2vw; right: 2vw; top: 3vh; bottom: 3vh;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--panel-solid); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}
.sp-v-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.sp-v-head h3 { margin: 0; font-size: 1rem; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-v-tabs { display: flex; gap: 6px; overflow-x: auto; flex: 1; min-width: 0; }
.sp-vtab {
  flex: none; height: 34px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: .8rem;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sp-vtab.on { border-color: var(--accent); color: var(--text); }
.sp-v-body { flex: 1; position: relative; background: #fff; }
.sp-v-body iframe { width: 100%; height: 100%; border: 0; display: block; }
.sp-v-hint {
  position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%);
  width: min(560px, 86%); text-align: center; color: #334; background: #fff;
  border: 1px solid #d8e2f5; border-radius: 12px; padding: 18px 20px; box-shadow: 0 10px 30px rgba(0,0,0,.12);
  font-size: .9rem; line-height: 1.7;
}
.sp-v-hint b { display: block; margin-bottom: 6px; font-size: 1rem; }
@media (max-width: 720px) {
  .sp-v-head h3 { max-width: 100%; }
  .sp-v-tabs { display: none; }
}

/* ===== 伊人图鉴欣赏 ===== */
.yg-wrap { max-width: 1280px; margin: 0 auto; padding: 18px 18px 40px; }
.yg-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.yg-card {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  background: var(--panel); cursor: pointer; transition: transform .12s ease, border-color .12s ease;
}
.yg-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 30px rgba(61,139,255,.2); }
.yg-cover { position: relative; aspect-ratio: 3/4; background: var(--panel-2); overflow: hidden; }
.yg-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yg-cover.bad img { display: none; }
.yg-cover.bad::after { content: attr(data-n); }
.yg-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; color: var(--muted); }
.yg-type {
  position: absolute; left: 8px; top: 8px; font-size: .68rem; font-weight: 700; padding: 2px 8px;
  border-radius: 6px; background: rgba(214,51,108,.9); color: #fff;
}
.yg-type.v { background: rgba(28,126,214,.9); }
.yg-tj { position: absolute; right: 8px; top: 8px; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: linear-gradient(135deg,#f59f00,#e8590c); color: #fff; }
.yg-count { position: absolute; right: 8px; bottom: 8px; font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: rgba(4,10,24,.6); color: #fff; }
.yg-cap { padding: 10px 12px 12px; }
.yg-cap h3 { margin: 0; font-size: .94rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yg-cat { display: block; font-size: .72rem; margin-top: 3px; opacity: .8; }
/* 灯箱 */
.yg-mask { position: fixed; inset: 0; background: rgba(2, 6, 16, .86); z-index: 70; }
.yg-box { position: fixed; z-index: 71; left: 0; right: 0; top: 0; bottom: 0; display: flex; flex-direction: column; }
.yg-box-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; flex-wrap: wrap; }
.yg-box-titles { min-width: 0; }
.yg-box-titles h3 { margin: 0; font-size: 1.05rem; }
.yg-meta { color: var(--muted); font-size: .78rem; }
.yg-box-body { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 12px 16px; min-height: 0; }
.yg-stage { flex: 1; height: 100%; position: relative; display: flex; align-items: center; justify-content: center; }
.yg-slide { position: absolute; inset: 0; margin: 0; display: none; align-items: center; justify-content: center; }
.yg-slide.on { display: flex; }
.yg-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.yg-slide img.bad { display: none; }
.yg-nav {
  flex: none; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(31,49,84,.6); color: #fff; font-size: 1.6rem; cursor: pointer; z-index: 2;
}
.yg-nav:hover { border-color: var(--accent); }
.yg-nopic { color: var(--muted); padding: 40px; text-align: center; }
.yg-hint { padding: 10px 16px 16px; text-align: center; color: var(--muted); font-size: .84rem; }
@media (max-width: 640px) {
  .yg-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .yg-nav { width: 40px; height: 40px; font-size: 1.2rem; }
}
