/* ============================================================
   主页样式（Soft UI）：柔和渐变背景 / 时钟浮雕 / 内凹搜索托盘
   分组与卡片为柔和凸起，Hover 上浮、Active 按压
   ============================================================ */

/* 分组标题字号/字重统一由变量控制，避免各主题各自覆盖导致层级字号漂移 */
:root {
  --group-title-size: 18px;
  --group-subtitle-size: 16px;
  --group-desc-size: 13px;
  --group-title-weight: 600;
  --group-title-spacing: 0.2px;
}

/* ---------- 背景（默认柔和渐变；设置壁纸后由 JS 叠加遮罩） ---------- */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg-grad);
  background-size: cover;
  background-position: center;
}
.bg-mask {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: transparent;
  pointer-events: none;
  transition: background 200ms var(--ease);
}

/* ---------- 页面布局（尺寸由后台「内容区域设置」注入 CSS 变量控制） ---------- */
.page {
  max-width: var(--content-max, 1200px);
  margin: 0 auto;
  padding: var(--content-pt, 0px) var(--content-px, 20px) var(--content-pb, 40px);
}

/* ---------- 顶栏（胶囊浮岛） ---------- */
.topbar {
  position: sticky;
  top: 14px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  margin-bottom: 30px;
  border-radius: 999px;
  transition: transform 0.35s cubic-bezier(.4,0,.2,1), opacity 0.35s ease;
  will-change: transform;
}
/* 滚动向下隐藏（只有到顶部才恢复显示，向上滚不弹回） */
.topbar.hidden-scroll {
  transform: translateY(-140%);
  opacity: 0;
  pointer-events: none;
}
/* 移动端：默认收起，点击悬浮按钮展开；iOS 上 sticky+transform 冲突，用 max-height 方案 */
@media (max-width: 640px) {
  .topbar {
    transition: max-height 0.35s ease, opacity 0.35s ease, padding 0.35s ease, margin 0.35s ease;
    overflow: hidden;
    max-height: 80px;
  }
  .topbar.mobile-hidden {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    opacity: 0;
    pointer-events: none;
  }
}

/* ---------- 移动端顶栏悬浮开关 ---------- */
.topbar-fab {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 200;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--raised-md, 0 4px 14px rgba(0,0,0,.15));
  background: var(--glass-bg, rgba(255,255,255,.85));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text-primary, #222);
  padding: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.topbar-fab:active { transform: scale(0.9); }
@media (max-width: 640px) {
  .topbar-fab { display: flex; }
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: var(--raised-sm);
}
.brand .title {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ann-pill {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface);
  box-shadow: var(--pressed-sm);
  border-radius: 999px;
  padding: 6px 15px;
  cursor: default;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid var(--edge);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: var(--raised-sm);
  transition: box-shadow var(--tr) var(--ease), transform var(--tr) var(--ease),
    color var(--tr) var(--ease);
}
.icon-btn:hover {
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--raised);
}
/* 主题三态按钮 + 内外网切换：带文字（如 🌙 深色 / 外网），自适应宽度 */
#themeBtn, #lanBtn {
  width: auto;
  padding: 0 14px;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 999px;
}
.icon-btn:active {
  transform: translateY(0);
  box-shadow: var(--pressed-sm);
}

/* ================= 导航栏模式：横向分组标签栏 ================= */
.navbar-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin: 16px auto 12px;
  padding: 0;
  border-radius: 0;
  justify-content: center;
  overflow: visible;
}
.navbar-tabs[hidden] { display: none; }

.ntab-btn {
  flex: 0 0 auto;
  border: 1px solid var(--edge-weak);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  padding: 7px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: var(--raised-sm);
}
.ntab-btn:hover {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--raised);
}
.ntab-btn.active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: transparent;
  box-shadow: var(--raised-sm);
}
.ntab-btn.ntab-hidden:not(.active) { opacity: 0.6; }

/* ---------- 移动端：分组图标横向滑动选择（≤640px 显示） ---------- */
.navbar-mobile {
  display: none;
  width: 100%;
  margin: 14px 0 4px;
  padding: 2px 0 8px;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;   /* iOS 惯性滑动 */
  scroll-snap-type: x mandatory;      /* 滑动停顿按 5 个一组对齐 */
  scrollbar-width: none;               /* Firefox 隐藏滚动条 */
  -webkit-tap-highlight-color: transparent;
}
.navbar-mobile::-webkit-scrollbar { display: none; }  /* WebKit 隐藏滚动条 */
.navbar-mobile[hidden] { display: none; }

/* 圆形图标项：槽位宽 =（容器宽 − 4 个间距）/ 5，任何屏宽一屏正好 5 个槽 */
.nm-item {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: calc((100% - 32px) / 5);     /* 4 gaps × 8px = 32px */
  aspect-ratio: 1 / 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  box-shadow: none;
  cursor: pointer;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
}
/* 圆形视觉面：固定 50px，槽位更窄时随槽缩小 */
.nm-face {
  width: min(100%, 50px);
  height: min(100%, 50px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  border-radius: 50%;
  border: 1px solid var(--edge-weak);
  background: var(--surface-2);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);   /* 轻柔投影，无厚重凸起 */
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.15s ease, box-shadow 0.22s ease;
}
/* 触摸按压即时反馈 */
.nm-item:active .nm-face {
  transform: scale(0.9);
}
/* 选中态：实心强调色填充 + 白色 emoji，柔和投影强化选中感 */
.nm-item.active .nm-face {
  background: var(--accent);
  border: 2px solid var(--accent);
  color: #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

@media (max-width: 640px) {
  /* PC 标签栏在移动端隐藏，由圆形图标滑动条接管 */
  .navbar-tabs { display: none; }
  .navbar-tabs[hidden] { display: none; }
  .navbar-mobile { display: flex; }
  /* 侧边栏分组标题：flex-start 替代 baseline，避免渐变裁剪 h3 与 desc 文本基线错位 */
  .group-parent-head {
    align-items: flex-start;
    padding: 6px 10px 10px;
  }
  .group-parent-head h3 {
    font-size: var(--group-subtitle-size);
    letter-spacing: var(--group-title-spacing);
    min-width: 0;
    flex-shrink: 1;
  }
  .group-parent-head .desc {
    font-size: var(--group-desc-size);
    max-width: 100%;
    flex-basis: 100%;
  }
  .group-parent {
    padding: 12px 12px 6px;
    margin-bottom: 14px;
    border-radius: 16px;
  }
  .group-child {
    padding: 10px 12px 12px;
    margin-bottom: 10px;
    border-radius: 12px;
  }
}

/* 窄屏手机：图标字号略收窄（圆形随槽位自动变小） */
@media (max-width: 360px) {
  .nm-face { font-size: 18px; }
}

/* ================= 右键卡片菜单 ================= */
.card-context-menu {
  min-width: 180px;
  padding: 6px;
  border-radius: 12px;
  box-shadow: var(--raised-lg);
  border: 1px solid var(--edge);
  animation: ccmIn 0.12s ease-out;
}
@keyframes ccmIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.ccm-item {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.ccm-item:hover {
  background: var(--hover-bg);
  color: var(--accent);
}
.ccm-item.danger:hover {
  color: #dc3545;
}
.ccm-sep {
  height: 1px;
  background: var(--edge-weak);
  margin: 4px 6px;
}

/* ---------- 时钟 + 天气（横向并排，浮雕文字 + 玻璃胶囊） ---------- */
.clock-area {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 36px auto 28px;
  user-select: none;
  font-family: var(--clock-font, var(--page-font, inherit));
}
.clock-area.show {
  display: flex;
}
/* 天气与时钟并排 */
.clock-area .cw-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}
.clock-area .clock-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1;
}
.clock-time {
  font-size: 64px;
  /* 默认粗黑体；后台选择设计字体后由 --clock-font 覆盖，未单独设置时继承整页字体 */
  font-family: var(--clock-font, var(--page-font, 'PingFang SC', 'Microsoft YaHei', 'HarmonyOS Sans SC', 'MiSans', 'Noto Sans CJK SC', 'Source Han Sans SC', 'WenQuanYi Micro Hei', sans-serif));
  font-weight: 800;
  letter-spacing: 4px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: var(--text);
  text-shadow: 0 1px 0 var(--sh-light), 0 12px 28px var(--sh-dark);
}
.clock-date {
  font-size: 16px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* 天气（无背景框，纯文字与时钟并排，两行布局高度对齐时钟） */
.weather {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 96px;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}
.weather[hidden] { display: none !important; }
/* 主行：emoji + 描述 + 温度 */
.weather .w-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.weather .w-emoji {
  font-size: 24px;
  line-height: 1;
}
.weather .w-desc {
  font-size: 18px;
  font-weight: 600;
}
.weather .w-temp {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
/* 副行：城市 · 湿度 · 风速 */
.weather .w-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  opacity: 0.9;
}
.weather .w-sep {
  opacity: 0.5;
}
@media (max-width: 640px) {
  .clock-area .cw-row { gap: 16px; }
  .clock-time { font-size: 48px; letter-spacing: 2px; }
  .weather { min-height: 78px; }
  .weather .w-emoji { font-size: 20px; }
  .weather .w-desc { font-size: 15px; }
  .weather .w-temp { font-size: 18px; }
  .weather .w-sub { font-size: 11px; }
}

/* ---------- 搜索托盘（内凹胶囊） ---------- */
.search-box[hidden] {
  display: none; /* 同 engine-menu：display:flex 会覆盖 hidden 属性 */
}
.search-box {
  /* 自建层叠上下文：holo/aurora 风格给搜索框加的 backdrop-filter 会创建上下文，
     把下拉菜单的 z-index 困在内部被后续卡片盖住——显式给宿主定 z（90：高于卡片/目录条 40，低于顶栏 100） */
  position: relative;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 640px;
  margin: 0 auto 32px;
  padding: 8px 10px 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--edge);
  box-shadow: var(--inset);
}
/* 搜索引擎选择器（带 logo 的自定义下拉） */
.engine-select {
  position: relative;
  flex-shrink: 0;
}
.engine-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 6px 4px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  white-space: nowrap;
}
.engine-btn .engine-logo {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
}
.engine-btn .engine-caret {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--tr) var(--ease);
}
.engine-select.open .engine-caret {
  transform: rotate(180deg);
}
.engine-menu[hidden] {
  display: none; /* 必须显式声明：display:flex 会覆盖 hidden 属性的 UA 样式，导致菜单收不回去 */
}
.engine-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  /* z 值仅作用于 search-box 上下文内部；对外层级由宿主 .search-box 的 z-index:90 决定 */
  z-index: 60;
  min-width: max(100%, 170px);
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--edge);
  box-shadow: 8px 8px 18px var(--sh-dark), -6px -6px 14px var(--sh-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: engine-menu-in 0.16s var(--ease);
}
@keyframes engine-menu-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.engine-item {
  display: flex;
  align-items: center;
  gap: 9px;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
  font-size: 14px;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  text-align: left;
  transition: background var(--tr) var(--ease), color var(--tr) var(--ease);
}
.engine-item:hover {
  background: rgba(127, 127, 127, 0.14);
}
.engine-item.active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(127, 127, 127, 0.09);
}
.engine-item .engine-logo {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: contain;
  flex-shrink: 0;
}
.search-box .divider {
  width: 1px;
  height: 22px;
  background: var(--edge-weak);
}
.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  padding: 8px 6px;
  color: var(--text);
  outline: none;
}
.search-box input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}
.search-box .search-btn {
  border: none;
  border-radius: 999px;
  padding: 9px 24px;
  background: var(--accent);
  color: var(--on-accent, #fff);
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 2px 2px 5px var(--sh-dark), 4px 4px 12px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: background var(--tr) var(--ease), transform var(--tr) var(--ease),
    box-shadow var(--tr) var(--ease);
}
.search-box .search-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 3px 3px 7px var(--sh-dark), 8px 8px 20px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.search-box .search-btn:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 3px var(--sh-dark), 2px 2px 8px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ---------- 左侧分组目录条 ---------- */
.group-nav {
  position: fixed;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px;
  border-radius: 18px;
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: none;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
}
.group-nav::-webkit-scrollbar { display: none; }
.group-nav[hidden] { display: none; }
.group-nav > li { list-style: none; }
.group-nav > li > a {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px; font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background var(--tr) var(--ease), color var(--tr) var(--ease);
}
.group-nav > li > a:hover { background: var(--hover-bg); color: var(--accent); }
.group-nav > li.gn-parent { position: relative; }
.group-nav > li.gn-parent > .gn-caret {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; padding: 0;
  border: none; background: transparent;
  color: var(--text-muted); font-size: 14px; line-height: 1;
  cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--tr) var(--ease), background var(--tr) var(--ease);
}
.group-nav > li.gn-parent > .gn-caret:hover { background: var(--hover-bg); color: var(--accent); }
.group-nav > li.gn-parent.gn-open > .gn-caret { transform: translateY(-50%) rotate(180deg); }
.group-nav > li.gn-parent > .gn-children {
  list-style: none; padding: 2px 0 0 10px; margin: 0;
  border-left: 2px solid var(--edge);
  margin-left: 14px;
  max-height: 0; overflow: hidden;
  transition: max-height 0.32s var(--ease), padding 0.2s var(--ease), opacity 0.2s var(--ease);
  opacity: 0;
}
.group-nav > li.gn-parent.gn-open > .gn-children {
  max-height: 600px; padding: 6px 0 6px 0; opacity: 1;
}
/* 当前激活的顶级分组：高亮 + 左侧 accent 色竖条 */
.group-nav > li.active-top > a {
  color: var(--accent);
  font-weight: 600;
  position: relative;
}
.group-nav > li.active-top > a::before {
  content: '';
  position: absolute;
  left: -10px; top: 50%;
  width: 3px; height: 14px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-50%);
}
/* 当前激活的子分组：accent 色 */
.group-nav > li.gn-parent > .gn-children > li.active-child > a {
  color: var(--accent);
  font-weight: 500;
}
.group-nav > li.gn-parent > .gn-children > li > a {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 8px;
  font-size: 12px; color: var(--text-muted); font-weight: 400;
  text-decoration: none;
  transition: background var(--tr) var(--ease), color var(--tr) var(--ease), padding-left var(--tr) var(--ease);
}
.group-nav > li.gn-parent > .gn-children > li > a:hover {
  background: var(--hover-bg); color: var(--accent); padding-left: 14px;
}
/* 收起态：淡出左移，仅左缘 ▶ 把手可见 */
.group-nav.gn-collapsed {
  opacity: 0;
  transform: translateY(-50%) translateX(-14px);
  pointer-events: none;
}
/* 左缘 ▶ 把手：目录收起时显示右三角（点击展开），展开时旋转为左三角（点击收起） */
.gn-toggle {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  width: 22px;
  height: 46px;
  padding: 0;
  border: none;
  border-radius: 0 12px 12px 0;
  background: var(--surface);
  box-shadow: 2px 2px 6px var(--sh-dark), -1px -1px 4px var(--sh-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--tr) var(--ease);
}
.gn-toggle::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-left: 9px solid var(--text-muted);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  transition: transform var(--tr) var(--ease), border-left-color var(--tr) var(--ease);
}
.gn-toggle:hover { background: var(--hover-bg); }
.gn-toggle:hover::before { border-left-color: var(--accent); }
.gn-toggle:not(.gn-collapsed)::before { transform: rotate(180deg); }
.gn-toggle[hidden] { display: none; }
/* ---------- 返回顶部（右下角常驻） ---------- */
.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90; /* 与搜索托盘同级：盖过卡片与目录条，低于 iframe 弹窗与 toast */
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: 3px 3px 8px var(--sh-dark), -1px -1px 4px var(--sh-light);
  transition: color var(--tr) var(--ease), background var(--tr) var(--ease), transform var(--tr) var(--ease), box-shadow var(--tr) var(--ease);
}
.back-top:hover {
  color: var(--accent);
  background: var(--hover-bg);
  transform: translateY(-2px);
  box-shadow: 4px 4px 10px var(--sh-dark), -1px -1px 5px var(--sh-light);
}
.back-top:active { transform: translateY(0); box-shadow: inset 2px 2px 5px var(--sh-dark), inset -1px -1px 3px var(--sh-light); }
@media (max-width: 640px) {
  .back-top { right: 14px; bottom: 14px; width: 40px; height: 40px; }
}
.gn-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 13.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--tr) var(--ease), color var(--tr) var(--ease);
}
.gn-item:hover {
  background: var(--hover-bg);
  color: var(--text);
}
.gn-item.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}
.gn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.5;
  flex-shrink: 0;
  transition: background var(--tr) var(--ease), opacity var(--tr) var(--ease), transform var(--tr) var(--ease);
}
.gn-item.active .gn-dot {
  background: var(--accent);
  opacity: 1;
  transform: scale(1.25);
}
.gn-label {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 两级分组：父容器 + 子 section ---------- */
.group-parent {
  position: relative;
  padding: 18px 18px 10px;
  margin-bottom: 22px;
  border-radius: 22px;
  border: 1px solid var(--edge);
  background: linear-gradient(140deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  box-shadow: var(--raised-sm);
}
.group-parent-head {
  padding: 8px 14px 14px;
  margin-bottom: 8px;
  border-radius: 14px;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.group-parent-head h3 {
  font-size: var(--group-title-size); font-weight: var(--group-title-weight); margin: 0;
  letter-spacing: var(--group-title-spacing);
  background: linear-gradient(120deg, var(--accent), var(--accent-2, var(--accent)));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.group-parent-head .desc {
  font-size: var(--group-desc-size); color: var(--text-muted);
}
.group-child {
  padding: 14px 16px 16px;
  margin-bottom: 12px;
  border-radius: 16px;
  border-left: 3px solid var(--accent);
  background: linear-gradient(140deg, rgba(255,255,255,0.025), rgba(255,255,255,0.008));
  box-shadow: var(--raised-xs);
}
.group-child .group-head h2 { font-size: var(--group-subtitle-size); letter-spacing: var(--group-title-spacing); font-weight: var(--group-title-weight); }
.group-child .cards { gap: 12px; }
/* ---------- 分组（柔和浮岛） ---------- */
.group {
  padding: 20px 22px 22px;
  margin-bottom: 24px;
}
.group-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 15px;
  position: relative;
}
.group-head h2 {
  margin: 0;
  font-size: var(--group-title-size);
  font-weight: var(--group-title-weight);
  letter-spacing: var(--group-title-spacing);
  min-width: 0;                 /* 允许在 flex 行内收缩，避免撑破容器 */
  white-space: nowrap;          /* 标题保持一行，杜绝逐字竖排 */
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-head .desc {
  font-size: var(--group-desc-size);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 隐藏分组徽章（仅登录管理员可见的分组） */
.group-head .hidden-badge {
  flex-shrink: 0;
  font-size: 12px;
  line-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 159, 10, 0.14);
  color: #c77c11;
  border: 1px solid rgba(255, 159, 10, 0.4);
}

/* 卡片网格：nav（导航栏详细）样式 */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
/* 卡片网格：app 样式（小图标）；列宽弹性拉伸，避免窄屏残留右侧空当 */
.cards.style-app {
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}

/* ---------- 卡片（柔和小凸起） ---------- */
.card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: 18px;
  border: 1px solid var(--edge);
  background: var(--surface);
  color: var(--text);
  text-decoration: none !important;
  cursor: pointer;
  position: relative;
  overflow: visible !important;
  box-shadow: var(--raised-sm);
  transition: box-shadow var(--tr) var(--ease), transform var(--tr) var(--ease);
  isolation: isolate;
}

/* 卡片背景透明度：只降低卡片底色 alpha，文字与图标保持不透明（主题 hover 规则优先） */
:root body .card {
  background: color-mix(in srgb, var(--surface) calc(var(--card-opacity, 1) * 100%), transparent);
}

/* Soft 主题：分组容器与卡片同色，仅降低卡片 alpha 会被容器底色完全遮住；
   让玻璃面板（分组、父分组头、顶栏、搜索框）一起跟随透明度变量，滑条才真正可见 */
:root:not([data-style]) .glass,
:root[data-style='soft'] .glass,
:root:not([data-style]) .card,
:root[data-style='soft'] .card {
  background: color-mix(in srgb, var(--surface) calc(var(--card-opacity, 1) * 100%), transparent);
}

/* 卡片背景渐变流动层：默认关闭，仅 Liquid Glass 主题启用（见 themes.json） */
.card-bg {
  display: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.card-bg::before {
  content: "";
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
  opacity: 0;
  mix-blend-mode: soft-light;
  will-change: transform;
}
.card > .icon,
.card > .info,
.card > .lan-badge,
.card > .hidden-badge {
  position: relative;
  z-index: 1;
}
@keyframes bg-gradient-shift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-25%, -10%); }
  50% { transform: translate(-10%, -25%); }
  75% { transform: translate(-25%, 0); }
}

/* + 快速添加按钮 —— 放在 .group-sort 容器内 flex 排列 */
.group-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  margin-left: 2px;
  border-radius: 50%;
  font-size: 16px; font-weight: 700;
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--raised-sm);
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s, box-shadow 0.15s;
  opacity: 0.7;
}
.group-add-btn:hover { opacity: 1; transform: scale(1.1); }

/* ============================================================
   主页 quick-add modal 专用样式（从 auth-admin.css 移植 + 主页作用域）
   ============================================================ */
.radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
}
.radio-group label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.upload-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}
.upload-row .input {
  flex: 1;
  min-width: 0;
}
.upload-row .icon-preview { flex-shrink: 0; }
.upload-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 8px 14px;
}
.upload-row input[type='file'] { display: none; }
.icon-preview {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--raised-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  overflow: hidden;
  flex-shrink: 0;
}
.icon-preview img { width: 100%; height: 100%; object-fit: cover; }

/* 文字图标 grid 通用层 */
.icon-grid-cn {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: 1fr 1fr !important;
  gap: 0 !important;
}
.icon-wrap-en {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr 1fr !important;
  gap: 0 !important;
}
.icon-grid-cn .child-text,
.icon-wrap-en .child-text {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

/* icon-preview 特异度层（覆盖自身 display:flex） */
.icon-preview.icon-grid-cn {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: 1fr 1fr !important;
  gap: 0 !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  padding: 4px !important;
  font-weight: 600 !important;
}
.icon-preview.icon-wrap-en {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr 1fr !important;
  gap: 0 !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  padding: 3px !important;
  font-weight: 500 !important;
  letter-spacing: -0.3px !important;
}

/* Cloud Float: hover 上浮 + 阴影扩散带彩色光晕，Pillow Press: active 按入枕面 */
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--raised-lg), 0 0 18px var(--accent-glow);
}
.card:active {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--pressed-sm);
}

/* 卡片入场：缩放淡入（错峰出现，按 DOM 顺序递增延迟） */
@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.scale-in {
  --sk-duration: 400ms;
  --sk-delay: 0ms;
  --sk-ease: cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
  animation: scale-in var(--sk-duration) var(--sk-ease) var(--sk-delay) backwards;
}

.cards > .scale-in:nth-child(1) { --sk-delay: 0ms; }
.cards > .scale-in:nth-child(2) { --sk-delay: 20ms; }
.cards > .scale-in:nth-child(3) { --sk-delay: 40ms; }
.cards > .scale-in:nth-child(4) { --sk-delay: 60ms; }
.cards > .scale-in:nth-child(5) { --sk-delay: 80ms; }
.cards > .scale-in:nth-child(6) { --sk-delay: 100ms; }
.cards > .scale-in:nth-child(7) { --sk-delay: 120ms; }
.cards > .scale-in:nth-child(8) { --sk-delay: 140ms; }
.cards > .scale-in:nth-child(9) { --sk-delay: 160ms; }
.cards > .scale-in:nth-child(10) { --sk-delay: 180ms; }
.cards > .scale-in:nth-child(11) { --sk-delay: 200ms; }
.cards > .scale-in:nth-child(n+12) { --sk-delay: 220ms; }

@media (prefers-reduced-motion: reduce) {
  .scale-in {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .card-bg::before {
    animation: none !important;
  }
}

.card .icon {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  font-weight: 700;
  color: var(--on-accent, #fff);
  background: var(--accent);
  overflow: hidden;
  box-shadow: 0 2px 6px var(--sh-dark), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.card .icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 图标背景透明度为 0：文字图标改用主色文字并去掉投影，避免白字透明底看不清
   （提升特异度 + !important，压过各主题给 .card .icon 设的文字色） */
:root body .card .icon.icon-bg-clear {
  color: var(--accent) !important;
  box-shadow: none;
}
/* 图片/favicon 图标：所有主题、所有明暗模式下背景一律透明（含边框、投影与 hover 态）。
   各主题会给 .card .icon.has-img 设白底/描边，特异性更高，这里用 !important 统一压掉，
   避免部分浏览器（如 Chrome）因缓存或绘制差异露出白色方块。 */
:root body .card .icon.has-img,
:root body .card:hover .icon.has-img {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.card .icon.has-img img {
  object-fit: contain;
  padding: 3px;
}
/* 深色模式图标可见性兜底：给图片图标一圈极淡高光轮廓，
   避免黑色/深色 logo 与深色卡片融为一体（只加轮廓，不加底板） */
:root[data-theme='dark'] .card .icon.has-img img {
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.5));
}

/* ============================================================
   主页卡片 .card .icon grid 特异度层（所有属性 !important 强杀 flex）
   覆盖 .card .icon { display:flex } (0,0,2,0) → 这里 (0,0,3,0) + !important
   ============================================================ */
.card .icon.icon-grid-cn {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: 1fr 1fr !important;
  gap: 0 !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  padding: 5px !important;
  font-weight: 600 !important;
}
.card .icon.icon-wrap-en {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr 1fr !important;
  gap: 0 !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  padding: 4px !important;
  font-weight: 500 !important;
  letter-spacing: -0.3px !important;
}

.card .info {
  min-width: 0;
}
.card .info .t {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .info .d {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .lan-badge {
  position: absolute;
  top: 7px;
  right: 9px;
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 1px 7px;
}
.card .hidden-badge {
  position: absolute;
  top: 7px;
  left: 9px;
  font-size: 10px;
  color: #c77c11;
  background: rgba(255, 159, 10, 0.14);
  border-radius: 999px;
  padding: 1px 7px;
  border: 1px solid rgba(255, 159, 10, 0.4);
  pointer-events: none;
  opacity: 0.85;
}
.card-hidden {
  opacity: 0.55;
  filter: saturate(0.35);
}

/* navapp（导航栏·应用）样式卡片：纵向小图标 */
.card.app-card {
  flex-direction: column;
  gap: 8px;
  padding: 15px 8px 11px;
  text-align: center;
  border-radius: 20px;
}
.card.app-card .icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
}
.card.app-card .info {
  width: 100%;
}
.card.app-card .info .t {
  font-size: 12.5px;
  max-width: 100%;
}
.card.app-card .info .d {
  display: none;
}

/* ---------- iframe 弹层 ---------- */
.iframe-modal .modal-box {
  max-width: 1080px;
  width: 92vw;
  height: 84vh;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
}
.iframe-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.iframe-head .t {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#iframeWin {
  flex: 1;
  width: 100%;
  border: none;
  border-radius: 18px;
  background: var(--surface-2);
  box-shadow: var(--inset);
}
.iframe-tip {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ---------- 页脚 ---------- */
.footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 18px 0 6px;
}
.footer a {
  color: var(--text-muted);
}
.footer .app-ver {
  margin-left: 10px;
  font-size: 12px;
  opacity: 0.75;
  user-select: text;
}

/* ---------- 分组入场：打开主页后由上而下逐个浮现（仅首屏，JS 控制只播一次） ---------- */
/* 注：系统「减少动效」偏好开启时动画被禁用属预期兜底行为 */
.group.group-in {
  animation: groupIn 520ms cubic-bezier(0.25, 0.6, 0.3, 1) both;
}
@keyframes groupIn {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .group.group-in {
    animation: none;
  }
}

/* ---------- 搜索高亮 ---------- */
.group.search-active { box-shadow: 0 0 0 2px var(--accent), var(--raised-sm); }
.group.search-active .group-head h2::after {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: searchPulse 1.2s ease-in-out infinite;
}
@keyframes searchPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.group-parent.search-active {
  box-shadow: 0 0 0 2px var(--accent), var(--raised-sm);
}
.group-parent.search-active > .group-parent-head h3::after {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: searchPulse 1.2s ease-in-out infinite;
}
.card.search-hit {
  box-shadow: 0 0 0 2px var(--accent) !important;
  transform: scale(1.02);
  animation: cardHitPulse 1.2s ease-in-out infinite;
}
@keyframes cardHitPulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent); }
  50% { box-shadow: 0 0 0 2px var(--accent), 0 0 18px 4px rgba(108, 92, 231, 0.35); }
}
.card.search-dim {
  opacity: 0.18;
  filter: grayscale(0.6);
}

/* ---------- 空状态 ---------- */
.empty-tip {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 30px 0;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .group-nav,
  .gn-toggle { display: none !important; }
}
@media (max-width: 640px) {
  .clock-time {
    font-size: 46px;
  }
  .topbar {
    top: 10px;
    padding: 8px 12px;
    gap: 10px;
  }
  .brand .title {
    font-size: 15px;
  }
  .top-actions {
    gap: 6px;
  }
  .icon-btn {
    width: 34px;
    height: 34px;
  }
  #themeBtn, #lanBtn {
    padding: 0 10px;
    font-size: 12.5px;
  }
  .ann-pill {
    display: none;
  }
  /* nav（导航栏详细）样式：移动端固定一行双卡片（navapp 由下方 .style-app 规则接管） */
  .cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  /* 双列紧凑卡片：缩小内边距、图标与字号，保证图标+标题+描述横向排布不挤行。
     作用域排除 .style-app，navapp 的纵向卡片规则不受影响 */
  .cards:not(.style-app) .card {
    gap: 9px;
    padding: 10px 11px;
    border-radius: 16px;
    min-width: 0;
  }
  .cards:not(.style-app) .card .icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 17px;
  }
  .cards:not(.style-app) .card .icon.has-img img {
    padding: 2px;
  }
  .cards:not(.style-app) .card .info .t {
    font-size: 13px;
  }
  .cards:not(.style-app) .card .info .d {
    font-size: 11.5px;
    margin-top: 2px;
  }
  /* app 样式：弹性列填满分组宽度，最小 80px（≥58px 图标+内边距），窄屏不再留白 */
  .cards.style-app {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
  }
  .search-box .search-btn {
    padding: 9px 15px;
  }
  .footer {
    font-size: 12px;
    line-height: 1.9;
    padding: 16px 8px 6px;
  }
}

/* 超窄屏（≤360px）：双列卡片再收紧，保证文字区留有可读宽度 */
@media (max-width: 360px) {
  .cards { gap: 10px; }
  .cards:not(.style-app) .card {
    gap: 8px;
    padding: 9px 10px;
  }
  .cards:not(.style-app) .card .icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    font-size: 15px;
  }
  .cards:not(.style-app) .card .info .t {
    font-size: 12.5px;
  }
  .cards:not(.style-app) .card .info .d {
    font-size: 11px;
  }
}

/* 搜索框右侧：热点新闻常驻按钮（与 search-btn 等高，同风格） */
.hotnews-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  padding: 0 14px;
  height: 38px;
  margin-left: 2px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* display:inline-flex 会覆盖 hidden 属性的 UA 样式，关闭热点新闻后按钮仍会显示 */
.hotnews-btn[hidden] { display: none; }
.hotnews-btn:hover {
  color: var(--text);
  background: var(--accent-soft);
}
.hotnews-btn.active {
  color: var(--on-accent, #fff);
  background: var(--accent);
  box-shadow: var(--raised-sm);
}

/* ================= 热点新闻视图 ================= */
.news-view {
  margin-top: 4px;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
  align-items: start;
}
.news-card {
  border-radius: 20px;
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  transition: transform var(--tr) var(--ease), box-shadow var(--tr) var(--ease);
}
.news-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--raised-lg, var(--raised));
}
.nc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 2px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--edge-weak);
}
.nc-logo {
  flex: none;
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 4px;
}
.nc-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--nc, var(--accent));
  box-shadow: 0 0 10px var(--nc, var(--accent));
}
.nc-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.nc-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.nc-refresh {
  flex: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nc-refresh:hover {
  color: var(--nc, var(--accent));
  background: var(--accent-soft);
}
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .nc-refresh:hover {
    background: color-mix(in srgb, var(--nc, var(--accent)) 14%, transparent);
  }
}
.news-card.loading .nc-refresh {
  animation: nc-spin 0.8s linear infinite;
}
@keyframes nc-spin {
  to { transform: rotate(360deg); }
}
.nc-body {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--edge-weak) transparent;
  max-height: 480px;
}
.nc-body::-webkit-scrollbar {
  width: 6px;
}
.nc-body::-webkit-scrollbar-thumb {
  background: var(--edge-weak);
  border-radius: 999px;
}
.nc-body::-webkit-scrollbar-track {
  background: transparent;
}
.nc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nc-list li a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  line-height: 1.45;
  transition: background 0.15s ease;
}
.nc-list li a:hover {
  background: var(--accent-soft);
}
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .nc-list li a:hover {
    background: color-mix(in srgb, var(--nc, var(--accent)) 12%, transparent);
  }
}
.nc-rank {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--edge-weak);
  transform: translateY(3px);
}
.nc-rank.top {
  background: var(--nc, var(--accent));
  color: var(--on-accent, #fff);
  box-shadow: 0 2px 7px color-mix(in srgb, var(--nc, var(--accent)) 45%, transparent),
              inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
/* 不支持 color-mix 的浏览器回退为纯实色 */
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .nc-rank.top {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  }
}
.nc-title {
  flex: 1;
  font-size: 13.5px;
  word-break: break-word;
}
.nc-info {
  flex: none;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}
.nc-when {
  flex: none;
  font-size: 11.5px;
  color: var(--text-muted);
  min-width: 58px;
  text-align: right;
  white-space: nowrap;
}
.nc-empty {
  padding: 22px 8px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
  .nc-body {
    max-height: 46vh;
  }
  /* 中间断点：640-481px，减少头部和列表的水平空隙 */
  .nc-head {
    gap: 8px;
  }
  .nc-list li a {
    gap: 8px;
  }
}

/* 超窄屏（≤480px）细化 */
@media (max-width: 480px) {
  .news-card {
    border-radius: 16px;
    padding: 12px 12px 8px;
  }
  .nc-head {
    gap: 6px;
    padding: 2px 2px 8px;
  }
  .nc-logo {
    width: 16px;
    height: 16px;
  }
  .nc-dot {
    width: 8px;
    height: 8px;
  }
  .nc-name {
    font-size: 14px;
  }
  .nc-time {
    font-size: 11px;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
  }
  .nc-refresh {
    width: 26px;
    height: 26px;
    font-size: 14px;
    border-radius: 7px;
  }
  .nc-list li a {
    gap: 6px;
    padding: 6px 6px;
    border-radius: 8px;
  }
  .nc-title {
    font-size: 13px;
  }
  .nc-rank {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    font-size: 11px;
  }
  .nc-info {
    max-width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
  }
  .nc-when {
    min-width: 0;
  }
  .nc-body {
    max-height: 42vh;
  }
}

/* ---------- 卡片排序模式（管理员，按分组独立） ---------- */
/* 分组头部排序操作区：分组名后横向并排 */
.group-head .group-sort {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto; /* 推到分组头右侧（分组名后） */
}
.group-sort .btn-sort-toggle {
  opacity: 0.85;
}
.group-sort .btn-sort-toggle:hover {
  opacity: 1;
}
.group-sort .btn-save-order {
  white-space: nowrap;
}

/* 当前排序分组高亮：卡片整卡可抓 */
.group.sorting .card {
  cursor: grab;
}
.group.sorting .card:active {
  cursor: grabbing;
}
.group.sorting .card:hover {
  transform: none; /* 拖拽时关闭上浮，避免抖动干扰 */
}
.group.sorting .card.dragging {
  opacity: 0.4;
}
/* 落点指示：accent 内描边 + 左/右侧定位条 */
.card.drag-over-before {
  border-color: var(--accent);
  box-shadow: var(--raised), inset 4px 0 0 var(--accent);
}
.card.drag-over-after {
  border-color: var(--accent);
  box-shadow: var(--raised), inset -4px 0 0 var(--accent);
}

@media (max-width: 640px) {
  /* 头部允许换行：标题独占第一行，排序/添加按钮整体落到第二行 */
  .group-head {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .group-head h2 {
    flex: 1 1 auto;             /* 第一行占满可用宽，超长省略号 */
  }
  .group-head .group-sort {
    margin-left: 0;
    width: 100%;
    order: 99;
  }
}

/* ================= 更新日志弹窗 ================= */
.footer .app-ver {
  cursor: pointer;
  transition: color var(--tr) var(--ease), opacity var(--tr) var(--ease);
}
.footer .app-ver:hover {
  color: var(--accent);
  opacity: 1;
}
.footer-beian {
  margin-top: 6px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer-beian a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--tr) var(--ease);
}
.footer-beian a:hover {
  color: var(--accent);
}
.footer-beian .beian-dot {
  opacity: 0.5;
}
#changelogModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  background: var(--overlay);
  backdrop-filter: blur(4px);
}
#changelogModal.show {
  display: flex;
}
.changelog-box {
  max-width: 520px;
  width: 90vw;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  animation: changelogIn 0.2s var(--ease);
}
@keyframes changelogIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.changelog-box .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--edge-weak);
}
.changelog-box .modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.modal-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--tr) var(--ease), color var(--tr) var(--ease);
}
.modal-close:hover {
  background: var(--hover-bg);
  color: var(--accent);
}
.changelog-body {
  padding: 16px 22px 22px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--edge-weak) transparent;
}
.changelog-body::-webkit-scrollbar { width: 6px; }
.changelog-body::-webkit-scrollbar-thumb { background: var(--edge-weak); border-radius: 999px; }
.cl-version {
  margin-bottom: 18px;
}
.cl-version:last-child {
  margin-bottom: 0;
}
.cl-ver-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.cl-ver-tag {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}
.cl-ver-date {
  font-size: 12px;
  color: var(--text-muted);
}
.cl-ver-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cl-ver-items li {
  position: relative;
  padding: 4px 0 4px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
}
.cl-ver-items li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

/* ================= 搜索历史下拉 ================= */
.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.search-input-wrap input {
  width: 100%;
}
.search-history-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 16px;
  box-shadow: 8px 8px 18px var(--sh-dark), -6px -6px 14px var(--sh-light);
  padding: 14px 14px 16px;
  animation: engine-menu-in 0.16s var(--ease);
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--edge-weak) transparent;
}
.search-history-dropdown::-webkit-scrollbar { width: 6px; }
.search-history-dropdown::-webkit-scrollbar-thumb { background: var(--edge-weak); border-radius: 999px; }
.search-history-dropdown[hidden] {
  display: none;
}
.sh-section {
  margin-bottom: 10px;
}
.sh-section:last-child {
  margin-bottom: 0;
}
.sh-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.sh-section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.sh-section-clear {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: color var(--tr) var(--ease), background var(--tr) var(--ease);
}
.sh-section-clear:hover {
  color: var(--danger);
  background: rgba(224, 93, 93, 0.1);
}
.sh-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sh-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--edge-weak);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--tr) var(--ease), color var(--tr) var(--ease), border-color var(--tr) var(--ease), transform var(--tr) var(--ease);
  box-shadow: var(--pressed-sm);
  user-select: none;
}
.sh-tag:hover {
  background: var(--hover-bg);
  color: var(--accent);
  border-color: var(--accent-soft);
  transform: translateY(-1px);
}
.sh-tag .sh-tag-fav {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
  transition: color var(--tr) var(--ease), opacity var(--tr) var(--ease);
}
.sh-tag.faved .sh-tag-fav {
  color: var(--accent);
  opacity: 1;
}
.sh-tag:hover .sh-tag-fav {
  opacity: 1;
}
.sh-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px 8px;
}

/* ============ P0: 访客锁屏 ============ */
.guest-lock {
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(var(--accent-rgb,120,160,255),0.18), transparent 50%),
    radial-gradient(circle at 75% 80%, rgba(var(--accent-rgb,120,160,255),0.12), transparent 55%),
    rgba(0,0,0,0.55);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  animation: guestLockIn .35s ease-out;
}
:root[data-theme='light'] .guest-lock {
  background:
    radial-gradient(circle at 30% 20%, rgba(var(--accent-rgb,80,120,220),0.14), transparent 50%),
    rgba(255,255,255,0.55);
}
.guest-lock[hidden] { display: none !important; } /* 同 .engine-menu/.search-box：display:flex 会覆盖 [hidden] UA 样式 */
@keyframes guestLockIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.guest-lock-box {
  padding: 44px 36px 32px;
  border-radius: 26px;
  width: min(380px, 92vw);
  text-align: center;
  position: relative;
  animation: guestLockBoxIn .4s cubic-bezier(.2,.8,.2,1);
  background: var(--surface-2, rgba(30,32,42,0.78));
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid var(--edge, rgba(255,255,255,0.12));
  box-shadow:
    0 30px 60px -15px rgba(0,0,0,0.45),
    0 2px 0 rgba(255,255,255,0.08) inset,
    0 -1px 0 rgba(0,0,0,0.2) inset;
}
:root[data-theme='light'] .guest-lock-box {
  box-shadow:
    0 30px 60px -20px rgba(0,0,0,0.2),
    0 2px 0 rgba(255,255,255,0.6) inset,
    0 -1px 0 rgba(0,0,0,0.06) inset;
}
@keyframes guestLockBoxIn {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.guest-lock-box::before {
  content: '🔒';
  position: absolute; top: -28px; left: 50%; transform: translateX(-50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 26px;
  background: var(--surface-2);
  border: 1px solid var(--edge);
  box-shadow: 0 8px 20px -8px rgba(0,0,0,0.4), 0 0 0 4px var(--bg, rgba(18,20,28,1));
}
.guest-lock-title { margin: 12px 0 10px; font-size: 20px; font-weight: 600; letter-spacing: .01em; }
.guest-lock-hint { margin: 0 0 24px; font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.guest-lock-box .input { width: 100%; margin-bottom: 16px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border); background: rgba(0,0,0,0.25); color: var(--text); font-size: 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
.guest-lock-box .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb,120,160,255),0.25); }
.guest-lock-box .btn { width: 100%; padding: 12px; border-radius: 12px; font-weight: 500; }
.guest-lock-err { margin-top: 12px; font-size: 13px; color: var(--danger); min-height: 20px; }
.guest-lock-admin { margin-top: 18px; font-size: 12px; color: var(--text-muted); }
.guest-lock-admin a { color: var(--accent); text-decoration: none; }
.guest-lock-admin a:hover { text-decoration: underline; }

/* ============ P2: 快捷键帮助 ============ */
.shortcuts-list {
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px 0;
}
.sc-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
}
.sc-row span { color: var(--text-muted); font-size: 13px; }
kbd {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 2px 8px;
  font-family: monospace;
  font-size: 12px;
  color: var(--text);
}

/* update-ready / shortcuts-btn 已移除（Docker 版无 SW update 提示） */

/* ================= 分组图标显示 ================= */
/* 导航栏标签：图标+文字保持一行完整 */
.ntab-btn { white-space: nowrap; }

/* 分组标题内图标 */
.group-head h2 .g-title-icon {
  flex-shrink: 0;               /* 空间不足时图标不被挤压 */
  margin-right: 7px;
  font-size: 0.92em;
}

/* 侧边目录：有图标时替代色点 */
.gn-icon {
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1;
}

/* ================= NAS 运行状态面板（右侧 / 左侧悬浮，可折叠） ================= */
.nas-panel {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  width: 246px;
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px 13px 11px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--edge);
  box-shadow: var(--raised);
  transition: width 260ms var(--ease), padding 260ms var(--ease);
}
.nas-panel[hidden] { display: none; }
/* 紧贴内容区（卡片分组）左右边缘：内容区外仍留白时贴边，留白不足时退回视口边缘 */
.nas-panel.right { right: max(14px, calc((100vw - var(--content-max, 1200px)) / 2 - 258px)); }
.nas-panel.left { left: max(14px, calc((100vw - var(--content-max, 1200px)) / 2 - 258px)); }
.nas-panel.collapsed { width: 46px; padding: 12px 6px; height: 190px; }

.np-head { display: flex; align-items: center; gap: 8px; flex: none; }
.np-title { font-size: 12.5px; font-weight: 600; letter-spacing: .2px; }
.np-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--success); box-shadow: 0 0 0 3px rgba(63, 169, 129, .16);
}
.np-dot.bad { background: var(--danger); box-shadow: 0 0 0 3px rgba(224, 93, 93, .16); }
.np-fold {
  margin-left: auto; width: 24px; height: 24px; flex: none;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: 14px; line-height: 1; display: grid; place-items: center;
  transition: background var(--tr) var(--ease), color var(--tr) var(--ease), transform var(--tr) var(--ease);
}
.np-fold:hover { background: var(--hover-bg); color: var(--accent); }
.nas-panel.left .np-fold { transform: rotate(180deg); }

.np-rail { display: none; flex-direction: column; align-items: center; gap: 9px; flex: 1; padding-top: 4px; }
.np-rail .pct { writing-mode: vertical-rl; font-size: 11px; font-weight: 600; color: var(--accent); }
.np-rail .txt { writing-mode: vertical-rl; font-size: 10.5px; letter-spacing: 2px; color: var(--text-muted); }
.np-rail .bar {
  width: 4px; flex: 1; border-radius: 3px; overflow: hidden;
  background: var(--surface-2); box-shadow: var(--inset);
  display: flex; align-items: flex-end;
}
.np-rail .bar i {
  display: block; width: 100%; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), #9db0ff);
  transition: height 500ms var(--ease);
}

.np-body { display: flex; flex-direction: column; gap: 9px; overflow-y: auto; min-height: 0; }
.np-body::-webkit-scrollbar { width: 4px; }
.np-body::-webkit-scrollbar-thumb { background: var(--edge); border-radius: 3px; }
.np-hn { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-os { font-size: 10.5px; color: var(--text-muted); line-height: 1.5; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-ip { font-size: 10.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; letter-spacing: .3px; margin-top: 1px; }

.np-metric .np-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); }
.np-metric .np-row b { font-size: 12.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.np-metric .bar {
  height: 4px; border-radius: 3px; margin-top: 5px; overflow: hidden;
  background: var(--surface-2); box-shadow: var(--inset);
}
.np-metric .bar i {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), #9db0ff);
  transition: width 500ms var(--ease);
}
.np-metric .bar i.warn { background: linear-gradient(90deg, #d9963f, #f0c178); }
.np-metric .bar i.danger { background: linear-gradient(90deg, #e05d5d, #f09a9a); }

/* 网络数值较长（↓104.6 KB/s ↑109 B/s），单独缩小字号避免撑满面板宽度 */
.np-net .np-row b { font-size: 11.5px; letter-spacing: -0.2px; }

.np-net svg { width: 100%; height: 34px; display: block; margin: 3px 0 1px; flex: none; }
.np-legend { display: flex; gap: 10px; font-size: 10px; color: var(--text-muted); }

.np-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.np-meta div { padding: 6px 8px; border-radius: 10px; background: var(--surface-2); box-shadow: var(--inset); }
.np-meta span { display: block; font-size: 10px; color: var(--text-muted); }
.np-meta b { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

.np-ct-head {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 11.5px; font-weight: 600; margin-top: 2px;
}
.np-ct-head span { font-size: 10.5px; font-weight: 400; color: var(--text-muted); }
.np-ct-list { display: flex; flex-direction: column; gap: 5px; }
.np-ct {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px;
  padding: 6px 8px; border-radius: 10px; background: var(--surface-2);
}
.np-ct .n {
  font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.np-ct .n i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex: none; }
.np-ct .n i.stop { background: var(--text-muted); opacity: .5; }
.np-ct .c { font-size: 11px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.np-ct .m { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text-muted); }
.np-ct .m .mb { flex: 1; height: 3px; border-radius: 2px; overflow: hidden; background: var(--surface); box-shadow: var(--inset); }
.np-ct .m .mb i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

.np-foot { font-size: 10px; color: var(--text-muted); text-align: center; letter-spacing: .2px; }
.np-empty { font-size: 11px; color: var(--text-muted); padding: 8px 0; text-align: center; }

.nas-panel.collapsed .np-title,
.nas-panel.collapsed .np-dot,
.nas-panel.collapsed .np-body { display: none; }
.nas-panel.collapsed .np-head { flex-direction: column; gap: 8px; }
.nas-panel.collapsed .np-fold { margin: 0; transform: rotate(180deg); }
.nas-panel.left.collapsed .np-fold { transform: none; }
.nas-panel.collapsed .np-rail { display: flex; }

/* 宽屏时面板紧贴内容区边缘，不再给 body 加内边距（避免内容与面板双重偏移） */
/* 左侧面板与分组目录互斥（目录固定在同一侧） */
body.nas-left .group-nav,
body.nas-left .gn-toggle,
body.nas-both .group-nav,
body.nas-both .gn-toggle { display: none !important; }
/* 手机端不展示面板，避免遮挡卡片 */
@media (max-width: 768px) {
  .nas-panel { display: none !important; }
}

/* ---- 面板「详情」按钮与存储汇总 ---- */
.np-detail {
  margin-left: auto; flex: none; border: 0; cursor: pointer;
  padding: 3px 8px; border-radius: 8px; font: inherit; font-size: 10.5px;
  background: var(--accent-soft); color: var(--accent);
  transition: background var(--tr) var(--ease), color var(--tr) var(--ease);
}
.np-detail:hover { background: var(--accent); color: #fff; }
.np-head .np-detail + .np-fold { margin-left: 2px; }
.nas-panel.collapsed .np-detail { display: none; }
.np-stor { font-size: 10.5px; color: var(--text-muted); line-height: 1.55; }
.np-stor b { color: var(--text); font-weight: 600; }

/* ================= NAS 详细信息弹窗 ================= */
.nas-detail-box {
  /* 宽度约为原版 1.3 倍，缓解容器表拥挤 */
  width: min(1220px, 94vw); max-width: 1220px; max-height: 88vh;
  display: flex; flex-direction: column; padding: 18px 22px 16px; overflow: hidden;
}
/* 用 ID 提升优先级，覆盖各主题对 .modal-box 的背景定义；--nas-alpha 由后台滑块控制 */
#nasDetailModal .nas-detail-box {
  background: color-mix(in srgb, var(--surface) var(--nas-alpha, 100%), transparent);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
}
.nas-detail-box .modal-head { flex: none; }
.nas-detail-body { overflow: auto; margin-top: 10px; padding-right: 4px; min-height: 0; }
.nas-detail-body::-webkit-scrollbar { width: 6px; }
.nas-detail-body::-webkit-scrollbar-thumb { background: var(--scroll-thumb, var(--edge)); border-radius: 3px; }

.nas-d-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.nas-d-host h4 { margin: 0; font-size: 15px; font-weight: 600; }
.nas-d-host p { margin: 2px 0 0; font-size: 11.5px; color: var(--text-muted); }
.nas-d-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.nas-d-kpi { padding: 12px 13px; border-radius: 14px; background: var(--surface-2); box-shadow: var(--raised-sm); min-width: 0; }
.nas-d-kpi .k { font-size: 11px; color: var(--text-muted); }
.nas-d-kpi .v { font-size: 21px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.nas-d-kpi .v small { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: 3px; }
.nas-d-kpi .s { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }

.nas-d-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 10px; margin-top: 10px; }
.nas-d-panel { padding: 12px 13px; border-radius: 14px; background: var(--surface-2); box-shadow: var(--raised-sm); min-width: 0; }
.nas-d-panel h5 { margin: 0 0 8px; font-size: 12px; font-weight: 600; }
.nas-d-net { width: 100%; height: 110px; display: block; }
.nas-d-legend { display: flex; gap: 14px; font-size: 11px; color: var(--text-muted); margin-top: 4px; flex-wrap: wrap; }
.nas-d-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

.nas-d-disk { padding: 6px 0; border-bottom: 1px dashed var(--edge); }
.nas-d-disk:last-child { border-bottom: 0; }
.nas-d-disk .r { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; }
.nas-d-disk .r span:last-child { color: var(--text-muted); white-space: nowrap; }

.nas-d-table { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 10px; }
.nas-d-table th {
  text-align: left; font-weight: 500; font-size: 10.5px; color: var(--text-muted);
  padding: 0 8px 6px; border-bottom: 1px solid var(--edge); white-space: nowrap;
}
.nas-d-table td { padding: 7px 8px; border-bottom: 1px solid var(--edge); }
.nas-d-table tr:last-child td { border-bottom: 0; }
.nas-d-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nas-d-table .nm { display: flex; align-items: center; gap: 6px; }
.nas-d-table .nm i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); flex: none; }
.nas-d-table .nm i.stop { background: var(--text-muted); opacity: .5; }
.nas-d-foot { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--text-muted); }
.nas-d-foot b { color: var(--text); font-weight: 600; }

@media (max-width: 820px) {
  .nas-d-kpis { grid-template-columns: repeat(2, 1fr); }
  .nas-d-grid { grid-template-columns: 1fr; }
}

/* 网络上下行配色：下行蓝、上行绿（与曲线颜色一致） */
.v-down { color: var(--accent); }
.v-up { color: var(--success); }
.np-row b .v-down, .np-row b .v-up { font-size: inherit; font-weight: inherit; }

/* ================= NAS 状态条（卡片下方，单行概览） ================= */
.nas-banner {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 18px; padding: 12px 18px;
  border-radius: 18px; background: var(--surface);
  box-shadow: var(--raised-sm); cursor: pointer;
  transition: box-shadow var(--tr) var(--ease), transform var(--tr) var(--ease);
}
.nas-banner[hidden] { display: none; }
.nas-banner:hover { box-shadow: var(--raised); transform: translateY(-1px); }
.nb-host { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; min-width: 0; }
.nb-host b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-host span { font-size: 10.5px; font-weight: 400; color: var(--text-muted); white-space: nowrap; }
.nb-item { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.nb-item b { font-size: 13.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.nb-item .m { font-size: 10.5px; color: var(--text-muted); }
.nb-spark { width: 92px; height: 24px; flex: none; }
.nb-more {
  margin-left: auto; border: 0; background: transparent; cursor: pointer; font: inherit;
  font-size: 12.5px; color: var(--accent); font-weight: 600; white-space: nowrap;
}
.nb-more:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .nas-banner { gap: 10px 14px; padding: 11px 14px; }
  .nb-item .m, .nb-host span { display: none; }
  .nb-more { margin-left: 0; }
}
