@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Text:ital@0;1&display=swap');

/* ===== 默认：暗色主题 ===== */
:root {
  --bg: #0b1220;
  --glass: rgba(9, 16, 30, 0.72);
  --glass-strong: rgba(9, 16, 30, 0.85);
  --line: #5fdfff33;
  --accent: #7ad8ff;
  --accent-strong: #00c8ff;
  --text: #e8f7ff;
  --muted: #a5c8d9;

  /* HUD 风格 */
  --hud-accent: #00f0ff;
  --hud-bg: #0a0f1c;
  --hud-text: #e0f7ff;

  --radius: 14px;
  --blur: 10px;
  --shadow: 0 6px 24px rgba(0, 200, 255, 0.15);
  --Double-Arrow-Up: #FFFFFF;
  --search: #FFFFFF;

  /* 代码框（暗色） */
  --cb-bg: #1e1e1e;
  --cb-text: #eaeaea;
  --cb-border: #3c3c3c;
  --cb-accent: #8ab4f8;
  --cb-scroll: rgba(255,255,255,0.2);
  --cb-toolbar-bg: rgba(255,255,255,0.05);
}

/* ===== 浅色主题 ===== */
:root.light {
  --bg: #e9f6ff;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.85);
  --line: #007fb833;
  --accent: #0aa8ff;
  --accent-strong: #0077ff;
  --text: #0b1b2b;
  --muted: #46718a;

  /* HUD 风格（浅色版） */
  --hud-accent: #0077ff;
  --hud-bg: #e9f6ff;
  --hud-text: #0a1b2b;

  --Double-Arrow-Up: #000000;
  --search: #000000;

  /* 代码框（浅色） */
  --cb-bg: #fafafa;
  --cb-text: #1a1a1a;
  --cb-border: #d0d0d0;
  --cb-accent: #1a73e8;
  --cb-scroll: rgba(0,0,0,0.2);
  --cb-toolbar-bg: rgba(0,0,0,0.03);
}


* { box-sizing: border-box; font-family: "DM Serif Text", serif;
  font-weight: 400;
  font-style: normal; font-size:24px}
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 800px at 20% -10%, #07203a 0%, var(--bg) 45%) no-repeat fixed;
  color: var(--text);
  overflow-x: hidden;
}

/* HUD 扫描线背景层 */
.hud-scanlines {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px);
  background-size: 100% 4px;
  animation: scan 3.6s linear infinite;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 1;
}
@keyframes scan {
  from { background-position: 0 0; }
  to   { background-position: 0 4px; }
}

/* 顶部导航 */
.ba-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: linear-gradient(180deg, var(--glass-strong), color-mix(in oklab, var(--glass) 88%, transparent));
  backdrop-filter: blur(var(--blur));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.left-cluster { display: flex; align-items: center; gap: 10px;}
.hamburger {
  display:none;
}

.logo {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; letter-spacing: .5px; text-decoration: none;
  color: var(--text);
  justify-content: center;       
}
.logo-mark { width: 20px; height: 20px; fill: none; stroke: var(--accent-strong); stroke-width: 2; filter: drop-shadow(0 0 6px color-mix(in oklab, var(--accent-strong) 60%, transparent)); }

/* 顶部菜单 */
.ba-topnav { position: relative; z-index: 2; }
.topmenu {
  display: flex; gap: 6px; list-style: none; margin: 0; padding: 0;
  align-items: stretch;  align-items: center;             /* 垂直居中子元素 */
  justify-content: center;         /* 水平居中子元素 */
}
.pill {
  position: relative;
  padding: 10px 14px;
  border: none;
  background:transparent;
  color: var(--text);
  transition: color .2s, border-color .2s, background .2s;
  overflow: hidden;
  text-decoration: none;
  display: inline-flex;            /* 让内容按 flex 布局 */
  align-items: center;             /* 垂直居中子元素 */
  justify-content: center;         /* 水平居中子元素 */
  line-height: 1;                   /* 避免行高额外撑开 */
  vertical-align: middle;           /* 和同排元素基线对齐 */
}
.pill::after { /* 流光 */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.12) 30%, transparent 60%);
  transform: translateX(-120%);
  transition: transform .6s ease;
}
.pill:hover { color: var(--accent-strong); border: none; box-shadow: var(--shadow); }
.pill:hover::after { transform: translateX(0%); }

.has-submenu { position: relative; }
.submenu-toggle .arrow { margin-left: 6px; transition: transform .25s; }
.has-submenu.open .submenu-toggle .arrow { transform: rotate(180deg); }

/* 悬浮下拉菜单（不挤压） */
.dropdown {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 220px;
  background: color-mix(in oklab, var(--glass-strong) 96%, transparent);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, .35), 0 0 0 1px #00d3ff1a inset;
  padding: 8px;
  display: grid; gap: 4px;
  opacity: 0; transform: translateY(-6px) scale(.98);
  pointer-events: none; transition: opacity .2s, transform .2s;
  backdrop-filter: blur(calc(var(--blur) * 1.1));
 
}
.has-submenu.open > .dropdown { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

/* 下拉项 */
.dropdown a, .dropdown .dropdown-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px; color: var(--text);
  background: transparent; border: none; text-align: left; cursor: pointer;
  text-decoration: none;
  
}
li{
 list-style: none;
}
.dropdown a:hover, .dropdown .dropdown-toggle:hover {
  background: #00c8ff12; color: var(--accent-strong);
}

/* 右侧浮出二级下拉 */
.right-open { position: relative; }
.dropdown.nested {
  top: -8px; left: calc(100% + 10px);
  min-width: 200px;
}

/* 右侧操作区 */
.right-actions { display: flex; align-items: center; gap: 8px; }
.pill.small { padding: 8px 12px; font-size: 12px; border-radius:50%; height:48px; width:48px;}

/* 侧边栏抽屉 */
.ba-sidebar {
  position: fixed; top: 0; left: -300px; width: 280px; height: 100vh;
  background: color-mix(in oklab, var(--glass-strong) 98%, transparent);
  backdrop-filter: blur(calc(var(--blur) * 1.2));
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 36px rgba(0,0,0,.35);
  z-index: 120;
  transition: left .28s ease;
  display: grid; grid-template-rows: auto 1fr;
}
.ba-sidebar.open { left: 0; }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.sidebar-logo {
  display: flex; align-items: center; gap: 8px; font-weight: 800;
}
.close-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; display: grid; place-items: center; cursor: pointer;
}
.close-btn:hover { border-color: var(--line); }

.icon { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 2; }

/* 侧边菜单 */
.side-nav { overflow: auto; padding: 8px 8px 18px; }
.sidemenu { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sidemenu > li > a,
.accordion {
  width: 100%; padding: 12px 12px; border-radius: 10px;
  color: var(--text); text-decoration: none; background: transparent;
  border: 1px solid transparent; cursor: pointer; text-align: left;
}
.sidemenu > li > a:hover, .accordion:hover {
  border-color: var(--line); background: #00c8ff14; box-shadow: var(--shadow);
}

.sublist {
  list-style: none; margin: 4px 0 10px 0; padding-left: 10px;
  display: grid; gap: 4px;
  max-height: 0; overflow: hidden; transition: max-height .25s ease;
  border-left: 1px dashed #00c8ff40;
  text-decoration: none;
}
.sublist li {
  list-style: none;       /* 保险起见，li 也清除 */
  padding: 6px 12px;      /* 内间距 */
  border-radius: 6px;     /* 圆角 */
  transition: background 0.25s ease, color 0.25s ease;
}

.sublist li a {
  display: block;         /* 链接撑满点击区域 */
  color: var(--hud-text, #e0f7ff);
  text-decoration: none;  /* 去下划线 */
  font-size: 14px;
}


.has-submenu.open > .sublist { max-height: 640px; text-decoration: none; }

.accordion.sub { padding-left: 6px; }

/* 遮罩 */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0, 10, 20, .46);
  backdrop-filter: blur(1px);
  z-index: 110; opacity: 0; visibility: hidden; transition: .22s;
}
.overlay.show { opacity: 1; visibility: visible; }

/* 页面内容示例 */
.page { position: relative; z-index: 2; padding: 28px 20px; }
.hero {
  margin-top: 20px; padding: 28px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: color-mix(in oklab, var(--glass) 90%, transparent);
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
}
.cards {
  margin-top: 20px; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  
}
.card {
  height: 120px; border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in oklab, var(--glass) 85%, transparent), transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(calc(var(--blur) * .6));
  display: grid; place-items: center; color: var(--muted);
}

/* 响应式：小屏隐藏顶部横向菜单，仅保留汉堡与 LOGO */
@media (max-width: 900px) {
  .ba-topnav { display: none; }
  .hamburger {
  width: 40px; height: 40px; border-radius: 12px;
  background: transparent; border: 1px solid transparent; cursor: pointer;
  display: inline-grid; place-items: center; transition: .2s;
}
.hamburger .icon { width: 22px; height: 22px; fill: none; stroke: var(--text); stroke-width: 2; }
.hamburger:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.logo{display:none;}
/* 所有菜单项统一清零默认样式 */
.sidemenu, .sublist {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 一级 & 二级基础样式 */
.sidemenu > li > a,
.sidemenu > li > .accordion,
.sublist li > a,
.sublist li > .accordion {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--hud-text);
  background: transparent;
  border: none;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

/* hover 效果统一 */
.sidemenu li > a:hover,
.sidemenu li > .accordion:hover,
.sublist li > a:hover,
.sublist li > .accordion:hover {
  background: rgba(0,240,255,0.08);
  color: var(--hud-accent);
}

/* 缩进统一：子菜单 */
.sublist {
  padding-left: 12px;
  border-left: 1px dashed rgba(0,240,255,0.3);
}

/* 多级子菜单的内层缩进稍小 */
.sublist .sublist {
  padding-left: 10px;
  border-left: 1px dashed rgba(0,240,255,0.15);
}

/* 手风琴箭头对齐调整 */
.accordion::after {
  content: "▾";
  float: right;
  transition: transform 0.25s ease;
}
.has-submenu.open > .accordion::after {
  transform: rotate(180deg);
}

}
/* 面板主体 */
.panel {
  height: auto;
  border-radius: var(--radius, 10px);
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--glass, rgba(0,0,0,0.5)) 85%, transparent),
    transparent
  );
  border: 1px solid var(--line, rgba(0,240,255,0.4));
  backdrop-filter: blur(calc(var(--blur, 10px) * .6));
  display: flex;
  flex-direction: column;
  color: var(--muted, #a5c8d9);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  overflow: hidden;
  margin-top: 20px;
  
}

/* 面板头部 */
.panel-header {
  padding: 10px 14px;
  background: linear-gradient(
    180deg,
    rgba(0,240,255,0.08) 0%,
    rgba(0,240,255,0.03) 100%
  );
  color: var(--hud-accent, #00f0ff);
  font-weight: bold;
  font-size: 15px;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--line, rgba(0,240,255,0.4));
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 面板主体内容 */
.panel-body {
  padding: 14px;
  font-size: 14px;
  color: var(--hud-text, #e0f7ff);
  line-height: 1.5;
  flex: 1;
}

/* 面板底部（可选） */
.panel-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--line, rgba(0,240,255,0.4));
  background: rgba(0,240,255,0.03);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 遮罩层 */
.hud-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
  animation: fadeOut 1s ease forwards;
  animation-delay: 2.5s; /* 页面加载后延时消失 */
}

/* 核心内容容器 */
.loader-content {
  position: relative;
  text-align: center;
}

/* 扫描线动画 */
.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--hud-accent);
  box-shadow: 0 0 10px var(--hud-accent), 0 0 20px var(--hud-accent);
  animation: scan 2s linear infinite;
}

/* LOGO 样式 */
.logo {
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 2px;
  color: var(--hud-accent);
  text-shadow: 0 0 8px var(--hud-accent);
  margin-bottom: 10px;
}

/* LOADING 文字 */
.loading-text {
  font-size: 14px;
  letter-spacing: 4px;
  color: var(--hud-text);
}

.dots::after {
  content: '';
  animation: dots 1.5s steps(3, end) infinite;
}

/* 动画定义 */
@keyframes scan {
  0% { top: 0; }
  100% { top: 100%; }
}

@keyframes dots {
  0% { content: ''; }
  33% { content: '.'; }
  66% { content: '..'; }
  100% { content: '...'; }
}

#preloader.hide {
    transform: translateY(100vh) rotate(20deg) scale(0.9);
    opacity: 0;
  }
  .to-top-btn {
  position: fixed;
  right: 20px;
  bottom: 30px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--hud-accent, #00f0ff);
  background: var(--hud-bg, rgba(0,0,0,0.65));
  color: var(--hud-accent, #00f0ff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 8px var(--hud-accent, #00f0ff);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.25s ease, background 0.3s ease;
  z-index: 1000;
  overflow: hidden; /* 让脉冲不超出按钮范围 */
}

.to-top-btn:hover {
  background: var(--hud-accent, #00f0ff);
  color: var(--hud-bg, #0a0f1c);
  transform: translateY(-3px);
}

.to-top-btn.show {
  opacity: 1;
  pointer-events: auto;
}

/* 能量脉冲圈 */
.pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--hud-accent, #00f0ff);
  opacity: 0;
  transform: scale(0.5);
  pointer-events: none;
}

.pulse.animate {
  animation: pulseAnim 0.6s ease-out forwards;
}

@keyframes pulseAnim {
  0%   { opacity: 0.5; transform: scale(0.5); }
  70%  { opacity: 0.2; transform: scale(2); }
  100% { opacity: 0; transform: scale(2.5); }
}

.btn-group {
  display: flex;
  gap: none;
}

/* 横向 */
.btn-group.horizontal {
  flex-direction: row;
}

/* 纵向 */
.btn-group.vertical {
  flex-direction: column;
}

.hud-btn {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--hud-accent);
  background: var(--hud-bg);
  border: 1px solid var(--hud-accent);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
   margin-top:20px;
}

.hud-btn:hover {
  background: var(--hud-accent);
  color: var(--hud-bg);
  box-shadow: 0 0 12px var(--hud-accent);
}

.hud-btn:active {
  transform: scale(0.96);
}
/* 页脚 */
.hud-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--hud-accent);
  background: var(--hud-bg);
  color: var(--hud-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top:20px;
  
}

/* 开关容器 */
.rgb-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  z-index:80;
}

/* 滑块底座 */
.rgb-switch input {
  display: none;
}

.slider {
  position: relative;
  width: 44px;
  height: 22px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-accent);
  border-radius: 22px;
  transition: all 0.3s ease;
  box-shadow: 0 0 6px var(--hud-accent);
}

.slider::before {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: var(--hud-accent);
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 0 6px var(--hud-accent);
}

/* ON 状态滑块效果 */
input:checked + .slider {
  background: linear-gradient(90deg, red, orange, yellow, lime, cyan, blue, violet);
  background-size: 400% 400%;
  animation: rgbFlow 3s linear infinite;
  border-color: transparent;
  box-shadow: 0 0 12px white;
}

input:checked + .slider::before {
  transform: translateX(22px);
  background: white;
  box-shadow: 0 0 6px white;
}

/* RGB 动画 */
@keyframes rgbFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* RGB 状态文字 */
.label-text {
  color: var(--hud-accent);
  font-weight: bold;
}
input:checked ~ .label-text {
  animation: rgbText 3s linear infinite;
}

@keyframes rgbText {
  0%   { color: red; }
  20%  { color: orange; }
  40%  { color: yellow; }
  60%  { color: lime; }
  80%  { color: cyan; }
  100% { color: red; }
}

/* 全局 RGB 模式 */
.rgb-mode * {
  animation: rgbGlow 4s linear infinite;
}

@keyframes rgbGlow {
  0%   { color: red; border-color: red; box-shadow: 0 0 8px red; fill: red; }
  20%  { color: orange; border-color: orange; box-shadow: 0 0 8px orange; fill: orange; }
  40%  { color: yellow; border-color: yellow; box-shadow: 0 0 8px yellow; fill: yellow; }
  60%  { color: lime; border-color: lime; box-shadow: 0 0 8px lime; fill: lime; }
  80%  { color: cyan; border-color: cyan; box-shadow: 0 0 8px cyan; fill: cyan; }
  100% { color: red; border-color: red; box-shadow: 0 0 8px red; fill: red; }
}

.hud-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative
}

/* 搜索按钮和框容器 */
.search-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}

/* 搜索框默认隐藏 */
.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-accent);
  border-radius: 6px;
  padding: 4px 8px;
  box-shadow: 0 0 8px var(--hud-accent);
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transition: all 0.3s ease;
  z-index: 10;
  right:0;
}

/* 输入框样式 */
.search-box input {
  background: transparent;
  border: none;
  color: var(--hud-text);
  font-size: 14px;
  outline: none;
  width: 120px;
}

/* 图标样式 */
.search-icon {
  fill: var(--hud-accent);
}

/* 展开状态 */
.search-wrapper.active .search-box {
  opacity: 1;
  pointer-events: auto;
  z-index:114514;
}

/* 桌面端：搜索框在左边 */
@media (min-width: 768px) {
  .search-box {
    right: 100%;
    margin-right: 8px;
  }
}

/* 移动端：搜索框在右边 */
@media (max-width: 767px) {
  .search-box {
    left: 100%;
    margin-left: 8px;
    width:100px;
  }
}

:root {
  --hud-primary: #00e5ff;
  --hud-bg: rgba(15,25,35,0.92);
  --hud-text: #e6f7ff;
  --hud-danger: #ff4d4f;
}

.hud-overlay {
  width: 100%;
  height: 240px; /* 固定高度条形 */
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--hud-bg);
  position: fixed;
  top: 50%;
  left: 0;
    box-shadow: 0 0 12px var(--hud-primary);
  transform: translateY(-50%);
  z-index: 9999;
  border: 1px solid var(--hud-primary);
    border-radius: 8px;
animation: fadeIn 1s;
}

.hud-dialog {
  background: var(--hud-bg);
  color: var(--hud-text);
  width: 420px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding:5px;
}

.CodeBox{
margin-top:20px;
}
/* 第一行：图标+标题 */
.hud-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.hud-icon {
  font-size: 40px;
}
.hud-title {
  margin: 0;
  font-size: 24px;
  white-space: nowrap;
}

/* 第二行：正文 */
.hud-body {
  flex: 1;
  padding: 16px;
  line-height: 1.5;
  overflow-y: auto;
  font-size: 12px;
}

/* 第三行：按钮区 */
.hud-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.hud-btn-ok {
 padding: 8px 16px;
  font-size: 14px;
  color: var(--hud-accent);
  background: var(--hud-bg);
  border: 1px solid var(--hud-accent);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}
.hud-btn-cancel {
 padding: 8px 16px;
  font-size: 14px;
  color: var(--hud-accent);
  background: var(--hud-bg);
  border: 1px solid var(--hud-accent);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.hud-btn-ok:hover {
  background: var(--hud-accent);
  color: var(--hud-bg);
  box-shadow: 0 0 12px var(--hud-accent);
}

.hud-btn-ok:active {
  transform: scale(0.96);
}

.hud-btn-cancel:hover {
  background: var(--hud-accent);
  color: var(--hud-bg);
  box-shadow: 0 0 12px var(--hud-accent);
}

.hud-btn-cancel:active {
  transform: scale(0.96);
}

.hud-overlay.close{
display:none;
  width: 100%;
  height: 240px; /* 固定高度条形 */
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--hud-bg);
  position: fixed;
  top: 50%;
  left: 0;
    box-shadow: 0 0 12px var(--hud-primary);
  transform: translateY(-50%);
  z-index: 9999;
  border: 1px solid var(--hud-primary);
    border-radius: 8px;
animation: fade-out 1s;
}      
main.page {
  position: relative; /* 确保 z-index 生效 */
  z-index: 1; /* 比看板娘的 9999 小很多 */
}



.hud-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--hud-accent, #00f0ff);
  text-shadow: 0 0 6px rgba(0, 255, 255, 0.6);
  margin-top:20px;
}

.hud-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--hud-bg);
  border: 1px solid rgba(0, 255, 255, 0.4);
  border-radius: 6px;
  outline: none;
  transition: all 0.25s ease;
  
}

.hud-input:focus {
  border-color: var(--hud-cyan);
  box-shadow: 0 0 12px var(--hud-cyan);
}

/* 呼吸发光 + 扫描线 */
.glow {
  animation: hudGlow 3s ease-in-out infinite, hudScan 4s linear infinite;
}

@keyframes hudGlow {
  0%, 100% { box-shadow: 0 0 6px var(--hud-cyan), inset 0 0 4px var(--hud-cyan); }
  50% { box-shadow: 0 0 16px var(--hud-cyan), inset 0 0 8px var(--hud-cyan); }
}

@keyframes hudScan {
  0% {
    background: linear-gradient(180deg, rgba(0,255,255,0.15) 0%, transparent 30%) no-repeat, var(--hud-bg);
    background-size: 100% 200%;
    background-position-y: -100%;
  }
  100% {
    background: linear-gradient(180deg, rgba(0,255,255,0.15) 0%, transparent 30%) no-repeat, var(--hud-bg);
    background-size: 100% 200%;
    background-position-y: 200%;
  }
}

/* 色相旋转动画 */
.hue-shift {
  animation: hudGlow 3s ease-in-out infinite,
             hudScan 4s linear infinite,
             hueCycle 6s linear infinite;
}

@keyframes hueCycle {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.hud-input::placeholder {
  color: var(--text);
}


.toast {
  min-width: 240px;
  background: var(--hud-bg);
  color: var(--hud-text);
  border: 1px solid var(--hud-primary);
  border-radius: 6px;
  padding: 10px 14px;
  box-shadow: 0 0 8px var(--hud-primary);
  font-size: 14px;
  position: relative;
  transform: translateY(-15px) scale(0.98);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  display: flex;
  flex-direction: column;
}

.toast.is-enter {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.toast.is-leave {
  transform: translateY(-10px) scale(0.95);
  opacity: 0;
}

/* HUD 光效 */
.toast-header {
  display: flex;
  align-items: center;
  gap: 6px;
    justify-content: space-between; 
  margin-bottom: 4px;
}

.toast-icon {
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px var(--hud-primary));
}

.toast-title {
  font-weight: bold;
  text-shadow: 0 0 6px var(--hud-primary);
}

.toast-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toast-close {
  flex-shrink: 0;
  cursor: pointer;
  color: var(--hud-primary);
  font-weight: bold;
  border: none;
  background: none;
  font-size: 16px;
}

.toast-container {
  position: fixed;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.hud-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--hud-bg);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--hud-text);
}

.hud-radio input[type="radio"] {
  appearance: none;
  width: 14px;
  height: 14px;
  border: 2px solid var(--hud-primary);
  border-radius: 50%;
  position: relative;
  outline: none;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s ease;
}

.hud-radio input[type="radio"]:checked {
  background: var(--hud-primary);
  box-shadow: 0 0 6px var(--hud-primary);
  
}

.hud-radio span {
  font-size: 14px;
  pointer-events: none;
}

.hud-radio input[type="radio"]::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;      /* 控制内圆大小 */
  height: 8px;
  background: var(--hud-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0); /* 初始隐藏 */
  transition: transform 0.2s ease;
  box-shadow: 0 0 4px var(--hud-primary);
}
.hud-radio input[type="radio"]:checked::after {
  transform: translate(-50%, -50%) scale(1); /* 选中时放大显示 */
}

/* 主题变量（暗色） */
:root {
  --cb-bg: #1e1e1e;
  --cb-text: #eaeaea;
  --cb-border: #3c3c3c;
  --cb-accent: #8ab4f8;
  --cb-scroll: rgba(255,255,255,0.2);
  --cb-toolbar-bg: rgba(255,255,255,0.05);
  --cb-radius: 8px;
  --cb-open-max: 1000px; /* 默认展开高度，可被实例覆盖 */
  --cb-wave-inset: -2px;
  --cb-line-num: rgba(200,255,255,.6);
}

/* 主题变量（浅色） */
:root.light {
  --cb-bg: #fafafa;
  --cb-text: #1a1a1a;
  --cb-border: #d0d0d0;
  --cb-accent: #1a73e8;
  --cb-scroll: rgba(0,0,0,0.2);
  --cb-toolbar-bg: rgba(0,0,0,0.03);
}

/* 容器 */
.CodeBox { margin-top: 20px; }

/* HUD 动效 */
@keyframes hud-breath {
  0%,100% { box-shadow: 0 0 4px var(--cb-accent), 0 0 8px rgba(0,240,255,0.4); }
  50%     { box-shadow: 0 0 10px var(--cb-accent), 0 0 20px rgba(0,240,255,0.8); }
}
@keyframes hud-pulse {
  0%   { box-shadow: 0 0 20px var(--cb-accent), 0 0 40px rgba(0,240,255,0.8); }
  100% { box-shadow: 0 0 4px var(--cb-accent), 0 0 8px rgba(0,240,255,0.4); }
}
@keyframes hud-wave {
  0%   { opacity: 0.6; transform: scale(1);   border-color: var(--cb-accent); }
  100% { opacity: 0;   transform: scale(1.5); border-color: transparent; }
}

/* 代码块壳体 */
.code-block {
  position: relative;
  background: var(--cb-bg);
  border: 1px solid var(--cb-border);
  border-radius: var(--cb-radius);
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  animation: hud-breath 3s ease-in-out infinite;
  transition: box-shadow 0.3s ease;
}
.code-block.is-expanded {
  animation: hud-breath 3s ease-in-out infinite, hud-pulse 0.6s ease forwards;
}
.code-block::after {
  content: "";
  position: absolute;
  inset: var(--cb-wave-inset);
  border-radius: var(--cb-radius);
  border: 2px solid var(--cb-accent);
  pointer-events: none;
  opacity: 0;
}
.code-block.is-expanded::after { animation: hud-wave 0.6s ease-out; }

/* 只折叠中间内容 */
.code-block-content {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform-origin: top;
  transform: scaleY(0.96);
  will-change: max-height, opacity, transform;
  transition:
    max-height 0.42s cubic-bezier(.25,.8,.25,1),
    opacity 0.35s ease,
    transform 0.35s ease;
}
.code-block.is-expanded .code-block-content {
  max-height: var(--cb-open-max);
  opacity: 1;
  transform: scaleY(1);
}

/* 代码区 */
.code-block-content pre {
  margin: 0;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cb-text);
  overflow: auto;
}
.code-block-content pre::-webkit-scrollbar { width: 8px; height: 8px; }
.code-block-content pre::-webkit-scrollbar-thumb { background: var(--cb-scroll); border-radius: 4px; }

/* 工具栏常驻 */
.code-block-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: var(--cb-toolbar-bg);
  border-top: 1px solid var(--cb-border);
}
.code-block-toolbar-top {
  border-top: none;
  border-bottom: 1px solid var(--cb-border);
}
.code-block-title { font-weight: 700; font-size: 12px; color: var(--cb-text); }
.code-block-lang  { font-size: 12px; color: var(--cb-text); opacity: .7; }

/* 工具栏按钮组 */
.code-block-actions { display: flex; align-items: center; gap: 8px; }
.code-block-actions button {
  background: transparent; border: none; font-size: 12px; cursor: pointer;
  padding: 4px 8px; border-radius: 4px; color: var(--cb-accent);
  transition: background .2s ease, box-shadow .3s ease, color .2s ease;
}
.code-block-actions button:hover { background: var(--cb-scroll); box-shadow: 0 0 6px var(--cb-accent); }
.code-block-actions button:focus-visible { outline: 2px solid var(--cb-accent); outline-offset: 2px; }
.code-block-copy-btn.is-copied { color: #4caf50; }

/* 搜索条 */
.code-block-search {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: var(--cb-toolbar-bg);
  border-bottom: 1px solid var(--cb-border);
}
.code-block-search-input {
  flex: 1; min-width: 120px; background: transparent; color: var(--cb-text);
  border: 1px solid var(--cb-border); border-radius: 4px; padding: 6px 8px;
}
.code-block-search-input::placeholder { color: rgba(127,127,127,.7); }
.code-block-search-count { font-size: 12px; color: var(--cb-text); opacity: .7; }

/* 行号与行高亮 */
.code-block-code { counter-reset: linenumber; }
.code-line { display: block; counter-increment: linenumber; position: relative; white-space: pre; }
.line-number {
  display: inline-block; width: 2.6em; margin-right: 1em; text-align: right;
  color: var(--cb-line-num); user-select: none; opacity: .6;
}
.line-number::before { content: counter(linenumber); }
.code-line.hl { background: linear-gradient(90deg, rgba(0,240,255,.15), transparent 60%); }

/* 搜索命中高亮 */
.cb-hit {
  background: rgba(255, 230, 0, .25);
  outline: 1px solid rgba(255, 230, 0, .5);
  border-radius: 2px;
}

/* 自动换行开关 */
.code-block.is-wrapped .code-block-content .code-line { white-space: pre-wrap; word-break: break-word; }

/* 全屏模式 */
.code-block.is-fullscreen {
  position: fixed; inset: 16px; z-index: 9999;
  border-radius: 12px; box-shadow: 0 8px 48px rgba(0,0,0,.5);
  background: var(--cb-bg);
}
body.cb-no-scroll { overflow: hidden; }

/* 无动画模式降级（无障碍） */
@media (prefers-reduced-motion: reduce) {
  .code-block, .code-block.is-expanded, .code-block::after, .code-block-content {
    animation: none !important;
    transition: none !important;
  }
}
/* Tabs 样式 */
.code-tabs-nav {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--cb-border);
  margin-bottom: 8px;
}
.code-tabs-nav button {
  background: transparent;
  border: none;
  padding: 6px 12px;
  color: var(--cb-accent);
  cursor: pointer;
  border-radius: 4px;
  transition: background .2s ease, color .2s ease;
}
.code-tabs-nav button[aria-selected="true"] {
  background: var(--cb-scroll);
  color: var(--cb-text);
  box-shadow: 0 0 6px var(--cb-accent);
}
.code-tabs-panel { display: none; }
.code-tabs-panel.is-active { display: block; }
