:root {
    --china: #d9534f;
    --world: #5bc0de;
    --bg: #f9f7f2;
    --text: #2c2c2c;
    --muted: #6b6b6b;
    --card: #ffffff;
    --border: #e5e0d8;
    --shadow: rgba(0, 0, 0, 0.06);
    --accent: #4a6cf7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
}

.page-wrapper {
    display: flex;
}

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

.side-panel {
    width: 300px;
    flex-shrink: 0;
    background: #fff;
    border-left: 1px solid var(--border);
    padding: 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero {
    position: relative;
    padding: 5rem 0 4rem;
    background: #fff;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(200, 200, 200, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200, 200, 200, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.6;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero-tag {
    font-size: 0.9rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    margin: 0 0 1.5rem;
    font-weight: 600;
}

.hero h1 {
    font-size: 3rem;
    margin: 0 0 0.5rem;
    line-height: 1.15;
    font-weight: 700;
    color: var(--text);
}

.hero h1 .accent {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 1.35rem;
    color: var(--text);
    margin: 0 0 1.5rem;
    font-weight: 600;
}

.hero-desc {
    font-size: 1rem;
    color: var(--muted);
    max-width: 640px;
    margin: 0 0 2rem;
    line-height: 1.8;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.hero-tag-item {
    padding: 0.5rem 1rem;
    background: #f0f0f0;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}

.hero-note {
    font-size: 0.8rem;
    color: #999;
    margin: 0 0 2rem;
    max-width: 720px;
}

.view-modes {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.view-label {
    font-size: 0.85rem;
    color: var(--muted);
}

.view-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.view-btn:hover {
    border-color: var(--text);
}

.view-btn.active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

.section-tag {
    font-size: 0.85rem;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0 0 0.75rem;
    font-weight: 600;
}

h1 {
    font-size: 2.25rem;
    margin: 0 0 1rem;
    line-height: 1.2;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 640px;
    margin: 0 0 1.5rem;
}

.mode-switcher {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 0.6rem 1.2rem;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.15s ease;
}

.mode-btn:hover {
    border-color: var(--text);
}

.mode-btn.active {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

.window-section {
    padding: 3.5rem 0;
    border-bottom: 1px solid var(--border);
}

.window-section:nth-child(odd) {
    background: #fff;
}

.window-section:nth-child(even) {
    background: #fdfcfa;
}

.window-tag {
    font-size: 0.85rem;
    color: var(--muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin: 0 0 0.5rem;
    font-weight: 600;
}

.window-section h2 {
    font-size: 1.6rem;
    margin: 0 0 0.5rem;
    font-weight: 700;
}

.window-period {
    font-size: 0.95rem;
    color: var(--muted);
    margin: 0 0 1rem;
    font-weight: 600;
}

.window-desc {
    color: var(--muted);
    max-width: 720px;
    margin: 0 0 2rem;
    font-size: 1rem;
}

.data-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.data-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 6px var(--shadow);
}

.data-card h4 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.data-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.mini-timeline {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
}

.mini-timeline h4 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.event-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.event-tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.event-tag.china {
    background: rgba(217, 83, 79, 0.12);
    color: var(--china);
}

.event-tag.world {
    background: rgba(91, 192, 222, 0.12);
    color: #2a8faa;
}

.timeline-full {
    text-align: center;
    background: #fff;
}

.cta {
    display: inline-block;
    padding: 0.9rem 1.6rem;
    background: var(--text);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.panel-section {
    margin-bottom: 2rem;
}

.panel-section h3 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: #444;
    font-weight: 600;
}

.panel-window {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

#globe {
    width: 100%;
    height: 260px;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    cursor: grab;
    user-select: none;
}

#globe:active {
    cursor: grabbing;
}

#globe svg {
    display: block;
    width: 100%;
    height: 100%;
}

.globe-caption {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    color: #888;
    text-align: center;
}

.globe-ocean {
    fill: #e8f4f8;
}

.globe-country {
    cursor: pointer;
    transition: fill 0.3s ease;
}

.globe-graticule {
    pointer-events: none;
}

.mechanism-flow {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.mech-step {
    padding: 0.5rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    width: 100%;
    text-align: center;
}

.mech-arrow {
    color: var(--muted);
    font-size: 0.8rem;
}

.window-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.window-nav a {
    display: block;
    padding: 0.6rem 0.75rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.window-nav a:hover {
    background: var(--bg);
    color: var(--text);
}

.window-nav a.active {
    background: var(--text);
    color: #fff;
}

@media (max-width: 900px) {
    .page-wrapper {
        flex-direction: column;
    }

    .side-panel {
        width: 100%;
        height: auto;
        position: static;
        border-left: none;
        border-top: 1px solid var(--border);
    }

    .container {
        padding: 0 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .window-section {
        padding: 2.5rem 0;
    }
}
