/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    overflow: auto;
    -webkit-overflow-scrolling: auto;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

body.prize-modal-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ========== Header ========== */
.header {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: #fff;
    padding: 1rem 1rem;
    text-align: center;
    position: relative;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header h1 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.back-btn {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ========== 分享按钮 ========== */
.share-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    cursor: pointer;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.share-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.share-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ========== 分享面板 ========== */
.share-panel-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.share-panel-overlay.active {
    display: flex;
}

.share-panel {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    width: 90%;
    max-width: 340px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: sharePanelIn 0.25s ease-out;
}

@keyframes sharePanelIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.share-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.share-panel-header h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #222;
}

.share-panel-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #999;
    cursor: pointer;
    padding: 0.2rem;
    line-height: 1;
}

.share-panel-close:hover {
    color: #333;
}

.share-platforms {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.share-platform-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.share-platform-item:hover {
    transform: translateY(-2px);
}

.share-platform-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
}

.share-platform-icon.wechat { background: #07c160; }
.share-platform-icon.qq { background: #1296db; }
.share-platform-icon.weibo { background: #e6162d; }
.share-platform-icon.copy { background: #999; }

.share-platform-item span {
    font-size: 0.8rem;
    color: #666;
}

.share-url-box {
    background: #f5f5f5;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
    color: #666;
    word-break: break-all;
    text-align: center;
}

/* ========== 温馨提示弹窗 ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-dialog {
    background: #fff;
    border-radius: 16px;
    padding: 2rem 1.5rem 1.5rem;
    width: 85%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.85);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #222;
    margin-bottom: 1rem;
}

.modal-body {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.modal-body strong {
    color: #d32f2f;
}

.modal-btn {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: #fff;
    border: none;
    border-radius: 25px;
    padding: 0.65rem 2.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.35);
    transition: all 0.2s;
}

.modal-btn:hover {
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.45);
    transform: translateY(-1px);
}

/* ========== Footer ========== */
.toast {
    position: fixed;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.footer {
    text-align: center;
    padding: 1.25rem;
    color: #999;
    font-size: 0.8rem;
    margin-top: auto;
    background-color: #f5f5f5;
}

/* ========== Tab 导航 ========== */
.tabs {
    display: flex;
    overflow-x: auto;
    background-color: #fff;
    padding: 0 0.5rem;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 48px;
    z-index: 99;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab-item {
    padding: 0.75rem 0.85rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: #666;
    border-bottom: 2.5px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.tab-item:hover {
    color: #d32f2f;
}

.tab-item.active {
    color: #d32f2f;
    border-bottom-color: #d32f2f;
    font-weight: 600;
}

.tab-divider {
    width: 1px;
    background-color: #e0e0e0;
    margin: 0.4rem 0.25rem;
    align-self: stretch;
    flex-shrink: 0;
}

.tab-link {
    padding: 0.75rem 0.85rem;
    font-size: 0.95rem;
    color: #666;
    text-decoration: none;
    border-bottom: 2.5px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.2s;
}

.tab-link:hover {
    color: #d32f2f;
}

.tab-link.active {
    color: #1565c0;
    border-bottom-color: #1565c0;
    font-weight: 600;
}

/* ========== Loading ========== */

/* ========== 子 Tab（历史开奖/号码比对） ========== */
.sub-tabs {
    position: relative;
    top: auto;
    border-bottom: none;
    border-top: 1px solid #eee;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    justify-content: center;
}
.loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
    font-size: 0.95rem;
}

.loading.compact {
    padding: 1rem;
}

/* ========== 首页 - 卡片容器 ========== */
.container {
    padding: 1rem;
    flex: 1;
}

#latestResultsContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ========== 首页 - 彩票卡片 ========== */
.lottery-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
}

.lottery-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #222;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.card-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 1rem;
}

.card-title-info {
    margin-bottom: 0;
    gap: 0.5rem;
    font-weight: 400;
}

.card-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    justify-content: center;
    min-height: 2.4rem;
}

.prize-summary {
    border-top: 1px solid #f4f4f4;
    padding-top: 0.75rem;
    margin-bottom: 0.85rem;
}

.prize-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
    color: #555;
    font-size: 0.85rem;
    font-weight: 600;
}

.prize-more-btn {
    border: none;
    background: #fff7ed;
    color: #c2410c;
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
}

.prize-more-btn:hover {
    background: #fed7aa;
}

.prize-list {
    display: grid;
    gap: 0.35rem;
}

.prize-list.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.prize-row {
    display: grid;
    grid-template-columns: minmax(4.5rem, 1fr) auto auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.42rem 0.55rem;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fafafa;
    font-size: 0.8rem;
    color: #666;
    min-width: 0;
}

.prize-list.compact .prize-row {
    grid-template-columns: minmax(3.2rem, 1fr) auto;
    gap: 0.35rem;
}

.prize-list.compact .prize-row span:nth-child(2) {
    display: none;
}

.prize-row strong {
    color: #d32f2f;
    font-size: 0.82rem;
    white-space: nowrap;
}

.prize-level {
    color: #333;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prize-empty {
    color: #999;
    background: #fafafa;
    border: 1px dashed #e0e0e0;
    border-radius: 8px;
    padding: 0.6rem;
    text-align: center;
    font-size: 0.82rem;
}

.prize-empty.large {
    padding: 2rem 1rem;
}

.card-footer {
    margin-top: auto;
    border-top: 1px solid #f0f0f0;
    padding-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.prize-day {
    font-size: 0.8rem;
    color: #aaa;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.action-btn {
    background-color: #f5f5f5;
    color: #555;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.2s;
    border: 1px solid #eee;
}

.action-btn:hover {
    background-color: #d32f2f;
    color: #fff;
    border-color: #d32f2f;
}

.notice-btn {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.notice-btn:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.prize-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: hidden;
    overscroll-behavior: contain;
}

.prize-modal-overlay.active {
    display: flex;
}

.prize-modal-dialog {
    position: relative;
    z-index: 20001;
    width: min(560px, 100%);
    max-height: min(76vh, 680px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: modalIn 0.25s ease-out;
}

.prize-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid #f0f0f0;
}

.prize-modal-title {
    font-size: 1.05rem;
    color: #222;
    margin: 0 0 0.2rem;
}

.prize-modal-meta {
    margin: 0;
    color: #888;
    font-size: 0.82rem;
}

.prize-modal-close {
    border: none;
    background: #f5f5f5;
    color: #777;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
}

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

.prize-modal-body {
    padding: 1rem 1.1rem 1.1rem;
    max-height: calc(min(76vh, 680px) - 74px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.prize-list.full .prize-row {
    grid-template-columns: minmax(6rem, 1fr) minmax(5rem, auto) minmax(5rem, auto);
    padding: 0.55rem 0.7rem;
    font-size: 0.86rem;
}

/* ========== 球样式 ========== */
.ball {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.ball.red { background: linear-gradient(145deg, #ef5350, #c62828); }
.ball.blue { background: linear-gradient(145deg, #42a5f5, #1565c0); }

.ball-small {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #fff;
    margin: 0.1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.ball-small.red { background: linear-gradient(145deg, #ef5350, #c62828); }
.ball-small.blue { background: linear-gradient(145deg, #42a5f5, #1565c0); }

.ball-small.active {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #ff9800;
}

/* ========== 号码选择器 (比对页) ========== */
.selector-section {
    background: #fff;
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.selector-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
}

.ball-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.ball-section-label {
    flex: 0 0 100%;
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    margin: 0.1rem 0 0.15rem;
}

.ball-selectable {
    width: 2.2rem;
    height: 2.2rem;
    border: 1.5px solid #e0e0e0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.15s;
    color: #555;
    background: #fafafa;
    user-select: none;
    -webkit-user-select: none;
}

.ball-selectable:hover {
    border-color: #bbb;
    background: #f0f0f0;
}

.ball-selectable.disabled {
    cursor: not-allowed;
    color: #bbb;
    background: #f3f3f3;
    border-color: #e5e5e5;
}

.ball-selectable.disabled:hover {
    background: #f3f3f3;
    border-color: #e5e5e5;
}

.ball-selectable.red.active {
    background-color: #d32f2f;
    color: #fff;
    border-color: #d32f2f;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.35);
}

.ball-selectable.blue.active {
    background-color: #1976d2;
    color: #fff;
    border-color: #1976d2;
    box-shadow: 0 2px 6px rgba(25, 118, 210, 0.35);
}

.ball-group {
    margin-bottom: 0.75rem;
}

.ball-group > div:first-child {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.ball-grid-small {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.ball-grid-small .ball-selectable {
    width: 2rem;
    height: 2rem;
    font-size: 0.85rem;
}

/* ========== 按钮 ========== */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: #fff;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.3);
}

.btn:hover {
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.4);
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn.secondary {
    background: #f0f0f0;
    color: #555;
    box-shadow: none;
    border: 1px solid #ddd;
}

.btn.secondary:hover {
    background: #e8e8e8;
    box-shadow: none;
    transform: none;
}

.submit-section {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

/* ========== 比对结果卡片 ========== */
.results-list {
    max-width: 800px;
    margin: 0 auto;
}

.results-list h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #333;
}

.result-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: box-shadow 0.2s;
}

.result-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.result-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #555;
}

.result-card .card-numbers {
    margin-bottom: 0;
}

.prize-label {
    background-color: #fff8e1;
    color: #f57f17;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
}

.result-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

/* ========== 历史页 - 过滤栏 ========== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    background: #fff;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #555;
    flex-shrink: 0;
}

.filter-item label {
    white-space: nowrap;
}

.filter-item input,
.filter-item select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    width: 110px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
}

.filter-item select {
    width: auto;
    min-width: 86px;
    color: #333;
}

.filter-item input:focus,
.filter-item select:focus {
    border-color: #d32f2f;
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.1);
    background: #fff;
}

.filter-bar .btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.filter-bar .btn-sm:not(.secondary) {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: #fff;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.3);
}

.filter-bar .btn-sm:not(.secondary):hover {
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.4);
    transform: translateY(-1px);
}

.filter-bar .btn-sm.secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
    box-shadow: none;
}

.filter-bar .btn-sm.secondary:hover {
    background: #eee;
}

.filter-bar .btn-sm.copy {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
    box-shadow: none;
}

.filter-bar .btn-sm.copy:hover {
    background: #c8e6c9;
}

/* ========== 历史页 - 分析 ========== */
.analysis-panel {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 1rem;
    margin-bottom: 0.75rem;
}

.analysis-head {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: center;
    color: #777;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.analysis-head div {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.analysis-head strong {
    color: #222;
    font-size: 1rem;
}

.analysis-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.statistics-main .analysis-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.analysis-card {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 0.7rem;
    min-width: 0;
}

.analysis-card span {
    display: block;
    color: #888;
    font-size: 0.75rem;
    margin-bottom: 0.2rem;
}

.analysis-card strong {
    color: #222;
    font-size: 1.05rem;
}

.statistics-main .analysis-card {
    border-radius: 6px;
    padding: 0.38rem 0.35rem;
    text-align: center;
}

.statistics-main .analysis-card span {
    font-size: 0.68rem;
    line-height: 1.1;
    margin-bottom: 0.08rem;
    white-space: nowrap;
}

.statistics-main .analysis-card strong {
    display: block;
    font-size: 0.9rem;
    line-height: 1.15;
}

.trend-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}

.trend-section h4 {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.4rem;
}

.trend-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.trend-ball {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: #f7f7f7;
    border: 1px solid #eee;
    font-size: 0.78rem;
}

.trend-ball b {
    color: #d32f2f;
}

.trend-ball em {
    color: #777;
    font-style: normal;
}

.trend-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
    color: #777;
    font-size: 0.8rem;
}

.trend-meta span {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
}

.page-size-selector {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

.page-size-selector select {
    padding: 0.3rem 0.3rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.8rem;
    background: #fff;
    color: #333;
    outline: none;
}

/* ========== 历史页 - 表格 ========== */
.history-main {
    max-width: 960px;
    margin: 0 auto;
}

.table-wrapper {
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    -webkit-overflow-scrolling: touch;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.history-table th, .history-table td {
    padding: 0.75rem 0.6rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
    white-space: nowrap;
}

.history-table th {
    background-color: #fafafa;
    color: #666;
    font-weight: 600;
    font-size: 0.85rem;
    position: sticky;
    top: 0;
}

.history-table tbody tr:hover {
    background-color: #fafafa;
}

.history-card-list {
    display: none;
}

.statistics-main .history-card-list {
    display: block;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin: 0.9rem 0 0.55rem;
    color: #777;
    font-size: 0.85rem;
}

.section-title-row h2 {
    color: #222;
    font-size: 1rem;
    margin: 0;
}

.history-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    padding: 0.85rem;
}

.history-card + .history-card {
    margin-top: 0.6rem;
}

.history-card-head {
    display: flex;
    justify-content: space-between;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.55rem;
    font-size: 0.85rem;
}

.history-card-head span {
    color: #888;
    white-space: nowrap;
}

.history-card-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
    min-width: 0;
    overflow: visible;
}

.history-card-metrics span {
    flex: 0 0 auto;
    background: #f7f7f7;
    color: #555;
    border: 1px solid #eee;
    border-radius: 999px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* ========== 走势图 ========== */
.trend-main {
    max-width: 1120px;
}

.trend-filter-bar {
    margin-bottom: 0.6rem;
}

.trend-mode-bar {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 0.55rem;
    margin-bottom: 0.75rem;
}

.trend-mode {
    flex: 0 0 auto;
    border: 1px solid #eee;
    background: #fafafa;
    color: #555;
    border-radius: 8px;
    padding: 0.42rem 0.72rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.trend-mode.active {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    border-color: #d32f2f;
    color: #fff;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.24);
}

.trend-panel {
    min-width: 0;
}

.trend-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    color: #777;
    font-size: 0.85rem;
}

.trend-head div {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
    min-width: 0;
}

.trend-head strong {
    color: #222;
    font-size: 1rem;
}

.trend-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 0.85rem;
    margin-bottom: 0.75rem;
    min-width: 0;
    overflow: hidden;
}

.trend-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.trend-card-head h2 {
    font-size: 0.95rem;
    color: #222;
    margin: 0;
    white-space: nowrap;
}

.trend-summary {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.25rem;
    min-width: 0;
}

.trend-summary span {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 999px;
    color: #555;
    font-size: 0.72rem;
    padding: 0.16rem 0.4rem;
    white-space: nowrap;
}

.trend-summary b {
    color: #d32f2f;
    font-size: 0.72rem;
}

.trend-scroll {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fff;
}

.trend-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    text-align: center;
}

.trend-table th,
.trend-table td {
    border-bottom: 1px solid #f3f3f3;
    border-right: 1px solid #f6f6f6;
    color: #555;
    font-size: 0.78rem;
    height: 2.1rem;
    padding: 0.18rem;
    white-space: nowrap;
}

.trend-table th {
    background: #fafafa;
    color: #666;
    font-weight: 700;
}

.trend-table tr:last-child td {
    border-bottom: none;
}

.trend-table th:last-child,
.trend-table td:last-child {
    border-right: none;
}

.trend-matrix-table th:not(.trend-issue-col):not(.trend-date-col),
.trend-matrix-table td:not(.trend-issue-col):not(.trend-date-col) {
    width: 2.1rem;
}

.trend-issue-col {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 5.4rem;
    min-width: 5.4rem;
    background: #fff;
    box-shadow: 1px 0 0 #f0f0f0;
}

th.trend-issue-col {
    z-index: 3;
    background: #fafafa;
}

.trend-date-col {
    width: 4.1rem;
    min-width: 4.1rem;
}

.trend-hit,
.trend-miss {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.48rem;
    height: 1.48rem;
    border-radius: 50%;
    font-size: 0.72rem;
    line-height: 1;
}

.trend-hit {
    color: #fff;
    font-weight: 700;
}

.trend-hit.red {
    background: linear-gradient(135deg, #e53935, #b71c1c);
    box-shadow: 0 1px 4px rgba(211, 47, 47, 0.25);
}

.trend-hit.blue {
    background: linear-gradient(135deg, #1e88e5, #0d47a1);
    box-shadow: 0 1px 4px rgba(30, 136, 229, 0.24);
}

.trend-miss {
    color: #aaa;
    background: #fafafa;
}

.trend-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 0.75rem;
}

.trend-kpi-grid .analysis-card {
    text-align: center;
    padding: 0.55rem 0.5rem;
}

.trend-chart-scroll {
    padding: 0.4rem;
}

.trend-line-chart {
    display: block;
    background: #fff;
}

.trend-axis {
    stroke: #e0e0e0;
    stroke-width: 1;
}

.trend-axis-text,
.trend-x-text {
    fill: #888;
    font-size: 11px;
}

.trend-polyline {
    fill: none;
    stroke: #d32f2f;
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.trend-point {
    fill: #fff;
    stroke: #d32f2f;
    stroke-width: 2;
}

.trend-detail-table {
    min-width: 620px;
}

.trend-detail-table th,
.trend-detail-table td {
    padding: 0.45rem 0.5rem;
}

.trend-detail-table strong {
    color: #222;
}

.trend-result {
    justify-content: center;
    gap: 0.08rem;
}

/* ========== 分页 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    flex-wrap: nowrap;
    width: 100%;
}

.page-btn {
    padding: 0.4rem 0.55rem;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #555;
    transition: all 0.2s;
    flex-shrink: 0;
}

.page-btn:hover:not(:disabled) {
    border-color: #d32f2f;
    color: #d32f2f;
}

.page-btn.active {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: #fff;
    border-color: #d32f2f;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.25);
}

.page-btn:disabled {
    background-color: #fafafa;
    color: #ccc;
    cursor: not-allowed;
}

/* ========== 响应式 - 平板 ========== */
@media (max-width: 768px) {
    #latestResultsContainer {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 0.75rem;
    }

    .container {
        padding: 0.75rem;
    }

    .lottery-card {
        padding: 1rem;
    }

    .selector-section {
        padding: 1rem;
    }

    .ball-grid {
        gap: 0.4rem;
    }

    .ball-selectable {
        width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
    }

    .analysis-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-main .table-wrapper {
        display: none;
    }

    .history-main .history-card-list {
        display: block;
    }

    .trend-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ========== 响应式 - 手机 ========== */
@media (max-width: 480px) {
    .history-main {
        padding-top: 0.75rem;
    }

    .filter-bar {
        gap: 0.4rem;
        padding: 0.6rem 0.75rem;
        align-items: stretch;
    }

    .filter-item {
        font-size: 0.8rem;
        gap: 0.2rem;
        flex: 1 1 calc(50% - 0.4rem);
        justify-content: space-between;
    }

    .filter-item input,
    .filter-item select {
        width: 82px;
        min-width: 82px;
        padding: 0.3rem 0.4rem;
        font-size: 0.8rem;
    }

    .filter-bar .btn-sm {
        flex: 1 1 calc(33.333% - 0.4rem);
        padding: 0.4rem 0.45rem;
        font-size: 0.75rem;
        border-radius: 6px;
    }

    .header h1 {
        font-size: 1.05rem;
    }

    .back-btn {
        font-size: 0.85rem;
        left: 0.6rem;
    }

    .share-btn {
        right: 0.6rem;
        font-size: 0.85rem;
        padding: 0.2rem 0.4rem;
    }

    .share-btn svg {
        width: 14px;
        height: 14px;
    }

    .tab-item, .tab-link {
        padding: 0.65rem 0.65rem;
        font-size: 0.85rem;
    }

    .tabs {
        position: relative;
        top: 0;
    }

    .header {
        position: relative;
    }

    #latestResultsContainer {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .container {
        padding: 0.45rem;
    }

    .lottery-card {
        padding: 0.65rem;
        border-radius: 8px;
    }

    .card-title {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }

    .card-info {
        font-size: 0.78rem;
        margin-bottom: 0.45rem;
    }

    .card-title-info {
        margin-bottom: 0;
        gap: 0.35rem;
    }

    .ball {
        width: 1.65rem;
        height: 1.65rem;
        font-size: 0.78rem;
    }

    .ball-small {
        width: 1.3rem;
        height: 1.3rem;
        font-size: 0.7rem;
    }

    .card-numbers {
        gap: 0.25rem;
        min-height: 1.75rem;
        margin-bottom: 0.45rem;
    }

    .prize-summary {
        padding-top: 0.55rem;
        margin-bottom: 0.55rem;
    }

    .prize-summary-head {
        font-size: 0.8rem;
    }

    .prize-list.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.3rem;
    }

    .prize-row {
        grid-template-columns: minmax(3.8rem, 1fr) auto auto;
        gap: 0.35rem;
        padding: 0.36rem 0.45rem;
        font-size: 0.74rem;
    }

    .prize-list.compact .prize-row {
        grid-template-columns: minmax(2.8rem, 1fr) auto;
        padding: 0.32rem 0.4rem;
    }

    .prize-row strong {
        font-size: 0.75rem;
    }

    .card-footer {
        gap: 0.45rem;
        padding-top: 0.45rem;
        align-items: flex-start;
        flex-direction: column;
    }

    .card-actions {
        justify-content: flex-start;
        gap: 0.35rem;
    }

    .action-btn {
        text-align: center;
        padding: 0.28rem 0.5rem;
        font-size: 0.75rem;
        border-radius: 14px;
        white-space: nowrap;
    }

    .prize-day {
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .prize-modal-overlay {
        padding: 0.6rem;
        align-items: center;
        z-index: 20000;
    }

    .prize-modal-dialog {
        z-index: 20001;
        max-height: 82vh;
        border-radius: 14px;
    }

    .prize-modal-header {
        padding: 0.85rem;
    }

    .prize-modal-body {
        padding: 0.8rem;
        max-height: calc(82vh - 68px);
    }

    .prize-list.full .prize-row {
        grid-template-columns: minmax(4rem, 1fr) auto auto;
        padding: 0.48rem 0.5rem;
        font-size: 0.78rem;
    }

    .selector-section {
        padding: 0.85rem;
        border-radius: 10px;
    }

    .ball-selectable {
        width: 1.85rem;
        height: 1.85rem;
        font-size: 0.8rem;
    }

    .ball-grid-small .ball-selectable {
        width: 1.7rem;
        height: 1.7rem;
        font-size: 0.75rem;
    }

    .ball-grid {
        gap: 0.35rem;
    }

    .submit-section {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        padding: 0.7rem;
    }

    .analysis-panel {
        padding: 0.75rem;
        border-radius: 10px;
    }

    .analysis-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.2rem;
    }

    .analysis-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
    }

    .analysis-card {
        padding: 0.55rem;
    }

    .trend-section {
        grid-template-columns: 1fr;
        gap: 0.65rem;
    }

    .table-wrapper {
        display: none;
    }

    .history-card-list {
        display: block;
    }

    .history-card {
        padding: 0.7rem;
        overflow: visible;
    }

    .history-card-head {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 0.2rem 0.5rem;
    }

    .history-card .result-display {
        justify-content: flex-start;
        gap: 0.12rem;
    }

    .history-card-metrics {
        flex-wrap: wrap;
        gap: 0.25rem;
        margin-top: 0.45rem;
        overflow: visible;
    }

    .history-card-metrics span {
        flex: 0 0 auto;
        padding: 0.16rem 0.38rem;
        font-size: 0.68rem;
        line-height: 1.25;
        white-space: nowrap;
    }

    .trend-main {
        max-width: 100%;
        overflow-x: hidden;
    }

    .trend-filter-bar {
        margin-bottom: 0.55rem;
    }

    .trend-filter-bar .filter-item {
        flex: 1 1 calc(50% - 0.4rem);
    }

    .trend-filter-bar .btn-sm {
        flex: 1 1 calc(50% - 0.4rem);
    }

    .trend-mode-bar {
        border-radius: 10px;
        padding: 0.45rem;
        gap: 0.35rem;
        margin-bottom: 0.55rem;
    }

    .trend-mode {
        padding: 0.38rem 0.55rem;
        font-size: 0.78rem;
        border-radius: 7px;
    }

    .trend-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.22rem;
        padding: 0.72rem;
        border-radius: 10px;
        margin-bottom: 0.55rem;
    }

    .trend-head strong {
        font-size: 0.95rem;
    }

    .trend-card {
        padding: 0.65rem;
        border-radius: 10px;
        margin-bottom: 0.55rem;
    }

    .trend-card-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.35rem;
        margin-bottom: 0.5rem;
    }

    .trend-card-head h2 {
        font-size: 0.9rem;
    }

    .trend-summary {
        justify-content: flex-start;
        width: 100%;
    }

    .trend-scroll {
        border-radius: 7px;
    }

    .trend-table th,
    .trend-table td {
        height: 1.92rem;
        font-size: 0.7rem;
        padding: 0.12rem;
    }

    .trend-issue-col {
        width: 4.7rem;
        min-width: 4.7rem;
    }

    .trend-date-col {
        width: 3.6rem;
        min-width: 3.6rem;
    }

    .trend-hit,
    .trend-miss {
        width: 1.32rem;
        height: 1.32rem;
        font-size: 0.64rem;
    }

    .trend-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.45rem;
        margin-bottom: 0.55rem;
    }

    .trend-kpi-grid .analysis-card {
        padding: 0.48rem 0.35rem;
    }

    .trend-kpi-grid .analysis-card span {
        font-size: 0.68rem;
        white-space: nowrap;
    }

    .trend-kpi-grid .analysis-card strong {
        font-size: 0.9rem;
    }

    .trend-chart-scroll {
        padding: 0.28rem;
    }

    .trend-detail-table {
        min-width: 560px;
    }

    .trend-detail-table th,
    .trend-detail-table td {
        padding: 0.35rem 0.35rem;
    }

    .trend-result {
        justify-content: flex-start;
        min-width: 8rem;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 0.35rem;
        margin-top: 1rem;
    }

    .page-size-selector {
        flex: 0 0 100%;
        justify-content: center;
        margin-left: 0;
        order: -1;
    }

    .history-table th, .history-table td {
        padding: 0.55rem 0.3rem;
        font-size: 0.8rem;
    }

    .history-table {
        min-width: 360px;
    }

    .page-btn {
        padding: 0.4rem 0.55rem;
        font-size: 0.8rem;
    }

    .result-card {
        padding: 0.85rem;
        border-radius: 10px;
    }

    .result-card .card-header {
        font-size: 0.85rem;
    }
}
