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

:root {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a3e;
    --bg-tertiary: #252552;
    --text-primary: #e8e8f0;
    --text-secondary: #a0a0c0;
    --accent: #6c63ff;
    --accent-hover: #5a52d5;
    --accent-light: rgba(108, 99, 255, 0.15);
    --border: #2a2a5a;
    --user-bubble: #2d2d6b;
    --bot-bubble: #1e1e48;
    --success: #4ade80;
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

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

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.skill-section, .mode-section {
    padding: 16px 12px;
}

.skill-section h3, .mode-section h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    padding: 0 8px;
    margin-bottom: 8px;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.skill-item:hover {
    background: var(--accent-light);
}

.skill-item.active {
    background: var(--accent);
    color: white;
}

.skill-icon {
    font-size: 18px;
}

.mode-item {
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin-bottom: 2px;
}

.mode-item:hover {
    background: var(--accent-light);
    color: var(--text-primary);
}

.mode-item.active {
    background: var(--accent-light);
    color: var(--accent);
    border-left: 3px solid var(--accent);
}

.mode-section {
    flex: 1;
    overflow-y: auto;
}

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

.new-chat-btn {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.new-chat-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.powered-by {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 10px;
    opacity: 0.6;
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
}

.current-skill {
    font-size: 16px;
    font-weight: 600;
}

.current-mode {
    font-size: 13px;
    color: var(--accent);
}

/* Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scroll-behavior: smooth;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px;
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.welcome-screen h2 {
    font-size: 24px;
    margin-bottom: 8px;
}

.welcome-screen > p {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    max-width: 560px;
}

/* Hotspot research pages */
.hotspot-page {
    min-height: 100vh;
    overflow: auto;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.hotspot-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.hotspot-header h1 {
    margin-top: 10px;
    font-size: 28px;
}

.hotspot-header p,
.muted {
    color: var(--text-secondary);
}

.back-link,
.admin-link {
    color: var(--accent);
    text-decoration: none;
}

.admin-link {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    white-space: nowrap;
}

.hotspot-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
    gap: 20px;
    padding: 24px 32px 48px;
}

.hotspot-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.hotspot-panel h2 {
    font-size: 18px;
    margin-bottom: 14px;
}

.panel-title,
.topic-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.hotspot-panel select,
.hotspot-panel textarea,
.hotspot-panel input {
    width: 100%;
    margin: 8px 0 14px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font: inherit;
}

.hotspot-panel textarea {
    resize: vertical;
    min-height: 150px;
}

.hotspot-panel button,
.primary-action {
    padding: 10px 14px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    cursor: pointer;
}

.topic-list {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.topic-card,
.match-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}

.topic-card h3 {
    font-size: 16px;
    line-height: 1.3;
}

.topic-card p,
.idea-result p {
    color: var(--text-secondary);
    margin: 10px 0;
    line-height: 1.6;
}

.topic-card ol,
.match-card ol {
    margin: 10px 0 0 20px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 10px 0;
}

.topic-tags span {
    background: var(--accent-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
}

.idea-result,
.hotspot-panel pre {
    margin-top: 16px;
    white-space: pre-wrap;
    word-break: break-word;
}

.match-card {
    margin-top: 12px;
}

.feature-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.2);
}

.feature-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 8px;
}

.feature-card h4 {
    font-size: 15px;
    margin-bottom: 4px;
}

.feature-card p {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Message bubbles */
.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    max-width: 860px;
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    flex-direction: row-reverse;
    margin-left: auto;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.bubble {
    padding: 12px 16px;
    border-radius: var(--radius);
    line-height: 1.7;
    font-size: 14px;
    max-width: 75%;
    word-break: break-word;
}

.message.user .bubble {
    background: var(--user-bubble);
    border-bottom-right-radius: 4px;
}

.message.assistant .bubble {
    background: var(--bot-bubble);
    border-bottom-left-radius: 4px;
}

/* Markdown styles inside bubbles */
.bubble h1, .bubble h2, .bubble h3, .bubble h4 {
    margin: 16px 0 8px;
    color: var(--text-primary);
}
.bubble h1 { font-size: 20px; }
.bubble h2 { font-size: 17px; }
.bubble h3 { font-size: 15px; }

.bubble p { margin: 8px 0; }

.bubble ul, .bubble ol {
    padding-left: 20px;
    margin: 8px 0;
}

.bubble li { margin: 4px 0; }

.bubble code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

.bubble pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.bubble pre code {
    background: none;
    padding: 0;
}

.bubble table {
    border-collapse: collapse;
    margin: 12px 0;
    width: 100%;
}

.bubble th, .bubble td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
    font-size: 13px;
}

.bubble th {
    background: var(--bg-tertiary);
}

.bubble blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 12px;
    margin: 8px 0;
    color: var(--text-secondary);
}

.bubble strong { color: var(--accent); }

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

.bubble a:hover {
    text-decoration: underline;
}

/* Input Area */
.chat-input-area {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    transition: border-color 0.2s;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    line-height: 1.5;
    max-height: 200px;
}

textarea::placeholder {
    color: var(--text-secondary);
}

.send-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--accent);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    background: var(--accent-hover);
}

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

.input-hint {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
    opacity: 0.5;
}

/* Upload button */
.upload-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.upload-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

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

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-secondary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* PDF preview badge */
.pdf-preview {
    display: flex;
    margin-bottom: 8px;
}

.pdf-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
}

.pdf-icon { font-size: 16px; }

.pdf-name {
    color: var(--text-primary);
    font-weight: 500;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-pages {
    color: var(--text-secondary);
    font-size: 12px;
}

.pdf-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.pdf-remove:hover { color: #ff6b6b; }

/* Drag and drop overlay */
.drop-overlay {
    position: absolute;
    inset: 0;
    background: rgba(108, 99, 255, 0.15);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.drop-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.drop-content {
    text-align: center;
    padding: 40px;
    border: 3px dashed var(--accent);
    border-radius: 20px;
    background: rgba(15, 15, 35, 0.9);
}

.drop-icon { font-size: 48px; margin-bottom: 12px; }
.drop-content p { color: var(--text-primary); font-size: 16px; }

/* Make chat-main relative for overlay positioning */
.chat-main { position: relative; }

/* Hotspot dashboard overrides */
body.hotspot-body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #10131f;
}

.hotspot-body .hotspot-page {
    min-height: 100vh;
    overflow: visible;
    background:
        linear-gradient(180deg, rgba(18, 30, 48, 0.92), rgba(15, 15, 35, 0.98) 380px),
        #0f0f23;
}

.hotspot-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 36px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.hotspot-hero-main h1 {
    margin: 12px 0 8px;
    font-size: 34px;
    line-height: 1.15;
    letter-spacing: 0;
}

.hotspot-hero-main p,
.idea-panel p,
.pack-meta,
.topic-card p,
.muted {
    color: var(--text-secondary);
}

.hotspot-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid #fecdd3;
    border-radius: 999px;
    background: #ffffff;
    padding: 3px;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.language-toggle-label {
    color: #6b7280;
    font-size: 13px;
    font-weight: 800;
    padding: 0 8px 0 10px;
    white-space: nowrap;
}

.language-toggle button {
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 12px;
}

.language-toggle button.active {
    background: #8C1515;
    color: #ffffff;
}

.hotspot-shell,
.hotspot-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
    padding: 24px 36px 52px;
    max-width: 1680px;
    margin: 0 auto;
}

.hotspot-workspace {
    grid-template-columns: 260px minmax(0, 1fr);
}

.hotspot-sidebar {
    display: grid;
    gap: 12px;
    align-content: start;
}

.hotspot-sidebar button {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.07);
    color: #374151;
    cursor: pointer;
    display: grid;
    gap: 6px;
    padding: 16px;
    text-align: left;
}

.hotspot-sidebar button span {
    color: #8C1515;
    font-size: 13px;
    font-weight: 900;
}

.hotspot-sidebar button strong {
    color: #111827;
    font-size: 16px;
    line-height: 1.25;
}

.hotspot-sidebar button small {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.45;
}

.hotspot-sidebar button.active {
    background: #8C1515;
    border-color: #8C1515;
    color: #ffffff;
}

.hotspot-sidebar button.active span,
.hotspot-sidebar button.active strong,
.hotspot-sidebar button.active small {
    color: #ffffff;
}

.hotspot-content {
    min-width: 0;
}

.hotspot-view {
    display: none;
}

.hotspot-view.active {
    display: block;
}

.hotspot-dashboard,
.idea-panel-inner {
    background: rgba(26, 26, 62, 0.82);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.22);
}

.hotspot-dashboard {
    padding: 18px;
    min-width: 0;
}

.idea-panel {
    min-width: 0;
}

.idea-panel-inner {
    padding: 20px;
}

.idea-panel h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.hotspot-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 160px auto;
    gap: 12px;
    align-items: end;
}

.hotspot-toolbar label,
.idea-panel label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 12px;
}

.hotspot-toolbar select,
.hotspot-toolbar input,
.idea-panel textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: rgba(15, 15, 35, 0.82);
    color: var(--text-primary);
    padding: 10px 12px;
    font: inherit;
}

.idea-panel textarea {
    min-height: 170px;
    resize: vertical;
    margin: 12px 0;
    line-height: 1.55;
}

.analysis-mode-group {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 8px 0 12px;
}

.analysis-mode-group button {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    min-height: 38px;
    padding: 8px 10px;
    text-align: left;
}

.analysis-mode-group button.active {
    background: #8C1515;
    border-color: #8C1515;
    color: #ffffff;
}

.hotspot-toolbar button,
.primary-action,
.admin-link {
    min-height: 42px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: var(--accent);
    color: white;
    padding: 10px 14px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.back-link {
    color: #7dd3fc;
    text-decoration: none;
    font-size: 14px;
}

.pack-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 12px;
    margin: 18px 0 12px;
}

.stat-card {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(37, 37, 82, 0.78);
    padding: 14px;
}

.stat-card span {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 8px;
}

.stat-card strong {
    display: block;
    font-size: 26px;
    line-height: 1;
}

.pack-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin: 8px 0 18px;
    font-size: 13px;
}

.pack-meta strong {
    color: var(--text-primary);
}

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

.topic-card {
    display: flex;
    flex-direction: column;
    min-height: 360px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(28, 31, 66, 0.92);
    padding: 16px;
}

.topic-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.topic-card h3 {
    margin-top: 4px;
    font-size: 17px;
    line-height: 1.35;
    letter-spacing: 0;
}

.topic-id {
    color: #7dd3fc;
    font-size: 12px;
}

.competition {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 12px;
    border: 1px solid rgba(255,255,255,0.12);
}

.competition.high { color: #fecaca; background: rgba(239, 68, 68, 0.16); }
.competition.medium { color: #fde68a; background: rgba(245, 158, 11, 0.16); }
.competition.low { color: #bbf7d0; background: rgba(34, 197, 94, 0.16); }

.topic-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 14px 0 8px;
}

.topic-metrics div {
    border-radius: 8px;
    background: rgba(15, 15, 35, 0.64);
    padding: 10px;
}

.topic-metrics span {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
}

.topic-metrics strong {
    display: block;
    margin-top: 4px;
    font-size: 20px;
}

.heat-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    overflow: hidden;
}

.heat-track div {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22c55e, #38bdf8, #8b5cf6);
}

.topic-card p {
    margin: 12px 0 10px;
    line-height: 1.55;
    font-size: 14px;
}

.topic-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 12px;
}

.topic-tags span {
    border-radius: 999px;
    background: rgba(125, 211, 252, 0.12);
    border: 1px solid rgba(125, 211, 252, 0.20);
    color: #dbeafe;
    padding: 4px 8px;
    font-size: 12px;
}

.topic-card ol,
.match-card ol {
    margin: auto 0 0 18px;
    color: var(--text-secondary);
    line-height: 1.5;
    font-size: 13px;
}

.topic-card li + li,
.match-card li + li {
    margin-top: 6px;
}

.idea-result {
    margin-top: 16px;
}

.idea-result h3 {
    font-size: 16px;
    margin-bottom: 8px;
}

.idea-result p {
    color: var(--text-secondary);
    line-height: 1.55;
}

.match-card {
    margin-top: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    background: rgba(37, 37, 82, 0.72);
    padding: 12px;
}

.empty-state {
    grid-column: 1 / -1;
    border: 1px dashed rgba(255,255,255,0.16);
    border-radius: 8px;
    color: var(--text-secondary);
    padding: 24px;
    text-align: center;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Mobile */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        z-index: 100;
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }
    .menu-btn {
        display: block;
    }
    .feature-grid {
        grid-template-columns: 1fr;
    }
    .hotspot-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px;
    }
    .hotspot-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 20px;
    }
    .hotspot-hero-main h1 {
        font-size: 28px;
    }
    .hotspot-layout {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    .hotspot-shell,
    .hotspot-workspace {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    .hotspot-toolbar {
        grid-template-columns: 1fr;
    }
    .pack-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .topic-grid {
        grid-template-columns: 1fr;
    }
    .bubble {
        max-width: 90%;
    }
}

/* Paperreview-inspired light theme */
:root {
    --bg-primary: #fff7f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #fff1f2;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --accent: #8C1515;
    --accent-hover: #820000;
    --accent-light: rgba(140, 21, 21, 0.08);
    --border: #e5e7eb;
    --user-bubble: #8C1515;
    --bot-bubble: #ffffff;
    --success: #15803d;
    --radius: 12px;
}

body.research-body,
body.hotspot-body {
    background: linear-gradient(135deg, #fff1f2 0%, #ffffff 48%, #fff1f2 100%);
    color: var(--text-primary);
}

.site-banner {
    background: linear-gradient(90deg, #fff1f2, #fdf2f8);
    border-bottom: 1px solid #fee2e2;
    color: #1f2937;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    padding: 10px 18px;
    text-align: center;
}

.site-nav {
    position: sticky;
    top: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 64px;
    padding: 0 36px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 8px rgba(17, 24, 39, 0.06);
    backdrop-filter: blur(10px);
}

.site-intro {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
    color: #111827;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.35;
}

.site-intro img {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 36%;
    box-shadow: 0 8px 22px rgba(140, 21, 21, 0.16);
}

.site-intro span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #111827;
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #8C1515, #820000);
    color: #ffffff;
    font-size: 21px;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(140, 21, 21, 0.22);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    display: block;
}

.site-brand strong,
.site-brand small {
    display: block;
}

.site-brand strong {
    font-size: 17px;
}

.site-brand small {
    color: #6b7280;
    font-size: 12px;
    margin-top: 2px;
}

.site-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-links a {
    border-bottom: 4px solid transparent;
    color: #4b5563;
    font-size: 14px;
    font-weight: 700;
    padding: 18px 18px 14px;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s;
}

.site-links a:hover,
.site-links a.active {
    border-bottom-color: #8C1515;
    color: #8C1515;
}

.research-body .app-container {
    height: calc(100vh - 96px);
    max-width: 1260px;
    margin: 16px auto;
    border: 1px solid #f3f4f6;
    border-radius: 24px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 28px 70px rgba(17, 24, 39, 0.14);
}

.research-body .sidebar {
    width: 278px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
}

.research-body .sidebar-header {
    border-bottom: 1px solid #f3f4f6;
    padding: 24px 22px 18px;
}

.research-body .digital-human-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.research-body .digital-human-brand img {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 36%;
    box-shadow: 0 12px 28px rgba(140, 21, 21, 0.18);
}

.research-body .sidebar-header h1 {
    color: #111827;
    font-size: 20px;
    line-height: 1.18;
}

.research-body .subtitle,
.research-body .powered-by,
.research-body .skill-section h3,
.research-body .mode-section h3 {
    color: #6b7280;
}

.research-body .skill-item,
.research-body .mode-item {
    color: #374151;
    border-radius: 10px;
}

.research-body .skill-item:hover,
.research-body .mode-item:hover {
    background: #fff1f2;
    color: #8C1515;
}

.research-body .skill-item.active {
    background: #8C1515;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(140, 21, 21, 0.18);
}

.research-body .mode-item.active {
    background: #fff1f2;
    border-left-color: #8C1515;
    color: #8C1515;
}

.research-body .new-chat-btn {
    border: 1px dashed #d1d5db;
    color: #4b5563;
    background: #ffffff;
}

.research-body .new-chat-btn:hover {
    border-color: #8C1515;
    color: #8C1515;
    background: #fff1f2;
}

.research-body .chat-main {
    background: linear-gradient(180deg, #fff7f7, #ffffff 38%);
}

.research-body .chat-header {
    background: #ffffff;
    border-bottom: 1px solid #f3f4f6;
    padding: 16px 22px;
}

.research-body .current-skill {
    color: #111827;
    font-size: 17px;
}

.research-body .current-mode {
    color: #8C1515;
}

.research-body .welcome-screen {
    align-items: flex-start;
    height: auto;
    min-height: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 64px 42px;
    text-align: left;
}

.research-body .welcome-screen .eyebrow {
    color: #8C1515;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.research-body .welcome-screen h2 {
    max-width: 680px;
    color: #111827;
    font-size: 44px;
    font-weight: 900;
    line-height: 1.12;
    margin-bottom: 14px;
}

.research-body .welcome-screen > p {
    max-width: 720px;
    color: #4b5563;
    font-size: 17px;
    line-height: 1.7;
    margin-bottom: 28px;
}

.research-body .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: 920px;
    gap: 20px;
}

.research-body .feature-card {
    min-height: 172px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.08);
    padding: 26px;
}

.research-body .feature-card:hover {
    border-color: rgba(140, 21, 21, 0.34);
    box-shadow: 0 16px 36px rgba(140, 21, 21, 0.14);
    transform: translateY(-1px);
}

.research-body .feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: #8C1515;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    margin-bottom: 12px;
}

.research-body .feature-card h4 {
    color: #111827;
    font-size: 17px;
    margin-bottom: 6px;
}

.research-body .feature-card p {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.55;
}

.research-body .chat-messages {
    background: transparent;
}

.research-body .message .avatar {
    background: #8C1515;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
}

.research-body .message.user .bubble {
    background: #8C1515;
    color: #ffffff;
}

.research-body .message.assistant .bubble {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #111827;
    box-shadow: 0 8px 22px rgba(17, 24, 39, 0.08);
}

.research-body .chat-input-area {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding: 18px 24px;
}

.research-body .input-wrapper {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06);
}

.research-body .input-wrapper:focus-within {
    border-color: #8C1515;
    box-shadow: 0 0 0 4px rgba(140, 21, 21, 0.12);
}

.research-body #userInput {
    color: #111827;
}

.research-body #userInput::placeholder {
    color: #9ca3af;
}

.research-body .upload-btn,
.research-body .send-btn {
    color: #8C1515;
}

.research-body .send-btn {
    background: linear-gradient(135deg, #8C1515, #820000);
    color: #ffffff;
    margin-right: 8px;
    border-radius: 12px;
}

.research-body .input-hint {
    color: #6b7280;
}

.research-body .pdf-badge {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #166534;
}

body.hotspot-body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.hotspot-body .hotspot-page {
    min-height: auto;
    background: transparent;
}

.hotspot-hero {
    max-width: 1260px;
    margin: 18px auto 0;
    padding: 36px 10px 20px;
    border-bottom: 0;
}

.hotspot-hero-main h1 {
    color: #111827;
    font-size: 42px;
    font-weight: 900;
    line-height: 1.14;
}

.hotspot-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.hotspot-title-row img {
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 36%;
    box-shadow: 0 14px 34px rgba(140, 21, 21, 0.18);
}

.hotspot-hero-main p,
.idea-panel p,
.pack-meta,
.topic-card p,
.muted {
    color: #6b7280;
}

.hotspot-hero-main .hero-note {
    display: inline-flex;
    max-width: 780px;
    margin-top: 12px;
    padding: 10px 14px;
    border: 1px solid #fee2e2;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    color: #4b5563;
    font-size: 14px;
    line-height: 1.55;
}

.hotspot-shell,
.hotspot-workspace,
.hotspot-layout {
    max-width: 1260px;
    margin: 0 auto;
    padding: 18px 10px 52px;
}

.hotspot-workspace {
    max-width: 1260px;
}

.hotspot-dashboard,
.idea-panel-inner,
.hotspot-panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    box-shadow: 0 22px 58px rgba(17, 24, 39, 0.10);
}

.hotspot-toolbar select,
.hotspot-toolbar input,
.idea-panel textarea,
.hotspot-panel select,
.hotspot-panel textarea,
.hotspot-panel input {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    color: #111827;
    border-radius: 12px;
}

.hotspot-toolbar select:focus,
.hotspot-toolbar input:focus,
.idea-panel textarea:focus,
.hotspot-panel input:focus {
    border-color: #8C1515;
    box-shadow: 0 0 0 4px rgba(140, 21, 21, 0.10);
    outline: none;
}

.hotspot-toolbar button,
.primary-action,
.admin-link {
    background: linear-gradient(135deg, #8C1515, #820000);
    border: 0;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(140, 21, 21, 0.20);
}

.back-link {
    color: #8C1515;
    font-weight: 700;
}

.stat-card {
    background: linear-gradient(180deg, #fff7f7, #ffffff);
    border: 1px solid #fee2e2;
}

.stat-card span {
    color: #6b7280;
}

.stat-card strong {
    color: #111827;
}

.pack-meta strong {
    color: #111827;
}

.hotspot-map-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(17, 24, 39, 0.08);
    margin: 14px 0 18px;
    padding: 18px;
}

.hotspot-map-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}

.hotspot-map-head h2 {
    color: #111827;
    font-size: 20px;
    margin-bottom: 4px;
}

.hotspot-map-head p {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    color: #4b5563;
    font-size: 13px;
}

.map-legend span {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.legend-dot.high { background: #8C1515; }
.legend-dot.medium { background: #f59e0b; }
.legend-dot.low { background: #16a34a; }

.hotspot-map {
    width: 100%;
    overflow-x: auto;
}

.hotspot-map svg {
    display: block;
    min-width: 760px;
    width: 100%;
}

.axis-line {
    stroke: #9ca3af;
    stroke-width: 1.2;
}

.grid-line {
    stroke: #e5e7eb;
    stroke-width: 1;
}

.axis-label,
.tick-label {
    fill: #6b7280;
    font-size: 12px;
}

.tick-left {
    text-anchor: end;
}

.bubble-node {
    cursor: pointer;
    outline: none;
}

.bubble-node circle {
    transition: opacity 0.18s, stroke-width 0.18s, transform 0.18s;
    transform-box: fill-box;
    transform-origin: center;
    stroke: rgba(255,255,255,0.86);
    stroke-width: 2;
}

.bubble-node:hover circle,
.bubble-node:focus circle {
    opacity: 1;
    stroke: #111827;
    stroke-width: 3;
    transform: scale(1.06);
}

.bubble-index {
    fill: #ffffff;
    font-size: 12px;
    font-weight: 800;
    pointer-events: none;
    text-anchor: middle;
}

.bubble-label {
    fill: #374151;
    font-size: 11px;
    font-weight: 700;
    paint-order: stroke;
    stroke: #ffffff;
    stroke-width: 4px;
    stroke-linejoin: round;
}

.hotspot-visual-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 0.85fr);
    gap: 16px;
}

.wordcloud-card,
.ranking-card {
    min-height: 360px;
    border: 1px solid #f3f4f6;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #fff7f7);
    padding: 16px;
}

.visual-title {
    color: #111827;
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 12px;
}

.wordcloud {
    align-content: center;
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    justify-content: center;
    min-height: 292px;
    padding: 10px;
}

.cloud-word {
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.08;
    padding: 4px 6px;
    transition: transform 0.16s, background 0.16s;
}

.cloud-word:hover {
    background: #fff1f2;
    transform: translateY(-1px) scale(1.04);
}

.cloud-word.tone-0 { color: #8C1515; }
.cloud-word.tone-1 { color: #b91c1c; }
.cloud-word.tone-2 { color: #9f1239; }
.cloud-word.tone-3 { color: #92400e; }
.cloud-word.tone-4 { color: #374151; }

.hotspot-ranking {
    display: grid;
    gap: 8px;
}

.rank-row {
    align-items: center;
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 12px;
    cursor: pointer;
    display: grid;
    gap: 10px;
    grid-template-columns: 36px minmax(0, 1fr) 48px;
    padding: 9px 10px;
    text-align: left;
    transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s;
}

.rank-row:hover {
    border-color: #fecdd3;
    box-shadow: 0 8px 20px rgba(140, 21, 21, 0.10);
    transform: translateY(-1px);
}

.rank-num {
    color: #9ca3af;
    font-size: 12px;
    font-weight: 800;
}

.rank-main {
    min-width: 0;
}

.rank-title {
    color: #111827;
    display: block;
    font-size: 13px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-track {
    background: #f3f4f6;
    border-radius: 999px;
    display: block;
    height: 7px;
    margin-top: 7px;
    overflow: hidden;
}

.rank-track span {
    background: linear-gradient(90deg, #fca5a5, #8C1515);
    border-radius: inherit;
    display: block;
    height: 100%;
}

.rank-meta {
    font-size: 14px;
    font-weight: 900;
    text-align: right;
}

.topic-card,
.match-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
}

.topic-card-focus {
    border-color: #8C1515;
    box-shadow: 0 0 0 4px rgba(140, 21, 21, 0.12), 0 16px 34px rgba(140, 21, 21, 0.16);
}

.topic-card h3,
.idea-result h3,
.match-card strong,
.hotspot-panel h2 {
    color: #111827;
}

.topic-id {
    color: #8C1515;
    font-weight: 800;
}

.competition {
    border: 1px solid #e5e7eb;
}

.competition.high { color: #991b1b; background: #fee2e2; }
.competition.medium { color: #92400e; background: #fef3c7; }
.competition.low { color: #166534; background: #dcfce7; }

.topic-metrics div {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
}

.topic-metrics span {
    color: #6b7280;
}

.topic-metrics strong {
    color: #111827;
}

.heat-track {
    background: #f3f4f6;
}

.heat-track div {
    background: linear-gradient(90deg, #f59e0b, #ef4444, #8C1515);
}

.topic-tags span {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.topic-card ol,
.match-card ol {
    color: #4b5563;
}

.analysis-plan {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(17, 24, 39, 0.08);
    margin-top: 12px;
    padding: 14px;
}

.analysis-plan h3 {
    color: #111827;
    font-size: 16px;
    margin-bottom: 8px;
}

.analysis-plan strong {
    color: #111827;
    display: block;
    margin: 12px 0 6px;
}

.analysis-plan ol {
    color: #4b5563;
    margin-left: 18px;
}

.analysis-steps {
    display: grid;
    gap: 7px;
    margin: 12px 0;
}

.analysis-steps span {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    color: #374151;
    font-size: 13px;
    padding: 8px 10px;
}

.empty-state {
    border-color: #e5e7eb;
    color: #6b7280;
    background: #f9fafb;
}

.hotspot-loading {
    align-items: center;
    background: rgba(255, 247, 247, 0.72);
    backdrop-filter: blur(8px);
    display: flex;
    inset: 0;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 0.18s ease;
    z-index: 120;
}

.hotspot-loading.visible {
    opacity: 1;
    pointer-events: auto;
}

.loading-card {
    align-items: center;
    background: #ffffff;
    border: 1px solid #fee2e2;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(17, 24, 39, 0.18);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 260px;
    padding: 28px 32px;
    text-align: center;
}

.loading-card strong {
    color: #111827;
    font-size: 17px;
}

.loading-card span {
    color: #6b7280;
    font-size: 14px;
}

.loading-spinner {
    animation: hotspot-spin 0.85s linear infinite;
    border: 4px solid #fee2e2;
    border-top-color: #8C1515;
    border-radius: 999px;
    height: 42px;
    width: 42px;
}

@keyframes hotspot-spin {
    to { transform: rotate(360deg); }
}

.hotspot-panel pre {
    color: #374151;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
}

.model-status {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    display: grid;
    gap: 6px;
    margin: 12px 0;
    padding: 12px;
}

.model-status strong {
    color: #111827;
}

.model-status span {
    font-size: 13px;
}

@media (max-width: 900px) {
    .site-nav {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding: 12px 18px 0;
    }
    .site-intro {
        font-size: 14px;
        width: 100%;
    }
    .site-intro img {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }
    .site-links {
        width: 100%;
        overflow-x: auto;
    }
    .research-body .app-container {
        height: calc(100vh - 132px);
        margin: 0;
        border-radius: 0;
    }
    .research-body .feature-grid {
        grid-template-columns: 1fr;
    }
    .research-body .welcome-screen h2,
    .hotspot-hero-main h1 {
        font-size: 32px;
    }
    .hotspot-shell,
    .hotspot-layout {
        padding-left: 16px;
        padding-right: 16px;
    }
    .hotspot-visual-grid {
        grid-template-columns: 1fr;
    }
}

/* === site-intro 双行：品牌 + 当前页副标题 === */
.site-intro-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}
.site-intro-text strong {
    color: #111827;
    font-size: 16px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.site-intro-text small {
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 720px) {
    .site-intro-text small { display: none; }   /* 手机隐藏副标题，省空间 */
}

