* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    background: #faf0e1;
    font-family: system-ui, -apple-system, 'Segoe UI', '华文楷书', 'Microsoft YaHei', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.game-container {
    width: 1000px;
    max-width: 100%;
    background: #fffaf2;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #e6d5b8;
    display: flex;
    flex-direction: column;
}

/* 页眉 */
.header {
    background: #fdf3e0;
    padding: 16px 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ecd9b4;
    gap: 12px;
}
.player-info {
    display: flex;
    gap: 24px;
    background: #fff6ea;
    padding: 8px 20px;
    border-radius: 60px;
    font-weight: bold;
    color: #5a3e2b;
}
.location-badge {
    background: #e6d5b8;
    padding: 6px 18px;
    border-radius: 40px;
    color: #5a3e2b;
    font-weight: bold;
}

/* 主体区域（竖版：左侧边栏 + 中央战斗区） */
.main-layout {
    display: flex;
    gap: 0;
    background: #fffaf2;
    min-height: 450px;
}

/* 左侧边栏 */
.left-sidebar {
    width: 100px;
    background: #fef7ec;
    border-right: 1px solid #ecd9b4;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 20px;
}
.sidebar-btn {
    background: #e7cfaa;
    border: none;
    width: 70px;
    padding: 12px 0;
    border-radius: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.1s;
    color: #5a3e2b;
}
.sidebar-btn:active {
    background: #dbbc87;
}

/* 中央战斗测试区 */
.combat-area {
    flex: 1;
    padding: 30px 20px;
    text-align: center;
}
.combat-area h2 {
    color: #b97f3a;
    margin-bottom: 24px;
}
.difficulty-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}
.difficulty-btn {
    background: #d9a066;
    border: none;
    padding: 12px 28px;
    border-radius: 48px;
    font-weight: bold;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.1s;
}
.difficulty-btn:active {
    transform: scale(0.96);
}
.combat-log-preview {
    background: #fff2e4;
    border-radius: 28px;
    padding: 16px;
    min-height: 150px;
    border: 1px solid #ecd9b4;
    color: #5a3e2b;
    text-align: left;
    font-family: monospace;
    font-size: 0.9rem;
    overflow-y: auto;
    max-height: 200px;
}

/* 底部功能栏 */
.bottom-bar {
    background: #fdf3e0;
    padding: 12px 20px;
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    border-top: 1px solid #ecd9b4;
}
.func-btn {
    background: #fff2e4;
    border: 1px solid #d9a066;
    padding: 8px 24px;
    border-radius: 48px;
    color: #5a3e2b;
    font-weight: bold;
    cursor: pointer;
    transition: 0.1s;
}
.func-btn:active {
    background: #e7cfaa;
}

/* 页脚 */
.footer {
    background: #faf0e1;
    padding: 12px 20px;
    text-align: center;
    font-size: 12px;
    color: #8b6946;
    border-top: 1px solid #ecd9b4;
}

/* 模态框（复用之前的样式） */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}
.modal-content {
    background-color: #fffaf2;
    border-radius: 28px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #ecd9b4;
    color: #5a3e2b;
}
.modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid #ecd9b4;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-close {
    font-size: 24px;
    cursor: pointer;
}
.modal-body {
    padding: 16px;
}
.inventory-item, .formation-unit, .owned-unit {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #ecd9b4;
}
.card-mini {
    transition: transform 0.1s;
    cursor: pointer;
}
.card-mini:hover {
    transform: scale(1.02);
    background-color: #ffe6cc !important;
}


.combat-unit {
    background: #fff2e4;
    border: 1px solid #d9a066;
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    font-size: 12px;
}
/* 战斗模态框 (内部已有) */

/* 战斗单元卡片样式 */
.combat-unit {
    background: #fff2e4;
    border: 1px solid #d9a066;
    border-radius: 12px;
    padding: 8px;
    text-align: center;
    font-size: 12px;
}
#playerGrid, #enemyGrid {
    margin-bottom: 8px;
}

/* 卡片容器 */
.card {
    width: 240px;
    background: #fff9ef;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.1s;
    cursor: pointer;
    border: 2px solid #aaa;
}
.card:hover {
    transform: scale(1.02);
}

/* 星级阶段边框颜色 */
.star-gray { border-color: #aaa; }
.star-green { border-color: #6c6; }
.star-blue { border-color: #69f; }
.star-purple { border-color: #c6c; }
.star-gold { border-color: #fc3; }
.star-red { border-color: #f66; }

.card-header {
    padding: 8px;
    text-align: center;
    background: #f5e6d3;
}
.card-stars {
    font-size: 0.8rem;
    color: #f4b400;
    letter-spacing: 2px;
}
.card-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 4px;
}

/* 美术资源预留区 */
.card-art {
    height: 100px;
    background: #e6d5b8;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #d4b88c;
    border-bottom: 1px solid #d4b88c;
}
.art-placeholder {
    color: #8b6946;
    font-size: 0.8rem;
    text-align: center;
    font-style: italic;
}

/* 属性区 */
.card-stats {
    padding: 8px;
    font-size: 0.75rem;
    background: #fff;
}
.stats-row {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
}

/* 羁绊与技能区 */
.card-bonds, .card-skills {
    padding: 6px 8px;
    font-size: 0.7rem;
    border-top: 1px solid #e2d2bc;
}
.card-bonds {
    background: #faf0e1;
}
.card-skills {
    background: #f5e6d3;
}