/* ========== 3d_index.css - 福彩3D专用样式（完善版） ========== */
:root {
    --fc-red: #E4393C;
    --fc-gold: #F8B500;
    --fc-dark: #2C3E50;
    --fc-light-bg: #F5F7FA;
    --fc-card-bg: #FFFFFF;
    --fc-border: #E0E6ED;
    --fc-success: #27AE60;
    --fc-danger: #E74C3C;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: var(--fc-light-bg);
    font-family: 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
    padding-bottom: 70px;
    line-height: 1.5;
    color: var(--fc-dark);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 15px;
}

/* 卡片 */
.card {
    background: var(--fc-card-bg);
    border-radius: 16px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(228,57,60,0.08);
    border: 1px solid var(--fc-border);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(145deg, var(--fc-red), #C62828);
    color: white;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.card-body {
    padding: 18px;
}

/* 开奖信息 */
.countdown {
    text-align: center;
    font-size: 15px;
    color: #666;
    margin-bottom: 15px;
    font-weight: 600;
}

.timer {
    color: var(--fc-red);
    font-weight: bold;
    font-size: 22px;
    margin-left: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.closed-badge {
    display: inline-block;
    background: var(--fc-danger);
    color: white;
    padding: 3px 12px;
    border-radius: 30px;
    margin-left: 10px;
    font-size: 13px;
}

.lottery-result {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.ball-red {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    border: 2px solid white;
    background: radial-gradient(circle at 30% 30%, #FF6B6B, var(--fc-red));
}

.data-source {
    text-align: center;
    font-size: 12px;
    color: #999;
    border-top: 1px dashed #ddd;
    padding-top: 12px;
    margin-top: 8px;
}

/* 玩法选择滚动条 */
.play-scroll {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 8px 4px;
    margin: 0 -4px;
}

.play-tag {
    display: inline-block;
    padding: 8px 18px;
    margin: 0 4px;
    border-radius: 40px;
    background: #f0f2f5;
    font-weight: 600;
    font-size: 14px;
    color: var(--fc-dark);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.play-tag.active {
    background: var(--fc-red);
    color: white;
    box-shadow: 0 4px 10px rgba(228,57,60,0.3);
    border-color: #b71c1c;
}

.play-tag i {
    margin-right: 6px;
    font-size: 13px;
}

/* 玩法介绍模态框 */
.intro-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    opacity: 0;
    visibility: hidden;
    transition: 0.25s;
}

.intro-modal.show {
    opacity: 1;
    visibility: visible;
}

.intro-content {
    background: white;
    border-radius: 24px;
    max-width: 360px;
    width: 90%;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}

.intro-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--fc-red);
    margin-bottom: 16px;
}

.intro-desc {
    font-size: 15px;
    color: #444;
    line-height: 1.7;
    margin-bottom: 28px;
    text-align: left;
    background: #f8f9fa;
    padding: 18px;
    border-radius: 16px;
}

.intro-actions {
    display: flex;
    gap: 12px;
}

.intro-btn {
    flex: 1;
    padding: 14px 0;
    border-radius: 40px;
    font-weight: 600;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.intro-btn.confirm {
    background: var(--fc-red);
    color: white;
    box-shadow: 0 6px 12px rgba(228,57,60,0.3);
}

.intro-btn.cancel {
    background: #e9ecef;
    color: #495057;
}

/* 选号区域 */
.position-label {
    font-weight: 600;
    margin: 18px 0 10px;
    color: var(--fc-dark);
    border-left: 4px solid var(--fc-gold);
    padding-left: 12px;
}

.number-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 12px 0;
}

.number-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.number-btn.selected {
    background: var(--fc-red);
    color: white;
    border-color: #b71c1c;
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(228,57,60,0.3);
}

/* 单选组 */
.radio-group {
    display: flex;
    gap: 25px;
    justify-content: center;
    margin: 15px 0;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--fc-red);
}

/* 和值滑块 */
.sum-slider {
    width: 100%;
    margin: 20px 0 10px;
    -webkit-appearance: none;
    height: 8px;
    background: linear-gradient(90deg, #3498db, #e74c3c);
    border-radius: 4px;
    outline: none;
}

.sum-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--fc-red);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
}

.sum-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--fc-red);
    text-align: center;
}

/* 工具栏 */
.toolbar-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    gap: 10px;
}

.toolbar-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.toolbar-label {
    font-weight: 600;
    white-space: nowrap;
    font-size: 14px;
}

.step-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--fc-border);
    border-radius: 30px;
    overflow: hidden;
    background: white;
}

.step-btn {
    width: 36px;
    height: 36px;
    background: #f0f2f5;
    border: none;
    font-size: 20px;
    font-weight: 600;
    color: var(--fc-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.step-btn:hover {
    background: #e0e4e9;
}

.step-input {
    width: 60px;
    border: none;
    text-align: center;
    font-weight: 600;
    font-size: 15px;
    padding: 8px 0;
    outline: none;
    background: white;
}

.random-btn {
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(52,152,219,0.3);
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.random-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(52,152,219,0.4);
}

/* 机选列表 */
#random-list-container {
    background: #f8fafd;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--fc-border);
    margin: 20px 0;
}

.action-bar {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.action-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.action-bar-right {
    display: flex;
    gap: 10px;
}

.action-btn {
    background: white;
    border: 1px solid var(--fc-red);
    color: var(--fc-red);
    border-radius: 30px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    background: var(--fc-red);
    color: white;
}

.random-list {
    max-height: 300px;
    overflow-y: auto;
}

.random-ticket {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px dashed #ddd;
    font-size: 14px;
}

.random-ticket:last-child {
    border-bottom: none;
}

.ticket-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.ticket-index {
    font-weight: 600;
    min-width: 26px;
    color: var(--fc-dark);
}

.play-badge {
    background: var(--fc-red);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
}

/* 投注按钮 */
.bet-button {
    background: linear-gradient(145deg, var(--fc-red), #B71C1C);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 6px 14px rgba(228,57,60,0.3);
    transition: 0.2s;
    margin-top: 15px;
}

.bet-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(228,57,60,0.4);
}

.bet-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #B0BEC5;
    box-shadow: none;
}

/* 消息提示 */
#toast-container {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 10001;
}

.toast {
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px);
    color: white;
    padding: 12px 28px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transform: translateY(-20px);
    opacity: 0;
    transition: 0.25s;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success { background: rgba(39,174,96,0.95); }
.toast.error { background: rgba(231,76,60,0.95); }
.toast.info { background: rgba(52,152,219,0.95); }

/* 历史表格 */
.table-scroll {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--fc-border);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: white;
}

.history-table th {
    background: #f0f3f8;
    padding: 12px 6px;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid var(--fc-border);
    white-space: nowrap;
}

.history-table td {
    padding: 10px 6px;
    border-bottom: 1px solid #ecf0f1;
    vertical-align: middle;
    white-space: nowrap;
}

.history-table .ball-red {
    width: 28px;
    height: 28px;
    font-size: 14px;
    margin: 0 2px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background: white;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
}

.page-btn.active {
    background: var(--fc-red);
    border-color: var(--fc-red);
    color: white;
}

.page-btn:hover:not(.active) {
    border-color: var(--fc-red);
    color: var(--fc-red);
}

/* 响应式 */
@media (max-width: 480px) {
    .ball-red { width: 38px; height: 38px; font-size: 18px; }
    .number-btn { width: 38px; height: 38px; font-size: 16px; }
    .toolbar-label { font-size: 12px; }
    .step-input { width: 50px; }
    .action-btn { padding: 4px 10px; font-size: 12px; }
}