/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "SimSun", serif;
    background-color: #f5f0e6;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 100%;
    min-height: 100vh;
    padding: 20px;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiPjxkZWZzPjxwYXR0ZXJuIGlkPSJwYXR0ZXJuIiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIiB3aWR0aD0iNDAiIGhlaWdodD0iNDAiPjxwYXRoIGQ9Ik0wIDBoNDB2NDBoLTQweiIvPjwvcGF0dGVybj48L2RlZnM+PHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNwYXR0ZXJuKSIvPjwvc3ZnPg==');
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #d4a76a;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

h1 {
    font-size: 1.8rem;
    color: #8b4513;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* 主内容区域 */
main {
    background-color: rgba(255,255,255,0.8);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 城池信息 */
.city-info {
    margin-bottom: 25px;
    text-align: center;
}

.city-info h2 {
    font-size: 1.5rem;
    color: #8b4513;
    margin-bottom: 10px;
}

.health-bar {
    width: 100%;
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid #8b4513;
}

.health-fill {
    height: 100%;
    background-color: #e74c3c;
    transition: width 0.5s ease;
}

.health-text {
    font-size: 1rem;
    font-weight: bold;
    color: #8b4513;
}

.army-text {
    font-size: 0.9rem;
    font-weight: bold;
    color: #8b4513;
    text-align: center;
    margin-top: 5px;
}

.player-counts {
    display: flex;
    justify-content: space-around;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #8b4513;
}

.player-counts p {
    font-weight: bold;
}

/* 时间信息 */
.time-info {
    margin-bottom: 25px;
    text-align: center;
}

.time-info h3 {
    font-size: 1.2rem;
    color: #8b4513;
    margin-bottom: 10px;
}

.countdown {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 5px;
}

.next-attack {
    font-size: 0.9rem;
    color: #666;
}

/* 玩家操作区 */
.player-controls {
    margin-bottom: 25px;
}

.player-controls h3 {
    font-size: 1.2rem;
    color: #8b4513;
    margin-bottom: 10px;
    text-align: center;
}

.action-buttons {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.action-buttons button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-family: "SimSun", serif;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #d4a76a;
    color: #8b4513;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.action-buttons button:hover {
    background-color: #c1945a;
    transform: translateY(-2px);
}

.action-buttons button.active {
    background-color: #e74c3c;
    color: white;
}

.faction-buttons {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.faction-btn {
    padding: 10px 15px;
    border: 2px solid #8b4513;
    border-radius: 5px;
    font-size: 1rem;
    font-family: "SimSun", serif;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f5f0e6;
    color: #8b4513;
}

.faction-btn:hover {
    background-color: #d4a76a;
    transform: translateY(-2px);
}

.faction-btn.active {
    background-color: #8b4513;
    color: white;
}

#start-btn {
    display: block;
    margin: 0 auto;
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-family: "SimSun", serif;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #e74c3c;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#start-btn:hover:not(:disabled) {
    background-color: #c0392b;
    transform: translateY(-2px);
}

#start-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

/* 行军信息 */
.march-info {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f5f0e6;
    border-radius: 10px;
    border: 1px solid #d4a76a;
}

.march-info h3 {
    font-size: 1.2rem;
    color: #8b4513;
    margin-bottom: 10px;
    text-align: center;
}

.march-time {
    text-align: center;
    margin-bottom: 10px;
    font-size: 1rem;
    color: #666;
}

#arrival-time {
    font-weight: bold;
    color: #8b4513;
}

.march-progress {
    width: 100%;
    height: 15px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #d4a76a;
}

.march-fill {
    height: 100%;
    background-color: #27ae60;
    width: 0%;
    transition: width 1s linear;
}

/* 战斗结果 */
.battle-result {
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f5f0e6;
    border-radius: 10px;
    border: 1px solid #d4a76a;
    text-align: center;
}

.battle-result h3 {
    font-size: 1.2rem;
    color: #8b4513;
    margin-bottom: 10px;
}

#result-message {
    font-size: 1.1rem;
    font-weight: bold;
    color: #e74c3c;
    animation: flash 1s ease-in-out infinite;
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 侧边栏 */
aside {
    background-color: rgba(255,255,255,0.8);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

aside h3 {
    font-size: 1.2rem;
    color: #8b4513;
    margin-bottom: 15px;
    text-align: center;
}

.records {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.record-item {
    background-color: #f5f0e6;
    border-radius: 5px;
    padding: 10px;
    border: 1px solid #d4a76a;
}

.record-item h4 {
    font-size: 1rem;
    color: #8b4513;
    margin-bottom: 5px;
}

.record-item p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
}

/* 排行榜 */
.leaderboard {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #d4a76a;
}

.leaderboard h3 {
    font-size: 1.2rem;
    color: #8b4513;
    margin-bottom: 15px;
    text-align: center;
}

.leaderboard table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.leaderboard th,
.leaderboard td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid #d4a76a;
}

.leaderboard th {
    background-color: #d4a76a;
    color: #8b4513;
    font-weight: bold;
}

.leaderboard tr:hover {
    background-color: #f5f0e6;
}

/* 响应式设计 */
@media (min-width: 768px) {
    .container {
        max-width: 800px;
        margin: 0 auto;
    }
    
    .content-wrapper {
        display: flex;
        gap: 20px;
    }
    
    main {
        flex: 2;
    }
    
    aside {
        flex: 1;
    }
}