/* ================================
   万界星图：造物主日志 - 样式表
   风格：复古羊皮纸卷轴
   ================================ */

/* 基础设置 */
:root {
    /* 羊皮纸色系 */
    --parchment: #f5e6d3;
    --parchment-dark: #e8d4bc;
    --parchment-shadow: #d4c4a8;
    --ink: #2c2416;
    --ink-light: #5c4d3c;
    --ink-faded: #8b7355;
    
    /* 势力颜色 */
    --royal: #8B4513;
    --merchant: #DAA520;
    --cult: #4B0082;
    
    /* 国家颜色 */
    --nation-1: #8B4513;
    --nation-2: #2E8B57;
    --nation-3: #4682B4;
    --nation-4: #9370DB;
    --nation-5: #CD853F;
    --nation-6: #DC143C;
    
    /* 特效 */
    --glow-warm: rgba(218, 165, 32, 0.4);
    --shadow-paper: 0 4px 20px rgba(44, 36, 22, 0.15);
    --border-ornate: 2px solid var(--ink-faded);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Serif SC', 'Cinzel', serif;
    background: var(--parchment);
    color: var(--ink);
    line-height: 1.8;
    overflow-x: hidden;
}

/* 羊皮纸背景纹理 */
.parchment-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(139, 115, 85, 0.03) 2px,
            rgba(139, 115, 85, 0.03) 4px
        ),
        radial-gradient(ellipse at 30% 20%, rgba(218, 165, 32, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(139, 69, 19, 0.08) 0%, transparent 50%),
        var(--parchment);
    pointer-events: none;
    z-index: -1;
}

/* 浮动符文 */
.floating-runes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.rune {
    position: absolute;
    font-size: 2rem;
    color: var(--parchment-shadow);
    opacity: 0.3;
    animation: float-rune 20s infinite ease-in-out;
}

.rune:nth-child(1) { top: 10%; left: 5%; animation-delay: 0s; }
.rune:nth-child(2) { top: 20%; right: 10%; animation-delay: 3s; }
.rune:nth-child(3) { top: 60%; left: 8%; animation-delay: 6s; }
.rune:nth-child(4) { bottom: 20%; right: 5%; animation-delay: 9s; }
.rune:nth-child(5) { bottom: 40%; left: 15%; animation-delay: 12s; }
.rune:nth-child(6) { top: 40%; right: 20%; animation-delay: 15s; }

@keyframes float-rune {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.2; }
    50% { transform: translateY(-20px) rotate(10deg); opacity: 0.4; }
}

/* 导航栏 - 卷轴风格 */
.scroll-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 3%;
    background: linear-gradient(to bottom, var(--parchment-dark), var(--parchment));
    border-bottom: var(--border-ornate);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-paper);
}

.nav-ornament {
    font-size: 1.5rem;
    color: var(--ink-faded);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.5rem;
    animation: pulse-star 2s infinite;
}

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

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--ink);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--ink-light);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s;
}

.nav-links a::before {
    content: '❧';
    position: absolute;
    left: 50%;
    bottom: -5px;
    transform: translateX(-50%) scale(0);
    color: var(--royal);
    transition: transform 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--royal);
}

.nav-links a:hover::before,
.nav-links a.active::before {
    transform: translateX(-50%) scale(1);
}

/* 导航操作按钮 */
.nav-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-nav {
    width: 36px;
    height: 36px;
    border: 2px solid var(--ink-faded);
    background: var(--parchment);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-nav:hover {
    border-color: var(--royal);
    background: var(--royal);
    transform: scale(1.1);
}

/* 创世主视觉区 */
.genesis-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6rem 2rem;
    overflow: hidden;
}

/* 卷轴边框 */
.scroll-border {
    position: absolute;
    width: 90%;
    height: 40px;
    display: flex;
    justify-content: space-between;
}

.scroll-border.top { top: 3rem; }
.scroll-border.bottom { bottom: 3rem; }

.scroll-border::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 40px;
    right: 40px;
    height: 2px;
    background: linear-gradient(to right, transparent, var(--ink-faded), transparent);
}

.scroll-roller {
    width: 60px;
    height: 40px;
    background: linear-gradient(to bottom, #8B4513, #654321);
    border-radius: 10px;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.scroll-roller::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10px;
    right: 10px;
    height: 2px;
    background: var(--parchment-shadow);
}

.hero-content {
    text-align: center;
    max-width: 800px;
    z-index: 1;
}

.seal-mark {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: seal-glow 3s infinite;
}

@keyframes seal-glow {
    0%, 100% { filter: drop-shadow(0 0 10px var(--glow-warm)); }
    50% { filter: drop-shadow(0 0 20px var(--glow-warm)); }
}

.title-ancient {
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--ink);
    text-shadow: 2px 2px 4px var(--parchment-shadow);
}

.title-divider {
    display: block;
    font-size: 1.5rem;
    color: var(--ink-faded);
    margin: 0.5rem 0;
}

.subtitle {
    display: block;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 400;
    color: var(--ink-light);
    letter-spacing: 0.3em;
}

.prophecy {
    font-size: 1.2rem;
    color: var(--ink-faded);
    font-style: italic;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.prophecy::before,
.prophecy::after {
    content: '❝';
    position: absolute;
    font-size: 2rem;
    color: var(--parchment-shadow);
    opacity: 0.5;
}

.prophecy::before {
    left: -2rem;
    top: -0.5rem;
}

.prophecy::after {
    content: '❞';
    right: -2rem;
    bottom: -0.5rem;
}

/* 按钮样式 */
.genesis-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.btn-scroll {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2.5rem;
    font-family: inherit;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid var(--royal);
    background: linear-gradient(135deg, var(--parchment), var(--parchment-dark));
    color: var(--royal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow-paper);
}

.btn-scroll::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(218, 165, 32, 0.2), transparent);
    transition: left 0.5s;
}

.btn-scroll:hover::before {
    left: 100%;
}

.btn-scroll:hover {
    background: var(--royal);
    color: var(--parchment);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 69, 19, 0.3);
}

.btn-icon {
    font-size: 1.3rem;
}

.cta-hint {
    font-size: 0.9rem;
    color: var(--ink-faded);
}

/* 创世面板 */
.genesis-panel {
    max-width: 900px;
    margin: 4rem auto;
    padding: 3rem;
    background: linear-gradient(135deg, var(--parchment), var(--parchment-dark));
    border: var(--border-ornate);
    border-radius: 10px;
    box-shadow: var(--shadow-paper);
    position: relative;
}

.genesis-panel.hidden {
    display: none;
}

.genesis-panel::before,
.genesis-panel::after {
    content: '❦';
    position: absolute;
    font-size: 2rem;
    color: var(--ink-faded);
    opacity: 0.5;
}

.genesis-panel::before { top: 1rem; left: 1rem; }
.genesis-panel::after { bottom: 1rem; right: 1rem; }

.panel-header {
    text-align: center;
    margin-bottom: 3rem;
}

.panel-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--ink);
}

.panel-header p {
    color: var(--ink-faded);
}

/* 问题卡片 */
.questions-container {
    position: relative;
    min-height: 300px;
}

.question-card {
    display: none;
    text-align: center;
    animation: fade-in 0.5s;
}

.question-card.active {
    display: block;
}

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

.q-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--parchment-shadow);
    margin-bottom: 1rem;
}

.question-card h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--royal);
}

.question-card > p {
    color: var(--ink-light);
    margin-bottom: 2rem;
}

.options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.option-btn {
    padding: 1rem 2rem;
    font-family: inherit;
    font-size: 1rem;
    border: 2px solid var(--ink-faded);
    background: var(--parchment);
    color: var(--ink);
    cursor: pointer;
    transition: all 0.3s;
    min-width: 150px;
}

.option-btn:hover,
.option-btn.selected {
    border-color: var(--royal);
    background: var(--royal);
    color: var(--parchment);
}

.option-btn.custom {
    border-style: dashed;
}

/* 进度球 */
.progress-orb {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--parchment-dark);
    border: 3px solid var(--royal);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-paper);
    z-index: 100;
}

.orb-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 20%;
    background: var(--royal);
    border-radius: 0 0 50% 50%;
    opacity: 0.3;
    transition: height 0.3s;
}

.orb-text {
    font-weight: 700;
    color: var(--royal);
    z-index: 1;
}

/* 模拟器区域 */
.simulator-section {
    padding: 4rem 2rem;
    background: linear-gradient(to bottom, var(--parchment), var(--parchment-dark));
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--ink-faded);
}

/* 左右布局 */
.simulator-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* 地图容器 */
.map-container,
.timeline-container {
    background: var(--parchment);
    border: var(--border-ornate);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-paper);
}

.map-scroll,
.timeline-scroll {
    padding: 1.5rem;
}

.map-header,
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--parchment-shadow);
    margin-bottom: 1.5rem;
}

.map-title {
    font-weight: 600;
    color: var(--royal);
}

.map-year {
    font-size: 0.9rem;
    color: var(--ink-faded);
    padding: 0.3rem 0.8rem;
    background: var(--parchment-dark);
    border-radius: 20px;
}

/* 世界地图 */
.world-map {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    aspect-ratio: 4/3;
    padding: 1rem;
    background: 
        radial-gradient(ellipse at center, rgba(139, 69, 19, 0.05) 0%, transparent 70%),
        var(--parchment-dark);
    border-radius: 8px;
    position: relative;
}

.nation {
    position: relative;
}

.nation-territory {
    height: 100%;
    background: linear-gradient(135deg, var(--nation-color), color-mix(in srgb, var(--nation-color) 70%, black));
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    position: relative;
}

.nation-territory::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.1'/%3E%3C/svg%3E");
    opacity: 0.3;
    pointer-events: none;
}

.nation-territory:hover {
    transform: scale(1.05);
    border-color: var(--parchment);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 10;
}

.nation-territory.selected {
    border-color: #FFD700 !important;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.4), 0 10px 30px rgba(0,0,0,0.2);
    transform: scale(1.05);
}

.nation-territory.selected::after {
    content: '✦';
    position: absolute;
    top: 6px;
    right: 8px;
    color: #FFD700;
    font-size: 1rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.nation-name {
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.power-dots {
    display: flex;
    gap: 0.4rem;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.dot.royal { background: var(--royal); }
.dot.merchant { background: var(--merchant); }
.dot.cult { background: var(--cult); }

/* 地图图例 */
.map-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--parchment-shadow);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--ink-light);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.royal { background: var(--royal); }
.legend-dot.merchant { background: var(--merchant); }
.legend-dot.cult { background: var(--cult); }

/* 时间线 */
.timeline-header span {
    font-weight: 600;
    color: var(--royal);
}

.timeline-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-filter {
    width: 36px;
    height: 36px;
    border: 2px solid var(--ink-faded);
    background: var(--parchment);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-filter:hover,
.btn-filter.active {
    border-color: var(--royal);
    background: var(--royal);
    color: var(--parchment);
}

/* 筛选面板 */
.filter-panel {
    background: var(--parchment-dark);
    border: 1px solid var(--parchment-shadow);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    animation: slide-down 0.3s ease;
}

.filter-panel.hidden {
    display: none;
}

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

.filter-section {
    margin-bottom: 0.8rem;
}

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

.filter-label {
    font-size: 0.85rem;
    color: var(--ink-faded);
    margin-right: 0.5rem;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.3rem;
}

.filter-chip {
    padding: 0.3rem 0.8rem;
    font-family: inherit;
    font-size: 0.8rem;
    border: 1px solid var(--parchment-shadow);
    background: var(--parchment);
    color: var(--ink-light);
    cursor: pointer;
    border-radius: 15px;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--royal);
}

.filter-chip.active {
    background: var(--royal);
    color: var(--parchment);
    border-color: var(--royal);
}

.btn-evolve {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    border: none;
    background: var(--royal);
    color: var(--parchment);
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s;
}

.btn-evolve:hover {
    background: color-mix(in srgb, var(--royal) 80%, black);
    transform: scale(1.05);
}

/* 领域选择按钮 */
.domain-selector {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.btn-domain {
    padding: 0.5rem 1.1rem;
    font-family: inherit;
    font-size: 0.92rem;
    border: 1px solid var(--parchment-shadow);
    background: rgba(255,255,255,0.5);
    color: var(--ink-light);
    cursor: pointer;
    border-radius: 14px;
    transition: all 0.25s;
}

.btn-domain:hover {
    background: rgba(255,255,255,0.8);
    color: var(--ink);
}

.btn-domain.active {
    background: var(--ink);
    color: var(--parchment);
    border-color: var(--ink);
}

.timeline-flow {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.timeline-flow::-webkit-scrollbar {
    width: 6px;
}

.timeline-flow::-webkit-scrollbar-track {
    background: var(--parchment-dark);
    border-radius: 3px;
}

.timeline-flow::-webkit-scrollbar-thumb {
    background: var(--ink-faded);
    border-radius: 3px;
}

.era-marker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--parchment-dark);
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--royal);
}

.era-icon {
    font-size: 1.5rem;
}

.era-name {
    font-weight: 600;
    color: var(--royal);
}

.event-node {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 1.5rem;
    border-left: 2px solid var(--parchment-shadow);
}

.event-node::before {
    content: '●';
    position: absolute;
    left: -6px;
    top: 0;
    color: var(--royal);
    font-size: 0.8rem;
}

.event-time {
    font-size: 0.85rem;
    color: var(--ink-faded);
    margin-bottom: 0.3rem;
}

.event-content {
    background: var(--parchment-dark);
    padding: 1rem;
    border-radius: 8px;
}

.event-type {
    font-weight: 600;
    color: var(--royal);
    margin-bottom: 0.5rem;
}

.event-content p {
    font-size: 0.95rem;
    color: var(--ink-light);
    margin-bottom: 0.5rem;
}

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

.tag {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    background: rgba(139, 69, 19, 0.1);
    color: var(--royal);
    border-radius: 12px;
    border: 1px solid rgba(139, 69, 19, 0.2);
}

/* 世界画廊 */
.worlds-gallery {
    padding: 4rem 2rem;
    background: var(--parchment);
}

.worlds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.world-card {
    background: linear-gradient(135deg, var(--parchment), var(--parchment-dark));
    border: var(--border-ornate);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
}

.world-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(44, 36, 22, 0.2);
}

.card-ornament {
    position: absolute;
    font-size: 1.5rem;
    color: var(--royal);
    opacity: 0.5;
    z-index: 1;
}

.card-ornament.top { top: 0.5rem; right: 0.5rem; }
.card-ornament.bottom { bottom: 0.5rem; left: 0.5rem; }

.world-preview {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.world-constellation {
    font-size: 4rem;
    opacity: 0.8;
}

.world-info {
    padding: 1.5rem;
}

.world-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
    color: var(--ink);
}

.world-author {
    font-size: 0.9rem;
    color: var(--ink-faded);
    margin-bottom: 1rem;
}

.world-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--ink-light);
}

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

.world-card.featured {
    grid-column: span 2;
}

/* 页脚 */
.ancient-footer {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--parchment-dark);
    border-top: var(--border-ornate);
}

.footer-ornament {
    font-size: 2rem;
    color: var(--royal);
    margin-bottom: 1rem;
}

.ancient-footer p {
    color: var(--ink-light);
    margin-bottom: 0.5rem;
}

.footer-quote {
    font-style: italic;
    color: var(--ink-faded);
}

.footer-runes {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 1.2rem;
    color: var(--parchment-shadow);
}

/* ================================
   国家详情弹窗
   ================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 36, 22, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    display: none;
    opacity: 0;
}

.modal-scroll {
    background: linear-gradient(135deg, var(--parchment), var(--parchment-dark));
    border: var(--border-ornate);
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    animation: modal-in 0.3s ease;
}

.modal-scroll.wide {
    max-width: 900px;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(to bottom, var(--parchment-dark), var(--parchment));
    border-bottom: 1px solid var(--parchment-shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--royal);
    margin: 0;
}

.modal-ornament {
    font-size: 1.2rem;
    color: var(--ink-faded);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border: 2px solid var(--ink-faded);
    background: var(--parchment);
    color: var(--ink);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 11;
}

.modal-close:hover {
    background: var(--royal);
    color: var(--parchment);
    border-color: var(--royal);
    transform: rotate(90deg);
}

.modal-content {
    padding: 1.5rem;
}

/* 国家概览 */
.nation-overview {
    margin-bottom: 2rem;
}

.nation-color-strip {
    height: 8px;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.nation-description {
    font-size: 1rem;
    color: var(--ink-light);
    line-height: 1.8;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(139, 115, 85, 0.1);
    border-radius: 8px;
    border-left: 4px solid var(--royal);
}

.nation-traits {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 势力区块 */
.powers-section,
.relations-section,
.history-section {
    margin-bottom: 2rem;
}

.powers-section h3,
.relations-section h3,
.history-section h3 {
    font-size: 1.1rem;
    color: var(--ink);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--parchment-shadow);
}

.powers-grid {
    display: grid;
    gap: 1rem;
}

.power-card {
    background: var(--parchment);
    border: 1px solid var(--parchment-shadow);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s;
}

.power-card:hover {
    border-color: var(--royal);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.15);
}

.power-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.power-icon.royal { background: var(--royal); color: white; }
.power-icon.merchant { background: var(--merchant); color: white; }
.power-icon.cult { background: var(--cult); color: white; }

.power-info h4 {
    font-size: 1rem;
    color: var(--ink);
    margin-bottom: 0.3rem;
}

.power-info p {
    font-size: 0.85rem;
    color: var(--ink-faded);
    margin-bottom: 0.5rem;
}

.power-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.power-tag {
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: rgba(139, 69, 19, 0.1);
    color: var(--royal);
}

/* 外交关系 */
.relations-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.relation-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: var(--parchment);
    border-radius: 8px;
    border: 1px solid var(--parchment-shadow);
}

.relation-nation {
    font-weight: 600;
    color: var(--ink);
    min-width: 80px;
}

.relation-bar {
    flex: 1;
    height: 6px;
    background: var(--parchment-dark);
    border-radius: 3px;
    overflow: hidden;
}

.relation-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.relation-fill.ally { background: #2E8B57; }
.relation-fill.neutral { background: var(--ink-faded); }
.relation-fill.hostile { background: #DC143C; }

.relation-value {
    font-size: 0.8rem;
    color: var(--ink-faded);
    min-width: 40px;
    text-align: right;
}

/* 历史记录 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.history-item {
    padding: 0.8rem 1rem;
    background: var(--parchment);
    border-radius: 8px;
    border-left: 3px solid var(--royal);
    font-size: 0.9rem;
}

.history-time {
    font-size: 0.8rem;
    color: var(--ink-faded);
    margin-bottom: 0.3rem;
}

.history-content {
    color: var(--ink-light);
}

.relation-hint {
    font-size: 0.8rem;
    color: var(--ink-faded);
    font-weight: normal;
}

/* 关键人物区域 */
.heroes-section {
    margin-bottom: 2rem;
}

.heroes-section h3 {
    font-size: 1.1rem;
    color: var(--ink);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--parchment-shadow);
}

.heroes-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.hero-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: var(--parchment);
    border: 1px solid var(--parchment-shadow);
    border-radius: 8px;
    transition: all 0.2s;
}

.hero-item:hover {
    border-color: var(--royal);
}

.hero-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--parchment-dark);
    border: 2px solid var(--royal);
}

.hero-info h4 {
    font-size: 1rem;
    color: var(--ink);
    margin-bottom: 0.2rem;
}

.hero-info p {
    font-size: 0.85rem;
    color: var(--ink-faded);
}

.hero-status {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
}

.hero-status.alive {
    background: #2E8B57;
    color: white;
}

.hero-status.dead {
    background: var(--ink-faded);
    color: var(--parchment);
}

.hero-status.legend {
    background: var(--royal);
    color: var(--parchment);
}

/* 世界管理弹窗样式 */
.current-world-section {
    margin-bottom: 2rem;
}

.current-world-section h3,
.saved-worlds-section h3 {
    font-size: 1rem;
    color: var(--ink);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--parchment-shadow);
}

.current-world-card {
    background: var(--parchment);
    border: 2px solid var(--royal);
    border-radius: 8px;
    padding: 1rem;
}

.world-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.world-name-input {
    flex: 1;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--royal);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.3rem;
    transition: border-color 0.3s;
}

.world-name-input:focus {
    outline: none;
    border-bottom-color: var(--royal);
}

.world-name-input::placeholder {
    color: var(--ink-faded);
}

.btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--parchment-shadow);
}

.world-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--ink-faded);
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-family: inherit;
    font-size: 0.85rem;
    border: 1px solid var(--royal);
    background: var(--parchment);
    color: var(--royal);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-small:hover {
    background: var(--royal);
    color: var(--parchment);
}

.saved-worlds-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-height: 250px;
    overflow-y: auto;
}

.saved-world-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background: var(--parchment);
    border: 1px solid var(--parchment-shadow);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.saved-world-item:hover {
    border-color: var(--royal);
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.15);
}

.saved-world-item.active {
    border-color: var(--royal);
    background: rgba(139, 69, 19, 0.05);
}

.world-item-info {
    flex: 1;
}

.world-item-name {
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.2rem;
}

.world-item-meta {
    font-size: 0.8rem;
    color: var(--ink-faded);
}

.world-item-actions {
    display: flex;
    gap: 0.3rem;
}

.btn-item-action {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-item-action:hover {
    background: var(--parchment-shadow);
}

.btn-item-action.delete:hover {
    background: #DC143C;
    color: white;
}

.world-actions {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.btn-danger {
    border-color: #DC143C;
    color: #DC143C;
}

.btn-danger:hover {
    background: #DC143C;
    color: white;
}

/* 人物志弹窗样式 */
.heroes-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--parchment-shadow);
}

.hero-tab {
    padding: 0.5rem 1.2rem;
    font-family: inherit;
    font-size: 0.9rem;
    border: 1px solid var(--parchment-shadow);
    background: var(--parchment);
    color: var(--ink-light);
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s;
}

.hero-tab:hover {
    border-color: var(--royal);
}

.hero-tab.active {
    background: var(--royal);
    color: var(--parchment);
    border-color: var(--royal);
}

.heroes-filter {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--ink-light);
}

.heroes-filter select {
    font-family: inherit;
    padding: 0.4rem 1rem;
    border: 1px solid var(--parchment-shadow);
    background: var(--parchment);
    color: var(--ink);
    border-radius: 4px;
    cursor: pointer;
}

.heroes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.hero-card {
    background: var(--parchment);
    border: 1px solid var(--parchment-shadow);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s;
}

.hero-card:hover {
    border-color: var(--royal);
    box-shadow: 0 4px 12px rgba(139, 69, 19, 0.15);
    transform: translateY(-2px);
}

.hero-card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.hero-card-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--parchment-dark);
    border: 2px solid var(--royal);
}

.hero-card-title h4 {
    font-size: 1rem;
    color: var(--ink);
    margin-bottom: 0.2rem;
}

.hero-card-title span {
    font-size: 0.8rem;
    color: var(--ink-faded);
}

.hero-card-body {
    font-size: 0.9rem;
    color: var(--ink-light);
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

.hero-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hero-card-tags {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.hero-card-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: rgba(139, 69, 19, 0.1);
    color: var(--royal);
}

/* 保存提示 */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ink);
    color: var(--parchment);
    padding: 1rem 2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    z-index: 3000;
    animation: toast-in 0.3s ease;
}

.toast.hidden {
    display: none;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast-icon {
    font-size: 1.2rem;
}

/* ================================
   响应式设计
   ================================ */
@media (max-width: 1024px) {
    .simulator-layout {
        grid-template-columns: 1fr;
    }
    
    .world-card.featured {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .scroll-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .world-map {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .genesis-panel {
        margin: 2rem 1rem;
        padding: 2rem 1rem;
    }
}

/* ========== 关于 / 开发日记 ========== */
.about-section {
    padding: 4rem 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.about-section .section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.about-section .section-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.about-section h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: var(--ink);
    margin-bottom: 0.5rem;
}

.about-section .section-subtitle {
    color: var(--ink-faded);
    font-size: 0.95rem;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-card {
    background: rgba(255,255,255,0.6);
    border: 1px solid var(--parchment-shadow);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
}

.about-card::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px; right: -1px; bottom: -1px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(218,165,32,0.15), transparent 50%);
    z-index: -1;
}

.about-card h3 {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.15rem;
    color: var(--ink);
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--parchment-shadow);
}

.about-card p {
    color: var(--ink-light);
    line-height: 1.8;
    font-size: 0.95rem;
}

.about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.about-tag {
    background: rgba(218,165,32,0.12);
    color: #8B6914;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(218,165,32,0.25);
}

/* 开发时间线 */
.dev-timeline {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dev-entry {
    display: grid;
    grid-template-columns: 90px 70px 1fr;
    gap: 0.8rem;
    align-items: start;
    padding: 0.6rem 0;
    border-bottom: 1px dashed var(--parchment-shadow);
}

.dev-entry:last-child {
    border-bottom: none;
}

.dev-date {
    font-size: 0.8rem;
    color: var(--ink-faded);
    font-family: 'Cinzel', serif;
}

.dev-version {
    font-size: 0.75rem;
    background: var(--ink);
    color: var(--parchment);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-align: center;
    white-space: nowrap;
}

.dev-content p {
    font-size: 0.9rem;
    color: var(--ink-light);
    margin: 0;
    line-height: 1.6;
}

/* 版图规划 */
.roadmap {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.roadmap-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--ink-light);
    padding: 0.4rem 0;
}

.roadmap-item.done {
    color: var(--ink-faded);
    text-decoration: line-through;
    opacity: 0.7;
}

.roadmap-item.current {
    color: var(--ink);
    font-weight: bold;
    background: rgba(218,165,32,0.08);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border-left: 3px solid #DAA520;
}

.roadmap-icon {
    font-size: 1rem;
}

@media (max-width: 768px) {
    .dev-entry {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
    .dev-version {
        width: fit-content;
    }
}
