/* ===================================
   AI 产业链研究 - 咖啡馆风格设计
   =================================== */

:root {
    /* Light theme - "warm coffee shop" */
    --bg-primary: #FBF6EE;
    --bg-secondary: #F4ECDE;
    --bg-card: #FFFFFF;
    --bg-elevated: #FAF3E5;

    --text-primary: #2D2419;
    --text-secondary: #5A4A37;
    --text-muted: #8A7A66;

    --accent-primary: #B45309;
    --accent-secondary: #92400E;
    --accent-hover: #C2410C;

    --border: #E5D4B7;
    --border-light: #EFE3CC;

    --success: #15803D;
    --warning: #D97706;
    --error: #B91C1C;
    --info: #1D4ED8;

    --shadow-sm: 0 1px 2px rgba(45, 36, 25, 0.06);
    --shadow-md: 0 4px 12px rgba(45, 36, 25, 0.08);
    --shadow-lg: 0 10px 30px rgba(45, 36, 25, 0.12);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", "JetBrains Mono", Menlo, Monaco, Consolas, monospace;

    --sidebar-width: 320px;
    --toc-width: 240px;
    --topbar-height: 64px;
}

[data-theme="dark"] {
    --bg-primary: #1A1612;
    --bg-secondary: #221C16;
    --bg-card: #2A231C;
    --bg-elevated: #322A20;

    --text-primary: #F5EBDB;
    --text-secondary: #C7B89F;
    --text-muted: #8A7A66;

    --accent-primary: #F59E0B;
    --accent-secondary: #FCD34D;
    --accent-hover: #FBBF24;

    --border: #3D3325;
    --border-light: #2D261C;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.7);
}

/* ===================================
   Reset & Base
   =================================== */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 16px;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ===================================
   Top bar
   =================================== */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.brand-icon {
    font-size: 28px;
    line-height: 1;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-container {
    position: relative;
}

#search-input {
    width: 320px;
    height: 38px;
    padding: 0 14px 0 40px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.15s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A7A66' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center;
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.1);
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 480px;
    max-height: 560px;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 200;
}

.search-results.active {
    display: block;
}

.search-result {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.15s ease;
}

.search-result:hover {
    background: var(--bg-elevated);
}

.search-result:last-child {
    border-bottom: none;
}

.result-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.result-context {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.result-match {
    background: rgba(180, 83, 9, 0.2);
    color: var(--accent-primary);
    padding: 0 2px;
    border-radius: 3px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.icon-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

/* Progress bar */
#progress-bar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    z-index: 99;
    transition: width 0.15s ease-out;
}

/* ===================================
   Layout
   =================================== */

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr var(--toc-width);
    min-height: calc(100vh - var(--topbar-height));
}

/* ===================================
   Sidebar
   =================================== */

.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    height: calc(100vh - var(--topbar-height));
    position: sticky;
    top: var(--topbar-height);
    padding: 16px 0;
    transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.sidebar-stats {
    padding: 0 20px 16px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}

.mini-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mini-stat {
    background: var(--bg-card);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.mini-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1;
}

.mini-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.nav-section {
    margin-bottom: 4px;
}

.nav-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    transition: background 0.15s ease;
    user-select: none;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.nav-section-header:hover {
    background: var(--bg-elevated);
}

.nav-section-header.active {
    background: rgba(180, 83, 9, 0.08);
    color: var(--accent-primary);
}

.nav-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.nav-section-title {
    flex: 1;
    line-height: 1.3;
}

.nav-section-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 2px;
}

.nav-toggle {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.nav-section.expanded .nav-toggle {
    transform: rotate(90deg);
}

.nav-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.nav-section.expanded .nav-items {
    max-height: 2000px;
}

.nav-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 20px 8px 50px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    line-height: 1.4;
}

.nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding-left: 54px;
}

.nav-item.active {
    background: rgba(180, 83, 9, 0.12);
    color: var(--accent-primary);
    font-weight: 600;
    border-left: 3px solid var(--accent-primary);
    padding-left: 47px;
}

.nav-item-emoji {
    flex-shrink: 0;
    font-size: 14px;
    line-height: 1.4;
}

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

.nav-item-title {
    line-height: 1.3;
}

.nav-item-tagline {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.3;
    font-weight: 400;
}

.nav-item.active .nav-item-tagline {
    color: var(--accent-secondary);
}

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

.sidebar-footer a {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===================================
   Main content
   =================================== */

.main {
    padding: 32px 48px;
    max-width: 100%;
    overflow-x: hidden;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ===================================
   Landing view
   =================================== */

.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.hero-accent {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 720px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 800px;
    margin: 0 auto 36px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-primary);
    line-height: 1;
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

.hero-cta {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-primary, .cta-secondary {
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.cta-primary {
    background: var(--accent-primary);
    color: white;
}

.cta-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cta-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--border);
}

.cta-secondary:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Layer grid */
.layer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 60px 0 40px;
}

.layer-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.layer-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-primary);
}

.layer-card-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.layer-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.layer-card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.layer-card-companies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
}

.layer-card-tag {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    padding: 3px 8px;
    border-radius: 10px;
}

/* Featured insights */
.section-h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 60px 0 24px;
    letter-spacing: -0.01em;
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 60px;
}

.insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.insight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.insight-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.insight-card:hover::before {
    transform: scaleX(1);
}

.insight-emoji {
    font-size: 32px;
    margin-bottom: 8px;
}

.insight-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.insight-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* How to read */
.how-to-read {
    margin: 60px 0;
}

.read-paths {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.read-path {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
}

.path-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.read-path h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.read-path p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.page-footer {
    margin-top: 60px;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.8;
}

/* ===================================
   Article view
   =================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--text-secondary);
}

.breadcrumb-separator {
    color: var(--border);
}

.article {
    max-width: 820px;
    margin: 0 auto;
    padding-bottom: 60px;
}

.article h1 {
    font-size: 36px;
    font-weight: 800;
    margin: 16px 0 24px;
    line-height: 1.25;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.article h2 {
    font-size: 26px;
    font-weight: 700;
    margin: 48px 0 16px;
    line-height: 1.3;
    color: var(--text-primary);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.article h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 32px 0 12px;
    color: var(--text-primary);
}

.article h4 {
    font-size: 17px;
    font-weight: 600;
    margin: 24px 0 10px;
    color: var(--text-secondary);
}

.article p {
    margin: 14px 0;
    line-height: 1.85;
    color: var(--text-primary);
    font-size: 16px;
}

.article ul, .article ol {
    margin: 14px 0;
    padding-left: 28px;
}

.article li {
    margin: 6px 0;
    line-height: 1.8;
}

.article blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border-left: 4px solid var(--accent-primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article blockquote p {
    margin: 4px 0;
}

.article code {
    font-family: var(--font-mono);
    background: var(--bg-elevated);
    color: var(--accent-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.92em;
    border: 1px solid var(--border-light);
}

.article pre {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 14px;
    line-height: 1.6;
}

.article pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: var(--text-primary);
    font-size: 14px;
}

.article strong {
    color: var(--text-primary);
    font-weight: 700;
}

.article em {
    font-style: italic;
}

.article hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 36px 0;
}

/* Tables */
.article table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: block;
    overflow-x: auto;
}

.article thead {
    background: var(--bg-elevated);
}

.article th, .article td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    vertical-align: top;
    line-height: 1.5;
}

.article th:last-child, .article td:last-child {
    border-right: none;
}

.article th {
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.article tbody tr:hover {
    background: var(--bg-elevated);
}

.article tbody tr:last-child td {
    border-bottom: none;
}

/* Mermaid */
.article .mermaid {
    text-align: center;
    margin: 24px 0;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    overflow-x: auto;
}

/* Links in article */
.article a {
    color: var(--accent-primary);
    text-decoration: underline;
    text-decoration-color: rgba(180, 83, 9, 0.3);
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
}

.article a:hover {
    text-decoration-color: var(--accent-primary);
}

/* Article nav */
.article-nav {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    padding: 24px 0;
    border-top: 1px solid var(--border);
}

.nav-btn {
    padding: 12px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.nav-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===================================
   TOC (right sidebar)
   =================================== */

.toc {
    position: sticky;
    top: calc(var(--topbar-height) + 32px);
    height: calc(100vh - var(--topbar-height) - 64px);
    overflow-y: auto;
    padding: 0 20px;
    align-self: flex-start;
    border-left: 1px solid var(--border);
}

.toc-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.toc-content {
    font-size: 13px;
}

.toc-item {
    display: block;
    padding: 4px 0;
    color: var(--text-secondary);
    line-height: 1.5;
    border-left: 2px solid transparent;
    padding-left: 12px;
    margin-left: -12px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.toc-item:hover {
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    text-decoration: none;
}

.toc-item.h3 {
    padding-left: 24px;
    font-size: 12px;
    color: var(--text-muted);
}

.toc-item.h4 {
    padding-left: 36px;
    font-size: 11px;
    color: var(--text-muted);
}

.toc-item.active {
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    font-weight: 600;
}

.toc.empty {
    visibility: hidden;
}

.internal-link {
    cursor: pointer;
}

/* ===================================
   Mobile responsive
   =================================== */

.mobile-only {
    display: none;
}

.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 1280px) {
    .layout {
        grid-template-columns: var(--sidebar-width) 1fr;
    }
    .toc {
        display: none;
    }
}

@media (max-width: 968px) {
    .mobile-only {
        display: flex;
    }
    .layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: var(--topbar-height);
        width: var(--sidebar-width);
        z-index: 60;
        transform: translateX(-100%);
        height: calc(100vh - var(--topbar-height));
    }
    .sidebar.active {
        transform: translateX(0);
    }
    .main {
        padding: 24px 20px;
    }
    #search-input {
        width: 140px;
    }
    .search-results {
        width: calc(100vw - 32px);
        right: -16px;
    }
    .hero-title {
        font-size: 32px;
    }
    .hero-subtitle {
        font-size: 16px;
    }
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .brand-subtitle {
        display: none;
    }
}

@media (max-width: 480px) {
    .brand-text {
        display: none;
    }
    #search-input {
        width: 100px;
    }
    .article h1 {
        font-size: 26px;
    }
    .article h2 {
        font-size: 22px;
    }
    .article p {
        font-size: 15px;
    }
}

/* Loading state */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px;
    color: var(--text-muted);
    font-size: 14px;
}

.loading::before {
    content: '☕';
    font-size: 32px;
    margin-right: 12px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Selection */
::selection {
    background: var(--accent-primary);
    color: white;
}

/* ===================================
   Top navigation (新视图导航)
   =================================== */
.top-nav {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: center;
}
.top-nav-link {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    cursor: pointer;
}
.top-nav-link:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}
.top-nav-link.active {
    background: var(--accent-primary);
    color: white;
}

/* ===================================
   View header (新视图通用头)
   =================================== */
.view-header {
    text-align: center;
    padding: 40px 20px 24px;
    max-width: 960px;
    margin: 0 auto;
}
.view-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 12px;
    letter-spacing: -0.01em;
}
.view-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===================================
   Industry Map (SVG 全景图)
   =================================== */
.map-container, #landing-map-svg {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}
.industry-map-svg {
    width: 100%;
    height: auto;
    display: block;
}
.industry-map-svg .company-node {
    transition: all 0.15s ease;
    outline: none;
}
.industry-map-svg .company-node:hover .company-rect {
    fill: var(--bg-elevated);
    stroke-width: 3;
    filter: drop-shadow(0 4px 12px rgba(180, 83, 9, 0.25));
}
.industry-map-svg .company-node:focus .company-rect {
    stroke-width: 3;
    stroke-dasharray: 4,2;
}
.landing-map-preview {
    margin: 60px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.map-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.link-btn {
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.link-btn:hover {
    background: var(--accent-primary);
    color: white;
}

/* ===================================
   Dashboard (Chart.js)
   =================================== */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}
.big-numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}
.big-number-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: 4px solid var(--accent-primary);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.big-number-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}
.big-number-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}
.big-number-value {
    font-size: 36px;
    font-weight: 800;
    font-family: var(--font-mono);
    line-height: 1;
    margin-bottom: 8px;
}
.big-number-sub {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}
.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}
.chart-card-wide {
    grid-column: 1 / -1;
}
.chart-card h3 {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.chart-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 18px;
}
.chart-card canvas {
    max-height: 320px;
}
.chart-card-wide canvas {
    max-height: 380px;
}

/* ===================================
   Sankey
   =================================== */
.sankey-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}
.sankey-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}
.sankey-svg {
    width: 100%;
    min-width: 900px;
    height: auto;
}
.sankey-svg .sankey-link {
    transition: opacity 0.2s ease;
}
.sankey-svg .sankey-link:hover {
    opacity: 0.6 !important;
}
.sankey-svg .sankey-node {
    cursor: pointer;
}
.sankey-legend {
    margin-top: 24px;
    background: var(--bg-elevated);
    border-left: 4px solid var(--accent-primary);
    padding: 20px 24px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.sankey-legend h3 {
    font-size: 16px;
    margin: 0 0 12px;
    color: var(--text-primary);
}
.sankey-legend ul {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ===================================
   Timeline
   =================================== */
.timeline-section {
    margin: 60px 0;
}
.timeline {
    border-left: 3px solid var(--border);
    padding-left: 24px;
    max-width: 800px;
}
.timeline-item {
    position: relative;
    padding: 12px 0 12px 32px;
    transition: background 0.15s ease;
    border-radius: var(--radius-sm);
}
.timeline-item:hover {
    background: var(--bg-elevated);
}
.timeline-emoji {
    position: absolute;
    left: -38px;
    top: 8px;
    width: 28px;
    height: 28px;
    background: var(--bg-card);
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 14px;
}
.timeline-date {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--accent-primary);
    font-weight: 700;
    margin-bottom: 4px;
}
.timeline-event {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.6;
}

@media (max-width: 968px) {
    .top-nav { display: none; }
    .chart-grid { grid-template-columns: 1fr; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Print */
@media print {
    .topbar, .sidebar, .toc, .article-nav, #progress-bar {
        display: none;
    }
    .layout {
        grid-template-columns: 1fr;
    }
    .main {
        padding: 0;
    }
}
