/* ============================================================
   全局样式 - 号码投注统计结算系统
   深蓝 #081226 + 金融金 #eab308，大圆角 16-20px，紧凑布局
   全分辨率自适应：手机 / 平板 / 桌面 / 超宽屏
   ============================================================ */

:root {
    --bg-deep: #081226;
    --bg-card: #0f1c36;
    --bg-card-2: #162447;
    --gold: #eab308;
    --gold-light: #facc15;
    --gold-dark: #ca8a04;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(234, 179, 8, 0.2);
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 20px;
}

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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

/* 平板及以上放大基础字号 */
@media (min-width: 768px) {
    body { font-size: 15px; }
}
@media (min-width: 1024px) {
    body { font-size: 16px; }
}
@media (min-width: 1440px) {
    body { font-size: 16px; }
}

/* 隐藏滚动条 - 无痕滚动 */
::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 通用布局 - 响应式容器
   手机：全宽；平板/桌面：居中并限制最大宽度，利用屏幕空间 */
.app {
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg-deep);
    position: relative;
}

.page {
    padding: 16px;
    padding-bottom: 80px;
}

/* 平板及以上适当加宽 */
@media (min-width: 768px) {
    .app { max-width: 900px; }
    .page { padding: 20px 24px; padding-bottom: 84px; }
}

/* PC 大屏 */
@media (min-width: 1024px) {
    .app { max-width: 1100px; }
    .page { padding: 24px 28px; padding-bottom: 88px; }
}

/* 超宽屏 */
@media (min-width: 1440px) {
    .app { max-width: 1280px; }
}

/* 防止水平溢出的通用规则 */
img, table, pre, code {
    max-width: 100%;
}

/* 表格响应式：超出时横向滚动 */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* 预览表格样式 */
.preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.preview-table th,
.preview-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    word-break: break-all;
}
.preview-table th {
    color: var(--gold);
    font-weight: 600;
    font-size: 12px;
}
.preview-table tr:last-child td {
    border-bottom: none;
}
@media (min-width: 768px) {
    .preview-table { font-size: 14px; }
    .preview-table th,
    .preview-table td { padding: 10px 14px; }
}

/* 顶部导航栏 */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-deep);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.navbar .title {
    font-size: 17px;
    font-weight: 600;
    color: var(--gold);
}

/* 响应式导航栏 */
@media (min-width: 768px) {
    .navbar { padding: 16px 24px; }
    .navbar .title { font-size: 19px; }
}
@media (min-width: 1024px) {
    .navbar { padding: 18px 28px; }
    .navbar .title { font-size: 21px; }
}

.navbar .sub {
    font-size: 12px;
    color: var(--text-muted);
}

.navbar .right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #081226;
}

.btn-gold:active {
    transform: scale(0.97);
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 1px solid var(--gold);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn-sm {
    min-height: 32px;
    padding: 0 12px;
    font-size: 13px;
}

/* 卡片 */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

/* 响应式卡片 */
@media (min-width: 768px) {
    .card { padding: 20px; margin-bottom: 16px; }
}
@media (min-width: 1024px) {
    .card { padding: 24px; margin-bottom: 18px; }
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gold);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

/* 表单 */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    background: var(--bg-card-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--gold);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    appearance: none;
}

/* 数字输入 */
input[type="number"] {
    -moz-appearance: textfield;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(15, 28, 54, 0.95);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    z-index: 9999;
    border: 1px solid var(--gold);
    max-width: 80%;
    text-align: center;
    animation: toastIn 0.25s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -60%); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

/* 确认弹窗（强排他，遮罩不可关闭） */
.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    animation: modalIn 0.25s ease;
}

/* 平板/桌面弹窗加宽 */
@media (min-width: 768px) {
    .modal-box { max-width: 520px; }
}
@media (min-width: 1024px) {
    .modal-box { max-width: 600px; }
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    font-weight: 600;
    color: var(--gold);
}

.modal-body {
    padding: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.modal-footer {
    padding: 12px 16px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 自定义日期选择器 */
.dp-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 8px;
}
.dp-btn {
    background: var(--bg-card-2);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    min-width: 36px;
    height: 36px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.dp-btn:active { background: var(--gold); color: var(--bg-dark); }
.dp-title {
    flex: 1;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--gold);
}
.dp-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 6px;
}
.dp-weekdays span {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 6px 0;
}
.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.dp-empty { display: block; }
.dp-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-card-2);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.dp-day:active { transform: scale(0.92); }
.dp-today {
    border: 1px solid var(--gold);
    color: var(--gold);
}
.dp-sel {
    background: var(--gold) !important;
    color: var(--bg-dark) !important;
    font-weight: 700;
}

/* 日期输入框（只读，触发自定义选择器） */
input.date-input[readonly] {
    cursor: pointer;
    background: var(--bg-card-2);
}
input.date-input[readonly]:active {
    border-color: var(--gold);
}

/* 底部导航 */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 720px;
    margin: 0 auto;
    background: var(--bg-card);
    display: flex;
    border-top: 1px solid var(--border);
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 768px) { .tabbar { max-width: 900px; } }
@media (min-width: 1024px) { .tabbar { max-width: 1100px; } }
@media (min-width: 1440px) { .tabbar { max-width: 1280px; } }

.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 2px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 10px;
    min-height: 50px;
    white-space: nowrap;
}

.tabbar-item.active {
    color: var(--gold);
}

.tabbar-item .icon {
    font-size: 18px;
    margin-bottom: 2px;
}

/* 平板/PC 放大导航图标 */
@media (min-width: 768px) {
    .tabbar-item { font-size: 12px; padding: 10px 4px; }
    .tabbar-item .icon { font-size: 22px; }
}

/* 空数据 */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* 金额/数字 */
.amount {
    font-family: "SF Mono", "Monaco", monospace;
    font-weight: 600;
}

.text-gold { color: var(--gold); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--text-muted); }

/* 通用工具 */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mb-12 { margin-bottom: 12px; }

/* 列表行 */
.list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.list-row:last-child { border-bottom: none; }
