/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 页面基础样式 */
body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 15px;
}

.container {
    max-width: 450px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    padding: 20px;
}

/* 标题样式 */
.header {
    text-align: center;
    margin-bottom: 25px;
}

.header h1 {
    color: #e74c3c;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
}

/* 球区通用样式 */
.ball-section {
    margin-bottom: 25px;
}

.section-title {
    font-size: 18px;
    margin-bottom: 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
}

.red-section .section-title {
    color: #e74c3c;
}

.blue-section .section-title {
    color: #3498db;
}

/* 数字球容器 */
.balls-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* 数字球样式 */
.ball {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 红球样式 */
.red-ball {
    background: #fff;
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.red-ball.active {
    background: #e74c3c;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* 蓝球样式 */
.blue-ball {
    background: #fff;
    color: #3498db;
    border: 2px solid #3498db;
}

.blue-ball.active {
    background: #3498db;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* 闪烁动画 */
@keyframes flash {
    0% { opacity: 0.3; }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.3; }
}

.flashing {
    animation: flash 0.2s infinite;
}

/* 按钮组样式 */
.btn-group {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.btn {
    flex: 1;
    height: 50px;
    border-radius: 25px;
    border: none;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.start-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.start-btn:active {
    transform: scale(0.98);
}

.save-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
}

.save-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}

.save-btn:active:not(:disabled) {
    transform: scale(0.98);
}

/* 历史记录区域 */
.history-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ball-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ball-group.red {
    margin-right: 15px;
}

.history-item .ball {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

.empty-tip {
    text-align: center;
    color: #999;
    padding: 20px 0;
}

footer {
    font-size: 0.65rem;
    text-align: center;
    color: #b9c2d0;
    margin-top: 20px;
}