:root {
    --bg-deep: #0a0a14;
    --text-primary: #e8e8f0;
    --text-secondary: #b0b0c8;
    --accent-cyan: #5eeadb;
    --accent-purple: #a78bfa;
    --accent-blue: #60a5fa;
    --accent-pink: #f472b6;
    --accent-gold: #fbbf24;
    --boss-name-color: #FF5555;
    --font-main: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 260px;
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-main);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.5;
    letter-spacing: 0.02em;
    /* 使用浏览器原生滚动条：窗口不足时横向滚动，而不是裁切内容；
       不使用内部滚动容器，整页统一由浏览器滚动。 */
    overflow-x: auto;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

/* ========== 侧边栏 ========== */
#sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255,255,255,0.06);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    align-self: flex-start;  /* 跟随网页滑动，不固定/不内部滚动 */
}

.sidebar-header {
    text-align: center;
}
.sidebar-thumbnail {
    width: 120px;
    height: auto;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 10px;
}
.sidebar-title {
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px rgba(160,180,255,0.4);
    line-height: 1.2;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
}
.nav-btn {
    display: block;
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 16px;
    text-decoration: none;
    transition: all var(--transition-smooth);
    text-align: center;
}
.nav-btn:hover {
    color: #fff;
    background: rgba(94,234,219,0.15);
    border-color: rgba(94,234,219,0.3);
    text-shadow: 0 0 6px rgba(94,234,219,0.3);
}
.nav-btn.nav-hidden {
    opacity: 0;
    transition: opacity var(--transition-smooth);
}
.nav-btn.nav-hidden:hover {
    opacity: 1;
}

/* ========== 右侧主内容区 ========== */
.main-content {
    flex: 0 0 1400px;
    width: 1400px;
    padding: 24px 32px 48px;
}

.content-section {
    margin-bottom: 28px;
}
.content-card {
    background: rgba(20, 20, 40, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 20px 22px 18px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 3px 22px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}
.content-card:hover {
    border-color: rgba(94, 234, 219, 0.25);
    box-shadow: 0 3px 26px rgba(0, 0, 0, 0.35), 0 0 40px rgba(94, 234, 219, 0.07);
}

.content-title {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    color: #e0e0f0;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 6px;
}
.content-title::before {
    content: '';
    display: inline-block;
    width: 2.5px;
    height: 15px;
    background: var(--accent-cyan);
    border-radius: 2px;
}

.content-text {
    font-size: 0.82rem;
    color: #c8c8dc;
    line-height: 1.7;
    margin-bottom: 10px;
}
.content-text:last-child { margin-bottom: 0; }

/* BOSS 页正文：字号与颜色略大（原先为 boss.html 内联 !important 覆盖） */
.boss-page .content-text {
    font-size: 0.95rem;
    color: #e0e0e8;
}

/* 经济体系页：正文与子标题字号独立调大（仅作用于 .economy-page，不影响其它页） */
.economy-page .content-text {
    font-size: 0.9rem;
    line-height: 1.85;
}
.economy-page .sub-area-title {
    font-size: 1rem;
}
/* ============================================================
   通用数据表格（wiki-table，如 economy.html 的汇率/经济数据）
   用法：<div class="wiki-table-wrap"><table class="wiki-table">...</table></div>
   ============================================================ */
.wiki-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 12px 0;
}
.wiki-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.wiki-table th,
.wiki-table td {
    padding: 8px 14px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.wiki-table thead th {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}
.wiki-table tbody tr:hover {
    background: rgba(94, 234, 219, 0.06);
}
.boss-intro {
    font-size: 0.95rem;
    color: #c8c8dc;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border-left: 2px solid var(--accent-gold);
}

.content-highlight { color: var(--accent-cyan); font-weight: 500; }
.content-muted { color: rgba(180,180,200,0.6); font-size: 0.75rem; }

.sub-area-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #c0c0d8;
    margin: 16px 0 10px;
    padding-left: 6px;
    border-left: 2px solid var(--accent-cyan);
}

.mobs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

/* ============================================================
   栅格布局：每行显示数量统一控制
   调整各规则中的 repeat(N, 1fr) 即可改变对应列表每行显示的个数
   （从各页面内联 <style> 与 JS 注入样式中抽取汇总）
   ============================================================ */

/* 内容卡片网格：默认每行 4 个，可加 -1 / -2 / -3 / -4 / -5 覆盖 */
.content-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
/* 一行一个 */
.content-grid-1 { grid-template-columns: repeat(1, 1fr); }
/* 一行两个 */
.content-grid-2 { grid-template-columns: repeat(2, 1fr); }
/* 一行三个 */
.content-grid-3 { grid-template-columns: repeat(3, 1fr); }
/* 一行四个 */
.content-grid-4 { grid-template-columns: repeat(4, 1fr); }
/* 一行五个 */
.content-grid-5 { grid-template-columns: repeat(5, 1fr); }

/* 玩家卡片：每行 3 个 */
.player-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* 工具调用页表单：每行 2 列 */
.tool-app {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px 16px;
    align-items: start;
}
.tool-app h1,
.tool-app .sub,
.tool-app .row,
.tool-app .btn-calc,
.tool-app .result-box,
.tool-app .note {
    grid-column: 1 / -1;
}

/* 开箱模拟器：左右 2 栏 */
.crate-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
}

/* 锻造模拟器：模板 / 数值 / 区域 / 目标 各 3 列 */
.forge-app .forge-templates {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.forge-app .forge-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.forge-app .forge-zones {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    font-size: 0.78rem;
    color: #fca5a5;
}
.forge-app .forge-targets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

/* ============================================================
   物品 / 道具 / 饰品卡片（item.html / forging.html / accessory.html 共用）
   饰品卡片换行布局见各页的内联覆盖（.item-card { flex-wrap; align-items }）
   ============================================================ */
.item-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(20, 20, 40, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 14px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: all 0.3s;
}
.item-card:hover {
    border-color: rgba(94, 234, 219, 0.3);
    box-shadow: 0 3px 22px rgba(0, 0, 0, 0.35), 0 0 32px rgba(94, 234, 219, 0.1);
    transform: translateY(-2px);
    background: rgba(24, 24, 48, 0.7);
}
.item-card img {
    width: 128px;
    height: 128px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    flex-shrink: 0;
}
.item-info {
    flex: 1;
}
.item-name {
    font-size: 1rem;
    font-weight: 700;
    color: #e0e0f0;
    margin-bottom: 4px;
}
.item-meta {
    font-size: 0.82rem;
    color: #b0b0c8;
    line-height: 1.6;
}
.item-meta p {
    margin-bottom: 2px;
}
.item-meta strong {
    color: #d0d0e0;
}

/* ============================================================
   页面内子导航（链接式 / 按钮式）
   item / point / accessory / forging / fun 共用
   按钮尺寸可用 --subnav-* 变量微调，间距用 --subnav-gap
   ============================================================ */
.sub-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--subnav-gap, 24px);
    margin-bottom: 20px;
}
/* 链接式（item.html / gazetteer.html / fun） */
.sub-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.3s;
}
.sub-nav-link:hover {
    color: #fff;
    background: rgba(94, 234, 219, 0.1);
}
.sub-nav-separator {
    color: rgba(180, 180, 200, 0.3);
}
/* 按钮式（accessory.html / forging.html） */
.sub-nav-btn {
    font-family: var(--font-main);
    font-weight: 500;
    font-size: var(--subnav-font-size, 1.05rem);
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--subnav-radius, 8px);
    padding: var(--subnav-padding-y, 8px) var(--subnav-padding-x, 16px);
    text-decoration: none;
    transition: all var(--transition-smooth);
}
.sub-nav-btn:hover {
    color: #fff;
    background: rgba(94, 234, 219, 0.15);
    border-color: rgba(94, 234, 219, 0.3);
    text-shadow: 0 0 6px rgba(94, 234, 219, 0.3);
}

.gazetteer-card {
    background: rgba(20,20,40,0.6);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 18px 16px 14px;
    backdrop-filter: blur(14px);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}
.gazetteer-card::before {
    content: '';
    position: absolute;
    top: 0; left: 10px; right: 10px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
    opacity: 0;
    transition: opacity 0.3s;
}
.gazetteer-card:hover {
    transform: translateY(-2px);
    border-color: rgba(94,234,219,0.3);
    box-shadow: 0 3px 22px rgba(0,0,0,0.35), 0 0 32px rgba(94,234,219,0.1);
    background: rgba(24,24,48,0.7);
}
.gazetteer-card:hover::before { opacity: 1; }
.gazetteer-name { font-weight: 700; font-size: 1.05rem; color: #ececf2; margin-bottom: 6px; }
.gazetteer-coords {
    font-family: var(--font-main);
    font-size: 0.88rem;
    color: var(--accent-cyan);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.gazetteer-desc { font-size: 0.85rem; color: var(--text-secondary); padding-top: 6px; border-top: 1px solid rgba(255,255,255,0.06); }
.gazetteer-desc strong { color: #d0d0e0; }

/* BOSS 卡片（列数由所在 .content-grid-N 决定，此处不再跨列） */
.boss-card {
    background: rgba(20,20,40,0.6);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 20px 18px 16px;
    backdrop-filter: blur(14px);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}
.boss-card::before {
    content: '';
    position: absolute;
    top: 0; left: 10px; right: 10px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-pink));
    opacity: 0;
    transition: opacity 0.3s;
}
.boss-card:hover {
    transform: translateY(-2px);
    border-color: rgba(94,234,219,0.3);
    box-shadow: 0 3px 22px rgba(0,0,0,0.35), 0 0 32px rgba(94,234,219,0.1);
    background: rgba(24,24,48,0.7);
}
.boss-card:hover::before { opacity: 1; }
.boss-card .gazetteer-name { font-weight: 700; font-size: 1.1rem; color: var(--boss-name-color); margin-bottom: 6px; }
.boss-card .gazetteer-coords { font-family: var(--font-main); font-size: 0.88rem; color: var(--accent-cyan); margin-bottom: 8px; }
.boss-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.06); }
.boss-info-item { font-size: 0.82rem; color: var(--text-secondary); }
.boss-info-full { grid-column: span 2; font-size: 0.82rem; color: var(--text-secondary); }
/* BOSS 区域内的子区域标题（如「矿洞」「晶海」） */
.sub-region-title {
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    color: #c0c0d8;
    margin: 18px 0 10px;
    padding-left: 8px;
    border-left: 2px solid var(--accent-gold);
}

/* 矿物点位坐标列表 */
.gazetteer-card .ore-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.gazetteer-card .ore-list li {
    font-family: var(--font-main);
    font-size: 0.98rem;
    color: var(--accent-cyan);
    margin-bottom: 3px;
    line-height: 1.5;
}

/* ===== 折叠框（小标题样式，[展开]/[折叠]） ===== */
.fold-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}
.fold-box {
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
    overflow: visible;
}
/* 标题行 —— 与 .sub-area-title 同款 */
.fold-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0 2px 6px;
    border-left: 2px solid var(--accent-cyan);
    cursor: pointer;
    list-style: none;
    user-select: none;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.85rem;
    color: #c0c0d8;
    transition: color var(--transition-smooth);
}
.fold-header::-webkit-details-marker { display: none; }
.fold-header:hover { color: #fff; }
.fold-title { flex: 0 0 auto; }
/* [展开] / [折叠] —— 字号、颜色均可单独控制 */
.fold-toggle {
    font-family: inherit;   /* 字体跟随标题 */
    font-weight: inherit;   /* 字重跟随标题，单独调就改成 400 */
    font-size: 0.78rem;     /* 单独控制字号 */
    letter-spacing: inherit;
    color: var(--fold-toggle-color, #5eeadcd2);
    white-space: nowrap;
}
.fold-toggle::after { content: '[展开]'; }
.fold-box[open] .fold-toggle::after { content: '[折叠]'; }
/* 内容区 */
.fold-body {
    margin: 8px 0 2px 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
    color: #c0c0d4;
    line-height: 1.75;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
    animation: foldIn 0.25s ease;
}
.fold-body p { margin-bottom: 6px; }
.fold-body p:last-child { margin-bottom: 0; }
.fold-body strong { color: #d8d8e8; }
@keyframes foldIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
/* 特别注意：仅左侧竖线换金色，其余同款 */
.fold-box.fold-warn .fold-header {
    border-left-color: var(--accent-gold);
}
