/* 双色球注数统计 —— 全站样式（前台 + 后台） */

:root {
    --bg: #f4f6fa;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --red: #e0383e;
    --red-dark: #b8272d;
    --blue: #2f6fed;
    --blue-dark: #1f55c4;
    --accent: #1f2937;
    --ok: #15803d;
    --warn: #b45309;
    --radius: 14px;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 28px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand { font-size: 18px; font-weight: 700; letter-spacing: .5px; }

.topnav { display: flex; gap: 18px; font-size: 14px; }
.topnav a { color: var(--muted); }
.topnav a.active { color: var(--text); font-weight: 600; }

.page { max-width: 1080px; margin: 24px auto 48px; padding: 0 20px; display: flex; flex-direction: column; gap: 18px; }

/* 顶部主标题（渐变色） */
.hero { text-align: center; padding: 6px 0 2px; }
.hero-title {
    margin: 0;
    font-size: clamp(28px, 5vw, 46px);
    font-weight: 800;
    letter-spacing: 8px;
    line-height: 1.25;
    background-image: linear-gradient(92deg, #e0383e 0%, #d13a63 30%, #7c53c9 62%, #2f6fed 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}
.hero-sub {
    margin: 10px 0 0;
    font-size: 14px;
    color: var(--muted);
    letter-spacing: 1px;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 22px;
}

.card h2 { margin: 0; font-size: 17px; }
.card h2 small { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 8px; }

/* 顶部状态区 */
.status-main { display: flex; flex-wrap: wrap; gap: 28px; }
.status-item { display: flex; flex-direction: column; gap: 2px; min-width: 160px; }
.status-item .label { font-size: 12px; color: var(--muted); }
.status-item strong { font-size: 18px; }
.status-item .sub { font-size: 12px; color: var(--muted); }
.draw-state.drawing { color: var(--red); }
.draw-state.not-drawing { color: var(--muted); }

.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.hint.small { font-size: 12px; }

/* 选号区 */
.preview { display: flex; flex-wrap: wrap; gap: 24px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.preview-group { display: flex; align-items: center; gap: 12px; }
.preview-group .label { font-size: 12px; color: var(--muted); }

.ball-row { display: flex; gap: 8px; align-items: center; min-height: 38px; }
.empty-hint { color: #b6bcc8; font-size: 13px; }

.ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fff;
}
.ball.sm { width: 32px; height: 32px; font-size: 14px; }
.ball.md { width: 38px; height: 38px; font-size: 15px; }
.ball.red { background: var(--red); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); }
.ball.blue { background: var(--blue); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); }
.ball.ghost { background: #eef1f6; color: #9aa3b2; font-weight: 500; }

.picker-block { margin-top: 18px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.counter { font-size: 13px; color: var(--muted); }

.number-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; margin-top: 12px; }
.blue-grid { grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); max-width: 820px; }

.number-btn {
    appearance: none;
    border: 1px solid var(--line);
    background: #fafbfd;
    border-radius: 10px;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #4b5563;
    cursor: pointer;
    transition: transform .06s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.number-btn:hover { border-color: #c8d0dd; background: #f1f4f9; }
.number-btn:active { transform: scale(.96); }

.red-grid .number-btn.selected { background: var(--red); border-color: var(--red); color: #fff; }
.blue-grid .number-btn.selected { background: var(--blue); border-color: var(--blue); color: #fff; }
.number-btn:disabled { opacity: .45; cursor: not-allowed; }

.register-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--line); }

.picker-note { margin-top: 10px; padding: 8px 12px; background: #f7f9fc; border: 1px dashed var(--line); border-radius: 10px; }

/* 人机验证弹层 */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
}
.modal[hidden] { display: none; }
.modal-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, .2);
    padding: 22px 22px 18px;
}
.modal-card h3 { margin: 0 0 4px; font-size: 17px; }
.captcha-body { margin: 16px 0 6px; min-height: 60px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.captcha-question {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    text-align: center;
    padding: 10px 0 12px;
    font-variant-numeric: tabular-nums;
}
.captcha-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 18px;
    text-align: center;
    letter-spacing: 4px;
    outline: none;
}
.captcha-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }

.slider-track {
    position: relative;
    height: 44px;
    background: #eef1f6;
    border-radius: 22px;
    overflow: hidden;
    user-select: none;
    touch-action: none;
}
.slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: rgba(47, 111, 237, .16);
}
.slider-marker {
    position: absolute;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--blue);
    opacity: .55;
    border-radius: 1px;
}
.slider-handle {
    position: absolute;
    left: 0;
    top: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .12);
    cursor: grab;
    font-size: 20px;
    color: var(--blue);
}
.slider-handle:active { cursor: grabbing; }
.slider-hint { text-align: center; margin-top: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field input {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 15px;
    color: var(--text);
    background: #fff;
    outline: none;
}
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 111, 237, .12); }
.field input[type="number"] { width: 120px; }

button.primary, button.ghost {
    appearance: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
button.primary { background: var(--accent); color: #fff; }
button.primary:hover { background: #111827; }
button.primary:disabled { background: #9aa3b2; cursor: not-allowed; }
button.ghost { background: #fff; border-color: var(--line); color: #4b5563; }
button.ghost:hover { border-color: #c8d0dd; background: #f8fafc; }
button.ghost:disabled { opacity: .45; cursor: not-allowed; }
button.small { padding: 6px 12px; font-size: 13px; }
.link-button { display: inline-flex; align-items: center; border-radius: 10px; border: 1px solid var(--line); padding: 6px 12px; font-size: 13px; color: #4b5563; }
.link-button:hover { text-decoration: none; background: #f8fafc; }

/* 消息 */
.message { margin-top: 14px; font-size: 14px; min-height: 0; }
.message:empty { display: none; }
.message.success { color: var(--ok); background: #ecfdf3; border: 1px solid #bbf7d0; padding: 10px 14px; border-radius: 10px; }
.message.error { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; padding: 10px 14px; border-radius: 10px; }
.message.info { color: #1d4ed8; background: #eff6ff; border: 1px solid #bfdbfe; padding: 10px 14px; border-radius: 10px; }

/* 列表 */
.tabs { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.tabs button {
    appearance: none;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--muted);
    padding: 8px 16px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
}
.tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.table-wrap { margin-top: 12px; overflow-x: auto; }
table.combinations { width: 100%; border-collapse: collapse; font-size: 14px; }
table.combinations th, table.combinations td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.combinations thead th { font-size: 12px; color: var(--muted); font-weight: 500; background: #fafbfd; }
table.combinations tbody tr:hover { background: #fafbfd; }
table.combinations td.num, table.combinations th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.combinations td.empty { text-align: center; color: var(--muted); padding: 28px 0; }
.ball-cell { display: flex; gap: 5px; flex-wrap: wrap; }

.pager { display: flex; align-items: center; gap: 14px; margin-top: 16px; justify-content: flex-end; }

.footer { color: var(--muted); font-size: 12px; text-align: center; padding: 0 10px; }
.footer p { margin: 4px 0; }
.footer .slogan {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--text);
    margin-bottom: 6px;
}

.zero-tip { margin: 10px 0 0; }
.zero-tip strong { color: var(--blue); font-variant-numeric: tabular-nums; }

/* 登录页 */
.auth-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 28px; }
.auth-card h1 { margin: 0 0 4px; font-size: 20px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.auth-card .field input { width: 100%; }
.auth-card button.primary { width: 100%; }

/* 后台 */
.admin-main { max-width: 1040px; margin: 24px auto 48px; padding: 0 20px; display: flex; flex-direction: column; gap: 18px; }
.admin-user { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.inline-form { display: inline; }
.stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 12px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.stat strong.ok { color: var(--ok); }
.stat strong.warn { color: var(--warn); }

.grid-form { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; margin-top: 14px; }
.grid-form .field { min-width: 220px; flex: 1 1 220px; }
.grid-form .field input { width: 100%; }

.result-panel { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fafbfd; font-size: 14px; }
.result-panel h3 { margin: 0 0 8px; font-size: 15px; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.result-grid div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.result-grid span { display: block; font-size: 12px; color: var(--muted); }
.result-grid strong { font-size: 16px; font-variant-numeric: tabular-nums; }

code { background: #f1f4f9; padding: 1px 6px; border-radius: 6px; font-size: 12px; }

@media (max-width: 640px) {
    .topbar { padding: 12px 16px; }
    .page { padding: 0 12px; margin-top: 16px; }
    .hero { padding-top: 2px; }
    .hero-title { letter-spacing: 4px; }
    .hero-sub { font-size: 12px; letter-spacing: 0; }
    .card { padding: 16px; }
    .number-grid { grid-template-columns: repeat(6, 1fr); }
    .status-main { gap: 16px; }
    .status-item { min-width: 120px; }
    .register-bar { align-items: stretch; }
    .register-bar .field.inline { width: 100%; }
    .register-bar button { flex: 1; }
    .pager { justify-content: space-between; }
    .admin-user span { display: none; }
}
