/* ===== static/css/record.css - 开奖记录样式 ===== */

/* ===== 全局样式重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.3;
    color: #333;
    background-color: #f5f5f5;
    padding: 2px 2px;
    font-size: 13px;
}

/* ===== 容器 ===== */
.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0px;
}

/* ===== 每个彩种卡片 ===== */
.lottery-card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    padding: 1px 4px 1px 4px;
    border-left: 4px solid #667eea;
    border-right: 4px solid #667eea;
    transition: all 0.2s ease;
}

.lottery-card:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
}

.lottery-card.tw { 
    border-left-color: #f12424; 
    border-right-color: #f12424; 
}
.lottery-card.xg { 
    border-left-color: #0c00ff; 
    border-right-color: #0c00ff; 
}
.lottery-card.am { 
    border-left-color: #2e7d32; 
    border-right-color: #2e7d32; 
}

/* ===== 标题行 ===== */
.lottery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 3px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 2px;
    flex-wrap: wrap;
    gap: 2px;
}

.lottery-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.lottery-name .icon { margin-right: 4px; }
.lottery-name.tw .icon { color: #0c00ff; }
.lottery-name.xg .icon { color: #f12424; }
.lottery-name.am .icon { color: #2e7d32; }

/* ===== 倒计时样式 ===== */
.countdown-timer {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 14px;
    display: inline-block;
    min-width: 80px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
    padding: 0 8px;
    border-radius: 4px;
    line-height: 1.6;
}

.countdown-timer.ready {
    color: #51cf66;
    background: rgba(81, 207, 102, 0.12);
}

.countdown-timer.urgent {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.lottery-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #666;
    flex-wrap: wrap;
}

.lottery-info .label { font-weight: 600; color: #333; }
.lottery-info .value { font-weight: 700; color: #667eea; }
.lottery-info .value.period { color: #ff6700; }

.action-buttons {
    display: flex;
    gap: 3px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-refresh {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 0px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
    height: 20px;
    line-height: 20px;
}

.btn-refresh:hover {
    background: #5a6fd6;
    transform: translateY(-1px);
}

.btn-link {
    color: #667eea;
    text-decoration: none;
    font-size: 10px;
    font-weight: 500;
}

.btn-link:hover { text-decoration: underline; }

/* ===== 号码展示区 ===== */
.numbers-container {
    padding: 0px 0;
    text-align: center;
}

.numbers-grid {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
    padding: 0px 0;
    align-items: center;
}

.number-box {
    flex: 0 0 calc((100% - 35px) / 7);
    max-width: calc((100% - 35px) / 7);
    min-width: 38px;
    min-height: 50px;
    border-radius: 10px;
    border: 0px solid #e8ecf1;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 1px rgba(0,0,0,0.03);
    position: relative;
    padding: 1px 1px;
    margin-left:-2px;
}

.number-box:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    border-color: #667eea;
}

/* 当 number-circle 有颜色时，number-box 跟随其背景色 */
.number-box:has(.number-circle.red),
.number-box:has(.number-circle.special.red) {
    background: #e74c3c;
}

.number-box:has(.number-circle.green),
.number-box:has(.number-circle.special.green) {
    background: #2ecc71;
}

.number-box:has(.number-circle.blue),
.number-box:has(.number-circle.special.blue) {
    background: #3498db;
}

.number-circle {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 800;
    color: #000;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.number-circle:hover { transform: scale(2.05); }
.number-circle.red { background: #e74c3c; }
.number-circle.green { background: #2ecc71; }
.number-circle.blue { background: #3498db; }


.number-label {
    font-size: 16px;
    font-weight: 600;
    color: #000;
    margin-top: 0px;
    text-align: center;
    line-height: 1.1;
}

.special-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    min-width: 12px;
    color: #c62828;
    font-size: 14px;
    flex-shrink: 0;
}

/* ===== 下一期信息 ===== */
.next-draw-info {
    background: #f8f9fc;
    padding: 1px 10px;
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
    color: #555;
    margin-top: 1px;
    border: 1px solid #e8ecf1;
    height: 22px;
    line-height: 22px;
}

.next-draw-info strong { color: #667eea; }

/* ===== 加载占位 ===== */
.loading-placeholder {
    text-align: center;
    padding: 8px 10px;
    color: #999;
    font-size: 11px;
}

.loading-placeholder .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 3px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== 摇号文字 ===== */
.lottery-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    color: #333;
    background: white;
    z-index: 10;
    border-radius: 2px;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    body { padding: 0px 2px !important; font-size: 12px; }
    .container { padding: 0px !important; gap: 3px; }
    .lottery-card { padding: 2px 4px 2px 4px; border-radius: 4px; border-left-width: 3px; }
    .lottery-name { font-size: 13px; }
    .countdown-timer { 
        font-size: 12px; 
        min-width: 70px;
        padding: 0 6px;
    }
    .lottery-info { font-size: 10px; gap: 4px; }
    /* 小屏幕隐藏期数和日期信息 */
    .draw-info-item:not(.action-buttons) {
        display: none !important;
    }
    .number-circle { width: 24px; height: 24px; font-size: 16px; }
    .number-box { min-width: 24px; padding: 1px 2px;min-height: 30px;margin-left:0px;}
    .numbers-grid { gap: 3px; }
    .number-label { font-size: 13px; }
    .special-separator { font-size: 9px; min-width: 10px; }
    /* 让标题和按钮保持同一行，不折行 */
    .lottery-header { 
        flex-direction: row; 
        align-items: center; 
        gap: 2px;
        flex-wrap: wrap;
    }
    .next-draw-info { font-size: 11px; padding: 1px 6px; height: 20px; line-height: 20px; }
    .btn-refresh { padding: 0px 8px; font-size: 9px; height: 18px; line-height: 18px; }
    .btn-link { font-size: 9px; }
}

@media (max-width: 480px) {
    body { padding: 0px 0px !important; font-size: 12px; }
    .container { padding: 0px !important; gap: 2px; }
    .lottery-card { padding: 2px 2px 2px 2px !important; border-radius: 0px !important; border-left-width: 3px; }
    .lottery-name { 
        font-size: 11px;
        gap: 2px;
    }
    .countdown-timer { 
        font-size: 10px; 
        min-width: 60px;
        padding: 0 4px;
        letter-spacing: 0px;
    }
    /* 小屏幕隐藏期数和日期信息（更小屏幕也保持隐藏） */
    .draw-info-item:not(.action-buttons) {
        display: none !important;
    }
    .number-circle { width: 25px; height: 25px; font-size: 16px;border-radius: 20px;}
    .number-box { min-width: 20px; padding: 1px 1px; border-radius: 8px;min-height: 30px;margin-left:0px;}
    .numbers-grid { gap: 2px; }
    .number-label { font-size: 11px; }
    .special-separator { font-size: 8px; min-width: 8px; }
    .lottery-info { font-size: 9px; gap: 2px; }
    /* 让标题和按钮保持同一行，不折行 */
    .lottery-header { 
        flex-direction: row; 
        align-items: center; 
        gap: 1px;
        flex-wrap: wrap;
    }
    .btn-refresh { padding: 0px 6px; font-size: 8px; height: 16px; line-height: 16px; }
    .btn-link { font-size: 8px; }
    .next-draw-info { font-size: 10px; padding: 1px 4px; height: 16px; line-height: 16px; }
}