* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #1e1e1e; --bg2: #252526; --bg3: #2d2d30;
  --fg: #e8e8e8; --muted: #9a9a9a; --line: #3a3a3d;
  --accent: #1a8cff; --accent2: #0d6fd4; --card: #2b2b2e;
}
body { background: var(--bg); color: var(--fg); font: 14px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
#app { display: flex; height: 100vh; }

/* 侧边栏 */
.sidebar { width: 220px; min-width: 220px; background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { padding: 18px 16px; font-size: 18px; font-weight: 700; border-bottom: 1px solid var(--line); }
.brand-icon { color: var(--accent); }
nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; cursor: pointer; color: var(--fg); user-select: none; }
.nav-item:hover { background: var(--bg3); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item .ico { width: 20px; text-align: center; font-size: 16px; }
.nav-sep { height: 1px; background: var(--line); margin: 8px 12px; }
.sidebar-footer { padding: 12px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.sidebar-footer .btn { margin-top: 6px; }

/* 主区 */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.conn-bar { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #888; flex: none; }
.dot.on { background: #3c3; } .dot.busy { background: #fa0; }
.conn-name { color: var(--muted); font-size: 12px; }
.spacer { flex: 1; }
.content { flex: 1; overflow-y: auto; padding: 20px; }

/* 通用 */
.btn { background: var(--bg3); color: var(--fg); border: 1px solid var(--line); padding: 8px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent2); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.danger { color: #ff6b6b; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.card h2 { font-size: 16px; margin-bottom: 12px; }
.card h3 { font-size: 14px; margin: 12px 0 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid { display: grid; gap: 12px; }
.muted { color: var(--muted); font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 8px; }
.err { background: #5a1e1e; color: #ffd0d0; padding: 8px 10px; border-radius: 6px; margin-bottom: 10px; font-size: 13px; }
input, select, textarea { background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 13px; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: block; margin-bottom: 10px; }
label > input, label > select, label > textarea { display: block; width: 100%; margin-top: 4px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; background: var(--bg3); font-size: 11px; margin-left: 6px; }
.tag.ok { background: #1e5e2a; color: #9f9; }
.tag.wait { background: #6b5410; color: #ffd67a; }

/* 学习模块 */
.learn-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.learn-tabs .btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.learn-layout { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.2fr); gap: 16px; }
.hz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; max-height: 60vh; overflow-y: auto; padding-right: 4px; }
.hz-cell { position: relative; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 10px 4px; text-align: center; cursor: pointer; }
.hz-cell:hover { border-color: var(--accent); }
.hz-cell.mastered { background: #1e5e2a; border-color: #3a3; }
.hz-cell .ch { font-size: 26px; font-weight: 700; line-height: 1.2; }
.hz-cell .wd { font-size: 10px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hz-cell .mk { position: absolute; top: 2px; right: 4px; font-size: 10px; color: #9f9; }
.preview-box { background: #fff; border-radius: 8px; padding: 10px; display: flex; align-items: center; justify-content: center; min-height: 300px; }
.preview-box img { max-width: 100%; image-rendering: pixelated; border: 1px solid #ddd; }

/* 英语图片 */
.topic-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.topic-card { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.topic-card h4 { margin-bottom: 6px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.img-item { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.img-item img { width: 100%; height: 120px; object-fit: cover; display: block; background: #fff; }
.img-item .cap { padding: 6px 8px; font-size: 12px; }
.img-item .ops { padding: 0 8px 8px; display: flex; gap: 6px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; width: 380px; }
.modal-card.wide { width: 560px; max-height: 80vh; overflow-y: auto; }
.modal-card h3 { font-size: 18px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* 表单补充 */
label.inline { display: inline-flex !important; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
label.inline > input[type=checkbox], label.inline > input[type=range] { display: inline-block !important; width: auto !important; margin: 0; }
textarea { width: 100%; margin-top: 4px; resize: vertical; }
.block-editor { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 10px; }

/* 槽位网格 */
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 14px; }
.slot-cell { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; }
.slot-cell.has { border-color: #3a3; }
.slot-cell.cur { background: #1e5e2a; }
.slot-no { font-weight: 700; font-size: 14px; }
.slot-state { font-size: 11px; color: var(--muted); margin: 4px 0 6px; }
.slot-cell .btn { margin: 2px; padding: 3px 8px; font-size: 11px; }

/* 设备状态键值网格 */
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 14px; }
.kv { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; background: var(--bg3); border-radius: 6px; font-size: 12px; }
.kv span { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; word-break: break-word; }

/* 占位页 */
.placeholder { text-align: center; padding: 60px 20px; color: var(--muted); }
.placeholder .big { font-size: 48px; margin-bottom: 12px; }

@media (max-width: 800px) {
  .sidebar { width: 62px; min-width: 62px; }
  .brand { font-size: 0; padding: 16px 10px; }
  .brand-icon { font-size: 20px; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .nav-item span:not(.ico) { display: none; }
  .learn-layout { grid-template-columns: 1fr; }
}

/* 面包屑提示条（替代 alert dialog） */
#toastBox { position: fixed; top: 68px; right: 34px; left: auto; bottom: auto; z-index: 9999; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 360px; pointer-events: none; }
.toast-item { max-width: 100%; color: #f4f8ff; background: rgba(20,27,42,.92); color: var(--fg); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.4); font-size: 13px; animation: toastIn .25s ease; word-break: break-all; }
.toast-item.out { opacity: 0; transform: translateX(24px); transition: all .35s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* 左编辑 / 右预览 分栏 */
.split { display: flex; gap: 16px; align-items: flex-start; }
.split-left { flex: 1.1; min-width: 0; }
.split-right { flex: 1; min-width: 0; position: sticky; top: 0; }
.split .card { margin-bottom: 0; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h2 { font-size: 17px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg .btn { border: none; border-radius: 0; background: var(--bg2); }
.seg .btn.active { background: var(--accent); color: #fff; }
@media (max-width: 960px) { .split { flex-direction: column; } .split-right { position: static; } }

/* 设备连接页 hero 卡 */
.hero { padding: 22px; }
.hero-status { display: flex; align-items: center; gap: 14px; }
.dot.big { width: 16px; height: 16px; }
.hero-status h2 { margin-bottom: 4px; }
.known-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.known-row:last-child { border-bottom: none; }
.known-name { flex: 1; font-size: 13px; }

/* ==================== Liquid Glass 3.0（液态玻璃） ==================== */
:root {
  --bg: #0a0d14; --bg2: rgba(20,25,36,.55); --bg3: rgba(255,255,255,.055);
  --fg: #eef3fb; --muted: rgba(226,235,250,.56); --line: rgba(255,255,255,.12);
  --accent: #4f9dff; --accent2: #2f7ad8; --card: rgba(255,255,255,.055);
  --lg-blur: 30px;                 /* 玻璃厚度（模糊半径） */
  --lg-r: 20px;                    /* 大半径圆角，液态玻璃特征 */
  --lg-stroke: rgba(255,255,255,.14);
  --lg-inner: inset 0 1px 0 rgba(255,255,255,.32),
              inset 0 -1px 0 rgba(255,255,255,.05),
              inset 0 0 34px rgba(255,255,255,.035);
  --lg-shadow: 0 24px 60px rgba(3,6,16,.46), 0 4px 16px rgba(3,6,16,.30);
  --lg-ease: cubic-bezier(.32,.9,.28,1);
}

/* ---------- 底层环境：深空底色 + 缓慢流动的极光 ---------- */
html { color-scheme: dark; }
body { background: var(--bg); overflow-x: hidden; }
body::before { content: ''; position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 600px at 50% -10%, rgba(70,110,220,.16), transparent 70%),
    radial-gradient(700px 500px at 100% 100%, rgba(120,80,220,.10), transparent 70%),
    linear-gradient(180deg, #0b0f17, #090b11 60%, #0a0c12); }

/* 极光光斑层（#lgAurora 由 app.js 注入，纯 CSS 驱动位移） */
#lgAurora { position: fixed; inset: -20%; z-index: -1; pointer-events: none; filter: blur(64px) saturate(1.25); opacity: .85; }
#lgAurora i { position: absolute; display: block; border-radius: 50%; will-change: transform; }
#lgAurora .b1 { width: 46vw; height: 46vw; left: 4%; top: 2%;
  background: radial-gradient(circle at 35% 35%, rgba(64,124,255,.55), rgba(64,124,255,0) 68%);
  animation: lgDrift1 26s var(--lg-ease) infinite alternate; }
#lgAurora .b2 { width: 40vw; height: 40vw; right: 2%; top: 8%;
  background: radial-gradient(circle at 60% 40%, rgba(150,96,255,.42), rgba(150,96,255,0) 68%);
  animation: lgDrift2 32s var(--lg-ease) infinite alternate; }
#lgAurora .b3 { width: 44vw; height: 44vw; left: 30%; bottom: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0,180,255,.34), rgba(0,180,255,0) 70%);
  animation: lgDrift3 38s var(--lg-ease) infinite alternate; }
@keyframes lgDrift1 { to { transform: translate3d(8vw, 6vh, 0) scale(1.12); } }
@keyframes lgDrift2 { to { transform: translate3d(-9vw, 10vh, 0) scale(1.08); } }
@keyframes lgDrift3 { to { transform: translate3d(6vw, -8vh, 0) scale(1.15); } }

/* 指针折射光（#lgSpecular 由 app.js 注入，坐标 --sx/--sy） */
#lgSpecular { position: fixed; inset: 0; z-index: 0; pointer-events: none; mix-blend-mode: screen;
  background:
    radial-gradient(460px 340px at var(--sx, 50%) var(--sy, 30%), rgba(130,180,255,.20), rgba(130,150,255,.08) 46%, transparent 72%),
    radial-gradient(180px 140px at var(--sx, 50%) var(--sy, 30%), rgba(255,255,255,.10), transparent 70%); }

#app { position: relative; z-index: 1; background: transparent; }

/* 玻璃表面统一配方：竖向高光 + 斜向环境色折射 + 背景模糊提亮 */
.sidebar, .topbar, .card, .modal-card, .toast-item, .hz-cell, .topic-card, .img-item,
.slot-cell, .kv, .block-editor, .file-btn {
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.11) 0%, rgba(255,255,255,.03) 42%, rgba(255,255,255,0) 100%),
    linear-gradient(135deg, rgba(120,170,255,.08) 0%, rgba(150,120,255,.04) 46%, rgba(255,255,255,0) 78%);
  background-color: var(--card);
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(1.75) brightness(1.08);
          backdrop-filter: blur(var(--lg-blur)) saturate(1.75) brightness(1.08);
  border: 1px solid var(--lg-stroke);
  box-shadow: var(--lg-inner), var(--lg-shadow);
}

/* ---------- 侧边栏 ---------- */
.sidebar { background-color: rgba(255,255,255,.045); border-right: 1px solid rgba(255,255,255,.10);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.06), 0 0 60px rgba(0,0,0,.28); }
.brand { display: flex; align-items: center; gap: 11px; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-logo { width: 34px; height: 34px; border-radius: 12px; color: #dbeaff;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(255,255,255,.26), rgba(255,255,255,.04) 55%, rgba(110,170,255,.18));
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -8px 14px rgba(0,80,200,.18),
              0 6px 18px rgba(0,40,120,.32); }

/* 菜单项：透明底；激活底由玻璃胶囊承担 */
nav { position: relative; }
.nav-item { border-radius: 18px; margin: 3px 10px; padding: 9px 14px; background: transparent;
  transition: background .25s ease, transform .25s var(--lg-ease); }
.nav-item:hover { background: rgba(255,255,255,.07); transform: translateX(2px); }
.nav-item.active { background: transparent; color: #fff; }
.nav-sep { margin: 8px 14px; background: rgba(255,255,255,.10); }

/* 滑动玻璃胶囊：厚玻璃 + 上缘高光 + 内侧边缘折射 */
#navCapsule { position: absolute; left: 10px; right: 10px; border-radius: 18px; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.09) 46%, rgba(90,150,255,.20));
  background-color: rgba(86,150,255,.16);
  -webkit-backdrop-filter: blur(20px) saturate(1.9) brightness(1.1);
          backdrop-filter: blur(20px) saturate(1.9) brightness(1.1);
  border: 1px solid rgba(255,255,255,.26);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -1px 0 rgba(255,255,255,.10),
              inset 0 0 22px rgba(120,180,255,.18), 0 8px 22px rgba(0,50,140,.35);
  transition: top .46s var(--lg-ease), height .46s var(--lg-ease), left .46s var(--lg-ease), width .46s var(--lg-ease); }
#navCapsule .edge { position: absolute; left: 16%; right: 16%; height: 1.5px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent);
  animation: edgeFade .6s ease forwards; }
#navCapsule[data-dir="down"] .edge { top: 0; box-shadow: 0 0 10px rgba(255,255,255,.55); }
#navCapsule[data-dir="up"] .edge { bottom: 0; box-shadow: 0 0 10px rgba(255,255,255,.55); }
@keyframes edgeFade { 0% { opacity: 1; } 60% { opacity: .85; } 100% { opacity: 0; } }

/* ---------- 顶栏 ---------- */
.topbar { background-color: rgba(255,255,255,.045); border-bottom: 1px solid rgba(255,255,255,.10);
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.05), 0 10px 30px rgba(0,0,0,.25); }
.dot { box-shadow: 0 0 0 3px rgba(255,255,255,.06), 0 0 10px rgba(255,255,255,.15); }
.dot.on { background: #39d98a; box-shadow: 0 0 0 3px rgba(57,217,138,.16), 0 0 12px rgba(57,217,138,.75); }
.dot.busy { background: #ffb443; box-shadow: 0 0 0 3px rgba(255,180,67,.16), 0 0 12px rgba(255,180,67,.7); }

/* ---------- 卡片：玻璃 + 指针内层柔光 + 边缘折射亮环 ---------- */
.card { border-radius: var(--lg-r); position: relative; transition: transform .3s var(--lg-ease), box-shadow .3s var(--lg-ease); }
.card:hover { transform: translateY(-2px);
  box-shadow: var(--lg-inner), 0 30px 70px rgba(3,6,16,.52), 0 6px 18px rgba(3,6,16,.3); }
/* 内层：光在玻璃内部扩散 */
.card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.16), rgba(255,255,255,.05) 42%, transparent 66%);
  opacity: 0; transition: opacity .45s ease; }
/* 外层：只有 1px 描边环被照亮（液态玻璃的折射边） */
.card::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; padding: 1px;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.85), rgba(255,255,255,.22) 45%, transparent 74%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
          mask-composite: exclude;
  opacity: 0; transition: opacity .45s ease; }
.card:hover::before, .card:hover::after { opacity: 1; }

/* ---------- 按钮：胶囊状玻璃按键 ---------- */
.btn { border-radius: 999px; background-color: rgba(255,255,255,.08);
  background-image: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.02));
  -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.30), inset 0 -1px 0 rgba(255,255,255,.07),
              0 6px 16px rgba(0,0,0,.26);
  transition: transform .18s var(--lg-ease), box-shadow .25s ease, border-color .25s ease, background-color .25s ease; }
.btn:hover { border-color: rgba(255,255,255,.34); transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.40), inset 0 -1px 0 rgba(255,255,255,.09),
              0 10px 24px rgba(0,0,0,.32); }
.btn:active { transform: translateY(0) scale(.985); }
.btn.primary { background-image: linear-gradient(180deg, rgba(120,180,255,.95), rgba(40,110,220,.9));
  background-color: rgba(70,140,240,.9); border-color: rgba(255,255,255,.30); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), inset 0 -2px 8px rgba(0,40,120,.4),
              0 8px 24px rgba(30,110,240,.42); }
.btn.primary:hover { background-image: linear-gradient(180deg, rgba(140,195,255,.98), rgba(52,124,232,.94));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 12px 30px rgba(30,110,240,.5); }
.btn.danger { color: #ff8f8f; }
.btn:disabled { opacity: .4; transform: none; box-shadow: none; }

/* ---------- 输入控件：内凹玻璃槽 ---------- */
input, select, textarea { border-radius: 14px; background-color: rgba(6,10,18,.42);
  background-image: linear-gradient(180deg, rgba(0,0,0,.28), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.13);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.38), inset 0 -1px 0 rgba(255,255,255,.08);
  transition: border-color .2s ease, box-shadow .2s ease; }
input:focus, select:focus, textarea:focus { border-color: rgba(120,180,255,.65);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.35), 0 0 0 3px rgba(70,140,240,.22); }
.seg { border-radius: 999px; border-color: rgba(255,255,255,.16); background-color: rgba(0,0,0,.22);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35); }
.seg .btn { border-radius: 999px; background-color: transparent; background-image: none; box-shadow: none; border: none; }
.seg .btn.active { background-image: linear-gradient(180deg, rgba(120,180,255,.9), rgba(40,110,220,.86)); color: #fff; }

/* ---------- 其它玻璃构件 ---------- */
.hz-cell { border-radius: 14px; transition: transform .2s var(--lg-ease), border-color .2s ease; }
.hz-cell:hover { transform: translateY(-2px); border-color: rgba(140,190,255,.5); }
.hz-cell.mastered { background-color: rgba(40,150,90,.22); border-color: rgba(90,230,150,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 0 22px rgba(60,220,130,.18); }
.topic-card, .img-item, .slot-cell, .block-editor { border-radius: 16px; }
.img-item { box-shadow: var(--lg-inner), 0 12px 30px rgba(3,6,16,.4); }
.kv { border-radius: 12px; backdrop-filter: blur(10px); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.slot-cell.has { border-color: rgba(90,230,150,.42); }
.slot-cell.cur { background-color: rgba(40,150,90,.22); }
.preview-box { border-radius: 16px; background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 12px 34px rgba(3,6,16,.45); }
.epd-frame { border-radius: 16px; background: rgba(0,0,0,.42); border: 1px solid rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 0 40px rgba(0,0,0,.35); }
.file-btn { border-radius: 999px; }

/* ---------- 弹窗：全屏重度玻璃 ---------- */
.modal { background: rgba(6,9,16,.62); -webkit-backdrop-filter: blur(3px) saturate(1.15); backdrop-filter: blur(3px) saturate(1.15); }
.modal-card { border-radius: 26px; background-color: rgba(56,68,92,.42); border-color: rgba(255,255,255,.22);
  -webkit-backdrop-filter: blur(34px) saturate(2) brightness(1.2); backdrop-filter: blur(34px) saturate(2) brightness(1.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.42), inset 0 -1px 0 rgba(255,255,255,.08),
              inset 0 0 44px rgba(255,255,255,.06), 0 40px 90px rgba(0,0,0,.55); }
.err { border-radius: 12px; background: rgba(200,50,60,.22); color: #ffd6d8; border: 1px solid rgba(255,120,130,.32); }
.toast-item { border-radius: 16px; background-color: rgba(30,36,50,.6); border-left: 3px solid var(--accent);
  box-shadow: var(--lg-inner), 0 18px 40px rgba(3,6,16,.5); }
.tag { border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background-color: rgba(255,255,255,.07); }
.tag.ok { background: rgba(50,200,120,.22); color: #a8ffcd; border-color: rgba(90,230,150,.4); }
.tag.wait { background: rgba(255,180,60,.18); color: #ffdc9a; border-color: rgba(255,190,90,.35); }

/* ---------- 滚动条 / 选区 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.24); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: rgba(90,150,255,.35); color: #fff; }

/* ---------- 降级：不支持 backdrop-filter 时用实心玻璃色 ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar, .topbar, .card, .modal-card, .toast-item, .hz-cell, .topic-card, .img-item,
  .slot-cell, .kv, .block-editor, .file-btn { background-color: rgba(26,32,44,.86); }
}

/* ---------- 无障碍：尊重减少动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  #lgAurora i { animation: none; }
  #lgSpecular { display: none; }
  .card, .btn, .nav-item { transition: none; }
}

/* ==================== 图片推送页：墨水屏比例预览框 + 工具条 ==================== */
.file-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16); border-radius: 6px;
  padding: 8px 14px; cursor: pointer; font-size: 13px; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pv-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.pv-col { flex: 1 1 320px; min-width: 0; }
/* 墨水屏比例取景框：无白底，宽度即屏宽比例，方便看裁剪 */
.epd-frame { position: relative; width: 100%; max-width: 460px; background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.16); border-radius: 8px; overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10); }
.epd-frame canvas, .epd-frame img { display: block; width: 100%; height: auto;
  image-rendering: pixelated; touch-action: none; }
.grow { flex: 1; min-width: 160px; }
.grow input[type=range] { display: inline; width: 110px; margin: 0 6px; vertical-align: middle; }

/* ==================== 手机端适配（≤720px：侧栏变底部导航） ==================== */
@media (max-width: 720px) {
  #app { flex-direction: column; }
  .sidebar { position: fixed; bottom: 0; left: 0; right: 0; width: 100%; min-width: 0; z-index: 100;
    border-right: none; border-top: 1px solid rgba(255,255,255,.12); padding-bottom: env(safe-area-inset-bottom); }
  .brand, .sidebar-footer { display: none; }
  nav { display: flex; overflow-x: auto; padding: 6px 8px; }
  .nav-item { flex: none; margin: 0 3px; padding: 8px 12px; }
  .nav-item .ico { font-size: 15px; }
  .nav-item span:not(.ico) { display: inline; }   /* 覆盖旧 ≤800px 隐藏文字规则 */
  .nav-item span:last-child { font-size: 12px; }
  .nav-sep { display: none; }
  .content { padding: 12px 12px 86px; }
  .topbar { padding: 10px 12px; }
  .page-head { gap: 10px; }
  .pv-col { flex: 1 1 100%; }
  .epd-frame { max-width: 100%; }
}

/* ---------- 侧边栏图标统一（线性 SVG，同一粗细/尺寸） ---------- */
.nav-item { position: relative; z-index: 1; }
#navCapsule { z-index: 0; }
.nav-item .ico { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.nav-item .ico svg { width: 20px; height: 20px; display: block; color: currentColor; opacity: .9; }
.nav-item.active .ico svg { opacity: 1; }

/* ---------- Border Beam：悬停时高光沿边框跑一圈 ---------- */
@property --beam-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.nav-item::after, .btn::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.6px;
  background: conic-gradient(from var(--beam-a),
    rgba(255,255,255,0) 0deg, rgba(255,255,255,0) 248deg,
    rgba(150,205,255,.55) 308deg, rgba(255,255,255,.95) 344deg, rgba(255,255,255,0) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .22s ease; pointer-events: none; z-index: 3;
  animation: beamSpin 2.6s linear infinite; animation-play-state: paused;
}
.nav-item:hover::after, .btn:hover::after { opacity: 1; animation-play-state: running; }
.seg .btn::after, .btn:disabled::after { display: none; }
@keyframes beamSpin { to { --beam-a: 1turn; } }
@media (prefers-reduced-motion: reduce) {
  .nav-item::after, .btn::after { animation: none; }
}

/* ---------- 外观切换：自动 / 白天 / 夜间 ---------- */
.theme-switch { display: flex; gap: 4px; margin-bottom: 10px; padding: 4px; border-radius: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); }
.theme-switch button { flex: 1; border: 0; background: transparent; color: var(--muted);
  font: 600 13px/1.2 -apple-system, "PingFang SC", sans-serif; padding: 5px 0; border-radius: 9px; cursor: pointer;
  transition: background .2s ease, color .2s ease; }
.theme-switch button:hover { color: var(--fg); }
.theme-switch button.active { background: rgba(79,157,255,.30); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(140,190,255,.45); }

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef2f9;
  --bg2: rgba(255,255,255,.62);
  --bg3: rgba(20,50,110,.06);
  --fg: #16233a;
  --muted: #5b6779;
  --line: rgba(20,40,80,.14);
  --accent: #2b7cf0;
  --accent2: #1e66cc;
  --card: rgba(255,255,255,.72);
  --lg-stroke: rgba(255,255,255,.92);
  --lg-inner: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -1px 0 rgba(20,40,80,.04);
  --lg-shadow: 0 18px 44px rgba(24,48,96,.10), 0 2px 8px rgba(24,48,96,.06);
  --lg-blur: 22px;
}
html[data-theme="light"] body::before { background:
  radial-gradient(900px 620px at 50% -12%, rgba(120,170,255,.30), transparent 70%),
  radial-gradient(760px 520px at 98% 100%, rgba(150,130,255,.22), transparent 72%),
  linear-gradient(180deg, #f6f8fc, #eef2f9 62%, #eaeef6); }
html[data-theme="light"] #lgAurora { opacity: .45; }
html[data-theme="light"] #lgSpecular { opacity: .45; mix-blend-mode: normal; }
html[data-theme="light"] .sidebar { background-color: rgba(255,255,255,.60);
  border-right: 1px solid rgba(20,40,80,.08);
  box-shadow: inset -1px 0 0 rgba(255,255,255,.85), 12px 0 40px rgba(30,60,120,.07); }
html[data-theme="light"] .topbar { background-color: rgba(255,255,255,.55);
  border-bottom: 1px solid rgba(20,40,80,.08); box-shadow: 0 8px 24px rgba(30,60,120,.06); }
html[data-theme="light"] .sidebar .brand { border-bottom-color: rgba(20,40,80,.08); }
html[data-theme="light"] nav .nav-sep { background: rgba(20,40,80,.10); }
html[data-theme="light"] .nav-item { color: #26303f; }
html[data-theme="light"] .nav-item:hover { background: rgba(30,80,170,.07); }
html[data-theme="light"] .nav-item.active { color: #0b2a58; }
html[data-theme="light"] #navCapsule { background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(238,245,255,.76));
  background-color: rgba(255,255,255,.72); border-color: rgba(255,255,255,.95);
  box-shadow: inset 0 1px 0 #fff, 0 10px 24px rgba(30,80,170,.14); }
html[data-theme="light"] .card, html[data-theme="light"] .modal-card, html[data-theme="light"] .block-editor,
html[data-theme="light"] .kv, html[data-theme="light"] .slot-cell, html[data-theme="light"] .hz-cell,
html[data-theme="light"] .topic-card, html[data-theme="light"] .img-item, html[data-theme="light"] .file-btn {
  background-color: rgba(255,255,255,.72); border-color: rgba(255,255,255,.9);
  box-shadow: inset 0 1px 0 #fff, 0 12px 30px rgba(24,48,96,.09); }
html[data-theme="light"] .card::after { opacity: .5; }
html[data-theme="light"] .btn { background-color: rgba(255,255,255,.86); color: #16233a;
  border-color: rgba(20,40,80,.14);
  box-shadow: inset 0 1px 0 #fff, 0 6px 16px rgba(30,60,120,.08); }
html[data-theme="light"] .btn.sm { box-shadow: inset 0 1px 0 #fff, 0 4px 10px rgba(30,60,120,.07); }
html[data-theme="light"] .btn:hover { border-color: rgba(43,124,240,.55); }
html[data-theme="light"] .btn.primary { color: #fff; }
html[data-theme="light"] input, html[data-theme="light"] select, html[data-theme="light"] textarea {
  background-color: #fff; background-image: none; color: #16233a; border-color: rgba(20,40,80,.16);
  box-shadow: inset 0 1px 2px rgba(20,40,80,.05); }
html[data-theme="light"] input:focus, html[data-theme="light"] select:focus,
html[data-theme="light"] textarea:focus { box-shadow: 0 0 0 3px rgba(43,124,240,.16); }
html[data-theme="light"] .seg { background-color: rgba(255,255,255,.72); border-color: rgba(20,40,80,.10);
  box-shadow: inset 0 1px 2px rgba(20,40,80,.06); }
html[data-theme="light"] input::placeholder, html[data-theme="light"] textarea::placeholder { color: #9aa5b6; }
html[data-theme="light"] .toast-item { background-color: rgba(255,255,255,.94); color: #16233a;
  border-color: rgba(20,40,80,.10); border-left-color: var(--accent);
  box-shadow: 0 12px 30px rgba(20,40,90,.16); }
html[data-theme="light"] .hint, html[data-theme="light"] .muted { color: #5b6779; }
html[data-theme="light"] .theme-switch { background: rgba(20,40,80,.06); border-color: rgba(20,40,80,.10); }
html[data-theme="light"] .theme-switch button { color: #0f172a; }
html[data-theme="light"] .theme-switch button.active { background: #2b7cf0; color: #fff;
  box-shadow: 0 2px 8px rgba(30,90,190,.28); }
html[data-theme="light"] .sidebar-footer { color: #5b6779; border-top-color: rgba(20,40,80,.10); }

@media (max-width: 720px) {
  #toastBox { left: 12px; right: 12px; align-items: center; max-width: none; }
}

/* 提示条最终覆盖：保证深色下文字清晰、浅色下白底黑字 */
.toast-item { background: #121a29 !important; color: #f6f9ff !important; border-color: rgba(150,190,255,.35) !important; }
html[data-theme="light"] .toast-item { background: #ffffff !important; color: #16233a !important; border-color: rgba(20,40,80,.12) !important; }
html[data-theme="light"] #themeSwitch button { color: #0b1220 !important; }
html[data-theme="light"] #themeSwitch button.active { background: #2b7cf0 !important; color: #fff !important; }

/* ---------- 管理后台 ---------- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.admin-flag { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 14px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.10); cursor: pointer; }
.admin-flag input { width: auto; margin: 2px 0 0; box-shadow: none; }
.admin-flag b { display: block; font-size: 13px; color: var(--fg); }
.admin-flag em { display: block; font-style: normal; font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.admin-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-row:last-child { border-bottom: 0; }
.admin-name { font-weight: 600; min-width: 120px; }
html[data-theme="light"] .admin-flag { background: rgba(255,255,255,.72); border-color: rgba(20,40,80,.10); }
