/* ========== 历史开奖表格（图2） ========== */
#recent-history-section .hist-table-wrap,
.history-page .hist-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e0e0e0;
    border-radius: 0;
    background: #ffffff;
    margin-top: 4px;
    display: flex;
    justify-content: center;
}

#recent-history-section .hist-table,
.history-page .hist-table {
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    border-collapse: collapse;
    font-size: 14px;
    background: #ffffff;
    table-layout: auto;
}

#recent-history-section .hist-table thead th,
.history-page .hist-table thead th {
    background: #f5f5f5 !important;
    color: #333333 !important;
    font-weight: 600;
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
}

#recent-history-section .hist-table tbody td,
.history-page .hist-table tbody td {
    padding: 5px 8px;
    border-bottom: 1px solid #eeeeee;
    vertical-align: middle;
    background: #ffffff;
    color: #333333;
    text-align: center;
}

#recent-history-section .section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

#recent-history-section .section-title-row .section-title {
    margin-bottom: 0;
}

#recent-history-section .hist-table tbody tr:hover td,
.history-page .hist-table tbody tr:hover td {
    background: #fafafa;
}

#recent-history-section .hist-table .col-issue,
.history-page .hist-table .col-issue {
    width: auto;
    white-space: nowrap;
    color: #333333 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

#recent-history-section .hist-table .col-issue .issue-num,
.history-page .hist-table .col-issue .issue-num {
    color: #e74c3c !important;
    font-weight: bold;
}

.hist-date-mobile,
.hist-issue-mobile,
.hist-draw-time-mobile,
.hist-datetime-mobile {
    display: none;
}

#recent-history-section .hist-table .col-time,
.history-page .hist-table .col-time {
    width: auto;
    color: #666666 !important;
    white-space: nowrap;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

#recent-history-section .hist-table .col-numbers,
.history-page .hist-table .col-numbers {
    width: 1%;
    min-width: 0;
    white-space: nowrap;
    padding-left: 12px !important;
    padding-right: 12px !important;
}

/* 横向排列色块，禁止竖排 */
#recent-history-section .hist-balls,
.history-page .hist-balls {
    display: inline-flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 8px !important;
    width: auto !important;
    max-width: 100%;
    margin: 0 auto !important;
}

#recent-history-section .hist-ball-wrap,
.history-page .hist-ball-wrap {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: center !important;
    flex-shrink: 0;
    gap: 2px;
    width: auto !important;
}

#recent-history-section .hist-ball,
.history-page .hist-ball {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 1 !important;
    text-align: center !important;
    font-size: 15px !important;
    font-weight: bold !important;
}

#recent-history-section .hist-zodiac,
.history-page .hist-zodiac {
    font-size: 13px !important;
    color: #444444 !important;
    line-height: 1.1;
    text-align: center;
    min-height: 0;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

#recent-history-section .hist-plus,
.history-page .hist-plus {
    font-size: 22px !important;
    font-weight: bold !important;
    color: #333333 !important;
    line-height: 36px !important;
    margin: 0 4px !important;
    flex-shrink: 0;
}

/* ========== 推荐特码 & 多板块：紧凑居中表格 ========== */
#recommend-section .recommend-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

#recommend-section .recommend-item {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#recommend-section .rec-issue-header.rec-issue-outside {
    text-align: center !important;
    padding: 2px 6px 4px !important;
    background-color: transparent !important;
    border-bottom: none !important;
}

.multi-panel-section .rec-issue-header {
    text-align: center !important;
    padding: 4px 6px !important;
    background-color: #ffffff !important;
    border-bottom: 1px solid #008800 !important;
}

.multi-panel-section .rec-issue-header.multi-panel-issue {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    max-width: 88px;
    padding: 4px 6px !important;
    border-bottom: none !important;
    border-right: 1px solid #008800 !important;
    text-align: center !important;
    white-space: normal;
    word-break: break-all;
    line-height: 1.2 !important;
}

.multi-panel-section .rec-issue-cell {
    width: 1%;
    white-space: nowrap !important;
    word-break: keep-all;
    vertical-align: middle !important;
    text-align: center !important;
    padding: 3px 10px !important;
    line-height: 1.2 !important;
    background-color: #ffffff !important;
    border: 1px solid #008800 !important;
}

.multi-panel-section .rec-issue-cell .rec-issue-text {
    display: inline-block;
    white-space: nowrap !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
}

.multi-panel-section .recommend-panel.multi-panel-card {
    border: 2px solid #008800 !important;
    overflow: hidden;
}

.multi-panel-section .multi-panel-grid {
    width: 100%;
    border-collapse: collapse;
    border: none !important;
    margin: 0;
}

.multi-panel-section .multi-panel-grid .rec-cell {
    border: 1px solid #008800 !important;
}

#recommend-section .rec-issue-header span,
.multi-panel-section .rec-issue-header span {
    color: inherit !important;
    font-weight: bold !important;
    font-size: 15px !important;
    line-height: 1.25 !important;
}

.rec-issue-text {
    color: #000000 !important;
    font-size: 15px !important;
    font-weight: bold !important;
}

.rec-issue-num {
    color: #e74c3c !important;
    font-weight: bold !important;
}

#recommend-section .recommend-panel,
.multi-panel-section .recommend-panel {
    background-color: #ffffff !important;
    border: 2px solid #008800 !important;
    overflow: hidden;
}

#recommend-section .rec-grid,
.multi-panel-section .rec-grid {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff !important;
    border: 1px solid #008800;
}

#recommend-section .rec-grid td,
.multi-panel-section .rec-grid td {
    border: 1px solid #008800 !important;
    padding: 3px 5px !important;
    vertical-align: middle;
    background-color: #ffffff !important;
    text-align: center !important;
    line-height: 1.25 !important;
}

#recommend-section .rec-grid td {
    width: 50%;
}

#recommend-section .rec-label,
#recommend-section .rec-value,
.multi-panel-section .rec-label,
.multi-panel-section .rec-value {
    color: #008800 !important;
    font-weight: bold !important;
    font-size: 13px !important;
    margin-right: 0;
}

#recommend-section .rec-value,
.multi-panel-section .rec-value {
    color: #ff0000 !important;
    letter-spacing: 0;
}

#recommend-section tr.rec-row-hit .rec-label,
#recommend-section .rec-cell.rec-cell-hit .rec-label,
.multi-panel-section tr.rec-row-hit .rec-label {
    color: #004d00 !important;
}

#recommend-section tr.rec-row-hit .rec-value,
#recommend-section .rec-cell.rec-cell-hit .rec-value,
.multi-panel-section tr.rec-row-hit .rec-value {
    color: #b30000 !important;
}

.rec-row-win-mark {
    color: #004d00;
    font-weight: bold;
    white-space: nowrap;
}

.rec-num-hit,
.rec-code-num.is-hit,
#recommend-section .rec-num-hit,
.recommend-panel .rec-num-hit,
.multi-panel-section .rec-value .rec-num-hit {
    display: inline-block;
    background: #ffff00 !important;
    background-color: #ffff00 !important;
    color: #000000 !important;
    font-weight: bold;
    padding: 0 2px;
    border-radius: 2px;
    line-height: 1.25;
}

#recommend-section .rec-footer,
.multi-panel-section .rec-footer {
    text-align: center !important;
    padding: 3px 6px !important;
    border-top: 1px solid #008800 !important;
    background-color: #ffffff !important;
    font-size: 13px !important;
    line-height: 1.3;
}

#recommend-section .rec-footer .rec-text {
    color: #008800 !important;
    font-weight: bold !important;
}

#recommend-section .rec-footer .rec-highlight {
    color: #ff0000 !important;
    font-weight: bold !important;
    font-size: 1.05em !important;
}

#recommend-section .section-title,
.multi-panel-section .section-title {
    color: #333333;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 3px;
    text-align: center;
}

#recommend-section .section-title::before,
#recommend-section .section-title::after,
.multi-panel-section .section-title::before,
.multi-panel-section .section-title::after {
    content: '★★★';
    color: #f5c518;
    font-size: 13px;
    letter-spacing: 1px;
}

#recommend-section .section-title::before,
.multi-panel-section .section-title::before {
    margin-right: 4px;
}

#recommend-section .section-title::after,
.multi-panel-section .section-title::after {
    margin-left: 4px;
}

.caishen-images-section {
    scroll-margin-top: 6px;
    margin-top: 8px;
    padding-top: 4px;
}

.caishen-images-section .section-title {
    color: #333333;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 3px;
    text-align: center;
}

.caishen-images-section .section-title::before,
.caishen-images-section .section-title::after {
    content: '★★★';
    color: #f5c518;
    font-size: 13px;
    letter-spacing: 1px;
}

.caishen-images-section .section-title::before {
    margin-right: 4px;
}

.caishen-images-section .section-title::after {
    margin-left: 4px;
}

.multi-panel-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* 历史特码推荐记录 */
#recommend-history-section {
    margin-top: 8px;
}

.rec-history-wrap {
    border: 1px solid #cccccc;
    background: #ffffff;
    overflow: hidden;
}

.rec-history-banner {
    background: linear-gradient(180deg, #d4ebff 0%, #a8d4f5 100%);
    color: #cc0000;
    font-weight: bold;
    font-size: 15px;
    text-align: center;
    padding: 6px 8px;
    border-bottom: 1px solid #99ccee;
}

.rec-history-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.rec-history-table td {
    border: 1px solid #dddddd;
    padding: 4px 6px;
    vertical-align: middle;
    font-size: 13px;
    line-height: 1.45;
}

.rec-history-issue {
    width: 88px;
    white-space: nowrap;
    color: #333333;
    text-align: center;
    background: #fafafa;
}

.rec-history-codes {
    color: #0066cc;
    word-break: break-all;
}

.rec-code-sep {
    color: #0066cc;
    margin: 0 1px;
}

.rec-code-num {
    display: inline-block;
    color: #0066cc;
    font-weight: bold;
    padding: 0 2px;
    line-height: 1.4;
}

.rec-history-footer {
    text-align: center;
    color: #cc0000;
    font-size: 12px;
    padding: 4px 6px;
    border-top: 1px solid #dddddd;
    background: #ffffff;
}

@media (max-width: 768px) {
    #recent-history-section .hist-table-wrap,
    .history-page .hist-table-wrap {
        margin-left: 0;
        margin-right: 0;
        justify-content: stretch;
    }

    #recent-history-section .hist-table,
    .history-page .hist-table {
        width: 100%;
        max-width: 100%;
    }

    /* 手机端：隐藏表头，左侧日期+期号，右侧号码 */
    #recent-history-section .hist-table thead,
    .history-page .hist-table thead {
        display: none !important;
    }

    .hist-date-desktop,
    .hist-issue-desktop {
        display: none !important;
    }

    .hist-issue-mobile,
    .hist-datetime-mobile {
        display: block !important;
    }

    #recent-history-section .hist-table tbody tr.hist-row,
    .history-page .hist-table tbody tr.hist-row {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: auto auto;
        column-gap: 6px;
        row-gap: 0;
        align-items: center;
        padding: 4px 2px !important;
        border-bottom: 1px solid #eeeeee !important;
        text-align: left !important;
    }

    #recent-history-section .hist-table tbody tr.hist-row:last-child,
    .history-page .hist-table tbody tr.hist-row:last-child {
        border-bottom: none !important;
    }

    #recent-history-section .hist-table tbody td,
    .history-page .hist-table tbody td {
        display: block !important;
        padding: 0 !important;
        border: none !important;
        background: #ffffff !important;
    }

    #recent-history-section .hist-table .col-issue,
    .history-page .hist-table .col-issue {
        grid-column: 1;
        grid-row: 1;
        width: auto !important;
        min-width: 0 !important;
        text-align: left !important;
        padding-top: 0 !important;
    }

    #recent-history-section .hist-table .col-time,
    .history-page .hist-table .col-time {
        grid-column: 1;
        grid-row: 2;
        width: auto !important;
        min-width: 0 !important;
        text-align: left !important;
        padding-top: 2px !important;
    }

    #recent-history-section .hist-table .col-numbers,
    .history-page .hist-table .col-numbers {
        grid-column: 2;
        grid-row: 1 / span 2;
        width: auto !important;
        min-width: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        text-align: left !important;
        align-self: center;
    }

    .hist-datetime-mobile {
        font-size: 11px !important;
        color: #666666 !important;
        line-height: 1.15 !important;
        white-space: nowrap;
    }

    .hist-issue-mobile {
        font-size: clamp(11px, 3vw, 13px) !important;
        line-height: 1.15 !important;
        color: #333333 !important;
        white-space: nowrap;
    }

    .hist-issue-mobile .issue-num {
        color: #e74c3c !important;
        font-weight: bold !important;
    }

    /* 历史号码：球与生肖紧凑，靠右填满 */
    #recent-history-section .hist-balls,
    .history-page .hist-balls {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: flex-end !important;
        gap: 4px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        padding-bottom: 0 !important;
        width: 100%;
    }

    #recent-history-section .hist-ball-wrap,
    .history-page .hist-ball-wrap {
        gap: 1px !important;
    }

    #recent-history-section .hist-ball,
    .history-page .hist-ball {
        width: clamp(28px, 7.5vw, 34px) !important;
        height: clamp(28px, 7.5vw, 34px) !important;
        font-size: clamp(12px, 3.5vw, 14px) !important;
    }

    #recent-history-section .hist-plus,
    .history-page .hist-plus {
        font-size: clamp(14px, 4vw, 17px) !important;
        line-height: 1 !important;
        margin: 0 1px 2px !important;
        align-self: flex-end !important;
        padding-bottom: clamp(13px, 3.6vw, 15px) !important;
    }

    #recent-history-section .hist-zodiac,
    .history-page .hist-zodiac {
        font-size: clamp(12px, 3.3vw, 14px) !important;
        line-height: 1.05 !important;
        color: #444444 !important;
        min-height: 0 !important;
        margin-top: 0 !important;
    }

    #recent-history-section .hist-table thead th,
    #recent-history-section .hist-table tbody td,
    .history-page .hist-table thead th,
    .history-page .hist-table tbody td {
        font-size: 13px !important;
    }

    /* 推荐区：手机端先九肖→六肖→三肖，再24码→12码→6码 */
    #recommend-section .rec-grid {
        display: block !important;
        width: 100% !important;
    }

    #recommend-section .rec-grid tbody {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    #recommend-section .rec-grid tr {
        display: contents !important;
    }

    #recommend-section .rec-grid td {
        display: block !important;
        width: 100% !important;
        border-left: none !important;
        border-right: none !important;
        border-top: none !important;
        border-bottom: 1px solid #999999 !important;
        padding: 4px 6px !important;
        box-sizing: border-box !important;
        text-align: center !important;
    }

    #recommend-section .rec-grid tr:nth-child(1) td.rec-zodiac { order: 1; }
    #recommend-section .rec-grid tr:nth-child(2) td.rec-zodiac { order: 2; }
    #recommend-section .rec-grid tr:nth-child(3) td.rec-zodiac { order: 3; }
    #recommend-section .rec-grid tr:nth-child(1) td.rec-code { order: 4; }
    #recommend-section .rec-grid tr:nth-child(2) td.rec-code { order: 5; }
    #recommend-section .rec-grid tr:nth-child(3) td.rec-code {
        order: 6;
        border-bottom: none !important;
    }

    #recommend-section .rec-label,
    #recommend-section .rec-value {
        font-size: 13px !important;
    }

    #recommend-section .rec-value {
        word-break: break-all;
    }

    #recommend-section .rec-footer {
        font-size: 13px !important;
        padding: 4px 8px !important;
    }

    .rec-history-banner {
        font-size: clamp(13px, 3.8vw, 15px);
        padding: 5px 4px;
    }

    .rec-history-issue {
        width: 72px;
        font-size: 12px;
        padding: 4px 3px !important;
    }

    .rec-history-codes {
        font-size: clamp(11px, 3.2vw, 14px);
        padding: 4px 6px !important;
    }

    .rec-history-footer {
        font-size: 12px;
    }

    .multi-panel-section .rec-issue-cell {
        padding: 3px 8px !important;
    }

    .multi-panel-section .rec-issue-cell .rec-issue-text {
        font-size: 13px !important;
    }
}

/* ========== 多板块推荐导航 ========== */
.multi-panel-nav-wrap {
    background: #fff;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    padding: 4px 0;
    margin: 6px 0 4px;
}

.multi-panel-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
}

.multi-panel-nav-item {
    display: block;
    text-align: center;
    padding: 5px 2px;
    background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #ced4da;
    border-radius: 6px;
    color: #2c3e50;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.25;
}

.multi-panel-nav-item:hover,
.multi-panel-nav-item.is-active {
    background: linear-gradient(180deg, #2ecc71 0%, #27ae60 100%);
    border-color: #27ae60;
    color: #fff;
}

.multi-panel-section {
    scroll-margin-top: 6px;
}

.multi-panel-empty {
    color: #999;
    font-size: 13px;
    padding: 4px 0;
}

.multi-panel-section .recommend-panel.multi-panel-card {
    background-color: #ffffff !important;
    border: 2px solid #008800 !important;
    color: #333333 !important;
    overflow: hidden;
}

.multi-panel-section .rec-footer .rec-text {
    color: #008800 !important;
    font-weight: bold !important;
    font-size: 13px !important;
}

@media (max-width: 600px) {
    .multi-panel-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2px;
    }

    .multi-panel-nav-item {
        font-size: 11px;
        padding: 4px 1px;
    }

    .multi-panel-nav-wrap {
        padding: 3px 0;
        margin: 4px 0 3px;
    }
}
