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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #7986CB 0%, #3F51B5 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

/* 扁平化设计 - 主容器 */
.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 扁平化设计 - 游戏头部 */
.game-header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 10px;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.game-subtitle {
    font-size: 1.125rem;
    opacity: 0.8;
    font-weight: 400;
}

/* 故事选择界面 */
.story-selector {
    text-align: center;
    margin-bottom: 30px;
}

.story-selector h2 {
    font-size: 1.75rem;
    margin-bottom: 25px;
    font-weight: 400;
    opacity: 0.9;
}

.story-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    max-width: 1000px;
    margin: 0 auto;
}

.story-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 25px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
}

.story-card:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.story-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.story-info h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.story-info p {
    font-size: 1rem;
    opacity: 0.8;
    line-height: 1.4;
    margin-bottom: 12px;
}

.story-stats {
    display: flex;
    gap: 15px;
    font-size: 0.875rem;
    opacity: 0.7;
}

/* 游戏界面布局 */
.game-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

/* 故事面板 */
.story-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.location-header {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.location-name {
    font-size: 1.5rem;
    font-weight: 600;
}

.story-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.progress-bar {
    width: 120px;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #81C784);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.story-content {
    padding: 25px;
}

.story-text {
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 20px;
    min-height: 120px;
    text-align: justify;
}

.story-image {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.ascii-art {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #E0E0E0;
    text-align: center;
}

/* 交互面板 */
.interaction-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.player-status, .inventory-panel, .choices-panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.player-status h3, .inventory-panel h3, .choices-panel h3 {
    font-size: 1.125rem;
    margin-bottom: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 状态栏 */
.status-grid {
    display: grid;
    gap: 12px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.status-label {
    font-size: 0.9rem;
    opacity: 0.8;
    min-width: 60px;
}

.status-bar {
    flex: 1;
    min-width: 120px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.bar-fill.health {
    background: linear-gradient(90deg, #F44336, #FF9800);
}

.bar-fill.energy {
    background: linear-gradient(90deg, #2196F3, #03DAC6);
}

.bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.status-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #FFD700;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* 物品栏 */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.inventory-slot {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.inventory-slot.empty {
    opacity: 0.5;
    cursor: default;
}

.inventory-slot.empty span {
    font-size: 0.8rem;
    opacity: 0.6;
}

.inventory-slot:not(.empty):hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* 选择面板 */
.choices-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.choice-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    line-height: 1.4;
}

.choice-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(5px);
}

.choice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(128, 128, 128, 0.2);
}

.choice-requirements {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 5px;
    font-style: italic;
}

/* 游戏控制 */
.game-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    background: #5C6BC0;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(92, 107, 192, 0.3);
    min-width: 120px;
}

.btn:hover {
    background: #3F51B5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(92, 107, 192, 0.4);
}

.btn.secondary {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.15);
}

/* 扁平化设计 - 弹窗 */
.ending-popup, .menu-popup, .help-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.ending-popup.show, .menu-popup.show, .help-popup.show {
    display: flex;
}

.popup-content {
    background: linear-gradient(135deg, #7986CB 0%, #3F51B5 100%);
    border-radius: 25px;
    padding: 40px;
    text-align: center;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    max-height: 80vh;
    overflow-y: auto;
}

.popup-content h2 {
    font-size: 2rem;
    margin-bottom: 25px;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* 结局弹窗 */
.ending-content {
    margin-bottom: 25px;
}

.ending-image {
    margin-bottom: 20px;
}

.ending-text {
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 20px;
    opacity: 0.9;
}

.ending-stats {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(20px);
}

.final-stats {
    display: grid;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-row:last-child {
    border-bottom: none;
}

/* 菜单弹窗 */
.menu-options {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(5px);
}

.menu-btn span {
    font-size: 1.5rem;
    width: 30px;
    text-align: center;
}

.menu-btn div {
    font-size: 1.125rem;
    font-weight: 600;
}

.popup-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 帮助弹窗特殊样式 */
.help-content {
    text-align: left;
}

.help-content h2 {
    text-align: center;
}

.help-section {
    margin-bottom: 25px;
}

.help-section h3 {
    color: #FFD700;
    margin-bottom: 12px;
    font-size: 1.125rem;
    font-weight: 600;
}

.help-section p {
    margin-bottom: 12px;
    opacity: 0.9;
    line-height: 1.5;
}

.help-section ul {
    margin-left: 20px;
    opacity: 0.9;
}

.help-section li {
    margin-bottom: 8px;
    line-height: 1.4;
}

.help-section strong {
    color: #FFD700;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .game-container {
        padding: 15px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .game-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .story-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .story-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .location-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .story-progress {
        justify-content: center;
    }
    
    .status-item {
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
    }
    
    .status-bar {
        min-width: auto;
    }
    
    .inventory-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .game-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        min-width: 200px;
    }
    
    .popup-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .popup-actions {
        flex-direction: column;
    }
    
    .menu-btn {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .game-header {
        padding: 20px 15px;
    }
    
    .story-content {
        padding: 20px 15px;
    }
    
    .story-text {
        font-size: 1rem;
        min-height: 100px;
    }
    
    .ascii-art {
        padding: 15px;
        font-size: 0.7rem;
    }
    
    .interaction-panel > div {
        padding: 15px;
    }
    
    .choice-btn {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .inventory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}