:root {
    --bg: #eee8d8;
    --bg-card: #f7f3ea;
    --ink: #2a2118;
    --ink-light: #6b5f50;
    --ink-muted: #9a8e7e;
    --vermillion: #b82030;
    --vermillion-bg: rgba(184,32,48,0.05);
    --gold: #8a6d2b;
    --gold-dim: #7a6030;
    --gold-bg: rgba(138,109,43,0.05);
    --border: #d4c9a8;
    --border-light: #e2dace;
    --font-title: 'Ma Shan Zheng', cursive;
    --font-body: 'Noto Serif SC', serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    font-size: 17px;
    color: var(--ink);
    background: var(--bg);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background-image:
        radial-gradient(ellipse at 30% 40%, rgba(120,100,60,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(100,80,50,0.04) 0%, transparent 45%);
}

.page-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: none;
}

.scroll-container {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.scroll-container::-webkit-scrollbar { display: none; }

.mp-section {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 52px 0 0;
    overflow: hidden;
    position: relative;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.018'/%3E%3C/svg%3E");
}

.mp-section::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(
        ellipse at center,
        transparent 50%,
        rgba(42,33,24,0.08) 100%
    );
    z-index: 1;
}

.mp-section > * {
    position: relative;
    z-index: 2;
}

.mp-img-area {
    width: 100%;
    max-width: 600px;
    flex: 0 1 auto;
    max-height: 52vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mp-img-area img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 6px 24px rgba(42,33,24,0.15));
}

.mp-badge {
    width: 100%;
    max-width: 640px;
    text-align: center;
    flex-shrink: 0;
    padding: 4px 20px 0;
}

.mp-badge-name {
    font-family: var(--font-title);
    font-size: 2.8rem;
    color: var(--ink);
    letter-spacing: 8px;
    line-height: 1.1;
    text-shadow:
        0 1px 2px rgba(42,33,24,0.12),
        0 0 20px rgba(138,109,43,0.06);
}

.mp-badge-role {
    font-size: 0.78rem;
    color: var(--ink-light);
    letter-spacing: 2px;
    margin-top: 2px;
}

.mp-detail {
    width: 100%;
    max-width: 640px;
    flex: 1 1 0;
    overflow-y: auto;
    padding: 4px 20px 72px;
}

.mp-detail::-webkit-scrollbar { width: 3px; }
.mp-detail::-webkit-scrollbar-track { background: transparent; }
.mp-detail::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 3px; }

.mp-stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.mp-stat {
    background: var(--ink);
    color: var(--bg);
    padding: 6px 6px;
    border-radius: 3px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    box-shadow:
        inset 0 1px 4px rgba(247,243,234,0.08),
        inset 0 0 12px rgba(247,243,234,0.04);
}

.mp-stat::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 10px rgba(232,226,213,0.06);
    pointer-events: none;
    transition: box-shadow 0.3s ease;
}

.mp-stat:hover::after {
    box-shadow: inset 0 0 16px rgba(232,226,213,0.12);
}

.mp-stat-label {
    font-size: 0.58rem;
    color: rgba(212,201,168,0.7);
    letter-spacing: 1px;
    display: block;
}

.mp-stat-value {
    font-family: var(--font-title);
    font-size: 1.05rem;
    color: #e8e2d5;
}

.mp-attrs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    justify-content: center;
}

.mp-attr-tag {
    font-size: 0.7rem;
    padding: 2px 10px;
    border: 1px solid var(--vermillion);
    color: var(--vermillion);
    border-radius: 2px;
    letter-spacing: 1px;
}

.mp-desc {
    font-size: 0.96rem;
    line-height: 1.85;
    color: #2a2118;
    margin-bottom: 12px;
    text-align: justify;
}

.mp-desc strong {
    color: var(--vermillion);
    font-weight: 700;
}

.mp-desc em {
    color: var(--gold-dim);
    font-style: italic;
    background: var(--gold-bg);
    padding: 0 3px;
    border-radius: 2px;
}

.mp-desc p {
    margin-bottom: 4px;
    text-indent: 2em;
}

.mp-desc p:last-child {
    margin-bottom: 0;
    text-indent: 0;
    text-align: center;
    font-size: 0.78rem;
    color: var(--ink-light);
    margin-top: 6px;
}

.mp-section-title {
    font-family: var(--font-title);
    font-size: 1rem;
    color: var(--ink);
    letter-spacing: 2px;
    margin-bottom: 5px;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--border-light);
}

.mp-weapons {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.mp-weapon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: rgba(0,0,0,0.02);
    border: 1px solid var(--border-light);
    border-radius: 3px;
    font-size: 0.82rem;
}

.mp-weapon-type {
    font-weight: 600;
    color: var(--ink);
}

.mp-weapon-detail {
    color: var(--ink-light);
}

.mp-weapon-special {
    font-size: 0.68rem;
    color: var(--vermillion);
    background: var(--vermillion-bg);
    padding: 0 5px;
    border-radius: 2px;
}

.mp-nengli-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mp-nengli {
    padding: 7px 10px;
    background: var(--gold-bg);
    border-left: 3px solid var(--gold-dim);
    border-radius: 0 3px 3px 0;
    transition: background 0.3s ease, border-left-color 0.3s ease, box-shadow 0.3s ease;
}

.mp-nengli:hover {
    background: rgba(138,109,43,0.09);
    border-left-color: var(--vermillion);
    box-shadow: 0 2px 8px rgba(138,109,43,0.08);
}

.mp-nengli-name {
    font-family: var(--font-title);
    font-size: 0.92rem;
    color: var(--vermillion);
    margin-bottom: 2px;
}

.mp-nengli-desc {
    font-size: 0.84rem;
    line-height: 1.65;
    color: var(--ink);
}

.mp-nengli-desc code {
    background: var(--vermillion-bg);
    color: var(--vermillion);
    padding: 1px 4px;
    border-radius: 2px;
    font-family: var(--font-body);
    border: 1px solid rgba(184,32,48,0.08);
    font-size: 0.76rem;
}

.mp-nengli-desc em {
    color: #1a6b4a;
    background: rgba(26,107,74,0.06);
    padding: 0 3px;
    border-radius: 2px;
    font-style: italic;
}

.mp-nengli-desc strong {
    color: var(--vermillion);
    font-weight: 700;
    background: var(--vermillion-bg);
    padding: 0 3px;
    border-radius: 2px;
}

.mp-nengli-desc p {
    margin-bottom: 2px;
}

.mp-nengli-desc p:last-child {
    margin-bottom: 0;
}

.mp-bottom-bar-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(238,232,216,0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: none;
    display: flex;
    align-items: center;
}

.mp-bottom-bar-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(212,201,168,0.3) 15%,
        rgba(138,109,43,0.25) 50%,
        rgba(212,201,168,0.3) 85%,
        transparent 100%
    );
}

.mp-bar-scroll-btn {
    flex-shrink: 0;
    display: none;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--ink);
    font-size: 1rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s;
}

.mp-bar-scroll-btn:hover {
    color: var(--vermillion);
    background: rgba(184,32,48,0.06);
}

.mp-bottom-bar {
    flex: 1 1 0;
    display: flex;
    gap: 4px;
    padding: 8px 12px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: center;
}

.mp-bottom-bar::-webkit-scrollbar { display: none; }

.mp-bar-item {
    flex-shrink: 0;
    font-family: var(--font-body);
    font-size: 0.76rem;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: transparent;
    color: var(--ink-muted);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 1px;
    white-space: nowrap;
}

.mp-bar-item:hover {
    color: var(--vermillion);
    border-color: var(--vermillion);
}

.mp-bar-item.active {
    background: var(--vermillion);
    color: #f7f3ea;
    border-color: var(--vermillion);
    font-weight: 600;
}

@keyframes arrow-pulse {
    0%, 100% { opacity: 0.75; }
    50% { opacity: 1; }
}

.scroll-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid rgba(42,33,24,0.25);
    background: rgba(238,232,216,0.92);
    backdrop-filter: blur(6px);
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    transition: all 0.25s ease;
    box-shadow: 0 2px 12px rgba(42,33,24,0.12);
    animation: arrow-pulse 3s ease-in-out infinite;
}

.scroll-arrow:hover {
    border-color: var(--vermillion);
    color: var(--vermillion);
    background: rgba(238,232,216,1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 20px rgba(184,32,48,0.18);
    animation: none;
    opacity: 1;
}

.scroll-arrow.left { left: 12px; }
.scroll-arrow.right { right: 12px; }

@media (max-width: 600px) {
    .mp-section { padding: 52px 0 0; }
    .mp-badge-name { font-size: 2.2rem; letter-spacing: 4px; }
    .mp-detail { padding: 0 16px 80px; }
    .scroll-arrow { display: none; }
    .mp-weapons { flex-direction: column; }
    .mp-bottom-bar { justify-content: flex-start; }
    .mp-bar-scroll-btn { display: flex; }
}

.global-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 900;
    display: flex;
    justify-content: center;
    gap: 0;
    background: rgba(238,232,216,0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: none;
}

.global-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(212,201,168,0.4) 15%,
        rgba(184,32,48,0.2) 50%,
        rgba(212,201,168,0.4) 85%,
        transparent 100%
    );
}

.global-nav-item {
    flex: 1;
    max-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 12px 10px;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
    position: relative;
}

.global-nav-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--vermillion);
    border-radius: 0 0 2px 2px;
    transition: width 0.3s ease;
}

.global-nav-item.active::after {
    width: 24px;
}

.global-nav-item:hover {
    background: rgba(0,0,0,0.03);
}

.global-nav-item.active {
    background: rgba(184,32,48,0.04);
}

.global-nav-icon {
    font-family: var(--font-title);
    font-size: 1.3rem;
    color: var(--ink-light);
    line-height: 1;
    transition: color 0.2s;
}

.global-nav-item.active .global-nav-icon {
    color: var(--vermillion);
}

.global-nav-label {
    font-size: 0.68rem;
    color: var(--ink-light);
    letter-spacing: 1px;
    transition: color 0.2s;
}

.global-nav-item.active .global-nav-label {
    color: var(--vermillion);
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
