﻿* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg-primary: #1a1a2e; --bg-secondary: #16213e; --bg-card: #0f3460;
    --text-primary: #e6e6e6; --text-secondary: #a0a0a0;
    --accent: #e94560; --accent-hover: #ff6b81;
    --success: #2ed573; --warning: #ffa502; --danger: #ff4757;
    --border: #2a2a4a; --sidebar-width: 220px;
}
body { font-family: 'Microsoft YaHei', sans-serif; background: var(--bg-primary); color: var(--text-primary); }

/* 登录页 */
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #1a1a2e, #0f3460); }
.login-box { background: var(--bg-secondary); padding: 40px; border-radius: 12px; width: 380px; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.login-box h1 { font-size: 28px; margin-bottom: 8px; }
.login-box p { color: var(--text-secondary); margin-bottom: 24px; }
.form-group { margin-bottom: 16px; }
.form-group input, .form-group select { width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-primary); color: var(--text-primary); font-size: 14px; }
.form-group input:focus { outline: none; border-color: var(--accent); }
.btn-primary { width: 100%; padding: 12px; background: var(--accent); color: white; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { padding: 8px 16px; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.btn-secondary:hover { background: var(--border); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 4px; border: none; cursor: pointer; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: #333; }
.btn-danger { background: var(--danger); color: white; }
.error-text { color: var(--danger); margin-top: 12px; font-size: 13px; }

/* 主布局 */
.main-app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); background: var(--bg-secondary); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; }
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border); }
.sidebar-header h2 { font-size: 18px; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-item { display: block; padding: 12px 20px; color: var(--text-secondary); text-decoration: none; transition: all 0.2s; }
.nav-item:hover, .nav-item.active { background: var(--bg-card); color: var(--text-primary); border-left: 3px solid var(--accent); }
.sidebar-footer { padding: 12px 0; border-top: 1px solid var(--border); }
.content { flex: 1; margin-left: var(--sidebar-width); padding: 24px; }
.content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.content-header h2 { font-size: 22px; }

/* 卡片和统计 */
.stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-secondary); padding: 20px; border-radius: 10px; border: 1px solid var(--border); }
.stat-value { font-size: 28px; font-weight: bold; color: var(--accent); }
.stat-label { color: var(--text-secondary); margin-top: 4px; font-size: 13px; }
.card { background: var(--bg-secondary); padding: 20px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 20px; }
.card h3 { margin-bottom: 16px; font-size: 16px; }

/* 表格 */
.toolbar { display: flex; gap: 12px; margin-bottom: 16px; }
.toolbar input, .toolbar select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-primary); color: var(--text-primary); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--text-secondary); font-weight: normal; font-size: 13px; }
.data-table tr:hover { background: rgba(255,255,255,0.03); }
.status-tag { padding: 3px 8px; border-radius: 4px; font-size: 12px; }
.status-success { background: rgba(46,213,115,0.2); color: var(--success); }
.status-pending { background: rgba(255,165,2,0.2); color: var(--warning); }
.status-failed { background: rgba(255,71,87,0.2); color: var(--danger); }
.status-active { background: rgba(46,213,115,0.2); color: var(--success); }
.status-disabled { background: rgba(255,71,87,0.2); color: var(--danger); }
.bet-detail-cell { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.bet-content-cell { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.bet-detail-pre { background: var(--bg-primary); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; max-height: none; overflow: visible; white-space: pre-wrap; word-break: break-all; font-size: 13px; line-height: 1.6; margin-bottom: 12px; }
.bet-items-table { margin-bottom: 12px; font-size: 12px; }
.bet-items-table th, .bet-items-table td { padding: 8px 10px; white-space: nowrap; }
.bet-items-table td:nth-child(2) { white-space: normal; max-width: 180px; }
.modal-wide { max-width: 720px; width: 92%; }

/* 投注明细弹窗：内容区可滚动（625 注等长列表） */
.modal-bet-detail .modal-content {
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.modal-bet-detail .bet-detail-body {
    flex: 1;
    min-height: 120px;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-right: 4px;
}
.modal-bet-detail .bet-detail-body::-webkit-scrollbar { width: 8px; }
.modal-bet-detail .bet-detail-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.modal-bet-detail .bet-items-table thead th { position: sticky; top: 0; background: var(--bg-secondary); z-index: 1; }

/* 图表 */
.chart-container { height: 200px; display: flex; align-items: flex-end; gap: 4px; padding-top: 20px; }
.chart-bar { flex: 1; background: var(--accent); border-radius: 4px 4px 0 0; min-width: 8px; transition: height 0.3s; position: relative; }
.chart-bar:hover { opacity: 0.8; }
.chart-bar-label { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--text-secondary); white-space: nowrap; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.pagination button { padding: 6px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary); cursor: pointer; }
.pagination button.active { background: var(--accent); border-color: var(--accent); }

/* 弹窗 */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); display: flex; justify-content: center; align-items: flex-start; z-index: 1000; overflow-y: auto; padding: 24px 16px; -webkit-overflow-scrolling: touch; }
.modal-content { background: var(--bg-secondary); padding: 24px; border-radius: 12px; width: 400px; margin: auto; flex-shrink: 0; }
.modal-content h3 { margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 16px; }
