:root,
[data-theme="dark"] {
    --bg: #0a0c0f;
    --bg-elevated: #11141a;
    --bg-card: #161b24;
    --bg-card-hover: #1c222d;
    --fg: #e2e8f0;
    --fg-muted: #6b7a8d;
    --fg-dim: #3d4a5c;
    --accent: #00e59b;
    --accent-dim: rgba(0, 229, 155, 0.12);
    --accent-mid: rgba(0, 229, 155, 0.3);
    --danger: #ff4d6a;
    --danger-dim: rgba(255, 77, 106, 0.12);
    --warning: #ffb347;
    --warning-dim: rgba(255, 179, 71, 0.12);
    --info: #47b3ff;
    --info-dim: rgba(71, 179, 255, 0.12);
    --border: #1e2736;
    --border-light: #2a3548;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --font-mono: 'JetBrains Mono', monospace;
    --font-ui: 'Space Grotesk', sans-serif;
    --topbar-bg: rgba(10, 12, 15, 0.85);
    --scanline-opacity: 0.015;
    --glow-accent: rgba(0, 229, 155, 0.04);
    --glow-info: rgba(71, 179, 255, 0.03);
    --node-source: #00e59b;
    --edge-color: rgba(0, 229, 155, 0.3);
    --travel-color: rgba(0, 229, 155, 0.5);
}

[data-theme="light"] {
    --bg: #f0f2f6;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #e8ecf3;
    --fg: #0d1117;
    --fg-muted: #3a4259;
    --fg-dim: #6e788a;
    --accent: #1d56d8;
    --accent-dim: rgba(29, 86, 216, 0.08);
    --accent-mid: rgba(29, 86, 216, 0.2);
    --danger: #c8202a;
    --danger-dim: rgba(200, 32, 42, 0.08);
    --warning: #b45309;
    --warning-dim: rgba(180, 83, 9, 0.08);
    --info: #1d56d8;
    --info-dim: rgba(29, 86, 216, 0.08);
    --border: #dde2eb;
    --border-light: #c8cedb;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --topbar-bg: rgba(240, 242, 246, 0.88);
    --scanline-opacity: 0.008;
    --glow-accent: rgba(29, 86, 216, 0.03);
    --glow-info: rgba(29, 86, 216, 0.02);
    --node-source: #1d56d8;
    --edge-color: rgba(29, 86, 216, 0.25);
    --travel-color: rgba(29, 86, 216, 0.5);
}

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

body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--glow-accent) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    will-change: transform; /* 提示浏览器优化 */
}

body::after {
    content: '';
    position: fixed;
    bottom: -300px;
    left: -200px;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, var(--glow-info) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    will-change: transform; /* 提示浏览器优化 */
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fg-dim);
}

.scanline-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9998;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, var(--scanline-opacity)) 2px,
            rgba(0, 0, 0, var(--scanline-opacity)) 4px);
    contain: strict; /* 隔离重绘范围，避免全屏重绘 */
}

.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
}

.sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-elevated);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    position: sticky;
    top: 0;
    overflow: hidden;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.sidebar-logo .icon-wrap {
    width: 36px;
    height: 36px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-mid);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 16px;
}

.sidebar-logo h1 {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--fg);
}

.sidebar-logo span {
    font-size: 10px;
    color: var(--fg-muted);
    letter-spacing: 0.5px;
}

.sidebar-logo span a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

.sidebar-logo span a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.sidebar-section {
    padding: 16px 12px 8px;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--fg-dim);
    padding: 0 8px;
    margin-bottom: 8px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
}

/* ═══════════ 平台分区 Tab ═══════════ */
.platform-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 12px 8px;
    border-bottom: 1px solid var(--border);
}

.platform-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 12px;
    font-weight: 600;
    color: var(--fg-muted);
    background: transparent;
    border: 1px solid transparent;
}

.platform-tab:hover {
    background: var(--bg-card);
    color: var(--fg);
}

.platform-tab.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent-mid);
}

.platform-tab i {
    font-size: 13px;
}

/* 区域内容切换 */
.region-section {
    display: none;
}

.region-section.active {
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-muted);
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--fg);
}

.nav-item.active {
    background: var(--accent-dim);
    color: var(--accent);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.nav-item .count {
    margin-left: auto;
    background: var(--bg-card);
    color: var(--fg-dim);
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-family: var(--font-mono);
}

.nav-item.active .count {
    background: var(--accent-mid);
    color: var(--accent);
}

.nav-parent {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-muted);
    margin-bottom: 2px;
    user-select: none;
}

.nav-parent:hover {
    background: var(--bg-card);
    color: var(--fg);
}

.nav-parent i:first-child {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.nav-toggle-icon {
    margin-left: auto;
    font-size: 10px;
    transition: transform 0.2s ease;
}

.nav-parent.open .nav-toggle-icon {
    transform: rotate(90deg);
}

.nav-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.nav-children.open {
    max-height: 120px;
}

.nav-child-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 36px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
    font-weight: 500;
    color: var(--fg-dim);
    position: relative;
    margin-bottom: 2px;
}

.nav-child-item:hover {
    background: var(--bg-card);
    color: var(--fg);
}

.nav-child-item.active {
    background: var(--accent-dim);
    color: var(--accent);
}

.nav-child-item.active::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-child-item i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.nav-child-item .count {
    margin-left: auto;
    background: var(--bg-card);
    color: var(--fg-dim);
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-family: var(--font-mono);
}

.nav-child-item.active .count {
    background: var(--accent-mid);
    color: var(--accent);
}

.session-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 12px;
    color: var(--fg-muted);
    margin-bottom: 2px;
    position: relative;
}

.session-item:hover {
    background: var(--bg-card);
    color: var(--fg);
}

.session-item.active {
    background: var(--accent-dim);
    color: var(--accent);
}

.session-item .session-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.session-item .session-info {
    flex: 1;
    min-width: 0;
}

.session-item .session-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-item .session-meta {
    font-size: 10px;
    color: var(--fg-dim);
    font-family: var(--font-mono);
}

.session-item .session-delete {
    opacity: 0;
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 4px;
    font-size: 11px;
    transition: opacity 0.15s;
}

.session-item:hover .session-delete {
    opacity: 0.7;
}

.session-item .session-delete:hover {
    opacity: 1;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.btn-new-session {
    width: 100%;
    padding: 10px;
    background: var(--accent-dim);
    border: 1px dashed var(--accent-mid);
    color: var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-new-session:hover {
    background: var(--accent-mid);
    border-style: solid;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-elevated); /* 不透明背景替代 backdrop-filter，大幅提升滚动性能 */
    border-bottom: 1px solid var(--border);
    padding: 12px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.topbar-search {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.topbar-search input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 10px 16px 10px 40px;
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s;
}

.topbar-search input::placeholder {
    color: var(--fg-dim);
}

.topbar-search input:focus {
    border-color: var(--accent);
}

.topbar-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fg-dim);
    font-size: 13px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.topbar-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--fg-muted);
    padding: 8px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-ui);
}

.topbar-btn:hover {
    background: var(--bg-card-hover);
    color: var(--fg);
    border-color: var(--border-light);
}

.topbar-btn.primary {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
    font-weight: 600;
}

.topbar-btn.primary:hover {
    opacity: 0.9;
}

.topbar-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.status-dot-running {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    animation: dotBlink 1.5s ease-in-out infinite;
}

@keyframes dotBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.page {
    display: none;
    padding: 28px;
    animation: fadeIn 0.25s ease;
}

.page.active {
    display: block;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#page-report.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 16px;
}

@media (max-width: 768px) {
    #page-report.active {
        overflow-y: auto;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.dash-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: var(--border-light);
}

.stat-card .stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--fg-dim);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    color: var(--fg);
    line-height: 1;
}

.dash-section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dash-section-title i {
    color: var(--fg-dim);
    font-size: 14px;
}

.recent-reports {
    margin-bottom: 28px;
}

.report-list-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 16px;
}

.report-list-item:hover {
    border-color: var(--accent-mid);
    background: var(--bg-card-hover);
}

.report-list-item .rli-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.report-list-item .rli-icon.platform-icon {
    background: var(--info-dim);
    color: var(--info);
}

.report-list-item .rli-info {
    flex: 1;
    min-width: 0;
}

.report-list-item .rli-query {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-list-item .rli-meta {
    font-size: 11px;
    color: var(--fg-dim);
    margin-top: 2px;
}

.tag {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag.platform {
    background: var(--info-dim);
    color: var(--info);
}

.report-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
}

.report-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
}

.report-query {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 4px;
}

.report-query code {
    color: var(--accent);
}

.report-meta-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.report-meta-item {
    font-size: 12px;
    color: var(--fg-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-meta-item i {
    color: var(--fg-dim);
    font-size: 11px;
}

.report-meta-item strong {
    color: var(--fg);
    font-weight: 500;
}

.report-main {
    flex: 1;
    min-width: 0;
}

.report-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
}

.report-section h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.report-section h3 .section-num {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    background: var(--accent-dim);
    padding: 2px 8px;
    border-radius: 4px;
}

.report-section p {
    font-size: 13px;
    line-height: 1.7;
    color: var(--fg-muted);
    margin-bottom: 12px;
}

.report-section p:last-child {
    margin-bottom: 0;
}

.report-section strong {
    color: var(--fg);
}

.report-section code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
    border: 1px solid var(--border);
}

.markdown-report {
    line-height: 1.7;
}

.markdown-report h1,
.markdown-report h2,
.markdown-report h3 {
    color: var(--fg);
    margin: 20px 0 10px;
    font-weight: 700;
}

.markdown-report h1 {
    font-size: 18px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.markdown-report h2 {
    font-size: 15px;
    color: var(--accent);
}

.markdown-report h3 {
    font-size: 13px;
}

.markdown-report p {
    color: var(--fg-muted);
    margin-bottom: 10px;
}

.markdown-report ul,
.markdown-report ol {
    margin: 0 0 10px 20px;
}

.markdown-report li {
    color: var(--fg-muted);
    line-height: 1.75;
    margin-bottom: 4px;
}

.markdown-report strong {
    color: var(--fg);
}

.markdown-report code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent);
}

.markdown-report pre {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 13px 15px;
    overflow-x: auto;
    margin: 0 0 13px;
}

.markdown-report pre code {
    background: none;
    border: none;
    padding: 0;
}

.markdown-report blockquote {
    border-left: 3px solid var(--accent);
    padding: 7px 13px;
    margin: 0 0 11px;
    background: var(--accent-dim);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.markdown-report hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

.markdown-report a {
    color: var(--accent);
    text-decoration: none;
}

.markdown-report a:hover {
    text-decoration: underline;
}

.markdown-report table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 13px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.markdown-report th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-dim);
    background: var(--bg-elevated);
    padding: 7px 11px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.markdown-report td {
    padding: 7px 11px;
    color: var(--fg-muted);
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}

.markdown-report tr:last-child td {
    border-bottom: none;
}

.selector-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.selector-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--fg-dim);
    border-bottom: 1px solid var(--border);
}

.selector-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--fg-muted);
    font-family: var(--font-mono);
    font-size: 11px;
}

.selector-table tr:last-child td {
    border-bottom: none;
}

.sel-type {
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.sel-type.location {
    background: var(--danger-dim);
    color: var(--danger);
}

.sel-type.account {
    background: var(--info-dim);
    color: var(--info);
}

.sel-type.entity {
    background: var(--warning-dim);
    color: var(--warning);
}

.sel-type.digital {
    background: var(--accent-dim);
    color: var(--accent);
}

.section-toggle {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--fg-dim);
    cursor: pointer;
    padding: 4px;
    font-size: 11px;
    transition: transform 0.2s;
}

.report-section.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.report-section.collapsed .section-body {
    display: none;
}

.dash-columns {
    display: flex;
    gap: 20px;
}

.dash-col-main {
    flex: 1;
    min-width: 0;
}

.dash-col-side {
    width: 340px;
    flex-shrink: 0;
}

.dash-session-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.dash-session-card:hover {
    border-color: var(--accent-mid);
    background: var(--bg-card-hover);
}

.dash-session-card .dsc-name {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.dash-session-card .dsc-meta {
    font-size: 11px;
    color: var(--fg-dim);
    font-family: var(--font-mono);
}

.dash-session-card .dsc-targets {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.dash-session-card .dsc-target {
    font-size: 9px;
    background: var(--accent-dim);
    color: var(--accent);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
}

.contacts-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.contacts-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.contacts-search input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 12px;
    padding: 9px 14px 9px 36px;
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s;
}

.contacts-search input:focus {
    border-color: var(--accent);
}

.contacts-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--fg-dim);
    font-size: 12px;
}

.contacts-size-control {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--fg-dim);
    font-size: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

.contacts-size-control i {
    font-size: 13px;
}

.contacts-size-control input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 90px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.contacts-size-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-card);
    cursor: pointer;
    transition: transform 0.12s;
}

.contacts-size-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.contacts-size-control input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-card);
    cursor: pointer;
}

.contacts-size-control .size-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--fg-dim);
    min-width: 28px;
    text-align: right;
}

.contacts-grid {
    --card-min-width: 320px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-min-width), 1fr));
    gap: 12px;
}

.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all 0.15s;
    cursor: pointer;
}

.contact-card:hover {
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.contact-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.contact-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.contact-card-header .ch-name {
    font-weight: 600;
    font-size: 14px;
}

.contact-card-header .ch-handle {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-dim);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.contact-detail {
    font-size: 11px;
    color: var(--fg-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.contact-detail i {
    color: var(--fg-dim);
    width: 14px;
    text-align: center;
    font-size: 11px;
}

.contact-card-footer {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.cache-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.cache-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
}

.cache-stat .cs-value {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.cache-stat .cs-label {
    font-size: 11px;
    color: var(--fg-dim);
    margin-top: 4px;
}

.cache-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cache-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.cache-item .ci-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cache-item .ci-status.fresh {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(0, 229, 155, 0.4);
}

.cache-item .ci-status.stale {
    background: var(--warning);
}

.cache-item .ci-info {
    flex: 1;
}

.cache-item .ci-key {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--fg);
    word-break: break-all;
}

.cache-item .ci-meta {
    font-size: 10px;
    color: var(--fg-dim);
    margin-top: 2px;
}

.cache-item .ci-actions {
    display: flex;
    gap: 6px;
}

.cache-item .ci-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--fg-muted);
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-family: var(--font-ui);
    transition: all 0.15s;
}

.cache-item .ci-btn:hover {
    color: var(--fg);
    border-color: var(--border-light);
}

.cache-item .ci-btn.danger:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow);
}

.modal.large {
    max-width: 700px;
}

.modal h2 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal h2 i {
    color: var(--accent);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--fg-dim);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.form-group select {
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 18px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow);
    animation: toastIn 0.3s ease;
    min-width: 280px;
}

.toast.success {
    border-left: 3px solid var(--accent);
}

.toast.success i {
    color: var(--accent);
}

.toast.error {
    border-left: 3px solid var(--danger);
}

.toast.error i {
    color: var(--danger);
}

.toast.info {
    border-left: 3px solid var(--info);
}

.toast.info i {
    color: var(--info);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--fg-dim);
}

.empty-state i {
    font-size: 40px;
    margin-bottom: 16px;
    display: block;
}

.empty-state p {
    font-size: 13px;
}

.loading-bar {
    height: 3px;
    background: var(--accent);
    width: 0%;
    animation: loadBar 2s ease-in-out forwards;
    border-radius: 3px;
    margin-bottom: 20px;
}

@keyframes loadBar {
    0% {
        width: 0%;
    }

    60% {
        width: 80%;
    }

    100% {
        width: 100%;
    }
}

.pipeline-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: 28px 20px 16px;
}

.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--fg-dim);
    transition: all 0.4s ease;
    position: relative;
}

.step-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fg-dim);
    transition: color 0.3s;
    white-space: nowrap;
}

.pipeline-connector {
    display: flex;
    align-items: center;
    padding-top: 24px;
    width: 80px;
    flex-shrink: 0;
}

.connector-line {
    width: 100%;
    height: 2px;
    background: var(--border);
    border-radius: 1px;
    transition: background 0.4s ease;
}

.pipeline-step.active .step-circle {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
    box-shadow: 0 0 16px rgba(0, 229, 155, 0.2);
}

.pipeline-step.active .step-circle i {
    animation: stepPulse 1.5s ease-in-out infinite;
}

.pipeline-step.active .step-label {
    color: var(--accent);
}

.pipeline-step.complete .step-circle {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--bg);
}

.pipeline-step.complete .step-circle i {
    animation: none;
}

.pipeline-step.complete .step-label {
    color: var(--accent);
}

.pipeline-connector.complete .connector-line {
    background: var(--accent);
}

@keyframes stepPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.pipeline-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 20px 12px;
    font-size: 13px;
    color: var(--fg-muted);
}

.pipeline-elapsed {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--fg-dim);
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 99px;
    border: 1px solid var(--border);
}

.pipeline-heartbeat {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    font-size: 11px;
    color: var(--fg-dim);
}

.pipeline-heartbeat.visible {
    display: flex;
}

.heartbeat-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    animation: heartbeatPulse 1.5s ease-in-out infinite;
}

@keyframes heartbeatPulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

.network-graph {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.media-item-container {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    aspect-ratio: 1;
}

.media-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.2s;
}

.media-item:hover {
    opacity: 0.82;
}

.media-analysis-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.72);
    color: white;
    font-size: 9px;
    padding: 4px 6px;
    max-height: 50%;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.2s;
}

.media-item-container:hover .media-analysis-overlay {
    opacity: 1;
}

.targets-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.target-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
}

.target-row .plat-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--info-dim);
    color: var(--info);
    padding: 2px 8px;
    border-radius: 4px;
}

.target-row-name {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--fg);
}

.target-row-remove {
    background: none;
    border: none;
    color: var(--fg-dim);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: var(--radius);
    transition: all 0.15s;
}

.target-row-remove:hover {
    color: var(--danger);
    background: var(--danger-dim);
}

.cache-modal-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.cache-modal-table th {
    text-align: left;
    padding: 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-dim);
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    top: 0;
}

.cache-modal-table td {
    padding: 8px;
    font-size: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--fg-muted);
}

.cache-scroll {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.entity-group {
    margin-bottom: 12px;
}

.entity-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fg-dim);
    margin-bottom: 6px;
}

.entity-pill {
    display: inline-block;
    background: var(--accent-dim);
    border: 1px solid var(--accent-mid);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--font-mono);
    margin: 0 4px 4px 0;
}

.target-chips-bar {
    position: sticky;
    top: 56px;
    z-index: 99;
    background: var(--topbar-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 7px 28px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
    min-height: 38px;
}

.target-chips-bar:empty {
    display: none;
}

.target-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 99px;
    padding: 3px 9px 3px 7px;
    font-size: 11px;
    color: var(--fg-muted);
    transition: all 0.15s;
}

.target-chip:hover {
    border-color: var(--border-light);
}

.chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fg-dim);
    flex-shrink: 0;
}

.chip-dot.fresh {
    background: var(--accent);
}

.chip-dot.stale {
    background: var(--warning);
}

.chip-dot.absent {
    background: var(--fg-dim);
}

.chip-platform {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--fg-dim);
    background: var(--accent-dim);
    padding: 1px 4px;
    border-radius: 3px;
}

.chip-remove {
    background: none;
    border: none;
    color: var(--fg-dim);
    font-size: 13px;
    line-height: 1;
    padding: 0 0 0 1px;
    opacity: 0;
    transition: all 0.15s;
    cursor: pointer;
}

.target-chip:hover .chip-remove {
    opacity: 1;
}

.chip-remove:hover {
    color: var(--danger);
}

.add-target-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.add-target-inline select,
.add-target-inline input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 4px 7px;
    border-radius: 99px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.add-target-inline select:focus,
.add-target-inline input:focus {
    border-color: var(--accent);
}

.add-target-inline input {
    width: 100px;
}

.add-target-inline input::placeholder {
    color: var(--fg-dim);
}

.add-target-inline .add-btn {
    width: 22px;
    height: 22px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--fg-dim);
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    cursor: pointer;
}

.add-target-inline .add-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.query-bar {
    position: sticky;
    top: 94px;
    z-index: 98;
    background: var(--topbar-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 10px 28px;
    flex-shrink: 0;
}

.query-bar-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 800px;
}

.query-bar-inner .query-icon {
    color: var(--fg-dim);
    font-size: 13px;
    flex-shrink: 0;
}

.query-bar-inner input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: var(--font-ui);
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.2s;
}

.query-bar-inner input::placeholder {
    color: var(--fg-dim);
}

.query-bar-inner input:focus {
    border-color: var(--accent);
}

.query-bar-inner .run-btn {
    height: 38px;
    padding: 0 20px;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    color: var(--bg);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.query-bar-inner .run-btn:hover {
    opacity: 0.9;
}

.query-bar-inner .run-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.query-bar-inner .run-btn.running {
    opacity: 0.6;
    animation: pulse-btn 1.5s ease-in-out infinite;
}

.query-bar-inner input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@keyframes pulse-btn {

    0%,
    100% {
        opacity: 0.42;
    }

    50% {
        opacity: 0.7;
    }
}

#themeToggle {
    width: 32px;
    height: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    padding: 0;
    font-size: 14px;
}

#themeToggle:hover {
    background: var(--bg-card-hover);
    color: var(--fg);
    border-color: var(--border-light);
}

.contact-in-session {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid var(--accent-mid);
    padding: 2px 8px;
    border-radius: 4px;
}

.report-header-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.report-session-name {
    font-size: 12px;
    color: var(--fg-muted);
    margin-top: 4px;
}

.report-header-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

#panelCanvas {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.panel-group {
    position: absolute;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: 220px;
    min-height: 80px;
    transition: box-shadow 0.15s;
}

.panel-group:hover {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.panel-group.active-panel {
    border-color: var(--accent-mid);
}

.panel-group.collapsed .pg-content,
.panel-group.collapsed .pg-rh {
    display: none;
}

.panel-group.collapsed {
    min-height: 32px !important;
    height: 32px !important;
}

.pg-header {
    display: flex;
    align-items: center;
    height: 32px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    cursor: move;
    user-select: none;
    touch-action: none;
    flex-shrink: 0;
    gap: 2px;
    padding-right: 4px;
}

.pg-header:hover {
    background: var(--bg-card-hover);
}

.pg-tabs {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 1px;
    padding-left: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.pg-tabs::-webkit-scrollbar {
    display: none;
}

.pg-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fg-dim);
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.12s;
    flex-shrink: 0;
}

.pg-tab:hover {
    color: var(--fg-muted);
    background: var(--bg-card-hover);
}

.pg-tab.active {
    color: var(--fg);
    background: var(--bg-elevated);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.pg-tab i {
    font-size: 9px;
}

.pg-tab-label {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-actions {
    display: flex;
    align-items: center;
    gap: 1px;
    flex-shrink: 0;
}

.fp-btn {
    width: 22px;
    height: 22px;
    background: none;
    border: none;
    color: var(--fg-dim);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: var(--radius);
    transition: all 0.12s;
    padding: 0;
}

.fp-btn:hover {
    background: var(--bg-card-hover);
    color: var(--fg);
}

.pg-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.pg-pane {
    flex: 1;
    overflow: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

.pg-pane:empty {
    display: none;
}

.fp-body {
    flex: 1;
    overflow: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 8-direction resize handles */
.pg-rh {
    position: absolute;
    z-index: 6;
    touch-action: none;
}

.pg-rh-n {
    top: -3px;
    left: 10px;
    right: 10px;
    height: 6px;
    cursor: ns-resize;
}

.pg-rh-s {
    bottom: -3px;
    left: 10px;
    right: 10px;
    height: 6px;
    cursor: ns-resize;
}

.pg-rh-e {
    right: -3px;
    top: 10px;
    bottom: 10px;
    width: 6px;
    cursor: ew-resize;
}

.pg-rh-w {
    left: -3px;
    top: 10px;
    bottom: 10px;
    width: 6px;
    cursor: ew-resize;
}

.pg-rh-ne {
    top: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    cursor: nesw-resize;
}

.pg-rh-nw {
    top: -3px;
    left: -3px;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
}

.pg-rh-se {
    bottom: -3px;
    right: -3px;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
}

.pg-rh-sw {
    bottom: -3px;
    left: -3px;
    width: 14px;
    height: 14px;
    cursor: nesw-resize;
}

.pg-rh-se::after,
.pg-rh-sw::after,
.pg-rh-ne::after,
.pg-rh-nw::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    opacity: 0.3;
    transition: opacity 0.15s;
}

.pg-rh-se::after {
    bottom: 3px;
    right: 3px;
    border-right: 2px solid var(--fg-dim);
    border-bottom: 2px solid var(--fg-dim);
}

.pg-rh-sw::after {
    bottom: 3px;
    left: 3px;
    border-left: 2px solid var(--fg-dim);
    border-bottom: 2px solid var(--fg-dim);
}

.pg-rh-ne::after {
    top: 3px;
    right: 3px;
    border-right: 2px solid var(--fg-dim);
    border-top: 2px solid var(--fg-dim);
}

.pg-rh-nw::after {
    top: 3px;
    left: 3px;
    border-left: 2px solid var(--fg-dim);
    border-top: 2px solid var(--fg-dim);
}

.pg-rh-se:hover::after,
.pg-rh-sw:hover::after,
.pg-rh-ne:hover::after,
.pg-rh-nw:hover::after {
    opacity: 0.8;
}

/* Drop zone for merge */
.pg-drop-zone {
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    pointer-events: none;
    z-index: 10;
    transition: all 0.2s;
}

.pg-drop-zone.show {
    border-color: var(--accent);
    background: rgba(0, 229, 155, 0.06);
    box-shadow: inset 0 0 20px rgba(0, 229, 155, 0.08);
}

/* Snap guide */
.snap-guide {
    position: absolute;
    background: var(--accent);
    opacity: 0.5;
    pointer-events: none;
    z-index: 9999;
}

/* Pin */
.pg-pin-btn i {
    transition: transform 0.15s, color 0.15s;
}

.panel-group[data-pinned="true"] .pg-pin-btn i {
    color: var(--accent);
    transform: rotate(45deg);
}

.panel-group[data-pinned="true"] .pg-header {
    cursor: default;
}

.panel-group[data-pinned="true"] .pg-rh {
    cursor: default;
}

/* Detach ghost */
.panel-group.detach-ghost {
    position: fixed;
    z-index: 99999;
    pointer-events: none;
    opacity: 0.7;
    border: 1px dashed var(--accent);
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    min-width: 0;
    min-height: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.panel-group.detach-ghost .pg-header {
    padding: 4px 10px;
    height: auto;
    min-height: 28px;
}

.fp-scroll {
    padding: 16px 20px;
}

.fp-contacts-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.fp-contacts-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.fp-contacts-toolbar input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 8px;
    font-size: 11px;
    color: var(--fg);
    outline: none;
    font-family: var(--font-mono);
    transition: border-color 0.15s;
}

.fp-contacts-toolbar input:focus {
    border-color: var(--accent);
}

.fp-contacts-toolbar input::placeholder {
    color: var(--fg-dim);
}

.fp-graph-container {
    --graph-height: 170px;
    height: var(--graph-height);
    min-height: 60px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.fp-graph-resizer {
    height: 6px;
    background: transparent;
    cursor: ns-resize;
    flex-shrink: 0;
    position: relative;
    margin-top: -1px;
}

.fp-graph-resizer::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 3px;
    border-radius: 2px;
    background: var(--fg-dim);
    opacity: 0;
    transition: opacity 0.15s;
}

.fp-graph-resizer:hover::after {
    opacity: 0.6;
}

.fp-graph-resizer:active::after {
    opacity: 0.9;
    background: var(--accent);
}

.fp-graph-container svg {
    width: 100%;
    height: 100%;
    cursor: grab;
}

.fp-graph-container svg:active {
    cursor: grabbing;
}

.graph-zoom-ctrl {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    z-index: 5;
}

.gz-btn {
    width: 24px;
    height: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg-dim);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s;
    padding: 0;
}

.gz-btn:hover {
    background: var(--bg-card-hover);
    color: var(--fg);
    border-color: var(--accent);
}

.fp-contacts-list {
    flex: 1;
    overflow-y: auto;
}

.fp-contact-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s;
}

.fp-contact-row:hover {
    background: var(--bg-card-hover);
}

.fp-contact-avatar {
    width: 24px;
    height: 24px;
    background: var(--bg-card-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 9px;
    color: var(--fg-muted);
    flex-shrink: 0;
    text-transform: uppercase;
}

.fp-contact-info {
    flex: 1;
    min-width: 0;
}

.fp-contact-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-contact-detail {
    font-size: 9px;
    color: var(--fg-dim);
    margin-top: 1px;
    font-family: var(--font-mono);
}

.fp-plat-badge {
    display: inline-block;
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1px 4px;
    border-radius: 3px;
    background: var(--accent-dim);
    color: var(--accent);
}

.fp-itype {
    display: inline-block;
    font-size: 8px;
    padding: 0px 3px;
    border-radius: 3px;
    border: 1px solid var(--border);
    color: var(--fg-dim);
}

.fp-itype.retweet {
    border-color: rgba(71, 179, 255, 0.3);
    color: var(--info);
}

.fp-itype.mention {
    border-color: rgba(0, 229, 155, 0.3);
    color: var(--accent);
}

.fp-itype.repo_interaction {
    border-color: rgba(167, 139, 250, 0.3);
    color: #a78bfa;
}

.fp-contact-weight {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.weight-bar-wrap {
    width: 24px;
    height: 3px;
    background: var(--bg-card-hover);
    border-radius: 2px;
    overflow: hidden;
}

.weight-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
}

.weight-num {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--fg-dim);
    width: 14px;
    text-align: right;
}

.fp-contact-add {
    width: 20px;
    height: 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg-dim);
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.12s;
    padding: 0;
}

.fp-contact-add:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.fp-contact-add.in-session {
    border-color: var(--accent-mid);
    color: var(--accent);
    background: var(--accent-dim);
    cursor: default;
    opacity: 0.5;
}

.fp-entity-group {
    margin-bottom: 10px;
    padding: 8px 12px;
}

.fp-entity-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--fg-dim);
    margin-bottom: 5px;
}

.fp-entity-pill {
    display: inline-block;
    background: var(--accent-dim);
    border: 1px solid var(--accent-mid);
    color: var(--accent);
    padding: 2px 7px;
    border-radius: var(--radius);
    font-size: 10px;
    font-family: var(--font-mono);
    margin: 0 3px 3px 0;
}

.fp-history-item {
    padding: 7px 10px;
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: all 0.12s;
}

.fp-history-item:hover {
    background: var(--bg-card-hover);
}

.fp-history-item.active {
    background: var(--accent-dim);
    border-left-color: var(--accent);
}

.fp-history-query {
    font-size: 11px;
    color: var(--fg-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.fp-history-ts {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--fg-dim);
    margin-top: 1px;
}

.panel-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--fg-dim);
    font-size: 11px;
    line-height: 1.7;
}

.graph-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-dim);
    font-size: 11px;
    text-align: center;
    flex-direction: column;
    gap: 8px;
}

.graph-empty i {
    font-size: 24px;
    color: var(--border-light);
}

.node-source circle {
    fill: var(--accent);
    stroke: var(--bg-card);
    stroke-width: 2.5px;
}

.node-contact circle {
    fill: var(--bg-card-hover);
    stroke: var(--border-light);
    stroke-width: 1.5px;
    cursor: pointer;
}

.node-contact:hover circle {
    fill: var(--accent-dim);
    stroke: var(--accent);
}

.node-label {
    font-family: var(--font-mono);
    font-size: 9px;
    fill: var(--fg-muted);
    pointer-events: none;
}

.graph-link {
    stroke: var(--border-light);
    stroke-opacity: 0.5;
}

.timeline-section {
    margin-bottom: 24px;
}

.timeline-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--fg);
    margin-bottom: 4px;
}

.timeline-subtitle {
    font-size: 12px;
    color: var(--fg-muted);
    margin-bottom: 16px;
}

.timeline-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: 40px repeat(24, 1fr);
    gap: 2px;
    margin-top: 8px;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 2px;
    transition: transform 0.1s;
}

.heatmap-cell:hover {
    transform: scale(1.15);
    z-index: 10;
    position: relative;
    border: 1px solid var(--border-light);
}

.heatmap-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--fg-dim);
    align-self: center;
    text-align: right;
    padding-right: 6px;
}

.bar {
    fill: var(--accent);
    transition: fill 0.15s;
}

.bar:hover {
    fill: var(--info);
}

.axis text {
    font-family: var(--font-mono);
    font-size: 10px;
    fill: var(--fg-muted);
}

.axis path,
.axis line {
    stroke: var(--border-light);
}

.chart-tooltip {
    position: fixed;
    text-align: center;
    padding: 6px 10px;
    font-size: 11px;
    font-family: var(--font-ui);
    background: var(--bg-elevated);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    pointer-events: none;
    opacity: 0;
    box-shadow: var(--shadow);
    z-index: 10000;
    transition: opacity 0.15s;
}

/* ═══════════════ HAMBURGER BUTTON ═══════════════ */
.hamburger-btn {
    display: none;
}

/* ═══════════════ SIDEBAR OVERLAY ═══════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
}

.sidebar-overlay.active {
    display: block;
}

/* ═══════════════ RESPONSIVE: ≤1200px ═══════════════ */
@media (max-width: 1200px) {
    .dash-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-columns {
        flex-direction: column;
    }

    .dash-col-side {
        width: 100%;
    }
}

/* ═══════════════ RESPONSIVE: ≤768px (TABLETS & PHONES) ═══════════════ */
@media (max-width: 768px) {

    .scanline-overlay {
        display: none;
    }

    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        min-width: 40px;
        padding: 0;
        font-size: 18px;
        order: -1;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        height: 100dvh;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: none;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    }

    .sidebar-footer {
        order: -1;
        border-top: none;
        border-bottom: 1px solid var(--border);
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .topbar {
        padding: 10px 12px;
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
        gap: 8px;
        position: sticky;
        top: 0;
        backdrop-filter: none;
        background: var(--bg-elevated);
    }

    .topbar-search {
        max-width: none;
    }

    .topbar-search input {
        font-size: 16px;
        padding: 10px 14px 10px 38px;
    }

    .page {
        padding: 16px 12px;
    }

    #page-report.active {
        padding: 12px 8px;
        overflow-y: auto;
    }

    .dash-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-card .stat-value {
        font-size: 22px;
    }

    .report-query {
        font-size: 15px;
    }

    .report-header-top {
        flex-direction: column;
        gap: 12px;
    }

    .report-header-actions {
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
    }

    .report-meta-row {
        gap: 12px;
    }

    .report-section {
        padding: 16px 12px;
    }

    .hide-mobile {
        display: none;
    }

    .query-bar {
        padding: 8px 12px;
        position: sticky;
        top: 56px;
        backdrop-filter: none;
        background: var(--bg-elevated);
    }

    .query-bar-inner input {
        font-size: 16px;
        padding: 10px 10px;
    }

    .query-bar-inner .run-btn {
        height: 42px;
        padding: 0 14px;
        font-size: 13px;
    }

    .target-chips-bar {
        padding: 7px 12px;
        position: sticky;
        top: 56px;
        backdrop-filter: none;
        background: var(--bg-elevated);
    }

    .target-chips-bar #targetChips {
        flex-wrap: wrap;
    }

    .add-target-inline {
        flex-wrap: wrap;
    }

    .add-target-inline select {
        flex: 0 0 auto;
    }

    .add-target-inline input {
        min-width: 100px;
        font-size: 16px;
    }

    .contacts-grid {
        grid-template-columns: 1fr;
    }

    .contacts-toolbar {
        flex-direction: column;
        gap: 8px;
    }

    .contacts-size-control {
        display: none;
    }

    .contacts-search input {
        font-size: 16px;
    }

    .cache-stats {
        grid-template-columns: 1fr;
    }

    #page-cache>div[style*="display:flex"] {
        flex-wrap: wrap;
    }

    .modal-overlay {
        padding: 12px;
        align-items: flex-end;
    }

    .modal {
        width: 100%;
        max-width: none;
        max-height: 90vh;
        overflow-y: auto;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        padding: 20px 16px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }

    .modal.large {
        max-width: none;
    }

    .modal .form-actions {
        flex-direction: column;
    }

    .modal .form-actions .topbar-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    .modal h2 {
        font-size: 16px;
    }

    .modal input,
    .modal select {
        font-size: 16px !important;
    }

    #modalTargets .form-group>div[style*="display:flex"] {
        flex-wrap: wrap;
    }

    #modalTargets .form-group select {
        flex: 1 1 100% !important;
    }

    #modalTargets .form-group input {
        flex: 1;
        font-size: 16px;
    }

    .panel-group {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        height: auto !important;
        margin-bottom: 8px;
        border-radius: var(--radius);
    }

    .panel-group .pg-rh {
        display: none !important;
    }

    .panel-group .pg-content {
        height: auto !important;
        max-height: 60vh;
        overflow-y: auto;
    }

    #panelCanvas {
        display: flex;
        flex-direction: column;
        height: auto !important;
        overflow-y: auto !important;
        position: relative !important;
    }

    .pg-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .pg-tab {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .pg-tab-label {
        white-space: nowrap;
    }

    .pg-actions button {
        min-width: 36px;
        min-height: 36px;
    }

    .snap-guide {
        display: none !important;
    }

    .pipeline-stepper {
        padding: 20px 12px 12px;
    }

    .step-circle {
        width: 42px;
        height: 42px;
        font-size: 14px;
    }

    .pipeline-connector {
        width: 48px;
        padding-top: 20px;
    }

    .step-label {
        font-size: 10px;
    }

    .media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .toast-container {
        left: 8px;
        right: 8px;
        bottom: 8px;
        top: auto;
    }

    .toast {
        font-size: 13px;
        padding: 10px 14px;
    }

    .markdown-report table,
    .selector-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .heatmap-grid {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }

    .session-item .session-delete {
        opacity: 0.5;
        min-width: 36px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .chip-remove {
        opacity: 0.6;
        min-width: 28px;
        min-height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .media-analysis-overlay {
        opacity: 0.85;
    }

    .cache-item .ci-actions .ci-btn {
        min-width: 36px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-overlay {
        backdrop-filter: none;
        background: rgba(0, 0, 0, 0.75);
    }

    .fp-contact-add {
        min-width: 32px;
        min-height: 32px;
    }
}

/* ═══════════════ RESPONSIVE: ≤480px (SMALL PHONES) ═══════════════ */
@media (max-width: 480px) {
    .dash-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-card .stat-value {
        font-size: 20px;
    }

    .stat-card .stat-label {
        font-size: 10px;
    }

    .sidebar-logo h1 {
        font-size: 13px;
    }

    .report-list-item {
        padding: 12px;
        gap: 10px;
    }

    .report-list-item .rli-icon {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .report-list-item .rli-query {
        font-size: 12px;
    }

    .report-section {
        padding: 12px 10px;
    }

    .report-section h3 {
        font-size: 13px;
    }

    .report-section p {
        font-size: 13px;
    }

    .topbar-btn {
        padding: 10px 10px;
        min-height: 40px;
    }

    .media-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .contact-card {
        padding: 12px;
    }

    .contact-card-footer {
        flex-direction: column;
        gap: 6px;
    }

    .contact-card-footer .topbar-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ═══════════════ LOGIN OVERLAY ═══════════════ */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .icon-wrap {
    width: 56px;
    height: 56px;
    background: var(--accent-dim);
    border: 1px solid var(--accent-mid);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 24px;
    margin-bottom: 16px;
}

.login-logo h1 {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--fg);
    margin-bottom: 6px;
}

.login-logo p {
    font-size: 13px;
    color: var(--fg-muted);
}

.login-card .form-group {
    margin-bottom: 18px;
}

.login-card .form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--fg-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-card .form-group input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg);
    font-family: var(--font-ui);
    font-size: 14px;
    transition: border-color 0.15s;
}

.login-card .form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.login-error {
    font-size: 12px;
    color: var(--danger);
    min-height: 18px;
    margin-bottom: 8px;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    color: #000;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s;
}

.login-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ═══════════════ AUTH TABS / REGISTER ═══════════════ */
.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 4px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--fg-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.auth-tab.active {
    background: var(--accent, #4f46e5);
    color: #fff;
}

.sms-btn {
    white-space: nowrap;
    padding: 10px 16px;
    background: rgba(79, 70, 229, 0.15);
    border: 1px solid var(--accent, #4f46e5);
    color: var(--accent, #4f46e5);
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
}

.sms-btn:hover:not(:disabled) {
    background: rgba(79, 70, 229, 0.25);
}

.sms-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.topbar-credits {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(251, 191, 36, 0.1);
    border-radius: 20px;
    margin-right: 8px;
    transition: background 0.15s;
}

.topbar-credits:hover {
    background: rgba(251, 191, 36, 0.2);
}

/* ═══════════════ SCRAPED DATA PAGE ═══════════════ */
.scraped-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.scraped-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    flex: 1;
    min-width: 120px;
    text-align: center;
    transition: border-color 0.15s;
}

.scraped-stat-card:hover {
    border-color: var(--border-light);
}

.scraped-stat-value {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1.2;
}

.scraped-stat-label {
    font-size: 11px;
    color: var(--fg-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.scraped-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.scraped-filter-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--fg-muted);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.scraped-filter-btn:hover {
    background: var(--bg-card-hover);
    color: var(--fg);
}

.scraped-filter-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent-mid);
    color: var(--accent);
}

.scraped-refresh-info {
    font-size: 11px;
    color: var(--fg-dim);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.scraped-refresh-info i {
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.scraped-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.scraped-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: border-color 0.15s, transform 0.15s;
}

.scraped-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.scraped-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.scraped-platform-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scraped-platform-badge.douyin {
    background: rgba(0, 0, 0, 0.3);
    color: #fe2c55;
    border: 1px solid rgba(254, 44, 85, 0.3);
}

.scraped-platform-badge.xiaohongshu {
    background: rgba(255, 36, 66, 0.1);
    color: #ff2442;
    border: 1px solid rgba(255, 36, 66, 0.3);
}

.scraped-platform-badge.kuaishou {
    background: rgba(255, 135, 0, 0.1);
    color: #ff8700;
    border: 1px solid rgba(255, 135, 0, 0.3);
}

.scraped-platform-badge.bilibili {
    background: rgba(0, 161, 216, 0.1);
    color: #00a1d8;
    border: 1px solid rgba(0, 161, 216, 0.3);
}

.scraped-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.scraped-card-author {
    font-size: 12px;
    color: var(--fg-muted);
    margin-bottom: 10px;
}

.scraped-card-author i {
    margin-right: 4px;
    font-size: 10px;
}

.scraped-card-metrics {
    display: flex;
    gap: 14px;
    margin-bottom: 10px;
}

.scraped-metric {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--fg-muted);
    font-family: var(--font-mono);
}

.scraped-metric i {
    font-size: 10px;
    color: var(--fg-dim);
}

.scraped-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
}

.scraped-tag {
    font-size: 10px;
    padding: 2px 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--fg-muted);
}

.scraped-card-time {
    font-size: 10px;
    color: var(--fg-dim);
    font-family: var(--font-mono);
}

.scraped-card-time i {
    margin-right: 4px;
}

.scraped-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--fg-muted);
}

.scraped-empty i {
    font-size: 40px;
    color: var(--fg-dim);
    margin-bottom: 12px;
}

.scraped-empty p {
    font-size: 14px;
}
/* ═══════════════ Intelligence Analysis Page ═══════════════ */

.analysis-hero {
    text-align: center;
    padding: 30px 20px 20px;
}
.analysis-hero-icon {
    width: 64px; height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2, #47b3ff));
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 28px; color: #fff;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(0,229,155,0.3);
}
.analysis-hero h2 {
    font-size: 22px; font-weight: 600; margin: 0 0 6px;
}
.analysis-hero-desc {
    color: var(--fg-muted); font-size: 13px; margin: 0;
}

.analysis-input-area {
    max-width: 700px; margin: 0 auto 24px; padding: 0 16px;
}
.analysis-input-row {
    display: flex; gap: 10px; align-items: flex-start;
}
.analysis-textarea {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--fg);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}
.analysis-textarea:focus {
    border-color: var(--accent);
}
.analysis-submit-btn {
    background: linear-gradient(135deg, var(--accent), var(--accent-2, #47b3ff));
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.1s;
}
.analysis-submit-btn:hover { opacity: 0.9; }
.analysis-submit-btn:active { transform: scale(0.97); }
.analysis-submit-btn:disabled {
    opacity: 0.5; cursor: not-allowed;
}

.analysis-quick-tags {
    display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px;
}
.quick-tag {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.quick-tag:hover {
    border-color: var(--accent);
    background: rgba(0,229,155,0.08);
}

/* ═══════════════ 竞品/舆情 内嵌配置面板 ═══════════════ */

/* ═══════════════ 账号分析输入区 ═══════════════ */
.account-input-area {
    max-width: 700px; margin: 0 auto 24px; padding: 0 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--fg-muted);
    margin-top: 4px;
}

.brand-config-panel {
    max-width: 700px; margin: 0 auto 24px; padding: 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    animation: slideDown 0.2s ease;
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.brand-config-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.brand-config-header h3 {
    font-size: 16px; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
    color: var(--fg);
}
.brand-config-header h3 i { color: var(--accent); }
.brand-config-close {
    background: none; border: none; color: var(--fg-dim);
    font-size: 18px; cursor: pointer; padding: 4px 8px;
    border-radius: var(--radius); transition: all 0.15s;
}
.brand-config-close:hover { color: var(--fg); background: var(--bg-card); }
.brand-config-desc {
    font-size: 13px; color: var(--fg-muted); margin-bottom: 20px;
}
.brand-config-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.brand-config-grid .form-group { margin-bottom: 0; }
.brand-config-panel .form-group { margin-bottom: 16px; }
.brand-config-panel .form-group label {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--fg-dim); margin-bottom: 6px;
}
.brand-config-panel .form-group input {
    width: 100%; background: var(--bg-card);
    border: 1px solid var(--border); color: var(--fg);
    font-size: 13px; padding: 10px 14px;
    border-radius: var(--radius); outline: none;
    transition: border-color 0.2s; font-family: inherit;
}
.brand-config-panel .form-group input:focus { border-color: var(--accent); }
.req { color: #ef4444; }

/* 平台多选 chips */
.platform-chips {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.platform-chip {
    padding: 7px 18px; border-radius: 20px;
    font-size: 13px; cursor: pointer;
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--fg-muted); transition: all 0.15s;
    user-select: none;
}
.platform-chip:hover { border-color: var(--accent); }
.platform-chip.active {
    background: rgba(0,229,155,0.12);
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 600;
}

.brand-config-actions {
    display: flex; gap: 12px; justify-content: flex-end;
    margin-top: 20px; padding-top: 16px;
    border-top: 1px solid var(--border);
}
.brand-config-actions .analysis-submit-btn { padding: 10px 28px; }

@media (max-width: 640px) {
    .brand-config-grid { grid-template-columns: 1fr; }
}

/* Pipeline Progress */
.analysis-progress-area {
    max-width: 700px; margin: 0 auto 24px; padding: 0 16px;
}
.analysis-pipeline {
    display: flex; align-items: center; justify-content: center;
    gap: 0; flex-wrap: wrap; margin-bottom: 16px;
}
.pipeline-stage {
    display: flex; flex-direction: column; align-items: center;
    min-width: 70px; text-align: center;
}
.stage-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: var(--fg-muted);
    transition: all 0.3s;
}
.pipeline-stage.running .stage-icon {
    border-color: var(--accent);
    color: var(--accent);
    animation: pulse-glow 1.5s infinite;
}
.pipeline-stage.completed .stage-icon {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}
.pipeline-stage.failed .stage-icon {
    border-color: var(--danger, #ff4d6a);
    color: var(--danger, #ff4d6a);
}
.stage-label {
    font-size: 11px; color: var(--fg-muted); margin-top: 4px;
}
.pipeline-stage.completed .stage-label { color: var(--accent); }
.stage-status {
    font-size: 10px; color: var(--fg-muted); margin-top: 2px;
}
.pipeline-connector {
    width: 20px; height: 2px;
    background: var(--border);
    margin: 0 2px;
    align-self: center;
    margin-bottom: 18px;
}

.analysis-progress-bar {
    height: 4px; background: var(--bg-card); border-radius: 2px;
    overflow: hidden; margin-bottom: 8px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2, #47b3ff));
    border-radius: 2px;
    transition: width 0.5s ease;
}
.analysis-progress-text {
    text-align: center; font-size: 12px; color: var(--fg-muted);
}

/* Result Area */
.analysis-result-area {
    max-width: 800px; margin: 0 auto 24px; padding: 0 16px;
}
.analysis-result-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.analysis-result-header h3 {
    font-size: 16px; font-weight: 600; margin: 0;
}
.analysis-result-actions {
    display: flex; gap: 6px;
}
.analysis-report-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    font-size: 14px;
    line-height: 1.7;
    max-height: 600px;
    overflow-y: auto;
}
.analysis-report-content h1 { font-size: 20px; border-bottom: 2px solid var(--accent); padding-bottom: 8px; }
.analysis-report-content h2 { font-size: 17px; margin-top: 20px; color: var(--accent); }
.analysis-report-content h3 { font-size: 15px; margin-top: 16px; }
.analysis-report-content table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.analysis-report-content th, .analysis-report-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; font-size: 13px; }
.analysis-report-content th { background: rgba(0,229,155,0.05); }
.analysis-report-content blockquote { background: rgba(0,229,155,0.05); border-left: 3px solid var(--accent); padding: 8px 16px; margin: 12px 0; }
.analysis-report-content ul, .analysis-report-content ol { padding-left: 20px; }
.analysis-report-content li { margin: 4px 0; }
.analysis-report-content hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* History Area */
.analysis-history-area {
    max-width: 700px; margin: 0 auto; padding: 0 16px 40px;
}
.analysis-history-area h3 {
    font-size: 15px; font-weight: 600; margin-bottom: 12px;
}
.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.history-item:hover { border-color: var(--accent); }
.history-item-header {
    display: flex; justify-content: space-between; align-items: center;
}
.history-item-request {
    font-size: 13px; font-weight: 500;
}
.history-item-taskno {
    display: inline-block;
    font-size: 11px; font-weight: 700;
    color: var(--accent, #00e59b);
    background: rgba(0,229,155,0.1);
    padding: 1px 6px; border-radius: 4px;
    margin-right: 6px; vertical-align: middle;
    font-family: 'SF Mono', Monaco, monospace;
}
.taskno-badge {
    font-size: 10px; font-weight: 700;
    color: #47b3ff; background: rgba(71,179,255,0.1);
    padding: 1px 5px; border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
}
.history-item-status {
    font-size: 11px; padding: 2px 8px; border-radius: 10px;
}
.history-item-status.completed { background: rgba(0,229,155,0.15); color: var(--accent); }
.history-item-status.failed { background: rgba(255,77,106,0.15); color: var(--danger, #ff4d6a); }
.history-item-status.running { background: rgba(71,179,255,0.15); color: #47b3ff; }
.history-item-meta {
    font-size: 11px; color: var(--fg-muted); margin-top: 4px;
}
.history-item-error {
    font-size: 11px; color: var(--danger, #ff4d6a); margin-top: 6px;
    background: rgba(255,77,106,0.08); border-radius: 6px; padding: 4px 8px;
    word-break: break-all; line-height: 1.4;
}
.history-item-error i { margin-right: 4px; }

/* Badge */
.badge-new {
    background: var(--accent);
    color: #fff;
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: auto;
    font-weight: 600;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0,229,155,0.4); }
    50% { box-shadow: 0 0 12px 4px rgba(0,229,155,0.2); }
}

/* ═══════════ Dashboard V2 ═══════════ */
.stat-sub {
    font-size: 11px; color: var(--fg-muted); margin-top: 4px;
}

.dashboard-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}
.dashboard-section .section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 16px;
}
.dashboard-section .section-header h3 {
    font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.dashboard-row {
    display: flex; gap: 16px; margin-bottom: 16px;
}
.dashboard-row .dashboard-section {
    flex: 1; margin-bottom: 0;
}
@media (max-width: 768px) {
    .dashboard-row { flex-direction: column; }
}

/* Competitor Grid */
.competitor-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px;
}
.competitor-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    transition: border-color 0.2s;
}
.competitor-card:hover { border-color: var(--accent); }
.competitor-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.competitor-name { font-size: 14px; font-weight: 600; }
.competitor-platforms { font-size: 14px; color: var(--fg-muted); display: flex; gap: 6px; }
.competitor-meta {
    font-size: 11px; color: var(--fg-muted); display: flex; gap: 12px;
}

/* Sentiment Overview */
.sentiment-overview { padding: 8px 0; }
.sentiment-bar {
    display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin-bottom: 12px;
}
.sentiment-positive { background: #00e59b; }
.sentiment-neutral { background: #6c757d; }
.sentiment-negative { background: #ff4d6a; }
.sentiment-legend {
    display: flex; gap: 16px; font-size: 12px; color: var(--fg-muted); margin-bottom: 12px;
}
.sentiment-legend .dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px;
}
.sentiment-detail { font-size: 13px; }

/* Topics List */
.topics-list { max-height: 300px; overflow-y: auto; }
.topic-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.topic-item:last-child { border-bottom: none; }
.topic-rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}
.topic-item:nth-child(1) .topic-rank {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #000;
}
.topic-item:nth-child(2) .topic-rank {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #000;
}
.topic-item:nth-child(3) .topic-rank {
    background: linear-gradient(135deg, #cd7f32, #b87333);
    color: #fff;
}
.topic-name {
    font-size: 13px;
    color: var(--fg);
}

/* Alerts List */
.alerts-list { max-height: 200px; overflow-y: auto; }
.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.alert-item:hover {
    border-color: var(--danger);
    background: var(--danger-dim);
}
.alert-item i {
    color: var(--danger);
    font-size: 16px;
}
.alert-item .alert-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.alert-item .alert-message {
    font-size: 13px;
    font-weight: 500;
}
.alert-item .alert-time {
    font-size: 11px;
    color: var(--fg-muted);
}

/* Empty State */
.empty-state {
    text-align: center; padding: 40px 20px; color: var(--fg-muted);
}
.empty-state i { font-size: 32px; margin-bottom: 12px; display: block; opacity: 0.4; }
.empty-state p { font-size: 13px; margin-bottom: 12px; }

/* Page Header */
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 24px; margin-bottom: 8px;
}
.page-header h2 {
    font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px;
}

/* ═══════════ Subscribe ═══════════ */
.subscribe-types {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    padding: 0 24px; margin-bottom: 24px;
}
@media (max-width: 768px) {
    .subscribe-types { grid-template-columns: 1fr; }
}
.subscribe-type-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}
.subscribe-type-card .type-icon {
    width: 44px; height: 44px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.subscribe-type-card .type-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.subscribe-type-card .type-info p { font-size: 12px; color: var(--fg-muted); }

.subscribe-list {
    padding: 0 24px;
}
.subscribe-item {
    display: flex; align-items: center; gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}
.subscribe-item:hover { border-color: var(--accent); }
.subscribe-item-icon {
    width: 36px; height: 36px; border-radius: 8px;
    background: var(--accent-dim); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; flex-shrink: 0;
}
.subscribe-item-info { flex: 1; }
.subscribe-item-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.subscribe-item-meta {
    font-size: 11px; color: var(--fg-muted); display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.subscribe-type-badge {
    background: var(--accent-dim); color: var(--accent);
    padding: 1px 8px; border-radius: 8px; font-size: 10px; font-weight: 600;
}
.subscribe-item-actions { flex-shrink: 0; }

/* Subscribe Prompt (after analysis) */
.subscribe-prompt {
    display: flex; align-items: center; gap: 16px;
    background: linear-gradient(135deg, var(--accent-dim), var(--info-dim));
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin: 20px 24px;
}
.subscribe-prompt-icon {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.subscribe-prompt-text { flex: 1; }
.subscribe-prompt-text h4 { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.subscribe-prompt-text p { font-size: 12px; color: var(--fg-muted); }

/* Checkbox Group */
.checkbox-group {
    display: flex; gap: 16px; flex-wrap: wrap;
}
.checkbox-group label {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; cursor: pointer;
}
.checkbox-group input[type="checkbox"] {
    accent-color: var(--accent);
}

/* History Page */
.history-list {
    padding: 0 24px; max-width: 800px;
}

/* ═══════════ 快速分析入口 ═══════════ */
.quick-analyze-section {
    padding: 40px 24px 24px;
    text-align: center;
}
.quick-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--fg), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.quick-input-wrap {
    max-width: 700px;
    margin: 0 auto 20px;
    position: relative;
    display: flex;
    align-items: center;
}
.quick-input {
    flex: 1;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 16px 56px 16px 20px;
    font-size: 16px;
    color: var(--fg);
    outline: none;
    transition: all 0.3s;
}
.quick-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-dim);
}
.quick-submit {
    position: absolute;
    right: 6px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2, #47b3ff));
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}
.quick-submit:hover {
    transform: scale(1.05);
}
.quick-templates {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.template-btn {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--fg-muted);
    cursor: pointer;
    transition: all 0.2s;
}
.template-btn:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
}

/* ═══════════ 示例报告 ═══════════ */
.demo-section {
    padding: 0 24px 24px;
}
.demo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 900px) {
    .demo-grid { grid-template-columns: 1fr; }
}
.demo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
}
.demo-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.demo-preview {
    padding: 20px;
}
.demo-tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    margin-bottom: 12px;
}
.demo-tag.hot {
    background: rgba(255, 77, 106, 0.15);
    color: #ff4d6a;
}
.demo-tag.sentiment {
    background: rgba(0, 229, 155, 0.15);
    color: #00e59b;
}
.demo-tag.competitor {
    background: rgba(71, 179, 255, 0.15);
    color: #47b3ff;
}
.demo-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}
.demo-desc {
    font-size: 13px;
    color: var(--fg-muted);
    line-height: 1.5;
    margin-bottom: 16px;
}
.demo-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--fg-dim);
}
.demo-stats i {
    margin-right: 4px;
}

/* ═══════════ 最近分析 ═══════════ */
.recent-section {
    padding: 0 24px 24px;
}
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.recent-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.recent-item:hover {
    border-color: var(--accent-mid);
}
.recent-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-dim);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.recent-content {
    flex: 1;
    min-width: 0;
}
.recent-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recent-meta {
    font-size: 12px;
    color: var(--fg-muted);
}
.recent-status {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
}
.recent-status.completed {
    background: rgba(0, 229, 155, 0.15);
    color: #00e59b;
}
.recent-status.running {
    background: rgba(71, 179, 255, 0.15);
    color: #47b3ff;
}
.view-all {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
}
.view-all:hover {
    text-decoration: underline;
}

/* ═══════════ 空状态引导 ═══════════ */
.empty-guide {
    text-align: center;
    padding: 60px 24px;
}
.empty-illustration {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: var(--accent);
}
.empty-guide h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}
.empty-guide p {
    font-size: 14px;
    color: var(--fg-muted);
}
.capability-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (max-width: 768px) {
    .capability-grid { grid-template-columns: 1fr; }
}
.capability-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: all 0.2s;
}
.capability-card:hover {
    border-color: var(--accent-mid);
    transform: translateY(-2px);
}
.capability-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.capability-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}
.capability-content p {
    font-size: 12px;
    color: var(--fg-muted);
    line-height: 1.5;
    margin-bottom: 8px;
}
.capability-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.cap-tag {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 10px;
    color: var(--fg-muted);
}

/* ═══════════ Enhanced Modal ═══════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 500;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal-overlay.show {
    display: flex;
}
.modal {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}
.modal-header h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-header h2 i {
    color: var(--accent);
}
.modal-close {
    background: none;
    border: none;
    color: var(--fg-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius);
    transition: all 0.2s;
}
.modal-close:hover {
    background: var(--bg-elevated);
    color: var(--fg);
}
.modal-body {
    padding: 24px;
}
.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}
.form-group {
    margin-bottom: 20px;
}
.form-group:last-child {
    margin-bottom: 0;
}
.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--fg);
    margin-bottom: 8px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 14px;
    padding: 12px 14px;
    border-radius: var(--radius);
    outline: none;
    transition: all 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7a8d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.checkbox-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--fg-muted);
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.2s;
}
.checkbox-group label:hover {
    border-color: var(--accent-mid);
}
.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}
.checkbox-group input[type="checkbox"]:checked + span,
.checkbox-group label:has(input:checked) {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ═══════════════ 导出按钮 ═══════════════ */
.history-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-sm {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.btn-excel {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.btn-excel:hover {
    background: rgba(34, 197, 94, 0.3);
}

.btn-word {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.btn-word:hover {
    background: rgba(59, 130, 246, 0.3);
}

.btn-retry {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.btn-retry:hover {
    background: rgba(168, 85, 247, 0.3);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.3);
}

.recent-item-actions {
    margin-left: auto;
    margin-right: 8px;
}

/* ═══════════════ 历史详情页 ═══════════════ */
.detail-backbar {
    margin-bottom: 16px;
}

.detail-search-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.detail-search-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.detail-search-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.detail-search-body {
    flex: 1;
    min-width: 0;
}

.detail-search-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.detail-search-title-row h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
    word-break: break-word;
}

.detail-search-meta {
    font-size: 12px;
    color: var(--fg-muted);
    line-height: 1.5;
}

.detail-intent {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.detail-intent-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.detail-intent-label {
    font-size: 12px;
    color: var(--fg-muted);
    margin-right: 4px;
}

.detail-intent-label i {
    margin-right: 3px;
}

.detail-keyword-chip {
    display: inline-block;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 6px;
    background: rgba(59,130,246,0.12);
    color: #60a5fa;
    margin-bottom: 2px;
}


/* ═════════════ 充值成功动画 ═════════════ */
.recharge-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.recharge-success-overlay.show {
    opacity: 1;
}

.recharge-success-card {
    background: var(--bg-card, #fff);
    border-radius: 20px;
    padding: 40px 36px 32px;
    max-width: 340px;
    width: 90%;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
    transform: scale(0.85) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.recharge-success-overlay.show .recharge-success-card {
    transform: scale(1) translateY(0);
}

/* SVG 勾选动画 */
.checkmark-svg {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    display: block;
}

.checkmark-circle {
    stroke: #10b981;
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: checkmark-circle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    stroke: #10b981;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: checkmark-check 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

@keyframes checkmark-circle {
    to { stroke-dashoffset: 0; }
}

@keyframes checkmark-check {
    to { stroke-dashoffset: 0; }
}

.recharge-success-amount {
    font-size: 36px;
    font-weight: 800;
    color: #10b981;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    animation: amountBounce 0.5s ease 0.7s both;
}

.recharge-success-amount span {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted, #999);
    margin-left: 4px;
}

.recharge-success-desc {
    font-size: 14px;
    color: var(--text-muted, #888);
    margin-bottom: 24px;
    animation: fadeInUp 0.4s ease 0.9s both;
}

.recharge-success-btn {
    padding: 12px 0;
    width: 100%;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    animation: fadeInUp 0.4s ease 1.1s both;
}

.recharge-success-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.recharge-success-btn:active {
    transform: translateY(0);
}

@keyframes amountBounce {
    0% { opacity: 0; transform: scale(0.5); }
    60% { transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}