:root {
    --bg-color: #1a1a2e;
    --panel-bg: #16213e;
    --card-bg: #0f3460;
    --accent-magenta: #e94560;
    --accent-green: #4ecca3;
    --text-color: #e0e0e0;
    --tube-glass: rgba(255, 255, 255, 0.1);
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    user-select: none;
    /* Textured background hint */
    background-image: radial-gradient(circle at 50% 50%, #2a2a40 0%, #1a1a2e 100%);
}

#game-container {
    height: 100vh;
    position: relative;
}

/* --- Header --- */
#battle-header {
    height: 60px;
    background: linear-gradient(180deg, rgba(22,33,62,0.9) 0%, rgba(22,33,62,0) 100%);
    display: flex;
    justify-content: center; /* Center the round info */
    align-items: center;
    position: relative;
    padding: 0 20px;
    z-index: 10;
}

#lang-switch-container {
    position: absolute;
    left: 20px;
}

#lang-btn {
    background: transparent;
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8em;
}

#round-info {
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px var(--accent-green);
    background-color: rgba(0,0,0,0.5);
    padding: 5px 20px;
    border-radius: 5px;
    border: 1px solid #333;
}

#end-turn-btn {
    position: absolute;
    right: 20px;
    background-color: var(--accent-green);
    color: #1a1a2e;
    border: none;
    padding: 8px 20px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-green);
    transform: skew(-10deg);
}

/* --- Main Stage --- */
#main-stage {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* --- Left: Turn Order Tube --- */
#turn-order-panel {
    width: 100px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 5;
}

.test-tube-container {
    width: 60px;
    height: 90%;
    background-color: rgba(0,0,0,0.3);
    border: 3px solid #555;
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px #000;
}

.tube-glass {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 50%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
    z-index: 10;
}

#turn-icons-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 20px;
    gap: 15px;
    width: 100%;
    overflow-y: auto;
    height: 100%;
    /* Hide scrollbar for Chrome, Safari and Opera */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

#turn-icons-list::-webkit-scrollbar {
    display: none;
}

.turn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #333;
    border: 2px solid #666;
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: #fff;
    position: relative;
}

.turn-icon.player { border-color: var(--accent-green); }
.turn-icon.enemy { border-color: var(--accent-magenta); }
.turn-icon.current {
    box-shadow: 0 0 15px #fff;
    transform: scale(1.2);
    z-index: 2;
}

.next-round-marker {
    width: 100%;
    text-align: center;
    font-size: 0.7em;
    color: #888;
    border-top: 1px dashed #666;
    margin: 10px 0;
    padding-top: 5px;
}

/* --- Center: Battlefield --- */
#battle-field {
    flex: 1;
    display: flex;
    flex-direction: column; /* Top Enemy, Bottom Player */
    justify-content: space-between;
    padding: 40px 20px;
}

.team-area {
    display: flex;
    justify-content: center;
    gap: 20px;
    height: 40%;
}

.character-wrapper {
    display: flex;
    flex-direction: column;
    width: 120px;
    position: relative;
}

.character-card {
    width: 120px;
    height: 180px;
    background-color: var(--card-bg);
    border: 2px solid #333;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* OVERFLOW MUST BE VISIBLE for floating text! */
    overflow: visible;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.character-card.active-turn {
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.character-card.dead {
    filter: grayscale(100%) brightness(0.5);
}

.card-overlay {
    background: linear-gradient(0deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    padding: 10px;
    color: white;
}

.mini-hp-bar {
    width: 100%;
    height: 5px;
    background: #333;
    margin-top: 5px;
}
.mini-hp-fill {
    height: 100%;
    background: var(--accent-magenta);
    width: 100%;
    transition: width 0.3s;
}
    /* Shield Bar above HP */
    .mini-shield {
        height: 4px;
        background: #88e1f2;
        width: 0%;
        margin-bottom: 2px;
        transition: width 0.3s;
        box-shadow: 0 0 5px rgba(136, 225, 242, 0.5);
    }

    /* Buff Icons on Card - Updated */
    .card-buffs-container {
        display: flex;
        flex-wrap: wrap;
        gap: 2px;
        margin-top: 5px;
        min-height: 20px;
        justify-content: flex-start; /* Left aligned */
        width: 100%;
    }

    .card-buff-icon {
        width: 18px;
        height: 18px;
        background-color: #aa1111; /* Dark Red base as requested */
        border: 1px solid #ff4444;
        border-radius: 3px;
        cursor: pointer;
        position: relative;
        background-size: cover;
        background-position: center;
        box-shadow: 0 0 2px rgba(0,0,0,0.5);
    }
    .card-buff-icon:hover {
        border-color: #fff;
        z-index: 10;
        transform: scale(1.2);
        box-shadow: 0 0 5px #fff;
    }
    /* Distinguish Buff/Debuff via border color or slight overlay instead of full background override */
    .card-buff-icon.buff { border-color: #4ecca3; }
    .card-buff-icon.debuff { border-color: #e94560; }

    /* Buff Tooltip */
    .buff-tooltip-popup {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0,0,0,0.95);
        border: 1px solid #666;
        padding: 2px 5px;
        border-radius: 3px;
        color: #fff;
        font-size: 10px;
        line-height: 1.2;
        pointer-events: none;
        z-index: 99999;
        white-space: nowrap;
    }
    /* 技能tooltip特殊样式 */
    .buff-tooltip-popup.skill-tooltip {
        position: fixed;
        z-index: 99999;
        transform: translate(-50%, -100%);
        white-space: normal;
        padding: 2px 5px;
    }

    /* Detail View Improvements */
    .compact-stats-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }
    .compact-stat-item {
        background: rgba(255,255,255,0.03);
        padding: 5px;
        border-radius: 4px;
        text-align: center;
        border: 1px solid transparent;
    }
    .compact-stat-item:hover {
        border-color: rgba(255,255,255,0.2);
        background: rgba(255,255,255,0.08);
    }
    .compact-stat-label { font-size: 0.7em; color: #888; text-transform: uppercase; margin-bottom: 2px; }
    .compact-stat-val { font-size: 0.95em; font-weight: bold; color: #eee; }

    .detail-buff-row {
        display: flex;
        align-items: flex-start;
        background: rgba(255,255,255,0.05);
        padding: 8px;
        border-radius: 5px;
        margin-bottom: 8px;
        border-left: 3px solid #666;
    }
    .detail-buff-row.buff { border-left-color: var(--accent-green); }
    .detail-buff-row.debuff { border-left-color: var(--accent-magenta); }

    .detail-buff-icon {
        width: 30px; height: 30px;
        background: #333;
        margin-right: 12px;
        border: 1px solid #555;
        border-radius: 4px;
        flex-shrink: 0;
        background-size: cover;
    }
    .detail-buff-info { flex: 1; }
    .detail-buff-name { font-weight: bold; font-size: 0.95em; color: #fff; margin-bottom: 2px; }
    .detail-buff-desc { font-size: 0.85em; color: #aaa; line-height: 1.4; }
    .detail-buff-dur { font-size: 0.8em; color: #ffd700; margin-top: 2px; }


    /* Buff Icons on Card - Updated */
    .card-buffs-container {
        display: flex;
        flex-wrap: wrap;
        gap: 2px;
        margin-top: 5px;
        min-height: 20px;
        justify-content: flex-start; /* Left aligned */
        width: 100%;
    }

    .card-buff-icon {
        width: 18px;
        height: 18px;
        background-color: #aa1111; /* Dark Red base as requested */
        border: 1px solid #ff4444;
        border-radius: 3px;
        cursor: pointer;
        position: relative;
        background-size: cover;
        background-position: center;
        box-shadow: 0 0 2px rgba(0,0,0,0.5);
    }
    .card-buff-icon:hover {
        border-color: #fff;
        z-index: 10;
        transform: scale(1.2);
        box-shadow: 0 0 5px #fff;
    }
    /* Distinguish Buff/Debuff via border color or slight overlay instead of full background override */
    .card-buff-icon.buff { border-color: #4ecca3; }
    .card-buff-icon.debuff { border-color: #e94560; }

    /* Buff Tooltip */
    .buff-tooltip-popup {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0,0,0,0.95);
        border: 1px solid #666;
        padding: 2px 5px;
        border-radius: 3px;
        color: #fff;
        font-size: 10px;
        line-height: 1.2;
        pointer-events: none;
        z-index: 99999;
        white-space: nowrap;
    }
    /* 技能tooltip特殊样式 */
    .buff-tooltip-popup.skill-tooltip {
        position: fixed;
        z-index: 99999;
        transform: translate(-50%, -100%);
        white-space: normal;
        padding: 2px 5px;
    }

    /* Detail View Improvements */
    .compact-stats-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }
    .compact-stat-item {
        background: rgba(255,255,255,0.03);
        padding: 5px;
        border-radius: 4px;
        text-align: center;
        border: 1px solid transparent;
    }
    .compact-stat-item:hover {
        border-color: rgba(255,255,255,0.2);
        background: rgba(255,255,255,0.08);
    }
    .compact-stat-label { font-size: 0.7em; color: #888; text-transform: uppercase; margin-bottom: 2px; }
    .compact-stat-val { font-size: 0.95em; font-weight: bold; color: #eee; }

    .detail-buff-row {
        display: flex;
        align-items: flex-start;
        background: rgba(255,255,255,0.05);
        padding: 8px;
        border-radius: 5px;
        margin-bottom: 8px;
        border-left: 3px solid #666;
    }
    .detail-buff-row.buff { border-left-color: var(--accent-green); }
    .detail-buff-row.debuff { border-left-color: var(--accent-magenta); }

    .detail-buff-icon {
        width: 30px; height: 30px;
        background: #333;
        margin-right: 12px;
        border: 1px solid #555;
        border-radius: 4px;
        flex-shrink: 0;
        background-size: cover;
    }
    .detail-buff-info { flex: 1; }
    .detail-buff-name { font-weight: bold; font-size: 0.95em; color: #fff; margin-bottom: 2px; }
    .detail-buff-desc { font-size: 0.85em; color: #aaa; line-height: 1.4; }
    .detail-buff-dur { font-size: 0.8em; color: #ffd700; margin-top: 2px; }


/* --- Right: Controls --- */
#controls-panel {
    width: 250px;
    height: 100%;
    position: relative;
}

#resource-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 120px;
    height: 160px;
}

.hourglass-frame {
    width: 100%;
    height: 100%;
    position: relative;
    /* Simplified CSS hourglass shape using clip-path could be used, or just simple containers */
}

.hourglass-glass-bottom {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 80px;
    background: rgba(255,255,255,0.1);
    border: 2px solid #aaa;
    border-top: none;
    border-radius: 0 0 40px 40px;
    overflow: hidden;
}

.hourglass-liquid {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 40%; /* Dynamic */
    background: linear-gradient(0deg, var(--accent-green) 0%, #a8e6cf 100%);
    transition: height 0.5s;
    box-shadow: 0 0 10px var(--accent-green);
}

.hourglass-text {
    position: absolute;
    bottom: 30px;
    width: 100%;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 5px #000;
}

#skills-container {
    position: absolute;
    bottom: 200px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
}

.skill-arc-btn {
    background: linear-gradient(90deg, rgba(83, 52, 131, 0.9), rgba(15, 52, 96, 0.8));
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 15px 20px;
    border-radius: 30px 0 0 30px;
    width: 200px;
    text-align: right;
    cursor: pointer;
    transition: width 0.2s, background 0.2s;
    position: relative;
    overflow: hidden;
}

.skill-arc-btn:hover {
    width: 220px;
    background: linear-gradient(90deg, rgba(106, 76, 156, 0.9), rgba(22, 33, 62, 0.9));
}

.skill-arc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #333;
}

.skill-name { font-weight: bold; display: block;}
.skill-cost-label { font-size: 0.8em; color: var(--accent-green); }

/* --- Footer Log --- */
#battle-log-container {
    height: 30px;
    background-color: #000;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-style: italic;
    color: #aaa;
}

/* Target Selection */
.selectable-target {
    cursor: crosshair !important;
    animation: pulse-target 1s infinite alternate;
    border-color: #fff !important;
    box-shadow: 0 0 15px #fff !important;
    z-index: 100;
}

@keyframes pulse-target {
    from { transform: scale(1); box-shadow: 0 0 10px #fff; }
    to { transform: scale(1.05); box-shadow: 0 0 20px var(--accent-green); }
}

.floating-text {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: bold;
    text-shadow: 1px 1px 2px #000;
    pointer-events: none;
    z-index: 50;
    animation: float-up 1s ease-out forwards;
}

@keyframes float-up {
    0% { top: 30%; opacity: 1; transform: translateX(-50%) scale(1); }
    100% { top: 10%; opacity: 0; transform: translateX(-50%) scale(1.5); }
}

.floating-text.reflect { color: #f1c40f; font-size: 1.5em; text-shadow: 0 0 5px #e67e22; }
.floating-text.damage { color: #ff4757; font-size: 2em; text-shadow: 0 0 5px #000; }
.floating-text.magic-damage { color: #a29bfe; font-size: 2em; text-shadow: 0 0 5px #000; }
.floating-text.shield-damage { color: #88e1f2; font-size: 1.5em; text-shadow: 0 0 5px #fff; }
.floating-text.heal { color: #2ed573; font-size: 1.5em; text-shadow: 0 0 5px #0f0; }
.floating-text.true-damage { color: #fff; font-size: 1.5em; text-shadow: 0 0 5px #ffd700; border: 1px solid #ffd700; padding: 0 5px; border-radius: 3px; background: rgba(0,0,0,0.5); }
.floating-text.status {
    color: #ffd700;
    font-size: 1.2em;
    top: 40%;
    animation: float-up-slow 1.5s ease-out forwards;
    white-space: nowrap;
    text-shadow: 0 0 5px #000;
}

.floating-text.purify {
    color: #00cec9; /* Teal/Cyan for purify */
    font-weight: bold;
    text-shadow: 0 0 8px #81ecec;
    font-size: 1.5em; /* Match other big texts */
    top: 40%;
    animation: float-up-slow 1.5s ease-out forwards;
}


.floating-text.skill-name {
    color: #ffd700;
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 0 0 10px #ff0;
    top: 20%;
    animation: float-up-slow 1.5s ease-out forwards;
    white-space: nowrap;
    z-index: 60;
}

@keyframes float-up-slow {
    0% { top: 20%; opacity: 0; transform: translateX(-50%) scale(0.5); }
    20% { opacity: 1; transform: translateX(-50%) scale(1.2); }
    100% { top: 0%; opacity: 0; transform: translateX(-50%) scale(1); }
}

.floating-text.skill-target {
    color: #ff9f43; /* Orange for target */
    font-size: 1.0em;
    font-weight: bold;
    text-shadow: 0 0 5px #000;
    top: 35%; /* Below skill name */
    animation: float-up-slow 1.5s ease-out forwards;
    white-space: nowrap;
    z-index: 59;
}

#target-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}
#target-selection {
    background: var(--panel-bg);
    padding: 20px;
    border: 2px solid var(--accent-green);
    color: #fff;
    min-width: 300px;
    text-align: center;
}
.target-option {
    background: var(--card-bg);
    padding: 10px; margin: 5px 0;
    cursor: pointer;
}
.target-option:hover { background: var(--accent-magenta); }
.hidden { display: none !important; }

/* ---------------------------------------------------- */
/* NEW ROSTER UI STYLES (REVISED) */
/* ---------------------------------------------------- */

.global-lang-switch {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    padding: 5px 15px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.lang-btn:hover {
    background: var(--accent-green);
    color: #000;
}

.roster-layout {
    display: flex;
    width: 100%;
    height: 100%;
}

/* ---------------------------------------------------- */
/* EXPLORE PAGE STYLES */
/* ---------------------------------------------------- */
#explore-page {
    background: radial-gradient(circle at top center, #2e1a3e 0%, #1a1a2e 100%);
    display: flex;
    flex-direction: column;
}

#explore-container {
    flex: 1;
    display: flex;
    padding: 20px;
    gap: 20px;
    overflow: hidden;
}

/* Stage Tabs (Left) */
.stage-tabs {
    width: 200px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-right: 1px solid rgba(255,255,255,0.1);
    padding-right: 20px;
}

.stage-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    color: #888;
    transition: all 0.2s;
}

.stage-card:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.stage-card.active {
    background: linear-gradient(90deg, #4a2b5e 0%, #2e1a3e 100%);
    border-color: #d2a4ea;
    color: #fff;
    box-shadow: 0 0 15px rgba(210, 164, 234, 0.3);
}

/* Level Grid (Right) */
.level-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    grid-auto-rows: 120px;
    gap: 20px;
    overflow-y: auto;
    padding: 20px;
}

.level-node {
    background: #111;
    border: 2px solid #333;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: all 0.2s;
    opacity: 0.5;
}

.level-node.unlocked {
    opacity: 1;
    border-color: #666;
    background: #222;
    cursor: pointer;
}

.level-node.unlocked:hover {
    transform: translateY(-5px);
    border-color: var(--accent-green);
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.level-node.completed {
    border-color: #ffd700;
}

.level-id {
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
}

.level-name {
    font-size: 0.8em;
    color: #aaa;
    text-align: center;
    margin-top: 5px;
    padding: 0 5px;
}

.check-mark {
    position: absolute;
    top: 5px; right: 5px;
    color: #ffd700;
    font-weight: bold;
}

/* Event Modal */
.event-box {
    width: 600px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    background: #1e1e2e;
    border: 2px solid #555;
    position: relative;
}

#event-title {
    text-align: center;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
    margin-bottom: 20px;
    color: var(--accent-magenta);
}

.event-desc-text {
    flex: 1;
    font-size: 1.1em;
    line-height: 1.6;
    color: #ddd;
    background: rgba(0,0,0,0.3);
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    white-space: pre-wrap;
    min-height: 150px;
}

.event-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-option-btn {
    background: #333;
    border: 1px solid #555;
    color: #fff;
    padding: 15px;
    text-align: left;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s;
    font-size: 1em;
}

.event-option-btn:hover {
    background: #444;
    border-color: var(--accent-green);
}

.event-option-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #333;
}

/* ---------------------------------------------------- */
/* INVENTORY PAGE STYLES */
/* ---------------------------------------------------- */
#inventory-page {
    background-color: var(--bg-color);
    padding: 0;
    position: relative;
    flex-direction: column;
}

.page-header {
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
}
.page-header h2 {
    color: #fff;
    font-family: serif;
    font-size: 2em;
    text-shadow: 0 0 10px var(--accent-green);
    margin: 0;
}

/* 背包主容器：左右分栏布局 */
.inventory-container {
    display: flex;
    gap: 15px;
    padding: 15px;
    height: calc(100vh - 100px);
}

/* 左侧 2/3: 道具网格 */
.inventory-grid-panel {
    flex: 2;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    padding: 15px;
}

/* 右侧 1/3: 道具详情面板 */
.inventory-detail-panel {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 详情面板内容 */
.detail-empty {
    text-align: center;
    color: #888;
    padding: 50px 20px;
    font-size: 1.1em;
}

.detail-icon {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background-color: #555;
    margin: 0 auto 20px;
    display: block;
}

.detail-name {
    font-size: 1.4em;
    font-weight: bold;
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
}

.detail-quantity {
    text-align: center;
    color: var(--accent-green);
    font-size: 1.1em;
    margin-bottom: 15px;
}

.detail-type {
    text-align: center;
    color: var(--accent-blue);
    font-size: 0.95em;
    margin-bottom: 20px;
    padding: 5px 15px;
    background: rgba(74, 144, 226, 0.15);
    border-radius: 15px;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
}

.detail-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.detail-section-title {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-desc {
    font-size: 0.95em;
    color: #ccc;
    line-height: 1.6;
}

.detail-type-wrapper {
    text-align: center;
    margin-bottom: 20px;
}

/* 道具网格 */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 15px;
    padding: 10px;
}

/* 道具卡片 */
.inv-card {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.2s;
    cursor: pointer;
}

.inv-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-green);
    background: rgba(255, 255, 255, 0.1);
}

.inv-card.selected {
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(74, 144, 226, 0.5);
    background: rgba(74, 144, 226, 0.1);
}

.inv-card-icon {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.inv-card-icon.upgrade-icon { background-color: #e67e22; border: 2px solid #d35400; }
.inv-card-icon.break-icon { background-color: #9b59b6; border: 2px solid #8e44ad; }
.inv-card-icon.create-icon { background-color: #3498db; border: 2px solid #2980b9; }

.inv-card-name {
    font-weight: bold;
    font-size: 0.95em;
    color: #fff;
    text-align: center;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 数量角标（右下角） */
.inv-card-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    color: var(--accent-green);
}

/* Modal Styles */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex; justify-content: center; align-items: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
    pointer-events: auto;
}
.modal-box {
    background: #1e1e2e;
    width: 400px;
    padding: 30px;
    border-radius: 10px;
    border: 1px solid #555;
    box-shadow: 0 0 30px #000;
    text-align: center;
    pointer-events: auto;
}
.modal-box h3 { margin-top: 0; color: #fff; font-size: 1.5em; }
.modal-box p { color: #ccc; font-size: 1.1em; margin: 20px 0; }

.modal-actions {
    display: flex; justify-content: center; gap: 20px; margin-top: 30px;
}
.modal-btn {
    padding: 10px 30px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}
.modal-btn.cancel { background: #444; color: #aaa; }
.modal-btn.cancel:hover { background: #555; color: #fff; }
.modal-btn.confirm { background: var(--accent-green); color: #000; }
.modal-btn.confirm:hover { background: #fff; }

/* Slider Styles */
.alloc-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
}
.alloc-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 10px;
    background: #444;
    border-radius: 5px;
    outline: none;
}
.alloc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px; height: 24px;
    background: var(--accent-green);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-green);
}
#alloc-val-display {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--accent-green);
    width: 40px;
}
#alloc-info-text { color: #888; font-size: 0.9em; }


.roster-left-col {
    width: 140px;
    background: rgba(0,0,0,0.5);
    border-right: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 60px; /* Increased top padding to push list down below back button */
}

/* Back Button Styles */
.back-btn-corner {
    position: absolute !important;
    top: 20px !important;
    left: 20px !important;
    z-index: 9999 !important;
    background: rgba(0,0,0,0.8) !important;
    color: #fff !important;
    border: 1px solid var(--accent-magenta) !important;
    padding: 8px 20px !important;
    cursor: pointer !important;
    font-size: 1.1em !important;
    font-weight: bold !important;
    box-shadow: 0 0 10px rgba(0,0,0,0.5) !important;
    transition: all 0.2s !important;
    display: block !important;
    visibility: visible !important;
}
.back-btn-corner:hover {
    background: var(--accent-magenta) !important;
    color: #fff !important;
}

/* Adjust lang switch position in roster to not overlap back button */
.global-lang-switch.roster-switch {
    top: 20px;
    left: 140px; /* Move right of the sidebar */
}

.roster-list-scroll {
    flex: 1;
    overflow-y: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding-bottom: 20px;
}

/* New Avatar Item Style */
.roster-list-item {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    background-color: #333;
    border: 2px solid #555;
    cursor: pointer;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
    background-size: cover;
    background-position: center;
    display: block; /* It's a div */
    padding: 0;
}

.roster-list-item:hover {
    transform: scale(1.05);
    border-color: #888;
}

.roster-list-item.selected {
    border-color: #fff;
    box-shadow: 0 0 15px rgba(255,255,255,0.5);
}

.roster-list-item.deployed {
    border-color: var(--accent-green);
}

.roster-list-item .deployed-indicator {
    position: absolute;
    bottom: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: var(--accent-green);
    border-radius: 50%;
    border: 2px solid #000;
    color: #000;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.roster-add-btn {
    width: 60px;
    height: 60px;
    border: 2px dashed #666;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #666;
    font-size: 30px;
    cursor: pointer;
    margin-bottom: 20px;
    transition: all 0.2s;
}
.roster-add-btn:hover {
    border-color: #fff;
    color: #fff;
}


/* CENTER COLUMN: 30% width */
.roster-center-col {
    width: 30%;
    position: relative;
    background: radial-gradient(circle at center bottom, #2a2a40 0%, #000 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Align portrait to bottom */
}

.roster-portrait-container {
    width: 100%;
    height: 85%; /* Leave space for status at bottom */
    background-size: contain;
    background-position: center bottom;
    background-repeat: no-repeat;
    /* transition: background-image 0.3s; */
}

.roster-center-status {
    height: 15%;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 20px;
}

.deploy-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}
.deploy-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #444;
    border: 1px solid #666;
}
.deploy-dot.active {
    background: var(--accent-green);
    box-shadow: 0 0 5px var(--accent-green);
}

.deploy-status-text {
    font-size: 1.1em;
    font-weight: bold;
    color: #ccc;
    cursor: pointer;
    padding: 5px 15px;
    border-radius: 15px;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.deploy-status-text:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
}
.deploy-status-text.deployed {
    color: var(--accent-green);
}
.deploy-status-text.full {
    color: var(--accent-magenta);
}


/* RIGHT COLUMN: Remaining width (approx 55%) */
.roster-right-col {
    flex: 1;
    background: #1e1e2e;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #333;
}

.roster-name-header {
    padding: 20px 30px;
    font-size: 2em;
    font-weight: bold;
    color: #fff;
    font-family: serif;
    border-bottom: 1px solid #333;
}

.roster-tabs {
    display: flex;
    background: #161621;
}

.tab-btn {
    flex: 1;
    padding: 15px 0;
    background: transparent;
    border: none;
    color: #888;
    font-weight: bold;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    font-size: 1em;
}
.tab-btn:hover { color: #ccc; background: rgba(255,255,255,0.05); }
.tab-btn.active {
    color: #fff;
    border-bottom-color: var(--accent-green);
    background: #1e1e2e; /* Blend with content */
}

.tab-content-container {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    position: relative;
}

.tab-pane {
    display: none;
    flex-direction: column;
    height: 100%;
}
.tab-pane.active { display: flex; }

/* -- Stats Tab Styles -- */
.stat-group-box {
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.level-row {
    display: flex;
    align-items: center;
    gap: 15px;
}
.stat-label-main { font-weight: bold; color: #ccc; }
.stat-val-main { font-size: 1.5em; font-weight: bold; color: #fff; width: 40px; }
.exp-bar-container {
    flex: 1;
    height: 8px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
}
.exp-bar-fill { height: 100%; background: #ffd700; width: 40%; }
.upgrade-btn-small {
    background: #444; border: none; color: #fff;
    padding: 5px 10px; border-radius: 4px; cursor: pointer;
}
.upgrade-btn-small:hover { background: #666; }
.upgrade-btn-small.breakthrough-mode {
    background: var(--accent-magenta);
    box-shadow: 0 0 10px var(--accent-magenta);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.p-stat-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.p-stat-row:last-child { margin-bottom: 0; }
.p-stat-label { width: 40px; font-weight: bold; color: #aaa; font-size: 0.9em; }
.p-stat-bar-bg { flex: 1; height: 6px; background: #333; margin: 0 15px; border-radius: 3px; overflow: hidden; }
.p-stat-bar-fill { height: 100%; }
.p-stat-val { width: 30px; text-align: right; font-weight: bold; }
.plus-btn {
    width: 20px; height: 20px; background: #333;
    border: 1px solid #555; color: #aaa;
    display: flex; justify-content: center; align-items: center;
    margin-left: 10px; cursor: pointer; border-radius: 3px;
}
.plus-btn:hover { border-color: #fff; color: #fff; }

/* 3 Column Grid */
.derived-stats-grid-3col {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px 20px;
}
.d-stat-item {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #444;
    padding-bottom: 3px;
}
.d-stat-label { color: #888; font-size: 0.9em; }
.d-stat-val { font-weight: bold; color: #eee; }

.luck-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.luck-label { color: var(--accent-magenta); font-weight: bold; }
.luck-val { font-size: 1.2em; font-weight: bold; }

/* -- Talents Tab Styles -- */
.section-header-small {
    font-size: 1.1em;
    font-weight: bold;
    color: #fff;
    margin-bottom: 15px;
    border-left: 3px solid var(--accent-green);
    padding-left: 10px;
}

.skills-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.roster-skill-row {
    display: flex;
    background: rgba(255,255,255,0.05);
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid transparent;
    align-items: center;
}
.roster-skill-row:hover { background: rgba(255,255,255,0.1); }
.roster-skill-row.selected {
    border-color: var(--accent-green);
    background: rgba(78, 204, 163, 0.1);
}

.skill-icon-small {
    width: 40px; height: 40px;
    background: #333; border: 1px solid #555;
    border-radius: 4px;
    margin-right: 15px;
    background-size: cover;
}
.skill-info-row { flex: 1; }
.skill-name-row { font-weight: bold; color: #fff; }
.skill-cost-row { font-size: 0.8em; color: #888; }

.talent-desc-box {
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 5px;
    min-height: 80px;
    color: #ccc;
    line-height: 1.5;
    font-size: 0.95em;
    border: 1px dashed #444;
}

.weight-display { font-size: 0.9em; color: #aaa; cursor: help; }

.items-grid-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.item-slot {
    aspect-ratio: 1;
    background: rgba(0,0,0,0.3);
    border: 1px solid #444;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
}
.item-slot.filled { border-color: #888; background: rgba(255,255,255,0.05); }
.item-slot.locked { background: rgba(0,0,0,0.5); border-style: dashed; cursor: not-allowed; }
.lock-text { color: #666; font-size: 0.8em; }
.item-icon { width: 70%; height: 70%; background-size: cover; border-radius: 3px; }

/* -- Story Tab -- */
.story-block { margin-bottom: 25px; }
.story-label { color: var(--accent-magenta); margin-bottom: 8px; font-size: 0.9em; letter-spacing: 1px; text-transform: uppercase; }
.story-text { color: #bbb; line-height: 1.6; font-size: 0.95em; margin: 0; text-align: justify; }

/* -- Item Modal -- */
.item-modal-overlay {
    position: absolute; /* Relative to page container */
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
}
.item-modal-content {
    background: #1e1e2e;
    width: 350px;
    border: 1px solid #555;
    box-shadow: 0 10px 30px #000;
    border-radius: 8px;
    overflow: hidden;
}
.item-modal-header {
    background: #161621;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    border-bottom: 1px solid #333;
}
.close-modal-x {
    background: none; border: none; color: #888; font-size: 1.5em; cursor: pointer;
}
.close-modal-x:hover { color: #fff; }
.item-modal-body { padding: 20px; display: flex; gap: 20px; }
.item-big-icon {
    width: 80px; height: 80px; background: #333; border: 1px solid #555; border-radius: 5px;
    flex-shrink: 0;
}
.item-info-col { flex: 1; }
.item-name { margin: 0 0 5px 0; font-size: 1.1em; color: var(--accent-magenta); }
.item-type-row { display: flex; gap: 10px; font-size: 0.8em; color: #888; margin-bottom: 5px; }
.item-removable { color: var(--accent-green); font-size: 0.8em; margin-bottom: 10px; }
.item-effects-title { font-weight: bold; font-size: 0.9em; margin-bottom: 3px; color: #ddd; }
.item-desc { font-size: 0.9em; color: #aaa; margin: 0; line-height: 1.4; }

/* --- New Detail Modal Styles --- */
#detail-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex; justify-content: center; align-items: center;
    z-index: 300; backdrop-filter: blur(8px);
}

.modal-content-wrapper {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    max-height: 800px;
    display: flex;
}

/* Nav Swords */
.nav-sword {
    position: absolute; top: 50%;
    width: 60px; height: 60px;
    background: #222; border: 2px solid #666;
    color: #fff; font-size: 2em;
    cursor: pointer; z-index: 310;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    transition: all 0.2s;
    box-shadow: 0 0 10px #000;
}
.nav-sword:hover {
    background: var(--accent-green); border-color: #fff;
    box-shadow: 0 0 20px var(--accent-green);
}
.nav-sword::after { content: '➔'; }
.left-sword { left: -30px; transform: translateY(-50%) rotate(180deg); }
.right-sword { right: -30px; transform: translateY(-50%); }

/* Main Card Container */
.detail-card-container {
    width: 100%; height: 100%;
    background: linear-gradient(135deg, #1e1e2e 0%, #161621 100%);
    border: 2px solid #444;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
    display: flex;
    position: relative;
}

/* Close Ribbon */
.close-ribbon {
    position: absolute; top: -10px; right: 30px;
    width: 50px; height: 70px;
    background: var(--accent-magenta);
    z-index: 320; cursor: pointer;
    box-shadow: 0 5px 10px rgba(0,0,0,0.5);
    display: flex; justify-content: center; align-items: flex-end;
    padding-bottom: 15px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
    transition: transform 0.2s;
}
.close-ribbon:hover { transform: translateY(5px); }
.close-icon { color: #fff; font-size: 30px; font-weight: bold; margin-bottom: 5px; }

/* Panels */
.detail-panel { height: 100%; position: relative; display: flex; }
.left-panel {
    width: 320px;
    flex-shrink: 0;
    background: #111;
    border-right: 2px solid #333;
    display: flex; flex-direction: column;
    align-items: center; padding: 30px 20px;
    overflow-y: auto;
}
.right-panel {
    flex: 1;
    height: 100%;
    padding: 30px 40px;
    background: rgba(255,255,255,0.02);
    display: flex; flex-direction: column; gap: 20px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar for Right Panel */
.right-panel::-webkit-scrollbar {
    width: 8px;
}
.right-panel::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
.right-panel::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}
.right-panel::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Left Panel Content */
.char-header-row {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 15px;
}
.class-icon-slot {
    width: 30px; height: 30px; background: #333; border-radius: 50%;
    border: 1px solid #666;
}
.star-rating { color: #ffd700; font-size: 1.2em; letter-spacing: 2px; }

.portrait-box {
    width: 100%; aspect-ratio: 3/4;
    background: #000; border: 1px solid #333;
    margin-bottom: 15px; border-radius: 4px;
    overflow: hidden;
}
.portrait-img {
    width: 100%; height: 100%;
    background-size: cover; background-position: top center;
}

.name-box { text-align: center; margin-bottom: 20px; width: 100%; }
.name-box h2 { margin: 0; color: #fff; font-size: 1.5em; text-shadow: 0 0 10px var(--accent-magenta); }
.char-level { color: var(--accent-green); font-weight: bold; font-size: 1.1em; margin-right: 10px; }
.char-title { color: #888; font-size: 0.9em; font-style: italic; }

.vitals-box { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.vital-row { display: flex; align-items: center; gap: 10px; }
.vital-label { width: 50px; font-size: 0.8em; font-weight: bold; color: #aaa; }
.vital-track { flex: 1; height: 10px; background: #222; border-radius: 5px; overflow: hidden; border: 1px solid #444; }
.vital-fill { height: 100%; transition: width 0.3s; }
.vital-fill.hp { background: var(--accent-magenta); }
.vital-fill.shield { background: #88e1f2; }
.vital-val { font-size: 0.8em; color: #fff; width: 60px; text-align: right; }

/* Right Panel Content */
.detail-section-header {
    font-size: 1.1em; color: #fff; font-weight: bold;
    border-bottom: 2px solid var(--accent-green);
    padding-bottom: 5px; margin-bottom: 10px;
    text-transform: uppercase;
}

/* Attributes */
.attr-bars-container { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.attr-row { display: flex; align-items: center; gap: 15px; }
.attr-label { width: 40px; font-weight: bold; color: #ccc; }
.attr-track { flex: 1; height: 8px; background: #222; border-radius: 4px; overflow: hidden; }
.attr-fill { height: 100%; width: 0%; transition: width 0.5s; }
.attr-fill.red { background: linear-gradient(90deg, #500 0%, #f00 100%); }
.attr-fill.blue { background: linear-gradient(90deg, #005 0%, #00f 100%); }
.attr-fill.green { background: linear-gradient(90deg, #050 0%, #0f0 100%); }
.attr-val { width: 30px; text-align: right; font-weight: bold; color: #fff; }

/* Stats Grid */
.stats-grid-box {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 10px; margin-bottom: 20px;
}
.stat-grid-item {
    background: rgba(255,255,255,0.05); padding: 8px;
    border-radius: 4px; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    border: 1px solid transparent;
}
.stat-grid-item:hover { border-color: var(--accent-green); background: rgba(255,255,255,0.1); }
.stat-grid-label { font-size: 0.8em; color: #888; margin-bottom: 3px; }
.stat-grid-val { font-size: 1.1em; font-weight: bold; color: #eee; }

/* Skills List - 使用道具样式 */
.skills-horizontal-list {
    display: grid;
    grid-template-columns: repeat(5, 60px);
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Status List */
.status-horizontal-list { display: flex; gap: 10px; flex-wrap: wrap; }
.detail-buff-list { display: flex; flex-direction: column; gap: 8px; }
.status-tag {
    background: #333; padding: 5px 10px; border-radius: 15px;
    font-size: 0.85em; color: #fff; border: 1px solid #555;
}

/* Decorations */
.panel-decor-corner {
    position: absolute; width: 20px; height: 20px;
    border: 2px solid var(--accent-green);
    pointer-events: none;
}
.top-left { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.top-right { top: 10px; right: 10px; border-left: none; border-bottom: none; }
.bottom-left { bottom: 10px; left: 10px; border-right: none; border-top: none; }
.bottom-right { bottom: 10px; right: 10px; border-left: none; border-top: none; }


/* ---------------------------------------------------- */
/* CREATION PAGE STYLES */
/* ---------------------------------------------------- */
#creation-page {
    background-color: var(--bg-color);
    padding: 0;
    position: relative;
    flex-direction: column;
}

.creation-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.creation-box {
    background: #1e1e2e;
    width: 600px;
    padding: 40px;
    border-radius: 15px;
    border: 1px solid #555;
    box-shadow: 0 0 30px #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.creation-instruction {
    font-size: 1.2em;
    color: #ccc;
    text-align: center;
    margin: 0;
}

.creation-textarea {
    width: 100%;
    height: 150px;
    background: #161621;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 15px;
    color: #fff;
    font-size: 1.1em;
    resize: none;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.creation-textarea:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 10px rgba(78, 204, 163, 0.2);
}

.creation-status {
    min-height: 24px;
    font-size: 1em;
    color: #ffd700;
}

.cost-info {
    color: #888;
    font-size: 0.9em;
    margin-top: 10px;
}

/* Spinner for status */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------------------------------------------------- */
/* ADMIN PAGE STYLES */
/* ---------------------------------------------------- */
#admin-page {
    background-color: var(--bg-color);
    padding: 0;
    position: relative;
    flex-direction: column;
}

.admin-container {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
    gap: 5px;
}

.admin-tabs .tab-btn {
    flex: 0 0 auto;
    padding: 12px 20px;
    border-radius: 5px 5px 0 0;
    border-bottom: none;
    background: #222;
    white-space: nowrap;
    font-size: 0.9em;
}

.admin-tabs .tab-btn:hover {
    background: #2a2a2a;
}

.admin-tabs .tab-btn.active {
    background: #333;
    color: #fff;
    border-bottom: 2px solid var(--accent-green);
}

.admin-tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
}
.admin-tab-content.active {
    display: flex;
}

/* JSON Editor Tab */
.admin-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

#admin-char-select {
    padding: 10px;
    background: #1e1e2e;
    color: #fff;
    border: 1px solid #555;
    border-radius: 5px;
    min-width: 200px;
}

.admin-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    color: #fff;
}
.admin-btn.save { background-color: var(--accent-green); color: #000; }
.admin-btn.create { background-color: var(--accent-magenta); }

.json-editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.json-textarea {
    flex: 1;
    background: #111;
    color: #0f0;
    font-family: monospace;
    padding: 15px;
    border: 1px solid #333;
    border-radius: 5px;
    resize: none;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
}

.status-msg {
    margin-top: 10px;
    height: 20px;
    font-size: 0.9em;
}
.status-msg.success { color: var(--accent-green); }
.status-msg.error { color: var(--accent-magenta); }

/* Excel Viewer Tab */
.excel-controls {
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

#excel-file-input {
    color: #fff;
}

.excel-table-container {
    flex: 1;
    overflow: auto;
    background: #fff;
    color: #000;
    border-radius: 5px;
    padding: 10px;
}

.excel-table-container table {
    width: 100%;
    border-collapse: collapse;
}

.excel-table-container th, .excel-table-container td {
    border: 1px solid #ccc;
    padding: 5px 10px;
    text-align: left;
    font-size: 0.9em;
}
.excel-table-container th {
    background: #f0f0f0;
    font-weight: bold;
}

/* --- UI Lock (Anti-spam) --- */
.ui-locked {
    pointer-events: none !important;
    opacity: 0.8;
    filter: grayscale(30%);
    cursor: wait !important;
}

/* --- SAN值显示 --- */
.san-display {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #9b59b6;
    border-radius: 10px;
    padding: 10px 20px;
    color: #9b59b6;
    font-size: 1.1em;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.3);
}

.san-label {
    margin-right: 5px;
}

.san-value {
    color: #fff;
    font-size: 1.3em;
}

.san-max {
    color: #666;
    font-size: 0.9em;
}

/* --- 骰子检定UI --- */
.dice-check-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 30000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dice-check-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid var(--accent-green);
    border-radius: 20px;
    width: 80%;
    max-width: 900px;
    height: 550px;
    display: flex;
    box-shadow: 0 0 50px rgba(78, 204, 163, 0.3);
    position: relative;
}

.dice-check-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--accent-magenta);
    font-size: 2em;
    cursor: pointer;
    z-index: 10;
}

.dice-check-close:hover {
    color: #fff;
}

/* 左侧：骰子区域 */
.dice-check-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-right: 2px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
}

.dice-stage {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.die {
    width: 120px;
    height: 120px;
    background: linear-gradient(145deg, #e74c3c 0%, #c0392b 100%);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.2);
    position: relative;
    transition: transform 0.1s;
}

.die.rolling {
    animation: dieShake 0.1s infinite;
}

@keyframes dieShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.die-face {
    font-size: 3em;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.dice-status {
    font-size: 1.1em;
    color: #fff;
    text-align: center;
    min-height: 30px;
}

/* 右侧：检定信息 */
.dice-check-right {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.check-title {
    color: var(--accent-green);
    font-size: 1.5em;
    margin: 0 0 15px 0;
    text-align: center;
}

.check-info {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 10px;
}

.check-type, .check-difficulty {
    color: #ccc;
    font-size: 0.9em;
    margin: 2px 0;
}

/* 结果公式 */
.check-formula {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 10px;
}

.formula-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
    font-size: 0.9em;
}

.formula-label {
    color: #888;
}

.formula-value {
    color: #fff;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

.formula-divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
    margin: 10px 0;
}

.formula-row.total {
    font-size: 1.1em;
    margin-top: 8px;
}

.formula-row.total .formula-value {
    color: var(--accent-green);
    font-size: 1em;
}

/* 操作按钮 */
.check-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.check-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--accent-green);
    border-radius: 10px;
    background: transparent;
    color: var(--accent-green);
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.check-btn:hover:not(:disabled) {
    background: var(--accent-green);
    color: #1a1a2e;
    transform: scale(1.05);
}

.check-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.confirm-btn {
    border-color: var(--accent-magenta);
    color: var(--accent-magenta);
}

.confirm-btn:hover:not(:disabled) {
    background: var(--accent-magenta);
}

.reroll-btn {
    border-color: #f39c12;
    color: #f39c12;
}

.reroll-btn:hover:not(:disabled) {
    background: #f39c12;
}

.hidden {
    display: none !important;
}

/* 角色选择区域 */
.character-select {
    margin-bottom: 15px;
}

.section-title {
    color: var(--accent-green);
    font-size: 1em;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--accent-green);
    padding-bottom: 10px;
}

.character-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.character-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    border: 2px solid var(--accent-green);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.character-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(78, 204, 163, 0.3);
}

.character-card.selected {
    background: linear-gradient(135deg, var(--accent-green) 0%, #1a1a2e 100%);
    border-color: #fff;
    transform: scale(1.05);
}

.character-card .char-avatar {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.character-card .char-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-card .char-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: var(--accent-green);
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
}

.character-card .char-info {
    flex: 1;
    text-align: left;
}

.character-card .char-name {
    color: #fff;
    font-weight: bold;
    margin-bottom: 5px;
}

.character-card .char-level {
    color: var(--accent-green);
    font-size: 0.9em;
}

/* 检定信息区域 */
.check-info {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.character-stats {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin: 3px 0;
    color: #ccc;
    font-size: 0.9em;
}

.stat-name {
    font-weight: bold;
}

.stat-value {
    color: #fff;
}

/* 投掷按钮 */
.roll-btn {
    margin-top: 20px;
    padding: 20px 40px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: 3px solid #fff;
    border-radius: 15px;
    color: #fff;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
    box-shadow: 0 5px 20px rgba(231, 76, 60, 0.3);
}

.roll-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(231, 76, 60, 0.5);
}

.roll-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.roll-icon {
    font-size: 2em;
}

.roll-text {
    font-size: 1em;
}

/* 帮助按钮 */
.help-container {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.help-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ecca3 0%, #2e8b57 100%);
    border: 2px solid #fff;
    color: #fff;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 10px rgba(78, 204, 163, 0.3);
}

.help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(78, 204, 163, 0.5);
}

/* 帮助气泡 */
.help-bubble {
    position: absolute;
    top: 50px;
    left: 0;
    width: 350px;
    max-height: 400px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid var(--accent-green);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    overflow-y: auto;
}

.help-title {
    color: var(--accent-green);
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(78, 204, 163, 0.3);
}

.help-content {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.help-section {
    color: #ccc;
    font-size: 0.9em;
    line-height: 1.6;
    margin-bottom: 12px;
}

/* 自定义滚动条 */
.help-content::-webkit-scrollbar {
    width: 6px;
}

.help-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.help-content::-webkit-scrollbar-thumb {
    background: var(--accent-green);
    border-radius: 3px;
}

/* 测试按钮容器（弹窗外） */
.test-buttons-external {
    position: fixed;
    top: 10px;
    right: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    z-index: 30001;
    background: rgba(26, 26, 46, 0.95);
    padding: 10px 15px;
    border-radius: 10px;
    border: 2px solid var(--accent-green);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.test-label {
    color: #fff;
    font-size: 0.85em;
    font-weight: bold;
}

.test-difficulty-input {
    width: 50px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid var(--accent-green);
    border-radius: 5px;
    color: #fff;
    font-size: 0.9em;
    font-weight: bold;
    text-align: center;
}

.test-difficulty-input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.test-check-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: 2px solid #fff;
    border-radius: 8px;
    color: #fff;
    font-size: 0.85em;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.test-check-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.5);
}

/* 门槛值金色加粗 */
.difficulty-value {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.1em;
}

/* 3D立体骰子 */
.die {
    width: 100px;
    height: 100px;
    perspective: 500px;
    margin: 0 auto;
}

.die-face {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #e74c3c 0%, #c0392b 50%, #922b21 100%);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 
        0 1px 0 rgba(255, 255, 255, 0.8),
        0 -1px 0 rgba(0, 0, 0, 0.2),
        0 2px 4px rgba(0, 0, 0, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.3),
        inset 0 -1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1),
        inset 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    transition: transform 0.1s;
    border: 2px solid #c0392b;
}

/* 骰子内圈装饰 */
.die-face::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* 骰子点数装饰 */
.die-face::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(231, 76, 60, 0.3) 0%, transparent 70%);
    border-radius: 50%;
}

.die.rolling {
    animation: dieRoll3D 0.15s infinite;
}

@keyframes dieRoll3D {
    0% { 
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); 
    }
    25% { 
        transform: rotateX(15deg) rotateY(15deg) rotateZ(5deg); 
    }
    50% { 
        transform: rotateX(-10deg) rotateY(-15deg) rotateZ(-5deg); 
    }
    75% { 
        transform: rotateX(10deg) rotateY(-10deg) rotateZ(5deg); 
    }
    100% { 
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); 
    }
}

/* 改进的3D骰子样式 */
.die {
    width: 120px;
    height: 120px;
    perspective: 800px;
    margin: 0 auto;
    position: relative;
}

.die-face {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #e74c3c 0%, #c0392b 30%, #922b21 100%);
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5em;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    position: relative;
    border: 3px solid #a93226;
    box-shadow: 
        0 8px 16px rgba(0,0,0,0.6),
        inset 0 2px 4px rgba(255,255,255,0.3),
        inset 0 -2px 4px rgba(0,0,0,0.2),
        inset 2px 2px 4px rgba(255,255,255,0.1),
        0 0 0 1px rgba(255,255,255,0.2);
    transform-style: preserve-3d;
    transition: all 0.15s ease-out;
}

/* 骰子表面纹理 */
.die-face::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 2px solid rgba(231, 76, 60, 0.5);
    border-radius: 8px;
    background: rgba(0,0,0,0.1);
}

/* 骰子中心光泽 */
.die-face::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 30%;
    height: 30%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.4) 0%, transparent 70%);
    border-radius: 50%;
}

/* 骰子旋转动画 */
.die.rolling {
    animation: dieRoll3D 0.12s ease-in-out infinite;
}

@keyframes dieRoll3D {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(1);
    }
    25% {
        transform: rotateX(180deg) rotateY(90deg) rotateZ(45deg) scale(0.95);
    }
    50% {
        transform: rotateX(360deg) rotateY(180deg) rotateZ(-45deg) scale(1.05);
    }
    75% {
        transform: rotateX(540deg) rotateY(270deg) rotateZ(15deg) scale(0.98);
    }
    100% {
        transform: rotateX(720deg) rotateY(360deg) rotateZ(0deg) scale(1);
    }
}

/* 预览时的缓慢旋转 */
.die.previewing {
    animation: diePreviewRotate 2.4s ease-in-out infinite;
}

@keyframes diePreviewRotate {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

/* 骰子舞台 */
.dice-stage {
    perspective: 1000px;
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

/* 3D六面体骰子 */
.cube {
    width: 80px;
    height: 80px;
    position: relative;
    transform-style: preserve-3d;
    margin: 0 auto;
}

.cube-face {
    position: absolute;
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, #e74c3c 0%, #c0392b 50%, #922b21 100%);
    border: 2px solid #a93226;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2em;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}

/* 六个面的位置 */
.cube-face.front {
    transform: rotateY(0deg) translateZ(40px);
}

.cube-face.back {
    transform: rotateY(180deg) translateZ(40px);
}

.cube-face.right {
    transform: rotateY(90deg) translateZ(40px);
}

.cube-face.left {
    transform: rotateY(-90deg) translateZ(40px);
}

.cube-face.top {
    transform: rotateX(90deg) translateZ(40px);
}

.cube-face.bottom {
    transform: rotateX(-90deg) translateZ(40px);
}

/* 骰子面的编号 */
.cube-face::before {
    content: attr(data-face);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.4em;
    color: rgba(255, 255, 255, 0.3);
    font-weight: normal;
}

/* 预览旋转 */
.cube.previewing {
    animation: cubePreviewRotate 2.4s linear infinite;
}

@keyframes cubePreviewRotate {
    0% {
        transform: rotateX(0deg) rotateY(0deg);
    }
    100% {
        transform: rotateX(360deg) rotateY(360deg);
    }
}

/* 投掷旋转 */
.cube.rolling {
    animation: cubeRoll 0.1s ease-in-out infinite;
}

@keyframes cubeRoll {
    0% {
        transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    }
    25% {
        transform: rotateX(180deg) rotateY(90deg) rotateZ(45deg);
    }
    50% {
        transform: rotateX(360deg) rotateY(180deg) rotateZ(-45deg);
    }
    75% {
        transform: rotateX(540deg) rotateY(270deg) rotateZ(15deg);
    }
    100% {
        transform: rotateX(720deg) rotateY(360deg) rotateZ(0deg);
    }
}

/* 隐藏旧样式 */
.dice-check-left .die {
    display: none;
}

/* --- Item Source Link & Modal --- */
.gold-link {
    color: #ffd700;
    text-decoration: underline;
    cursor: pointer;
    font-weight: bold;
    transition: color 0.2s, text-shadow 0.2s;
}
.gold-link:hover {
    color: #fff;
    text-shadow: 0 0 5px #ffd700;
}

.source-modal-content {
    width: 400px;
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.source-icon {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.source-count-row {
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #aaa;
}
.source-val {
    color: var(--accent-green);
    font-weight: bold;
    font-size: 1.1em;
}

.source-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.source-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #555;
    border-radius: 5px;
    background: linear-gradient(180deg, #333 0%, #222 100%);
    color: #ccc;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}
.source-btn:hover {
    background: linear-gradient(180deg, #444 0%, #333 100%);
    color: #fff;
    border-color: #888;
}
#btn-source-explore:hover {
    border-color: #a29bfe;
    box-shadow: 0 0 10px rgba(162, 155, 254, 0.3);
}
#btn-source-shop:hover {
    border-color: #f39c12;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.3);
}

/* ========================================
   Welcome Page Styles (顶层首页)
   ======================================== */

#welcome-page {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at 50% 50%, #2a2a40 0%, #000 100%);
    min-height: 100vh;
}

.welcome-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.welcome-title {
    font-size: 4em;
    color: #fff;
    text-shadow: 0 0 20px var(--accent-green), 0 0 40px var(--accent-green);
    margin-bottom: 10px;
    font-family: serif;
    letter-spacing: 5px;
}

.welcome-subtitle {
    font-size: 1.5em;
    color: #888;
    margin-bottom: 40px;
    letter-spacing: 3px;
}

.welcome-buttons {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.welcome-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid var(--accent-green);
    color: #fff;
    padding: 20px 50px;
    font-size: 1.3em;
    cursor: pointer;
    width: 280px;
    border-radius: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.welcome-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px var(--accent-green);
    background: linear-gradient(135deg, #2a2a40 0%, #1a1a2e 100%);
}

.welcome-btn .btn-icon {
    font-size: 1.5em;
}

.welcome-btn.admin-btn {
    border-color: #ffd700;
}

.welcome-btn.admin-btn:hover {
    box-shadow: 0 0 25px #ffd700;
}

.welcome-footer {
    margin-top: 60px;
    color: #666;
    font-size: 0.9em;
}

/* ========================================
   Password Modal Styles (密码验证模态框)
   ======================================== */

.password-modal-box {
    background: #1e1e2e;
    width: 400px;
    padding: 30px;
    border-radius: 10px;
    border: 2px solid #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    text-align: center;
}

.password-modal-header h3 {
    color: #ffd700;
    margin: 0 0 15px 0;
}

.password-modal-body {
    margin-top: 20px;
}

.password-modal-body p {
    color: #ccc;
    margin-bottom: 15px;
    font-size: 1em;
}

#password-input {
    width: 100%;
    padding: 12px;
    background: #2a2a40;
    border: 1px solid #555;
    border-radius: 5px;
    color: #fff;
    font-size: 1em;
    box-sizing: border-box;
    margin-bottom: 20px;
}

#password-input:focus {
    outline: none;
    border-color: #ffd700;
}

.password-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.password-actions .modal-btn {
    padding: 10px 30px;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    font-size: 1em;
    transition: transform 0.2s;
}

.password-actions .modal-btn:hover {
    transform: scale(1.05);
}

.password-actions .modal-btn.cancel {
    background: #444;
    color: #fff;
}

.password-actions .modal-btn.confirm {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #000;
    font-weight: bold;
}
