@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg-color: #0f172a;
    --panel-bg: #1e293b;
    --accent-color: #38bdf8;
    --secondary-color: #fbbf24;
    --text-main: #f1f5f9;
    --border-color: #334155;
    --slider-track-height: 6px;
    --slider-track-start: rgba(56, 189, 248, 0.95);
    --slider-track-end: rgba(139, 92, 246, 0.85);
    --slider-track-fade: rgba(56, 189, 248, 0.1);
    --slider-thumb-size: 18px;
    --slider-thumb-glow: rgba(56, 189, 248, 0.45);
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    overflow: hidden;
}

body.landing-active {
    overflow: hidden;
}

body.landing-active .navbar,
body.landing-active #view-container,
body.landing-active #global-ai-panel {
    opacity: 0;
    pointer-events: none;
    filter: blur(6px);
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease, filter 0.6s ease;
}


/* =========================================
   SpaceX Style Portal Landing
   ========================================= */

/* Portal Header */
#portal-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 88px;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 48px;
    column-gap: 24px;
    background: linear-gradient(120deg, rgba(8, 12, 23, 0.78), rgba(14, 20, 35, 0.35));
    backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    box-shadow: 0 20px 60px rgba(2, 6, 23, 0.45);
    transition: transform 0.3s ease;
}

body:not(.landing-active) #portal-header {
    transform: translateY(-100%);
    pointer-events: none;
}

.header-left,
.header-center,
.header-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-left {
    justify-content: flex-start;
}

.header-center {
    flex: 1.4;
    justify-content: center;
    text-align: center;
}

.header-right {
    justify-content: flex-end;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: #f8fafc;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.brand-mark img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    filter: drop-shadow(0 6px 22px rgba(56, 189, 248, 0.25));
    transition: transform 0.35s ease, filter 0.35s ease;
}

.brand-mark:hover img {
    transform: translateY(-1px) scale(1.02);
    filter: drop-shadow(0 8px 30px rgba(56, 189, 248, 0.45));
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1;
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.24em;
}

.brand-meta {
    font-size: 11px;
    letter-spacing: 0.42em;
    color: var(--accent-color);
    opacity: 0.85;
}

.project-brief {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: rgba(226, 232, 240, 0.85);
    text-transform: uppercase;
    text-shadow: 0 6px 18px rgba(2, 6, 23, 0.65);
    padding-left: 30px;
}

.project-brief::before {
    content: "";
    position: absolute;
    left: 0;
    width: 22px;
    height: 1.5px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0), rgba(56, 189, 248, 0.85));
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.45);
}

.project-brief::after {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.45);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

#digital-clock {
    font-family: 'Space Mono', 'Roboto Mono', 'Space Grotesk', monospace;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    color: #f8fafc;
    text-align: right;
    text-shadow: 0 8px 16px rgba(2, 6, 23, 0.7);
    font-variant-numeric: tabular-nums;
}

.clock-date {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.75);
}

.clock-time {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--accent-color);
}

/* Background Canvas */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
    /* Subtle background */
    transition: opacity 0.5s ease;
}

body:not(.landing-active) #bg-canvas {
    opacity: 0;
}

/* Snap Scroll Container */
.snap-container {
    position: fixed;
    inset: 0;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    z-index: 50;
    background: transparent;
    /* Changed from #0f172a to allow canvas */
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.7) rgba(148, 163, 184, 0.12);
}

.snap-container::-webkit-scrollbar {
    width: 10px;
}

.snap-container::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.12);
    border-radius: 999px;
    margin: 4px 0;
}

.snap-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.65), rgba(59, 130, 246, 0.65));
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.6);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.snap-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.9), rgba(59, 130, 246, 0.9));
}

/* Portal Background (Base) */
body.landing-active {
    background: #0f172a;
}


body:not(.landing-active) .snap-container {
    display: none;
}

/* Sections */
.snap-section {
    position: relative;
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 10%;
    box-sizing: border-box;
    overflow: hidden;
}

.section-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.3;
    background-size: cover;
    background-position: center;
    transition: transform 10s ease-out;
}

.snap-section:hover .section-bg {
    transform: scale(1.05);
}

/* Background Gradients for each section - Made clearer for text */
#section-overview .section-bg {
    background: radial-gradient(circle at 80% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 60%);
}

#section-landscape .section-bg {
    background: radial-gradient(circle at 80% 50%, rgba(16, 185, 129, 0.15) 0%, transparent 60%);
}

#section-flow .section-bg {
    background: radial-gradient(circle at 80% 50%, rgba(245, 158, 11, 0.15) 0%, transparent 60%);
}

#section-wordcloud .section-bg {
    background: radial-gradient(circle at 80% 50%, rgba(236, 72, 153, 0.15) 0%, transparent 60%);
}

#section-leaderboard .section-bg {
    background: radial-gradient(circle at 80% 50%, rgba(251, 191, 36, 0.15) 0%, transparent 60%);
}

#section-ai .section-bg {
    background: radial-gradient(circle at 80% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 60%);
}

.section-content {
    position: relative;
    z-index: 10;
    max-width: 600px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.snap-section.active .section-content {
    opacity: 1;
    transform: translateY(0);
}

.section-tag {
    font-size: 12px;
    letter-spacing: 0.2em;
    color: var(--accent-color);
    margin-bottom: 16px;
    display: block;
    font-weight: 600;
}

.snap-section h1 {
    font-size: 48px;
    margin: 0 0 24px;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.section-desc {
    font-size: 16px;
    line-height: 1.6;
    color: #cbd5f5;
    margin-bottom: 40px;
    max-width: 480px;
}

.enter-view-btn {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 14px 32px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.enter-view-btn:hover {
    background: #fff;
    color: #000;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4);
}

/* Side Navigation */
.side-nav {
    position: fixed;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

body:not(.landing-active) .side-nav {
    display: none;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

.dot.active {
    background: transparent;
    border-color: #fff;
    transform: scale(1.4);
}

/* Scroll Controls */
.scroll-controls {
    position: fixed;
    right: 22px;
    bottom: 28px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

.scroll-controls::before {
    display: none;
}

body:not(.landing-active) .scroll-controls {
    display: none;
}

.scroll-controls .scroll-btn {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.32), rgba(59, 130, 246, 0.1)), rgba(8, 15, 30, 0.85);
    color: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
    overflow: visible;
}

.scroll-controls .scroll-btn::before {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    border: 1px solid rgba(56, 189, 248, 0.4);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.scroll-controls .scroll-btn:focus-visible {
    outline: none;
    border-color: rgba(56, 189, 248, 0.85);
    box-shadow: 0 22px 44px rgba(15, 23, 42, 0.85), 0 0 32px rgba(56, 189, 248, 0.55);
}

.scroll-controls .scroll-btn:hover {
    transform: translateX(-6px);
    border-color: rgba(56, 189, 248, 0.75);
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.8), 0 0 36px rgba(56, 189, 248, 0.4);
    background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.4), rgba(59, 130, 246, 0.18)), rgba(5, 11, 25, 0.95);
}

.scroll-controls .scroll-btn:hover::before,
.scroll-controls .scroll-btn:focus-visible::before {
    opacity: 1;
}

.scroll-controls .icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.scroll-controls .icon-svg {
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.45));
    transition: transform 0.4s ease;
}

.scroll-controls .icon-svg line:not(.icon-bar),
.scroll-controls .icon-svg polyline {
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 36;
    stroke-dashoffset: 0;
    opacity: 0.85;
    transition: stroke-dashoffset 0.5s ease, opacity 0.4s ease, stroke 0.3s ease;
}

.scroll-controls .icon-svg .icon-bar {
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    fill: none;
    opacity: 0.6;
    stroke-dasharray: 20;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.45s ease, opacity 0.4s ease;
}

.scroll-controls .scroll-btn:hover .icon-svg line:not(.icon-bar),
.scroll-controls .scroll-btn:hover .icon-svg polyline,
.scroll-controls .scroll-btn:focus-visible .icon-svg line:not(.icon-bar),
.scroll-controls .scroll-btn:focus-visible .icon-svg polyline {
    stroke-dashoffset: -36;
    opacity: 1;
}

.scroll-controls .scroll-btn:hover .icon-svg .icon-bar,
.scroll-controls .scroll-btn:focus-visible .icon-svg .icon-bar {
    stroke-dashoffset: -20;
    opacity: 0.9;
}

.scroll-controls .scroll-btn:hover .icon-svg,
.scroll-controls .scroll-btn:focus-visible .icon-svg {
    transform: translateY(-1px) scale(1.02);
}

.scroll-controls .scroll-btn .label {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(12px);
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(4, 12, 24, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #e2e8f0;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.scroll-controls .scroll-btn:hover .label,
.scroll-controls .scroll-btn:focus-visible .label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

@media (max-width: 768px) {
    .scroll-controls {
        right: 12px;
        bottom: 14px;
        padding: 10px;
        gap: 8px;
    }

    .scroll-controls .scroll-btn {
        width: 38px;
        height: 38px;
    }

    .scroll-controls .scroll-btn .label {
        display: none;
    }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    #portal-header {
        padding: 0 20px;
        height: 78px;
    }

    .snap-section {
        padding-left: 20px;
        padding-right: 20px;
    }

    .snap-section h1 {
        font-size: 32px;
    }

    .side-nav,
    .scroll-controls {
        right: 10px;
    }

    .project-brief {
        display: none;
    }

    .brand-mark img {
        width: 52px;
        height: 52px;
    }

    .brand-title {
        letter-spacing: 0.18em;
    }
}


/* 导航栏样式 */
.navbar {
    height: 68px;
    background: linear-gradient(125deg, rgba(8, 12, 23, 0.85), rgba(15, 23, 42, 0.48));
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    gap: 28px;
    backdrop-filter: blur(16px) saturate(130%);
}

.navbar .brand-mark {
    cursor: pointer;
    gap: 12px;
}

.navbar .brand-mark img {
    width: 58px;
    height: 58px;
}

.navbar .brand-title {
    font-size: 16px;
    letter-spacing: 0.18em;
}

.navbar .brand-meta {
    font-size: 10px;
    letter-spacing: 0.32em;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
    margin-left: auto;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}

.nav-links li {
    cursor: pointer;
    opacity: 0.7;
    transition: 0.3s;
}

.nav-links li.active,
.nav-links li:hover {
    opacity: 1;
    color: var(--accent-color);
}

/* 视图网格布局 */
#view-container {
    height: calc(100vh - 68px);
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    overflow-y: auto;
    transition: opacity 0.35s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.7) rgba(148, 163, 184, 0.12);
}

#view-container::-webkit-scrollbar {
    width: 10px;
}

#view-container::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.12);
    border-radius: 999px;
}

#view-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.65), rgba(59, 130, 246, 0.65));
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.6);
}

#view-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.9), rgba(59, 130, 246, 0.9));
}

#view-container.is-transitioning {
    opacity: 0.15;
}

/* 模拟学长的五视图网格 [cite: 4] */
.dashboard-grid {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    grid-template-rows: 1fr 250px;
    gap: 15px;
    height: 100%;
}

.panel {
    background: var(--panel-bg);
    border-radius: 12px;
    border: 1px solid #334155;
    padding: 15px;
    position: relative;
}

.chart-placeholder {
    height: 180px;
    border: 1px dashed #475569;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    color: #94a3b8;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.placeholder {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 8px;
}

.empty-state {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #475569;
    border-radius: 12px;
    color: #94a3b8;
    font-size: 16px;
}

.overview-grid {
    display: grid;
    grid-template-columns: minmax(260px, 0.34fr) minmax(0, 0.66fr);
    grid-template-rows: minmax(300px, 0.45fr) minmax(220px, 0.55fr);
    grid-template-areas:
        "controls trend"
        "controls insights";
    gap: 12px;
    height: 100%;
    align-items: stretch;
}

.overview-controls {
    grid-area: controls;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.panel.overview-controls {
    padding: 12px 14px;
}

.overview-controls>h2 {
    margin: 0;
    font-size: 18px;
}

.overview-controls>p {
    margin: 2px 0 6px;
    font-size: 12px;
    color: #cbd5f5;
}

.overview-trend {
    grid-area: trend;
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.overview-trend svg {
    width: 100%;
    height: 100%;
}

.overview-insights {
    grid-area: insights;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.control-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.control-row,
.flow-timeline-row,
.wordcloud-control {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(148, 163, 184, 0.12);
    position: relative;
    overflow: hidden;
    transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}

.control-row::before,
.flow-timeline-row::before,
.wordcloud-control::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: inherit;
    background: radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.25), rgba(15, 23, 42, 0.2) 55%, transparent 80%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.control-row:hover,
.flow-timeline-row:hover,
.wordcloud-control:hover {
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.75), inset 0 0 20px rgba(56, 189, 248, 0.12);
    transform: translateY(-1px);
}

.control-row:hover::before,
.flow-timeline-row:hover::before,
.wordcloud-control:hover::before {
    opacity: 0.75;
}

.control-row label {
    font-size: 13px;
    color: #94a3b8;
}

.control-row-head {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.control-row.is-disabled {
    opacity: 0.6;
}

.control-slider {
    width: 100%;
}

.control-row.is-disabled .control-slider {
    pointer-events: none;
}

.control-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--accent-color);
}

:is(.control-value, .flow-timeline-value, .wordcloud-control-value) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    padding: 4px 16px;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: radial-gradient(circle at 25% 25%, rgba(56, 189, 248, 0.4), rgba(15, 23, 42, 0.2) 60%), rgba(15, 23, 42, 0.7);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.75), inset 0 0 18px rgba(56, 189, 248, 0.2);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
    transition: color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

:is(.control-row, .flow-timeline-row, .wordcloud-control):hover :is(.control-value, .flow-timeline-value, .wordcloud-control-value) {
    color: #f8fafc;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.85), inset 0 0 22px rgba(56, 189, 248, 0.32);
    transform: translateY(-1px);
}

.overview-controls input[type="range"] {
    width: 100%;
    accent-color: var(--accent-color);
}

.overview-slider-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
    min-height: auto;
    margin-top: 4px;
}

.overview-slider-panel .control-row-head {
    gap: 6px;
}

.overview-slider-panel label {
    font-size: 12px;
    letter-spacing: 0.08em;
}

.overview-slider-panel .control-value {
    font-size: 16px;
    min-width: 52px;
    padding: 2px 10px;
}

/* 指标卡片增强 */
.metric-card {
    border: 1px solid var(--border-color);
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.7));
    transition: all 0.3s ease;
    cursor: default;
}

.metric-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.15);
}

.metric-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.metric-value {
    font-size: 28px;
    font-weight: 600;
    margin: 4px 0;
}

.metric-subtitle {
    font-size: 12px;
    color: #94a3b8;
}

.metric-delta {
    font-size: 12px;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.metric-delta.negative {
    color: #f87171;
}

.metric-delta.muted {
    color: #94a3b8;
}

.overview-controls .metric-card {
    padding: 10px 12px;
}

.overview-controls .metric-label,
.overview-controls .metric-delta,
.overview-controls .metric-subtitle {
    font-size: 11px;
}

.overview-controls .metric-value {
    font-size: 24px;
}

.overview-trend {
    overflow: visible;
}

.count-area {
    fill: url(#count-gradient);
}

.cite-line {
    fill: none;
    stroke: var(--secondary-color);
    stroke-width: 3px;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.4));
}

.axis text {
    fill: #94a3b8;
    font-size: 12px;
}

.axis path,
.axis line {
    stroke: #334155;
}

.axis-label {
    fill: #94a3b8;
    font-size: 12px;
}

.focus-line {
    stroke: rgba(248, 250, 252, 0.6);
    stroke-width: 1.5px;
    stroke-dasharray: 4 4;
}

.focus-dot {
    stroke: #0f172a;
    stroke-width: 1.5px;
    filter: drop-shadow(0 0 6px rgba(15, 23, 42, 0.8));
}

.focus-dot-count {
    fill: var(--accent-color);
}

.focus-dot-cites {
    fill: var(--secondary-color);
}

.chart-tooltip {
    position: absolute;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 10px 14px;
    pointer-events: none;
    font-size: 13px;
    color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.6);
}

.chart-tooltip.hidden {
    display: none;
}

.delta-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-color);
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.delta-pill.negative {
    background: rgba(248, 113, 113, 0.18);
    color: #f87171;
}

.delta-pill.muted {
    background: rgba(148, 163, 184, 0.18);
    color: #94a3b8;
}

.delta-pill.new {
    background: rgba(52, 211, 153, 0.18);
    color: #4ade80;
}

.delta-pill.positive {
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.chart-tooltip .delta-pill {
    margin-left: 6px;
}

.metric-panel {
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.78);
    box-shadow: inset 0 0 18px rgba(2, 6, 23, 0.35);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric-panel h3 {
    margin: 0;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #cbd5f5;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.overview-mini-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.45fr) minmax(0, 1.18fr);
    gap: 10px;
    width: 100%;
    align-items: stretch;
}

.overview-mini-panel {
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.78);
    box-shadow: inset 0 0 18px rgba(2, 6, 23, 0.4);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.overview-mini-panel h3 {
    margin: 0;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #e2e8f0;
}

.overview-mini-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.overview-mini-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(30, 41, 59, 0.65);
    font-size: 12px;
    color: #cbd5f5;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.overview-mini-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.overview-mini-item .value {
    font-weight: 600;
    color: var(--accent-color);
    font-size: 12px;
}

.overview-keyword-list .label {
    letter-spacing: 0.04em;
}

.overview-keyword-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 10px;
}

.overview-keyword-list .overview-mini-item {
    padding: 4px 6px;
    font-size: 11.5px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
}

@media (max-width: 1280px) {
    .overview-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "controls"
            "trend"
            "insights";
    }

    .overview-trend,
    .overview-insights {
        min-height: auto;
    }

    .metric-grid,
    .overview-mini-grid {
        grid-template-columns: 1fr;
    }

    .overview-keyword-list {
        grid-template-columns: 1fr;
    }
}

.insight-tip {
    color: #94a3b8;
    font-size: 13px;
}

.overview-insights h2,
.overview-insights .insight-block h3 {
    font-size: 16px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.overview-insights h2 {
    margin-bottom: 8px;
}

.insight-snapshot {
    color: #cbd5f5;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.insight-block {
    border-top: 1px solid #334155;
    padding-top: 12px;
}

.insight-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

/* 列表条目样式 */
.insight-item {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin-bottom: 4px;
}

.insight-label {
    font-weight: 500;
    color: var(--accent-color);
}

.insight-value {
    font-family: 'Space Grotesk';
    font-weight: 700;
}

.keyword-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    columns: 2;
    gap: 20px;
    font-size: 13px;
    color: #e2e8f0;
}

.keyword-list li {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.keyword-list li:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

.landscape-layout {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    gap: 18px;
    height: 100%;
    transition: grid-template-columns 0.4s ease;
}

.landscape-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
    height: 100%;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.55) rgba(15, 23, 42, 0.55);
}

.landscape-controls::-webkit-scrollbar {
    width: 8px;
}

.landscape-controls::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.55);
    border-radius: 999px;
}

.landscape-controls::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.55), rgba(59, 130, 246, 0.55));
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.65);
    box-shadow: 0 4px 10px rgba(2, 6, 23, 0.6);
}

.landscape-controls::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.8), rgba(59, 130, 246, 0.8));
}

.landscape-controls select,
.landscape-controls input[type="range"] {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 6px 10px;
    color: #e2e8f0;
    font-size: 13px;
}

.landscape-mini-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.control-row.mini-card {
    width: 100%;
    padding: 6px 10px;
    min-height: 0;
    align-items: stretch;
    gap: 3px;
    border-radius: 9px;
}

.control-row.mini-card label {
    font-size: 10px;
    letter-spacing: 0.08em;
}

.control-row.mini-card .control-row-head {
    gap: 4px;
}

.control-row.mini-card .control-value {
    font-size: 14px;
    min-width: 50px;
    padding: 1px 8px;
}

.landscape-controls .control-slider,
.overview-controls input[type="range"],
.flow-timeline-slider input,
.wordcloud-control input[type="range"] {
    accent-color: var(--accent-color);
    margin-top: 8px;
    padding: 0;
    border: none;
    background: transparent;
    width: 100%;
    height: 34px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    position: relative;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.18));
    transition: filter 0.3s ease;
}

.control-row.mini-card .control-slider {
    margin-top: 0;
    height: 22px;
    --slider-track-height: 2px;
    --slider-thumb-size: 13px;
}

.overview-slider-panel input[type="range"] {
    margin-top: 0;
    height: 24px;
}

.landscape-controls .control-slider::-webkit-slider-runnable-track,
.overview-controls input[type="range"]::-webkit-slider-runnable-track,
.flow-timeline-slider input::-webkit-slider-runnable-track,
.wordcloud-control input[type="range"]::-webkit-slider-runnable-track {
    height: var(--slider-track-height);
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    background: linear-gradient(120deg, var(--slider-track-start), var(--slider-track-end));
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.7), inset 0 0 18px rgba(56, 189, 248, 0.2);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.landscape-controls .control-slider::-webkit-slider-thumb,
.overview-controls input[type="range"]::-webkit-slider-thumb,
.flow-timeline-slider input::-webkit-slider-thumb,
.wordcloud-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--slider-thumb-size);
    height: var(--slider-thumb-size);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: radial-gradient(circle at 30% 30%, #ffffff, rgba(56, 189, 248, 0.35)), linear-gradient(145deg, rgba(30, 64, 175, 0.9), rgba(59, 130, 246, 0.6));
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.65), 0 0 18px var(--slider-thumb-glow);
    margin-top: calc((var(--slider-track-height) - var(--slider-thumb-size)) / 2);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: grab;
}

.landscape-controls .control-slider::-moz-range-track,
.overview-controls input[type="range"]::-moz-range-track,
.flow-timeline-slider input::-moz-range-track,
.wordcloud-control input[type="range"]::-moz-range-track {
    height: var(--slider-track-height);
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    background: linear-gradient(120deg, var(--slider-track-start), var(--slider-track-end));
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.7), inset 0 0 18px rgba(56, 189, 248, 0.2);
}

.landscape-controls .control-slider::-moz-range-progress,
.overview-controls input[type="range"]::-moz-range-progress,
.flow-timeline-slider input::-moz-range-progress,
.wordcloud-control input[type="range"]::-moz-range-progress {
    height: var(--slider-track-height);
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    background: linear-gradient(120deg, var(--slider-track-start), var(--slider-track-end));
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.7), inset 0 0 18px rgba(56, 189, 248, 0.2);
}

.landscape-controls .control-slider::-moz-range-thumb,
.overview-controls input[type="range"]::-moz-range-thumb,
.flow-timeline-slider input::-moz-range-thumb,
.wordcloud-control input[type="range"]::-moz-range-thumb {
    width: var(--slider-thumb-size);
    height: var(--slider-thumb-size);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: radial-gradient(circle at 30% 30%, #ffffff, rgba(56, 189, 248, 0.35)), linear-gradient(145deg, rgba(30, 64, 175, 0.9), rgba(59, 130, 246, 0.6));
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.65), 0 0 18px var(--slider-thumb-glow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: grab;
}

.landscape-controls .control-slider:hover,
.overview-controls input[type="range"]:hover,
.flow-timeline-slider input:hover,
.wordcloud-control input[type="range"]:hover {
    filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.26));
}

.landscape-controls .control-slider:focus-visible,
.overview-controls input[type="range"]:focus-visible,
.flow-timeline-slider input:focus-visible,
.wordcloud-control input[type="range"]:focus-visible {
    outline: none;
    filter: drop-shadow(0 0 18px rgba(56, 189, 248, 0.45));
}

.landscape-controls .control-slider:active::-webkit-slider-thumb,
.overview-controls input[type="range"]:active::-webkit-slider-thumb,
.flow-timeline-slider input:active::-webkit-slider-thumb,
.wordcloud-control input[type="range"]:active::-webkit-slider-thumb,
.landscape-controls .control-slider:focus-visible::-webkit-slider-thumb,
.overview-controls input[type="range"]:focus-visible::-webkit-slider-thumb,
.flow-timeline-slider input:focus-visible::-webkit-slider-thumb,
.wordcloud-control input[type="range"]:focus-visible::-webkit-slider-thumb {
    transform: scale(1.12);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.85), 0 0 24px rgba(56, 189, 248, 0.65);
}

.landscape-controls .control-slider:active::-moz-range-thumb,
.overview-controls input[type="range"]:active::-moz-range-thumb,
.flow-timeline-slider input:active::-moz-range-thumb,
.wordcloud-control input[type="range"]:active::-moz-range-thumb,
.landscape-controls .control-slider:focus-visible::-moz-range-thumb,
.overview-controls input[type="range"]:focus-visible::-moz-range-thumb,
.flow-timeline-slider input:focus-visible::-moz-range-thumb,
.wordcloud-control input[type="range"]:focus-visible::-moz-range-thumb {
    transform: scale(1.12);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.85), 0 0 24px rgba(56, 189, 248, 0.65);
}

.landscape-controls .control-slider:disabled,
.overview-controls input[type="range"]:disabled,
.flow-timeline-slider input:disabled,
.wordcloud-control input[type="range"]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: none;
}

.landscape-controls .control-slider:disabled::-webkit-slider-runnable-track,
.overview-controls input[type="range"]:disabled::-webkit-slider-runnable-track,
.flow-timeline-slider input:disabled::-webkit-slider-runnable-track,
.wordcloud-control input[type="range"]:disabled::-webkit-slider-runnable-track {
    border-color: rgba(148, 163, 184, 0.25);
    background: linear-gradient(120deg, rgba(148, 163, 184, 0.35), rgba(100, 116, 139, 0.2));
    box-shadow: none;
}

.landscape-controls .control-slider:disabled::-webkit-slider-thumb,
.overview-controls input[type="range"]:disabled::-webkit-slider-thumb,
.flow-timeline-slider input:disabled::-webkit-slider-thumb,
.wordcloud-control input[type="range"]:disabled::-webkit-slider-thumb,
.landscape-controls .control-slider:disabled::-moz-range-thumb,
.overview-controls input[type="range"]:disabled::-moz-range-thumb,
.flow-timeline-slider input:disabled::-moz-range-thumb,
.wordcloud-control input[type="range"]:disabled::-moz-range-thumb {
    border-color: rgba(148, 163, 184, 0.35);
    box-shadow: none;
    background: rgba(30, 41, 59, 0.9);
    cursor: not-allowed;
}

.landscape-stage {
    grid-row: 1;
    min-height: 420px;
    padding: 0;
    position: relative;
    overflow: hidden;
    transition: min-height 0.4s ease, border-radius 0.4s ease, box-shadow 0.4s ease;
}

.landscape-stage-status {
    position: absolute;
    left: 16px;
    top: 16px;
    z-index: 3;
    font-size: 12px;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    padding: 4px 12px;
    pointer-events: none;
}

.landscape-mini-map {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 150px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(4, 9, 20, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(12px);
    z-index: 6;
}

.landscape-mini-map h4 {
    margin: 0 0 4px;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.75);
}

.landscape-mini-map svg {
    width: 100%;
    height: 110px;
    cursor: pointer;
}

.mini-backdrop {
    fill: rgba(15, 23, 42, 0.72);
    stroke: rgba(148, 163, 184, 0.25);
}

.mini-point-layer circle {
    fill: var(--accent-color);
}

.mini-viewport {
    fill: rgba(251, 191, 36, 0.12);
    stroke: #fbbf24;
    stroke-width: 1.5px;
    stroke-dasharray: 6 4;
    pointer-events: none;
}

@media (max-width: 1280px) {
    .landscape-mini-map {
        display: none;
    }
}


.landscape-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 12px;
}

.landscape-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.landscape-label-root {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.semantic-anchor-chip,
.paper-chip {
    pointer-events: none;
}

.semantic-anchor-chip .chip-bg,
.paper-chip .chip-bg {
    fill: rgba(15, 23, 42, 0.65);
    stroke: rgba(148, 163, 184, 0.4);
    stroke-width: 1px;
    backdrop-filter: blur(14px);
    filter: drop-shadow(0 10px 26px rgba(2, 6, 23, 0.65));
}

.semantic-anchor-chip .chip-text,
.paper-chip .chip-text {
    fill: #f8fafc;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-shadow: 0 2px 8px rgba(2, 6, 23, 0.65);
}

.semantic-anchor rect {
    fill: rgba(15, 23, 42, 0.85);
    stroke: rgba(56, 189, 248, 0.5);
    stroke-width: 1.5px;
    backdrop-filter: blur(4px);
}

.semantic-anchor text {
    fill: #f8fafc;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.semantic-island {
    pointer-events: none;
}

.semantic-island .chip-bg {
    fill: rgba(15, 23, 42, 0.8);
    stroke: rgba(248, 250, 252, 0.35);
    stroke-width: 1px;
    filter: drop-shadow(0 12px 24px rgba(2, 6, 23, 0.7));
}

.semantic-island .chip-text {
    fill: #e2e8f0;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-shadow: 0 2px 6px rgba(2, 6, 23, 0.9);
}

.density-layer path {
    stroke-linejoin: round;
}

.landscape-legend {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.45);
    font-size: 12px;
    color: #94a3b8;
}

.landscape-legend p {
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.landscape-legend-gradient {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.landscape-legend-gradient .gradient-bar {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: inset 0 0 12px rgba(2, 6, 23, 0.6);
}

.legend-range-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 11px;
    color: #94a3b8;
}

.legend-year {
    font-size: 11px;
    letter-spacing: 0.04em;
    color: #cbd5f5;
}

.legend-arrow {
    font-size: 12px;
    letter-spacing: 0.2em;
    color: rgba(203, 213, 245, 0.65);
}

.legend-tip {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: #cbd5f5;
}

.landscape-era-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.era-chip {
    font-size: 11px;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.45);
    color: #0f172a;
    font-weight: 600;
    background: rgba(248, 250, 252, 0.7);
    text-transform: uppercase;
}

.landscape-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.landscape-mini-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}
.control-row.mini-card {
    width: 100%;
    padding: 8px 12px;
    min-height: 0;
    align-items: stretch;
    gap: 4px;
    border-radius: 10px;
}
    color: #e2e8f0;
}

.landscape-legend-item .swatch {
    width: 14px;
    height: 14px;
    width: 54px;
    height: 54px;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

.landscape-summary {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    font-size: 13px;
    color: #cbd5f5;
}

.landscape-digest {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.55);
}

.digest-tip {
    margin: 0 0 10px;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: #94a3b8;
    text-transform: uppercase;
}

.landscape-digest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.digest-card {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    padding: 10px 12px;
    background: radial-gradient(circle at top, rgba(56, 189, 248, 0.12), rgba(15, 23, 42, 0.6));
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.digest-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.digest-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
}

.digest-detail {
    font-size: 12px;
    color: #cbd5f5;
}

.digest-empty {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    padding: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.3);
    border-radius: 10px;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #94a3b8;
}

.toggle span {
    background: none;
    border: none;
    padding: 0;
}


.landscape-hover {
    border: 1px dashed rgba(148, 163, 184, 0.4);
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 13px;
    color: #e2e8f0;
    background: rgba(9, 13, 25, 0.72);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.6);
}

.stage-hover {
    position: absolute;
    left: 18px;
    bottom: 18px;
    width: min(280px, 28%);
    max-height: 200px;
    overflow-y: auto;
    pointer-events: auto;
    z-index: 4;
    padding: 10px 12px;
    border-radius: 12px;
}

.landscape-hover.active {
    border-color: var(--accent-color);
    box-shadow: 0 18px 36px rgba(56, 189, 248, 0.2);
}

.landscape-hover h3 {
    margin: 0 0 4px;
    font-size: 15px;
}

.hover-meta {
    color: #94a3b8;
    margin: 0 0 6px;
}

.flow-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    height: 100%;
}

.flow-layout>.panel {
    min-height: 0;
}

.flow-controls {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.55) rgba(15, 23, 42, 0.55);
}

.flow-controls::-webkit-scrollbar,
.flow-stage::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.flow-controls::-webkit-scrollbar-track,
.flow-stage::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.55);
    border-radius: 999px;
}

.flow-controls::-webkit-scrollbar-thumb,
.flow-stage::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.55), rgba(59, 130, 246, 0.55));
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.6);
    box-shadow: 0 4px 10px rgba(2, 6, 23, 0.6);
}

.flow-controls::-webkit-scrollbar-thumb:hover,
.flow-stage::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.8), rgba(59, 130, 246, 0.8));
}

.flow-tip {
    font-size: 13px;
    color: #94a3b8;
    margin-top: -6px;
}

.flow-control-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.flow-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.flow-button.tiny {
    padding: 4px 10px;
    font-size: 11px;
}

.flow-timeline-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.flow-timeline-slider {
    flex: 1 1 220px;
    min-width: 200px;
}

.flow-timeline-slider input {
    width: 100%;
    accent-color: var(--accent-color);
}

.flow-timeline-slider input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.flow-timeline-value {
    min-width: 82px;
    font-weight: 600;
    font-size: 18px;
}

.flow-year-all-btn.is-active {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.flow-control-group label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.flow-select,
.flow-search {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #e2e8f0;
    padding: 8px 12px;
    font-size: 13px;
}

.flow-select:focus,
.flow-search:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.flow-reset-row {
    display: flex;
    gap: 12px;
}

.flow-button {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: var(--accent-color);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flow-button:hover {
    background: rgba(56, 189, 248, 0.2);
}

.flow-button.ghost {
    background: transparent;
    border-color: var(--border-color);
    color: #cbd5f5;
}

.flow-summary {
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    padding-top: 12px;
}

.flow-summary h3 {
    margin: 0 0 10px;
    font-size: 14px;
    letter-spacing: 0.05em;
    color: #e2e8f0;
}

.flow-summary-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flow-summary-item {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 8px;
    padding: 8px 10px;
}

.flow-summary-title {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.flow-summary-title .delta-pill {
    margin-left: 8px;
}

.flow-summary-value {
    font-weight: 600;
    font-size: 18px;
    color: var(--text-main);
}

.flow-summary-empty {
    font-size: 12px;
    color: #94a3b8;
}

.flow-stage {
    position: relative;
    overflow: auto;
    padding: 0;
    max-height: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 189, 248, 0.55) rgba(15, 23, 42, 0.55);
    scrollbar-gutter: stable both-edges;
}

.flow-stage-legend {
    position: absolute;
    top: 14px;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent 55%), rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(248, 250, 252, 0.2);
    color: #f8fafc;
    text-shadow: 0 0 12px currentColor;
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.55);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: default;
    z-index: 4;
}

.flow-stage-legend::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 12px currentColor;
}

.flow-stage-legend:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 18px 30px rgba(2, 6, 23, 0.65), 0 0 18px currentColor;
    border-color: currentColor;
}

.flow-stage-legend.legend-problem {
    left: 16px;
    color: #34d399;
}

.flow-stage-legend.legend-method {
    right: 16px;
    color: #60a5fa;
}

.flow-stage-status {
    position: absolute;
    left: 50%;
    top: 16px;
    transform: translateX(-50%);
    font-size: 12px;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 999px;
    padding: 4px 12px;
    pointer-events: none;
    z-index: 2;
    text-align: center;
}

.flow-zoom-controls {
    position: absolute;
    right: 16px;
    top: 16px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.flow-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.flow-chart {
    width: 100%;
    height: 100%;
}

.node-label {
    fill: #f8fafc;
    font-size: clamp(18px, 1.2vw, 26px);
    font-weight: 600;
    letter-spacing: 0.08em;
    paint-order: stroke fill;
    stroke: rgba(2, 6, 23, 0.8);
    stroke-width: 2px;
    stroke-linejoin: round;
    text-shadow: 0 8px 18px rgba(2, 6, 23, 0.75);
}

.legend-item {
    border-left: 4px solid;
    padding-left: 8px;
    font-size: 12px;
    color: #cbd5f5;
}

.flow-links path.is-new {
    filter: drop-shadow(0 0 12px rgba(52, 211, 153, 0.35));
}

.flow-stage .empty-state {
    position: absolute;
    inset: 0;
}

.wordcloud-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 300px;
    gap: 16px;
    height: calc(100vh - 70px);
    max-height: 720px;
    min-height: 520px;
}

.wordcloud-controls,
.wordcloud-insight {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 100%;
    overflow: auto;
    padding-right: 4px;
}

.wordcloud-controls::-webkit-scrollbar,
.wordcloud-insight::-webkit-scrollbar {
    width: 8px;
}

.wordcloud-controls::-webkit-scrollbar-track,
.wordcloud-insight::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.12);
    border-radius: 999px;
}

.wordcloud-controls::-webkit-scrollbar-thumb,
.wordcloud-insight::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.55), rgba(59, 130, 246, 0.55));
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.6);
}

.wordcloud-controls::-webkit-scrollbar-thumb:hover,
.wordcloud-insight::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.8), rgba(59, 130, 246, 0.8));
}

.wordcloud-tip {
    font-size: 13px;
    color: #94a3b8;
    margin-top: -6px;
}

.wordcloud-control {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    overflow: visible;
}

.wordcloud-control label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.wordcloud-control-value {
    font-size: 18px;
    font-weight: 600;
}

.wordcloud-control input[type="range"] {
    width: 100%;
    accent-color: var(--accent-color);
    cursor: pointer;
}

.wordcloud-slider {
    position: relative;
    width: 100%;
    padding: 6px 2px 0;
}

.wordcloud-slider::before {
    content: "";
    position: absolute;
    inset: 10px 0 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(56, 189, 248, 0.25);
    box-shadow: inset 0 0 14px rgba(2, 6, 23, 0.65), 0 10px 24px rgba(2, 6, 23, 0.65);
    pointer-events: none;
    z-index: 0;
}

.wordcloud-slider input[type="range"] {
    position: relative;
    z-index: 1;
    margin-top: 0;
    height: 34px;
}

.wordcloud-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #cbd5f5;
}

.wordcloud-toggle input {
    accent-color: var(--accent-color);
}

.wordcloud-button-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wordcloud-button {
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-color);
    padding: 6px 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wordcloud-button:hover {
    background: rgba(56, 189, 248, 0.2);
}

.wordcloud-button.ghost {
    border-color: var(--border-color);
    background: transparent;
    color: #cbd5f5;
}

.wordcloud-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    padding-top: 12px;
}

.wordcloud-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.6);
    font-size: 12px;
    color: #cbd5f5;
}

.wordcloud-legend-item .swatch {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
}

.wordcloud-legend-item small {
    display: block;
    color: #94a3b8;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

.wordcloud-ranking {
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    padding-top: 12px;
}

.wordcloud-ranking h3 {
    margin: 0 0 8px;
    font-size: 14px;
    letter-spacing: 0.05em;
    color: #e2e8f0;
}

.wordcloud-ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wordcloud-ranking-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    background: rgba(148, 163, 184, 0.08);
    transition: all 0.2s ease;
}

.wordcloud-ranking-list li:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.wordcloud-ranking-list strong {
    font-size: 14px;
    color: var(--text-main);
}

.wordcloud-ranking-empty {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}

.wordcloud-rank-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wordcloud-ranking-list li .delta-pill {
    margin-left: auto;
}

.wordcloud-stage {
    position: relative;
    overflow: hidden;
    padding: 0;
    min-height: 0;
    height: 100%;
}

.wordcloud-stage-status {
    position: absolute;
    left: 16px;
    top: 16px;
    font-size: 12px;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 999px;
    padding: 4px 12px;
    z-index: 2;
}

.wordcloud-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.65);
    font-size: 14px;
    letter-spacing: 0.08em;
    color: #cbd5f5;
    z-index: 3;
}

.wordcloud-loading.hidden {
    display: none;
}

.wordcloud-svg {
    width: 100%;
    height: 100%;
}

.wordcloud-word {
    cursor: pointer;
    font-weight: 600;
    opacity: 0.88;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.wordcloud-word:hover {
    opacity: 1;
}

.wordcloud-word.is-new {
    filter: drop-shadow(0 0 12px rgba(52, 211, 153, 0.35));
}

.wordcloud-word.is-active {
    stroke: #f8fafc;
    stroke-width: 1.2px;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.35));
}

.ai-panel-view {
    max-height: 100%;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-gutter: stable;
    scrollbar-color: rgba(56, 189, 248, 0.7) rgba(148, 163, 184, 0.12);
}

.ai-panel-view::-webkit-scrollbar {
    width: 8px;
}

.ai-panel-view::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.12);
    border-radius: 999px;
}

.ai-panel-view::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.55), rgba(59, 130, 246, 0.55));
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.6);
}

.ai-panel-view::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.8), rgba(59, 130, 246, 0.8));
}

.wordcloud-ai-card {
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: auto;
}

.wordcloud-ai-card h3 {
    margin: 0;
    font-size: 18px;
}

.wordcloud-ai-card .ai-meta {
    font-size: 12px;
    color: #94a3b8;
}

.wordcloud-ai-text {
    margin: 0;
    line-height: 1.45;
    font-size: 13px;
    color: #e2e8f0;
}

.wordcloud-tooltip {
    pointer-events: none;
}

.ai-panel-view .ai-card {
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
    background: rgba(248, 250, 252, 0.03);
}

.ai-tip {
    color: #94a3b8;
    font-size: 13px;
    margin-top: -6px;
}

.ai-panel-view .ai-card.ai-selection {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-selection-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ai-selection-hint {
    font-size: 12px;
    color: #94a3b8;
}

.ai-status-pill {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.15);
    color: #e2e8f0;
}

.ai-status-pill[data-state="loading"] {
    border-color: rgba(56, 189, 248, 0.6);
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-color);
    animation: aiPulse 1.6s ease-in-out infinite;
}

.ai-status-pill[data-state="ready"] {
    border-color: rgba(59, 130, 246, 0.4);
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

@keyframes aiPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.25);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(56, 189, 248, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
    }
}

.ai-selection-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-selection-title {
    margin: 0;
    font-size: 20px;
}

.ai-selection-text {
    min-height: 78px;
    line-height: 1.6;
    color: #e2e8f0;
    position: relative;
}

.ai-selection-text.is-typing::after {
    content: '▌';
    margin-left: 2px;
    animation: aiCursor 0.9s steps(1) infinite;
    color: var(--accent-color);
}

@keyframes aiCursor {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 1;
    }

    50.1%,
    100% {
        opacity: 0;
    }
}

.ai-chip-row,
.ai-chip-wall {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-chip {
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.25);
    font-size: 12px;
    color: #cbd5f5;
    letter-spacing: 0.02em;
}

.ai-chip.ghost {
    background: linear-gradient(120deg, rgba(148, 163, 184, 0.2), rgba(148, 163, 184, 0.05));
    border-style: dashed;
    animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

.ai-summary-block h3 {
    margin: 12px 0 10px;
    font-size: 15px;
    letter-spacing: 0.04em;
    color: #e2e8f0;
}

.ai-venue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.metric-card.compact {
    padding: 12px;
}

.metric-card.compact .metric-value {
    font-size: 24px;
}

.metric-card.compact .metric-subtitle {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.ai-meta {
    color: #94a3b8;
    font-size: 13px;
}

.ai-summary {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.ai-summary-block {
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 12px;
}

.ai-summary-block ul {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    font-size: 13px;
    color: #cbd5f5;
}

#global-ai-panel {
    position: fixed;
    right: 8px;
    bottom: 18px;
    width: 320px;
    max-width: min(320px, calc(100vw - 16px));
    background: var(--panel-bg);
    border: 1px solid #334155;
    border-radius: 18px 0 0 18px;
    box-shadow: 0 16px 36px rgba(2, 6, 23, 0.55);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform-origin: bottom right;
    transition: width 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 30;
}

#global-ai-panel.collapsed {
    width: 150px;
    border-radius: 999px 0 0 999px;
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.45);
}

#global-ai-panel.collapsed #ai-response-area {
    display: none;
}

#global-ai-panel .panel-header {
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#global-ai-panel.collapsed .panel-header {
    justify-content: center;
    gap: 6px;
    font-size: 13px;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

#ai-response-area {
    padding: 14px 16px 18px;
    font-size: 13px;
    color: #e2e8f0;
    line-height: 1.5;
}

.ai-paper-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.ai-paper-meta {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 8px;
}

@media (max-width: 1024px) {
    .overview-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .overview-controls {
        grid-row: auto;
    }

    .flow-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .wordcloud-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .wordcloud-stage {
        min-height: 320px;
    }

    .landscape-layout {
        grid-template-columns: 1fr;
        padding-right: 0;
    }

    .landscape-nav-rail {
        right: 12px;
    }

    #global-ai-panel {
        width: 240px;
        right: 12px;
        bottom: 12px;
    }
}

/* AI Model Selector */
.ai-model-selector {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: #e2e8f0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    padding: 4px 8px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.ai-model-selector:hover,
.ai-model-selector:focus {
    border-color: var(--accent-color);
}

.ai-model-selector option {
    background: #1e293b;
    color: #f1f5f9;
}

.ai-status-pill[data-state="error"] {
    border-color: rgba(248, 113, 113, 0.6);
    background: rgba(248, 113, 113, 0.15);
    color: #fca5a5;
}

/* ------------------------------------------------------------------
   NEON AI CONFIG PANEL (Added for better contrast & style)
   ------------------------------------------------------------------ */

.ai-config-panel {
    border: 1px solid rgba(139, 92, 246, 0.4);
    /* Purple border */
    border-radius: 12px;
    padding: 24px;
    margin-top: 20px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 27, 75, 0.9));
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(124, 58, 237, 0.15);
    animation: fadeIn 0.3s ease-out;
}

.ai-config-panel h3 {
    margin: 0 0 20px;
    font-size: 16px;
    color: #facc15;
    /* Yellow text */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 0 10px rgba(250, 204, 21, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}

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

.ai-form-group label {
    display: block;
    font-size: 12px;
    color: #c4b5fd;
    /* Light purple text */
    margin-bottom: 8px;
    font-weight: 600;
}

.ai-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-family: monospace;
    font-size: 13px;
    transition: all 0.2s;
}

.ai-input:focus {
    outline: none;
    border-color: #facc15;
    /* Yellow focus */
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.15);
    background: rgba(15, 23, 42, 0.9);
}

.ai-action-row {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.ai-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s;
    flex: 1;
}

.ai-btn.primary {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    /* Purple gradient */
    border: 1px solid rgba(139, 92, 246, 0.5);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.ai-btn.primary:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

.ai-btn.ghost {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #cbd5f5;
}

.ai-btn.ghost:hover {
    border-color: #cbd5f5;
    background: rgba(255, 255, 255, 0.05);
}

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

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

/* Config Button in Selection Header */
.ai-config-btn {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #d8b4fe;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.ai-config-btn:hover,
.ai-config-btn.active {
    background: rgba(139, 92, 246, 0.3);
    color: #fff;
    border-color: #a78bfa;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

/* Markdown Rendering Styles */
.ai-selection-text h1,
.ai-selection-text h2,
.ai-selection-text h3 {
    color: #e2e8f0;
    margin-top: 16px;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.ai-selection-text p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.ai-selection-text ul,
.ai-selection-text ol {
    margin-bottom: 12px;
    padding-left: 20px;
}

.ai-selection-text li {
    margin-bottom: 4px;
}

.ai-selection-text strong {
    color: var(--accent-color);
    font-weight: 600;
}

.ai-selection-text code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

/* Leaderboard Styles (Black Gold Museum Theme) */
.leaderboard-layout {
    --leaderboard-accent-start: #38bdf8;
    --leaderboard-accent-end: #8b5cf6;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: 100%;
}

.leaderboard-layout.nankai-mode {
    --leaderboard-accent-start: #741B7C;
    --leaderboard-accent-end: #ac43b3;
}

.view-switcher {
    display: inline-flex;
    gap: 12px;
    padding-left: 20px;
}

.view-switcher .view-btn {
    background: transparent;
    color: rgba(248, 250, 252, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 999px;
    padding: 10px 28px;
    font-size: 12px;
    letter-spacing: 0.25em;
    font-weight: 600;
    text-transform: uppercase;
    transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.view-switcher .view-btn:not(:disabled):hover,
.view-switcher .view-btn:not(:disabled):focus-visible {
    color: #ffffff;
    border-color: rgba(248, 250, 252, 0.9);
    transform: translateY(-1px);
}

.view-switcher .view-btn.is-active {
    background: #ffffff;
    color: var(--leaderboard-accent-start);
    border-color: var(--leaderboard-accent-start);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.25);
}

.leaderboard-layout.nankai-mode .view-switcher .view-btn.is-active {
    box-shadow: 0 8px 25px rgba(116, 27, 124, 0.3);
}

.view-switcher .view-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.leaderboard-container {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 40px;
    height: 100%;
    overflow: hidden;
    padding: 0 20px 20px;
    background: radial-gradient(circle at center, #0f172a 0%, #020617 100%);
    box-sizing: border-box;
}

.column-scholars,
.column-papers {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
    padding-top: 20px;
    background: transparent;
    border: none;
    backdrop-filter: none;
    min-width: 0;
    /* Important for Grid/Flex nesting */
}

.column-scholars h2,
.column-papers h2 {
    margin: 0;
    font-size: 20px;
    color: #f1f5f9;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.card-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 20px;
    scrollbar-width: none;
}

.card-list::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* Scholar Card (Black Gold Glassmorphism) */
.scholar-card {
    position: relative;
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 30px;
    /* Increased padding */
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    min-height: 220px;
    /* Ensure sufficient height */
}

.scholar-card:hover {
    transform: translateY(-5px) scale(1.01);
    /* Reduced scale to prevent blur issues */
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.15);
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(56, 189, 248, 0.35);
    z-index: 10;
}

.scholar-card.active {
    border-color: var(--leaderboard-accent-start);
    background: rgba(30, 41, 59, 0.8);
    box-shadow: 0 12px 40px rgba(56, 189, 248, 0.25);
}

.leaderboard-layout.nankai-mode .scholar-card.active {
    box-shadow: 0 12px 40px rgba(116, 27, 124, 0.3);
}

.rank-watermark {
    position: absolute;
    right: -20px;
    bottom: -35px;
    top: auto;
    font-size: 160px;
    font-weight: 800;
    color: var(--leaderboard-accent-start);
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1;
}

.card-inner {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
}

.avatar-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(251, 191, 36, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    transition: border-color 0.3s;
    background-color: #1e293b;
}

.avatar-circle .avatar-initials {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.scholar-card:hover .avatar-circle {
    border-color: #fbbf24;
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.card-header h3 {
    margin: 0;
    font-size: 20px;
    color: #f1f5f9;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.card-header .aff {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
    line-height: 1.4;
}

.scholar-desc {
    font-size: 14px;
    /* Slightly larger text */
    color: #cbd5f5;
    line-height: 1.7;
    opacity: 0.9;
    margin: 10px 0 16px;
    overflow-wrap: anywhere;
    word-break: break-word;
    height: auto;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    flex-wrap: wrap;
    gap: 12px;
}

/* Make inner layout responsive on smaller desktops */
@media (max-width: 1400px) {
    .card-inner {
        gap: 12px;
    }

    .avatar-circle {
        width: 56px;
        height: 56px;
        font-size: 18px;
    }
}

@media (max-width: 1200px) {
    .leaderboard-container {
        grid-template-columns: 1fr;
        gap: 20px;
        overflow-y: auto;
        padding-bottom: 40px;
    }

    .column-scholars,
    .column-papers {
        overflow: visible;
        height: auto;
    }

    .card-list {
        overflow: visible;
        flex: none;
    }

    /* On mobile view, restore avatar size if desired, or keep compact */
    .avatar-circle {
        width: 52px;
        height: 52px;
    }
}

.citations .label {
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    margin-right: 6px;
    letter-spacing: 0.05em;
}

.citations {
    font-family: 'Space Grotesk', monospace;
    font-weight: 700;
    color: #fbbf24;
    font-size: 18px;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
    white-space: nowrap;
}

.tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tags span {
    font-size: 11px;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    color: #cbd5f5;
    border: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

/* Paper Item */
.paper-item {
    position: relative;
    padding: 16px;
    background: rgba(30, 41, 59, 0.25);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    backdrop-filter: blur(5px);
}

.paper-item:hover {
    background: rgba(30, 41, 59, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    z-index: 5;
}

.paper-item.active {
    background: rgba(56, 189, 248, 0.08);
    border-color: var(--leaderboard-accent-start);
}

.leaderboard-layout.nankai-mode .paper-item.active {
    background: rgba(116, 27, 124, 0.1);
}

.paper-row {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 16px;
}

.paper-rank {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    width: 28px;
    font-size: 16px;
    text-align: center;
}

.rank-num {
    background: linear-gradient(120deg, var(--leaderboard-accent-start), var(--leaderboard-accent-end));
    -webkit-background-clip: text;
    color: transparent;
}

.paper-content {
    flex: 1;
    min-width: 0;
}

.paper-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.paper-meta {
    font-size: 12px;
    color: #64748b;
}

.paper-cite-box {
    font-family: 'Space Grotesk', monospace;
    font-weight: 700;
    color: var(--leaderboard-accent-start);
    font-size: 15px;
    min-width: 70px;
    text-align: right;
    filter: drop-shadow(0 0 5px rgba(56, 189, 248, 0.4));
.control-row.mini-card .control-value {
    font-size: 15px;
    min-width: 54px;
    padding: 2px 8px;
}
.control-row.mini-card .control-slider {
    margin-top: 0;
    height: 24px;
    --slider-track-height: 3px;
    --slider-thumb-size: 14px;
}

.progress-bar-container {
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    z-index: 1;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--leaderboard-accent-start), var(--leaderboard-accent-end));
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
    border-radius: 2px;
    opacity: 0.8;
    transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.leaderboard-layout.nankai-mode .progress-bar-fill {
    box-shadow: 0 0 8px rgba(172, 67, 179, 0.35);
}

.paper-item:hover .progress-bar-fill {
    opacity: 1;
    filter: brightness(1.2);
}

.column-scholars h2 .icon,
.column-papers h2 .icon {
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.4));
}



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

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