/* 全局变量与重置 */
:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --primary-color: #ff4757;
    --secondary-color: #2ed573;
    --accent-color: #ffa502;
    --text-color: #ffffff;
    --text-muted: #a4b0be;
    --red-ball: linear-gradient(135deg, #ff6b6b, #ee5253);
    --blue-ball: linear-gradient(135deg, #4facfe, #0072ff);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Header 样式 */
.app-header {
    background: linear-gradient(135deg, #2c3e50, #000000);
    padding: 20px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 10;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon { font-size: 32px; }

.header-text h1 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    background: linear-gradient(to right, #fff, #a4b0be);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-text p { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* 主要内容区 */
.main-content {
    flex: 1;
    padding: 20px;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 状态卡片 */
.status-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
}

.timer-display {
    font-size: 48px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(255, 165, 2, 0.3);
    margin-bottom: 5px;
}

.status-text { color: var(--text-muted); font-size: 14px; }

/* 结果展示舞台 */
.result-stage {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 20px;
    background: rgba(255,255,255,0.03);
    border-radius: 15px;
    min-height: 100px;
    align-items: center;
}

.ball-slot {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    color: transparent; /* 默认透明 */
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scale(0.8);
}

/* 激活状态 */
.ball-slot.active { transform: scale(1); color: #fff; }
.red-slot.active { background: var(--red-ball); box-shadow: 0 5px 15px rgba(238, 82, 83, 0.4); }
.blue-slot.active { background: var(--blue-ball); box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4); }

/* 号码池 */
.pool-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.pool-section {
    background: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
}

.pool-label {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.sub-label { font-weight: normal; color: var(--text-muted); font-size: 12px; }

.pool-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pool-ball {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #555;
    transition: all 0.2s;
}

/* 选中高亮 */
.pool-ball.selected {
    color: #fff;
    transform: scale(1.15);
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.red-grid .pool-ball.selected { background: var(--red-ball); }
.blue-grid .pool-ball.selected { background: var(--blue-ball); }

/* 按钮组 */
.action-bar { display: flex; gap: 15px; }

.btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s;
    color: #fff;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; filter: grayscale(1); }

.btn-primary { background: linear-gradient(135deg, #ff416c, #ff4b2b); box-shadow: 0 4px 15px rgba(255, 75, 43, 0.3); }
.btn-secondary { background: linear-gradient(135deg, #56ab2f, #a8e063); box-shadow: 0 4px 15px rgba(86, 171, 47, 0.3); }

/* 历史记录 */
.history-panel {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
}

.history-panel h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-panel ul { list-style: none; max-height: 250px; overflow-y: auto; }

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.history-balls { display: flex; gap: 4px; }
.h-ball {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
}
.h-red { background: var(--red-ball); }
.h-blue { background: var(--blue-ball); }

/* Footer 样式 */
.app-footer {
    text-align: center;
    padding: 20px;
    color: #555;
    font-size: 11px;
    line-height: 1.6;
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: auto;
}