/* ============================================================
   AUTOSAR Architecture Atlas 2.0 — Precision Glass 精密玻璃
   UI 升级方案（CSS 全量视觉升级 · 2026-08-12）
   - 保留全部类名 / 状态类 / 响应式断点（app.js 依赖不变）
   - 升级：四层玻璃纵深 · 精密圆角 · 统一动效 · 可读性
   - 备份：styles.css.bak-20260812
   ============================================================ */
:root {
    /* —— 背景 / 面板层级（四层纵深）—— */
    --bg-page: #070b12;                 /* 最深背景（原 090d14） */
    --bg-panel: rgba(18, 27, 44, .72);  /* 面板玻璃底 */
    --bg-panel-solid: #121b2c;          /* blur 降级实底 */
    --bg-float: rgba(24, 35, 56, .55);  /* 浮层玻璃底 */
    --bg-secondary: rgba(148, 178, 255, .06);
    --bg-hover: rgba(148, 178, 255, .10);
    --bg-input: rgba(148, 178, 255, .05);

    /* —— 文字层级 —— */
    --ink: #f2f6ff;                     /* 主标题（原 e8ecf4） */
    --text-primary: #f2f6ff;
    --text-secondary: #c6d0e3;
    --text-muted: #93a1ba;
    --text-faint: #5d6b85;              /* 装饰弱化（≥3:1 仅大字号） */

    /* —— 边框 / 发光 —— */
    --border-subtle: rgba(148, 178, 255, .14);
    --border-active: #6ea4ff;
    --line-highlight: rgba(148, 178, 255, .28);
    --glow-blue: rgba(96, 152, 255, .55);
    --glow-teal: rgba(70, 220, 200, .45);
    --glow-amber: rgba(255, 196, 110, .45);

    /* —— 语义色（升级明度） —— */
    --color-module: #6ea4ff;            /* 原 78a7ff */
    --color-api: #4cd9c4;               /* 原 61d7c4 */
    --color-concept: #ffc46e;           /* 原 f5b85c */
    --color-flow: #ffb35c;              /* 原 f5b85c */
    --edge-depends: #6ea4ff;
    --edge-schedules: #b39cff;
    --edge-special: #ff9d80;
    --edge-callbacks: #8a99b5;
    --edge-exposes: #4cd9c4;
    --edge-calls: #ffc46e;
    --color-error: #ff7d87;
    --color-success: #4cd9c4;
    --color-focus: #ffc46e;

    /* —— 圆角令牌 —— */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-xl: 24px;

    /* —— 动效令牌 —— */
    --t-fast: 140ms;
    --t-med: 260ms;
    --t-slow: 520ms;
    --e-out: cubic-bezier(.16, 1, .3, 1);
    --e-in: cubic-bezier(.65, 0, .35, 1);
    --e-spring: cubic-bezier(.34, 1.56, .64, 1);

    --font-display: "Noto Sans SC", "Microsoft YaHei UI", sans-serif;
    --font-ui: "Noto Sans SC", "Microsoft YaHei", sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Mono", "Consolas", monospace;
    --topbar-height: 60px;
    --footer-height: 22px;
    --drawer-width: 320px;
    --shadow-lg: 0 16px 42px rgba(0, 0, 0, .45);
    --shadow-float: 0 14px 34px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .05);
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    color: var(--text-primary);
    background: var(--bg-page);
    font: 15px/1.6 var(--font-ui);                 /* 正文 14→15px */
    -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: var(--color-api); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, #graph:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(110, 164, 255, .55);  /* 发光焦点环 */
    border-radius: 4px;
}

.skip-link {
    position: fixed;
    top: -80px;
    left: 16px;
    z-index: 1000;
    padding: 8px 12px;
    color: var(--bg-page);
    background: var(--color-module);
    border-radius: var(--r-sm);
}
.skip-link:focus { top: 12px; }

.app-shell { display: grid; grid-template-rows: var(--topbar-height) 1fr var(--footer-height); height: 100%; }

/* ================= 顶栏（玻璃化） ================= */
.topbar {
    position: relative;
    z-index: 50;
    display: grid;
    grid-template-columns: minmax(235px, 0.7fr) minmax(320px, 1.2fr) minmax(255px, 0.7fr);
    align-items: center;
    gap: 24px;
    padding: 0 22px;
    background: rgba(18, 27, 44, .72);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    border-bottom: 1px solid var(--border-subtle);
}

.brand-block { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand-index {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    color: #fff;
    background: linear-gradient(135deg, #3d6fd8, #6ea4ff 60%, #4cd9c4);   /* 品牌印记：渐变+切角唯一保留 */
    clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
    font: 700 11px var(--font-mono);
    letter-spacing: -.03em;
    box-shadow: 0 0 18px rgba(110, 164, 255, .45);
}
.eyebrow { color: var(--text-muted); font: 700 9.5px var(--font-mono); letter-spacing: .15em; }
.brand-block h1 { font: 800 20px/1 var(--font-display); letter-spacing: .005em; }

.search-block { position: relative; min-width: 0; }
.search-block > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.search-field {
    display: flex;
    align-items: center;
    height: 42px;
    padding: 0 12px;
    background: var(--bg-input);
    border: 1px solid rgba(110, 164, 255, .28);
    border-radius: var(--r-md);
    box-shadow: inset 0 0 18px rgba(110, 164, 255, .08);
    transition: border-color var(--t-med) var(--e-out), box-shadow var(--t-med) var(--e-out), transform var(--t-fast) var(--e-out);
}
.search-field:focus-within {
    border-color: var(--border-active);
    box-shadow: 0 0 0 3px rgba(110, 164, 255, .14), inset 0 0 18px rgba(110, 164, 255, .10);
    transform: translateY(-1px);
}
.search-field svg { width: 17px; height: 17px; margin-right: 9px; fill: none; stroke: var(--text-secondary); stroke-width: 1.8; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--text-primary); background: transparent; }
.search-field input::placeholder { color: var(--text-muted); }
kbd {
    min-width: max-content;
    padding: 2px 8px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--line-highlight);
    border-radius: var(--r-sm);
    font: 11px var(--font-mono);
    white-space: nowrap;
}

.topbar-stats { display: flex; align-items: center; justify-content: flex-end; gap: 18px; color: var(--text-secondary); font-size: 11px; }
.topbar-stats div { display: flex; align-items: baseline; gap: 5px; }
.topbar-stats strong { color: var(--ink); font: 700 18px var(--font-mono); }
.status-dot { display: flex; align-items: center; gap: 6px; }
.status-dot i { width: 7px; height: 7px; background: var(--color-success); border-radius: 50%; box-shadow: 0 0 8px var(--glow-teal); }

.workspace, .graph-stage { min-width: 0; min-height: 0; }
.workspace { position: relative; overflow: hidden; }

/* ================= 画布（精密网格 + 光晕） ================= */
.graph-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    isolation: isolate;
    background-color: var(--bg-page);
    background-image:
        linear-gradient(rgba(148, 178, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 178, 255, .035) 1px, transparent 1px),
        radial-gradient(1200px 700px at 78% -10%, rgba(78, 130, 255, .16), transparent 60%),
        radial-gradient(900px 600px at -8% 108%, rgba(70, 217, 196, .10), transparent 55%);
    background-size: 44px 44px, 44px 44px, auto, auto;
    transition: background-image 360ms ease;
}
.graph-stage::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    content: "";
    opacity: .16;
    pointer-events: none;
    background-image: linear-gradient(90deg, transparent 0, rgba(110, 164, 255, .05) 50%, transparent 100%);
}

#graph { position: absolute; inset: 0; z-index: 2; cursor: grab; }
#graph:active { cursor: grabbing; }

/* ================= 架构泳道 ================= */
.architecture-strip {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    pointer-events: none;
    opacity: 0;
    transition: opacity 240ms ease;
}
.architecture-strip span {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 7px;
    padding: 0 12px 44px;
    color: rgba(242, 246, 255, .38);
    border-right: 1px solid rgba(148, 178, 255, .08);
    font: 700 9.5px var(--font-mono);
    letter-spacing: .08em;
}
.architecture-strip span::after { content: ""; position: absolute; inset: 0; background: rgba(148, 178, 255, .02); }
.architecture-strip span:nth-child(even)::after { background: rgba(110, 164, 255, .03); }
.architecture-strip span:last-child { border-right: 0; }
.architecture-strip b { color: var(--color-module); font-size: 15px; letter-spacing: -.04em; }

/* ================= 行星轨道（呼吸 + 自转） ================= */
.orbit-backdrop {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 320ms ease;
}
.orbit-system {
    position: absolute;
    top: 0;
    left: 0;
    width: 2700px;
    height: 1800px;
    transform-origin: 0 0;
}
.orbit-ring {
    position: absolute;
    top: 820px;
    left: 1200px;
    border: 1px solid rgba(110, 164, 255, .22);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: orbit-breathe 7s ease-in-out infinite;
}
/* 自转虚线层：独立 ::after，不干扰 JS 控制的 transform */
.orbit-ring::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px dashed rgba(148, 178, 255, .10);
    animation: orbit-spin 46s linear infinite;
    pointer-events: none;
}
.orbit-ring::before {
    position: absolute;
    top: 50%;
    left: -3px;
    width: 5px;
    height: 5px;
    content: "";
    background: var(--bg-page);
    border: 1px solid rgba(110, 164, 255, .55);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.orbit-ring b {
    position: absolute;
    top: -8px;
    left: 50%;
    padding: 2px 8px;
    color: rgba(198, 208, 227, .8);
    background: rgba(10, 15, 26, .9);
    border: 1px solid rgba(110, 164, 255, .16);
    border-radius: var(--r-sm);
    font: 700 11px var(--font-mono);
    letter-spacing: .12em;
    white-space: nowrap;
    transform: translateX(-50%);
}
.orbit-ring-mcal { width: 760px; height: 560px; border-color: rgba(112, 214, 163, .35); }
.orbit-ring-abstraction { width: 1300px; height: 900px; border-style: dashed; }
.orbit-ring-services { width: 1840px; height: 1240px; border-color: rgba(110, 164, 255, .30); }
.orbit-ring-rte { width: 2480px; height: 1600px; border-style: dashed; border-color: rgba(179, 156, 255, .28); }
.orbit-ring-application { width: 3060px; height: 1920px; border-color: rgba(255, 157, 128, .30); }
.orbit-core-glow {
    position: absolute;
    top: 820px;
    left: 1200px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255, 157, 128, .26) 0, rgba(255, 157, 128, .10) 34%, transparent 72%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: orbit-core-pulse 4s ease-in-out infinite;
}
@keyframes orbit-breathe {
    0%, 100% { opacity: .5; }
    50% { opacity: .92; }
}
@keyframes orbit-core-pulse {
    0%, 100% { opacity: .7; transform: translate(-50%, -50%) scale(.94); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}
@keyframes orbit-spin {
    to { transform: rotate(360deg); }
}

/* 布局模式背景（叠加精密网格保留） */
.graph-stage.orbit-mode {
    background-image:
        radial-gradient(circle at 50% 50%, rgba(255, 157, 128, .075), transparent 17%),
        linear-gradient(rgba(148, 178, 255, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 178, 255, .03) 1px, transparent 1px),
        radial-gradient(ellipse 80% 54% at 18% -10%, rgba(110, 164, 255, .22), transparent 56%),
        radial-gradient(ellipse 58% 42% at 92% 6%, rgba(255, 157, 128, .12), transparent 54%),
        radial-gradient(ellipse 58% 40% at 50% 108%, rgba(110, 164, 255, .09), transparent 50%);
    background-size: auto, 44px 44px, 44px 44px, auto, auto, auto;
}
.graph-stage.orbit-mode .architecture-strip { opacity: 0; }
.graph-stage.orbit-mode .orbit-backdrop { opacity: 1; }
.graph-stage.orbit-mode .orbit-ring { opacity: .6; }
.graph-stage.orbit-mode .orbit-core-glow { opacity: .85; }

.graph-stage.semantic-mode {
    background-image:
        linear-gradient(90deg, rgba(110, 164, 255, .09), transparent 20%, transparent 80%, rgba(76, 217, 196, .06)),
        linear-gradient(rgba(148, 178, 255, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 178, 255, .03) 1px, transparent 1px),
        radial-gradient(ellipse 70% 60% at 14% 12%, rgba(110, 164, 255, .18), transparent 58%),
        radial-gradient(ellipse 56% 44% at 90% 86%, rgba(255, 157, 128, .09), transparent 58%);
    background-size: auto, 44px 44px, 44px 44px, auto, auto;
}
.graph-stage.semantic-mode .architecture-strip { opacity: 1; }
.graph-stage.semantic-mode .architecture-strip span {
    background: linear-gradient(180deg, transparent 12%, rgba(110, 164, 255, .03) 100%);
}

.graph-stage.cose-mode {
    background-image:
        linear-gradient(rgba(148, 178, 255, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 178, 255, .03) 1px, transparent 1px),
        radial-gradient(circle at 28% 34%, rgba(110, 164, 255, .20), transparent 28%),
        radial-gradient(circle at 73% 62%, rgba(76, 217, 196, .12), transparent 24%),
        radial-gradient(circle at 66% 18%, rgba(255, 157, 128, .09), transparent 20%);
    background-size: 44px 44px, 44px 44px, auto, auto, auto;
}

.graph-stage.breadthfirst-mode {
    background-image:
        linear-gradient(180deg, rgba(110, 164, 255, .15), transparent 24%, transparent 78%, rgba(76, 217, 196, .06)),
        linear-gradient(rgba(148, 178, 255, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 178, 255, .03) 1px, transparent 1px),
        radial-gradient(ellipse 66% 36% at 50% 0%, rgba(110, 164, 255, .16), transparent 62%);
    background-size: auto, 44px 44px, 44px 44px, auto;
}

.graph-stage.concentric-mode {
    background-image:
        radial-gradient(circle at 50% 50%, rgba(255, 157, 128, .12), transparent 15%),
        radial-gradient(circle at 50% 50%, transparent 24%, rgba(110, 164, 255, .10) 25%, transparent 26%),
        radial-gradient(circle at 50% 50%, transparent 45%, rgba(76, 217, 196, .06) 46%, transparent 47%),
        linear-gradient(rgba(148, 178, 255, .03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 178, 255, .03) 1px, transparent 1px),
        radial-gradient(ellipse 82% 62% at 50% 50%, rgba(110, 164, 255, .08), transparent 68%);
    background-size: auto, auto, auto, 44px 44px, 44px 44px, auto;
}

/* ================= 工具轨（玻璃胶囊化） ================= */
.tool-rail {
    position: absolute;
    top: 22px;
    left: 18px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    width: 56px;
    padding: 6px;
    gap: 4px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.rail-button {
    display: grid;
    place-items: center;
    gap: 2px;
    min-height: 48px;
    padding: 5px 2px;
    border: 0;
    border-radius: var(--r-md);
    color: var(--text-secondary);
    background: transparent;
    transition: color var(--t-fast) var(--e-out), background var(--t-fast) var(--e-out), transform var(--t-fast) var(--e-out);
}
.rail-button:hover { color: var(--text-primary); background: var(--bg-hover); transform: translateX(1px); }
.rail-button.is-active {
    color: var(--text-primary);
    background: rgba(110, 164, 255, .16);
    box-shadow: inset 3px 0 var(--color-focus), 0 0 12px rgba(110, 164, 255, .15);
}
.rail-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.rail-button span { font-size: 9.5px; }
.rail-button b { font: 500 21px var(--font-mono); }
.rail-compact { min-height: 34px; }

/* ================= 抽屉面板（玻璃） ================= */
.control-panel, .details-panel {
    position: absolute;
    z-index: 30;
    top: 22px;
    bottom: 22px;
    width: var(--drawer-width);
    overflow-y: auto;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-float);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    transition: transform var(--t-med) var(--e-out), opacity var(--t-med) var(--e-out);
}
.control-panel { left: 84px; padding: 18px; transform: translateX(calc(-100% - 110px)); opacity: 0; pointer-events: none; }
.control-panel.is-open { transform: translateX(0); opacity: 1; pointer-events: auto; }
.details-panel { right: 18px; padding: 18px; transform: translateX(calc(100% + 24px)); opacity: 0; pointer-events: none; }
.details-panel.is-open { transform: translateX(0); opacity: 1; pointer-events: auto; }

.drawer-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(110, 164, 255, .35);
}
.drawer-heading h2 { font: 800 25px/1.1 var(--font-display); }
.section-kicker { margin-bottom: 4px; color: var(--color-module); font: 700 9.5px var(--font-mono); letter-spacing: .14em; }
.drawer-close {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-sm);
    color: var(--text-secondary);
    background: transparent;
    font-size: 21px;
    line-height: 1;
    transition: all var(--t-fast) var(--e-out);
}
.drawer-close:hover { color: var(--bg-page); background: var(--color-module); border-color: var(--color-module); box-shadow: 0 0 14px var(--glow-blue); }

.panel-section { padding: 16px 0; border-bottom: 1px solid var(--border-subtle); }
.panel-section:last-child { border-bottom: 0; }
.intro-section { color: var(--text-secondary); font-size: 13.5px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; }
.panel-section h3 { margin-bottom: 11px; color: var(--ink); font: 700 12px var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.section-heading h3 { margin-bottom: 0; }
.text-button { border: 0; color: var(--color-api); background: transparent; font-size: 11.5px; }
.text-button:hover { text-decoration: underline; }

/* 筛选行（微交互升级） */
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 12px; }
.filter-row {
    display: flex;
    align-items: center;
    min-height: 34px;
    gap: 8px;
    padding: 5px 7px;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all var(--t-fast) var(--e-out);
}
.filter-row:hover { border-color: var(--line-highlight); color: var(--ink); background: var(--bg-hover); }
.filter-row input { width: 15px; height: 15px; accent-color: var(--color-module); }
.filter-row small { margin-left: auto; color: var(--text-muted); font: 9.5px var(--font-mono); }
.select-field { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-top: 10px; color: var(--text-muted); font: 9.5px var(--font-mono); text-transform: uppercase; }
.select-field select {
    min-width: 154px;
    height: 34px;
    padding: 0 8px;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-sm);
}
.filter-swatch { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 6px currentColor; }
.filter-swatch.module { background: var(--color-module); color: var(--color-module); }
.filter-swatch.api { background: var(--color-api); color: var(--color-api); }
.filter-swatch.concept { background: var(--color-concept); transform: rotate(45deg); border-radius: 1px; color: var(--color-concept); }
.filter-swatch.flow { background: var(--color-flow); color: var(--color-flow); }
.edge-swatch { width: 18px; border-top: 2px solid; }
.edge-swatch.depends { border-color: var(--edge-depends); }
.edge-swatch.schedules { border-color: var(--edge-schedules); border-top-style: double; }
.edge-swatch.special { border-color: var(--edge-special); border-top-style: dashed; }
.edge-swatch.callbacks { border-color: var(--edge-callbacks); border-top-style: dotted; }
.edge-swatch.exposes { border-color: var(--edge-exposes); border-top-style: dashed; }
.edge-swatch.calls { border-color: var(--edge-calls); }

.full-width { width: 100%; }
/* 按钮（渐变 + 光晕 + 微交互） */
.primary-button, .secondary-button {
    min-height: 38px;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border-active);
    border-radius: var(--r-md);
    font-weight: 700;
    transition: all var(--t-fast) var(--e-out);
}
.primary-button {
    color: #fff;
    background: linear-gradient(135deg, #4d7fe0, #6ea4ff);
    border-color: transparent;
    box-shadow: 0 6px 20px rgba(110, 164, 255, .4);
}
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(110, 164, 255, .55); }
.secondary-button { color: var(--text-primary); background: rgba(148, 178, 255, .06); }
.secondary-button:hover { color: #fff; background: linear-gradient(135deg, #4d7fe0, #6ea4ff); border-color: transparent; box-shadow: 0 6px 18px rgba(110, 164, 255, .35); transform: translateY(-1px); }

.path-section label { display: block; margin: 10px 0 5px; color: var(--text-muted); font: 10.5px var(--font-mono); text-transform: uppercase; }
.path-section input {
    width: 100%;
    height: 37px;
    padding: 0 10px;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-sm);
}
.path-section input:focus { border-color: var(--border-active); outline: 0; box-shadow: 0 0 0 3px rgba(110, 164, 255, .12); }
.path-arrow { display: block; height: 9px; margin-left: 13px; color: var(--color-flow); line-height: 9px; }
.path-status { margin-top: 10px; color: var(--text-muted); font-size: 11.5px; }
.path-status.success { color: var(--color-success); }
.path-status.error { color: var(--color-error); }

/* ================= 画布顶栏工具 ================= */
.graph-toolbar {
    position: absolute;
    z-index: 20;
    top: 22px;
    right: 18px;
    display: flex;
    align-items: center;
    height: 42px;
    padding: 5px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.graph-toolbar label { padding: 0 7px; color: var(--text-muted); font: 9.5px var(--font-mono); text-transform: uppercase; }
.graph-toolbar select, .graph-toolbar button {
    height: 30px;
    padding: 0 9px;
    border: 0;
    border-radius: var(--r-sm);
    color: var(--text-primary);
    background: transparent;
    font-size: 11.5px;
    transition: background var(--t-fast) var(--e-out);
}
.graph-toolbar select option { color: var(--text-primary); background: var(--bg-panel-solid); }
.graph-toolbar select:hover, .graph-toolbar button:hover { background: var(--bg-secondary); }
.toolbar-rule { width: 1px; height: 20px; margin: 0 3px; background: var(--border-subtle); }
.graph-stage.details-open .graph-toolbar { right: 368px; }

/* ================= 图例（胶囊） ================= */
.graph-legend {
    position: absolute;
    left: 86px;
    bottom: 20px;
    z-index: 12;
    padding: 0;
    color: var(--text-secondary);
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    font: 10.5px var(--font-mono);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    pointer-events: auto;
}
.graph-legend summary { padding: 7px 12px; cursor: pointer; list-style: none; border-radius: var(--r-lg); }
.graph-legend summary::before { content: "◇"; margin-right: 6px; color: var(--color-module); }
.graph-legend[open] summary { border-bottom: 1px solid var(--border-subtle); }
.graph-legend > div { display: grid; grid-template-columns: repeat(2, auto); gap: 8px 12px; padding: 9px 12px; }
.graph-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-node { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 5px currentColor; }
.legend-node.module { color: var(--color-module); }
.legend-node.api { color: var(--color-api); }
.legend-line { width: 17px; border-top: 2px solid; }
.legend-line.depends { border-color: var(--edge-depends); }
.legend-line.schedules { border-color: var(--edge-schedules); border-top-style: double; }
.legend-line.special { border-color: var(--edge-special); border-top-style: dashed; }
.legend-line.calls { border-color: var(--edge-calls); }

/* ================= 提示条 ================= */
.graph-hint {
    position: absolute;
    z-index: 12;
    right: 50%;
    bottom: 20px;
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font: 10.5px var(--font-mono);
    pointer-events: none;
    padding: 8px 11px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    opacity: 1;
    transform: translateX(50%);
    transition: opacity var(--t-med) var(--e-out), transform var(--t-med) var(--e-out);
}
.graph-hint.is-hidden { opacity: 0; transform: translate(50%, 6px); }
.graph-hint i { width: 3px; height: 3px; border-radius: 50%; background: var(--text-muted); }

/* ================= 搜索下拉（玻璃浮层） ================= */
.search-results {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    z-index: 100;
    display: none;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-float);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-float);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
}
.search-results.active { display: block; }
.search-result-item { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: background var(--t-fast) var(--e-out); }
.search-result-item:hover, .search-result-item.active { background: var(--bg-secondary); }
.search-result-item:last-child { border-bottom: 0; }
.search-result-group { padding: 8px 11px 5px; color: var(--color-module); background: rgba(8, 12, 20, .6); font: 700 8.5px var(--font-mono); letter-spacing: .14em; }
.search-result-item .result-copy { display: grid; min-width: 0; flex: 1; gap: 2px; }
.search-result-item .result-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; }
.search-result-item .result-meta, .search-result-item .result-layer { color: var(--text-muted); font: 9.5px var(--font-mono); }

/* 类型徽章（胶囊 + 发光） */
.type-badge {
    padding: 2.5px 9px;
    color: #fff;
    background: var(--text-primary);
    border-radius: 99px;
    font: 8.5px var(--font-mono);
    text-transform: uppercase;
    letter-spacing: .06em;
    box-shadow: 0 0 8px currentColor;
}
.type-badge.module { background: var(--color-module); color: var(--color-module); background: transparent; border: 1px solid var(--color-module); }
.type-badge.api { background: transparent; border: 1px solid var(--color-api); color: var(--color-api); }
.type-badge.concept { background: transparent; border: 1px solid var(--color-concept); color: var(--color-concept); }
.type-badge.flow-step { background: transparent; border: 1px solid var(--color-flow); color: var(--color-flow); }

/* ================= 节点详情 ================= */
.detail-block { padding: 0 0 17px; margin-bottom: 17px; border-bottom: 1px solid var(--border-subtle); }
.detail-block:last-child { border-bottom: 0; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding-bottom: 13px; border-bottom: 1px solid rgba(110, 164, 255, .35); }
.detail-header h2 { overflow-wrap: anywhere; font: 800 24px/1.05 var(--font-display); }
.detail-header::before { content: "NODE / RELATION"; display: block; margin-bottom: 5px; color: var(--color-module); font: 700 8.5px var(--font-mono); letter-spacing: .12em; }
.detail-header { flex-wrap: wrap; }
.detail-header h2 { flex: 1 0 80%; }
.detail-field { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); }
.field-label { color: var(--text-muted); font: 9.5px var(--font-mono); text-transform: uppercase; }
.field-value { overflow-wrap: anywhere; color: var(--text-secondary); font-size: 12.5px; }
.field-value code { color: var(--ink); font: 10.5px var(--font-mono); }
.detail-semantic { line-height: 1.55; }
.detail-empty { color: var(--text-muted); font-size: 12.5px; }
.detail-block h3 { margin-bottom: 9px; font: 700 11.5px var(--font-mono); text-transform: uppercase; }
.detail-actions button {
    width: 100%;
    padding: 9px;
    color: var(--text-primary);
    border: 1px solid var(--border-active);
    border-radius: var(--r-md);
    background: transparent;
    font-weight: 700;
    transition: all var(--t-fast) var(--e-out);
}
.detail-actions button:hover { color: #fff; background: linear-gradient(135deg, #4d7fe0, #6ea4ff); border-color: transparent; box-shadow: 0 6px 18px rgba(110, 164, 255, .35); }
.adjacent-list { list-style: none; }
.adjacent-list li { border-bottom: 1px solid var(--border-subtle); }
.adjacent-list li:last-child { border-bottom: 0; }
.adjacent-list button {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 8px 5px;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: var(--r-sm);
    text-align: left;
    cursor: pointer;
    transition: background var(--t-fast) var(--e-out);
}
.adjacent-list button:hover { background: var(--bg-secondary); }
.adj-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adj-type { flex-shrink: 0; color: var(--text-muted); font-size: 10.5px; }
.adj-dir { color: var(--color-flow); font-family: var(--font-mono); }
.path-node-list { list-style: none; }
.path-node-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 7px 0; border-bottom: 1px solid var(--border-subtle); }
.path-step-num {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    color: #fff;
    background: linear-gradient(135deg, #4d7fe0, #6ea4ff);
    border-radius: 50%;
    font: 9px var(--font-mono);
    box-shadow: 0 0 8px rgba(110, 164, 255, .4);
}
.path-relation { flex-basis: 100%; margin-left: 27px; color: var(--text-muted); font: 9.5px/1.45 var(--font-mono); }
.detail-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin-top: 12px;
    background: var(--border-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-md);
    overflow: hidden;
}
.detail-metrics div { display: grid; gap: 2px; padding: 9px; background: var(--bg-panel-solid); }
.detail-metrics strong { color: var(--ink); font: 700 17px var(--font-mono); }
.detail-metrics span { color: var(--text-muted); font: 8.5px var(--font-mono); text-transform: uppercase; }
.detail-action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; }
.detail-action-grid button { font-size: 10.5px; }

/* ================= Focus 面包屑 ================= */
.focus-bar {
    position: absolute;
    top: 18px;
    left: 50%;
    z-index: 24;
    display: flex;
    align-items: center;
    max-width: min(620px, calc(100% - 650px));
    height: 38px;
    background: var(--bg-panel);
    border: 1px solid rgba(110, 164, 255, .32);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    transform: translateX(-50%);
}
.focus-bar button { align-self: stretch; padding: 0 11px; color: var(--text-secondary); background: transparent; border: 0; border-radius: var(--r-md); transition: all var(--t-fast) var(--e-out); }
.focus-bar button:hover { color: var(--bg-page); background: var(--color-focus); box-shadow: 0 0 14px var(--glow-amber); }
.focus-bar nav { display: flex; min-width: 0; align-items: center; gap: 6px; padding: 0 10px; overflow: hidden; color: var(--text-secondary); font: 9.5px var(--font-mono); white-space: nowrap; }
.focus-bar nav span { overflow: hidden; text-overflow: ellipsis; }
.focus-bar nav span:last-of-type { color: var(--ink); }
.focus-bar nav i { color: var(--color-module); font-style: normal; }

/* ================= 上下文操作 ================= */
.context-actions {
    position: absolute;
    z-index: 22;
    top: 72px;
    left: 50%;
    display: flex;
    padding: 4px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    transform: translateX(-50%);
}
.context-actions button {
    height: 28px;
    padding: 0 9px;
    color: var(--text-secondary);
    background: transparent;
    border: 0;
    border-radius: var(--r-sm);
    font: 9.5px var(--font-mono);
    transition: all var(--t-fast) var(--e-out);
}
.context-actions button:hover { color: var(--ink); background: var(--bg-hover); }

/* ================= 相机坞（雷达） ================= */
.camera-dock {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 21;
    width: 184px;
    background: var(--bg-panel);
    border: 1px solid rgba(110, 164, 255, .28);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
.graph-stage.details-open .camera-dock { right: 368px; }
.mini-map-shell summary {
    padding: 6px 8px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    list-style: none;
    font: 700 8.5px var(--font-mono);
    letter-spacing: .12em;
}
.mini-map-shell summary::after { content: "−"; float: right; color: var(--color-module); }
.mini-map-shell:not([open]) summary::after { content: "+"; }
#miniMap { display: block; width: 182px; height: 120px; cursor: crosshair; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.zoom-control, .fit-control { display: grid; border-top: 1px solid var(--border-subtle); }
.zoom-control { grid-template-columns: 36px 1fr 36px; }
.fit-control { grid-template-columns: 1fr 1fr; }
.zoom-control button, .fit-control button { height: 32px; color: var(--text-secondary); background: transparent; border: 0; transition: all var(--t-fast) var(--e-out); }
.zoom-control button:hover, .fit-control button:hover { color: var(--ink); background: var(--bg-hover); }
.zoom-control button:disabled { color: #424a58; cursor: not-allowed; }
.zoom-control output { display: grid; place-items: center; color: var(--ink); border-inline: 1px solid var(--border-subtle); font: 700 11px var(--font-mono); }
.fit-control button { border-right: 1px solid var(--border-subtle); font: 9.5px var(--font-mono); }
.fit-control button:last-child { border-right: 0; }

/* ================= Trace 面板 ================= */
.trace-panel {
    position: absolute;
    bottom: 18px;
    left: 50%;
    z-index: 23;
    display: flex;
    align-items: center;
    height: 40px;
    background: var(--bg-panel);
    border: 1px solid rgba(255, 196, 110, .5);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    transform: translateX(-50%);
}
.trace-mode-label {
    align-self: stretch;
    display: grid;
    place-items: center;
    padding: 0 10px;
    color: var(--bg-page);
    background: var(--color-focus);
    border-radius: var(--r-lg) 0 0 var(--r-lg);
    font: 700 8.5px var(--font-mono);
    letter-spacing: .1em;
}
.trace-panel button { height: 100%; padding: 0 11px; color: var(--text-secondary); background: transparent; border: 0; transition: all var(--t-fast) var(--e-out); }
.trace-panel button:hover { color: var(--ink); background: var(--bg-hover); }
.trace-panel button:disabled { color: #48505e; cursor: not-allowed; }
.trace-panel output { min-width: 54px; text-align: center; color: var(--ink); font: 700 10.5px var(--font-mono); }
.trace-panel .trace-close { border-left: 1px solid var(--border-subtle); font-size: 16px; }

/* ================= 悬浮预览 ================= */
.hover-preview {
    position: fixed;
    z-index: 120;
    display: grid;
    width: 270px;
    gap: 4px;
    padding: 12px;
    color: var(--text-secondary);
    background: var(--bg-float);
    border: 1px solid rgba(110, 164, 255, .38);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-float);
    backdrop-filter: blur(18px) saturate(1.4);
    -webkit-backdrop-filter: blur(18px) saturate(1.4);
    pointer-events: none;
}
.hover-preview strong { color: var(--ink); font: 700 14.5px var(--font-display); }
.hover-preview span, .hover-preview small { font-size: 10.5px; }
.hover-preview em { margin-top: 4px; color: var(--color-module); font: normal 8.5px var(--font-mono); text-transform: uppercase; }
.shortcut-section p { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 7px; color: var(--text-muted); font-size: 10.5px; }

/* ================= 加载 / 错误 ================= */
.loading-overlay, .engine-error { position: absolute; inset: 0; z-index: 80; display: grid; place-content: center; justify-items: center; gap: 12px; background: var(--bg-page); text-align: center; }
.loading-pulse {
    width: 34px;
    height: 34px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--color-module);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(110, 164, 255, .2);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.engine-error strong { color: var(--color-error); }
.engine-error p { color: var(--text-secondary); }

/* ================= Toast ================= */
.toast {
    position: fixed;
    right: 22px;
    bottom: 44px;
    z-index: 200;
    padding: 10px 14px;
    color: #fff;
    background: linear-gradient(135deg, #4d7fe0, #6ea4ff);
    border-radius: var(--r-md);
    box-shadow: 0 10px 26px rgba(110, 164, 255, .4);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity var(--t-med) var(--e-out), transform var(--t-med) var(--e-out);
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: linear-gradient(135deg, #d64557, #ff7d87); box-shadow: 0 10px 26px rgba(255, 125, 135, .4); }

.footerbar {
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    color: var(--text-muted);
    background: rgba(8, 12, 20, .9);
    border-top: 1px solid var(--border-subtle);
    font: 8.5px var(--font-mono);
    letter-spacing: .04em;
}
.footerbar a { color: var(--color-module); }

.app-shell:fullscreen { background: var(--bg-page); }

/* ================= 响应式（断点不变） ================= */
@media (max-width: 980px) {
    .topbar { grid-template-columns: auto 1fr; gap: 14px; }
    .topbar-stats { display: none; }
    .control-panel { left: 74px; }
    .graph-hint { display: none; }
    .focus-bar { top: 62px; left: 74px; right: 18px; max-width: none; transform: none; }
    .context-actions { top: 104px; }
}

@media (max-width: 720px) {
    :root { --topbar-height: 112px; --drawer-width: min(330px, calc(100vw - 86px)); }
    .topbar { grid-template-columns: 1fr; align-content: center; gap: 8px; padding: 9px 12px; }
    .brand-index { width: 30px; height: 30px; flex-basis: 30px; font-size: 9px; }
    .brand-block h1 { font-size: 17px; }
    .eyebrow { font-size: 8.5px; }
    .search-field { height: 36px; }
    .tool-rail { top: 10px; left: 8px; width: 50px; border-radius: var(--r-lg); }
    .control-panel { top: 10px; bottom: 10px; left: 64px; border-radius: var(--r-lg); }
    .details-panel { top: auto; right: 8px; bottom: 10px; left: 64px; width: auto; max-height: 58%; border-radius: var(--r-lg); transform: translateY(calc(100% + 18px)); }
    .details-panel.is-open { transform: translateY(0); }
    .graph-toolbar { top: 10px; right: 8px; max-width: calc(100% - 72px); }
    .graph-stage.details-open .graph-toolbar { right: 8px; }
    .graph-toolbar label, .toolbar-rule { display: none; }
    .graph-toolbar select, .graph-toolbar button { padding: 0 6px; font-size: 10.5px; }
    .architecture-strip { display: none; }
    .orbit-ring b { font-size: 8px; letter-spacing: .08em; }
    .graph-legend { left: 64px; bottom: 10px; gap: 8px; padding: 6px; }
    .graph-hint, .footerbar span:nth-child(2) { display: none; }
    .focus-bar { top: 54px; left: 64px; right: 8px; max-width: none; transform: none; }
    .focus-bar nav { flex: 1; }
    .context-actions { top: 98px; left: 64px; max-width: calc(100% - 72px); overflow-x: auto; transform: none; }
    .camera-dock { right: 8px; bottom: 10px; width: 164px; }
    .graph-stage.details-open .camera-dock { right: 8px; bottom: calc(58% + 18px); }
    .mini-map-shell { display: none; }
    .trace-panel { bottom: 54px; max-width: calc(100% - 72px); }
    .graph-stage.details-open .trace-panel { bottom: calc(58% + 18px); z-index: 35; }
    .trace-mode-label { display: none; }
    .trace-panel button { padding: 0 8px; font-size: 10.5px; }
    .hover-preview { display: none; }
}

@media (max-width: 420px) {
    .graph-toolbar #exportButton { display: none; }
    .graph-legend span:nth-child(n+3) { display: none; }
    .filter-grid { grid-template-columns: 1fr; }
    .focus-bar button { padding: 0 7px; font-size: 10.5px; }
    .focus-bar nav span:not(:last-of-type), .focus-bar nav i { display: none; }
    .detail-action-grid { grid-template-columns: 1fr; }
}

/* ================= 减弱动效（保留） ================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
