/* 引入 Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Noto+Sans+SC:wght@400;500;700&display=swap');

/* 复用 date/index.css 的核心样式，并优化字体 */
body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: #f0f2f5;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #1e293b;
    -webkit-font-smoothing: antialiased;
}

/* 布局容器 - 控制宽度 */
.layout-container {
    width: 100%;
    max-width: 1400px;
    /* 约视口的 75-80% */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 顶部控制栏 */
.top-bar-wrapper {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    z-index: 100;
    flex-shrink: 0;
    border-bottom: 1px solid #e2e8f0;
}

.top-bar {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.top-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-label {
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    /* Lighter color */
    white-space: nowrap;
}

/* 新版布局 CSS */
.config-layout {
    display: flex;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    padding: 12px 24px;
    gap: 16px;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.config-side {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* PC端：隐藏config-first-row，使用原有布局 */
.config-first-row {
    display: none;
}

.config-center {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border-right: 1px solid #e2e8f0;
}

/* 右侧实时状态区域（桌面端） */
.config-state {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px 12px;
    align-items: center;
    padding: 0;
    border-right: 1px solid #e2e8f0;
}

.config-state-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    white-space: nowrap;
}

.config-state-item .state-label {
    color: #64748b;
    font-weight: 500;
    min-width: 36px;
    text-align: right;
}

.config-state-item .state-value {
    color: #1e293b;
    font-weight: 600;
    font-size: 14px;
}

.config-state-item .state-value.clickable {
    cursor: pointer;
    transition: color 0.2s;
}

.config-state-item .state-value.clickable:hover {
    color: #3b82f6;
}

.config-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(100px, 160px));
    align-items: center;
    gap: 8px 10px;
    width: auto;
}

/* PC端隐藏移动端专用的提醒项 */
.mobile-row2-item {
    display: none !important;
}

/* PC端隐藏邮箱配置行（移动端专用） */
.config-center .config-row:has(#emailInput) {
    display: none !important;
}

/* 配置项内部布局 - 标签+控件 */
.config-row .top-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

/* 标签固定宽度 */
.config-row .top-bar-item .top-bar-label {
    width: 28px;
    flex-shrink: 0;
    text-align: right;
}

/* 下拉框wrapper占满剩余空间 */
.config-row .top-bar-item .custom-select-wrapper {
    flex: 1;
    min-width: 0;
    display: block;
}

/* 下拉框trigger占满wrapper */
.config-row .top-bar-item .custom-select-trigger {
    width: 100%;
    box-sizing: border-box;
}

/* 输入框占满剩余空间 */
.config-row .top-bar-item .input-small {
    flex: 1;
    min-width: 0;
}

/* 调整保存按钮样式以匹配大布局 */
.btn-save-large {
    height: 48px;
    padding: 0 28px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 40px;
    /* Changed to match status toggle's pill shape */
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-save-large:disabled {
    background: #cbd5e0;
    color: #718096;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-save-large:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 10px -1px rgba(37, 99, 235, 0.3);
}

/* 自定义下拉菜单组件样式（完全复用） */
.custom-select-wrapper {
    position: relative;
}

.custom-select-trigger {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
}

.custom-select-trigger:hover {
    border-color: #cbd5e0;
}

.custom-select-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #2d3748;
}

.custom-select-arrow {
    font-size: 10px;
    color: #718096;
    transition: transform 0.3s;
}

.custom-select-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    min-width: 100%;
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    max-height: 300px;
    overflow-y: auto;
    box-sizing: border-box;
}

/* 时间选择器网格布局 */
.custom-select-dropdown.time-grid.show {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    padding: 8px;
}

.custom-select-dropdown.time-grid .custom-select-option {
    padding: 8px 4px;
    text-align: center;
    border: 1px solid #edf2f7;
    border-radius: 4px;
    font-size: 12px;
}

.custom-select-dropdown.show {
    display: block;
    animation: fadeIn 0.2s;
}

/* 策略选择器下拉面板：宽度增大，高度自适应 */
#strategyOptions.show {
    width: 200%;
    min-width: 120px;
    max-height: none;
    left: 0;
    right: auto;
}

.custom-select-dropdown.time-grid.show {
    display: grid;
}

.custom-select-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #2d3748;
    border-bottom: 1px solid #f7fafc;
}

.custom-select-option:hover {
    background: #f7fafc;
}

.custom-select-option.selected {
    background: #edf2f7;
    color: #667eea;
    font-weight: 600;
}

/* 输入框 */
.input-small {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    width: 100%;
}

.input-small:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 策略状态切换按钮 */
.status-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    height: 48px;
    border-radius: 24px;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
}

.status-toggle:hover {
    transform: scale(1.02);
}

/* enabled=true: 红色，实盘运行中 */
.status-toggle.active {
    background: #fde8e8;
    color: #9b1c1c;
    border-color: #f98080;
}

/* enabled=false: 绿色，模拟运行中 */
.status-toggle.inactive {
    background: #def7ec;
    color: #03543f;
    border-color: #31c48d;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* enabled=true: 红色指示灯 */
.active .status-indicator {
    background: #f98080;
    box-shadow: 0 0 8px #f98080;
}

/* enabled=false: 绿色指示灯 */
.inactive .status-indicator {
    background: #31c48d;
    box-shadow: 0 0 8px #31c48d;
}

/* 内容区域 - 订单记录居中显示 */
.main-content-wrapper {
    flex: 1;
    overflow: hidden;
    background: #f0f2f5;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: stretch;
    padding: 0;
    box-sizing: border-box;
}

.main-content {
    height: 100%;
    padding: 24px;
    width: 90vw;
    min-width: 85vw;
    max-width: 1800px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

/* 右侧数据区域 - 桌面端隐藏 */
.right-panel {
    display: none;
}

/* 右侧上方状态区域 */
.panel-state {
    height: 18%;
    /* 增加高度，避免滚动条 */
    border-bottom: 2px solid #e2e8f0;
    padding: 2px 6px;
    overflow-y: auto;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    /* 防止被压缩 */
}

.panel-state-title {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 2px;
    padding-bottom: 2px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* .title-text 标题通过父元素的 text-align: center 居中 */

.panel-state-title .update-time {
    position: absolute;
    right: 0;
    font-size: 11px;
    color: #94a3b8;
    font-weight: normal;
}

.state-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 3列布局 */
    gap: 2px;
    font-size: 12px;
    flex: 1;
}

.state-item {
    background: white;
    padding: 2px 4px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 40px;
}

/* 用户名容器可点击样式 */
.state-item-username,
.state-item[data-action="switch-api"] {
    cursor: pointer;
    transition: all 0.2s;
}

.state-item-username:hover,
.state-item[data-action="switch-api"]:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.state-label {
    color: #94a3b8;
    font-size: 13px;
    /* 缩小1/3: 20px → 13px */
    margin-bottom: 2px;
    font-weight: 500;
}

.state-value {
    color: #1e293b;
    font-weight: 600;
    font-size: 16px;
    /* 缩小1/3: 24px → 16px */
    word-break: break-all;
}

/* 右侧下方历史区域 (80%) */
.panel-history {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-history-title {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    text-align: center;
}

.panel-history-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 历史记录表格样式 */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 20px;
}

.history-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc;
}

.history-table th {
    padding: 10px 8px;
    text-align: center;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
    font-size: 20px;
    white-space: nowrap;
}

.history-table td {
    padding: 4px 4px;
    border-bottom: 1px solid #f1f5f9;
    min-height: 40px;
    height: 40px;
    color: #334155;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
}

.history-table tbody tr:hover {
    background: #f8fafc;
    position: relative;
    z-index: 1000;
    /* 高于 thead 的 z-index: 10 */
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}

.status-pending {
    background: #fef3c7;
    color: #f59e0b;
}

.status-win {
    background: #d1fae5;
    color: #10b981;
}

.status-loss {
    background: #fee2e2;
    color: #ef4444;
}

/* 列表容器 */
.list-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

/* 投注内容号码球样式 */
.bet-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    /* 减小间距 */
    font-family: 'Roboto Mono', 'Consolas', monospace;
    white-space: nowrap;
}

.bet-ball {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 24px;
    /* 缩小球体 */
    height: 24px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #334155;
    font-weight: bold;
    font-size: 13px;
    /* 缩小字体 */
    position: relative;
    border: 1px solid #cbd5e0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* 不同的球色 */
.bet-ball.rank-1 {
    background: linear-gradient(135deg, #fef9c3 0%, #facc15 100%);
    border-color: #eab308;
    color: #854d0e;
}

/* 冠军黄 */
.bet-ball.rank-2 {
    background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
    border-color: #94a3b8;
    color: #334155;
}

/* 亚军灰 */
.bet-ball.rank-3 {
    background: linear-gradient(135deg, #ffedd5 0%, #fb923c 100%);
    border-color: #f97316;
    color: #9a3412;
}

/* 季军铜 */

/* 自定义单选按钮组 */
.lottery-radio-btn {
    padding: 5px 12px;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    outline: none;
}

.lottery-radio-btn:hover {
    background: #f8fafc;
    color: #1e293b;
}

/* 选中状态 */
.lottery-radio-btn.ft.active {
    background-color: #eff6ff;
    /* blue-50 */
    color: #2563eb;
    /* blue-600 */
    border-color: #bfdbfe;
    /* blue-200 */
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.1);
}

.lottery-radio-btn.sc.active {
    background-color: #fdf2f8;
    /* pink-50 */
    color: #db2777;
    /* pink-600 */
    border-color: #fbcfe8;
    /* pink-200 */
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(219, 39, 119, 0.1);
}

.bet-rate {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    padding: 1px 4px;
    border-radius: 10px;
    font-weight: bold;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    min-width: 12px;
    text-align: center;
    z-index: 2;
    transform: scale(0.9);
}

/* ... 前面的 CSS 保持 ... */

.list-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    flex-shrink: 0;
    /* 标题栏也不要缩小 */
}

.list-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 16px;
    /* 增加间距 */
}

/* 优化表头和单元格样式 */
td {
    padding: 4px 6px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    min-height: 40px;
    height: 40px;
}

/* 列特定样式 */
.col-center {
    text-align: center;
}

.col-right {
    text-align: right;
}

/* 统一表格列样式：20px 加粗 */
.col-time {
    font-size: 20px;
    font-weight: 600;
    color: #475569;
}

.col-period {
    font-size: 20px;
    font-weight: 600;
    color: #475569;
}

.col-result {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
    text-align: center;
}

.col-profit {
    font-size: 20px;
    font-weight: 600;
}

.col-cumulative {
    font-size: 20px;
    font-weight: 600;
}

/* 盈亏颜色 */
.profit-pos {
    color: #ef4444 !important;
}

/* 红 */
.profit-neg {
    color: #10b981 !important;
}

/* 绿 */
.profit-zero {
    color: #1e293b !important;
}

/* 黑 */

/* 徽章优化 */
.bet-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 底部合计 - 强制不缩小 */
.summary-bar {
    padding: 12px 24px;
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
    z-index: 20;
}

/* 统计行 */
.summary-row {
    display: flex;
    width: 100%;
    align-items: center;
    padding: 8px 0;
    gap: 24px;
}

.summary-row:first-child {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
}

.summary-row:last-child {
    padding-top: 10px;
}

/* 统计项 */
.summary-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    min-width: 100px;
    flex-shrink: 0;
    white-space: nowrap;
}

.summary-item span:first-child {
    color: #64748b;
}

/* 标签列（第一列） */
.summary-item.summary-label {
    min-width: 100px;
    font-weight: 700;
    color: #2563eb;
}

.summary-row:last-child .summary-item.summary-label {
    color: #64748b;
}

/* 占位符（保持对齐） */
.summary-item.summary-placeholder {
    min-width: 100px;
    visibility: hidden;
}

/* 右侧分组 */
.summary-group-right {
    margin-left: auto;
    display: flex;
    gap: 40px;
    flex-shrink: 0;
}

.summary-group-right .summary-item {
    min-width: 130px;
}

/* 时间标签 */
.summary-time {
    font-size: 11px;
    color: #94a3b8;
    font-weight: normal;
}

/* 表格容器 - 确保滚动 */
.table-container {
    flex: 1;
    overflow-y: auto;
    position: relative;
}

/* 全局Tooltip样式 (JS控制，解决裁剪问题) */
#globalTooltip {
    position: fixed;
    display: none;
    background: #1e293b;
    color: #ffffff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    white-space: pre-wrap;
    z-index: 1000000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    min-width: 200px;
    line-height: 1.6;
    text-align: left;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hover-tooltip {
    cursor: help;
    text-decoration: underline dotted #cbd5e0;
}





/* 开奖结果样式 */
.result-nums {
    font-family: 'Roboto Mono', 'Consolas', monospace;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: 1px;
    font-size: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 20px;
    table-layout: fixed;
    /* 强制固定列宽，防止被撑开 */
}

th {
    text-align: left;
    padding: 10px 12px;
    /* 减小内边距 */
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

td {
    padding: 4px 6px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 40px;
    height: 40px;
    font-size: 20px;
    font-weight: 600;
    /* 超出显示省略号 */
}

/* 彩种行背景色 */
tr.row-ft {
    background-color: #eff6ff;
    /* 浅蓝色 */
}

tr.row-ft:hover {
    background-color: #dbeafe;
}

tr.row-sc {
    background-color: #fdf2f8;
    /* 浅粉色 */
}

tr.row-sc:hover {
    background-color: #fce7f3;
}

/* 名次颜色 */
.rank-1 {
    background: #fbbf24 !important;
    color: white !important;
}

/* 冠军-金 */
.rank-2 {
    background: #94a3b8 !important;
    color: white !important;
}

/* 亚军-银 */
.rank-3 {
    background: #f97316 !important;
    color: white !important;
}

/* 季军-橙 */

/* Toast */
#toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2000;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-success {
    background: #16a34a;
}

.toast-error {
    background: #dc2626;
}

/* 桌面端盈亏累计弹窗样式 */
#profitSummaryToast {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 41, 59, 0.95);
    border-radius: 12px;
    padding: 16px 28px;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 3500;
    display: none;
    /* 默认隐藏 */
    pointer-events: none;
    /* 可穿透，不影响点击操作 */
}

#profitSummaryToast.show {
    display: block;
    /* 点击后显示 */
}

#profitSummaryToast .profit-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 15px;
    font-weight: 600;
}

#profitSummaryToast .profit-summary-row:first-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 12px;
    margin-bottom: 4px;
}

#profitSummaryToast .profit-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
}

#profitSummaryToast .profit-value-win {
    color: #ef4444;
    /* 盈单红色 */
    font-size: 18px;
    font-weight: 700;
}

#profitSummaryToast .profit-value-loss {
    color: #10b981;
    /* 亏单绿色 */
    font-size: 18px;
    font-weight: 700;
}

.btn-save {
    margin-left: auto;
    padding: 8px 20px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save:disabled {
    background: #cbd5e0;
    color: #718096;
    cursor: not-allowed;
}

/* 自定义确认弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 600px;
    max-height: 90vh;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-overlay.show .modal-box {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-header.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.modal-header.danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.modal-header.info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.modal-header.warning .modal-icon {
    background: #f59e0b;
    color: white;
}

.modal-header.danger .modal-icon {
    background: #ef4444;
    color: white;
}

.modal-header.info .modal-icon {
    background: #3b82f6;
    color: white;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
}

.modal-body {
    padding: 16px 24px;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    text-align: center;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: pre-line;
}

.modal-footer {
    padding: 12px 24px;
    display: flex;
    justify-content: center;
    gap: 16px;
    background: #f9fafb;
    border-top: 1px solid #e2e8f0;
}

.modal-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.modal-btn-cancel {
    background: #e5e7eb;
    color: #374151;
}

.modal-btn-cancel:hover {
    background: #d1d5db;
}

.modal-btn-confirm {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.modal-btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.modal-btn-confirm.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.modal-btn-confirm.success:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
}

.modal-btn-confirm.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.modal-btn-confirm.info:hover {
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
}

.time-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    padding: 8px;
    width: 280px;
}

.time-grid .custom-select-option {
    text-align: center;
    border: 1px solid #edf2f7;
    border-radius: 4px;
    padding: 6px 0;
    font-size: 13px;
}

.time-grid .custom-select-option:hover,
.time-grid .custom-select-option.selected {
    background: #ebf8ff;
    border-color: #4299e1;
    color: #2b6cb0;
}

/* 隐藏移动端统计栏 - PC端已有.summary-bar */
.mobile-summary {
    display: none !important;
}

/* 桌面端：隐藏移动端专用元素 */
.mobile-only {
    display: none !important;
}

/* 桌面端：显示桌面端专用元素 */
.desktop-only {
    display: block !important;
}

/* 桌面端：隐藏期号结果弹窗（移动端专用） */
#periodResultModal {
    display: none !important;
}


/* API切换弹窗样式 */
#apiSwitchModal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
}

#apiSwitchModal.show {
    display: flex;
}

#apiSwitchModal .modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

#apiSwitchModal .modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    text-align: center;
    padding: 16px 20px;
    border-bottom: 2px solid #e2e8f0;
    flex-shrink: 0;
}

#apiSwitchModal .api-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

#apiSwitchModal .api-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

#apiSwitchModal .api-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 8px;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1;
}

#apiSwitchModal .api-table thead th:nth-child(1) {
    width: 10%;
}

#apiSwitchModal .api-table thead th:nth-child(2) {
    width: 30%;
}

#apiSwitchModal .api-table thead th:nth-child(3) {
    width: 40%;
}

#apiSwitchModal .api-table thead th:nth-child(4) {
    width: 10%;
}

#apiSwitchModal .api-table thead th:nth-child(5) {
    width: 10%;
}

#apiSwitchModal .api-row {
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

#apiSwitchModal .api-row:hover {
    background: #f8fafc;
}

#apiSwitchModal .api-row.active {
    background: #eff6ff;
}

#apiSwitchModal .api-row.new-row {
    background: #fefce8;
}

#apiSwitchModal .api-row td {
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
}

#apiSwitchModal .api-index {
    text-align: center;
    color: #64748b;
    font-weight: 600;
    font-size: 13px;
}

#apiSwitchModal .api-name-cell,
#apiSwitchModal .api-url-cell {
    text-align: left;
}

#apiSwitchModal .api-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

#apiSwitchModal .api-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#apiSwitchModal .api-row.active .api-input {
    border-color: #3b82f6;
    background: white;
}

#apiSwitchModal .api-current {
    text-align: center;
}

#apiSwitchModal .current-icon {
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s, transform 0.2s;
}

#apiSwitchModal .current-icon.active {
    opacity: 1;
}

#apiSwitchModal .current-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

#apiSwitchModal .api-action {
    text-align: center;
}

#apiSwitchModal .delete-icon {
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}

#apiSwitchModal .delete-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

#apiSwitchModal .modal-footer {
    padding: 16px 20px;
    border-top: 2px solid #e2e8f0;
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-shrink: 0;
}

#apiSwitchModal .modal-btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    min-width: 100px;
}

#apiSwitchModal .modal-btn-cancel {
    background: #e5e7eb;
    color: #374151;
}

#apiSwitchModal .modal-btn-cancel:hover {
    background: #d1d5db;
}

#apiSwitchModal .modal-btn-confirm {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

#apiSwitchModal .modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* 命中统计弹窗样式 */
#hitSummaryModal .hit-summary-box {
    width: 500px;
    max-width: 90%;
    max-height: 70vh;
    position: relative;
}

#hitSummaryModal .modal-header {
    padding: 12px 20px;
}

#hitSummaryModal .hit-summary-body {
    padding: 0;
    text-align: left;
    max-height: 50vh;
    overflow-y: auto;
}

.hit-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.hit-summary-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    padding: 10px 12px;
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
}

.hit-summary-table tbody td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.hit-summary-table tbody tr:hover {
    background: #f8fafc;
}

/* 号码球样式 - 圆角正方形色块（与date.css完全一致） */
.number-ball {
    display: inline-block;
    width: 32px;
    height: 32px;
    line-height: 32px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    cursor: pointer;
}

.number-ball:hover {
    transform: scale(1.1);
}

/* 号码球颜色 1-10 */
.ball-1 {
    background: #FFD700;
}

.ball-2 {
    background: #1E90FF;
}

.ball-3 {
    background: #4A4A4A;
}

.ball-4 {
    background: #FF8C00;
}

.ball-5 {
    background: #00CED1;
}

.ball-6 {
    background: #8B00FF;
}

.ball-7 {
    background: #A9A9A9;
}

.ball-8 {
    background: #FF0000;
}

.ball-9 {
    background: #8B4513;
}

.ball-10 {
    background: #32CD32;
}

/* 空球样式 */
.ball-empty {
    background: #f1f5f9;
    color: #cbd5e0;
    font-size: 12px;
    text-shadow: none;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.05);
    cursor: default;
}

.ball-empty:hover {
    transform: none;
}