/* ============================================================
   蔷薇之心 · 视觉
   深色镜面 + 淡蓝冷光 + 毛玻璃
   ============================================================ */

:root {
  --bg-0: #05070c;
  --bg-1: #0a1019;
  --bg-2: #101a2b;

  --ink: #e9f1fb;
  --ink-dim: #93a6c0;
  --ink-faint: #5d6d84;

  --blue: #7cc4ff;
  --blue-soft: #a9d6ff;
  --blue-deep: #3d7fbf;
  --violet: #9aa8ff;

  /* 毛玻璃：色相 + 浓度分离，浓度由「外观 · 玻璃」滑块实时改 */
  --glass-tone: 9, 17, 29;
  --glass-a: 0.34;
  --glass-bg: rgba(var(--glass-tone), var(--glass-a));
  --glass-line: rgba(158, 200, 255, 0.13);
  --glass-line-hi: rgba(206, 231, 255, 0.22);
  --glass-sheen: rgba(214, 235, 255, 0.055);

  --line: rgba(140, 190, 255, 0.10);
  --line-strong: rgba(140, 190, 255, 0.20);

  --bg-blur: 0px;
  --bg-dim: 0.46;

  --dock-w: 272px;
  --dock-w-min: 64px;
  --chat-w: 408px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; background: var(--bg-solid, #05070c); transition: background-color 0.5s var(--ease); }

html, body {
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

body { background: transparent; }

/* ---------- 背景层：默认是夜色渐变，导入图片后换成照片 ---------- */
.bg-layer {
  position: fixed;
  inset: -4%;
  z-index: -3;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  transform: scale(1.01);
  filter: blur(var(--bg-blur)) saturate(108%);
  transition: opacity 0.9s var(--ease), filter 0.35s var(--ease);
  pointer-events: none;
}
body.has-bg .bg-layer { opacity: 1; }

.bg-dim {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #03060c;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
  pointer-events: none;
}
body.has-bg .bg-dim { opacity: var(--bg-dim); }

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* 背景光晕 + 暗角 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 700px at 50% 42%, #0a1424 0%, #060b14 42%, #04060a 78%),
    radial-gradient(600px 400px at 18% 88%, rgba(61, 127, 191, 0.10), transparent 70%),
    radial-gradient(560px 380px at 84% 12%, rgba(122, 138, 255, 0.07), transparent 72%);
  transition: opacity 0.6s var(--ease);
}
body.has-bg::before { opacity: 0.28; }
/* 纯色模式：把那层夜色渐变关掉，只留一块干净的颜色 */
body.is-solid::before { opacity: 0; }


.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

/* ============================================================
   登录层
   ============================================================ */
.login {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding-bottom: 12vh;
  transition: opacity 1.15s var(--ease), filter 1.15s var(--ease);
}

.login.is-out {
  opacity: 0;
  filter: blur(14px);
  pointer-events: none;
}

.login-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  opacity: 0;
  transform: translateY(14px);
  animation: riseIn 1.6s var(--ease) 0.6s forwards;
}

@keyframes riseIn {
  to { opacity: 1; transform: translateY(0); }
}

.login-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lw-mark {
  font-size: 13px;
  letter-spacing: 0.62em;
  color: rgba(210, 230, 255, 0.78);
  font-weight: 300;
  text-indent: 0.62em;
  text-shadow: 0 0 22px rgba(124, 196, 255, 0.45);
}

.lw-sub {
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: rgba(150, 175, 205, 0.6);
}

.login-bar {
  width: 168px;
  height: 1px;
  background: rgba(140, 190, 255, 0.14);
  overflow: hidden;
  position: relative;
}

.login-bar i {
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  animation: sweep 1.9s var(--ease) infinite;
  box-shadow: 0 0 12px var(--blue);
}

@keyframes sweep {
  0%   { transform: translateX(-110%); }
  100% { transform: translateX(360%); }
}

.login-status {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: rgba(130, 155, 185, 0.65);
  text-indent: 0.3em;
  transition: opacity 0.4s;
}

/* ============================================================
   主面板
   ============================================================ */
.panel {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: var(--dock-w) 1fr var(--chat-w);
  gap: 18px;
  padding: 18px;
  opacity: 0;
  transition: opacity 1.05s var(--ease);
}.panel.is-hidden { pointer-events: none; }

.panel.is-live { opacity: 1; }

/* ---------- 毛玻璃：左右两栏共用一套 ---------- */
.dock,
.chat {
  background:
    linear-gradient(180deg, var(--glass-sheen) 0%, rgba(214, 235, 255, 0.012) 34%, rgba(0, 0, 0, 0.10) 100%),
    var(--glass-bg);
  border: 1px solid var(--glass-line);
  backdrop-filter: blur(34px) saturate(155%) brightness(0.82);
  -webkit-backdrop-filter: blur(34px) saturate(155%) brightness(0.82);
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 var(--glass-line-hi),
    inset 0 -1px 0 rgba(0, 0, 0, 0.22);
}

/* 玻璃边缘的一点点色散，别太亮，只在转角处 */
.dock::after,
.chat::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(196, 226, 255, 0.10), transparent 46%),
    radial-gradient(90% 50% at 100% 100%, rgba(122, 138, 255, 0.08), transparent 52%);
  mix-blend-mode: screen;
  opacity: 0.7;
}

/* ---------- 左侧功能区 ---------- */
.dock {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px 14px 12px;
  border-radius: 20px;
  transition: width 0.45s var(--ease), padding 0.45s var(--ease);
  overflow: hidden;
  z-index: 1;
}

.panel.dock-collapsed { grid-template-columns: var(--dock-w-min) 1fr var(--chat-w); }
.dock.is-collapsed { padding-left: 10px; padding-right: 10px; }
.dock.is-collapsed .dock-body,
.dock.is-collapsed .dock-foot,
.dock.is-collapsed .nav-item span,
.dock.is-collapsed .brand-en { display: none; }
.dock.is-collapsed .dock-brand { opacity: 0; width: 0; }
.dock.is-collapsed .nav-item { justify-content: center; padding: 10px 0; }

.dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 14px;
  flex: 0 0 auto;
}

.dock-brand { display: flex; flex-direction: column; gap: 2px; overflow: hidden; white-space: nowrap; }
.brand-cn {
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 17px;
  letter-spacing: 0.16em;
  color: #dce9fb;
}
.brand-en {
  font-size: 9px;
  letter-spacing: 0.34em;
  color: var(--ink-faint);
}

.icon-btn {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  flex: 0 0 auto;
}
.icon-btn:hover { background: rgba(124, 196, 255, 0.10); color: var(--blue-soft); border-color: var(--line); }
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#dockToggle svg { transition: transform 0.45s var(--ease); }
.dock.is-collapsed #dockToggle svg { transform: rotate(180deg); }

.dock-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-dim);
  font-family: var(--font);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.22s var(--ease);
  position: relative;
}
.nav-item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.nav-item:hover { color: var(--ink); background: rgba(124, 196, 255, 0.06); }
.nav-item.is-active { color: #d9ecff; background: rgba(124, 196, 255, 0.11); }
.nav-item.is-active::before {
  content: "";
  position: absolute; left: 0; top: 50%;
  width: 2px; height: 14px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: var(--blue);
  box-shadow: 0 0 8px var(--blue);
}

.dock-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 2px 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 196, 255, 0.22) transparent;
}
.dock-body::-webkit-scrollbar { width: 4px; }
.dock-body::-webkit-scrollbar-thumb { background: rgba(124, 196, 255, 0.2); border-radius: 4px; }

.view { display: none; }
.view.is-active { display: block; animation: viewIn 0.35s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-title {
  font-size: 10.5px;
  letter-spacing: 0.26em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.view-title em { font-style: normal; color: var(--blue); letter-spacing: 0.05em; }

.skeleton { font-size: 12px; color: var(--ink-faint); padding: 8px 2px; }

/* 插件行 */
.plugin-list { display: flex; flex-direction: column; gap: 1px; }

.plugin-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink-dim);
  transition: background 0.2s;
  cursor: default;
}
.plugin-row:hover { background: rgba(124, 196, 255, 0.05); }
.plugin-row .pname {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plugin-row.on .pname { color: var(--ink); }

.switch {
  flex: 0 0 auto;
  width: 30px; height: 17px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  position: relative;
  cursor: pointer;
  transition: all 0.28s var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #6e7f96;
  transition: all 0.28s var(--ease);
}
.plugin-row.on .switch { background: rgba(124, 196, 255, 0.24); border-color: rgba(124, 196, 255, 0.5); }
.plugin-row.on .switch::after { left: 15px; background: var(--blue); box-shadow: 0 0 10px rgba(124, 196, 255, 0.8); }
.switch.is-busy { opacity: 0.45; pointer-events: none; }

/* 记忆 */
.mem-list { display: flex; flex-direction: column; gap: 6px; }
.mem-item {
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(124, 196, 255, 0.045);
  border: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-dim);
}
.mem-item b { display: block; color: var(--blue-soft); font-weight: 500; font-size: 11.5px; margin-bottom: 3px; }
.mem-item i { display: block; margin-top: 4px; font-style: normal; font-size: 9.5px; color: var(--ink-faint); letter-spacing: 0.05em; }

/* 记忆 · 统计 */
.mem-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 11px;
}
.mem-stats > div {
  padding: 8px 10px 7px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(124, 196, 255, 0.06), rgba(124, 196, 255, 0.015));
}
.mem-stats b {
  display: block;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.05;
  color: #e6f2ff;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}
.mem-stats span {
  display: block;
  margin-top: 3px;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

/* 记忆 · 图谱 */
.mem-graph {
  position: relative;
  height: 198px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(52, 96, 160, 0.16), rgba(4, 8, 14, 0.6) 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 22px);
}
.mem-graph canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.mem-tip {
  position: absolute;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(6, 12, 20, 0.92);
  border: 1px solid var(--line-strong);
  color: var(--blue-soft);
  font-size: 10px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.16s var(--ease);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mem-legend {
  position: absolute;
  left: 9px;
  bottom: 7px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  pointer-events: none;
}
.mem-legend i {
  width: 5px; height: 5px;
  border-radius: 50%;
  margin-left: 6px;
  display: inline-block;
}
.mem-legend i:first-child { margin-left: 0; }
.mem-legend .k-entry { background: #7cc4ff; }
.mem-legend .k-topic { background: #e8b96a; }
.mem-legend .k-session { background: #6ee7d0; }

/* 记忆 · 检索 */
.mem-search { display: flex; gap: 6px; margin: 10px 0 9px; }
.mem-search input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(6, 12, 20, 0.5);
  color: var(--ink);
  font-family: var(--font);
  font-size: 11.5px;
  outline: none;
  transition: border-color 0.2s var(--ease);
}
.mem-search input::placeholder { color: var(--ink-faint); }
.mem-search input:focus { border-color: rgba(124, 196, 255, 0.42); }
.mem-search .mini-btn {
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  padding: 0;
}
.mem-search .mini-btn svg {
  width: 14px; height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}


/* 提醒 */
.remind-form { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.remind-form input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 24, 0.55);
  color: var(--ink);
  font-family: var(--font);
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s;
  user-select: text;
}
.remind-form input:focus { border-color: rgba(124, 196, 255, 0.4); }
.remind-form input::-webkit-calendar-picker-indicator { filter: invert(0.7); cursor: pointer; }
.remind-row { display: flex; gap: 7px; }
.remind-row input { flex: 1 1 auto; }

.mini-btn {
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid rgba(124, 196, 255, 0.28);
  background: rgba(124, 196, 255, 0.12);
  color: var(--blue-soft);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  flex: 0 0 auto;
}
.mini-btn:hover { background: rgba(124, 196, 255, 0.2); }
.mini-btn:disabled { opacity: 0.4; cursor: default; }

.remind-list { display: flex; flex-direction: column; gap: 5px; }
.remind-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-dim);
}
.remind-item time { color: var(--blue-soft); font-variant-numeric: tabular-nums; flex: 0 0 auto; font-size: 11px; }
.remind-item span { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remind-item button { border: 0; background: transparent; color: var(--ink-faint); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.remind-item button:hover { color: #ff8b8b; }

/* ---- 外观 / 背景 ---------------------------------------------------- */
.bg-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(124, 196, 255, 0.05), rgba(5, 9, 16, 0.6)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.018) 0 6px, transparent 6px 12px);
  display: grid;
  place-items: center;
}
.bg-frame img,
.bg-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  opacity: 0.92;
}
.bg-frame.has-img img { display: block; }
.bg-frame.has-vid video { display: block; }
.bg-frame.has-img .bg-empty,
.bg-frame.has-vid .bg-empty { display: none; }
.bg-empty {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

/* 纯色色板 */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  margin-top: 2px;
}
.swatch {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  padding: 0;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}
.swatch:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, 0.28); }
.swatch.is-on {
  border-color: var(--accent, #7cc4ff);
  box-shadow: 0 0 0 1px var(--accent, #7cc4ff), 0 0 14px rgba(124, 196, 255, 0.35);
}
.swatch.is-on::after {
  content: "";
  position: absolute;
  inset: auto auto 4px 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #cfe9ff;
  box-shadow: 0 0 6px #7cc4ff;
}

.swatch-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font-size: 11px;
  color: var(--ink-dim);
  cursor: pointer;
}
.swatch-custom input[type="color"] {
  width: 26px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.swatch-custom input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
.swatch-custom input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 4px; }
.swatch-custom em {
  margin-left: auto;
  font-style: normal;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

/* ---- 背景层里的视频 ------------------------------------------------- */
.bg-layer video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
body.is-video .bg-layer video { display: block; }

.bg-act { display: flex; gap: 7px; margin-top: 10px; }
.bg-act .mini-btn { flex: 1 1 0; text-align: center; white-space: nowrap; font-size: 11px; padding-left: 6px; padding-right: 6px; }
.bg-act .mini-btn.is-ghost { flex: 0 0 66px; }
.mini-btn.is-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-dim);
}
.mini-btn.is-ghost:hover { color: var(--ink); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.04); }

.hint {
  margin-top: 10px;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--ink-faint);
}

.view-title.is-gap { margin-top: 20px; }

.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
  font-size: 11.5px;
  color: var(--ink-dim);
}
.slider-row > span { flex: 0 0 30px; letter-spacing: 0.08em; }
.slider-row > em {
  flex: 0 0 22px;
  font-style: normal;
  text-align: right;
  font-size: 10.5px;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}
.slider-row input[type="range"] {
  flex: 1 1 auto;
  -webkit-appearance: none;
  appearance: none;
  height: 2px;
  border-radius: 2px;
  background: rgba(140, 190, 255, 0.18);
  outline: none;
  cursor: pointer;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--blue-soft);
  box-shadow: 0 0 10px rgba(124, 196, 255, 0.65);
  cursor: pointer;
}
.slider-row input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid rgba(124, 196, 255, 0.7);
  outline-offset: 3px;
}

/* ---- 拖图导入提示 ---------------------------------------------------- */
.drop-hint {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(4, 8, 14, 0.62);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease);
}
body.is-dropping .drop-hint { opacity: 1; }
.drop-hint span {
  padding: 16px 26px;
  border-radius: 14px;
  border: 1px dashed rgba(158, 200, 255, 0.4);
  background: rgba(12, 20, 32, 0.7);
  color: var(--blue-soft);
  font-size: 13px;
  letter-spacing: 0.12em;
}

/* 服务 */
.svc-list { display: flex; flex-direction: column; gap: 2px; }.svc-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 6px;
  font-size: 12px;
  color: var(--ink-dim);
  border-radius: 8px;
}
.svc-row .dot { width: 6px; height: 6px; border-radius: 50%; background: #43536b; flex: 0 0 auto; transition: all 0.3s; }
.svc-row.up .dot { background: #5ee3a1; box-shadow: 0 0 8px rgba(94, 227, 161, 0.7); }
.svc-row.up { color: var(--ink); }
.svc-row .port { margin-left: auto; font-size: 10.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.svc-note { margin-top: 12px; font-size: 10.5px; color: var(--ink-faint); }
.svc-note code { color: var(--blue); font-family: ui-monospace, monospace; }

.dock-foot {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 7px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.dot { width: 5px; height: 5px; border-radius: 50%; background: #43536b; }
.dot.up { background: #5ee3a1; box-shadow: 0 0 8px rgba(94, 227, 161, 0.8); }
.dot.warn { background: #ffb84d; box-shadow: 0 0 8px rgba(255, 184, 77, 0.7); }

/* ---------- 中间舞台 ---------- */
.stage-mid {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 26px;
  /* 这一栏就是拖魔方的抓手：canvas 在 panel 底下，靠它接住指针 */
  pointer-events: auto;
  cursor: grab;
  min-width: 0;
}

/* 拖拽期间统一抓手，松手还原 */
body.is-dragging,
body.is-dragging * { cursor: grabbing !important; user-select: none; }
.mid-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  opacity: 0.9;
}
.mid-name {
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 14px;
  letter-spacing: 0.44em;
  text-indent: 0.44em;
  color: rgba(200, 222, 248, 0.72);
}
.mid-sub {
  font-size: 10px;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  color: rgba(110, 140, 175, 0.62);
}

/* ---------- 右侧聊天 ---------- */
.chat {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 20px;
  overflow: hidden;
  z-index: 1;
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
.chat.is-collapsed {
  opacity: 0;
  transform: translateX(28px);
  pointer-events: none;
  position: absolute;
  right: 18px; top: 18px; bottom: 18px;
  width: var(--chat-w);
}

.chat-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 16px 13px;
  border-bottom: 1px solid var(--line);
}
.chat-title { display: flex; align-items: baseline; gap: 9px; }
.chat-name {
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.12em;
  color: #e4eefc;
}
.chat-state { font-size: 10.5px; color: var(--ink-faint); letter-spacing: 0.06em; }
.chat-actions { display: flex; gap: 2px; }
#chatToggle svg { transition: transform 0.45s var(--ease); }

.chat-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 196, 255, 0.2) transparent;
}
.chat-scroll::-webkit-scrollbar { width: 4px; }
.chat-scroll::-webkit-scrollbar-thumb { background: rgba(124, 196, 255, 0.18); border-radius: 4px; }

.chat-empty {
  margin: auto;
  text-align: center;
  color: var(--ink-faint);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.msg {
  max-width: 86%;
  padding: 10px 14px;
  border-radius: 15px;
  font-size: 13px;
  line-height: 1.72;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  position: relative;
  animation: msgIn 0.42s var(--ease);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.msg.them {
  align-self: flex-start;
  background: linear-gradient(160deg, rgba(124, 196, 255, 0.13), rgba(124, 196, 255, 0.06));
  border: 1px solid rgba(124, 196, 255, 0.16);
  border-bottom-left-radius: 5px;
  color: #e2edfb;
}

/* 语音模式下的位置占位：先占住 DOM 顺序，视觉上完全不存在 */
.msg.preload { display: none; }

.msg.me {
  align-self: flex-end;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.045));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom-right-radius: 5px;
  color: #dfe8f4;
}

.msg .ts {
  display: block;
  margin-top: 6px;
  font-size: 9.5px;
  color: rgba(140, 165, 195, 0.42);
  letter-spacing: 0.04em;
}
.msg.me .ts { text-align: right; }

/* 还没真正发出去（断线排队中）：压暗一点，连上后自动补发并恢复 */
.msg.me.queued {
  opacity: 0.5;
  transition: opacity 0.3s var(--ease);
}
.msg.me.queued .ts::after {
  content: " · 待发送";
  color: rgba(255, 200, 120, 0.65);
}

.msg.typing::after {
  content: "";
  display: inline-block;
  width: 5px; height: 13px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--blue);
  animation: caret 1s steps(2) infinite;
}
@keyframes caret { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.msg.error {
  color: #ffbcbc;
  border-color: rgba(255, 140, 140, 0.25);
  background: rgba(255, 100, 100, 0.07);
}

.chat-input {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}
.chat-input textarea {
  flex: 1 1 auto;
  resize: none;
  max-height: 132px;
  padding: 10px 13px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 24, 0.5);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  outline: none;
  transition: border-color 0.22s, background 0.22s;
  user-select: text;
}
.chat-input textarea::placeholder { color: var(--ink-faint); }
.chat-input textarea:focus { border-color: rgba(124, 196, 255, 0.34); background: rgba(10, 17, 29, 0.66); }

/* Electron 默认给 textarea 画一条亮白滚动条，在深色面板里很扎眼。
   注意别同时写 scrollbar-width，它会盖掉下面这些 webkit 伪元素。 */
.chat-input textarea::-webkit-scrollbar { width: 6px; height: 6px; }
.chat-input textarea::-webkit-scrollbar-track { background: transparent; }
.chat-input textarea::-webkit-scrollbar-thumb {
  background: rgba(124, 196, 255, 0.22);
  border-radius: 3px;
}
.chat-input textarea::-webkit-scrollbar-thumb:hover { background: rgba(124, 196, 255, 0.4); }
.chat-input textarea::-webkit-scrollbar-button { display: none; height: 0; }
.chat-input textarea::-webkit-scrollbar-corner { background: transparent; }

.send-btn {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(124, 196, 255, 0.26);
  background: linear-gradient(150deg, rgba(124, 196, 255, 0.22), rgba(124, 196, 255, 0.08));
  color: var(--blue-soft);
  cursor: pointer;
  transition: all 0.22s var(--ease);
}
.send-btn:hover { background: linear-gradient(150deg, rgba(124, 196, 255, 0.34), rgba(124, 196, 255, 0.14)); box-shadow: 0 0 22px rgba(124, 196, 255, 0.28); }
.send-btn:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.send-btn svg { width: 16px; height: 16px; fill: currentColor; }

.chat-open {
  position: absolute;
  right: 18px; top: 18px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 13px;
  border: 1px solid var(--glass-line);
  background: var(--glass-bg);
  backdrop-filter: blur(26px) saturate(150%) brightness(0.85);
  -webkit-backdrop-filter: blur(26px) saturate(150%) brightness(0.85);
  color: var(--ink-dim);
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.chat-open svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; transform: rotate(180deg); }
.chat-open:hover { color: var(--blue-soft); border-color: var(--line-strong); }
.chat-open.is-hidden { opacity: 0; pointer-events: none; transform: scale(0.9); }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .panel { grid-template-columns: var(--dock-w-min) 1fr 360px; gap: 12px; padding: 12px; }
  .dock { padding-left: 10px; padding-right: 10px; }
  .dock .brand-en, .nav-item span { display: none; }
  .dock .nav-item { justify-content: center; }
  .dock-body { display: none; }
  .dock-foot { display: none; }
}


/* ============================================================
   Electron 壳：顶部让位给原生窗口按钮 + 可拖动条
   ============================================================ */
.win-drag { display: none; }

body.is-electron .win-drag {
  display: block;
  position: fixed;
  top: 0; left: 0; right: 140px;
  height: 40px;
  z-index: 70;
  -webkit-app-region: drag;
}

body.is-electron .panel { padding-top: 54px; }
body.is-electron .chat.is-collapsed { top: 54px; }
body.is-electron .chat-open { top: 54px; }
body.is-electron .login { padding-bottom: 14vh; }

@media (max-width: 1180px) {
  body.is-electron .panel { padding-top: 52px; }
}


/* ============================================================
   键盘可达性 / 降低动效
   ============================================================ */
button:focus-visible,
.nav-item:focus-visible,
.plugin-row:focus-visible {
  outline: 2px solid rgba(124, 196, 255, 0.65);
  outline-offset: 2px;
  border-radius: 10px;
}

input[type="text"]:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(124, 196, 255, 0.45);
  outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .msg, .view.is-active, .login-core { animation-duration: 0.01ms !important; }
  .login-bar i { animation: none; opacity: 0.6; }
  .panel, .login, .chat, .dock { transition-duration: 0.12s !important; }
}


/* 舞台可拖拽旋转 */
#stage { cursor: grab; touch-action: none; }
#stage.is-dragging { cursor: grabbing; }


/* ============================================================
   设置（左下角）
   ============================================================ */
.dock-foot #footText { flex: 1 1 auto; }

.foot-gear {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  margin-right: -3px;
  display: grid; place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  transition: all 0.22s var(--ease);
}
.foot-gear svg {
  width: 13px; height: 13px;
  fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round;
  transition: transform 0.5s var(--ease);
}
.foot-gear:hover { color: var(--blue-soft); background: rgba(124, 196, 255, 0.10); border-color: var(--line); }
.foot-gear:hover svg { transform: rotate(70deg); }
.foot-gear.is-active { color: var(--blue); background: rgba(124, 196, 255, 0.13); border-color: var(--line-strong); }

/* --- 卡片 --- */
.set-card {
  margin-bottom: 12px;
  padding: 11px 11px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.026);
  border: 1px solid var(--line);
}
.set-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}
.set-name {
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
}
.set-tag {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink-faint);
  white-space: nowrap;
}
.set-tag.up { color: #7fe7b4; border-color: rgba(94, 227, 161, 0.42); background: rgba(94, 227, 161, 0.10); }
.set-tag.warn { color: #ffcf7a; border-color: rgba(255, 184, 77, 0.42); background: rgba(255, 184, 77, 0.10); }
.set-tag.off { color: #ff9c9c; border-color: rgba(255, 139, 139, 0.36); background: rgba(255, 139, 139, 0.09); }

.set-rows { display: flex; flex-direction: column; gap: 1px; margin-bottom: 9px; }
.set-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px;
  padding: 5px 2px;
  font-size: 11px;
  color: var(--ink-faint);
  border-bottom: 1px dashed rgba(140, 190, 255, 0.07);
}
.set-row:last-child { border-bottom: 0; }
.set-row em {
  font-style: normal;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}
.set-row em.hi { color: var(--blue-soft); }

.set-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.set-acts .mini-btn { padding: 6px 11px; font-size: 11.5px; }
.mini-btn.is-danger { color: #ffb3b3; border-color: rgba(255, 139, 139, 0.30); background: rgba(255, 139, 139, 0.07); }
.mini-btn.is-danger:hover { background: rgba(255, 139, 139, 0.16); border-color: rgba(255, 139, 139, 0.5); }

.set-toggle {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 4px 2px;
  font-size: 11.5px;
  color: var(--ink-dim);
}
.set-toggle.on .switch { background: rgba(124, 196, 255, 0.24); border-color: rgba(124, 196, 255, 0.5); }
.set-toggle.on .switch::after { left: 15px; background: var(--blue); box-shadow: 0 0 10px rgba(124, 196, 255, 0.8); }

.set-links { display: flex; gap: 12px; margin-top: 9px; }
.mini-link {
  border: 0; background: transparent; padding: 0;
  font-family: var(--font);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  cursor: pointer;
  border-bottom: 1px solid rgba(140, 190, 255, 0.16);
  transition: color 0.2s, border-color 0.2s;
}
.mini-link:hover { color: var(--blue-soft); border-color: rgba(124, 196, 255, 0.5); }

.set-field {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 7px;
  font-size: 11px;
  color: var(--ink-faint);
}
.set-field > span { flex: 0 0 46px; letter-spacing: 0.08em; }
.set-field input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink);
  font-family: var(--font);
  font-size: 11.5px;
  outline: none;
}
.set-field input:focus { border-color: rgba(124, 196, 255, 0.4); background: rgba(124, 196, 255, 0.05); }

.set-saved {
  font-size: 10.5px;
  color: #7fe7b4;
  letter-spacing: 0.06em;
  opacity: 0;
  transition: opacity 0.3s;
}
.set-saved.show { opacity: 1; }

.set-about {
  margin-top: 14px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-align: center;
}


/* ============================================================
   消息语音（聊天头部开关）
   ============================================================ */
#voiceToggle { position: relative; }
#voiceToggle .ic-on { display: none; }
#voiceToggle.is-on { color: var(--blue); background: rgba(124, 196, 255, 0.12); border-color: var(--line-strong); }
#voiceToggle.is-on .ic-off { display: none; }
#voiceToggle.is-on .ic-on { display: block; }
/* 语音没出来：按钮短暂变红，鼠标悬停能看到原因 */
#voiceToggle.is-fail { color: #ff8f8f; border-color: rgba(255, 143, 143, 0.45); }
#voiceToggle.is-fail::after {
  content: "";
  position: absolute;
  top: 3px; right: 3px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #ff8f8f;
}

/* 合成期间不挂任何提示：屏幕上什么都不动，音频好了才落字 */

/* 播报中的气泡：时间戳左边挂一排小竖条跟着动 */
.msg.them.speaking .ts::before {
  content: "";
  display: inline-block;
  width: 13px; height: 8px;
  margin-right: 5px;
  vertical-align: -1px;
  background:
    linear-gradient(var(--blue-soft), var(--blue-soft)) 0 50% / 2px 40% no-repeat,
    linear-gradient(var(--blue-soft), var(--blue-soft)) 5px 50% / 2px 100% no-repeat,
    linear-gradient(var(--blue-soft), var(--blue-soft)) 10px 50% / 2px 60% no-repeat;
  animation: vc-bars 0.9s ease-in-out infinite;
  opacity: 0.85;
}
@keyframes vc-bars {
  0%, 100% { transform: scaleY(0.55); }
  50%      { transform: scaleY(1.25); }
}

/* ============================================================
   QQ 侧消息（镜像显示，只读）
   ============================================================ */
.msg.from-qq::after {
  content: "QQ";
  position: absolute;
  top: -7px;
  right: 9px;
  padding: 1px 5px 0;
  font-size: 8.5px;
  letter-spacing: 0.12em;
  line-height: 1.5;
  border-radius: 999px;
  color: rgba(180, 214, 255, 0.9);
  background: rgba(38, 62, 96, 0.94);
  border: 1px solid rgba(124, 196, 255, 0.34);
  pointer-events: none;
}
.msg.them.from-qq {
  border-color: rgba(124, 196, 255, 0.24);
  background: linear-gradient(160deg, rgba(124, 196, 255, 0.10), rgba(124, 196, 255, 0.045));
}

/* ============================================================
   访客通行
   ============================================================ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 90% at 50% 20%, rgba(28, 52, 84, 0.55), transparent 60%),
    rgba(4, 7, 12, 0.86);
  backdrop-filter: blur(10px);
}
.gate.is-hidden { display: none; }

.gate-card {
  width: 322px;
  padding: 30px 26px 24px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(20, 30, 46, 0.92), rgba(12, 19, 30, 0.94));
  border: 1px solid rgba(140, 190, 255, 0.16);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

.gate-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
}
.gate-brand .brand-cn {
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 19px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: #dfeaf8;
}
.gate-brand .brand-en {
  font-size: 9.5px;
  letter-spacing: 0.54em;
  text-indent: 0.54em;
  color: rgba(130, 165, 205, 0.62);
}

.gate-tip {
  margin: 0 0 14px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: rgba(140, 165, 195, 0.72);
  text-align: center;
}

#gateForm {
  display: flex;
  gap: 8px;
}
#gateCode {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(140, 190, 255, 0.18);
  background: rgba(8, 14, 22, 0.8);
  color: #e7f0fb;
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  outline: none;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
#gateCode::placeholder { color: rgba(110, 132, 160, 0.5); letter-spacing: 0.16em; }
#gateCode:focus {
  border-color: rgba(124, 196, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 196, 255, 0.1);
}
#gateBtn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(124, 196, 255, 0.34);
  background: linear-gradient(160deg, rgba(124, 196, 255, 0.24), rgba(124, 196, 255, 0.1));
  color: #eaf4ff;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
#gateBtn:hover { border-color: rgba(124, 196, 255, 0.6); transform: translateY(-1px); }
#gateBtn:disabled { opacity: 0.5; cursor: default; transform: none; }

.gate-msg {
  min-height: 16px;
  margin: 12px 0 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-align: center;
  color: rgba(255, 150, 150, 0.85);
}

/* ============================================================
   访客管理（主人）
   ============================================================ */
.guest-new {
  display: grid;
  grid-template-columns: 1fr 108px;
  gap: 7px;
  margin-bottom: 10px;
}
.guest-new input {
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid rgba(140, 190, 255, 0.14);
  background: rgba(10, 16, 26, 0.7);
  color: #e2ecf8;
  font-size: 12px;
  outline: none;
}
.guest-new input::placeholder { color: rgba(110, 132, 160, 0.55); }
.guest-new input:focus { border-color: rgba(124, 196, 255, 0.42); }
.guest-new button {
  grid-column: 1 / -1;
  padding: 8px;
  border-radius: 9px;
  border: 1px solid rgba(124, 196, 255, 0.28);
  background: rgba(124, 196, 255, 0.12);
  color: #dcebff;
  font-size: 12px;
  letter-spacing: 0.1em;
  cursor: pointer;
}
.guest-new button:hover { background: rgba(124, 196, 255, 0.2); }

.guest-fresh {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px dashed rgba(124, 196, 255, 0.34);
  background: rgba(124, 196, 255, 0.07);
}
.guest-fresh.is-hidden { display: none; }
.gf-label { font-size: 10.5px; letter-spacing: 0.12em; color: rgba(150, 180, 215, 0.8); }
.guest-fresh code {
  flex: 1;
  font-size: 13.5px;
  letter-spacing: 0.16em;
  color: #a9d6ff;
}

.guest-list { display: flex; flex-direction: column; gap: 7px; }
.guest-row {
  padding: 10px 11px;
  border-radius: 11px;
  border: 1px solid rgba(140, 190, 255, 0.1);
  background: rgba(14, 22, 34, 0.6);
}
.guest-row.is-off { opacity: 0.55; }
.gr-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}
.gr-name { font-size: 12.5px; color: #e4eefa; }
.gr-code {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(140, 175, 215, 0.7);
  margin-left: auto;
}
.gr-meta {
  font-size: 10.5px;
  color: rgba(140, 165, 195, 0.62);
  line-height: 1.7;
}
.gr-acts {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}
.gr-acts button {
  flex: 1;
  padding: 5px 0;
  border-radius: 7px;
  border: 1px solid rgba(140, 190, 255, 0.16);
  background: transparent;
  color: rgba(180, 205, 232, 0.85);
  font-size: 10.5px;
  cursor: pointer;
}
.gr-acts button:hover { border-color: rgba(124, 196, 255, 0.45); color: #dcebff; }
.gr-acts button.is-danger:hover {
  border-color: rgba(255, 120, 120, 0.5);
  color: #ffb3b3;
}
.gr-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(120, 140, 165, 0.45);
}
.gr-dot.up {
  background: #6ee7a0;
  box-shadow: 0 0 8px rgba(110, 231, 160, 0.7);
}

/* ============================================================
   访客态：这些区域不给看
   ============================================================ */
body.is-guest .nav-item[data-view="memory"],
body.is-guest .nav-item[data-view="remind"],
body.is-guest .nav-item[data-view="service"],
body.is-guest .view[data-view="memory"],
body.is-guest .view[data-view="remind"],
body.is-guest .view[data-view="service"],
body.is-guest .nav-owner,
body.is-guest .view[data-view="guests"] {
  display: none !important;
}
/* 访客没有插件开关，只剩只读列表 */
body.is-guest .plugin-row .switch { display: none !important; }
body.is-guest .plugin-row { cursor: default; }

/* ============================================================
   窄屏 / 手机
   手机用户九成时间在聊天，所以聊天占满屏；
   插件、记忆、外观这些收进左边抽屉，点顶栏的菜单拉开。
   ============================================================ */
.m-bar,
.m-scrim { display: none; }

@media (max-width: 860px) {
  :root {
    --m-bar-h: 52px;
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
  }

  html, body { overscroll-behavior: none; }

  /* 三栏塌成单列 */
  .panel { display: block; padding: 0; gap: 0; }
  /* 3D 舞台在手机上关掉：省电，且没有中间那一栏给它 */
  .stage-mid { display: none; }

  /* ---------- 顶栏 ---------- */
  .m-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: calc(var(--m-bar-h) + var(--safe-t));
    padding: var(--safe-t) 8px 0;
    z-index: 62;
    background: linear-gradient(180deg,
      rgba(5, 7, 12, 0.95) 0%,
      rgba(5, 7, 12, 0.74) 60%,
      rgba(5, 7, 12, 0) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  .m-btn {
    width: 40px; height: 40px; flex: none;
    display: grid; place-items: center;
    border: 0; border-radius: 12px; background: transparent;
    color: var(--ink-dim); cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.18s, color 0.18s;
  }
  .m-btn:active { background: rgba(124, 196, 255, 0.14); color: var(--blue-soft); }
  .m-btn svg {
    width: 21px; height: 21px; fill: none; stroke: currentColor;
    stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  }
  .m-title {
    flex: 1 1 auto; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 1px;
  }
  .m-title span {
    font-family: "Songti SC", "SimSun", Georgia, serif;
    font-size: 15px; letter-spacing: 0.34em; text-indent: 0.34em;
    color: rgba(214, 233, 255, 0.94);
  }
  .m-title em {
    font-style: normal; font-size: 10px;
    letter-spacing: 0.2em; text-indent: 0.2em;
    color: rgba(110, 140, 175, 0.8);
  }

  /* ---------- 聊天：占满剩余 ---------- */
  .chat {
    position: fixed;
    top: calc(var(--m-bar-h) + var(--safe-t));
    left: 0; right: 0; bottom: 0;
    width: auto;
    border: 0; border-radius: 0;
    z-index: 30;
  }
  .chat.is-collapsed { display: none; }
  .chat-open,
  #chatToggle { display: none !important; }
  /* 手机上聊天区就是全部，玻璃糊太重反而脏 */
  .chat {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: linear-gradient(180deg, rgba(9, 14, 22, 0.62), rgba(5, 7, 12, 0.80));
  }
  .chat::after { display: none; }

  .chat-head { padding: 10px 12px 8px; }
  .chat-scroll { padding-left: 12px; padding-right: 12px; }
  .chat-input {
    padding: 8px 10px calc(8px + var(--safe-b));
  }
  .chat-input textarea { font-size: 16px; }  /* 16px 以下 iOS 会自动放大页面 */
  #msgInput { max-height: 34vh; }

  /* ---------- 功能区：抽屉 ---------- */
  .dock {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(86vw, 380px);
    padding: calc(14px + var(--safe-t)) 14px calc(10px + var(--safe-b));
    border-radius: 0 22px 22px 0;
    border-left: 0;
    z-index: 80;
    transform: translateX(-104%);
    transition: transform 0.34s var(--ease);
    will-change: transform;
  }
  .dock::after { border-radius: 0 22px 22px 0; }
  .dock.is-open { transform: translateX(0); }

  /* 1180 断点为了省地方把内容藏了，抽屉里全放回来 */
  .dock .dock-body { display: block; }
  .dock .dock-foot { display: flex; }
  .dock .nav-item span { display: inline; }
  .dock .brand-en { display: inline; }
  .dock .nav-item { justify-content: flex-start; }
  .dock .nav-item { padding: 11px 12px; font-size: 13.5px; }
  .dock .nav-item svg { width: 18px; height: 18px; }
  .dock.is-collapsed { padding-left: 14px; padding-right: 14px; }
  .dock.is-collapsed .dock-body,
  .dock.is-collapsed .dock-foot,
  .dock.is-collapsed .nav-item span,
  .dock.is-collapsed .brand-en { display: revert; }
  .dock.is-collapsed .dock-brand { opacity: 1; width: auto; }
  .dock.is-collapsed .nav-item { justify-content: flex-start; }
  .dock.is-collapsed #dockToggle svg { transform: none; }

  /* 遮罩 */
  .m-scrim {
    display: block;
    position: fixed; inset: 0;
    z-index: 78;
    background: rgba(3, 5, 9, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s var(--ease);
  }
  .m-scrim.is-open { opacity: 1; pointer-events: auto; }

  /* ---------- 表单类：全宽、够手指点 ---------- */
  .guest-new { grid-template-columns: 1fr; }
  .mem-stats { grid-template-columns: 1fr 1fr; }
  .swatch-grid { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
  .remind-row { flex-wrap: wrap; }
  .remind-row input[type="datetime-local"] { flex: 1 1 100%; }
  .set-card { padding: 14px; }
  input[type="text"],
  input[type="number"],
  input[type="datetime-local"],
  textarea { font-size: 16px; }
  .mini-btn, .gate-card button { min-height: 38px; }
  .plugin-row { padding: 12px 10px; }
  .guest-row { flex-wrap: wrap; }

  /* 登录/通行页在竖屏里贴中间偏上，别被键盘顶没 */
  .gate-card { width: min(88vw, 420px); padding: 30px 24px; }
  .gate-card input { font-size: 17px; }
}

/* 手机横屏：顶栏矮一点，聊天还能看 */
@media (max-width: 860px) and (orientation: landscape) {
  :root { --m-bar-h: 42px; }
  .m-title em { display: none; }
}
