.container {
    max-width: 800px;
    width: 95%;
    margin: 0 auto;
    text-align: center;
    padding: min(15px, 3vw);
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: clamp(24px, 5vw, 32px);
    color: #2c3e50;
    margin-bottom: 25px;
}

.controls {
    margin: 25px 0;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.controls button {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 6px;
    border: none;
    background: #3498db;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.controls button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.controls select {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    outline: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#moves {
    padding: 10px 20px;
    background: #ecf0f1;
    border-radius: 6px;
    color: #2c3e50;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.towers {
    display: flex;
    justify-content: space-around;
    margin-top: clamp(20px, 5vw, 40px);
    gap: clamp(10px, 2vw, 20px);
    padding: 0 clamp(10px, 2vw, 20px);
}

.tower {
    position: relative;
    width: clamp(90px, 30%, 240px);
    height: clamp(140px, 40vw, 200px);
    min-width: auto;
    background: rgba(236, 240, 241, 0.5);
    border-radius: 8px;
    padding: clamp(5px, 1vw, 10px);
}

.pole {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: clamp(8px, 1.5vw, 12px);
    height: calc(100% - 20px);
    background: linear-gradient(to bottom, #95a5a6, #7f8c8d);
    transform: translateX(-50%);
    border-radius: 6px 6px 0 0;
}

.base {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 12px;
    background: linear-gradient(to right, #95a5a6, #7f8c8d);
    border-radius: 6px;
}

.disk {
    position: absolute;
    left: 50%;
    height: 24px;
    background: linear-gradient(to right, #e74c3c, #c0392b);
    border-radius: 12px;
    transform: translateX(-50%);
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 90%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    min-width: 20px; /* 确保圆盘不会太小 */
    /* 增加点击区域 */
    padding: 4px 0;
    margin: -4px 0;
    z-index: 10;
}

.disk:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 20;
}

/* 选中状态样式 */
.disk.selected {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.8), 0 4px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #3498db;
    z-index: 30;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 15px rgba(52, 152, 219, 0.8), 0 4px 8px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(52, 152, 219, 1), 0 6px 12px rgba(0, 0, 0, 0.4);
    }
}

/* 塔的可点击区域提示 */
.tower:hover .disk:last-child:not(.selected) {
    transform: translateX(-50%) scale(1.02);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

/* 无效移动时的视觉反馈 */
.disk.invalid-move {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(-50%); }
    25% { transform: translateX(-48%); }
    75% { transform: translateX(-52%); }
}

@media (max-width: 768px) {
    .controls {
        gap: 10px;
    }

    .controls button, .controls select, #moves {
        width: calc(50% - 10px);
        padding: 8px;
        font-size: clamp(14px, 3vw, 16px);
    }

    .disk {
        height: clamp(16px, 4vw, 24px);
    }
}

@media (max-width: 480px) {
    .container {
        width: 98%;
        padding: 8px;
        border-radius: 8px;
    }

    .controls button, .controls select, #moves {
        width: calc(100% - 10px);
    }

    .tower {
        height: clamp(120px, 35vw, 160px);
    }
    
    .pole {
        height: calc(100% - 15px);
    }
    
    .disk {
        height: clamp(14px, 3.5vw, 20px);
    }
}

@media (max-width: 320px) {
    h1 {
        font-size: clamp(18px, 4vw, 24px);
    }

    .tower {
        height: clamp(100px, 30vw, 120px);
    }

    .disk {
        height: clamp(12px, 3vw, 16px);
    }
}
.game-intro {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    margin: 20px auto;
    max-width: 600px;
    text-align: left;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.game-intro h2 {
    color: #2c3e50;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.game-intro h3 {
    color: #34495e;
    font-size: 1.2em;
    margin: 15px 0 10px;
}

.game-intro p {
    color: #555;
    line-height: 1.6;
    margin: 10px 0;
}

.game-intro ul {
    list-style-type: disc;
    padding-left: 20px;
    margin: 10px 0;
}

.game-intro li {
    color: #555;
    line-height: 1.8;
    margin: 5px 0;
}

@media (max-width: 480px) {
    .game-intro {
        padding: 15px;
        margin: 15px auto;
    }

    .game-intro h2 {
        font-size: 1.3em;
    }

    .game-intro h3 {
        font-size: 1.1em;
    }

    .game-intro p, .game-intro li {
        font-size: 0.9em;
    }
}