/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 开局封面 */
.start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a0a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.start-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 50px 40px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 0.8s ease;
}

.start-card h1 {
    font-size: 2.4em;
    color: #e8d5b7;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(232, 213, 183, 0.3);
}

.start-subtitle {
    font-size: 1em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 25px;
    letter-spacing: 2px;
}

.start-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #c9a96e, transparent);
    margin: 0 auto 25px;
}

.start-desc {
    font-size: 1.05em;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.8;
    margin-bottom: 35px;
}

.start-button {
    background: linear-gradient(135deg, #c9a96e 0%, #a8834a 100%);
    color: #1a0a2e;
    border: none;
    padding: 16px 48px;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(201, 169, 110, 0.3);
    letter-spacing: 2px;
}

.start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(201, 169, 110, 0.5);
}

.start-button:active {
    transform: translateY(0);
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    overflow: hidden;
}

/* 游戏头部 */
.game-header {
    background: linear-gradient(135deg, #5a3e2b 0%, #8c6d52 100%);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.game-header h1 {
    font-size: 2em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    font-size: 0.9em;
    opacity: 0.9;
}

/* 游戏主体 */
.game-body {
    padding: 30px;
}

/* 图文混合包装容器 — PC 端左右并排 */
.story-wrapper {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.story-panel {
    background: #f8f6f3;
    border: 2px solid #e0d5c7;
    border-radius: 15px;
    padding: 25px;
    min-height: 150px;
    line-height: 1.8;
    font-size: 1.05em;
    color: #3e2723;
    position: relative;
    flex: 1;
}

.story-panel::before {
    content: '📜';
    position: absolute;
    top: -15px;
    left: 20px;
    font-size: 24px;
}

/* 图片面板 */
.image-panel {
    flex: 0 0 300px;
    min-width: 200px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.image-panel img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 2px solid #e0d5c7;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
}

.image-panel img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.story-text {
    white-space: pre-line;
}

.player-choice {
    color: #8c6d52;
    font-style: italic;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #d0c8b8;
}

/* 选项面板 */
.options-panel {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.option-button {
    background: linear-gradient(135deg, #8c6d52 0%, #a07e60 100%);
    color: white;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    text-align: left;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.option-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(140, 109, 82, 0.4);
}

.option-button:active {
    transform: translateY(0);
}

.option-button::before {
    content: '⚔️';
    margin-right: 10px;
}

/* 加载指示器 */
.loading-indicator {
    text-align: center;
    padding: 20px;
}

.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 4px solid #e0d5c7;
    border-top: 4px solid #8c6d52;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-text {
    color: #8c6d52;
    font-size: 1.1em;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误面板 */
.error-panel {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #ef9a9a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-panel::before {
    content: '⚠️';
    font-size: 20px;
}

/* 控制按钮 */
.control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.control-button {
    background: #6c757d;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-button:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.control-button.primary {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.control-button.primary:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .game-header h1 {
        font-size: 1.5em;
    }

    .game-body {
        padding: 20px;
    }

    /* 手机端: 图文上下堆叠 */
    .story-wrapper {
        flex-direction: column;
    }

    .image-panel {
        flex: 0 0 auto;
        min-width: unset;
    }

    .image-panel img {
        max-height: 300px;
        object-fit: cover;
    }

    .story-panel {
        padding: 20px;
        font-size: 0.95em;
    }

    .game-info {
        flex-direction: column;
        gap: 10px;
    }
}

/* 工具类 */
.hidden {
    display: none !important;
}