* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
    background: #fff;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* 行布局 */
.row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.row-1 {
    justify-content: space-between;
    font-size: 14px;
}

.row-2 {
    justify-content: center;
    width: 100%;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.row-3 {
    justify-content: space-between;
    font-size: 14px;
}

.col {
    display: flex;
    align-items: center;
}

.left {
    justify-content: flex-start;
}

.center {
    justify-content: center;
}

.right {
    justify-content: flex-end;
}

/* 文字样式 */
.label {
    color: #333;
}

.title {
    color: #000;
    font-weight: 900;
    font-size: 15px;
}

.period-num {
    color: #e74c3c;
    font-weight: 900;
    font-size: 15px;
}

.countdown {
    color: #000;
    font-family: monospace;
    font-weight: 900;
    font-size: 15px;
}

.history-link {
    color: #e74c3c;
    text-decoration: none;
}

.date {
    color: #333;
}

/* 球体包装 */
.ball-wrap {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 2px;
    min-width: 50px;
    max-width: 90px;
}

/* 3D球体 - 外圈波色+白色曲线，中间白色号码区 */
.ball {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
}

.ball-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 
        inset -5px -5px 10px rgba(0,0,0,0.3),
        inset 5px 5px 10px rgba(255,255,255,0.5),
        2px 2px 6px rgba(0,0,0,0.3);
}

/* 外圈红白相间 - 波色曲线 */
.ball-red .ball-inner {
    background: 
        /* 高光 */
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 30%),
        /* 白色号码区 */
        radial-gradient(circle at 50% 50%, #fff 0%, #fff 45%, transparent 48%),
        /* 红色波色外圈 */
        radial-gradient(circle at 20% 20%, #e53935 0%, #c62828 30%, transparent 35%),
        radial-gradient(circle at 80% 80%, #e53935 0%, #c62828 30%, transparent 35%),
        radial-gradient(circle at 20% 80%, #e53935 0%, #c62828 25%, transparent 30%),
        radial-gradient(circle at 80% 20%, #e53935 0%, #c62828 25%, transparent 30%),
        /* 白色间隔 */
        #fff;
}

/* 外圈绿白相间 */
.ball-green .ball-inner {
    background: 
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 30%),
        radial-gradient(circle at 50% 50%, #fff 0%, #fff 45%, transparent 48%),
        radial-gradient(circle at 20% 20%, #43a047 0%, #2e7d32 30%, transparent 35%),
        radial-gradient(circle at 80% 80%, #43a047 0%, #2e7d32 30%, transparent 35%),
        radial-gradient(circle at 20% 80%, #43a047 0%, #2e7d32 25%, transparent 30%),
        radial-gradient(circle at 80% 20%, #43a047 0%, #2e7d32 25%, transparent 30%),
        #fff;
}

/* 外圈蓝白相间 */
.ball-blue .ball-inner {
    background: 
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 30%),
        radial-gradient(circle at 50% 50%, #fff 0%, #fff 45%, transparent 48%),
        radial-gradient(circle at 20% 20%, #1e88e5 0%, #1565c0 30%, transparent 35%),
        radial-gradient(circle at 80% 80%, #1e88e5 0%, #1565c0 30%, transparent 35%),
        radial-gradient(circle at 20% 80%, #1e88e5 0%, #1565c0 25%, transparent 30%),
        radial-gradient(circle at 80% 20%, #1e88e5 0%, #1565c0 25%, transparent 30%),
        #fff;
}

.ball-num {
    font-size: clamp(18px, 5vw, 28px);
    font-weight: bold;
    color: #000;
    z-index: 10;
    position: relative;
}

.ball-wrap .ball-attr {
    font-size: clamp(12px, 3vw, 16px);
    margin-top: 5px;
    color: #000;
    font-weight: 900;
    text-align: center;
}

.ball.special .ball-inner {
    /* 特码不加金边，保持和其他球一样 */
    box-shadow: 
        inset -5px -5px 10px rgba(0,0,0,0.3),
        inset 5px 5px 10px rgba(255,255,255,0.5),
        2px 2px 6px rgba(0,0,0,0.3);
}

/* 加号 */
.plus {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0 8px;
}

/* 刷新按钮 */
.refresh-btn {
    background: #ff9800;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.refresh-btn:hover {
    background: #f57c00;
}

/* 移动端适配 */
@media (max-width: 768px) {
    body {
        padding: 8px;
        min-width: 320px;
    }
    
    .row-1 {
        font-size: 10px;
        flex-wrap: nowrap;
        gap: 3px;
    }
    
    .period-num {
        font-size: 12px;
    }
    
    .countdown {
        font-size: 12px;
    }
    
    .history-link {
        font-size: 10px;
    }
    
    .row-2 {
        flex-wrap: nowrap;
        gap: 0;
        justify-content: space-between;
    }
    
    .ball-wrap {
        min-width: 36px;
        flex: 1;
    }
    
    .ball {
        width: 36px;
        height: 32px;
    }
    
    .ball-inner {
        width: 32px;
        height: 28px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    
    .ball-num {
        font-size: 12px;
    }
    
    .ball-attr {
        font-size: 7px;
        margin: 0 1px;
        line-height: 14px;
        height: 14px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        border-radius: 2px;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .plus {
        font-size: 10px;
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        align-self: center;
    }
    
    .row-3 {
        font-size: 10px;
        flex-wrap: nowrap;
        gap: 3px;
    }
    
    .refresh-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
}
