/* =========================================================
   SaaS平台 — 前端样式（深色主题）
   ========================================================= */

:root {
    --bg: #0b1020;
    --bg2: #141b32;
    --ink: #e8ecf6;
    --muted: #8a93ad;
    --rule: rgba(120, 140, 180, 0.18);
    --accent: #38e1ff;
    --accent2: #7c6bff;
    --accent3: #ff6b9d;
    --green: #4ade80;

    --card: #141b32;
    --card-2: #1a2240;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    --radius: 14px;
    --radius-sm: 9px;
    --maxw: 1280px;
    --nav-h: 64px;

    --t: 0.22s ease;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--t); }
a:hover { color: #fff; }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

::selection { background: rgba(56, 225, 255, 0.3); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a3458; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3a4674; }

/* ============ 容器 ============ */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}

/* 主内容区（顶部留出导航栏空间由各页面自行控制，避免叠加） */
.main-content {
    min-height: calc(100vh - var(--nav-h));
}

/* ============ 导航栏 ============ */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    z-index: 1000;
    background: rgba(11, 16, 32, 0.72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--rule);
}
.navbar__inner {
    max-width: var(--maxw);
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 18px;
}
.navbar__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    color: #fff;
    white-space: nowrap;
    text-decoration: none;
}
.navbar__logo-text { color: #fff; }

.navbar__menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0; padding: 0;
}
.navbar__item { position: relative; }
.navbar__link {
    display: block;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--ink);
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: background var(--t), color var(--t);
}
.navbar__link:hover,
.navbar__item:hover > .navbar__link {
    background: var(--card-2);
    color: #fff;
}
.navbar__item.is-active > .navbar__link {
    color: var(--accent);
}
/* 下拉子菜单 */
.navbar__dropdown {
    position: absolute;
    top: 100%; left: 0;
    min-width: 190px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 6px;
    opacity: 0; visibility: hidden;
    transform: translateY(8px);
    transition: all var(--t);
    list-style: none;
    margin: 6px 0 0;
}
.navbar__item--has-dropdown:hover .navbar__dropdown {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.navbar__dropdown a {
    display: block;
    padding: 8px 12px;
    border-radius: 7px;
    color: var(--ink);
    font-size: 0.92rem;
    text-decoration: none;
    transition: background var(--t);
}
.navbar__dropdown a:hover { background: var(--card-2); color: #fff; }
.navbar__dropdown .is-active > a { color: var(--accent); }
.navbar__caret {
    margin-left: 6px;
    font-size: 0.75em;
    opacity: 0.7;
}

.navbar__actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar__search {
    position: relative;
    display: flex;
    align-items: center;
}
.navbar__search .navbar__search-input {
    width: 200px;
    padding: 8px 14px 8px 38px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 20px;
    color: var(--ink);
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.4;
    transition: all var(--t);
}
.navbar__search .navbar__search-input:focus {
    outline: none;
    border-color: var(--accent);
    width: 240px;
}
.navbar__search .navbar__search-btn {
    position: absolute; left: 10px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--muted);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 20px;
    text-align: center;
}

.navbar__btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--t);
}
.navbar__btn--login {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #0b1020;
    border: none;
}
.navbar__btn--login:hover { opacity: 0.92; color: #0b1020; }
.navbar__btn--user {
    background: var(--card-2);
    color: var(--ink);
    border: 1px solid var(--rule);
}
.navbar__btn--user:hover { border-color: var(--accent); color: var(--accent); }

/* 移动端汉堡按钮 */
.navbar__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none; border: none;
    cursor: pointer; padding: 8px;
    min-width: 44px; min-height: 44px;
}
.navbar__toggle-bar {
    display: block;
    width: 24px; height: 3px;
    border-radius: 2px;
    background: var(--ink);
    transition: all var(--t);
}
.navbar__toggle.active .navbar__toggle-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.navbar__toggle.active .navbar__toggle-bar:nth-child(2) { opacity: 0; }
.navbar__toggle.active .navbar__toggle-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* 移动端抽屉（从右侧滑出，与右上角汉堡按钮位置一致） */
.navbar__drawer {
    position: fixed;
    top: var(--nav-h); right: 0;
    width: 280px; max-width: 84vw;
    bottom: 0;
    background: var(--bg2);
    border-left: 1px solid var(--rule);
    box-shadow: var(--shadow);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px 24px;
    transform: translateX(100%);
    transition: transform var(--t);
    z-index: 999;
}
.navbar__drawer.open { transform: translateX(0); }
.navbar__drawer-menu { list-style: none; margin: 0; padding: 0; }
.navbar__drawer-item { margin-bottom: 2px; }
.navbar__drawer-item > a {
    display: block;
    padding: 14px 16px;
    border-radius: 8px;
    color: var(--ink);
    font-weight: 500;
    text-decoration: none;
    min-height: 44px;
    display: flex; align-items: center;
    transition: background var(--t);
}
.navbar__drawer-item > a:hover,
.navbar__drawer-item.is-active > a {
    background: var(--card-2);
    color: var(--accent);
}
.navbar__drawer-sub {
    list-style: none; margin: 0 0 0 8px; padding: 0;
}
.navbar__drawer-sub li a {
    display: block;
    padding: 10px 16px;
    color: var(--muted);
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 8px;
    transition: background var(--t);
}
.navbar__drawer-sub li a:hover { background: var(--card-2); color: var(--ink); }
.navbar__drawer-search {
    display: flex; gap: 8px;
    margin-top: 16px; padding: 0 8px;
}
.navbar__drawer-search input {
    flex: 1;
    padding: 10px 14px;
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 9px;
    color: var(--ink);
    font-size: 0.9rem;
}
.navbar__drawer-search input:focus { outline: none; border-color: var(--accent); }
.navbar__drawer-search button {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #0b1020;
    border: none; border-radius: 9px;
    font-weight: 600; cursor: pointer;
}
.navbar__drawer-login {
    display: block;
    margin-top: 16px;
    padding: 12px 16px;
    text-align: center;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #0b1020;
    border-radius: 9px;
    font-weight: 600;
    text-decoration: none;
}
.navbar__overlay {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0; bottom: 0;
    z-index: 998;
    background: rgba(5, 8, 18, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden;
    transition: opacity var(--t), visibility var(--t);
}
.navbar__overlay.open { opacity: 1; visibility: visible; }

/* ============ 按钮 ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 9px;
    border: 1px solid var(--rule);
    background: var(--card);
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t);
    text-decoration: none;
}
.btn:hover { background: var(--card-2); color: #fff; border-color: #2a3458; }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #0b1020;
    border: none;
}
.btn-primary:hover { color: #0b1020; opacity: 0.92; }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(255, 107, 157, 0.12); color: var(--accent3); border-color: rgba(255, 107, 157, 0.3); }
.btn-danger:hover { background: var(--accent3); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 0.82rem; }
.btn-block { width: 100%; justify-content: center; }

/* ============ Hero ============ */
.hero {
    padding: calc(var(--nav-h) + 56px) 0 36px;
    text-align: center;
    background:
        radial-gradient(900px 380px at 50% -10%, rgba(124, 107, 255, 0.22), transparent 70%),
        radial-gradient(700px 320px at 80% 10%, rgba(56, 225, 255, 0.14), transparent 70%);
}
.hero h1 {
    font-size: 2.6rem;
    margin: 0 0 14px;
    background: linear-gradient(120deg, #fff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    color: var(--muted);
    max-width: 620px;
    margin: 0 auto;
    font-size: 1.05rem;
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 34px;
    margin-top: 28px;
    flex-wrap: wrap;
}
.hero-stat .num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent);
}
.hero-stat .label { color: var(--muted); font-size: 0.85rem; }

/* ============ 主题选择器 ============ */
.hero-theme-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(56, 225, 255, 0.12);
    border: 1px solid rgba(56, 225, 255, 0.3);
    color: var(--accent);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.theme-selector {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.theme-selector__label {
    color: var(--muted);
    font-size: 0.85rem;
}

.theme-selector__dropdown {
    position: relative;
    display: inline-block;
}

.theme-selector__current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(124, 107, 255, 0.15);
    border: 1px solid rgba(124, 107, 255, 0.35);
    color: var(--ink);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--t);
    white-space: nowrap;
}

.theme-selector__current:hover {
    background: rgba(124, 107, 255, 0.25);
    border-color: var(--accent2);
}

.theme-selector__star {
    color: #ffd700;
    font-size: 0.85em;
}

.theme-selector__arrow {
    font-size: 0.7em;
    color: var(--muted);
    transition: transform var(--t);
    margin-left: 2px;
}

.theme-selector.open .theme-selector__arrow {
    transform: rotate(180deg);
}

.theme-selector__list {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--card-2);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
}

.theme-selector.open .theme-selector__list {
    display: block;
}

.theme-selector__item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--ink);
    font-size: 0.88rem;
    transition: background var(--t);
    text-decoration: none;
}

.theme-selector__item:hover {
    background: rgba(56, 225, 255, 0.1);
    color: #fff;
}

.theme-selector__item.active {
    background: rgba(56, 225, 255, 0.15);
    color: var(--accent);
    font-weight: 600;
}

/* 侧栏中的主题选择器（graph.php） */
.theme-selector--sidebar {
    display: block;
    margin-bottom: 0;
}

.theme-selector--sidebar .theme-selector__current {
    width: 100%;
    justify-content: flex-start;
}

.theme-selector--sidebar .theme-selector__list {
    left: 0;
    right: 0;
    min-width: auto;
    width: 100%;
}

/* ============ 主布局（三栏） ============ */
.layout {
    display: grid;
    grid-template-columns: 240px 1fr 320px;
    gap: 22px;
    padding: 30px 0 60px;
    align-items: start;
}
.layout.two-col {
    grid-template-columns: 240px 1fr;
}

/* ============ 图谱页：独立布局（不继承 .layout 的 grid 三栏） ============ */
/* 使用 CSS Grid 240px + 1fr，比 flexbox 更可靠地填充右侧空间 */
.graph-page {
    width: 100%;
    max-width: none;
    padding-top: calc(var(--nav-h) + 24px);
    padding-bottom: 40px;
}
.graph-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    padding: 0;
    width: 100%;
    max-width: none;
    align-items: stretch;
}
.graph-layout > .sidebar {
    width: 240px;
    min-width: 0;
}
.graph-layout > section {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}
.graph-page .graph-wrap {
    width: 100%;
}

/* 侧栏展开按钮：移动端默认隐藏，桌面端在媒体查询中定义 */
.sidebar-show-btn { display: none; }

/* ============ 图谱页：全宽两栏布局（桌面端 ≥1024px） ============ */
/* 固定在导航栏下方，占满视口，左菜单 + 右图谱 */
@media (min-width: 1024px) {
    .graph-page {
        position: fixed;
        top: var(--nav-h);
        left: 0; right: 0; bottom: 0;
        padding: 0;
        max-width: none;
        overflow: hidden;
    }
    .graph-layout {
        display: grid;
        grid-template-columns: 240px 1fr;
        gap: 0;
        padding: 0;
        height: 100%;
        width: 100%;
        max-width: none;
        align-items: stretch;
    }
    .graph-layout > .sidebar {
        position: relative;
        width: 240px;
        height: 100%;
        overflow-y: auto;
        padding: 16px;
        background: var(--bg);
        border-right: 1px solid var(--rule);
        z-index: 50;
    }
    .graph-layout > section {
        position: relative;
        width: 100%;
        height: 100%;
        overflow: hidden;
        min-width: 0;
    }
    .graph-page .graph-wrap {
        width: 100%;
        height: 100% !important;
        border-radius: 0;
        border: none;
    }
    /* 全屏模式：侧栏完全移除（display:none），grid 变为单列 1fr，图谱占满全宽 */
    .graph-page.is-sidebar-hidden .graph-layout {
        grid-template-columns: 1fr;
    }
    .graph-page.is-sidebar-hidden .graph-layout > .sidebar {
        display: none;
    }
    /* 侧栏展开按钮（侧栏隐藏时显示） */
    .sidebar-show-btn {
        position: fixed;
        top: calc(var(--nav-h) + 16px);
        left: 16px;
        z-index: 51;
        width: 42px; height: 42px;
        border-radius: 10px;
        background: rgba(20, 27, 50, 0.92);
        backdrop-filter: blur(12px);
        border: 1px solid var(--rule);
        color: var(--accent);
        font-size: 1.1rem;
        cursor: pointer;
        display: none;
        align-items: center; justify-content: center;
        transition: all var(--t);
    }
    .sidebar-show-btn:hover { background: var(--card-2); border-color: var(--accent); }
    .sidebar-show-btn.show { display: flex; }

    /* 桌面端真正全屏：隐藏导航栏与页脚，图谱占满整个视口（含原导航栏区域） */
    body.graph-desktop-fullscreen .navbar,
    body.graph-desktop-fullscreen .footer { display: none !important; }
    body.graph-desktop-fullscreen .graph-page {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }
    /* 全屏时侧栏展开按钮上移（导航栏已隐藏） */
    body.graph-desktop-fullscreen .sidebar-show-btn { top: 16px !important; }
}

/* ============ 卡片 ============ */
.card {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 20px;
}
.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--rule);
    display: flex; align-items: center; justify-content: space-between;
}

/* ============ 侧边栏 ============ */
.sidebar { position: sticky; top: calc(var(--nav-h) + 16px); }
.sidebar .card { margin-bottom: 18px; }
.cat-filter { list-style: none; margin: 0; padding: 0; }
.cat-filter li { margin-bottom: 6px; }
.cat-filter label {
    display: flex; align-items: center; gap: 9px;
    padding: 7px 10px; border-radius: 8px; cursor: pointer;
    transition: background var(--t);
}
.cat-filter label:hover { background: var(--card-2); }
.cat-filter input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.cat-filter .swatch {
    width: 12px; height: 12px; border-radius: 4px; flex: none;
}
.cat-filter .count { margin-left: auto; color: var(--muted); font-size: 0.8rem; }

/* 筛选器重置按钮 */
.filter-reset-btn {
    font-size: 0.72rem; color: var(--muted); background: none; border: 1px solid var(--rule);
    border-radius: 100px; padding: 2px 10px; cursor: pointer; transition: all var(--t); font-family: inherit;
}
.filter-reset-btn:hover { color: var(--accent); border-color: var(--accent); }

/* 高级筛选图标 */
.advance-filter .adv-ico { width: 16px; text-align: center; font-size: 0.9rem; flex: none; }

/* ============ 图谱 Canvas 容器 ============ */
.graph-wrap {
    position: relative;
    background: linear-gradient(180deg, #0d1430, #0a0f20);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    overflow: hidden;
    height: 560px;
    width: 100%;
}
.graph-wrap.fullscreen { height: calc(100vh - var(--nav-h) - 60px); width: 100%; }
.graph-wrap canvas { display: block; width: 100% !important; height: 100% !important; cursor: grab; touch-action: none; }
.graph-wrap canvas:active { cursor: grabbing; }
.graph-toolbar {
    position: absolute;
    top: 14px; right: 14px;
    display: flex; gap: 8px;
}
.graph-toolbar .btn { padding: 6px 10px; backdrop-filter: blur(6px); }
.graph-legend {
    position: absolute;
    bottom: 14px; left: 14px;
    display: flex; flex-wrap: wrap; gap: 10px;
    background: rgba(11, 16, 32, 0.6);
    backdrop-filter: blur(6px);
    padding: 8px 12px; border-radius: 10px;
    border: 1px solid var(--rule);
    max-width: 80%;
}
.graph-legend .item { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--muted); }
.graph-legend .dot { width: 10px; height: 10px; border-radius: 50%; }
.graph-hint {
    position: absolute; bottom: 14px; right: 14px;
    color: var(--muted); font-size: 0.78rem;
    background: rgba(11, 16, 32, 0.6);
    padding: 5px 10px; border-radius: 8px;
}

/* 显示/隐藏设备特定提示：移动端显示"双指缩放"，桌面端显示"滚轮缩放" */
.hint-desktop { display: inline; }
.hint-mobile { display: none; }
@media (max-width: 767px) {
    .hint-desktop { display: none; }
    .hint-mobile { display: inline; }
}

/* ============ 全屏显示模式 ============ */
/* 全屏按钮样式 */
.btn-fullscreen-toggle {
    font-size: 1rem; line-height: 1;
    padding: 6px 9px;
}
/* 退出全屏按钮（仅全屏模式显示） */
.btn-fullscreen-exit {
    position: absolute;
    top: 14px; left: 14px;
    z-index: 10;
    font-size: 1rem; line-height: 1;
    padding: 6px 10px;
    backdrop-filter: blur(6px);
    background: rgba(255, 107, 157, 0.15);
    border-color: rgba(255, 107, 157, 0.3);
}

/* 全屏模式：图谱容器脱离文档流，占满整个视口 */
.graph-wrap.is-fullscreen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* 动态视口高度，兼容移动端浏览器 UI 栏 */
    z-index: 9999;
    border-radius: 0;
    border: none;
}
.graph-wrap.is-fullscreen .graph-toolbar {
    top: 14px; right: 14px;
    z-index: 10;
}
.graph-wrap.is-fullscreen .graph-legend {
    bottom: 14px; left: 14px;
    max-width: 60%;
    z-index: 10;
}
.graph-wrap.is-fullscreen .graph-hint {
    bottom: 14px; right: 14px;
    z-index: 10;
}

/* 横屏模式提示条（移动端横屏时显示） */
.graph-landscape-hint {
    position: absolute;
    top: 14px; left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex; align-items: center; gap: 8px;
    background: rgba(11, 16, 32, 0.8);
    backdrop-filter: blur(6px);
    padding: 5px 12px; border-radius: 8px;
    border: 1px solid var(--rule);
    font-size: 0.8rem; color: var(--accent);
}
.graph-landscape-hint .btn { padding: 3px 10px; font-size: 0.75rem; }

/* ============ 移动端横屏全屏支持 ============ */
/* 当移动端处于横屏（宽度 > 高度 且 宽度 >= 600px）时自动全屏 */
@media (max-width: 1023px) and (orientation: landscape) and (min-width: 600px) {
    .graph-wrap.auto-landscape-fullscreen {
        position: fixed;
        top: 0; left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        z-index: 9999;
        border-radius: 0;
        border: none;
    }
    .graph-wrap.auto-landscape-fullscreen .btn-fullscreen-toggle {
        display: none; /* 横屏自动全屏时隐藏手动全屏按钮 */
    }
    .graph-wrap.auto-landscape-fullscreen .graph-landscape-hint {
        display: flex !important;
    }
    /* 横屏全屏时隐藏导航栏和底部栏，腾出全部空间 */
    body:has(.auto-landscape-fullscreen) .navbar,
    body:has(.auto-landscape-fullscreen) .footer {
        display: none;
    }
}

/* 图谱空状态提示 */
.graph-empty {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center; color: var(--muted);
    pointer-events: none;
}
.graph-empty .ico { font-size: 2.4rem; margin-bottom: 8px; opacity: 0.4; }
.graph-empty .txt { font-size: 0.9rem; }

/* ============ 节点详情面板 ============ */
.detail-panel .empty { color: var(--muted); text-align: center; padding: 30px 0; }
/* graph.php 中脱离 .layout 的浮动详情面板（桌面端） */
.detail-panel:not(.layout .detail-panel) {
    position: fixed; right: 20px; bottom: 20px;
    width: 320px; max-width: calc(100vw - 40px);
    z-index: 50;
}
@media (max-width: 1023px) {
    #detail-panel.detail-panel,
    .layout .detail-panel {
        position: fixed; left: 0; right: 0; bottom: 0;
        width: 100%; max-height: 78vh;
        background: var(--card); border-top: 1px solid var(--rule);
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
        overflow-y: auto; -webkit-overflow-scrolling: touch;
        transform: translateY(100%); transition: transform 0.28s ease;
        z-index: 1095; padding: 14px 16px 28px;
    }
    #detail-panel.detail-panel.show,
    .layout .detail-panel.show { transform: translateY(0); }
}
.detail-panel .entity-name {
    font-size: 1.25rem; font-weight: 800; margin: 0 0 4px;
}
.detail-panel .entity-cat {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.8rem; color: var(--muted); margin-bottom: 12px;
}
.detail-panel .entity-cat .dot { width: 10px; height: 10px; border-radius: 50%; }
.detail-panel .desc { color: #c8cfde; margin: 0 0 16px; }
.detail-panel .relations { margin-top: 14px; }
.detail-panel .relations h4 { margin: 0 0 8px; font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.detail-panel .rel-item {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: 8px;
    background: var(--card-2); margin-bottom: 6px;
    font-size: 0.88rem; cursor: pointer;
    transition: background var(--t);
}
.detail-panel .rel-item:hover { background: #232c54; }
.detail-panel .rel-type {
    font-size: 0.72rem; padding: 2px 7px; border-radius: 5px;
    background: rgba(56, 225, 255, 0.14); color: var(--accent);
}

/* 详情分区（描述 / 文章 / 关系） */
.detail-panel .detail-section { margin-top: 14px; }
.detail-panel .detail-section h4 {
    margin: 0 0 8px; font-size: 0.85rem; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.5px;
}

/* 关联文章链接列表 */
.detail-panel .article-links {
    list-style: none; padding: 0; margin: 0;
}
.detail-panel .article-links li {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px; border-radius: 8px;
    background: var(--card-2); margin-bottom: 6px;
    font-size: 0.88rem; transition: background var(--t);
}
.detail-panel .article-links li:hover { background: #232c54; }
.detail-panel .article-links a {
    color: var(--accent); text-decoration: none;
    flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.detail-panel .article-links a:hover { text-decoration: underline; }
.detail-panel .article-date {
    font-size: 0.75rem; color: var(--muted); margin-left: 8px; white-space: nowrap;
}

/* ============ 文章列表 ============ */
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin: 44px 0 18px;
}
.section-head h2 { margin: 0; }
.article-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.article-card {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--t), border-color var(--t);
    display: flex; flex-direction: column;
}
.article-card:hover { transform: translateY(-4px); border-color: #2c3866; }
.article-card .cover {
    height: 150px;
    background: linear-gradient(135deg, #1a2240, #232c54);
    background-size: cover; background-position: center;
}
.article-card .body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.article-card h3 { font-size: 1.05rem; margin: 0 0 8px; }
.article-card h3 a { color: var(--ink); }
.article-card .excerpt { color: var(--muted); font-size: 0.88rem; flex: 1; }
.article-card .meta { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
    font-size: 0.74rem; padding: 2px 8px; border-radius: 5px;
    background: var(--card-2); color: var(--muted);
}
.article-card .date { color: var(--muted); font-size: 0.8rem; margin-top: 10px; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--rule); }
table.data {
    width: 100%; border-collapse: collapse;
    background: var(--card);
}
table.data th, table.data td {
    padding: 12px 14px; text-align: left;
    border-bottom: 1px solid var(--rule);
    font-size: 0.9rem;
}
table.data th {
    background: var(--card-2); color: var(--muted);
    font-weight: 600; text-transform: uppercase; font-size: 0.76rem; letter-spacing: 0.4px;
}
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background var(--t); }
table.data tbody tr:hover { background: var(--card-2); }
table.data .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ============ 表单 ============ */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; margin-bottom: 6px;
    font-weight: 600; font-size: 0.88rem; color: #c8cfde;
}
.form-control, input[type=text], input[type=password], input[type=email],
input[type=url], input[type=number], input[type=search], select, textarea {
    width: 100%;
    padding: 10px 13px;
    background: var(--bg2);
    border: 1px solid var(--rule);
    border-radius: 9px;
    color: var(--ink);
    font-size: 0.92rem;
    font-family: inherit;
    transition: border-color var(--t);
}
.form-control:focus, input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--accent);
}
textarea { resize: vertical; min-height: 120px; }
input[type=color] { padding: 4px; height: 40px; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { color: var(--muted); font-size: 0.8rem; margin-top: 5px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ============ 分页器 ============ */
.pagination {
    display: flex; justify-content: center; gap: 6px;
    margin-top: 26px; flex-wrap: wrap;
}
.pagination a, .pagination span {
    min-width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0 10px; border-radius: 9px;
    border: 1px solid var(--rule); background: var(--card);
    color: var(--ink); font-size: 0.88rem;
    transition: all var(--t);
}
.pagination a:hover { background: var(--card-2); border-color: #2a3458; }
.pagination .active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #0b1020; border: none; font-weight: 700;
}
.pagination .disabled { color: var(--muted); opacity: 0.5; cursor: not-allowed; }

/* ============ 搜索抽屉 ============ */
.drawer-backdrop {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(5, 8, 18, 0.6);
    backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden; transition: all var(--t);
}
.drawer-backdrop.open { opacity: 1; visibility: visible; }
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 420px; max-width: 92vw; z-index: 1201;
    background: var(--bg2); border-left: 1px solid var(--rule);
    transform: translateX(100%); transition: transform var(--t);
    display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.search-result { padding: 11px 12px; border-radius: 9px; cursor: pointer; transition: background var(--t); margin-bottom: 6px; }
.search-result:hover { background: var(--card); }
.search-result .t { font-weight: 600; }
.search-result .s { color: var(--muted); font-size: 0.82rem; }

/* ============ 模态框 ============ */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 1300;
    background: rgba(5, 8, 18, 0.7); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--card); border: 1px solid var(--rule);
    border-radius: var(--radius); box-shadow: var(--shadow);
    width: 560px; max-width: 100%; max-height: 90vh; overflow-y: auto;
}
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 22px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; line-height: 1; }

/* ============ 搜索页 ============ */
.search-page-bar { margin: 24px 0 30px; }
.search-box.lg {
    display: flex; align-items: center; gap: 10px;
    background: var(--card); border: 1px solid var(--rule);
    border-radius: 12px; padding: 6px 6px 6px 16px;
}
.search-box.lg .ico { color: var(--muted); font-size: 1.1rem; }
.search-box.lg input {
    flex: 1; background: none; border: none; outline: none;
    color: var(--ink); font-size: 1rem; padding: 10px 0;
}
.search-box.lg .btn { white-space: nowrap; }
.entity-list { display: grid; gap: 12px; }
.entity-result {
    display: block; text-decoration: none; color: inherit;
    transition: border-color var(--t), transform var(--t);
}
.entity-result:hover { border-color: #2c3866; transform: translateY(-2px); }
.entity-result-head { display: flex; align-items: center; gap: 8px; }
.entity-result-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.result-section { margin-bottom: 20px; }

/* ============ 页面内容 ============ */
.page-content { max-width: 820px; margin: calc(var(--nav-h) + 40px) auto 60px; }
.page-content .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 18px; }
.page-content article { line-height: 1.8; color: #c8cfde; }
.page-content article h2 { color: #fff; margin-top: 28px; }
.page-content article img { border-radius: 10px; margin: 18px 0; }
.related-entities { margin-top: 30px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ 登录页 ============ */
.auth-wrap {
    min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background:
        radial-gradient(800px 400px at 30% 20%, rgba(124, 107, 255, 0.2), transparent 70%),
        radial-gradient(700px 360px at 75% 80%, rgba(56, 225, 255, 0.16), transparent 70%);
}
.auth-card {
    width: 380px; max-width: 100%;
    background: var(--card); border: 1px solid var(--rule);
    border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.5rem; margin: 0 0 6px; text-align: center; }
.auth-card .sub { color: var(--muted); text-align: center; margin-bottom: 24px; font-size: 0.9rem; }
.auth-logo {
    width: 48px; height: 48px; border-radius: 12px; margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: grid; place-items: center; color: #0b1020; font-weight: 900; font-size: 1.3rem;
}
.alert {
    padding: 11px 14px; border-radius: 9px; margin-bottom: 16px; font-size: 0.88rem;
}
.alert-error { background: rgba(255, 107, 157, 0.12); color: var(--accent3); border: 1px solid rgba(255, 107, 157, 0.3); }
.alert-success { background: rgba(74, 222, 128, 0.12); color: var(--green); border: 1px solid rgba(74, 222, 128, 0.3); }

/* ============ 页脚 ============ */
.footer {
    border-top: 1px solid var(--rule);
    padding: 30px 0;
    color: var(--muted); font-size: 0.85rem;
}
.footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer a { color: var(--muted); }
.footer a:hover { color: var(--ink); }

/* ============ 工具类 ============ */
.muted { color: var(--muted); }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; }
/* hidden 基础类（不使用 !important，避免与动画冲突） */
.hidden { display: none; }

/* 移动端底部弹层：hidden 时保持 display:block 以支持滑出动画，但 translateY(100%) 将其移出视口 */
@media (max-width: 1023px) {
    .layout .detail-panel.hidden,
    #detail-panel.detail-panel.hidden {
        display: block;
        transform: translateY(100%);
    }
}
.badge {
    display: inline-block; font-size: 0.74rem; padding: 2px 8px; border-radius: 5px;
    background: rgba(74, 222, 128, 0.14); color: var(--green); font-weight: 600;
}
.badge-off { background: rgba(138, 147, 173, 0.16); color: var(--muted); }
.swatch-box { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: middle; margin-right: 6px; }

/* ============ 超级主题 ============ */

/* 超级主题视图切换容器 */
.super-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    margin-left: 12px;
}
.super-theme-toggle__label {
    color: var(--muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

/* 超级主题选择下拉框 */
.super-theme-selector {
    width: auto;
    min-width: 150px;
    padding: 6px 32px 6px 14px;
    border-radius: 20px;
    background-color: var(--card-2);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: var(--ink);
    font-size: 0.88rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--t), background-color var(--t);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%238a93ad' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}
.super-theme-selector:hover,
.super-theme-selector:focus {
    outline: none;
    border-color: #ffd700;
    background-color: rgba(255, 215, 0, 0.08);
}
.super-theme-selector option {
    background: var(--card);
    color: var(--ink);
    padding: 8px;
}

/* 合并实体金环指示器（详情面板中的小圆环，对应 canvas 中的金色双环） */
.merged-node-ring {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #ffd700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3);
    flex: none;
}

/* 合并实体徽章 — "多源合并" 标签 */
.entity-merged-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #ffd700;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 12px;
}

/* 主题跳转按钮 */
.theme-jump-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 9px;
    border: 1px solid rgba(124, 107, 255, 0.4);
    background: rgba(124, 107, 255, 0.12);
    color: var(--accent2);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--t);
    white-space: nowrap;
}
.theme-jump-btn:hover {
    background: rgba(124, 107, 255, 0.25);
    border-color: var(--accent2);
    color: #fff;
    transform: translateX(2px);
}

/* 管理员待审核重复高亮 — 脉冲边框 */
.admin-duplicate-highlight {
    border: 1px solid rgba(255, 107, 157, 0.4);
    border-radius: 9px;
    padding: 10px 12px;
    background: rgba(255, 107, 157, 0.06);
    animation: admin-pulse 2s ease-in-out infinite;
}
@keyframes admin-pulse {
    0%, 100% {
        border-color: rgba(255, 107, 157, 0.4);
        box-shadow: 0 0 0 0 rgba(255, 107, 157, 0.2);
    }
    50% {
        border-color: rgba(255, 107, 157, 0.8);
        box-shadow: 0 0 8px 2px rgba(255, 107, 157, 0.2);
    }
}

/* =========================================================
   响应式
   ========================================================= */

/* 768 - 1023px：平板也使用移动端布局，避免三栏挤压 */
@media (max-width: 1023px) {
    .layout, .layout.two-col {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
        padding: 18px 0 40px;
    }
    /* 侧栏与详情面板脱离网格流，改为抽屉 / 底部弹层 */
    .layout .sidebar,
    .layout .detail-panel {
        position: fixed;
    }

    /* —— 图谱页移动端布局：单列，侧栏改为抽屉 —— */
    .graph-layout {
        display: block;
        grid-template-columns: none;
        gap: 0;
        padding: 16px;
        width: 100%;
    }
    .graph-layout > .sidebar {
        position: fixed;
        top: var(--nav-h);
        bottom: 0;
        left: 0;
        width: 280px;
        max-width: 84vw;
        margin: 0;
        background: var(--bg2);
        border-right: 1px solid var(--rule);
        box-shadow: var(--shadow);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px 14px 24px;
        transform: translateX(-100%);
        transition: transform var(--t);
        z-index: 1095;
    }
    .graph-layout > .sidebar.open { transform: translateX(0); }
    .graph-layout > .sidebar .card { margin-bottom: 16px; }
    .graph-layout > section {
        width: 100%;
        min-width: 0;
    }

    /* —— 图谱区域：占满全宽，高度自适应 —— */
    .graph-wrap {
        width: 100%;
        height: 62vh;
        min-height: 340px;
        max-height: 620px;
        border-radius: var(--radius);
    }
    /* 移动端全屏模式覆盖：清除移动端限制 */
    .graph-wrap.is-fullscreen,
    .graph-wrap.auto-landscape-fullscreen {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        max-height: none;
        border-radius: 0;
    }

    /* —— 左侧分类筛选：抽屉式（默认隐藏，.open 时滑入） —— */
    .layout .sidebar {
        top: var(--nav-h);
        bottom: 0;
        left: 0;
        width: 280px;
        max-width: 84vw;
        margin: 0;
        background: var(--bg2);
        border-right: 1px solid var(--rule);
        box-shadow: var(--shadow);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 16px 14px 24px;
        transform: translateX(-100%);
        transition: transform var(--t);
        z-index: 1095;
    }
    .layout .sidebar.open { transform: translateX(0); }
    /* 抽屉内卡片间距复位 */
    .layout .sidebar .card { margin-bottom: 16px; }

    /* 侧栏遮罩层 */
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        top: var(--nav-h);
        z-index: 1090;
        background: rgba(5, 8, 18, 0.6);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--t), visibility var(--t);
    }
    .sidebar-backdrop.open {
        opacity: 1;
        visibility: visible;
    }

    /* 浮动筛选切换按钮（固定左下角） */
    .mobile-filter-toggle {
        position: fixed;
        left: 16px;
        bottom: 16px;
        z-index: 1080;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 12px 18px;
        border: none;
        border-radius: 999px;
        background: linear-gradient(135deg, var(--accent), var(--accent2));
        color: #0b1020;
        font-size: 0.9rem;
        font-weight: 700;
        line-height: 1;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
        cursor: pointer;
        transition: transform var(--t), opacity var(--t), box-shadow var(--t);
    }
    .mobile-filter-toggle:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5); }
    .mobile-filter-toggle:active { transform: translateY(0); }
    .mobile-filter-toggle .icon { font-size: 1.05rem; line-height: 1; }

    /* —— 右侧详情面板：底部弹层（默认隐藏，.show 时从底部滑出） —— */
    .layout .detail-panel,
    #detail-panel.detail-panel {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        max-height: 78vh;
        background: var(--card);
        border-top: 1px solid var(--rule);
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateY(100%);
        transition: transform 0.28s ease;
        z-index: 1095;
        padding: 14px 16px 28px;
        margin: 0;
    }
    .layout .detail-panel.show,
    #detail-panel.detail-panel.show { transform: translateY(0); }
    /* 底部弹层顶部抓手 */
    .layout .detail-panel::before,
    #detail-panel.detail-panel::before {
        content: "";
        display: block;
        width: 40px;
        height: 4px;
        margin: 0 auto 14px;
        border-radius: 999px;
        background: var(--rule);
    }

    /* 详情遮罩层 */
    .detail-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1090;
        background: rgba(5, 8, 18, 0.6);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--t), visibility var(--t);
    }
    .detail-backdrop.show {
        opacity: 1;
        visibility: visible;
    }

    /* —— 其他单列调整 —— */
    .article-grid { grid-template-columns: 1fr; }
    .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
    .form-row { grid-template-columns: 1fr; }
    .footer .container { flex-direction: column; }
    .hero-stats { gap: 20px; }
}

/* < 768px：小屏手机额外调整（汉堡菜单等） */
@media (max-width: 767px) {
    h1 { font-size: 1.7rem; }
    .hero h1 { font-size: 1.9rem; }
    .hero { padding: calc(var(--nav-h) + 30px) 0 26px; }
    .container { padding: 0 14px; }

    /* —— 顶部汉堡菜单 —— */
    .navbar__toggle { display: flex; margin-left: auto; }
    .navbar__menu { display: none; }
    .navbar__search { display: none; }
    .navbar__btn { display: none; }
    .navbar__actions { display: none; }
    .navbar__inner { padding: 0 14px; gap: 8px; }
    .navbar__logo { font-size: 1rem; }

    /* —— 图谱页面顶部间距 —— */
    .graph-page { padding-top: calc(var(--nav-h) + 24px); padding-bottom: 40px; }
}

/* =========================================================
   v2.3 新增页面样式
   ========================================================= */

/* ============ 徽章扩展 ============ */
.badge-accent { background: rgba(56, 225, 255, 0.14); color: var(--accent); }
.badge-primary { background: rgba(255, 215, 0, 0.16); color: #ffd700; }
.badge-warning { background: rgba(251, 191, 36, 0.16); color: #fbbf24; }
.badge-danger { background: rgba(255, 107, 157, 0.14); color: var(--accent3); }

/* ============ 个人中心 ============ */
.profile-header {
    display: flex; align-items: center; gap: 20px;
    background: var(--card); border: 1px solid var(--rule);
    border-radius: var(--radius); padding: 24px; margin-bottom: 22px;
}
.profile-avatar {
    width: 64px; height: 64px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: grid; place-items: center;
    font-size: 1.8rem; font-weight: 800; color: #0b1020; flex-shrink: 0;
}
.profile-info { flex: 1; min-width: 0; }
.profile-info h2 { margin: 0 0 6px; font-size: 1.3rem; }
.profile-info p { margin: 0; font-size: 0.88rem; }
.profile-stats { display: flex; gap: 24px; flex-shrink: 0; }
.profile-stat { text-align: center; }
.profile-stat .num { display: block; font-size: 1.5rem; font-weight: 800; color: var(--accent); }
.profile-stat .label { font-size: 0.78rem; color: var(--muted); }

.profile-tabs {
    display: flex; gap: 4px; margin-bottom: 20px;
    border-bottom: 1px solid var(--rule); flex-wrap: wrap;
}
.profile-tab {
    padding: 10px 16px; border-radius: 9px 9px 0 0;
    color: var(--muted); font-weight: 600; font-size: 0.9rem;
    text-decoration: none; transition: all var(--t);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.profile-tab:hover { color: var(--ink); background: var(--card-2); }
.profile-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.profile-content { min-height: 300px; }
.profile-panel {
    background: var(--card); border: 1px solid var(--rule);
    border-radius: var(--radius); padding: 20px; margin-bottom: 18px;
}
.profile-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--rule);
}
.profile-panel-head h3 { margin: 0; font-size: 1.05rem; }

.profile-list { display: flex; flex-direction: column; gap: 10px; }
.profile-list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 14px; border-radius: var(--radius-sm);
    background: var(--card-2); border: 1px solid var(--rule);
    transition: border-color var(--t);
}
.profile-list-item:hover { border-color: #2c3866; }
.profile-list-main { flex: 1; min-width: 0; }
.profile-list-title { font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-list-meta { font-size: 0.8rem; margin-top: 4px; }

.profile-empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.profile-empty .ico { font-size: 2.4rem; margin-bottom: 12px; opacity: 0.4; }
.profile-form { max-width: 480px; }
.profile-warn {
    background: rgba(255, 107, 157, 0.08);
    border: 1px solid rgba(255, 107, 157, 0.25);
    border-radius: var(--radius-sm); padding: 16px;
    margin-bottom: 18px; color: var(--accent3); font-size: 0.88rem;
}

@media (max-width: 767px) {
    .profile-header { flex-direction: column; text-align: center; }
    .profile-stats { justify-content: center; }
}

/* ============ 邮件中心 ============ */
.mail-layout {
    display: grid; grid-template-columns: 340px 1fr; gap: 18px;
    min-height: 600px;
}
.mail-list-panel {
    background: var(--card); border: 1px solid var(--rule);
    border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden;
}
.mail-list-head {
    padding: 14px 16px; border-bottom: 1px solid var(--rule);
    display: flex; align-items: center; justify-content: space-between;
}
.mail-list-head h2 { margin: 0; font-size: 1.05rem; }
.mail-filters { padding: 10px 16px; border-bottom: 1px solid var(--rule); display: flex; gap: 8px; flex-wrap: wrap; }
.mail-filters select { padding: 6px 10px; font-size: 0.82rem; border-radius: 7px; }
.mail-list { flex: 1; overflow-y: auto; max-height: 540px; }
.mail-item {
    display: flex; align-items: center; gap: 8px;
    padding: 12px 16px; border-bottom: 1px solid var(--rule);
    cursor: pointer; transition: background var(--t); position: relative;
}
.mail-item:hover { background: var(--card-2); }
.mail-item.active { background: rgba(56, 225, 255, 0.08); border-left: 3px solid var(--accent); padding-left: 13px; }
.mail-item.unread .mail-subject { font-weight: 700; color: #fff; }
.mail-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent3); flex-shrink: 0; }
.mail-star { color: #ffd700; flex-shrink: 0; }
.mail-subject { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.88rem; color: var(--ink); }
.mail-type { font-size: 0.72rem; padding: 2px 7px; border-radius: 5px; background: var(--card-2); color: var(--muted); white-space: nowrap; }
.mail-time { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.mail-empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.mail-empty .ico { font-size: 2rem; margin-bottom: 10px; opacity: 0.4; }

.mail-detail-panel {
    background: var(--card); border: 1px solid var(--rule);
    border-radius: var(--radius); padding: 20px;
}
.mail-detail-head { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.mail-detail-head h3 { margin: 0 0 8px; font-size: 1.1rem; }
.mail-meta { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; }
.mail-detail-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.mail-detail-body { line-height: 1.8; color: #c8cfde; }
.mail-detail-body img { max-width: 100%; border-radius: 10px; margin: 14px 0; }

@media (max-width: 1023px) {
    .mail-layout { grid-template-columns: 1fr; }
    .mail-list { max-height: 320px; }
}

/* ============ 公有库 ============ */
.pl-filter-bar {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
    margin-bottom: 22px;
}
.pl-search-form { flex: 1; min-width: 200px; position: relative; }
.pl-search-input { padding-left: 36px; }
.pl-search-form .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.pl-filter-select { width: auto; min-width: 140px; }
.pl-stat { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.85rem; }
.pl-stat .num { font-weight: 700; color: var(--accent); font-size: 1rem; }

.pl-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
}
.pl-card {
    background: var(--card); border: 1px solid var(--rule);
    border-radius: var(--radius); overflow: hidden;
    display: flex; flex-direction: column;
    transition: transform var(--t), border-color var(--t);
}
.pl-card:hover { transform: translateY(-3px); border-color: #2c3866; }
.pl-card-head { padding: 16px; }
.pl-card-title { font-size: 1rem; font-weight: 700; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.pl-card-desc { color: var(--muted); font-size: 0.85rem; line-height: 1.6; flex: 1; padding: 0 16px; }
.pl-card-foot {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-top: 1px solid var(--rule); margin-top: 14px;
}
.pl-card-cta { font-size: 0.85rem; font-weight: 600; }
.pl-badge { font-size: 0.72rem; padding: 2px 8px; border-radius: 5px; background: var(--card-2); color: var(--muted); font-weight: 600; }
.pl-badge-primary { background: rgba(56, 225, 255, 0.14); color: var(--accent); }
.pl-count { font-size: 0.78rem; color: var(--muted); }
.pl-date { font-size: 0.75rem; color: var(--muted); }
.pl-empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.pl-empty-ico { font-size: 2.4rem; margin-bottom: 12px; opacity: 0.4; }

.logged-in-notice {
    background: rgba(56, 225, 255, 0.08); border: 1px solid rgba(56, 225, 255, 0.25);
    border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 18px;
    font-size: 0.85rem; color: var(--accent); display: flex; align-items: center; gap: 8px;
}

@media (max-width: 1023px) { .pl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .pl-grid { grid-template-columns: 1fr; } }

/* ============ 更新日志 / Changelog ============ */
.cl-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.cl-filter-tab {
    padding: 7px 14px; border-radius: 20px; border: 1px solid var(--rule);
    background: var(--card); color: var(--muted); font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: all var(--t); text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px;
}
.cl-filter-tab:hover { color: #fff; border-color: #2a3458; }
.cl-filter-tab.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #0b1020; border: none; }
.cl-tab-ico { font-size: 0.95em; }

.cl-timeline { position: relative; padding-left: 32px; }
.cl-timeline::before {
    content: ''; position: absolute; left: 11px; top: 0; bottom: 0;
    width: 2px; background: var(--rule);
}
.cl-item { position: relative; margin-bottom: 28px; }
.cl-marker {
    position: absolute; left: -32px; top: 0;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--card); border: 2px solid var(--accent);
    display: grid; place-items: center; z-index: 1;
}
.cl-marker-ico { font-size: 0.7rem; }
.cl-content {
    background: var(--card); border: 1px solid var(--rule);
    border-radius: var(--radius); padding: 18px;
}
.cl-content-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cl-version { font-size: 1.1rem; font-weight: 800; color: var(--accent); }
.cl-date { font-size: 0.8rem; color: var(--muted); }
.cl-title { font-size: 0.95rem; font-weight: 700; margin: 0 0 8px; }
.cl-type-badge { font-size: 0.72rem; padding: 2px 8px; border-radius: 5px; font-weight: 600; }
.cl-type-badge.new { background: rgba(74, 222, 128, 0.14); color: var(--green); }
.cl-type-badge.update { background: rgba(56, 225, 255, 0.14); color: var(--accent); }
.cl-type-badge.fix { background: rgba(251, 191, 36, 0.16); color: #fbbf24; }
.cl-type-badge.optimize { background: rgba(124, 107, 255, 0.14); color: var(--accent2); }
.cl-body { color: #c8cfde; font-size: 0.88rem; line-height: 1.7; }
.cl-body ul { margin: 8px 0 0; padding-left: 18px; }
.cl-body li { margin-bottom: 4px; }
.cl-count { font-size: 0.78rem; color: var(--muted); margin-left: auto; }
.cl-empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.cl-empty-ico { font-size: 2.4rem; margin-bottom: 12px; opacity: 0.4; }

/* ============ 帮助中心：步骤 & 联系方式 ============ */
.steps-section { margin: 30px 0; }
.steps-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 18px; }
.step-item { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.step-num {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #0b1020; font-weight: 800; font-size: 0.9rem;
    display: grid; place-items: center;
}
.step-text { flex: 1; padding-top: 4px; }
.step-text strong { display: block; margin-bottom: 3px; }
.step-text span { color: var(--muted); font-size: 0.85rem; }

.contact-section { margin: 30px 0; }
.contact-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; }
.contact-items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.contact-item {
    background: var(--card); border: 1px solid var(--rule);
    border-radius: var(--radius-sm); padding: 16px;
    display: flex; align-items: center; gap: 12px;
}
.contact-item .ico { font-size: 1.5rem; }
.contact-item .info strong { display: block; font-size: 0.9rem; }
.contact-item .info span { color: var(--muted); font-size: 0.82rem; }
@media (max-width: 767px) { .contact-items { grid-template-columns: 1fr; } }
