/* PersonaForge · 深空星云视觉系统 v3（DESIGN.md 为唯一事实源）
 * 参照 dsh-memory-nebula v1.11.76：近黑深空底、玻璃 HUD、青/紫/暖金三级强调、
 * 全站常驻「记忆概览」；星图由 Canvas 自绘粒子星云，不依赖任何 CDN。
 * 兼容旧版全部类名（panel / stat-card / badge / chip / md-body …），模板无需改属性。
 */
:root {
  /* 深空基底 */
  --bg: #04060c;
  --bg-2: #070b14;
  --panel: rgba(12, 18, 30, 0.78);
  --panel-2: rgba(18, 26, 42, 0.72);
  --panel-solid: #0b1019;
  --line: rgba(140, 170, 210, 0.14);
  --line-strong: rgba(150, 190, 235, 0.28);
  --fg: #dbe6f5;
  --muted: #9aabc0;
  --faint: #8a94a6;
  --accent: #6ce0ff;
  --accent-2: #b48cff;
  --warm: #ffcf7a;
  --success: #78e6b0;
  --warning: #ffcf7a;
  --error: #ff7a8a;
  /* 兼容旧 token */
  --surface: var(--panel-2);
  --surface-2: rgba(30, 42, 62, 0.82);
  --accent-fg: #041018;
  /* color-mix 写进自定义属性时解析期不校验，双写无法兜底旧浏览器；
     且 v9 段已用 rgba 覆盖本 token，这里直接写新色近似 rgba */
  --accent-soft: rgba(88, 213, 232, 0.14);
  /* 节点类型色（与 graph.js COLORS 保持一致） */
  --c-persona: #ffd88a;
  --c-concept: #6cc8ff;
  --c-event: #9fb6cc;
  --c-stance: #ff8fb0;
  --c-habit: #7ff0c8;
  --c-person: #c39bff;
  --c-project: #8ce0ff;
  --radius: 14px;
  --radius-sm: 8px;
  /* 顶栏实测高度：窄屏两行导航时由媒体查询改写，星图据此算画布高度 */
  --topbar-h: 61px;
  --ease: cubic-bezier(0.25, 0.6, 0.3, 1);
  --font-display: Georgia, "Songti SC", "STSong", "SimSun", serif;
  --font-body: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI",
               "Source Han Sans SC", "Noto Sans CJK SC", "Segoe UI", system-ui, sans-serif;
  /* v6 可读性 token：最小字号、正文基准、内容宽度 */
  --fs-min: 11px;
  --fs-base: 1rem;
  --content-pad: clamp(16px, 2vw, 40px);
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0; padding-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
  color: var(--fg); font: var(--fs-base)/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
  background:
    radial-gradient(1100px 680px at 12% -12%, rgba(88, 68, 158, 0.20) 0%, transparent 62%),
    radial-gradient(980px 620px at 88% 4%, rgba(24, 92, 148, 0.18) 0%, transparent 60%),
    radial-gradient(760px 520px at 50% 108%, rgba(18, 64, 96, 0.12) 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
/* 全站环境星尘：纯 CSS，无图片、无请求 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(214, 232, 255, 0.55) 99%, transparent),
    radial-gradient(1px 1px at 72% 18%, rgba(190, 214, 255, 0.42) 99%, transparent),
    radial-gradient(1.5px 1.5px at 44% 72%, rgba(255, 226, 176, 0.34) 99%, transparent),
    radial-gradient(1px 1px at 88% 84%, rgba(196, 176, 255, 0.38) 99%, transparent);
  background-size: 223px 181px, 307px 263px, 181px 229px, 271px 211px;
}
a { color: var(--accent); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: rgb(135, 225, 238); color: color-mix(in srgb, var(--accent) 72%, #ffffff); }
code {
  font: 0.85em var(--mono); color: #a9e7ff;
  background: rgba(88, 213, 232, 0.08); background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px solid rgba(88, 213, 232, 0.12); border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 1px 6px; border-radius: 5px;
}
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.02em; }
h1 { font-size: 1.75rem; margin: 0.5em 0; }
h2 { font-size: 1.12rem; margin: 0.3em 0 0.7em; }
h3 { font: 600 0.85rem/1.4 var(--font-body); letter-spacing: 0.08em;
     text-transform: uppercase; color: var(--faint); margin: 1.2em 0 0.5em; }
h4 { font-size: 0.95rem; margin: 0.8em 0 0.4em; color: var(--fg); }
.muted { color: var(--muted); font-size: 0.9em; }
.error { color: var(--error); font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: rgba(88, 213, 232, 0.28); background: color-mix(in srgb, var(--accent) 28%, transparent); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(140, 170, 210, 0.24); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(140, 170, 210, 0.42); }

/* ---------------- 顶栏（全站常驻） ---------------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 20px; padding: 10px 26px;
  background: rgba(8, 12, 20, 0.86); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.02);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 1.1rem/1 var(--font-display); color: var(--fg);
  letter-spacing: 0.06em; white-space: nowrap;
}
.brand::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 32%, #fff6de 0%, var(--warm) 32%, rgba(255, 180, 96, 0.25) 70%, transparent 72%);
  box-shadow: 0 0 14px rgba(255, 207, 122, 0.65), 0 0 0 1px rgba(255, 207, 122, 0.35);
}
.brand span { color: var(--accent); }
.brand:hover { color: #fff; text-decoration: none; }
.topbar nav { display: flex; gap: 3px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a {
  position: relative; padding: 7px 15px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; white-space: nowrap; font-size: 0.93rem;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.topbar nav a:hover { background: rgba(88, 213, 232, 0.07); background: color-mix(in srgb, var(--accent) 7%, transparent); color: var(--fg); text-decoration: none; }
.topbar nav a.on { color: #eaf6ff; background: rgba(88, 213, 232, 0.11); background: color-mix(in srgb, var(--accent) 11%, transparent); }
.topbar nav a.on::after {
  content: ""; position: absolute; left: 15px; right: 15px; bottom: 3px; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 2px;
  box-shadow: 0 0 8px rgba(88, 213, 232, 0.7);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 70%, transparent);
}
/* 全局概览 HUD：每个页面都能看见"整个大脑"的规模 */
.global-hud { display: flex; align-items: center; gap: 16px; flex: none; }
.gh { display: flex; flex-direction: column; line-height: 1.2; min-width: 42px; }
.gh b { font: 600 13px/1.2 var(--mono); color: #eaf3ff; font-variant-numeric: tabular-nums; }
.gh span { font: 9px/1.4 var(--mono); letter-spacing: 0.1em; color: var(--faint); white-space: nowrap; }
.gh-sep { width: 1px; height: 22px; background: var(--line); }
.gh-live { display: inline-flex; align-items: center; gap: 6px; color: var(--success);
           font: 10px/1 var(--mono); letter-spacing: 0.08em; white-space: nowrap; }
.gh-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--success);
             box-shadow: 0 0 8px var(--success); }
.logout-form { display: inline; margin: 0; }
button.logout {
  background: rgba(16, 22, 34, 0.6); border: 1px solid var(--line); color: var(--muted);
  padding: 6px 14px; font-size: 0.85rem; white-space: nowrap;
}
button.logout:hover { color: var(--fg); border-color: var(--line-strong); background: rgba(30, 42, 62, 0.8); }
main { position: relative; z-index: 1; width: 100%; max-width: none;
       margin: 0 auto; padding: 22px var(--content-pad) 64px; }
footer {
  position: relative; z-index: 1; text-align: center; color: var(--faint);
  font: 0.78rem/1.6 var(--mono); letter-spacing: 0.04em;
  padding: 18px; border-top: 1px solid var(--line); background: rgba(6, 9, 16, 0.5);
}

/* ---------------- 页头 ---------------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin: 6px 0 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.page-head .eyebrow {
  display: block; font: 600 10px/1.4 var(--mono); letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 6px;
}
.page-head h1 { margin: 0 0 4px; font-size: 2.05rem; line-height: 1.25; }
.page-head p { margin: 0; color: var(--muted); font-size: 0.94rem; max-width: 780px; }
.page-head .head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------------- 面板 / 卡片 ---------------- */
.panel {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 24px; margin: 18px 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), var(--shadow);
  backdrop-filter: blur(12px);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.panel h2::before {
  content: ""; display: inline-block; width: 3px; height: 13px; margin-right: 10px;
  vertical-align: -1px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px rgba(88, 213, 232, 0.4);
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 40%, transparent);
}
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 12px; }
.stat-card {
  position: relative; overflow: hidden; text-align: left; padding: 15px 16px;
  background: linear-gradient(155deg, rgba(30, 44, 68, 0.72), rgba(9, 14, 24, 0.72));
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease);
}
.stat-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2)); opacity: 0.75;
}
.stat-card::after {
  content: ""; position: absolute; right: -26px; top: -26px; width: 74px; height: 74px;
  border-radius: 50%; background: radial-gradient(circle, rgba(88, 213, 232, 0.16), transparent 70%);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.stat-num {
  display: block; font: 700 2rem/1.1 var(--font-display); font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #eaf6ff, #8fd0ff); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.stat-label { display: block; color: var(--faint); font: 10px/1.5 var(--mono);
              letter-spacing: 0.14em; text-transform: uppercase; margin-top: 4px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 14px; }
.persona-card {
  display: block; position: relative; overflow: hidden; color: var(--fg);
  background: linear-gradient(150deg, rgba(26, 38, 60, 0.8), rgba(9, 14, 24, 0.78));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease);
}
.persona-card::after {
  content: ""; position: absolute; right: -30px; top: -30px; width: 96px; height: 96px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 216, 138, 0.14), transparent 70%);
}
.persona-card:hover { border-color: rgba(88, 213, 232, 0.45); border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-3px); text-decoration: none; }
.persona-name { font: 600 1.05rem/1.4 var(--font-display); margin-bottom: 2px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; font: 600 0.76rem/1.4 var(--mono);
  padding: 3px 10px; border-radius: 999px;
  background: rgba(88, 213, 232, 0.10); background: color-mix(in srgb, var(--accent) 10%, transparent); color: #a7e5ff;
  border: 1px solid rgba(88, 213, 232, 0.18); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}
.chip.archived { background: rgba(255, 255, 255, 0.04); color: var(--faint); border-color: var(--line); }
.chip.skill { background: rgba(180, 140, 255, 0.12); color: #d0b6ff; border-color: rgba(180, 140, 255, 0.22); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 14px; margin: 8px 0; }
.kv dt { color: var(--faint); font-size: 0.88rem; }
.kv dd { margin: 0; }
.code-block {
  background: rgba(6, 10, 18, 0.75); color: #cfe4f7; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow-x: auto; font: 0.82rem/1.6 var(--mono); white-space: pre-wrap; word-break: break-all;
}
.plain-list { list-style: none; padding: 0; margin: 6px 0; }
.plain-list li { padding: 8px 0 8px 12px; border-left: 2px solid rgba(88, 213, 232, 0.25); border-left: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
                 border-bottom: 1px dashed var(--line); margin-bottom: 4px; }
.plain-list li:last-child { border-bottom: none; }
.plain-list li:hover { border-left-color: var(--accent); background: rgba(88, 213, 232, 0.04); background: color-mix(in srgb, var(--accent) 4%, transparent); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px;
       box-shadow: 0 0 7px currentColor; vertical-align: baseline; }
.dot.Persona { background: var(--c-persona); color: var(--c-persona); }
.dot.Concept { background: var(--c-concept); color: var(--c-concept); }
.dot.Event { background: var(--c-event); color: var(--c-event); }
.dot.Stance { background: var(--c-stance); color: var(--c-stance); }
.dot.Habit { background: var(--c-habit); color: var(--c-habit); }
.dot.Person { background: var(--c-person); color: var(--c-person); }
.dot.Project { background: var(--c-project); color: var(--c-project); }

/* ---------------- 按钮 / 表单 ---------------- */
button, .btn {
  background: linear-gradient(180deg, #9fe9ff, #62cdf0); color: #041018;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 8px 18px; font: 600 0.9rem/1.4 var(--font-body); cursor: pointer;
  transition: transform 0.15s var(--ease), filter 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
button:hover, .btn:hover { filter: brightness(1.08); transform: translateY(-1px);
                           box-shadow: 0 6px 18px rgba(88, 213, 232, 0.18);
                           box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 18%, transparent); }
button:active { transform: translateY(0); }
button[disabled] { opacity: 0.5; cursor: wait; transform: none; }
.btn-ghost, button.btn-ghost {
  background: rgba(16, 22, 34, 0.6); color: var(--muted);
  border: 1px solid var(--line); backdrop-filter: blur(8px);
}
.btn-ghost:hover, button.btn-ghost:hover { color: #eaf6ff; border-color: var(--line-strong);
                                          background: rgba(30, 42, 62, 0.85); }
.btn-ghost.on, button.btn-ghost.on {
  color: #9fe9ff; background: rgba(108, 200, 255, 0.16);
  border-color: rgba(88, 213, 232, 0.42); border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  box-shadow: inset 0 0 12px rgba(88, 213, 232, 0.08); box-shadow: inset 0 0 12px color-mix(in srgb, var(--accent) 8%, transparent);
}
.linklike { background: none; border: none; color: var(--accent); font-size: 0.85rem;
            padding: 0 4px; text-decoration: underline; box-shadow: none; }
.linklike:hover { box-shadow: none; transform: none; filter: none; }
button[disabled]::after, button.is-busy::after, button.htmx-request::after {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 8px;
  vertical-align: -2px; border-radius: 50%; border: 2px solid rgba(4, 16, 24, 0.25);
  border-top-color: var(--accent-fg); animation: pf-spin 0.7s linear infinite;
}
@keyframes pf-spin { to { transform: rotate(360deg); } }
input, select, textarea {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: rgba(7, 11, 20, 0.82); color: var(--fg); font: 0.94rem var(--font-body);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(88, 213, 232, 0.55); border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px rgba(88, 213, 232, 0.12);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; align-items: end; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; color: var(--muted); font-weight: 600; }
.form-grid input { width: 100%; }
.filter-bar {
  display: flex; gap: 14px; margin: 0 0 18px; flex-wrap: wrap; align-items: center;
  padding: 12px 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); backdrop-filter: blur(10px);
}
.filter-bar label { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--muted); }
.filter-bar input[type=search] { flex: 1; min-width: 200px; }

/* ---------------- 登录 ---------------- */
.login-body { display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card {
  position: relative; overflow: hidden; width: 390px; max-width: 100%; text-align: center;
  padding: 42px 44px; border-radius: 18px;
  background: linear-gradient(160deg, rgba(24, 34, 54, 0.92), rgba(8, 12, 20, 0.94));
  border: 1px solid var(--line-strong); box-shadow: var(--shadow); backdrop-filter: blur(16px);
}
.login-card::before {
  content: ""; position: absolute; left: 50%; top: -90px; width: 260px; height: 260px;
  transform: translateX(-50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(88, 213, 232, 0.16), transparent 70%);
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%);
}
.login-card h1 { margin: 0 0 6px; font-size: 1.7rem; }
.login-card h1 span { color: var(--accent); }
.login-card input { width: 100%; margin: 18px 0 14px; }
.login-card button { width: 100%; }

/* ---------------- 列表 / 徽章 ---------------- */
.draft-list { display: flex; flex-direction: column; gap: 10px; animation: pf-fade-in 0.28s var(--ease); }
.draft-card {
  position: relative; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 18px;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.draft-card:hover { border-color: rgba(88, 213, 232, 0.35); border-color: color-mix(in srgb, var(--accent) 35%, transparent); transform: translateX(2px); }
.draft-card summary { cursor: pointer; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; list-style: none; }
.draft-card summary::-webkit-details-marker { display: none; }
.draft-card[open] { border-color: rgba(88, 213, 232, 0.42); border-color: color-mix(in srgb, var(--accent) 42%, transparent); }
.draft-card[open] .draft-body { animation: pf-fade-in 0.25s var(--ease); }
.draft-q { flex: 1; min-width: 200px; }
.draft-body { padding: 12px 4px 4px; border-top: 1px dashed var(--line); margin-top: 10px; }
.badge {
  display: inline-flex; align-items: center; font: 700 0.7rem/1.4 var(--mono);
  padding: 3px 10px; border-radius: 999px; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid transparent;
}
.badge.generated { background: rgba(255, 207, 122, 0.13); color: var(--warning); border-color: rgba(255, 207, 122, 0.24); }
.badge.fetched { background: rgba(108, 200, 255, 0.13); color: #9fd4ff; border-color: rgba(108, 200, 255, 0.24); }
.badge.sent { background: rgba(120, 230, 176, 0.13); color: var(--success); border-color: rgba(120, 230, 176, 0.24); }
.badge.discarded { background: rgba(255, 255, 255, 0.05); color: var(--faint); border-color: var(--line); }
.badge.feedback { background: rgba(195, 155, 255, 0.14); color: #d0b6ff; border-color: rgba(195, 155, 255, 0.26); }
.badge.mem-event, .badge.mem-concept, .badge.mem-stance, .badge.mem-habit {
  background: rgba(88, 213, 232, 0.09); background: color-mix(in srgb, var(--accent) 9%, transparent); color: #9fd4ff;
  border-color: rgba(88, 213, 232, 0.20); border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}
.empty { padding: 46px 24px; text-align: center; border: 1px dashed var(--line);
         border-radius: var(--radius); background: rgba(10, 15, 25, 0.4); }
.promote-report {
  margin-top: 12px; padding: 14px 16px;
  background: rgba(88, 213, 232, 0.05); background: color-mix(in srgb, var(--accent) 5%, transparent);
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  animation: pf-fade-in 0.28s var(--ease);
}
.note-form { display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.note-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; color: var(--muted); font-weight: 600; }
.note-form textarea { font: 0.94rem/1.7 var(--font-body); resize: vertical; }
/* 速记页宽屏双栏：表单 + 链路说明，避免 1600px 内容区右半屏全空 */
.notes-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.notes-layout .note-form { max-width: none; margin: 0; }
.notes-aside { margin: 0; }
.notes-aside h2 { font-size: 1.02rem; }
.notes-aside ol { margin: 6px 0 0; padding-left: 1.35em; font-size: 0.88rem; color: var(--muted); }
.notes-aside li { margin: 7px 0; }
.notes-aside .aside-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--line);
                           font: 10px/1.8 var(--mono); color: var(--faint); letter-spacing: 0.04em; }
.rail-mobile-only { display: none; }
.rail-mobile-only select { width: 100%; font-size: 0.86rem; }
.panel-inline { margin-top: 10px; }
.mem-card { padding: 12px 16px; }
.mem-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mem-title { font-weight: 600; flex: 1; min-width: 200px; }
.mem-body { margin-top: 10px; }
.mem-detail .meta { font-size: 0.8rem; }
.diff-block {
  background: rgba(6, 10, 18, 0.8); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; font: 0.78rem/1.6 var(--mono); overflow-x: auto; white-space: pre-wrap; color: #cfe4f7;
}
.feedback-list li { margin-bottom: 10px; }
#draft-list.htmx-swapping, #promote-result.htmx-swapping, #create-result.htmx-swapping { opacity: 0.35; }
.htmx-indicator { opacity: 0; transition: opacity 0.2s var(--ease); }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
@keyframes pf-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------------- Markdown ---------------- */
.md-body { word-break: break-word; }
.md-body > :first-child { margin-top: 0; }
.md-body > :last-child { margin-bottom: 0; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 { margin: 0.9em 0 0.4em; line-height: 1.35; }
.md-body h1 { font-size: 1.3rem; } .md-body h2 { font-size: 1.12rem; }
.md-body h3 { font-size: 1rem; color: var(--fg); text-transform: none; letter-spacing: 0; }
.md-body p { margin: 0.55em 0; }
.md-body ul, .md-body ol { margin: 0.5em 0; padding-left: 1.5em; }
.md-body li { margin: 0.2em 0; }
.md-body blockquote {
  margin: 0.7em 0; padding: 8px 14px; border-left: 3px solid var(--accent);
  background: rgba(88, 213, 232, 0.06); background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.md-body table { border-collapse: collapse; margin: 0.7em 0; width: 100%; font-size: 0.92em; }
.md-body th, .md-body td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.md-body th { background: rgba(88, 213, 232, 0.07); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.md-body hr { border: none; border-top: 1px dashed var(--line); margin: 1em 0; }
.md-body img { max-width: 100%; border-radius: var(--radius-sm); }
.md-body pre {
  background: rgba(6, 10, 18, 0.8); padding: 14px 16px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); overflow-x: auto; font: 0.84rem/1.6 var(--mono);
}
.md-body pre code { background: none; padding: 0; color: inherit; border: none; font-size: 1em; }
.md-body .hljs-keyword, .md-body .hljs-selector-tag, .md-body .hljs-built_in { color: #e5c07b; }
.md-body .hljs-string, .md-body .hljs-attr { color: #98c379; }
.md-body .hljs-number, .md-body .hljs-literal { color: #d19a66; }
.md-body .hljs-comment, .md-body .hljs-quote { color: #7f848e; font-style: italic; }
.md-body .hljs-title, .md-body .hljs-section { color: #61afef; }
.md-body .hljs-variable, .md-body .hljs-template-variable { color: #e06c75; }
.md-body .hljs-type, .md-body .hljs-class .hljs-title { color: #56b6c2; }
.md-body .hljs-meta { color: #abb2bf; }

/* ---------------- Toast / 错误 ---------------- */
#pf-toasts { position: fixed; top: 16px; right: 16px; z-index: 1000;
             display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 32px)); }
.pf-toast {
  background: rgba(10, 16, 26, 0.95); border: 1px solid var(--line-strong);
  border-left: 3px solid var(--muted); border-radius: var(--radius-sm);
  padding: 11px 16px; font-size: 0.9rem; backdrop-filter: blur(12px);
  box-shadow: var(--shadow); animation: pf-toast-in 0.28s var(--ease);
}
.pf-toast.success { border-left-color: var(--success); }
.pf-toast.error { border-left-color: var(--error); }
.pf-toast.info { border-left-color: var(--accent); }
.pf-toast.out { animation: pf-toast-out 0.25s var(--ease) forwards; }
@keyframes pf-toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pf-toast-out { to { opacity: 0; transform: translateX(24px); } }
.error-page { max-width: 560px; margin: 60px auto; text-align: center; }
.ui-error { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.92rem;
            background: rgba(255, 122, 138, 0.12); border: 1px solid rgba(255, 122, 138, 0.4); }

/* ==================================================================
   记忆星图：全屏深空舞台（v3 粒子星云）
   ================================================================== */
body.nebula-body { overflow: hidden; }
body.nebula-body main { max-width: none; margin: 0; padding: 0; }
body.nebula-body footer { display: none; }
/* 星图页自带完整 HUD，顶栏不再重复占位 */
body.nebula-body .global-hud { display: none; }
/* 用 dvh 跟随移动端地址栏；不再设 min-height，矮窗口不会被 body overflow:hidden 裁掉 */
.nebula-app { position: relative; height: calc(100vh - var(--topbar-h));
              height: calc(100dvh - var(--topbar-h)); min-height: 0; overflow: hidden; }
#starfield { position: absolute; inset: 0; width: 100%; height: 100%; display: block;
             background: #04060c; cursor: grab; }
#starfield.dragging { cursor: grabbing; }
.vignette { position: absolute; inset: 0; pointer-events: none; z-index: 2;
            background: radial-gradient(ellipse 75% 75% at 50% 50%, transparent 42%, rgba(2, 4, 9, 0.62) 100%); }

/* 顶部 HUD */
.hud-top {
  position: absolute; z-index: 8; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 18px 18px;
  background: linear-gradient(180deg, rgba(4, 7, 13, 0.94) 0%, rgba(4, 7, 13, 0.72) 60%, transparent 100%);
}
.hud-brand { display: flex; flex-direction: column; line-height: 1.15; min-width: 116px; }
.hud-brand b { font: 600 1rem/1.2 var(--font-display); letter-spacing: 0.04em; }
.hud-brand small { font: 9px/1.4 var(--mono); letter-spacing: 0.14em; color: var(--faint); }
.hud-stats { display: flex; gap: 16px; align-items: center; padding-left: 4px; }
.hud-stats .gh b { font-size: 15px; }
.hud-spacer { flex: 1; min-width: 8px; }
.hud-search { position: relative; width: 236px; flex: none; }
.hud-search input { width: 100%; padding-left: 32px; background: rgba(8, 12, 20, 0.86); }
.hud-search::before { content: "⌕"; position: absolute; left: 10px; top: 6px;
                      color: var(--faint); font-size: 16px; pointer-events: none; }
.hud-qmeta { position: absolute; top: 100%; left: 0; font: 10px/1.5 var(--mono);
             color: var(--faint); padding: 3px 4px; white-space: nowrap; }
.hits {
  position: absolute; top: calc(100% + 16px); left: 0; width: 320px; max-height: 300px;
  overflow-y: auto; z-index: 20; display: none;
  background: rgba(8, 12, 20, 0.96); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.hits.on { display: block; }
.hit { display: flex; align-items: center; gap: 9px; padding: 8px 12px; cursor: pointer;
       border-bottom: 1px solid var(--line); font-size: 0.86rem; }
.hit:hover, .hit.active { background: rgba(88, 213, 232, 0.09); background: color-mix(in srgb, var(--accent) 9%, transparent); }
.hit span.txt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit em { font-style: normal; color: var(--warm); }
.hud-views { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line);
             border-radius: 10px; background: rgba(8, 12, 20, 0.7); }
.hud-views button { padding: 5px 11px; font-size: 0.8rem; background: none; color: var(--muted);
                    border: none; border-radius: 7px; box-shadow: none; }
.hud-views button:hover { transform: none; filter: none; box-shadow: none; color: var(--fg);
                          background: rgba(255, 255, 255, 0.05); }
.hud-views button.on { color: #041018; background: linear-gradient(180deg, #9fe9ff, #62cdf0);
                       font-weight: 700; }
.hud-top select { padding: 6px 10px; font-size: 0.82rem; max-width: 168px; }
.hud-top .btn-ghost { padding: 6px 12px; font-size: 0.8rem; }

/* 左栏筛选 */
.rail {
  position: absolute; z-index: 6; left: 16px; top: 82px; bottom: 16px; width: 236px;
  display: flex; flex-direction: column; gap: 10px; overflow-y: auto; scrollbar-width: thin;
  pointer-events: none;
}
.rail > * { pointer-events: auto; }
.rail-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; backdrop-filter: blur(16px); box-shadow: inset 0 1px 0 rgba(255,255,255,.04), var(--shadow);
}
.f-title { display: flex; align-items: center; justify-content: space-between; gap: 8px;
           font: 600 10px/1.4 var(--mono); letter-spacing: 0.14em; color: var(--faint);
           text-transform: uppercase; margin-bottom: 10px; }
.f-title i { font-style: normal; color: var(--accent); font-size: 10px; }
.rail-total { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.rail-total b { font: 700 1.7rem/1 var(--font-display);
                background: linear-gradient(180deg, #eaf6ff, #8fd0ff); -webkit-background-clip: text;
                background-clip: text; color: transparent; }
.rail-total span { font: 10px/1.4 var(--mono); color: var(--faint); letter-spacing: 0.1em; }
.dist-row { display: grid; grid-template-columns: 52px 1fr 26px; gap: 7px; align-items: center;
            font: 10px/1.6 var(--mono); color: var(--muted); margin: 5px 0; }
.dist-bar { height: 4px; border-radius: 3px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.dist-bar i { display: block; height: 100%; border-radius: 3px; }
.dist-row b { text-align: right; color: #eaf3ff; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.fchip {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer; user-select: none;
  font: 10px/1.4 var(--mono); padding: 4px 8px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.03); color: var(--muted); border: 1px solid var(--line);
}
.fchip:hover { border-color: var(--line-strong); color: var(--fg); }
.fchip.on { background: rgba(88, 213, 232, 0.13); background: color-mix(in srgb, var(--accent) 13%, transparent);
  border-color: rgba(88, 213, 232, 0.40); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: #d6f6ff; }
.fchip .sw { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.fchip .n { opacity: 0.6; }
.rail-note { font: 10px/1.65 var(--mono); color: var(--faint); }
.rail-note b { color: var(--accent); font-weight: 600; }
.rail-btn { width: 100%; margin-top: 8px; padding: 6px 10px; font-size: 0.78rem; }
.rail-hint { font: 10px/1.8 var(--mono); color: var(--faint); }
.rail-hint kbd { display: inline-block; min-width: 16px; text-align: center; padding: 0 4px;
                 border: 1px solid var(--line); border-radius: 4px; color: var(--muted);
                 background: rgba(255,255,255,.03); }

/* 右侧详情 */
.detail {
  position: absolute; z-index: 6; right: 16px; top: 82px; bottom: 16px; width: 322px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; overflow-y: auto; backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), var(--shadow);
}
.detail-empty { text-align: center; padding: 54px 12px; color: var(--faint); }
.detail-empty .orb { width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fff6de, var(--warm) 30%, rgba(88, 213, 232, 0.18) 68%, transparent 72%);
  background: radial-gradient(circle at 38% 34%, #fff6de, var(--warm) 30%, color-mix(in srgb, var(--accent) 18%, transparent) 68%, transparent 72%);
  box-shadow: 0 0 34px rgba(255, 207, 122, 0.35); animation: orb-breathe 5s ease-in-out infinite; }
@keyframes orb-breathe { 0%,100% { transform: scale(1); opacity: .85 } 50% { transform: scale(1.09); opacity: 1 } }
.detail-empty b { display: block; color: var(--fg); font: 600 1rem/1.6 var(--font-display); margin-bottom: 6px; }
.d-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.d-eyebrow { font: 700 10px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.d-title { font: 600 1.15rem/1.45 var(--font-display); margin: 8px 0 6px; word-break: break-word; }
.d-close { background: none; border: none; color: var(--faint); font-size: 18px; padding: 0 4px;
           box-shadow: none; line-height: 1; }
.d-close:hover { filter: none; transform: none; box-shadow: none; color: var(--fg); }
.d-imps { display: flex; gap: 4px; margin: 10px 0; }
.d-imps i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,.09); }
.d-imps i.on { background: linear-gradient(90deg, var(--warm), #ff9e6b); box-shadow: 0 0 7px rgba(255,180,110,.5); }
.d-meta { font: 10px/1.8 var(--mono); color: var(--faint); border-top: 1px solid var(--line);
          border-bottom: 1px solid var(--line); padding: 8px 0; margin: 10px 0; }
.d-meta b { color: var(--muted); font-weight: 600; }
.d-body { font-size: 0.9rem; }
.d-nbr { display: flex; align-items: center; gap: 8px; padding: 7px 8px; margin: 4px 0;
         border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.02);
         cursor: pointer; font-size: 0.82rem; }
.d-nbr:hover { background: rgba(88, 213, 232, 0.08); background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-color: rgba(88, 213, 232, 0.24); border-color: color-mix(in srgb, var(--accent) 24%, transparent); }
.d-nbr span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-nbr small { color: var(--faint); font: 9px var(--mono); }

/* 小地图 / 悬浮提示 / 加载 / 帮助 */
.minimap-wrap {
  position: absolute; z-index: 6; right: 354px; bottom: 16px; width: 196px; height: 132px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
  background: rgba(6, 10, 18, 0.85); backdrop-filter: blur(12px); box-shadow: var(--shadow);
}
#minimap { display: block; width: 100%; height: 100%; cursor: crosshair; }
.mini-label { position: absolute; left: 8px; top: 5px; font: 9px/1 var(--mono);
              letter-spacing: 0.12em; color: var(--faint); pointer-events: none; }
.view-badge {
  position: absolute; z-index: 6; left: 268px; bottom: 20px; font: 10px/1.6 var(--mono);
  color: var(--faint); letter-spacing: 0.08em; pointer-events: none;
}
.view-badge b { color: var(--accent); font-weight: 600; }
#hover-tip {
  position: absolute; z-index: 9; display: none; pointer-events: none;
  padding: 7px 11px; border-radius: 7px; font-size: 0.8rem; max-width: 260px;
  background: rgba(8, 12, 20, 0.94); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); backdrop-filter: blur(10px);
}
#hover-tip.on { display: block; }
#hover-tip b { display: block; font-weight: 600; }
#hover-tip small { color: var(--faint); font: 9px/1.6 var(--mono); letter-spacing: .06em; }
#graph-loading {
  position: absolute; inset: 0; z-index: 15; display: flex; flex-direction: column;
  gap: 14px; align-items: center; justify-content: center;
  background: rgba(4, 6, 12, 0.86); color: var(--muted); font-size: 0.9rem;
  opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease);
}
#graph-loading.on { opacity: 1; pointer-events: auto; }
.boot-title { font: 600 1.1rem/1.6 var(--font-display); color: var(--fg); }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line);
           border-top-color: var(--accent); animation: pf-spin 0.8s linear infinite; }
.boot-bar { width: 220px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; border-radius: 3px;
              background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--warm));
              animation: boot-slide 1.4s ease-in-out infinite; }
@keyframes boot-slide { 0% { transform: translateX(-100%) } 100% { transform: translateX(320%) } }
#help {
  position: absolute; z-index: 20; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 420px; max-width: calc(100vw - 40px); display: none;
  background: rgba(8, 12, 20, 0.97); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 22px 26px; box-shadow: var(--shadow);
}
#help.on { display: block; }
#help h3 { margin: 0 0 12px; color: var(--fg); font-size: 1rem; letter-spacing: 0.04em; }
#help table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
#help td { padding: 5px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
#help td:first-child { width: 110px; color: var(--accent); font-family: var(--mono); font-size: 0.78rem; }
.legend-inline { display: flex; flex-wrap: wrap; gap: 8px 14px; font: 10px/1.6 var(--mono); color: var(--muted); }
.legend-inline span { display: inline-flex; align-items: center; gap: 5px; }
.legend-inline i { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }

/* ==================================================================
   响应式 v4
   目标：宽屏不吃留白 / 中屏页头不挤 / 窄屏导航不藏入口 /
         星图左右栏改抽屉，画布吃满宽度（全局观）
   ================================================================== */
.rail-toggle { display: none; }
.hud-actions { display: inline-flex; align-items: center; gap: 6px; }

@media (min-width: 1500px) {
  main { padding-left: 40px; padding-right: 40px; }
  .notes-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}

/* ≤1100 星图紧凑模式：单排 HUD + 左栏/详情抽屉，默认退场，画布铺满 */
@media (max-width: 1100px) {
  .global-hud { display: none !important; }
  .minimap-wrap { display: none; }
  .view-badge { left: 12px; bottom: 10px; }
  .hud-top { flex-wrap: nowrap; gap: 8px; padding: 8px 10px 12px; }
  .hud-brand { min-width: auto; }
  .hud-brand small, .hud-top select, #btn-help { display: none; }
  .hud-stats { gap: 10px; padding-left: 0; }
  .hud-stats .gh:nth-of-type(n+3) { display: none; }
  .hud-stats .gh b { font-size: 13px; }
  .hud-spacer { min-width: 0; }
  .hud-search { width: min(190px, 24vw); }
  .hud-views button { padding: 5px 8px; }
  .hud-top .btn-ghost { padding: 6px 9px; font-size: 0.78rem; }
  .rail-toggle { display: inline-flex; }
  .rail {
    display: flex; left: 10px; top: 68px; bottom: auto;
    width: min(284px, calc(100vw - 20px));
    max-height: calc(100% - 82px);
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.26s var(--ease);
    z-index: 12; pointer-events: auto;
  }
  .rail.open { transform: translateX(0); }
  .detail {
    left: 8px; right: 8px; top: auto; bottom: 0; width: auto;
    height: min(58vh, 440px); z-index: 12;
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 14px 16px 20px;
    transform: translateY(calc(100% + 24px));
    transition: transform 0.28s var(--ease);
  }
  .detail.on { transform: translateY(0); }
  .detail .detail-empty { padding: 26px 12px; }
}

@media (max-width: 1000px) {
  .hud-search { width: min(210px, 30vw); }
}

/* ≤980：页头从「标题 + 右侧按钮并排」改纵向，按钮不再被压成竖排单字 */
@media (max-width: 980px) {
  .page-head { flex-direction: column; align-items: stretch; gap: 14px; }
  .page-head .head-actions { justify-content: flex-start; }
  .page-head .head-actions .btn { white-space: nowrap; }
  .page-head p { max-width: none; }
  .two-col { grid-template-columns: 1fr; }
  .notes-layout { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 96px 1fr; }
}

/* ≤860：顶栏两行 —— 第一行品牌 + 退出，第二行放全部导航（换行而非隐藏） */
@media (max-width: 860px) {
  :root { --topbar-h: 92px; }
  .topbar {
    display: grid; grid-template-columns: 1fr auto;
    gap: 6px 10px; padding: 8px 14px 7px; align-items: center;
  }
  .topbar .brand { grid-column: 1; grid-row: 1; }
  .topbar .logout-form { grid-column: 2; grid-row: 1; }
  .topbar nav {
    grid-column: 1 / -1; grid-row: 2; width: 100%;
    flex-wrap: wrap; overflow: visible; gap: 2px;
  }
  .topbar nav a { padding: 4px 9px; font-size: 0.85rem; }
  .topbar nav a.on::after { left: 9px; right: 9px; bottom: 1px; }
  main { padding: 18px 16px 52px; }
  .panel { padding: 16px 18px; }
}

/* ≤700 星图 HUD：三行网格，把 146px 压到 ~100px，搜索与视图都占满宽 */
@media (max-width: 700px) {
  .hud-top {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand stats" "search search" "views actions";
    gap: 7px 8px; padding: 8px 10px 12px; align-items: center;
  }
  .hud-brand { grid-area: brand; }
  .hud-brand small { display: none; }
  .hud-stats { grid-area: stats; justify-self: end; gap: 12px; }
  .hud-stats .gh:nth-of-type(n+3) { display: none; }
  .hud-spacer { display: none; }
  .hud-search { grid-area: search; width: 100%; }
  .hud-search input { padding: 7px 10px 7px 30px; font-size: 0.85rem; }
  .hud-qmeta { display: none; }
  .hud-views { grid-area: views; width: 100%; overflow-x: auto;
               /* D2 修复：横滑收纳走全站蓝灰细滚动条语言（Firefox 同步 thin） */
               scrollbar-width: thin; scrollbar-color: rgba(140, 170, 210, 0.25) transparent; }
  /* D2 修复：全局 button overflow:hidden 使 flex 自动最小尺寸归零，胶囊被挤到逐字竖排；
     nowrap + flex:none 保住每档 intrinsic 宽度，超出部分由容器横滑收纳；
     min-height 窄范围豁免全局 44px 触控规则（仅 HUD 胶囊组，其他按钮不动），
     恢复紧凑单行高度，容器 4px 内边距仍保住点击区 */
  .hud-views button { padding: 5px 9px; white-space: nowrap; flex: none; min-height: 32px; }
  .hud-actions { grid-area: actions; }
  .hud-top select, #btn-help { display: none; }
  .hud-top .btn-ghost { padding: 6px 9px; font-size: 0.78rem; }
  .rail-mobile-only { display: block; }
  .hits { width: min(320px, calc(100vw - 20px)); }
  #help { width: auto; }
  .view-badge { font-size: 9px; }
  .detail .d-body { font-size: 0.86rem; }
}

@media (max-width: 600px) {
  body { font-size: 14px; }
  .page-head h1 { font-size: 1.5rem; }
  .brand { font-size: 0.98rem; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar label { display: flex; justify-content: space-between; }
  .filter-bar select, .filter-bar input[type=search] { width: 100%; min-width: 0; }
  .draft-q { min-width: 100%; order: 5; }
  .login-card { padding: 30px 22px; }
  #pf-toasts { top: 10px; right: 10px; left: 10px; max-width: none; }
  .form-grid { grid-template-columns: 1fr; }
  /* 6 张统计卡改 2 列，末行不再孤零零一张 */
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kv { grid-template-columns: 1fr; gap: 2px 10px; }
  .kv dt { color: var(--accent); font-size: 0.78rem; margin-top: 9px; }
  .code-block, .md-body pre, .md-body table { font-size: 0.78rem; }
  .draft-card, .mem-card { padding: 12px 14px; }
  .panel-head { gap: 8px; }
  .detail { height: min(64vh, 460px); }
  .hud-stats .gh b { font-size: 13px; }
  /* 长 ID / 文件名 / diff 不允许撑破视口 */
  .d-meta, .code-block, .diff-block, .md-body { overflow-wrap: anywhere; }
  .chip, .badge { max-width: 100%; overflow-wrap: anywhere; }
}
@media (max-width: 380px) {
  .topbar nav a { padding: 4px 7px; font-size: 0.8rem; }
  .hud-views button { padding: 5px 7px; font-size: 0.75rem; }
  .hud-brand b { font-size: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
                           transition-duration: 0.01ms !important; }
}

/* ==================================================================
   v6 · 可读性与宽度覆盖层（P0/P1）
   规则：不改旧版类名结构，只在末尾覆盖；星图页是独立画布体系，
   除字号档位外不强制改它的 HUD 小字，避免挤坏密集 HUD。
   ================================================================== */

/* ---- 字号档位：改根字号，rem 体系整体缩放；固定 px 的小字用 clamp 跟随 ---- */
html { font-size: 100%; }
html[data-fs="large"] { font-size: 110%; }
html[data-fs="xlarge"] { font-size: 120%; }

/* ---- 宽度：所有非星图页面流式铺满 ---- */
body:not(.nebula-body) main { width: 100%; max-width: none; }
.page-head p { max-width: min(78ch, 100%); font-size: 1rem; }
.note-form { max-width: min(1100px, 100%); }
.notes-layout .note-form { max-width: none; }
.panel { max-width: none; }
.filter-bar { width: 100%; }

/* ---- 小字统一抬到 ≥11px（非星图页） ---- */
body:not(.nebula-body) .gh span,
body:not(.nebula-body) .gh-live,
body:not(.nebula-body) .page-head .eyebrow,
body:not(.nebula-body) .stat-label,
body:not(.nebula-body) .notes-aside .aside-note {
  font-size: clamp(var(--fs-min), 0.72rem, 17px);
  letter-spacing: 0.08em;
}
body:not(.nebula-body) .muted { font-size: 0.95rem; }
body:not(.nebula-body) .badge { font-size: clamp(var(--fs-min), 0.74rem, 17px); }
body:not(.nebula-body) .chip { font-size: clamp(var(--fs-min), 0.78rem, 17px); }
body:not(.nebula-body) .linklike,
body:not(.nebula-body) .mem-detail .meta,
body:not(.nebula-body) .diff-block,
body:not(.nebula-body) .code-block,
body:not(.nebula-body) .feedback-list .muted,
body:not(.nebula-body) .kv dt {
  font-size: clamp(var(--fs-min), 0.82rem, 18px);
}
body:not(.nebula-body) .note-form textarea,
body:not(.nebula-body) .note-form label,
body:not(.nebula-body) .filter-bar label { font-size: 0.95rem; }
body:not(.nebula-body) .md-body { font-size: 1rem; }
body:not(.nebula-body) .mem-title { font-size: 1.02rem; }

/* ---- 列表行 grid 化：宽度拉开后标题不再变一字长蛇 ---- */
body:not(.nebula-body) .mem-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center; gap: 12px;
}
body:not(.nebula-body) .mem-title { min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  body:not(.nebula-body) .mem-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  body:not(.nebula-body) .mem-head .muted { grid-column: 2; }
}

/* ---- 双栏常驻详情（记忆页 / 草稿箱） ---- */
.split-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 30%);
                gap: 18px; align-items: start; }
.split-list { min-width: 0; }
.split-detail { position: sticky; top: calc(var(--topbar-h) + 14px);
                max-height: calc(100vh - var(--topbar-h) - 40px);
                overflow-y: auto; overscroll-behavior: contain;
                background: var(--panel); border: 1px solid var(--line);
                border-radius: var(--radius); padding: 18px 20px; }
.split-detail:empty { display: none; }
.split-detail .detail-title { font: 600 1.05rem/1.4 var(--font-body);
                              margin: 0 0 10px; word-break: break-word; }
.split-detail .detail-empty { color: var(--muted); font-size: 0.95rem; padding: 24px 4px; }
.split-row.is-active { border-color: var(--accent) !important;
                       box-shadow: inset 3px 0 0 var(--accent); }
.split-row { cursor: pointer; }
.split-row:focus-visible { outline-offset: -2px; }
@media (max-width: 1180px) {
  .split-layout { grid-template-columns: 1fr; }
  .split-detail { position: static; max-height: none; }
}

/* ---- 字号档位控件（顶栏） ---- */
.fs-switch { display: inline-flex; align-items: center; gap: 2px;
             border: 1px solid var(--line); border-radius: var(--radius-sm);
             padding: 2px; background: rgba(16, 22, 34, 0.6); }
.fs-switch button { border: 0; background: transparent; color: var(--muted);
                    padding: 3px 8px; border-radius: 5px; cursor: pointer;
                    font: 600 0.75rem/1.4 var(--mono); }
.fs-switch button:hover { color: var(--fg); }
.fs-switch button.on { background: rgba(88, 213, 232, 0.16); background: color-mix(in srgb, var(--accent) 16%, transparent); color: #d8f3ff; }
.fs-switch .fs-label { font-size: 0.72rem; color: var(--muted); padding: 0 4px; }

/* ---- 新增面板组件：队列 / 体检 / 来源 / 工具 / 证据链 ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td { text-align: left; padding: 9px 12px;
  border-bottom: 1px solid var(--line); vertical-align: top; }
.data-table th { color: var(--muted); font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.04em; white-space: nowrap; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table code { font-size: 0.85em; word-break: break-all; }
.state-pill { display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font: 600 0.78rem/1.5 var(--mono);
  border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--fg); }
.state-pill.ok, .state-pill.published, .state-pill.active, .state-pill.sent {
  color: var(--success); border-color: rgba(120,230,176,.3); background: rgba(120,230,176,.1); }
.state-pill.warn, .state-pill.queued, .state-pill.processing, .state-pill.candidate {
  color: var(--warning); border-color: rgba(255,207,122,.3); background: rgba(255,207,122,.1); }
.state-pill.bad, .state-pill.failed, .state-pill.archived {
  color: var(--error); border-color: rgba(255,122,138,.3); background: rgba(255,122,138,.1); }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.health-card { padding: 14px 16px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: rgba(10,16,28,.5); }
.health-card b { display: block; font: 600 1.5rem/1.2 var(--font-display);
  font-variant-numeric: tabular-nums; }
.health-card span { color: var(--muted); font-size: 0.88rem; }
.health-card.bad { border-color: rgba(255,122,138,.45); }
.health-card.bad b { color: var(--error); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.tool-card { padding: 11px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: rgba(10,16,28,.45); }
.tool-card b { font: 600 0.92rem/1.5 var(--mono); color: #a9e7ff; }
.tool-card p { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; }
.quote-block { border-left: 3px solid var(--accent-2); padding: 8px 14px;
  background: rgba(180,140,255,.07); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 8px 0; font-size: 0.95rem; white-space: pre-wrap; word-break: break-word; }
.chain-list { list-style: none; padding: 0; margin: 8px 0; }
.chain-list li { padding: 7px 0 7px 14px; border-left: 2px solid var(--line-strong);
  font-size: 0.92rem; }
.chain-list li:hover { border-left-color: var(--accent); }
.attr-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.attr-row .chip { font-size: 0.78rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input, .inline-form select, .inline-form textarea { min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.scroll-panel:focus-visible { outline-offset: -2px; }
.ui-note { border-left: 3px solid var(--accent); padding: 10px 14px; margin: 12px 0;
  background: rgba(88, 213, 232, 0.06); background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted); font-size: 0.92rem; }
.ui-note.warn { border-left-color: var(--warning); background: rgba(255,207,122,.07); }
.ui-note.bad { border-left-color: var(--error); background: rgba(255,122,138,.07); }
.empty-state { padding: 36px 20px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state b { display: block; color: var(--fg); font-size: 1.02rem; margin-bottom: 6px; }
.upload-drop { border: 2px dashed var(--line-strong); border-radius: var(--radius);
  padding: 26px 18px; text-align: center; background: rgba(10,16,28,.4); }
.upload-drop:hover { border-color: var(--accent); }
.truncate-1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) {
  .data-table { font-size: 0.85rem; }
  .data-table th, .data-table td { padding: 7px 6px; }
  .split-detail { max-height: none; }
}

/* ==================================================================
   v7 · WebGL 三维记忆宇宙 / 空画面守卫 / 空态 / 引导 / 证据链
   ================================================================== */
#universe, #space-labels {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
#universe {
  z-index: 1; opacity: 0; pointer-events: none; background: #04060c;
  transition: opacity .35s var(--ease);
}
#space-labels {
  z-index: 1; opacity: 0; pointer-events: none;
  transition: opacity .35s var(--ease);
}
#starfield { transition: opacity .35s var(--ease); }
.nebula-app.mode-3d #universe,
.nebula-app.mode-3d #space-labels { opacity: 1; }
.nebula-app.mode-3d #universe { pointer-events: auto; cursor: grab; }
.nebula-app.mode-3d #starfield { opacity: 0; pointer-events: none; }
.nebula-app.mode-3d .minimap-wrap { display: none; }
.nebula-app.mode-3d #space-labels { pointer-events: none; }

.hint-2d { display: none; }
.nebula-app:not(.mode-3d) .hint-3d { display: none; }
.nebula-app:not(.mode-3d) .hint-2d { display: inline; }

.mode-flag { font: 10px/1.5 var(--mono); color: var(--faint); padding: 3px 8px;
  border: 1px solid var(--line); border-radius: 6px; white-space: nowrap; }
.mode-flag.warn { color: var(--warning); border-color: rgba(255,207,122,.4);
  background: rgba(255,207,122,.07); }
.hud-actions .btn-ghost.on { color: #041018; font-weight: 700;
  background: linear-gradient(180deg, #9fe9ff, #62cdf0); }

/* 详情面板：导出动作 + 证据链 */
.d-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.d-actions .btn-ghost { font-size: 0.76rem; padding: 5px 9px; }
.d-evidence { font-size: 0.82rem; }
.d-evidence h4 { margin: 12px 0 6px; font-size: 0.78rem; color: var(--muted);
  letter-spacing: 0.06em; }
.ev-row { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; margin: 5px 0;
  border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.02); }
.ev-row > span:nth-child(2) { color: var(--fg); }
.ev-row small { color: var(--faint); font: 10px/1.6 var(--mono); }
.ev-tag { display: inline-block; align-self: flex-start;
  font: 9px/1.4 var(--mono); color: var(--accent); letter-spacing: 0.08em; }
.ev-quote { white-space: pre-wrap; word-break: break-word; max-height: 180px; overflow: auto;
  font: 11px/1.7 var(--mono); color: var(--muted); background: rgba(4,7,13,.6);
  padding: 9px; border-radius: 7px; }
.ev-warn { margin-top: 9px; padding: 8px 10px; border-radius: 7px; color: var(--warning);
  background: rgba(255,207,122,.08); border: 1px solid rgba(255,207,122,.3); font-size: 0.8rem; }

/* 空画面守卫：镜头飞出星云 / 全部被筛掉 */
.empty-hint {
  position: absolute; z-index: 12; left: 50%; top: 50%;
  transform: translate(-50%, -50%); display: none;
  padding: 12px 20px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(88, 213, 232, 0.45); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: rgba(8,14,24,.94);
  color: var(--fg); font-size: 0.9rem; box-shadow: var(--shadow);
}
.empty-hint.on { display: block; }
.empty-hint:hover { border-color: var(--accent); background: rgba(14,24,40,.97); }
.empty-hint kbd, .onboard kbd, .rail-hint kbd {
  display: inline-block; min-width: 16px; text-align: center; padding: 0 4px;
  border: 1px solid var(--line); border-radius: 4px; color: var(--muted);
  background: rgba(255,255,255,.03);
}

/* 空态：库里还没有 active 记忆 / 加载失败 */
.graph-empty {
  position: absolute; z-index: 11; left: 50%; top: 50%;
  transform: translate(-50%, -50%); display: none;
  width: min(460px, calc(100vw - 40px)); padding: 28px 26px; text-align: center;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: rgba(8,12,20,.94); box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.graph-empty.on { display: block; }
.graph-empty b { display: block; font: 600 1.15rem/1.5 var(--font-display); color: var(--fg); }
.graph-empty p { color: var(--muted); font-size: 0.88rem; line-height: 1.8; }
.ge-orb { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #fff6de, var(--warm) 32%,
              rgba(88, 213, 232, 0.20) 68%, transparent 72%);
  background: radial-gradient(circle at 38% 34%, #fff6de, var(--warm) 32%,
              color-mix(in srgb, var(--accent) 20%, transparent) 68%, transparent 72%);
  box-shadow: 0 0 30px rgba(255,207,122,.3); }
.ge-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* 首访引导 */
.onboard {
  position: absolute; z-index: 22; left: 50%; top: 50%;
  transform: translate(-50%, -50%); display: none;
  width: min(520px, calc(100vw - 40px)); padding: 22px 26px;
  background: rgba(8,12,20,.97); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.onboard.on { display: block; }
.onboard p { color: var(--muted); font-size: 0.88rem; line-height: 1.7; }
.onboard ul { margin: 10px 0; padding-left: 20px; color: var(--muted);
  font-size: 0.86rem; line-height: 1.9; }
.ob-head { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; color: var(--fg); font-size: 1.05rem; }
.ob-head .btn-ghost { font-size: 1.1rem; padding: 2px 9px; }
#help { max-height: 76vh; overflow-y: auto; }

@media (max-width: 1100px) {
  .hud-views button { padding: 4px 7px; font-size: 0.72rem; }
  #spin-toggle, #btn-export-png, #btn-export-sub, .mode-flag { display: none; }
  .onboard { padding: 18px 18px; }
  .graph-empty { padding: 22px 18px; }
}

/* ==================================================================
   v9 · 商业化视觉层（只覆盖表现；结构、路由、业务类名一律不改）
   顶部菜单保留；记忆与知识库全局，不引入「工作区」概念。
   全站统一由 CSS 单一深空底承担，不再叠第二层 WebGL 气体背景。
   ================================================================== */
:root {
  --bg: #070b14;
  --bg-2: #0b111d;
  --panel: rgba(13, 19, 32, 0.84);
  --panel-2: rgba(18, 25, 41, 0.78);
  --panel-solid: #0d1321;
  --line: rgba(142, 169, 205, 0.14);
  --line-strong: rgba(150, 190, 235, 0.27);
  --fg: #e4ecf8;
  --muted: #96a5ba;
  --faint: #6d7a90;
  --accent: #6cd7ef;
  --accent-2: #8b8cff;
  --warm: #ffc46b;
  --success: #4fd6a0;
  --warning: #f3b65c;
  --error: #ff7285;
  --accent-soft: rgba(88, 213, 232, 0.13);
  --radius: 14px;
  --radius-sm: 9px;
  --fs-base: 15px;
  --font-display: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI",
                  "Source Han Sans SC", "Noto Sans CJK SC", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 20px 52px rgba(1, 4, 10, 0.52);
  --v9-brand-soft: rgba(139, 140, 255, 0.14);
}

/* ---- 全站 WebGL 背景 ---- */
body {
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(88, 116, 180, 0.10) 0%, transparent 68%),
    radial-gradient(100% 70% at 50% 110%, rgba(40, 84, 128, 0.06) 0%, transparent 72%),
    linear-gradient(180deg, #070b14 0%, #05070d 100%);
  background-attachment: fixed;
}
body::before { opacity: 0.10; }
#pf-ambient {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: none; z-index: 0; pointer-events: none;
}
main, footer { position: relative; z-index: 1; }

/* ---- 字阶与排版 ---- */
h1, h2 { letter-spacing: -0.015em; }
h1 { font-size: clamp(1.6rem, 2.1vw, 2.05rem); font-weight: 700;
     line-height: 1.28; margin: 0 0 6px; }
h2 { font-size: 1.08rem; font-weight: 660; }
h3 { font-size: 0.72rem; letter-spacing: 0.16em; color: var(--faint); }
.page-head { border-bottom: 1px solid var(--line); position: relative; }
.page-head::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 88px; height: 2px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 12px rgba(139, 140, 255, 0.55); border-radius: 2px;
}
.page-head .eyebrow { color: var(--accent-2); letter-spacing: 0.2em; }
.page-head h1 { margin-bottom: 6px; }
.muted { color: var(--muted); }
code { color: #a9e7ff; background: rgba(88, 213, 232, 0.075);
       border-color: rgba(88, 213, 232, 0.14); }

/* ---- 页面入场：消除「静态页面」感 ---- */
@keyframes pf-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
/* :not(.pf-modal)：弹层不参与整页入场编排，否则 animation-delay 单属性会压过
   .pf-modal.on 的动画简写，弹层打开后先隐身一段时间（pf10.js 60ms 即 focus 不可见输入框） */
body:not(.nebula-body) main > *:not(.pf-modal) { animation: pf-rise 0.46s var(--ease) both; }
body:not(.nebula-body) main > *:not(.pf-modal):nth-child(1) { animation-delay: 0.02s; }
body:not(.nebula-body) main > *:not(.pf-modal):nth-child(2) { animation-delay: 0.08s; }
body:not(.nebula-body) main > *:not(.pf-modal):nth-child(3) { animation-delay: 0.14s; }
body:not(.nebula-body) main > *:not(.pf-modal):nth-child(4) { animation-delay: 0.19s; }
body:not(.nebula-body) main > *:not(.pf-modal):nth-child(n+5) { animation-delay: 0.23s; }

/* ---- 顶栏（保持顶层菜单，只提升质感） ---- */
.topbar {
  gap: 14px; padding: 10px clamp(14px, 2vw, 30px);
  background: linear-gradient(180deg, rgba(9, 13, 23, 0.93), rgba(9, 13, 23, 0.80));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.035), 0 12px 36px rgba(2, 5, 12, 0.48);
  backdrop-filter: blur(18px) saturate(140%);
}
.brand { font-family: var(--font-display); font-weight: 760; font-size: 1.14rem;
         letter-spacing: -0.02em; }
.brand::before {
  background: radial-gradient(circle at 34% 30%, #fff8e8 0%, var(--warm) 34%,
              rgba(139, 140, 255, 0.42) 68%, transparent 73%);
  box-shadow: 0 0 18px rgba(255, 196, 107, 0.62), 0 0 0 1px rgba(255, 196, 107, 0.30);
  animation: pf-core-breathe 4.6s ease-in-out infinite;
}
@keyframes pf-core-breathe { 0%,100% { filter: brightness(1); } 50% { filter: brightness(1.35); } }
.brand span { color: var(--accent); }
.topbar nav a { font-size: 0.9rem; padding: 8px 14px; border-radius: 9px;
                letter-spacing: 0.01em; }
.topbar nav a:hover { background: rgba(139, 140, 255, 0.09); color: #fff; }
.topbar nav a.on {
  color: #fff; background: var(--v9-brand-soft);
  box-shadow: inset 0 0 0 1px rgba(139, 140, 255, 0.24);
}
.topbar nav a.on::after {
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 10px rgba(88, 213, 232, 0.75);
  animation: pf-underline 3.4s ease-in-out infinite;
}
@keyframes pf-underline { 0%,100% { opacity: .72; } 50% { opacity: 1; } }
.global-hud { padding: 6px 13px; border: 1px solid var(--line);
               border-radius: 999px; background: rgba(10, 15, 26, 0.52); }
.gh-live i { animation: pf-core-breathe 2.4s ease-in-out infinite; }
.fs-switch { padding: 3px; border: 1px solid var(--line); border-radius: 999px;
             background: rgba(10, 15, 26, 0.48); }
.fs-switch button.on { background: rgba(139, 140, 255, 0.20); color: #fff; }
button.logout { border-radius: 999px; padding: 7px 16px; }
footer { color: var(--faint); background: rgba(6, 9, 16, 0.42); }

/* ---- 面板 / 卡片 ---- */
.panel {
  background: linear-gradient(165deg, rgba(20, 28, 46, 0.78), rgba(10, 15, 26, 0.80));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), var(--shadow);
  transition: border-color 0.28s var(--ease), box-shadow 0.28s var(--ease);
}
.panel:hover {
  border-color: rgba(139, 140, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06),
              0 24px 58px rgba(2, 5, 14, 0.56),
              0 0 0 1px rgba(139, 140, 255, 0.06);
}
.panel h2::before {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 10px rgba(139, 140, 255, 0.5);
}
.stat-card, .persona-card {
  border-radius: var(--radius);
  background: linear-gradient(152deg, rgba(24, 33, 53, 0.80), rgba(9, 14, 25, 0.80));
}
.stat-card:hover, .persona-card:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 140, 255, 0.38);
  box-shadow: 0 16px 38px rgba(2, 5, 14, 0.48), 0 0 24px rgba(88, 213, 232, 0.08);
}
.stat-num { font-family: var(--mono); font-weight: 700; letter-spacing: -0.02em; }
.persona-card::after { background: radial-gradient(circle, rgba(139, 140, 255, 0.18), transparent 70%); }
.chip { border-radius: 999px; background: rgba(139, 140, 255, 0.11);
        border-color: rgba(139, 140, 255, 0.22); color: #c9caff; }
.badge { letter-spacing: 0.08em; }
.plain-list li { transition: background 0.18s var(--ease), border-color 0.18s var(--ease); }

/* ---- 按钮四态 + 光泽扫过 ---- */
button, .btn {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, #7adfef, #48b7d5);
  color: #04121a; font-weight: 700; letter-spacing: 0.012em;
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: var(--radius-sm);
  box-shadow: 0 4px 18px rgba(88, 213, 232, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}
button:hover, .btn:hover {
  filter: brightness(1.08); transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(88, 213, 232, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
button:active { transform: translateY(0) scale(0.985); }
button::after, .btn::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, 0.34) 50%, transparent 68%);
  transform: translateX(-130%); transition: transform 0.6s var(--ease);
}
button:hover::after, .btn:hover::after { transform: translateX(130%); }
.btn-ghost, button.btn-ghost { background: rgba(16, 23, 38, 0.62); color: var(--muted);
  border-color: var(--line); box-shadow: none; }
.btn-ghost:hover, button.btn-ghost:hover { color: #fff; border-color: rgba(139, 140, 255, 0.42);
  background: rgba(28, 38, 60, 0.82); box-shadow: 0 6px 18px rgba(2, 5, 14, 0.35); }
.btn-ghost::after, button.btn-ghost::after { display: none; }
.btn-ghost.on, button.btn-ghost.on { color: #bfeef8; background: rgba(88, 213, 232, 0.16);
  border-color: rgba(88, 213, 232, 0.42); }

/* ---- 表单 ---- */
input, select, textarea {
  background: rgba(7, 11, 20, 0.72); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(88, 213, 232, 0.62);
  box-shadow: 0 0 0 3px rgba(88, 213, 232, 0.13), 0 0 24px rgba(88, 213, 232, 0.10);
}
.form-grid label { letter-spacing: 0.01em; }
label { color: var(--muted); }

/* ---- 表格 / 代码块 / 提示 ---- */
table { border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); }
tbody tr { transition: background 0.16s var(--ease); }
tbody tr:hover { background: rgba(139, 140, 255, 0.055); }
.pf-code {
  font: 0.82rem/1.8 var(--mono); color: #c8dcf0;
  background: rgba(4, 8, 16, 0.72); border: 1px solid var(--line);
  border-left: 3px solid var(--accent-2); border-radius: var(--radius-sm);
  padding: 14px 16px; overflow-x: auto;
}
.code-block { border-left: 3px solid var(--accent-2); }
.ui-note { border-left: 2px solid var(--accent-2); padding-left: 12px; }
.pf-toast { border-radius: 10px; }
#pf-toasts { z-index: 1000; }

/* ---- 登录 / 注册 / 找回：WebGL 星云上浮起的玻璃卡 ---- */
.login-body { min-height: 100vh; }
.login-card {
  z-index: 1; border-radius: 20px; padding: 42px 40px;
  background: linear-gradient(160deg, rgba(19, 27, 45, 0.90), rgba(9, 13, 23, 0.94));
  border: 1px solid rgba(150, 190, 235, 0.20);
  box-shadow: 0 28px 80px rgba(1, 3, 9, 0.66), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px) saturate(140%);
  animation: pf-rise 0.6s var(--ease) both;
}
.login-card::before {
  background: radial-gradient(circle, rgba(139, 140, 255, 0.24), transparent 70%);
  width: 320px; height: 320px; top: -140px;
}
.login-card h1 { font-size: 1.85rem; font-weight: 760; letter-spacing: -0.025em; }
.login-card h1 span { color: var(--accent); }
.login-card input { margin: 16px 0 12px; }
.login-card button { margin-top: 8px; }

/* ---- 星图：让画布成为主角，HUD 只做轻量浮层 ---- */
#gl-overlay { position: absolute; inset: 0; width: 100%; height: 100%;
               display: block; z-index: 1; pointer-events: none;
               opacity: 0; transition: opacity 0.4s var(--ease); }
.nebula-app .rail { opacity: 0.86; transition: opacity 0.25s var(--ease); }
.nebula-app .rail:hover { opacity: 1; }
.rail-card, .detail {
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 18px 44px rgba(1, 4, 10, 0.5);
}
.hud-top { background: linear-gradient(180deg, rgba(5, 8, 15, 0.90), rgba(5, 8, 15, 0.55) 62%, transparent); }
.hud-views { border-radius: 999px; padding: 4px; background: rgba(10, 15, 26, 0.68); }
.hud-views button { border-radius: 999px; }
.hud-views button.on { background: linear-gradient(180deg, #8b8cff, #6367e8);
                        color: #fff; box-shadow: 0 0 16px rgba(139, 140, 255, 0.32); }

/* ---- 响应式双端：顶栏仍为顶层菜单，窄屏可横滑 ---- */
@media (max-width: 1080px) {
  .topbar { gap: 10px; padding: 9px 14px; }
  .topbar nav a { padding: 8px 11px; font-size: 0.86rem; }
  .global-hud, .fs-switch { display: none; }
}
@media (max-width: 700px) {
  :root { --content-pad: 14px; }
  .topbar { flex-wrap: wrap; }
  .topbar nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .logout-form { margin-left: auto; }
  main { padding: 16px 14px 56px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; padding-bottom: 14px; }
  .page-head h1 { font-size: 1.6rem; }
  .panel { padding: 16px; border-radius: 12px; }
  .two-col, .card-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  input, select, textarea { font-size: 16px; min-height: 44px; }
  button, .btn { min-height: 44px; }
  .login-card { padding: 30px 22px; }
  .pf-code, .code-block, .md-body pre { font-size: 0.76rem; }
}
@media (max-width: 380px) {
  .topbar nav a { padding: 8px 9px; font-size: 0.8rem; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 8px; }
}
/* ---- 星图沉浸模式：桌面端默认收起筛选与空态详情，让画布成为主角 ---- */
@media (min-width: 861px) {
  .nebula-app .rail {
    opacity: 0; transform: translateX(-14px);
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  }
  .nebula-app .rail > * { pointer-events: none; }
  .nebula-app .rail.open { opacity: 1; transform: none; }
  .nebula-app .rail.open > * { pointer-events: auto; }
  .nebula-app .detail {
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  }
  .nebula-app .detail:has(.detail-empty) {
    opacity: 0; pointer-events: none; transform: translateX(14px);
  }
}
@media (prefers-reduced-motion: reduce) {
  body:not(.nebula-body) main > *, .login-card { animation: none; }
  .brand::before, .gh-live i, .topbar nav a.on::after { animation: none; }
  button::after, .btn::after { transition: none; }
}

/* ==================================================================
   v10 · 商业化产品层（只覆盖表现；顶层菜单、路由、业务逻辑一律不动）
   目标：把「一堆 panel 往下堆」升级成有主次、有状态、有反馈的工作台。
   组件分四类：KPI 与概览 / 分区导航 / 数据表格与表单 / 反馈与状态。
   所有视觉值走本段 :root 变量，改色只改这里。
   ================================================================== */
:root {
  --v10-surface: #101827;
  --v10-surface-2: #162034;
  --v10-surface-3: #1d2940;
  --v10-line: rgba(142, 169, 205, 0.16);
  --v10-line-2: rgba(150, 190, 235, 0.32);
  --v10-brand: #8b8cff;
  --v10-action: #58d5e8;
  --v10-warm: #ffc46b;
  --v10-ok: #4fd6a0;
  --v10-warn: #f3b65c;
  --v10-bad: #ff7285;
  --v10-r: 12px;
  --v10-r-lg: 16px;
  --v10-ease: cubic-bezier(0.25, 0.6, 0.3, 1);
  --v10-shadow: 0 18px 46px rgba(2, 5, 14, 0.48);
}

/* ---- 页头：主操作更醒目，副信息更收敛 ---- */
.page-head { padding-bottom: 20px; margin-bottom: 24px; }
.page-head .eyebrow { display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px; margin-bottom: 10px; border-radius: 999px;
  background: rgba(139, 140, 255, 0.12); border: 1px solid rgba(139, 140, 255, 0.24);
  color: #c3c4ff; font: 600 10px/1.7 var(--mono); letter-spacing: 0.14em; }
.page-head .desc { font-size: 0.92rem; color: var(--muted); max-width: 780px; }
.head-actions .btn-primary, .head-actions button.pf-primary {
  background: linear-gradient(135deg, #6ee0f2, #8b8cff); color: #07101d;
  box-shadow: 0 8px 26px rgba(88, 213, 232, 0.20); }
.head-actions .btn-primary:hover { box-shadow: 0 12px 32px rgba(88, 213, 232, 0.34); }

/* ---- 概览 Hero ---- */
.pf-hero { position: relative; overflow: hidden; border-radius: var(--v10-r-lg);
  border: 1px solid var(--v10-line); padding: 26px 30px; margin-bottom: 22px;
  background: linear-gradient(112deg, rgba(24, 34, 58, 0.92), rgba(11, 17, 30, 0.92) 62%,
              rgba(20, 30, 52, 0.92));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), var(--v10-shadow); }
.pf-hero::before { content: ""; position: absolute; right: -80px; top: -140px;
  width: 460px; height: 460px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(88,213,232,.18), rgba(139,140,255,.10) 45%, transparent 70%); }
.pf-hero::after { content: ""; position: absolute; right: 6%; bottom: -60px; width: 260px; height: 160px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse, rgba(255,196,107,.12), transparent 72%); }
.pf-hero .hero-kicker { font: 600 10px/1.6 var(--mono); letter-spacing: .18em;
  text-transform: uppercase; color: var(--v10-action); }
.pf-hero h1 { font-size: clamp(1.55rem, 2.3vw, 2.1rem); margin: 8px 0 8px; }
.pf-hero p { color: var(--muted); font-size: 0.94rem; max-width: 640px; }
.pf-hero .hero-side { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.hero-stat { display: inline-flex; align-items: baseline; gap: 7px; padding: 8px 14px;
  border: 1px solid var(--v10-line); border-radius: 10px; background: rgba(7, 12, 22, .56); }
.hero-stat b { font: 700 1.15rem/1 var(--mono); color: #fff; font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: 11px; color: var(--faint); }

/* ---- KPI：数字 + 趋势 + 语义 ---- */
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi-card { position: relative; overflow: hidden; padding: 17px 18px 15px;
  border: 1px solid var(--v10-line); border-radius: var(--v10-r);
  background: linear-gradient(155deg, rgba(25, 35, 56, .88), rgba(10, 16, 28, .90));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .2s var(--v10-ease), border-color .2s var(--v10-ease), box-shadow .2s var(--v10-ease); }
.kpi-card:hover { transform: translateY(-3px); border-color: var(--v10-line-2);
  box-shadow: 0 16px 36px rgba(2,5,14,.46); }
.kpi-card::after { content: ""; position: absolute; right: -34px; top: -46px; width: 128px; height: 128px;
  border-radius: 50%; background: radial-gradient(circle, var(--kpi-glow, rgba(88,213,232,.16)), transparent 70%); }
.kpi-card .kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-card .kpi-label { font-size: 12px; color: var(--muted); letter-spacing: .01em; }
.kpi-card .kpi-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px;
  background: var(--kpi-glow, rgba(88,213,232,.14)); color: var(--kpi-color, var(--v10-action)); }
.kpi-card .kpi-icon svg { width: 15px; height: 15px; }
.kpi-card .kpi-value { font: 700 1.9rem/1.2 var(--mono); font-variant-numeric: tabular-nums;
  letter-spacing: -.03em; color: #f2f7ff; margin: 10px 0 4px; }
.kpi-card .kpi-foot { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--faint); }
.kpi-card .kpi-delta { font: 600 11px/1 var(--mono); padding: 3px 7px; border-radius: 999px;
  background: rgba(79,214,160,.12); color: var(--v10-ok); }
.kpi-card .kpi-delta.down { background: rgba(255,114,133,.12); color: var(--v10-bad); }
.kpi-card .kpi-spark { position: absolute; right: 12px; bottom: 12px; width: 76px; height: 26px; opacity: .75; }
.kpi-card .kpi-value.text { font-size: 1.06rem; letter-spacing: 0; line-height: 1.45;
  margin: 14px 0 6px; word-break: break-word; }
.grid.g-main { grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); }
.grid { display: grid; gap: 18px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.col { display: grid; gap: 18px; align-content: start; }
@media (max-width: 1080px) { .g-3, .g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .g-3, .g-2 { grid-template-columns: 1fr; } }
.grid > *, .col > * { min-width: 0; }
@media (max-width: 1080px) { .grid.g-main { grid-template-columns: 1fr; } }
.due-late { color: var(--v10-bad) !important; font-weight: 600; }
.pf-alert.info { border-color: rgba(88,213,232,.30); background: rgba(88,213,232,.08); color: #c9edf7; }
/* 品牌靛紫提示条：修饰类原名 brand 与顶栏 logo 全局 .brand（L109–118，nowrap + 金色 orb ::before）
   撞名，390px 窄屏下文字单行不换行被裁切；改名 pf-alert-brand 并显式正常换行，不动全局 .brand */
.pf-alert.pf-alert-brand { border-color: rgba(139,140,255,.32); background: rgba(139,140,255,.08); color: #d2d2ff;
  white-space: normal; }
.pf-input-affix input[readonly] { padding-right: 62px; font-family: var(--mono);
  font-size: 11.5px; color: var(--muted); }
.pf-tabpane > .grid { align-items: start; }
.dotc { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.pf-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 22px 16px; text-align: center; cursor: pointer;
  border: 1px dashed var(--v10-line-2); border-radius: var(--v10-r);
  background: rgba(9, 14, 25, .42); transition: .18s var(--v10-ease); }
.pf-drop:hover { border-color: rgba(88,213,232,.55); background: rgba(88,213,232,.07); }
.pf-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pf-drop .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(88,213,232,.12); color: var(--v10-action); }
.pf-drop .ico svg { width: 19px; height: 19px; }
.pf-drop b { font-size: 12.5px; font-weight: 600; color: var(--fg); }
.pf-drop small { font: 11px var(--mono); color: var(--faint); }
.pf-toolbar label.pf-mini { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.pf-toolbar label.pf-mini select { min-width: 0; }

/* ---- 分区导航 / 页内 Tab / 分段控件 ---- */
.pf-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 5px; margin-bottom: 20px;
  border: 1px solid var(--v10-line); border-radius: 999px; background: rgba(9, 14, 25, .72); }
.pf-tabs button { background: transparent; border: 0; box-shadow: none; color: var(--muted);
  padding: 7px 16px; min-height: 34px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pf-tabs button:hover { transform: none; filter: none; color: #fff; background: rgba(255,255,255,.06); box-shadow: none; }
.pf-tabs button.on { color: #fff; background: rgba(139,140,255,.20);
  box-shadow: inset 0 0 0 1px rgba(139,140,255,.32); }
.pf-tabs button::after { display: none; }
.pf-tabs button .n { font: 700 10px/1 var(--mono); margin-left: 6px; opacity: .8; }
.pf-tabpane { display: none; animation: pf-rise .3s var(--v10-ease) both; }
.pf-tabpane.on { display: block; }
.pf-segment { display: inline-flex; gap: 3px; padding: 4px; border-radius: 10px;
  border: 1px solid var(--v10-line); background: rgba(9, 14, 25, .66); flex-wrap: wrap; }
.pf-segment button { background: none; border: 0; box-shadow: none; color: var(--muted);
  padding: 6px 13px; min-height: 30px; border-radius: 7px; font-size: 12.5px; font-weight: 600; }
.pf-segment button:hover { transform: none; filter: none; color: #fff;
  background: rgba(255,255,255,.06); box-shadow: none; }
.pf-segment button.on { background: rgba(88,213,232,.16); color: #bfeef8;
  box-shadow: inset 0 0 0 1px rgba(88,213,232,.28); }
.pf-segment button::after { display: none; }
.pf-segment button .n { font: 700 10px var(--mono); margin-left: 5px; opacity: .78; }
.pf-anchors { position: sticky; top: calc(var(--topbar-h) + 6px); z-index: 12;
  display: flex; gap: 6px; flex-wrap: wrap; padding: 9px 12px; margin-bottom: 18px;
  border: 1px solid var(--v10-line); border-radius: 12px; backdrop-filter: blur(16px);
  background: rgba(9, 14, 25, .88); box-shadow: 0 10px 26px rgba(2,5,14,.36); }
.pf-anchors a { padding: 5px 11px; border-radius: 8px; font-size: 12px; color: var(--muted); }
.pf-anchors a:hover { color: #fff; background: rgba(139,140,255,.14); }

/* ---- 面板 heads / 商品化卡片 ---- */
.panel-head { padding-bottom: 12px; border-bottom: 1px solid var(--v10-line); margin-bottom: 16px; }
.panel-head .sub { font-size: 12px; color: var(--faint); }
.panel-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.pf-card { position: relative; display: block; padding: 18px; border: 1px solid var(--v10-line);
  border-radius: var(--v10-r); background: linear-gradient(155deg, rgba(23,33,53,.84), rgba(10,16,28,.86));
  transition: transform .2s var(--v10-ease), border-color .2s var(--v10-ease), box-shadow .2s var(--v10-ease); }
.pf-card:hover { transform: translateY(-3px); border-color: var(--v10-line-2);
  box-shadow: 0 16px 36px rgba(2,5,14,.44); }
.pf-card h3 { font-size: 15px; font-weight: 650; color: var(--fg); letter-spacing: 0;
  margin: 0 0 7px; display: flex; align-items: center; gap: 8px; }
.pf-card p { font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.pf-card .pf-card-foot { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 13px; }
.pf-card .ico-tile { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(88,213,232,.12); color: var(--v10-action); }
.pf-card .ico-tile svg { width: 18px; height: 18px; }
.pf-card .arrow { position: absolute; right: 16px; top: 18px; color: var(--faint); font-size: 14px; }

/* ---- 标签 / 状态 ---- */
.pf-tag { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  border: 1px solid transparent; line-height: 1.6; }
.pf-tag.ok { background: rgba(79,214,160,.12); color: var(--v10-ok); border-color: rgba(79,214,160,.28); }
.pf-tag.warn { background: rgba(243,182,92,.12); color: var(--v10-warn); border-color: rgba(243,182,92,.28); }
.pf-tag.bad { background: rgba(255,114,133,.12); color: var(--v10-bad); border-color: rgba(255,114,133,.28); }
.pf-tag.info { background: rgba(88,213,232,.12); color: var(--v10-action); border-color: rgba(88,213,232,.28); }
.pf-tag.brand { background: rgba(139,140,255,.13); color: #bcbdff; border-color: rgba(139,140,255,.28); }
.pf-tag.muted { background: rgba(154,171,192,.10); color: var(--muted); border-color: var(--v10-line); }
.pf-tag .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---- 表格：排序 / 固定头 / 批量条 / 空态 ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--v10-line); border-radius: var(--v10-r); }
.table-wrap .data-table { width: 100%; min-width: 620px; font-size: 13px; }
.table-wrap th { position: sticky; top: 0; z-index: 1; background: rgba(14, 21, 35, .96);
  color: var(--faint); font: 600 11px/1.5 var(--mono); letter-spacing: .06em;
  text-transform: uppercase; text-align: left; padding: 11px 14px; white-space: nowrap; }
.table-wrap td { padding: 11px 14px; color: var(--fg); border-bottom: 1px solid var(--v10-line); vertical-align: middle; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover { background: rgba(139,140,255,.06); }
.table-wrap th[data-sort] { cursor: pointer; user-select: none; }
.table-wrap th[data-sort]:hover { color: var(--v10-action); }
.table-wrap th[data-sort]::after { content: "↕"; margin-left: 6px; opacity: .45; font-size: 10px; }
.table-wrap th[data-sort].asc::after { content: "↑"; opacity: 1; color: var(--v10-action); }
.table-wrap th[data-sort].desc::after { content: "↓"; opacity: 1; color: var(--v10-action); }
.pf-bulkbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 14px; border: 1px solid rgba(88,213,232,.28); border-radius: 10px;
  background: rgba(88,213,232,.09); font-size: 12.5px; color: #cdeef7; margin-bottom: 12px; }
.pf-bulkbar button { min-height: 28px; padding: 4px 10px; font-size: 12px; }

/* ---- 表单：分组 / 帮助 / 校验 / 四态 ---- */
.pf-fieldset { border: 1px solid var(--v10-line); border-radius: var(--v10-r);
  padding: 16px 18px 18px; margin-bottom: 16px; background: rgba(8, 13, 23, .36); }
.pf-fieldset legend { padding: 0 8px; font-size: 12px; font-weight: 650; color: var(--v10-action);
  letter-spacing: .04em; }
.pf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.pf-grid.one { grid-template-columns: 1fr; }
.pf-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pf-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pf-field > label, .pf-field .pf-label { font-size: 12.5px; font-weight: 600; color: var(--fg); }
.pf-field .pf-hint { font-size: 11.5px; color: var(--faint); line-height: 1.55; }
.pf-field .pf-err { font-size: 11.5px; color: var(--v10-bad); display: none; }
.pf-field.invalid input, .pf-field.invalid select, .pf-field.invalid textarea {
  border-color: rgba(255,114,133,.62); box-shadow: 0 0 0 3px rgba(255,114,133,.10); }
.pf-field.invalid .pf-err { display: block; }
.pf-field input, .pf-field select, .pf-field textarea { width: 100%; }
.pf-field .pf-input-affix { position: relative; display: flex; align-items: center; }
.pf-field .pf-input-affix input { padding-right: 62px; }
.pf-field .pf-input-affix button { position: absolute; right: 5px; min-height: 28px; padding: 3px 9px;
  font-size: 11px; background: transparent; color: var(--faint); border: 0; box-shadow: none; }
.pf-field .pf-input-affix button:hover { transform: none; filter: none; box-shadow: none; color: var(--v10-action); }
.pf-field .pf-input-affix button::after { display: none; }
.pf-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 12.5px; color: var(--muted); }
.pf-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pf-switch .track { width: 36px; height: 20px; border-radius: 999px; background: rgba(154,171,192,.22);
  border: 1px solid var(--v10-line); transition: background .18s var(--v10-ease); position: relative; flex: none; }
.pf-switch .track::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: #cbd8e9; transition: transform .18s var(--v10-ease); }
.pf-switch input:checked + .track { background: rgba(88,213,232,.34); border-color: rgba(88,213,232,.5); }
.pf-switch input:checked + .track::after { transform: translateX(16px); background: #eafcff; }
.pf-switch input:focus-visible + .track { outline: 2px solid var(--v10-action); outline-offset: 2px; }
.pf-strength { display: flex; gap: 4px; margin-top: 3px; }
.pf-strength i { height: 3px; flex: 1; border-radius: 2px; background: rgba(154,171,192,.20); }
.pf-strength i.on { background: var(--v10-ok); }
.pf-strength i.on.mid { background: var(--v10-warn); }
.pf-strength i.on.low { background: var(--v10-bad); }
.pf-counter { font: 11px var(--mono); color: var(--faint); text-align: right; }
.pf-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding-top: 4px; }
.pf-form-foot .pf-note { font-size: 11.5px; color: var(--faint); }

/* ---- 反馈：空 / 加载 / 错误 / 成功 ---- */
.pf-empty { display: grid; place-items: center; text-align: center; gap: 8px;
  padding: 38px 20px; border: 1px dashed var(--v10-line-2); border-radius: var(--v10-r);
  background: rgba(9, 14, 25, .42); }
.pf-empty .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(139,140,255,.12); color: #b9baff; margin-bottom: 4px; }
.pf-empty .ico svg { width: 22px; height: 22px; }
.pf-empty b { font-size: 14px; color: var(--fg); }
.pf-empty p { font-size: 12.5px; color: var(--faint); max-width: 420px; line-height: 1.7; }
.pf-empty .btn-row { margin-top: 6px; }
.pf-skeleton { border-radius: 6px; background: linear-gradient(90deg, rgba(154,171,192,.09),
  rgba(154,171,192,.18), rgba(154,171,192,.09)); background-size: 200% 100%;
  animation: pf-shimmer 1.4s linear infinite; }
@keyframes pf-shimmer { to { background-position: -200% 0; } }
.pf-alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 15px;
  border-radius: 10px; border: 1px solid var(--v10-line); font-size: 12.5px; line-height: 1.7;
  background: rgba(9,14,25,.6); color: var(--muted); margin-bottom: 14px; }
.pf-alert.ok { border-color: rgba(79,214,160,.30); background: rgba(79,214,160,.08); color: #bff2dc; }
.pf-alert.warn { border-color: rgba(243,182,92,.30); background: rgba(243,182,92,.08); color: #f6dfba; }
.pf-alert.bad { border-color: rgba(255,114,133,.30); background: rgba(255,114,133,.08); color: #ffc9d1; }
.pf-alert b { color: inherit; }
.pf-alert .grow { flex: 1; }
.pf-alert a { color: var(--v10-action); }
.pf-spinner { display: inline-block; width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.28); border-top-color: #fff; animation: pf-spin .7s linear infinite; }
@keyframes pf-spin { to { transform: rotate(360deg); } }
button.is-busy { opacity: .72; pointer-events: none; }

/* ---- 服务商卡片 / 向导 ---- */
.pf-provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.pf-provider { position: relative; display: block; text-align: left; padding: 14px; cursor: pointer;
  border: 1px solid var(--v10-line); border-radius: var(--v10-r);
  background: rgba(9,14,25,.52); transition: .18s var(--v10-ease); }
.pf-provider:hover { border-color: var(--v10-line-2); background: rgba(20,30,49,.72); transform: translateY(-2px); }
.pf-provider.on { border-color: rgba(88,213,232,.55); background: rgba(88,213,232,.10);
  box-shadow: 0 0 0 1px rgba(88,213,232,.16), 0 10px 26px rgba(88,213,232,.10); }
.pf-provider input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pf-provider .pv-top { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.pf-provider .pv-logo { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  font: 700 12px var(--mono); color: #07101d; flex: none; }
.pf-provider b { font-size: 13px; color: var(--fg); }
.pf-provider small { display: block; font: 10.5px/1.5 var(--mono); color: var(--faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-provider .pv-check { position: absolute; right: 12px; top: 12px; width: 16px; height: 16px;
  border-radius: 50%; border: 1px solid var(--v10-line-2); }
.pf-provider.on .pv-check { background: var(--v10-action); border-color: var(--v10-action);
  box-shadow: inset 0 0 0 4px #0b1422; }
/* ---- 模型清单：按类型卡片 / 默认项 ---- */
.pf-model-panel { margin-bottom: 18px; }
.pf-model-add { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto auto;
  gap: 12px; align-items: end; padding: 14px; margin-bottom: 16px;
  border: 1px solid var(--v10-line); border-radius: var(--v10-r);
  background: rgba(9,14,25,.5); }
.pf-model-default { display: inline-flex; align-items: center; gap: 7px; min-height: 34px;
  font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pf-model-default input { width: 16px; height: 16px; accent-color: var(--v10-action); }
.pf-model-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.pf-model-group { min-width: 0; padding: 14px; border: 1px solid var(--v10-line);
  border-radius: var(--v10-r); background: rgba(9,14,25,.52); }
.pf-model-group-head { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px; }
.pf-model-group-head b { font-size: 13px; color: var(--fg); }
.pf-model-list { display: grid; gap: 8px; }
.pf-model-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px; align-items: center; min-width: 0; padding: 9px 11px;
  border: 1px solid var(--v10-line); border-radius: 10px; background: rgba(8,13,23,.55); }
.pf-model-item.default { border-color: rgba(79,214,160,.36); background: rgba(79,214,160,.06); }
.pf-model-item code { font: 12px var(--mono); color: #d9e8f7; overflow-wrap: anywhere; }
.pf-model-actions { display: inline-flex; gap: 6px; flex-wrap: nowrap; }
.pf-model-actions .pf-model-btn { min-height: 26px; padding: 3px 9px;
  font-size: 11px; border-radius: 7px; }
.pf-model-foot { margin-top: 12px; }
@media (max-width: 1080px) { .pf-model-add { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) {
  .pf-model-add { grid-template-columns: 1fr; }
  .pf-model-groups { grid-template-columns: 1fr; }
  .pf-model-item { grid-template-columns: auto minmax(0, 1fr); }
  .pf-model-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

.pf-stepper { display: flex; align-items: center; gap: 0; margin-bottom: 18px; }
.pf-stepper .st { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--faint); }
.pf-stepper .st i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font: 700 11px var(--mono); border: 1px solid var(--v10-line-2); font-style: normal; }
.pf-stepper .st.on { color: #fff; }
.pf-stepper .st.on i { background: rgba(88,213,232,.20); border-color: rgba(88,213,232,.6); color: #c9f4fc; }
.pf-stepper .st.done i { background: rgba(79,214,160,.18); border-color: rgba(79,214,160,.5); color: var(--v10-ok); }
.pf-stepper .bar { flex: 1; height: 1px; background: var(--v10-line-2); margin: 0 12px; min-width: 16px; }
.pf-test-result { margin-top: 12px; border-radius: 10px; border: 1px solid var(--v10-line); padding: 12px 14px; }
.pf-test-result .tr-row { display: flex; align-items: center; gap: 9px; font-size: 12.5px; padding: 3px 0; }
.pf-test-result .tr-row .d { width: 7px; height: 7px; border-radius: 50%; background: var(--v10-ok); }
.pf-test-result.bad .tr-row .d { background: var(--v10-bad); }

/* ---- 弹层 / 一次性 Key ---- */
.pf-modal { position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 18px;
  background: rgba(3, 6, 12, .72); backdrop-filter: blur(8px); }
.pf-modal.on { display: flex; animation: pf-rise .22s var(--v10-ease) both; }
.pf-modal-card { width: min(560px, 100%); max-height: min(86vh, 820px); overflow-y: auto;
  border: 1px solid var(--v10-line-2); border-radius: var(--v10-r-lg); padding: 22px 24px 24px;
  background: linear-gradient(160deg, rgba(22,32,52,.97), rgba(9,14,25,.98));
  box-shadow: 0 30px 90px rgba(1,3,9,.74); }
.pf-modal-card.wide { width: min(760px, 100%); }
.pf-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--v10-line); }
.pf-modal-head h2 { font-size: 17px; }
.pf-modal-head p { font-size: 12px; color: var(--faint); margin-top: 5px; }
.pf-modal-head .x { background: transparent; border: 0; box-shadow: none; color: var(--faint);
  font-size: 20px; min-height: 30px; padding: 0 8px; line-height: 1; }
.pf-modal-head .x:hover { transform: none; filter: none; box-shadow: none; color: #fff; }
.pf-modal-head .x::after { display: none; }
.pf-once { border: 1px solid rgba(255,196,107,.38); border-radius: var(--v10-r); padding: 16px;
  background: linear-gradient(150deg, rgba(255,196,107,.09), rgba(9,14,25,.6)); }
.pf-once .pf-code { background: rgba(3,7,14,.82); word-break: break-all; white-space: pre-wrap; }
.pf-copy { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 5px 11px;
  border-radius: 8px; font-size: 12px; font-weight: 600; }
.pf-copy.copied { color: var(--v10-ok); }
.pf-danger-zone { border: 1px solid rgba(255,114,133,.26); border-radius: var(--v10-r);
  padding: 16px 18px; background: rgba(255,114,133,.05); }
.pf-danger-zone h3 { color: var(--v10-bad); font-size: 13px; letter-spacing: 0; margin-bottom: 6px; }

/* ---- 时间线 / 详情 ---- */
.pf-timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 1px solid var(--v10-line-2); }
.pf-timeline li { position: relative; padding: 0 0 16px 14px; font-size: 12.5px; color: var(--muted); }
.pf-timeline li::before { content: ""; position: absolute; left: -22px; top: 6px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--v10-brand); box-shadow: 0 0 0 3px rgba(139,140,255,.14); }
.pf-timeline li b { color: var(--fg); font-weight: 600; }
.pf-timeline li code { font-size: 11px; }
.pf-kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; font-size: 13px; }
.pf-kv dt { color: var(--faint); font-size: 12px; }
.pf-kv dd { margin: 0; color: var(--fg); }

/* ---- 待办看板 ---- */
.todo-board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; }
.todo-col { border: 1px solid var(--v10-line); border-radius: var(--v10-r);
  background: rgba(9,14,25,.52); padding: 12px; min-height: 180px; }
.todo-col .tc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--v10-line); }
.todo-col .tc-head b { font-size: 12.5px; color: var(--fg); display: flex; align-items: center; gap: 7px; }
.todo-col .tc-head .n { font: 700 11px var(--mono); color: var(--faint); }
.todo-col .tc-head i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.todo-card { position: relative; display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 12px 13px 12px 15px; margin-bottom: 9px; border: 1px solid var(--v10-line);
  border-left: 3px solid var(--todo-accent, var(--v10-action)); border-radius: 10px;
  background: linear-gradient(150deg, rgba(24,34,54,.86), rgba(11,17,30,.86));
  transition: transform .16s var(--v10-ease), border-color .16s var(--v10-ease), box-shadow .16s var(--v10-ease); }
.todo-card:hover { transform: translateY(-2px); border-color: var(--v10-line-2);
  box-shadow: 0 10px 24px rgba(2,5,14,.42); }
.todo-card.is-active { border-color: rgba(88,213,232,.62); box-shadow: 0 0 0 1px rgba(88,213,232,.18); }
.todo-card .tt { font-size: 13px; font-weight: 600; color: var(--fg); line-height: 1.5; margin-bottom: 7px; }
.todo-card .tm { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 11px; color: var(--faint); }
.todo-card .tm .sep { opacity: .5; }
.todo-card .tf { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 9px; font-size: 10.5px; color: var(--faint); }
.todo-card .due-late { color: var(--v10-bad); }
.todo-col .tc-empty { font-size: 11.5px; color: var(--faint); text-align: center; padding: 18px 6px; }
.todo-view { display: none; }
.todo-view.on { display: block; }
.pf-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  gap: 18px; align-items: start; }
.pf-workspace .pf-side { position: sticky; top: calc(var(--topbar-h) + 16px); }
.pf-workspace .pf-side .panel { max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto; }

/* ---- 通用工具类 ---- */
.pf-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pf-row.between { justify-content: space-between; }
.pf-mini { font-size: 11.5px; color: var(--faint); }
.pf-divider { height: 1px; background: var(--v10-line); margin: 18px 0; }
.pf-mono-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pf-nowrap { white-space: nowrap; }
.pf-hidden { display: none !important; }
.pf-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.pf-toolbar .grow { flex: 1; min-width: 180px; }
.pf-toolbar input[type=search] { min-height: 36px; }

/* ---- 响应式：1200 宽屏升级 / 768 移动单列 ---- */
@media (min-width: 1200px) {
  .pf-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pf-hero { padding: 30px 36px; }
}
@media (max-width: 1200px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .todo-board { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .pf-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .pf-hero { padding: 20px; }
  .pf-hero .hero-side { gap: 8px; }
  .kpi-row { gap: 10px; }
  .kpi-card { padding: 14px; }
  .kpi-card .kpi-value { font-size: 1.55rem; }
  .kpi-card .kpi-spark { display: none; }
  .pf-grid, .pf-grid.three { grid-template-columns: 1fr; }
  .pf-tabs { border-radius: 12px; }
  .pf-tabs button { padding: 8px 12px; min-height: 40px; }
  .pf-segment button { min-height: 40px; }
  .pf-anchors { position: static; }
  .todo-board { grid-template-columns: 1fr; }
  .todo-col { min-height: 0; }
  .pf-workspace { grid-template-columns: 1fr; }
  .pf-workspace .pf-side { position: static; }
  .pf-workspace .pf-side .panel { max-height: none; }
  .pf-modal-card { padding: 18px 16px 20px; }
  .table-wrap .data-table { min-width: 540px; }
  .pf-kv { grid-template-columns: 88px 1fr; }
  .pf-field input, .pf-field select, .pf-field textarea { font-size: 16px; min-height: 44px; }
  .pf-copy, .pf-provider { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .kpi-card, .pf-card, .todo-card, .pf-provider, .pf-modal.on { animation: none; transition: none; }
  .pf-skeleton { animation: none; }
  .pf-spinner { animation: none; }
}

/* ==================================================================
   v11 · 视觉升级（只覆盖表现；ID / hx-* / data-pf-* / 状态类名一律不动）
   四件事：香槟金高价值语义 + 玻璃面板 + 三层深空背景 + color-mix 状态派生；
   节点类型色对齐 v9 色板（与可视化层共享的契约，值不得漂移）。
   历史段（v3/v6/v7/v9/v10）保留，本段为第四覆盖层，后者生效。
   ================================================================== */
:root {
  /* 高价值语义专职色：双向链接 / 晋升 / 精选 / KPI 关键数字；
     与 --warm（星核 / 命中橙金）分工并存，不互相替代 */
  --gold: #e6cf98;
  --canvas-bg: #06080f;
  /* 节点类型色对齐 v9 色板（覆盖 v3 旧值；memories 的 dotc 与图例自动跟随） */
  --c-persona: #ffc46b;
  --c-concept: #6cc8ff;
  --c-event: #9fb6cc;
  --c-stance: #ff8fb0;
  --c-habit: #4fd6a0;
  --c-person: #8b8cff;
  --c-project: #58d5e8;
  /* 玻璃配方：顶部内高光 / 模糊半径 / 大扩散负偏移投影 / 蓝紫调渐变底 */
  --glass-hi: rgba(255, 255, 255, 0.05);
  --glass-blur: 18px;
  --glass-deep: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
  --glass-grad: linear-gradient(160deg, rgba(24, 33, 55, 0.88), rgba(10, 15, 27, 0.90));
}

/* ---- 玻璃面板升级：仅大面板 / 浮层吃 backdrop-filter，防低配掉帧 ---- */
.topbar {
  background: linear-gradient(160deg, rgba(17, 24, 42, 0.92), rgba(8, 12, 22, 0.86));
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-deep);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
}
.pf-hero {
  background: linear-gradient(160deg, rgba(20, 29, 48, 0.94), rgba(10, 15, 27, 0.96) 58%,
              rgba(14, 21, 36, 0.94));
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-deep);
}
/* 普通 panel 去掉 v3 遗留的全量 blur(12px)：密集页多面板同屏时避免逐帧重绘 */
.panel {
  backdrop-filter: none;
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 18px 46px -18px rgba(0, 0, 0, 0.6);
}
.pf-modal { background: rgba(3, 6, 12, 0.66); backdrop-filter: blur(var(--glass-blur)) saturate(1.25); }
.pf-modal-card {
  background: linear-gradient(160deg, rgba(25, 34, 56, 0.97), rgba(9, 14, 25, 0.98));
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 30px 90px -20px rgba(0, 0, 0, 0.8);
}
.rail-card, .detail {
  background: linear-gradient(160deg, rgba(22, 30, 50, 0.82), rgba(10, 15, 27, 0.84));
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--glass-deep);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
}
.login-card {
  background: linear-gradient(160deg, rgba(21, 29, 49, 0.92), rgba(9, 13, 23, 0.95));
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 28px 80px -22px rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.25);
}
/* 列表密集卡片一律不吃 backdrop-filter（显式兜底，防止历史段残留） */
.persona-card, .draft-card, .mem-card, .todo-card, .pf-card, .stat-card, .kpi-card {
  backdrop-filter: none;
}

/* ---- 三层深空背景：radial 星云（保留）+ 星尘（保留）+ 网格 / 噪点（新增） ---- */
/* 第二层：64px 网格，mask 让网格仅中心隐约可见 */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black, transparent 75%);
}
/* 第三层：内联 SVG feTurbulence 噪点，纯低透明度叠加，零外部请求；
   不用 mix-blend-mode：避免与持续动画的 #pf-ambient 同层逐帧全屏 blend */
html::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* 星图页与星系全景页跳过网格 / 噪点，避免干扰画布；
   网格层用 body 专用类排除（cosmos-body 由模板 body_class 注入），无 :has 依赖 */
body.nebula-body::after,
body.cosmos-body::after { display: none; }
/* :has 双保险：支持的浏览器同时关掉 html 噪点层；旧浏览器整条丢弃也不影响
   上面的网格排除，噪点层由 graph.html / cosmos.html 页内样式兜底关闭 */
html:has(body.nebula-body)::after,
html:has(body.cosmos-body)::after { display: none; }

/* ---- color-mix 状态色派生：hover 边框 55% / 选中底 20% / 外发光 26% / chip 底 9% 边框 38% ---- */
.chip {
  background: rgba(139, 140, 255, 0.09);
  background: color-mix(in srgb, var(--accent-2) 9%, transparent);
  border-color: rgba(139, 140, 255, 0.38);
  border-color: color-mix(in srgb, var(--accent-2) 38%, transparent);
}
.chip.skill {
  background: rgba(139, 140, 255, 0.12);
  background: color-mix(in srgb, var(--accent-2) 12%, transparent);
  border-color: rgba(139, 140, 255, 0.38);
  border-color: color-mix(in srgb, var(--accent-2) 38%, transparent);
}
.badge.generated { background: rgba(243, 182, 92, 0.12); background: color-mix(in srgb, var(--warning) 12%, transparent);
  border-color: rgba(243, 182, 92, 0.30); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.badge.fetched { background: rgba(108, 200, 255, 0.12); background: color-mix(in srgb, var(--c-concept) 12%, transparent);
  border-color: rgba(108, 200, 255, 0.30); border-color: color-mix(in srgb, var(--c-concept) 30%, transparent); }
.badge.sent { background: rgba(79, 214, 160, 0.12); background: color-mix(in srgb, var(--success) 12%, transparent);
  border-color: rgba(79, 214, 160, 0.30); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.badge.feedback { background: rgba(139, 140, 255, 0.12); background: color-mix(in srgb, var(--accent-2) 12%, transparent);
  border-color: rgba(139, 140, 255, 0.30); border-color: color-mix(in srgb, var(--accent-2) 30%, transparent); }
.badge.mem-event, .badge.mem-concept, .badge.mem-stance, .badge.mem-habit {
  background: rgba(88, 213, 232, 0.09);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border-color: rgba(88, 213, 232, 0.30);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.pf-tag.ok { background: rgba(79, 214, 160, 0.12); background: color-mix(in srgb, var(--success) 12%, transparent);
  border-color: rgba(79, 214, 160, 0.28); border-color: color-mix(in srgb, var(--success) 28%, transparent); }
.pf-tag.warn { background: rgba(243, 182, 92, 0.12); background: color-mix(in srgb, var(--warning) 12%, transparent);
  border-color: rgba(243, 182, 92, 0.28); border-color: color-mix(in srgb, var(--warning) 28%, transparent); }
.pf-tag.bad { background: rgba(255, 114, 133, 0.12); background: color-mix(in srgb, var(--error) 12%, transparent);
  border-color: rgba(255, 114, 133, 0.28); border-color: color-mix(in srgb, var(--error) 28%, transparent); }
.pf-tag.info { background: rgba(88, 213, 232, 0.12); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: rgba(88, 213, 232, 0.28); border-color: color-mix(in srgb, var(--accent) 28%, transparent); }
.pf-tag.brand { background: rgba(139, 140, 255, 0.13); background: color-mix(in srgb, var(--accent-2) 13%, transparent);
  border-color: rgba(139, 140, 255, 0.28); border-color: color-mix(in srgb, var(--accent-2) 28%, transparent); }
.fchip:hover { border-color: rgba(88, 213, 232, 0.55); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.fchip.on {
  background: rgba(88, 213, 232, 0.20);
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  border-color: rgba(88, 213, 232, 0.55);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 12px rgba(88, 213, 232, 0.26);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 26%, transparent);
}
.persona-card:hover {
  border-color: rgba(88, 213, 232, 0.55);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 16px 38px rgba(2, 5, 14, 0.48), 0 0 24px rgba(88, 213, 232, 0.26);
  box-shadow: 0 16px 38px rgba(2, 5, 14, 0.48), 0 0 24px color-mix(in srgb, var(--accent) 26%, transparent);
}
.split-row:hover { border-color: rgba(88, 213, 232, 0.55); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
/* 选中态三重阴影语言：描边环 + 投影 + 类型色微辉光 */
.split-row.is-active {
  border-color: rgba(88, 213, 232, 0.65) !important;
  border-color: color-mix(in srgb, var(--accent) 65%, transparent) !important;
  box-shadow: inset 3px 0 0 var(--accent),
              0 0 0 1px rgba(88, 213, 232, 0.35),
              0 8px 24px -6px rgba(88, 213, 232, 0.26);
  box-shadow: inset 3px 0 0 var(--accent),
              0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent),
              0 8px 24px -6px color-mix(in srgb, var(--accent) 26%, transparent);
}
/* todo 卡片的 --todo-accent 每卡不同，旧浏览器兜底取主 accent 近似辉光 */
.todo-card:hover {
  border-color: rgba(88, 213, 232, 0.55);
  border-color: color-mix(in srgb, var(--todo-accent, var(--accent)) 55%, transparent);
  border-left-color: var(--todo-accent, var(--accent));
  box-shadow: 0 10px 24px rgba(2, 5, 14, 0.42), 0 0 16px rgba(88, 213, 232, 0.26);
  box-shadow: 0 10px 24px rgba(2, 5, 14, 0.42),
              0 0 16px color-mix(in srgb, var(--todo-accent, var(--accent)) 26%, transparent);
}
.todo-card.is-active {
  border-color: rgba(88, 213, 232, 0.62);
  border-color: color-mix(in srgb, var(--todo-accent, var(--accent)) 62%, transparent);
  box-shadow: 0 0 0 1px rgba(88, 213, 232, 0.38),
              0 10px 26px -8px rgba(2, 5, 14, 0.6),
              0 0 18px rgba(88, 213, 232, 0.26);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--todo-accent, var(--accent)) 38%, transparent),
              0 10px 26px -8px rgba(2, 5, 14, 0.6),
              0 0 18px color-mix(in srgb, var(--todo-accent, var(--accent)) 26%, transparent);
}

/* ---- 阶梯入场：只编排整页首屏区块；HTMX 局部替换的片段不带长延迟 ---- */
@keyframes pf-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  /* 终帧用 none 而非 translateY(0)：避免动画 fill 永久留下包含块 / 堆叠上下文 */
  to   { opacity: 1; transform: none; }
}
@keyframes pf-slide-in {
  from { opacity: 0; transform: translateX(48px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
/* :not(.pf-modal)：弹层豁免整页入场与延迟，保住 .pf-modal.on 自身的 0.22s 入场 */
body:not(.nebula-body) main > *:not(.pf-modal) { animation: pf-fade-up 0.55s var(--ease) both; }
body:not(.nebula-body) main > *:not(.pf-modal):nth-child(1) { animation-delay: 0.1s; }
body:not(.nebula-body) main > *:not(.pf-modal):nth-child(2) { animation-delay: 0.16s; }
body:not(.nebula-body) main > *:not(.pf-modal):nth-child(3) { animation-delay: 0.22s; }
body:not(.nebula-body) main > *:not(.pf-modal):nth-child(4) { animation-delay: 0.3s; }
body:not(.nebula-body) main > *:not(.pf-modal):nth-child(n+5) { animation-delay: 0.34s; }
/* 语义锚点：无论区块落在第几个子元素，Hero 始终最先、KPI 带随后；同样豁免弹层 */
body:not(.nebula-body) main > .pf-hero:not(.pf-modal) { animation-delay: 0.1s; }
body:not(.nebula-body) main > .kpi-row:not(.pf-modal) { animation-delay: 0.16s; }
body:not(.nebula-body) main > .card-grid:not(.pf-modal),
body:not(.nebula-body) main > .grid:not(.pf-modal) { animation-delay: 0.22s; }
body:not(.nebula-body) main > .panel:not(.pf-modal),
body:not(.nebula-body) main > .split-layout:not(.pf-modal) { animation-delay: 0.3s; }
/* 星图详情抽屉：桌面端右侧滑入；窄屏底部抽屉沿用既有 translateY 过渡，
   避免动画与抽屉定位 transform 互相覆盖；空态详情不参与入场 */
@media (min-width: 1101px) {
  .nebula-app .detail.on:not(:has(.detail-empty)) {
    animation: pf-slide-in 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
}

/* ---- 语义洞察卡片 .pf-insight：左侧 2px 圆角竖条 + 渐变语义底 ---- */
.pf-insight {
  position: relative; overflow: hidden;
  padding: 12px 16px 12px 18px; margin: 12px 0;
  border: 1px solid var(--v10-line); border-radius: var(--v10-r);
  background: linear-gradient(150deg, rgba(88, 213, 232, 0.10), rgba(10, 16, 28, 0.55) 60%);
}
.pf-insight::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  border-radius: 2px; background: var(--accent);
  box-shadow: 0 0 10px rgba(88, 213, 232, 0.55);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 55%, transparent);
}
/* 金色调：洞察 / 晋升 / 精选等高价值语义 */
.pf-insight.tone-gold {
  background: linear-gradient(150deg, rgba(150, 128, 80, 0.22), rgba(12, 17, 29, 0.55) 60%);
  border-color: rgba(230, 207, 152, 0.22);
  border-color: color-mix(in srgb, var(--gold) 22%, transparent);
}
.pf-insight.tone-gold::before {
  background: var(--gold);
  box-shadow: 0 0 10px rgba(230, 207, 152, 0.5);
  box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 50%, transparent);
}
/* 风险调：告警 / 体检异常 */
.pf-insight.tone-warn {
  background: linear-gradient(150deg, rgba(150, 50, 70, 0.28), rgba(12, 17, 29, 0.55) 60%);
  border-color: rgba(255, 114, 133, 0.24);
  border-color: color-mix(in srgb, var(--error) 24%, transparent);
}
.pf-insight.tone-warn::before {
  background: var(--error);
  box-shadow: 0 0 10px rgba(255, 114, 133, 0.5);
  box-shadow: 0 0 10px color-mix(in srgb, var(--error) 50%, transparent);
}
.pf-insight.tone-info {
  background: linear-gradient(150deg, rgba(88, 213, 232, 0.12), rgba(12, 17, 29, 0.55) 60%);
  border-color: rgba(88, 213, 232, 0.24);
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
}
/* 与既有组件叠加时去掉重复的左边条，避免双竖条；虚线框改实线 */
.pf-insight.ui-note, .pf-insight.pf-alert, .pf-insight.promote-report { border-left-width: 1px; border-style: solid; }
.pf-insight.pf-alert { margin-bottom: 14px; }
/* 后端直出的结果片段（ui-note）落在这些容器里时，同样套金色洞察配方；
   不改后端 HTML，用容器 ID 后代选择器命中（ID 本身不动） */
#layer-result .ui-note, #endorse-result .ui-note, #obs-result .ui-note {
  position: relative; overflow: hidden;
  padding: 12px 16px 12px 18px; margin: 12px 0;
  border: 1px solid rgba(230, 207, 152, 0.22);
  border: 1px solid color-mix(in srgb, var(--gold) 22%, transparent);
  border-radius: var(--v10-r); color: var(--fg);
  background: linear-gradient(150deg, rgba(150, 128, 80, 0.22), rgba(12, 17, 29, 0.55) 60%);
}
#layer-result .ui-note::before, #endorse-result .ui-note::before, #obs-result .ui-note::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  border-radius: 2px; background: var(--gold);
  box-shadow: 0 0 10px rgba(230, 207, 152, 0.5);
  box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 50%, transparent);
}
#layer-result .ui-note.warn, #endorse-result .ui-note.warn, #obs-result .ui-note.warn {
  border-color: rgba(243, 182, 92, 0.26);
  border-color: color-mix(in srgb, var(--warning) 26%, transparent);
  background: linear-gradient(150deg, rgba(150, 110, 50, 0.20), rgba(12, 17, 29, 0.55) 60%);
}
#layer-result .ui-note.bad, #endorse-result .ui-note.bad, #obs-result .ui-note.bad {
  border-color: rgba(255, 114, 133, 0.26);
  border-color: color-mix(in srgb, var(--error) 26%, transparent);
  background: linear-gradient(150deg, rgba(150, 50, 70, 0.28), rgba(12, 17, 29, 0.55) 60%);
}

/* ---- KPI 带：四列一体式玻璃带，列间分隔线，关键数字香槟金 ---- */
.kpi-row {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
  border: 1px solid var(--v10-line); border-radius: var(--v10-r-lg); overflow: hidden;
  background: linear-gradient(160deg, rgba(23, 32, 52, 0.85), rgba(10, 15, 27, 0.90));
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 18px 46px -20px rgba(0, 0, 0, 0.55);
}
.kpi-card {
  border: 0; border-left: 1px solid var(--v10-line); border-radius: 0;
  background: transparent; box-shadow: none;
}
.kpi-card:first-child { border-left: 0; }
/* 带内卡片不再上浮（overflow:hidden 会裁切），改用底色提亮反馈 */
.kpi-card:hover {
  transform: none; border-left-color: var(--v10-line);
  background: rgba(139, 140, 255, 0.05); box-shadow: none;
}
.kpi-card .kpi-value {
  font-size: 32px; font-weight: 600; font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}
.kpi-card .kpi-value.gold {
  color: var(--gold);
  text-shadow: 0 0 20px rgba(230, 207, 152, 0.32);
  text-shadow: 0 0 20px color-mix(in srgb, var(--gold) 32%, transparent);
}
.hero-stat.gold b { color: var(--gold); }
/* 待办完成率环形进度：渐变描边 + 微辉光，起点朝上（模板内 rotate(-90)） */
.kpi-ring {
  width: 44px; height: 44px; flex: none;
  filter: drop-shadow(0 0 6px rgba(88, 213, 232, 0.4));
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 40%, transparent));
}
.kpi-ring text { font: 600 9px var(--mono); fill: var(--fg); }

/* ---- 滚动条：5px 细款，与全站蓝灰调一致；Firefox 走 scrollbar-width ---- */
html { scrollbar-width: thin; scrollbar-color: rgba(140, 170, 210, 0.25) transparent; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(140, 170, 210, 0.25); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(140, 170, 210, 0.45); }
.rail, .split-list, .scroll-panel, .split-detail, .detail, .hits,
.pf-modal-card, .table-wrap, .ev-quote {
  scrollbar-width: thin; scrollbar-color: rgba(140, 170, 210, 0.25) transparent;
}
/* topbar nav 隐藏滚动条的既有规则保留（v3 段），此处不覆盖 */

/* ---- 补齐模板 / pf10.js 已在用但无样式的类 ---- */
/* 危险按钮：红系派生底 / 边框 / hover 辉光（#pf-confirm-yes 在用） */
.btn-danger, button.btn-danger {
  /* 兜底渐变端色：error 86%+白 / error 74%+#5c1622 的预混结果 */
  background: linear-gradient(180deg, rgb(255, 134, 150), rgb(213, 90, 107));
  background: linear-gradient(180deg, color-mix(in srgb, var(--error) 86%, #ffffff),
              color-mix(in srgb, var(--error) 74%, #5c1622));
  color: #fff;
  border-color: rgba(255, 114, 133, 0.55); border-color: color-mix(in srgb, var(--error) 55%, transparent);
  box-shadow: 0 4px 18px rgba(255, 114, 133, 0.24),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 18px color-mix(in srgb, var(--error) 24%, transparent),
              inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-danger:hover, button.btn-danger:hover {
  box-shadow: 0 10px 26px rgba(255, 114, 133, 0.34),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--error) 34%, transparent),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-sm, button.btn-sm { padding: 5px 12px; font-size: 0.8rem; min-height: 30px; border-radius: 8px; }
.btn-quiet, button.btn-quiet {
  background: transparent; border-color: transparent; color: var(--muted);
  box-shadow: none; padding: 4px 8px;
}
.btn-quiet:hover, button.btn-quiet:hover {
  background: rgba(139, 140, 255, 0.08); color: var(--fg);
  transform: none; filter: none; box-shadow: none;
}
.btn-quiet::after, button.btn-quiet::after { display: none; }
/* 去内边距面板：列表视图的 table-wrap 自带边框，外壳不再叠一层 */
.panel.flush, .panel.flush:hover {
  padding: 0; border: 0; background: transparent; box-shadow: none; backdrop-filter: none;
}

/* ---- v11 响应式：KPI 带 2×2 降级（≤700 保持两列），分隔线随换行重排 ---- */
@media (max-width: 1200px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card:nth-child(odd) { border-left: 0; }
  .kpi-card:nth-child(n+3) { border-top: 1px solid var(--v10-line); }
}
@media (max-width: 700px) {
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card { padding: 13px 14px; }
  .kpi-card .kpi-value { font-size: 24px; }
  .kpi-card .kpi-value.text { font-size: 1rem; }
  .kpi-ring { width: 38px; height: 38px; }
  .btn-sm, button.btn-sm { min-height: 38px; }
}
/* 新动画同样被全局 reduced-motion 降级覆盖（* 规则压动画时长），此处再显式兜底 */
@media (prefers-reduced-motion: reduce) {
  body:not(.nebula-body) main > *, .nebula-app .detail.on { animation: none; }
}

/* ==================================================================
   v11.4 星座工作台（独立 HUD 入口；#view-switch 五档契约零触碰）
   构图：左侧亮星云 + 星座折线 + 散落模块卡 / 单点收束扇形束 → 右侧紧凑清单；
   DOM 卡片压在底层 canvas 之上；详情抽屉靠右，色板沿用全站 token。
   ================================================================== */
.const-view {
  position: absolute; inset: 0; z-index: 7;
  display: flex; flex-direction: column; min-height: 0;
  /* 顶栏 HUD 实测高度由 JS 写入 --const-hud-h，兼顶栏保留不遮挡 */
  padding-top: var(--const-hud-h, 72px);
  background:
    radial-gradient(ellipse 80% 70% at 30% 48%, rgba(88, 213, 232, 0.05), transparent 72%),
    linear-gradient(180deg, #070b14 0%, #05070d 100%);
}
/* hidden 属性会被 display:flex 覆盖（§11.5 已知坑）：必须显式压回 */
#constellation-view[hidden] { display: none !important; }

/* ---- 顶部控制条：面包屑 + 规模 meta + 胶囊控制 ---- */
.const-bar { display: flex; align-items: center; gap: 14px; padding: 10px 18px 8px; flex: none; }
.const-crumb { display: flex; flex-direction: column; line-height: 1.2; }
.const-crumb b { font: 600 0.98rem/1.3 var(--font-display); letter-spacing: 0.04em; color: var(--gold); }
.const-crumb small { font: 9px/1.4 var(--mono); letter-spacing: 0.16em; color: var(--faint); }
.const-meta { font: 10px/1.6 var(--mono); color: var(--faint); letter-spacing: 0.06em; }
.const-bar-actions { margin-left: auto; display: inline-flex; gap: 8px; }
.const-pill {
  padding: 6px 15px; border-radius: 999px; cursor: pointer;
  font: 500 0.78rem/1.4 var(--font-body, inherit); color: var(--muted);
  background: rgba(12, 17, 30, 0.72); border: 1px solid rgba(142, 169, 205, 0.22);
  box-shadow: inset 0 1px 0 var(--glass-hi);
}
.const-pill:hover {
  color: var(--fg); border-color: rgba(88, 213, 232, 0.55);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 14px rgba(88, 213, 232, 0.22);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 14px color-mix(in srgb, var(--accent) 22%, transparent);
  transform: none; filter: none;
}
.const-pill.on {
  color: #d6f6ff; background: rgba(88, 213, 232, 0.16);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: rgba(88, 213, 232, 0.5);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.const-pill.gold {
  color: var(--gold); background: rgba(230, 207, 152, 0.08);
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  border-color: rgba(230, 207, 152, 0.35);
  border-color: color-mix(in srgb, var(--gold) 35%, transparent);
}
.const-pill.gold:hover {
  border-color: rgba(230, 207, 152, 0.6);
  border-color: color-mix(in srgb, var(--gold) 60%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 16px rgba(230, 207, 152, 0.26);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 16px color-mix(in srgb, var(--gold) 26%, transparent);
}
/* HUD 入口按钮选中态：香槟金实心胶囊，与五档青色选中态分工 */
#btn-constellation.on {
  color: #1a1408; font-weight: 700;
  background: linear-gradient(180deg, #f3e3bb, #e6cf98);
  border-color: transparent;
  box-shadow: 0 0 18px rgba(230, 207, 152, 0.35);
}

/* ---- 舞台三栏：左侧星座场 / 中栏汇聚点 / 右侧紧凑清单；canvas 在底层 ---- */
.const-stage {
  position: relative; flex: 1; min-height: 0;
  /* v21：中栏承载「每卡来线 → 汇聚点」，留足扇形束展开的起点空间 */
  display: grid; grid-template-columns: minmax(320px, 0.95fr) minmax(110px, 0.28fr) minmax(420px, 1.15fr);
  gap: 10px; padding: 4px 18px 8px;
}
.const-modules {
  position: relative; z-index: 2; min-height: 0;
  overflow: visible; padding: 0;
}
.const-mod {
  position: absolute; overflow: hidden; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px; width: 164px; height: 80px;
  padding: 8px 10px; border-radius: 10px; color: var(--fg);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(18, 26, 43, 0.88), rgba(9, 14, 25, 0.92));
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 14px 34px -18px rgba(0, 0, 0, 0.6);
}
/* v20：卡片交错排布，左侧留出每卡专属星座线稿的位置，右边缘是出线锚点。
   v27：模块共 8 张（7 类 + 全部星体），补齐 7/8 位，避免最后两张退回静态位置互相压住。 */
.const-mod:nth-child(1) { left: 46%; top: 0%; }
.const-mod:nth-child(2) { left: 40%; top: 12.5%; }
.const-mod:nth-child(3) { left: 52%; top: 25%; }
.const-mod:nth-child(4) { left: 42%; top: 37.5%; }
.const-mod:nth-child(5) { left: 48%; top: 50%; }
.const-mod:nth-child(6) { left: 38%; top: 62.5%; }
.const-mod:nth-child(7) { left: 46%; top: 75%; }
.const-mod:nth-child(8) { left: 40%; top: 87.5%; }
.const-mod-thumb { display: none !important; }
.const-mod-top { display: flex; align-items: center; gap: 8px; }
.const-mod-ico { font-style: normal; font-size: 14px; color: var(--modc); text-shadow: 0 0 10px currentColor; }
.const-mod-num { font: 700 1.45rem/1 var(--mono); font-variant-numeric: tabular-nums; color: #eaf3ff; }
.const-mod-name { display: flex; align-items: baseline; gap: 8px; }
.const-mod-name b { font: 600 0.92rem/1.3 inherit; letter-spacing: 0.02em; }
.const-mod-name small { font: 9px/1.4 var(--mono); letter-spacing: 0.14em; color: var(--faint); }
.const-mod-stats { font: 10px/1.6 var(--mono); color: var(--muted); }
.const-mod-stats em { font-style: normal; color: var(--gold); }
/* D3 修复：统计项内部不断词（「0 双向」不被拆行），项与项之间仍可在 · 处换行 */
.const-mod-stats span, .const-mod-stats em { white-space: nowrap; }
/* hover 微辉光：--modc 每卡不同，color-mix 派生 + 前置 rgba 兜底 */
.const-mod:hover {
  border-color: rgba(88, 213, 232, 0.5);
  border-color: color-mix(in srgb, var(--modc) 55%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 22px rgba(88, 213, 232, 0.2);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 22px color-mix(in srgb, var(--modc) 26%, transparent);
  transform: none; filter: none;
}
.const-mod.on {
  border-color: rgba(230, 207, 152, 0.5);
  border-color: color-mix(in srgb, var(--modc) 65%, transparent);
  background: linear-gradient(160deg, rgba(30, 40, 68, 0.9), rgba(12, 17, 31, 0.9));
  box-shadow: inset 3px 0 0 var(--modc), inset 0 1px 0 var(--glass-hi),
              0 0 26px rgba(230, 207, 152, 0.16);
  box-shadow: inset 3px 0 0 var(--modc), inset 0 1px 0 var(--glass-hi),
              0 0 26px color-mix(in srgb, var(--modc) 30%, transparent);
}
.const-core-wrap { position: relative; z-index: 1; min-height: 0; }
.const-list-wrap {
  position: relative; z-index: 2; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
.const-list-head {
  flex: none; display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; padding: 2px 8px 10px; border-bottom: 1px solid var(--line);
}
.const-list-head b { font: 600 0.86rem/1.4 inherit; color: var(--gold); letter-spacing: 0.03em; }
.const-list-head span { font: 10px/1.4 var(--mono); color: var(--faint); }
.const-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0; display: flex; flex-direction: column; gap: 0; }
.const-list-empty { padding: 34px 12px; text-align: center; color: var(--faint); font-size: 0.85rem; line-height: 1.8; }
.const-row {
  flex: none;
  min-height: 26px;
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 3px 8px; border-radius: 0; cursor: pointer; color: var(--fg);
  border: 0; border-bottom: 1px solid rgba(142, 169, 205, 0.10); background: transparent;
}
.const-row:hover {
  background: rgba(108, 215, 239, 0.06);
  border-bottom-color: rgba(108, 215, 239, 0.28);
  transform: none; filter: none; box-shadow: none;
}
.const-row.is-active {
  background: rgba(230, 207, 152, 0.07);
  border-bottom-color: rgba(230, 207, 152, 0.42);
  box-shadow: inset 2px 0 0 var(--gold);
}
.const-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.const-row-main { flex: 1; min-width: 0; }
.const-row-main b { display: block; font: 500 0.78rem/1.5 inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.const-row-main small { display: none; }
.const-row-stats { flex: none; font: 9px/1.6 var(--mono); color: var(--faint); white-space: nowrap; }
.const-row-stats em { font-style: normal; font-weight: 600; color: #cfe2ff; }
.const-bidi { color: var(--gold); margin-right: 4px; }
/* 覆盖 canvas 放底层：左侧星座线 + 右侧扇形束；DOM 卡与列表压在上层 */
#const-canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; display: block; pointer-events: none; }
.const-foot { display: none; }
.const-foot kbd { display: inline-block; min-width: 16px; text-align: center; padding: 0 4px;
  border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: rgba(255, 255, 255, 0.03); }

/* ---- 工作台专属滚动条：香槟金细款，与全站蓝灰款分工 ---- */
.const-modules, .const-list { scrollbar-width: thin; scrollbar-color: rgba(230, 207, 152, 0.28) transparent; }
.const-modules::-webkit-scrollbar, .const-list::-webkit-scrollbar { width: 5px; height: 5px; }
.const-modules::-webkit-scrollbar-track, .const-list::-webkit-scrollbar-track { background: transparent; }
.const-modules::-webkit-scrollbar-thumb, .const-list::-webkit-scrollbar-thumb { background: rgba(230, 207, 152, 0.25); border-radius: 999px; }
.const-modules::-webkit-scrollbar-thumb:hover, .const-list::-webkit-scrollbar-thumb:hover { background: rgba(230, 207, 152, 0.45); }

/* ---- .mode-const：隐藏正常画布层与冲突 HUD 元素（顶栏保留） ---- */
.nebula-app.mode-const #starfield,
.nebula-app.mode-const #gl-overlay,
.nebula-app.mode-const #universe,
.nebula-app.mode-const #space-labels { opacity: 0 !important; pointer-events: none !important; }
.nebula-app.mode-const .rail,
.nebula-app.mode-const .minimap-wrap,
.nebula-app.mode-const .view-badge,
.nebula-app.mode-const #empty-hint,
.nebula-app.mode-const #hover-tip { display: none !important; }
/* 详情抽屉复用：高-2 修复——层序规则提出媒体查询全宽度生效。
   旧实现 z-index:9 被包在 ≥1101 内，窄视口抽屉被工作台（z-index:7）遮挡点击无反应；
   ≤1100 保留既有底部抽屉几何（left/right/bottom/transform 不动），仅补层序 */
.nebula-app.mode-const .detail { z-index: 9; }
/* 高-2 补必要偏移：≤860 顶栏导航换行后实测高可能超过 --topbar-h，
   .nebula-app 底缘溢出视口，bottom:0 的抽屉随之落到视口外；
   用 constellation.js 实测回写的 --const-drawer-lift 抬升同量，
   保留既有底部抽屉几何与 transform 过渡，不动 --topbar-h 与画布尺寸机制 */
@media (max-width: 1100px) {
  .nebula-app.mode-const .detail { bottom: var(--const-drawer-lift, 0px); }
}
/* 桌面端靠右停靠：详情不再覆盖中央扇形，也不落在舞台中间 */
@media (min-width: 1101px) {
  .nebula-app.mode-const .detail {
    right: 18px; left: auto; width: min(380px, 32vw);
    top: calc(var(--const-hud-h, 72px) + 52px); bottom: 36px;
  }
}
/* 既有缺陷顺带修复：.d-nbr span{flex:1} 把类型圆点拉成椭圆色块；
   圆点恢复固定尺寸（正常星图抽屉同步受益，ID / 类名契约不动） */
.d-nbr .dot { flex: none; margin-right: 0; }

/* 参考图是静态星座线稿：卡片与清单不再做逐条入场动效 */
.const-view.on .const-bar,
.const-view.on .const-list-wrap,
.const-view.on #const-canvas,
.const-view.on .const-mod,
.const-view.on .const-row { animation: none; }

/* ---- 响应式：≤1100 收窄；≤700 模块横滑 + 列表纵排 + 连线隐藏 ---- */
@media (max-width: 1100px) {
  .const-stage { grid-template-columns: 240px minmax(84px, 0.24fr) minmax(300px, 1fr); gap: 8px; padding: 4px 10px 6px; }
  .const-mod { width: 138px; height: 68px; }
  .const-mod-num { font-size: 1.05rem; }
  .const-bar { padding: 8px 10px 6px; gap: 10px; }
  .const-pill { padding: 6px 11px; }
  .const-foot { padding: 4px 10px 8px; }
}
@media (max-width: 700px) {
  .hud-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 52vw; gap: 4px; }
  .hud-top .btn-ghost { padding: 6px 8px; font-size: 0.74rem; }
  #btn-constellation { white-space: nowrap; }
  .const-stage { display: flex; flex-direction: column; gap: 10px; }
  .const-modules {
    flex: none; height: 96px; display: flex; flex-direction: row;
    overflow-x: auto; overflow-y: hidden; gap: 10px; padding: 0 2px 4px;
  }
  .const-mod {
    position: relative; left: auto !important; top: auto !important;
    flex: 0 0 146px; width: auto; min-height: 0; height: 82px;
  }
  .const-core-wrap { display: none; }
  #const-canvas { display: none; }
  .const-list-wrap { flex: 1; min-height: 0; }
  .const-bar { flex-wrap: wrap; gap: 8px; }
  .const-meta { order: 3; width: 100%; }
  .const-bar-actions { margin-left: auto; }
  .const-row-stats { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .const-view.on .const-bar, .const-view.on .const-list-wrap,
  .const-view.on #const-canvas, .const-view.on .const-mod,
  .const-view.on .const-row { animation: none; }
}

/* ==================================================================
   v18 · 深空背景层 / 页脚移除 / 弹层堆叠 / 自适应弹窗 / 导入表单 / 分页 / HUD
   本段为最终覆盖层：统一放在文件末尾，覆盖历史同名规则。
   ================================================================== */

/* ---- 1. 背景图：按页面 + 星图视图档切换（纯 CSS，无新增 JS） ---- */
:root {
  --pf-bg: url("/static/bg/bg-deep.png");
  --pf-bg-dim: rgba(5, 8, 15, .46);
}
/* v20：星图三档 / 星系全景 / 星座工作台的底景全部由画布运行时生成，
   不再按档位挂静态图片，也就不会出现「几张 2D 图是同一张背景」的观感。
   用有效的 CSS gradient 顶替 url()，body 的 background 简写仍保持合法。 */
body.cosmos-body,
body.nebula-body:not(.brain-body)[data-pf-bg] {
  --pf-bg: linear-gradient(#05070d, #05070d);
  --pf-bg-dim: rgba(5, 8, 15, 0);
}
/* 大脑页同时带 nebula-body：保留既有星云底图（用户已确认效果无需改动） */
body.brain-body.nebula-body { --pf-bg: url("/static/bg/bg-nebula.png");
                              --pf-bg-dim: rgba(5, 8, 15, .52); }

body {
  background:
    linear-gradient(var(--pf-bg-dim), var(--pf-bg-dim)),
    var(--pf-bg) center center / cover no-repeat fixed,
    radial-gradient(120% 90% at 50% -20%, rgba(88, 116, 180, 0.10) 0%, transparent 68%),
    radial-gradient(100% 70% at 50% 110%, rgba(40, 84, 128, 0.06) 0%, transparent 72%),
    linear-gradient(180deg, #070b14 0%, #05070d 100%);
  background-attachment: fixed;
}
/* 图片自带星野，星尘伪元素降档，避免双层噪点 */
body::before { opacity: 0.06; }

/* v19：星系全景与四种 2D 星图改由画布运行时生成，不再使用静态底图。
   大脑页仍保留既有星云底图（用户确认大脑效果无需改动）。 */
body.cosmos-body { background: #05070d !important; }
body.nebula-body:not(.brain-body) { background: #05070d !important; }

/* ---- 2. 画布透明化：底图透出，粒子 / 连线仍由 WebGL·Canvas 绘制 ---- */
#starfield, #universe { background: transparent; }
.brain-app { background: transparent; }
.const-view {
  background:
    radial-gradient(ellipse 52% 62% at 18% 48%, rgba(230, 207, 152, 0.07), transparent 72%),
    radial-gradient(ellipse 42% 54% at 82% 48%, rgba(139, 140, 255, 0.05), transparent 72%),
    linear-gradient(180deg, #070a12 0%, #04060c 100%);
}

/* ---- 3. 页脚移除 + 弹层堆叠：main 不再生成层叠上下文 ---- */
footer { display: none; }
main { position: relative; }
main { z-index: auto; }
.topbar { z-index: 30; }

/* ---- 4. 待办详情：自适应弹窗，看板占满整行 ---- */
.pf-todo-detail-card { width: min(880px, 100%); max-height: min(88vh, 920px); }
/* 详情片段自带标题：弹窗头部只留右上关闭按钮，避免双标题与内容重叠 */
.pf-head-tools { min-height: 30px; padding-bottom: 0; margin-bottom: 4px; border-bottom: 0; }
.pf-workspace { grid-template-columns: minmax(0, 1fr); }
.pf-workspace .pf-side { position: static; }

/* ---- 5. 导入页：修掉 .note-form label 与 .pf-field 的冲突 ---- */
body .note-form .pf-field > label,
body .note-form .pf-field .pf-label {
  display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--fg);
}
body .note-form .pf-field > label span { display: inline; }
body .note-form label.pf-drop {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--fg); font-weight: 400;
}
body .note-form label.pf-drop b { font-size: 12.5px; font-weight: 600; }
body .note-form { max-width: none; }
@media (max-width: 1080px) {
  body .note-form .pf-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  body .note-form .pf-grid, body .note-form .pf-grid.three { grid-template-columns: 1fr; }
}

/* ---- 6. 分页控件 ---- */
.pf-pager { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0 4px; }
.pf-pager .pg-btn { min-height: 32px; padding: 5px 12px; font-size: 12px; }
.pf-pager .pg-btn[aria-disabled="true"] { opacity: .38; pointer-events: none; }
.pf-pager .pg-info { font: 600 11.5px var(--mono); color: var(--muted); letter-spacing: .04em; }
.pf-pager .pg-sep { width: 1px; height: 18px; background: var(--line); }

/* ---- 7. 内容页 HUD 密度 ---- */
.page-head h1 { letter-spacing: -.01em; }
.page-head .eyebrow { text-shadow: 0 0 14px color-mix(in srgb, var(--accent) 55%, transparent); }
body:not(.nebula-body) .page-head {
  padding: 6px 0 16px 14px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent 62%);
  border-radius: 0 0 14px 0;
}
.pf-hud-strip { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; margin: 0 0 18px; }
.pf-hud-cell { position: relative; min-width: 132px; flex: 1 1 132px; padding: 12px 16px;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: linear-gradient(150deg, rgba(20, 30, 50, .72), rgba(9, 14, 25, .78)); }
.pf-hud-cell::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, var(--accent), transparent); }
.pf-hud-cell b { display: block; font: 700 1.6rem/1.15 var(--mono); color: var(--fg);
  font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(108, 215, 239, .45); }
.pf-hud-cell span { display: block; margin-top: 5px; font: 600 10px/1.4 var(--mono);
  letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.pf-hud-cell .pf-bar { height: 3px; margin-top: 9px; border-radius: 2px; background: rgba(148, 170, 205, .14); }
.pf-hud-cell .pf-bar i { display: block; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent)); box-shadow: 0 0 10px var(--accent); }
.mem-card { border-left: 2px solid transparent; transition: border-color .18s, box-shadow .18s, transform .18s; }
.mem-card:hover, .mem-card.is-active { border-left-color: var(--accent);
  box-shadow: 0 8px 28px rgba(2, 5, 14, .5), inset 0 0 0 1px rgba(108, 215, 239, .14); }




/* ==================================================================
   v27 · 记忆星图深墨绿主题（只作用于星图页 .nebula-app，大脑页/全站不动）
   近黑墨绿底 + 薄荷绿强调 + 1px 细边玻璃卡 + 等宽小标签 + 大号数字。
   ================================================================== */
body.nebula-body:not(.brain-body) {
  background:
    radial-gradient(ellipse 110% 82% at 50% -18%, rgba(22, 96, 72, 0.22), transparent 62%),
    radial-gradient(ellipse 82% 64% at 88% 110%, rgba(14, 78, 58, 0.18), transparent 68%),
    #03100b !important;
}

.nebula-app {
  --accent: #6ee7b7;
  --accent-2: #2dd4bf;
  --accent-soft: rgba(110, 231, 183, 0.13);
  --fg: #e6f7ef;
  --muted: #9dbfb2;
  --faint: #6a8d81;
  --line: rgba(110, 231, 183, 0.14);
  --line-strong: rgba(110, 231, 183, 0.32);
  --panel: rgba(6, 21, 16, 0.72);
  --panel-2: rgba(9, 29, 22, 0.70);
  --gold: #e8d6a3;
  --warm: #f5c97b;
  background: #03100b;
}
.nebula-app #starfield { background: #03100b; }
.nebula-app .vignette {
  background: radial-gradient(ellipse 78% 78% at 50% 46%, transparent 40%, rgba(1, 8, 5, 0.66) 100%);
}

/* ---- 顶部 HUD：深墨绿渐隐条 + 细边胶囊 + 等宽大数字 ---- */
.nebula-app .hud-top {
  background: linear-gradient(180deg, rgba(3, 13, 10, 0.94) 0%, rgba(3, 13, 10, 0.66) 58%, transparent 100%);
}
.nebula-app .hud-brand b { color: #eafaf3; letter-spacing: 0.06em; }
.nebula-app .hud-brand small { color: #5f9e88; letter-spacing: 0.2em; }
.nebula-app .hud-stats { gap: 22px; }
.nebula-app .hud-stats .gh b {
  font: 600 19px/1 var(--mono); color: #d8fff0; letter-spacing: -0.01em;
  text-shadow: 0 0 16px rgba(110, 231, 183, 0.32);
}
.nebula-app .hud-stats .gh span {
  font: 600 9px/1.4 var(--mono); letter-spacing: 0.18em; color: #5f8f7e;
}
.nebula-app .hud-search input {
  background: rgba(5, 18, 14, 0.82);
  border: 1px solid rgba(110, 231, 183, 0.16);
  border-radius: 8px; color: #e6f7ef;
}
.nebula-app .hud-search input:focus {
  border-color: rgba(110, 231, 183, 0.45);
  box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.10);
}
.nebula-app .hud-qmeta { color: #5f8f7e; }
.nebula-app .hud-top select {
  background: rgba(5, 18, 14, 0.82); color: #c9e8dc;
  border: 1px solid rgba(110, 231, 183, 0.16); border-radius: 8px;
}
.nebula-app .btn-ghost, .nebula-app button.btn-ghost {
  background: rgba(8, 24, 19, 0.55);
  border: 1px solid rgba(110, 231, 183, 0.16);
  border-radius: 8px; color: #9dbfb2;
}
.nebula-app .btn-ghost:hover, .nebula-app button.btn-ghost:hover {
  color: #e6fff6; border-color: rgba(110, 231, 183, 0.38);
  background: rgba(110, 231, 183, 0.10);
}
.nebula-app .btn-ghost.on, .nebula-app button.btn-ghost.on {
  color: #04120d; background: linear-gradient(180deg, #8bf3c8, #4fd6a0);
  border-color: rgba(110, 231, 183, 0.55);
  box-shadow: 0 0 16px rgba(110, 231, 183, 0.24);
}

/* ---- 视图切换：四档细边胶囊，选中薄荷实底 ---- */
.nebula-app .hud-views {
  border: 1px solid rgba(110, 231, 183, 0.16); border-radius: 9px;
  background: rgba(4, 16, 12, 0.72); padding: 3px;
}
.nebula-app .hud-views button {
  border-radius: 6px; padding: 5px 12px;
  font: 600 0.78rem/1 var(--mono); letter-spacing: 0.02em; color: #7fa596;
}
.nebula-app .hud-views button:hover { color: #dcfff2; background: rgba(110, 231, 183, 0.10); }
.nebula-app .hud-views button.on {
  color: #04120d; background: linear-gradient(180deg, #8bf3c8, #4fd6a0);
  box-shadow: 0 0 14px rgba(110, 231, 183, 0.28);
}

/* ---- 左右面板：近黑玻璃 + 1px 薄荷细边 ---- */
.nebula-app .rail-card, .nebula-app .detail {
  background: linear-gradient(160deg, rgba(10, 30, 24, 0.74), rgba(4, 15, 11, 0.86));
  border: 1px solid rgba(110, 231, 183, 0.14);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(180, 255, 230, 0.05), 0 22px 48px -28px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(16px) saturate(1.12);
}
.nebula-app .f-title { color: #6fa493; letter-spacing: 0.18em; }
.nebula-app .f-title i { color: #6ee7b7; }
.nebula-app .rail-total b {
  font: 700 1.95rem/1 var(--mono); letter-spacing: -0.02em;
  background: linear-gradient(180deg, #eafff6, #5be3b0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nebula-app .rail-total span { color: #5f8f7e; letter-spacing: 0.16em; }
.nebula-app .rail-note, .nebula-app .rail-hint { color: #6a8d81; }
.nebula-app .rail-note b { color: #6ee7b7; }
.nebula-app .rail-hint kbd {
  border-color: rgba(110, 231, 183, 0.18); color: #9dbfb2;
  background: rgba(110, 231, 183, 0.05);
}
.nebula-app .dist-row { color: #8fb3a8; }
.nebula-app .dist-row b { color: #e4fff5; }
.nebula-app .dist-bar { background: rgba(110, 231, 183, 0.08); }
.nebula-app .fchip {
  border-radius: 5px; background: rgba(110, 231, 183, 0.04);
  border-color: rgba(110, 231, 183, 0.14);
}
.nebula-app .fchip.on {
  background: rgba(110, 231, 183, 0.14);
  border-color: rgba(110, 231, 183, 0.42); color: #d9fff0;
}

/* ---- 详情 / 浮层 / 小地图 ---- */
.nebula-app .d-meta { border-color: rgba(110, 231, 183, 0.12); }
.nebula-app .d-nbr {
  background: rgba(110, 231, 183, 0.03);
  border-color: rgba(110, 231, 183, 0.14); border-radius: 6px;
}
.nebula-app .d-nbr:hover {
  background: rgba(110, 231, 183, 0.09);
  border-color: rgba(110, 231, 183, 0.30);
}
.nebula-app .detail-empty .orb {
  background: radial-gradient(circle at 38% 34%, #f2fff8, #6ee7b7 30%,
              rgba(110, 231, 183, 0.18) 68%, transparent 72%);
  box-shadow: 0 0 34px rgba(110, 231, 183, 0.32);
}
.nebula-app .minimap-wrap {
  background: rgba(4, 15, 11, 0.86);
  border-color: rgba(110, 231, 183, 0.16); border-radius: 8px;
}
.nebula-app .mini-label { color: #5f8f7e; }
.nebula-app .view-badge { color: #5f8f7e; letter-spacing: 0.12em; }
.nebula-app .view-badge b { color: #6ee7b7; }
.nebula-app #hover-tip, .nebula-app .hits {
  background: rgba(4, 16, 12, 0.96);
  border-color: rgba(110, 231, 183, 0.22);
}
.nebula-app .hit:hover, .nebula-app .hit.active { background: rgba(110, 231, 183, 0.09); }
.nebula-app #help {
  background: rgba(4, 16, 12, 0.98);
  border-color: rgba(110, 231, 183, 0.24);
}
.nebula-app #graph-loading { background: rgba(3, 12, 9, 0.9); }
.nebula-app .boot-bar i { background: linear-gradient(90deg, #6ee7b7, #2dd4bf, #f5c97b); }

/* ---- 宽屏：左右栏略放宽，详情正文更好读 ---- */
@media (min-width: 1600px) {
  .nebula-app .rail { width: 260px; }
  .nebula-app .detail { width: 360px; }
  .nebula-app .minimap-wrap { right: 392px; }
  .nebula-app .view-badge { left: 292px; }
}

/* ==================================================================
   v28 · 全站深墨绿主题（与记忆星图 / 大脑 / 星系全景统一）
   只覆盖 token 与基础组件；节点类型色（--c-*）保持不变。
   ================================================================== */
:root {
  --bg: #03100b;
  --bg-2: #061a13;
  --panel: rgba(6, 21, 16, 0.84);
  --panel-2: rgba(9, 29, 22, 0.78);
  --panel-solid: #061a13;
  --line: rgba(110, 231, 183, 0.14);
  --line-strong: rgba(110, 231, 183, 0.30);
  --fg: #e6f7ef;
  --muted: #9dbfb2;
  --faint: #6a8d81;
  --accent: #6ee7b7;
  --accent-2: #2dd4bf;
  --accent-soft: rgba(110, 231, 183, 0.13);
  --warm: #f5c97b;
  --gold: #e8d6a3;
  --v9-brand-soft: rgba(110, 231, 183, 0.14);
  --pf-bg-dim: rgba(1, 8, 5, 0.46);
}
body {
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(22, 96, 72, 0.16) 0%, transparent 68%),
    radial-gradient(100% 70% at 50% 110%, rgba(14, 78, 58, 0.10) 0%, transparent 72%),
    linear-gradient(180deg, #03100b 0%, #020b07 100%);
  background-attachment: fixed;
}
.topbar {
  background: linear-gradient(160deg, rgba(8, 28, 22, 0.92), rgba(3, 14, 10, 0.88));
  box-shadow: inset 0 1px 0 rgba(180, 255, 230, 0.05), 0 18px 44px -24px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(16px) saturate(1.15);
}
.topbar nav a.on { color: #eafff6; }
button, .btn {
  background: linear-gradient(180deg, #8bf3c8, #4fd6a0);
  color: #04120d;
}
button:hover, .btn:hover { box-shadow: 0 6px 18px rgba(110, 231, 183, 0.18); }
.btn-ghost, button.btn-ghost {
  background: rgba(8, 24, 19, 0.60);
  border-color: var(--line);
  color: var(--muted);
}
.btn-ghost:hover, button.btn-ghost:hover {
  background: rgba(110, 231, 183, 0.10);
  border-color: var(--line-strong);
  color: #eafff6;
}
.btn-ghost.on, button.btn-ghost.on {
  color: #d9fff0;
  background: rgba(110, 231, 183, 0.16);
  border-color: rgba(110, 231, 183, 0.42);
  box-shadow: inset 0 0 12px rgba(110, 231, 183, 0.08);
}
input, select, textarea { background: rgba(5, 18, 14, 0.82); }
input::placeholder, textarea::placeholder { color: #6a8d81; }
.panel, .pf-card, .stat-card, .kpi-card, .mem-card, .todo-card, .persona-card {
  background: linear-gradient(160deg, rgba(10, 30, 24, 0.74), rgba(4, 15, 11, 0.86));
  border-color: rgba(110, 231, 183, 0.14);
}
.pf-hero {
  background: linear-gradient(160deg, rgba(10, 30, 24, 0.94), rgba(4, 15, 11, 0.96) 58%,
              rgba(8, 26, 20, 0.94));
  box-shadow: inset 0 1px 0 rgba(180, 255, 230, 0.05), 0 24px 60px -24px rgba(0, 0, 0, 0.7);
}
.pf-modal { background: rgba(1, 8, 5, 0.66); }
.pf-modal-card {
  background: linear-gradient(160deg, rgba(10, 30, 24, 0.97), rgba(4, 15, 11, 0.98));
}
.login-card {
  background: linear-gradient(160deg, rgba(10, 30, 24, 0.92), rgba(4, 15, 11, 0.95));
}
.hits, #hover-tip { background: rgba(4, 16, 12, 0.96); }
.pf-table th { color: #8fb3a8; }
.pf-table tr:hover td { background: rgba(110, 231, 183, 0.05); }

/* v28 补充：v10 组件 token 与页头主按钮/眉标 */
:root {
  --v10-surface: #061a13;
  --v10-surface-2: #0a241b;
  --v10-surface-3: #0f3025;
  --v10-line: rgba(110, 231, 183, 0.16);
  --v10-line-2: rgba(110, 231, 183, 0.32);
  --v10-brand: #2dd4bf;
  --v10-action: #6ee7b7;
}
.page-head .eyebrow {
  background: rgba(110, 231, 183, 0.10);
  border-color: rgba(110, 231, 183, 0.22);
  color: #9df3d3;
}
.head-actions .btn-primary, .head-actions button.pf-primary {
  background: linear-gradient(135deg, #8bf3c8, #4fd6a0);
  color: #04120d;
  box-shadow: 0 8px 26px rgba(110, 231, 183, 0.20);
}
.head-actions .btn-primary:hover { box-shadow: 0 12px 32px rgba(110, 231, 183, 0.30); }
.pf-tag.info {
  background: rgba(110, 231, 183, 0.12);
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.28);
}

/* v28 补充 2：代码片 / 字号切换 / 分段控件 */
code {
  color: #9df3d3;
  background: rgba(110, 231, 183, 0.08);
  border-color: rgba(110, 231, 183, 0.14);
}
.fs-switch button.on { background: rgba(110, 231, 183, 0.18); color: #eafff6; }

/* v28 补充 3：HUD 指标卡与 KPI 行 */
.pf-hud-cell {
  background: linear-gradient(150deg, rgba(10, 30, 24, 0.72), rgba(4, 15, 11, 0.78));
  border-color: rgba(110, 231, 183, 0.14);
}
.pf-hud-cell b { color: #eafff6; text-shadow: 0 0 18px rgba(110, 231, 183, 0.40); }
.pf-hud-cell .pf-bar { background: rgba(110, 231, 183, 0.12); }
.pf-hud-cell .pf-bar i { background: linear-gradient(90deg, #2dd4bf, #6ee7b7); box-shadow: 0 0 10px #6ee7b7; }
.kpi-row {
  background: linear-gradient(160deg, rgba(10, 30, 24, 0.85), rgba(4, 15, 11, 0.90));
}

/* v29 · 记忆节律热力图 / 关系能量 / 导航分隔 */
.nav-sep { width: 1px; height: 16px; background: var(--line); margin: 0 6px; flex: none; align-self: center; }
.activity-panel { margin-bottom: 22px; }
.heat-wrap { overflow-x: auto; padding-bottom: 2px; }
.heat { display: grid; grid-template-columns: 38px repeat(24, minmax(0, 1fr)); gap: 3px;
        align-items: center; min-width: 560px; }
.heat-hour { font: 9px/1.4 var(--mono); color: var(--faint); text-align: center; }
.heat-day { font: 10px/1.4 var(--mono); color: var(--faint); white-space: nowrap; }
.heat-cell { display: block; aspect-ratio: 1 / 1; border-radius: 3px;
             background: rgba(110, 231, 183, 0.05); transition: background 0.2s var(--ease); }
.heat-cell:hover { outline: 1px solid rgba(110, 231, 183, 0.5); }
.heat-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.heat-legend { display: inline-flex; align-items: center; gap: 4px;
               font: 10px/1 var(--mono); color: var(--faint); }
.heat-legend i { width: 11px; height: 11px; border-radius: 3px; background: rgba(110, 231, 183, 0.12); }
.heat-legend .lv2 { background: rgba(110, 231, 183, 0.28); }
.heat-legend .lv3 { background: rgba(110, 231, 183, 0.50); }
.heat-legend .lv4 { background: rgba(110, 231, 183, 0.82); }
.rel-meter { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-style: normal; }
.rel-num { font: 700 0.95rem/1 var(--mono); color: var(--accent); min-width: 34px; }
.rel-bar { flex: 1; height: 4px; border-radius: 3px; background: rgba(110, 231, 183, 0.10); overflow: hidden; }
.rel-bar i { display: block; height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, #2dd4bf, #6ee7b7);
  box-shadow: 0 0 8px rgba(110, 231, 183, 0.5); transition: width 0.6s var(--ease); }

/* v30 · 记忆质量表 */
.quality-panel { margin-bottom: 22px; }
.table-wrap { overflow-x: auto; }
.quality-table { width: 100%; }
.quality-table th { cursor: pointer; user-select: none; white-space: nowrap; }
.quality-table th.on { color: var(--accent); }
.quality-table th.on[data-dir="desc"]::after { content: " ↓"; }
.quality-table th.on[data-dir="asc"]::after { content: " ↑"; }
.quality-table td.num, .quality-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.quality-table .q-title { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quality-table .q-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 6px var(--c); margin-right: 6px; vertical-align: 1px; }
.quality-table .q-conf { color: #ff8fa3; font-weight: 600; }

/* v31 · 使用指南 */
.topbar-help { width: 26px; height: 26px; display: grid; place-items: center; flex: none;
  border-radius: 50%; border: 1px solid var(--line); color: var(--muted);
  font: 700 12px/1 var(--mono); text-decoration: none; }
.topbar-help:hover { color: #04120d; background: var(--accent); border-color: var(--accent); }
.guide { max-width: 1180px; margin: 0 auto; padding: 8px 0 40px; }
.guide-progress { height: 2px; background: rgba(110, 231, 183, 0.10); border-radius: 2px;
  margin: 4px 0 22px; overflow: hidden; }
.guide-progress i { display: block; height: 100%; width: 20%;
  background: linear-gradient(90deg, #2dd4bf, #6ee7b7);
  box-shadow: 0 0 10px rgba(110, 231, 183, 0.6); transition: width 0.35s var(--ease); }
.guide-stage { position: relative; min-height: 440px; }
.guide-slide { display: none; grid-template-columns: 170px minmax(0, 1fr); gap: 40px; padding: 26px 0 12px; }
.guide-slide.on { display: grid; animation: guide-in 0.42s var(--ease) both; }
@keyframes guide-in { from { opacity: 0; transform: translateY(10px); } }
.guide-num { font: 700 clamp(3.2rem, 7vw, 5.4rem)/1 var(--mono); letter-spacing: -0.04em;
  background: linear-gradient(180deg, #eafff6, #2dd4bf);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.guide-kicker { font: 600 10px/1.6 var(--mono); letter-spacing: 0.28em; color: #5f8f7e; }
.guide-title { margin: 10px 0 14px; font-size: clamp(1.55rem, 3vw, 2.3rem); line-height: 1.3; color: #eafff6; }
.guide-title em { font-style: normal; color: #6ee7b7; }
.guide-lead { max-width: 760px; margin: 0 0 26px; color: #9dbfb2; font-size: 0.98rem; line-height: 1.8; }
.guide-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.guide-card { border: 1px solid rgba(110, 231, 183, 0.14); border-radius: 10px; padding: 14px 16px;
  background: linear-gradient(160deg, rgba(10, 30, 24, 0.70), rgba(4, 15, 11, 0.82)); }
.guide-card i { display: inline-block; width: 22px; height: 22px; margin-bottom: 8px; border-radius: 6px;
  background: rgba(110, 231, 183, 0.10); color: #6ee7b7; text-align: center;
  font: 700 11px/22px var(--mono); font-style: normal; }
.guide-card b { display: block; margin-bottom: 6px; color: #eafff6; font-size: 0.92rem; }
.guide-card span { color: #8fb3a8; font-size: 0.8rem; line-height: 1.6; }
.guide-cta { margin-top: 20px; }
.guide-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 26px; padding-top: 16px; border-top: 1px solid rgba(110, 231, 183, 0.10); }
.guide-dots { display: flex; gap: 8px; }
.guide-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(110, 231, 183, 0.20); box-shadow: none; cursor: pointer; }
.guide-dots button:hover { transform: none; filter: none; box-shadow: none; background: rgba(110, 231, 183, 0.45); }
.guide-dots button.on { background: #6ee7b7; box-shadow: 0 0 10px rgba(110, 231, 183, 0.7); }
@media (max-width: 760px) {
  .guide-slide { grid-template-columns: 1fr; gap: 10px; padding-top: 10px; }
  .guide-cards { grid-template-columns: 1fr; }
  .guide-num { font-size: 2.6rem; }
}

/* v31 修正：指南圆点不被 flex 拉伸 */
.guide-dots { align-items: center; }
.guide-dots button { flex: none; align-self: center; }

/* v32 · 自动整理时间线 */
.organize-panel { margin-bottom: 22px; }
.org-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.org-list li { display: grid; grid-template-columns: 8px 66px 120px minmax(0, 1fr); gap: 10px;
  align-items: center; padding: 7px 4px; border-bottom: 1px solid rgba(110, 231, 183, 0.07);
  font-size: 0.82rem; }
.org-list li:last-child { border-bottom: 0; }
.org-list i { width: 7px; height: 7px; border-radius: 50%;
  background: var(--k, #6ee7b7); box-shadow: 0 0 8px var(--k, #6ee7b7); }
.org-list time { font: 500 10.5px/1.4 var(--mono); color: var(--faint); white-space: nowrap; }
.org-list b { font-weight: 600; color: #eafff6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-list span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-list .org-empty { display: block; color: var(--faint); border: 0; padding: 8px 4px; }


/* v33 · 仪表盘信息密度 / 页内导航不再固定 */
.insight-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 22px; align-items: stretch; margin-bottom: 22px; }
.insight-grid .activity-panel, .insight-grid .quality-panel { margin-bottom: 0; }
/* v34 · 左右两栏等高：节律面板纵向撑满，图例贴底，热力图格子保持正方形随宽度放大 */
.insight-grid > .panel { display: flex; flex-direction: column; }
.insight-grid .heat-wrap { flex: 1; display: flex; align-items: center; }
.insight-grid .heat { width: 100%; }
.insight-grid .heat-foot { margin-top: auto; }
.heat { min-width: 520px; }
.heat-cell { height: auto; aspect-ratio: 1 / 1; }
.quality-table .q-title { max-width: 260px; }
.persona-panel { margin-bottom: 22px; }
.persona-panel .card-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid.g-dashboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px; align-items: stretch; margin-bottom: 22px; }
/* v34 · 底栏三卡等高：空态撑满剩余高度并居中，避免内容和边框错位 */
.grid.g-dashboard > .panel { display: flex; flex-direction: column; }
.grid.g-dashboard > .panel > .pf-empty { flex: 1; }
.pf-anchors { position: static; margin-bottom: 18px; }
@media (max-width: 1180px) {
  .insight-grid { grid-template-columns: 1fr; }
  .grid.g-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .grid.g-dashboard { grid-template-columns: 1fr; }
}
