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

/* 地图容器 - 移动端优先 */
#overworld {
    background-image: url('../img/bigmap.JPG');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 100vh;
    padding: 15px;
    position: relative;
    font-family: 'Microsoft JhengHei', Arial, sans-serif;
    color: white; /* 全局默认白色字体 */
}

/* 半透明遮罩层 */
#overworld::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

/* 确保内容在遮罩上方 */
#overworld > * {
    position: relative;
    z-index: 1;
}

/* 标题区域 */
.header {
    display: flex;
    flex-direction: column;
    margin-bottom: 25px; /* 增加下边距 */
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

#current-faction {
    color: #ffcc00;
    font-size: 1.5rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    margin-bottom: 8px;
}

#faction-info {
    color: white; /* 确保白色字体 */
    font-size: 0.9rem;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 8px 12px;
    border-radius: 20px;
    display: inline-block;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* 城市卡片容器 - 增加间距 */
.cities-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px; /* 增大卡片间距 */
    padding: 15px; /* 增加内边距 */
    margin-bottom: 80px;
}

/* 城市卡片样式 - 增加间距 */
.city-card {
    background-color: rgba(40, 40, 40, 0.9);
    border-radius: 10px;
    padding: 20px; /* 增加内边距 */
    margin-bottom: 8px; /* 增加卡片下边距 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    color: white; /* 确保卡片内文字为白色 */
}

.city-card.clickable {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.city-card h3 {
    color: #ffcc00;
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 18px; /* 增加标题下边距 */
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

/* 城市信息行 - 确保白色字体 */
.city-info p {
    display: flex;
    justify-content: space-between;
    margin: 15px 0; /* 增加行间距 */
    font-size: 0.95rem;
    color: white; /* 确保白色字体 */
}

.city-info span:first-child {
    color: #ddd; /* 浅灰色提高可读性 */
}

.city-info span:last-child {
    color: white; /* 确保白色字体 */
    font-weight: bold;
}

/* 不同阵营的城市样式 */
.enemy-city {
    background-color: rgba(139, 0, 0, 0.25);
    border-left: 4px solid #8B0000;
}

.neutral-city {
    background-color: rgba(100, 100, 100, 0.4);
    border-left: 4px solid #666;
}

.ally-city {
    background-color: rgba(0, 100, 0, 0.25);
    border-left: 4px solid #4CAF50;
}

/* 底部操作按钮 */
.footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px; /* 增加按钮间距 */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.85);
    padding: 20px 15px; /* 增加上下内边距 */
    border-top: 1px solid rgba(255, 215, 0, 0.3);
    z-index: 10;
}

/* 按钮样式 */
button {
    padding: 16px; /* 增大按钮尺寸 */
    font-size: 1rem;
    background-color: rgba(139, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 8px;
    transition: all 0.2s;
    margin: 5px 0; /* 按钮间垂直间距 */
}

/* 平板设备适配 (600px以上) */
@media (min-width: 600px) {
    .cities-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px; /* 增大间距 */
        padding: 20px;
    }
    
    .footer {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px; /* 增大按钮间距 */
    }
    
    .city-card {
        margin-bottom: 12px; /* 增加卡片下边距 */
    }
}

/* 桌面设备适配 (900px以上) */
@media (min-width: 900px) {
    .cities-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 32px; /* 继续增大间距 */
        padding: 25px;
    }
    
    .city-card {
        padding: 25px; /* 增加内边距 */
    }
    
    .city-info p {
        margin: 18px 0; /* 增加行间距 */
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 3px;
}