/* ==================== 基础样式 ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #f8fbff 0%, #f5f7fb 45%, #eef6ff 100%);
    background-attachment: fixed;
    color: #333;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px;
    margin-top: 50px;
}

/* ==================== 星空横幅 ==================== */

.star-banner {
    width: 100%;
    margin-bottom: 3px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.star-banner a {
    display: block;
    width: 100%;
}

.star-banner-img {
    width: 100%;
    height: auto;
    display: block;
}

/* ==================== 粘性头部 ==================== */

.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.sticky-header .container-fluid {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sticky-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sticky-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.sticky-title {
    color: white;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
}

.sticky-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.welcome-text {
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    font-weight: 500;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.welcome-text::before {
    content: '👤';
    font-size: 12px;
}

.login-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    color: #667eea;
    border: none;
    padding: 10px 22px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25);
    letter-spacing: 0.3px;
}

.login-btn:hover {
    background: linear-gradient(135deg, #ffffff 0%, #e8edff 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.25);
}

/* ==================== 主头部 ==================== */

.header {
    background: rgba(255, 255, 255, 0.96);
    padding: 18px;
    border-radius: 22px;
    box-shadow: 0 18px 42px rgba(58, 98, 140, 0.12);
    margin-bottom: 10px;
    position: relative;
    overflow: visible;
    border: 1px solid rgba(201, 219, 236, 0.78);
}

.header-banner {
    display: none;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #bdefff, #51c8ff, #9be6d1);
    opacity: 0.85;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    background: transparent;
    border-radius: 0;
    padding: 0 2px 14px;
}

.draw-title-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.draw-kicker {
    color: #111827;
    font-size: 24px;
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.header-top h1 {
    font-size: 13px;
    font-weight: 600;
    color: #8a93a3;
    margin: 0;
    letter-spacing: 0.2px;
}

.header-top h1 strong {
    color: #111827;
    font-size: 15px;
    font-weight: 900;
}

.header-top .controls {
    display: flex;
    gap: 7px;
    flex-shrink: 0;
    padding-top: 1px;
}

.header-top .controls button {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.9);
    color: #2f3a4a;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 800;
    font-size: 13px;
    line-height: 1;
    transition: all 0.3s ease;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.07);
}

.header-top .controls button:hover {
    transform: translateY(-1px);
    background: #f8fbff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}

.header-middle {
    display: flex;
    flex-direction: column;
    gap: 13px;
    margin-bottom: 12px;
    font-size: 12px;
    overflow-x: hidden;
}

/* ==================== 倒计时区域 ==================== */

.next-draw {
    width: min(280px, 92%);
    min-width: 0;
    flex: none;
    margin: 0 auto;
    padding: 10px 16px;
    border-radius: 18px;
    border: 1px solid rgba(92, 204, 255, 0.55);
    background: linear-gradient(180deg, #f3fbff 0%, #ecf8ff 100%);
    box-shadow: 0 10px 22px rgba(61, 180, 236, 0.12), inset 0 0 0 1px rgba(255,255,255,.75);
    display: flex;
    flex-direction: column;
}

.countdown-label {
    text-align: center;
    color: #9aa5b3;
    font-size: 12px;
    font-weight: 700;
}

.countdown-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    color: #22a7ee;
}

.next-draw input {
    flex: 0 1 auto;
    width: 50%;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #111827;
    text-align: center;
    font-size: 18px;
    font-weight: 900;
    outline: none;
    box-shadow: none;
}

/* ==================== 和值计算区域 ==================== */

.sum-calculator {
    width: 100%;
    min-width: 0;
    flex: none;
    padding: 20px 12px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f8fc 100%);
    border: 1px solid #edf2f7;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 10px 24px rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 20px;
    color: #111827;
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    touch-action: pan-y;
}

.sum-calculator > span {
    font-size: 20px;
    font-weight: 900;
    color: #111827;
    margin: 0 1px;
}

.sum-item {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 14px;
    background: linear-gradient(180deg, #f3f5fb 0%, #eceff7 100%);
    color: #111827;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 23px;
    font-weight: 900;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 7px 16px rgba(15, 23, 42, 0.08);
    transition: transform 0.3s ease;
}

.sum-item:hover {
    transform: scale(1.1);
}

.sum-item.result {
    background: linear-gradient(135deg, #23d7ff 0%, #0ea5e9 100%);
    color: #fff;
    font-size: 24px;
    box-shadow: 0 12px 22px rgba(14, 165, 233, 0.28);
}

.sum-item.border-radius-20 {
    border-radius: 14px;
    color: #fff;
    font-size: 19px;
    min-width: 46px;
    width: 46px;
}

.sum-item-wrapper {
    position: relative;
    display: inline-block;
}

.scratch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    cursor: crosshair;
    overflow: hidden;
    display: none;
}

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

.scratch-overlay canvas {
    width: 100%;
    height: 100%;
}

/* ==================== 统计区域 ==================== */

.stats-header {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
    padding: 2px 14px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(39, 174, 96, 0.1));
    border-radius: 8px;
    border-left: 4px solid #3498db;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-title {
    display: block;
}

.help-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #3498db;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    position: relative;
}

.tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #2c3e50;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    z-index: 1000;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tooltip::before {
    content: "";
    position: absolute;
    bottom: 100%;
    right: 8px;
    border: 6px solid transparent;
    border-bottom-color: #2c3e50;
}

.help-icon:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.stat-item {
    background: white;
    padding: 4px 6px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.stat-left {
    font-size: 18px;
    font-weight: 700;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.stat-right {
    font-size: 12px;
    color: #666;
    flex: 1;
    text-align: left;
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-weight: 500;
}

.stat-right span {
    display: block;
    line-height: 1.5;
    margin-bottom: 3px;
}

/* ==================== 标签按钮 ==================== */

.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tab-button {
    flex: 1;
    min-width: 180px;
    padding: 8px 14px;
    border: 2px solid #3498db;
    border-radius: 8px;
    background-color: white;
    color: #3498db;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    text-align: center;
}

.tab-button:hover {
    background-color: #3498db;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.tab-button.active {
    background-color: #3498db;
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.sub-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.sub-tab {
    padding: 6px 14px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background-color: white;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sub-tab:hover {
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.sub-tab.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* ==================== 结果表格 ==================== */

.results-table {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow-x: hidden;
    margin-bottom: 8px;
    border: 1px solid #dee2e6;
}

.results-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 100%;
    max-width: 100%;
}

.results-table th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 8px 6px;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.results-table td {
    padding: 6px 4px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
    color: #495057;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.results-table tr:hover {
    background-color: #f8f9fa;
}

.results-table tr:nth-child(even) {
    background-color: #fafbfc;
}

#main-results-table {
    display: block;
}

#predict-results-table,
#missed-chart-container,
#opened-stats-container {
    display: none;
}

/* ==================== 预测菜单 ==================== */

.predict-menu {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    margin: 0 0 3px 0;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.predict-menu-item {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background-color: #f9fafb;
    color: #5b6270;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.predict-menu-item:hover {
    border-color: #3B82F6;
    background-color: #eff6ff;
    color: #2563EB;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.predict-menu-item.active {
    border-color: #3B82F6;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ==================== 遗漏查询 ==================== */

.missed-query-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #dee2e6;
}

.missed-query-header {
    padding: 8px 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.missed-query-title {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.missed-query-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.missed-query-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.25s ease;
}

.missed-query-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #3B82F6;
}

.missed-query-left {
    font-size: 14px;
    font-weight: 600;
    color: #3B82F6;
    min-width: 24px;
}

.missed-query-right {
    display: flex;
    flex-direction: column;
    margin-left: 8px;
    font-size: 11px;
    color: #6b7280;
}

.missed-query-right span {
    line-height: 1.4;
}

/* ==================== 遗漏图表 ==================== */

.missed-chart-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #dee2e6;
}

.missed-chart-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-radius: 10px;
    border: 1px solid #bfdbfe;
}

.missed-chart-title {
    font-size: 18px;
    font-weight: 600;
    color: #655b9c;
}

.missed-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.missed-chart-item {
    display: flex;
    align-items: center;
    padding: 10px 6px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.25s ease;
}

.missed-chart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #3B82F6;
}

.missed-chart-left {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.missed-chart-right {
    display: flex;
    flex-direction: column;
    margin-left: 12px;
    font-size: 13px;
    color: #6b7280;
}

.missed-chart-right span {
    line-height: 1.5;
}

/* ==================== 已开统计 ==================== */

.opened-stats-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 8px;
    margin-bottom: 8px;
    border: 1px solid #dee2e6;
}

.opened-stats-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-radius: 10px;
    border: 1px solid #bfdbfe;
}

.opened-stats-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e40af;
}

.stats-subtitle {
    font-size: 12px;
    color: #64748b;
    margin-left: 10px;
}

.header-date-picker {
    margin-left: auto;
    padding: 6px 10px;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    font-size: 11px;
    color: #2563eb;
    background: white;
    cursor: pointer;
}

.header-date-picker:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.opened-stats-content {
    padding: 6px 0;
}

.stats-section {
    margin-bottom: 8px;
    padding: 8px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.section-title {
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}

.title-icon {
    width: 4px;
    height: 4px;
    background: #3b82f6;
    border-radius: 50%;
    margin-right: 8px;
}

.section-date-picker {
    margin-left: auto;
    padding: 4px 8px;
    border: 1px solid #bfdbfe;
    border-radius: 4px;
    font-size: 13px;
    color: #3b82f6;
    background: white;
    cursor: pointer;
}

.section-date-picker:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.stats-grid-2col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.stats-grid-3col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stats-grid-4col {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.type-tag {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.tag-blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.tag-red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.tag-green {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.tag-orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.tag-cyan {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.tag-purple {
    background: linear-gradient(135deg, #a855f7, #9333ea);
}

.tag-gray {
    background: linear-gradient(135deg, #64748b, #475569);
}

.tag-light-green {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.stats-value {
    font-size: 14px;
    color: #3b82f6;
    font-weight: 500;
}

.text-red {
    color: #ef4444;
    font-weight: 600;
}

.background-red {
    background: linear-gradient(135deg, #ff5b6b 0%, #ef2f4a 100%);
    color: #fff;
    box-shadow: 0 12px 20px rgba(239, 47, 74, 0.24);
}

.background-blue {
    background: linear-gradient(135deg, #31c7ff 0%, #2383ff 100%);
    color: #fff;
    box-shadow: 0 12px 20px rgba(35, 131, 255, 0.24);
}

/* ==================== 数字标签 ==================== */

.number-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    font-weight: 600;
    font-size: 13px;
    margin: 0 2px;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.number-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 21px;
    height: 21px;
    padding: 0 4px;
    border-radius: 38px;
    color: white;
    margin: 0 1px;
    box-shadow: 0 2px 6px rgba(126, 184, 230, 0.3);
}

.result-lan {
    background: linear-gradient(135deg, #4a71f0, #ab7aeb);
    font-weight: 600;
    font-size: 12px;
}

.result-hong {
    background: linear-gradient(135deg, #f02d2d, #b48045);
    font-weight: 600;
    font-size: 12px;
}

.result-cheng {
    background: linear-gradient(135deg, #fa8518, #b48045);
    font-weight: 1600;
    font-size: 14px;
}

.result-lv {
    background: linear-gradient(135deg, #314774, #7d997a);
    font-weight: 1600;
    font-size: 14px;
}

.result-dhong {
    background: linear-gradient(135deg, #a52323, #7d997a);
    font-weight: 1600;
    font-size: 14px;
}

.text-pink {
    color: #e74c3c;
    font-weight: 600;
}

.text-orange {
    color: var(--warning-color);
    font-weight: 600;
}

.text-blue {
    color: #2563EB;
    font-weight: 600;
}

.font-bold {
    font-weight: bold;
}

.icon-cuo {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-image: url('img/cuo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.icon-dui {
    display: inline-block;
    width: 18px;
    height: 18px;
    background-image: url('img/dui.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* ==================== 分页 ==================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding-bottom: 12px;
}

.pagination button {
    padding: 6px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background-color: white;
    color: #666;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination button:hover:not(:disabled) {
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-1px);
}

.pagination button.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== 页脚 ==================== */

.footer {
    background-color: white;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    margin-top: 12px;
    border-top: 4px solid #3498db;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.footer-top h3 {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.footer-middle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-item {
    flex: 1;
    min-width: 180px;
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.footer-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.footer-item img {
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
    border-radius: 50%;
    background: white;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.footer-item p {
    font-size: 13px;
    color: #666;
    margin: 3px 0;
    line-height: 1.4;
}

.footer-bottom {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    color: #666;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.footer-bottom .links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-bottom a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* ==================== 算法展示 ==================== */

.algorithms-display {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
    min-width: 300px;
}

.algo-card-mini {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(201, 219, 236, 0.78);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 4px 12px rgba(58, 98, 140, 0.08);
    transition: all 0.2s;
    min-width: 0;
}

.algo-card-mini:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(58, 98, 140, 0.12);
    border-color: #51c8ff;
}

.algo-header-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.algo-name-mini {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.algo-tag-mini {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    background: linear-gradient(135deg, #51c8ff, #9be6d1);
    color: white;
}

.algo-formula-mini {
    font-size: 11px;
    color: #111827;
    margin-bottom: 8px;
    padding: 4px 6px;
    background: #f8fafc;
    border-radius: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.formula-label {
    color: #8a93a3;
}

.formula-value {
    font-weight: 600;
    color: #2563eb;
}

.algo-stats-mini {
    display: flex;
    gap: 6px;
    margin-bottom: 0;
}

.stat-item-mini {
    flex: 1;
    text-align: center;
    padding: 6px 2px;
    background: #f8fafc;
    border-radius: 6px;
    min-width: 0;
}

.stat-label-mini {
    font-size: 9px;
    color: #8a93a3;
    margin-bottom: 1px;
}

.stat-value-mini {
    font-size: 12px;
    font-weight: 700;
    color: #111827;
}

.stat-value-mini.highlight {
    color: #2196f3;
}

.mi-panel {
    position: absolute;
    width: 100%;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 0.01;
    border-radius: 18px;
    overflow: hidden;
}

.center-tc {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.border-radius-10 {
    border-radius: 10%;
}

.border-radius-20 {
    border-radius: 20%;
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 992px) {
    .container {
        padding: 6px;
    }
    
    .header-top {
        gap: 10px;
        text-align: left;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-item {
        width: calc(50% - 10px);
    }
    
    .opened-stats-container {
        padding: 11px;
    }
    
    .opened-stats-header {
        padding: 9px 12px;
    }
}

@media (max-width: 768px) {
    .sticky-header {
        height: 44px;
    }
    
    .sticky-header .container-fluid {
        padding: 0 12px;
    }
    
    .sticky-header-left {
        gap: 8px;
    }
    
    .sticky-logo {
        width: 24px;
        height: 24px;
    }
    
    .sticky-title {
        font-size: 15px;
    }
    
    .sticky-header-right {
        gap: 10px;
    }
    
    .welcome-text {
        font-size: 12px;
        padding: 5px 10px;
        gap: 4px;
    }
    
    .login-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .container {
        padding: 6px;
    }
    
    .header-top {
        flex-direction: row;
        text-align: left;
        gap: 10px;
    }
    
    .draw-kicker {
        font-size: 21px;
    }
    
    .header-top .controls button {
        padding: 7px 8px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .sub-tabs {
        flex-direction: column;
    }
    
    .sub-tab {
        width: 100%;
    }
    
    .results-table {
        overflow-x: hidden;
        margin-bottom: 12px;
    }
    
    .footer-middle {
        flex-direction: column;
    }
    
    .footer-item {
        min-width: 100%;
    }
    
    .opened-stats-container {
        padding: 4px;
    }
    
    .opened-stats-header {
        padding: 8px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .opened-stats-title {
        font-size: 16px;
    }
    
    .stats-subtitle {
        font-size: 12px;
        margin-left: 8px;
    }
    
    .header-date-picker {
        font-size: 11px;
        padding: 5px 8px;
    }
    
    .stats-section {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .stats-grid-4col {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-row {
        padding: 7px 9px;
    }
    
    .section-title {
        font-size: 14px;
    }
    
    .type-tag {
        font-size: 13px;
        padding: 2px 6px;
    }
    
    .stats-value {
        font-size: 13px;
    }
    
    .algorithms-display {
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .algo-card-mini {
        padding: 10px 10px;
        border-radius: 10px;
    }
    
    .algo-name-mini {
        font-size: 12px;
    }
    
    .algo-tag-mini {
        padding: 1.5px 6px;
        font-size: 9px;
    }
    
    .algo-formula-mini {
        font-size: 10px;
        padding: 3px 4px;
        margin-bottom: 6px;
    }
    
    .algo-header-mini {
        margin-bottom: 6px;
    }
    
    .algo-stats-mini {
        gap: 4px;
    }
    
    .stat-item-mini {
        padding: 4px 2px;
        border-radius: 4px;
    }
    
    .stat-label-mini {
        font-size: 8px;
    }
    
    .stat-value-mini {
        font-size: 10px;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 6px;
    }
    
    .header {
        padding: 15px 14px;
    }
    
    .header-top h1 {
        font-size: 18px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tab-buttons {
        flex-direction: column;
    }
    
    .tab-button {
        min-width: 100%;
    }
    
    .sub-tabs {
        flex-direction: column;
    }
    
    .sub-tab {
        width: 100%;
    }
    
    .footer-item {
        width: calc(50% - 10px);
    }
    
    .opened-stats-container {
        padding: 9px;
    }
    
    .opened-stats-header {
        padding: 9px 13px;
    }
    
    .opened-stats-title {
        font-size: 17px;
    }
    
    .stats-subtitle {
        font-size: 12px;
    }
    
    .header-date-picker {
        font-size: 11px;
    }
    
    .stats-section {
        padding: 9px;
    }
    
    .stats-grid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .sticky-header {
        height: 40px;
    }
    
    .sticky-header .container-fluid {
        padding: 0 10px;
    }
    
    .sticky-header-left {
        gap: 6px;
    }
    
    .sticky-logo {
        width: 20px;
        height: 20px;
    }
    
    .sticky-title {
        font-size: 13px;
    }
    
    .sticky-header-right {
        gap: 8px;
    }
    
    .welcome-text {
        font-size: 11px;
        padding: 4px 8px;
        gap: 3px;
    }
    
    .login-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .algorithms-display {
        gap: 6px;
    }
    
    .algo-card-mini {
        padding: 8px 8px;
        border-radius: 8px;
    }
    
    .algo-name-mini {
        font-size: 11px;
    }
    
    .algo-tag-mini {
        padding: 1px 4px;
        font-size: 8px;
    }
    
    .algo-formula-mini {
        font-size: 9px;
        padding: 2px 3px;
        margin-bottom: 4px;
    }
    
    .algo-header-mini {
        margin-bottom: 4px;
    }
    
    .algo-stats-mini {
        gap: 3px;
    }
    
    .stat-item-mini {
        padding: 3px 1px;
        border-radius: 3px;
    }
    
    .stat-label-mini {
        font-size: 7px;
    }
    
    .stat-value-mini {
        font-size: 9px;
    }
}

@media (max-width: 500px) {
    .container {
        padding: 4px;
    }
    
    .header {
        padding: 10px;
    }
    
    .header-top {
        padding: 6px;
    }
    
    .header-middle {
        gap: 13px;
    }
    
    .next-draw {
        padding: 10px 16px;
    }
    
    .next-draw input {
        padding: 0;
        font-size: 18px;
    }
    
    .sum-calculator {
        padding: 18px 8px;
        gap: 6px;
        font-size: 18px;
    }
    
    .sum-item {
        width: 42px;
        height: 42px;
        min-width: 42px;
        font-size: 21px;
    }
    
    .sum-calculator > span {
        font-size: 18px;
    }
    
    .sum-calculator .sum-item.result {
        width: 42px;
        height: 42px;
        font-size: 21px;
    }
    
    .sum-item.border-radius-20 {
        width: 40px;
        min-width: 40px;
        font-size: 17px;
    }
    
    .opened-stats-container {
        padding: 6px;
        margin-bottom: 8px;
    }
    
    .opened-stats-header {
        padding: 6px 8px;
        margin-bottom: 8px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .opened-stats-title {
        font-size: 14px;
    }
    
    .stats-subtitle {
        font-size: 10px;
        margin-left: 0;
        margin-top: 4px;
    }
    
    .header-date-picker {
        font-size: 9px;
        padding: 3px 6px;
        margin-left: 0;
        margin-top: 6px;
        align-self: stretch;
    }
    
    .stats-section {
        padding: 6px;
        margin-bottom: 6px;
    }
    
    .section-title {
        font-size: 13px;
        margin-bottom: 6px;
        padding-bottom: 6px;
    }
    
    .stats-grid-3col {
        grid-template-columns: 1fr;
    }
    
    .stats-grid-4col {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        padding: 5px 7px;
    }
    
    .type-tag {
        font-size: 11px;
        padding: 1px 4px;
    }
    
    .stats-value {
        font-size: 11px;
    }
    
    .results-table th,
    .results-table td {
        white-space: normal;
        word-wrap: break-word;
        word-break: break-word;
        padding: 4px 3px;
        font-size: 9px;
    }
    
    .predict-container .results-table th,
    .predict-container .results-table td {
        white-space: normal;
        word-wrap: break-word;
        word-break: break-word;
        padding: 4px 3px;
        font-size: 9px;
    }
    
    .number-tag {
        min-width: 21px;
        height: 21px;
        padding: 0 4px;
    }
}

@media (max-width: 420px) {
    .header {
        padding: 15px 12px;
    }
    
    .draw-kicker {
        font-size: 21px;
    }
    
    .header-top .controls {
        gap: 5px;
    }
    
    .header-top .controls button {
        font-size: 12px;
        padding: 7px 8px;
    }
    
    .sum-calculator {
        gap: 6px;
        padding: 18px 8px;
    }
    
    .sum-item {
        width: 42px;
        height: 42px;
        min-width: 42px;
        font-size: 21px;
    }
    
    .sum-item.border-radius-20 {
        width: 40px;
        min-width: 40px;
        font-size: 17px;
    }
    
    .sum-calculator > span {
        font-size: 18px;
    }
}

@media (max-width: 400px) {
    .sticky-header {
        height: 36px;
    }
    
    .sticky-header .container-fluid {
        padding: 0 8px;
    }
    
    .sticky-header-left {
        gap: 5px;
    }
    
    .sticky-logo {
        width: 18px;
        height: 18px;
    }
    
    .sticky-title {
        font-size: 12px;
    }
    
    .sticky-header-right {
        gap: 6px;
    }
    
    .welcome-text {
        font-size: 10px;
        padding: 3px 6px;
        gap: 2px;
    }
    
    .login-btn {
        padding: 5px 10px;
        font-size: 10px;
    }
    
    .container {
        padding: 4px;
    }
    
    .header {
        padding: 12px;
    }
    
    .header-top {
        padding: 6px;
    }
    
    .header-top h1 {
        font-size: 16px;
    }
    
    .stats-header {
        font-size: 16px;
        padding: 10px 12px;
    }
    
    .stat-left {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .stat-right {
        font-size: 12px;
    }
    
    .tab-button {
        font-size: 12px;
        padding: 8px 12px;
        min-width: 100%;
    }
    
    .sub-tab {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .results-table {
        overflow-x: hidden;
        margin-bottom: 12px;
    }
    
    .pagination button {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .opened-stats-container {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .opened-stats-header {
        padding: 7px 10px;
        margin-bottom: 10px;
    }
    
    .opened-stats-title {
        font-size: 15px;
    }
    
    .stats-subtitle {
        font-size: 11px;
    }
    
    .header-date-picker {
        font-size: 10px;
        padding: 4px 7px;
    }
    
    .stats-section {
        padding: 7px;
        margin-bottom: 8px;
    }
    
    .section-title {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .stats-grid-2col {
        grid-template-columns: 1fr;
    }
    
    .stats-grid-3col {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid-4col {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-row {
        padding: 6px 8px;
    }
    
    .type-tag {
        font-size: 12px;
        padding: 1px 5px;
    }
    
    .stats-value {
        font-size: 12px;
    }
    
    .algorithms-display {
        gap: 4px;
    }
    
    .algo-card-mini {
        padding: 6px 6px;
    }
    
    .algo-name-mini {
        font-size: 10px;
    }
    
    .algo-tag-mini {
        font-size: 7px;
        padding: 1px 3px;
    }
    
    .algo-formula-mini {
        font-size: 8px;
    }
    
    .stat-label-mini {
        font-size: 6px;
    }
    
    .stat-value-mini {
        font-size: 8px;
    }
}

@media (max-width: 360px) {
    .sticky-header {
        height: 34px;
    }
    
    .sticky-header .container-fluid {
        padding: 0 6px;
    }
    
    .sticky-header-left {
        gap: 4px;
    }
    
    .sticky-logo {
        width: 16px;
        height: 16px;
    }
    
    .sticky-title {
        font-size: 11px;
    }
    
    .sticky-header-right {
        gap: 5px;
    }
    
    .welcome-text {
        font-size: 9px;
        padding: 2px 5px;
        gap: 1px;
    }
    
    .login-btn {
        padding: 4px 8px;
        font-size: 9px;
    }
    
    .container {
        padding: 3px;
    }
    
    .header {
        padding: 10px 8px;
    }
    
    .header-top {
        padding: 4px;
    }
    
    .header-top h1 {
        font-size: 11px;
    }
    
    .draw-kicker {
        font-size: 19px;
    }
    
    .header-top .controls {
        gap: 4px;
    }
    
    .header-top .controls button {
        font-size: 10px;
        padding: 5px 6px;
    }
    
    .header-middle {
        gap: 10px;
    }
    
    .next-draw {
        padding: 8px 12px;
    }
    
    .next-draw input {
        font-size: 16px;
    }
    
    .sum-calculator {
        padding: 12px 6px;
        gap: 4px;
        font-size: 14px;
        overflow-x: hidden;
        overflow-y: hidden;
    }
    
    .sum-calculator > span {
        font-size: 14px;
    }
    
    .sum-item {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 18px;
        border-radius: 10px;
    }
    
    .sum-item.result {
        width: 34px;
        height: 34px;
        font-size: 18px;
    }
    
    .sum-item.border-radius-20 {
        width: 32px;
        min-width: 32px;
        font-size: 14px;
    }
    
    .stats-header {
        font-size: 14px;
        padding: 8px 10px;
    }
    
    .stat-left {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }
    
    .stat-right {
        font-size: 11px;
    }
    
    .tab-button {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .sub-tab {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .results-table th,
    .results-table td {
        padding: 3px 2px;
        font-size: 8px;
    }
    
    .pagination button {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .opened-stats-container {
        padding: 6px;
    }
    
    .opened-stats-header {
        padding: 5px 8px;
    }
    
    .opened-stats-title {
        font-size: 13px;
    }
    
    .stats-subtitle {
        font-size: 9px;
    }
    
    .header-date-picker {
        font-size: 9px;
        padding: 3px 5px;
    }
    
    .stats-section {
        padding: 5px;
    }
    
    .section-title {
        font-size: 12px;
    }
    
    .stats-grid-2col {
        grid-template-columns: 1fr;
    }
    
    .stats-grid-3col {
        grid-template-columns: 1fr;
    }
    
    .stats-grid-4col {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        padding: 4px 6px;
    }
    
    .type-tag {
        font-size: 11px;
        padding: 1px 4px;
    }
    
    .stats-value {
        font-size: 11px;
    }
    
    .number-tag {
        min-width: 18px;
        height: 18px;
        padding: 0 3px;
    }
    
    .algorithms-display {
        gap: 3px;
    }
    
    .algo-card-mini {
        padding: 5px 5px;
    }
    
    .algo-name-mini {
        font-size: 9px;
    }
    
    .algo-tag-mini {
        font-size: 6px;
        padding: 1px 2px;
    }
    
    .algo-formula-mini {
        font-size: 7px;
    }
    
    .stat-label-mini {
        font-size: 5px;
    }
    
    .stat-value-mini {
        font-size: 7px;
    }
}
