/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #fff;
    min-height: 100vh;
    color: #333;
}

/* 横幅样式 */
.banner {
    width: 100%;
    background: #fff;
    text-align: center;
}

.banner-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* 顶部导航栏 */
.header {
    background: #666;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 15px;
    height: 50px;
}

.logo h1 {
    color: #ffcc00;
    font-size: 18px;
    font-weight: 600;
}

.nav {
    display: flex;
    gap: 5px;
}

.nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.nav a:hover,
.nav a.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* 主内容区域 */
.main {
    max-width: 1200px;
    margin: 15px auto;
    padding: 0 15px;
}

/* 顶部信息栏 */
.top-section {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}

.left-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lottery-logo {
    width: 45px;
    height: 48px;
    flex-shrink: 0;
}

.period-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.current-period {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.current-period .label {
    color: #666;
    font-size: 13px;
}

.period-num {
    color: #ff6600;
    font-size: 20px;
    margin: 0 3px;
}

.period-select-wrapper {
    display: inline-block;
}

.period-select {
    padding: 5px 8px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    min-width: 120px;
    outline: none;
}

.period-select:focus {
    border-color: #ff6600;
}

.scratch-section {
    flex: 0 0 auto;
}

.scratch-btn {
    width: 50px;
    height: 50px;
    padding: 0;
    background: #ff6600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scratch-btn:hover {
    background: #e55a00;
}

/* 倒计时样式 */
.scratch-countdown,
.next-countdown {
    background: #fff;
    border-radius: 8px;
    padding: 12px 15px;
    text-align: center;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.countdown-label {
    color: #666;
    font-size: 14px;
}

.countdown-time {
    color: #ff6600;
    font-size: 18px;
    font-weight: bold;
    margin-left: 8px;
}

/* 最新开奖结果 */
.latest-result {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-left: 4px solid #ff6600;
}

.result-display {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}

.result-info {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.size-tag,
.odd-even-tag {
    padding: 5px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
}

.size-tag {
    background: #ff6600;
    color: #fff;
}

.odd-even-tag {
    background: #333;
    color: #fff;
}

/* 功能切换标签 */
.tab-section {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tab-nav {
    display: flex;
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    min-width: 0;
    padding: 12px 8px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    white-space: nowrap;
}

.tab-btn:hover {
    background: #eee;
    color: #333;
}

.tab-btn.active {
    color: #ff6600;
    background: #fff;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    right: 25%;
    height: 3px;
    background: #ff6600;
}

.tab-panel {
    display: none;
    padding: 15px;
    max-height: 500px;
    overflow-x: auto;
    overflow-y: auto;
}

.tab-panel.active {
    display: block;
}

/* 数据表格 */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 10px 6px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.data-table th {
    background: #f8f8f8;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}

/* 斜马纹表格 - 奇数行白色，偶数行浅灰色 */
.data-table tbody tr:nth-child(odd) {
    background: #fff;
}

.data-table tbody tr:nth-child(even) {
    background: #f5f5f5;
}

.data-table tbody tr:hover {
    background: #e8e8e8;
}

.data-table td {
    font-size: 13px;
}

/* 待开奖行样式 */
.pending-row {
    background: #fffde7 !important;
}

.pending-row td {
    color: #ff6600;
}

.pending-link {
    color: #2196F3;
    text-decoration: none;
    font-weight: bold;
}

.pending-link:hover {
    text-decoration: underline;
}

/* 走势表格特殊样式 */
.trend-table {
    width: max-content;
    min-width: 100%;
}

.trend-table th,
.trend-table td {
    padding: 8px 4px;
    white-space: nowrap;
}

.trend-table td {
    font-weight: bold;
}

/* 走势标签样式 */
.trend-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    min-width: 28px;
}

.trend-tag.big {
    background: #ff6600;
    color: #fff;
}

.trend-tag.small {
    background: #2196F3;
    color: #fff;
}

.trend-tag.odd {
    background: #e91e63;
    color: #fff;
}

.trend-tag.even {
    background: #4CAF50;
    color: #fff;
}

.trend-tag.big-odd {
    background: #ff5722;
    color: #fff;
}

.trend-tag.big-even {
    background: #9c27b0;
    color: #fff;
}

.trend-tag.small-odd {
    background: #00bcd4;
    color: #fff;
}

.trend-tag.small-even {
    background: #607d8b;
    color: #fff;
}

/* 统计表格 */
.stats-table td {
    padding: 8px;
}

.stats-table td:nth-child(2),
.stats-table td:nth-child(4) {
    color: #ff6600;
    font-weight: bold;
}

/* 刮刮卡弹窗 */
.scratch-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.scratch-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 100;
}

.modal-close:hover {
    color: #333;
}

/* 刮刮卡容器 */
.scratch-card-container {
    text-align: center;
    width: 280px;
    margin: 0 auto;
}

/* 第1行：刮刮卡底图 + 期号背景叠加 */
.row-top {
    position: relative;
    width: 100%;
}

.row-top .img-base {
    width: 100%;
    display: block;
}

.period-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
}

.period-overlay img {
    width: 100%;
    display: block;
}

.period-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    white-space: nowrap;
}

/* 第2行：图层背景 + 开奖号码 + Canvas只覆盖这里 */
.row-scratch-area {
    position: relative;
    width: 100%;
}

.row-scratch-area .img-layer-bg {
    width: 100%;
    display: block;
}

.result-reveal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

.number-balls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.scratch-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    z-index: 10;
    touch-action: none;
}

/* 底部：挂挂卡下层 + 倒计时 */
.row-bottom {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
}

.row-bottom img {
    width: 100%;
    display: block;
}

.countdown-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.ball {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    border: 2px solid #ff6600;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #ff6600;
}

.ball.sum {
    background: #ff6600;
    color: #fff;
    width: 38px;
    height: 38px;
    font-size: 16px;
}

.operator {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.reset-scratch {
    padding: 10px 20px;
    background: #ff6600;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.reset-scratch:hover {
    background: #e55a00;
}

/* 底部版权 */
.footer {
    background: #333;
    padding: 20px 15px;
    margin-top: 30px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer p {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

/* 加载动画 */
.loading {
    color: #999;
    font-size: 16px;
}

/* 响应式设计 - 手机端优化 */
@media (max-width: 768px) {
    .header-inner {
        padding: 0 10px;
        height: 45px;
    }
    
    .logo h1 {
        font-size: 16px;
    }
    
    .nav {
        display: none;
    }
    
    .main {
        padding: 0 10px;
        margin: 10px auto;
    }
    
    .top-section {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 8px;
        flex-wrap: nowrap;
        gap: 6px;
    }
    
    .left-section {
        display: flex;
        flex-direction: row;
        align-items: center;
        flex: 1;
        min-width: 0;
        gap: 6px;
    }
    
    .scratch-section {
        flex: 0 0 auto;
    }
    
    .lottery-logo {
        width: 28px;
        height: 30px;
        flex-shrink: 0;
    }
    
    .period-info {
        flex: 1;
        min-width: 0;
        gap: 2px;
    }
    
    .current-period {
        font-size: 11px;
    }
    
    .current-period .label {
        font-size: 10px;
    }
    
    .period-num {
        font-size: 12px;
    }
    
    .period-select {
        min-width: 70px;
        max-width: 90px;
        font-size: 10px;
        padding: 3px 4px;
    }
    
    .scratch-btn {
        width: 36px;
        height: 36px;
        font-size: 11px;
        border-radius: 6px;
    }
    
    .scratch-countdown,
    .next-countdown {
        padding: 10px 12px;
        margin-bottom: 10px;
    }
    
    .countdown-label {
        font-size: 13px;
    }
    
    .countdown-time {
        font-size: 16px;
    }
    
    .latest-result {
        padding: 15px;
    }
    
    .result-display {
        font-size: 24px;
        margin-bottom: 10px;
    }
    
    .size-tag,
    .odd-even-tag {
        padding: 4px 12px;
        font-size: 12px;
    }
    
    .tab-btn {
        flex: 1 1 0;
        padding: 8px 2px;
        font-size: 12px;
        min-width: 0;
        white-space: nowrap;
    }
    
    .tab-nav {
        display: flex;
        flex-wrap: nowrap;
        width: 100%;
    }
    
    .tab-panel {
        padding: 10px;
        max-height: 400px;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    /* 走势表格手机端滚动 */
    .trend-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .modal-content {
        padding: 20px 15px;
        width: 95%;
    }
    
    .scratch-card {
        width: 260px;
        height: 170px;
    }
    
    .period-bg img {
        max-width: 260px;
    }
    
    .footer {
        padding: 15px 10px;
        margin-top: 20px;
    }
    
    .footer p {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .top-section {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 6px;
        flex-wrap: nowrap;
        gap: 4px;
    }
    
    .left-section {
        display: flex;
        flex-direction: row;
        align-items: center;
        flex: 1;
        min-width: 0;
        gap: 4px;
    }
    
    .scratch-section {
        flex: 0 0 auto;
    }
    
    .lottery-logo {
        width: 24px;
        height: 26px;
    }
    
    .period-info {
        flex: 1;
        min-width: 0;
    }
    
    .current-period {
        font-size: 10px;
    }
    
    .current-period .label {
        font-size: 9px;
    }
    
    .period-num {
        font-size: 11px;
    }
    
    .period-select {
        min-width: 60px;
        max-width: 75px;
        font-size: 9px;
        padding: 2px 3px;
    }
    
    .scratch-btn {
        width: 32px;
        height: 32px;
        font-size: 10px;
        border-radius: 5px;
    }
    
    .tab-btn {
        flex: 1 1 0;
        padding: 6px 1px;
        font-size: 11px;
        min-width: 0;
    }
    
    .tab-nav {
        display: flex;
        flex-wrap: nowrap;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}
