:root {
    --primary: #1f6feb;
    --primary-dark: #1657bd;
    --bg: #f4f6f9;
    --card: #ffffff;
    --text: #1f2329;
    --muted: #8a9099;
    --line: #eceff3;
    --success: #16a34a;
    --warn: #d97706;
    --danger: #dc2626;
    --radius: 12px;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.view { display: none; }
.view.active { display: block; }
.hidden { display: none !important; }

/* ---------------- 鉴权页 ---------------- */
.auth-wrap { padding: 56px 20px 32px; }
.auth-logo { font-size: 52px; text-align: center; }
.auth-title { font-size: 24px; text-align: center; margin-top: 12px; font-weight: 600; }
.auth-sub { text-align: center; color: var(--muted); font-size: 13px; margin-top: 4px; letter-spacing: 2px; }
.auth-card {
    background: var(--card); border-radius: var(--radius); padding: 20px;
    margin-top: 28px; box-shadow: 0 2px 12px rgba(31, 35, 41, .06);
}
.auth-tip { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.6; }
.auth-status { text-align: center; padding: 8px 0 4px; }
.auth-error-ico { font-size: 34px; line-height: 1.2; }
.auth-error-title { font-size: 16px; font-weight: 600; margin-top: 8px; color: var(--text); }
.spinner {
    width: 30px; height: 30px; margin: 6px auto 0;
    border: 3px solid rgba(31, 111, 235, .18);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- 表单 ---------------- */
.field { display: block; margin-bottom: 16px; }
.field-label { display: block; font-size: 13px; color: #5b6270; margin-bottom: 6px; }
.field-label .req { color: var(--danger); font-style: normal; }
.input {
    width: 100%; height: 44px; padding: 0 12px; font-size: 15px; color: var(--text);
    background: #fff; border: 1px solid #dfe3e8; border-radius: 8px; outline: none;
    appearance: none; -webkit-appearance: none;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 111, 235, .12); }
select.input { background-image: none; }

.btn {
    height: 44px; padding: 0 18px; border: none; border-radius: 8px;
    font-size: 15px; cursor: pointer; background: #eef1f5; color: var(--text);
}
.btn:active { opacity: .85; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-plain { background: #f1f3f6; color: #5b6270; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------------- 顶栏 ---------------- */
.topbar {
    background: linear-gradient(135deg, #2f7bf6, #1f6feb);
    color: #fff; padding: 16px 16px 20px;
    display: flex; justify-content: space-between; align-items: center;
    border-radius: 0 0 18px 18px;
}
.topbar-title { font-size: 20px; font-weight: 600; }
.topbar-sub { font-size: 12px; opacity: .85; margin-top: 2px; word-break: break-all; }
.point-box { text-align: center; background: rgba(255, 255, 255, .16); border-radius: 10px; padding: 6px 14px; }
.point-num { font-size: 22px; font-weight: 700; line-height: 1.1; }
.point-label { font-size: 11px; opacity: .9; }

/* ---------------- 列表 ---------------- */
.content { padding: 8px 16px 84px; }
.list { display: block; }
.empty { text-align: center; color: #b3b8c0; padding: 64px 0; font-size: 14px; }
.empty-ico { font-size: 44px; display: block; margin-bottom: 10px; opacity: .5; }

.card {
    background: var(--card); border-radius: var(--radius); padding: 14px;
    margin-bottom: 12px; box-shadow: 0 1px 6px rgba(31, 35, 41, .05);
}
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.card-title { font-size: 16px; font-weight: 600; flex: 1; }
.card-row { font-size: 13px; color: #6b7280; margin-top: 6px; }
.card-row .ico { margin-right: 4px; opacity: .75; }
.card-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.tag-success { background: #e7f7ee; color: var(--success); }
.tag-warn { background: #fdf3e2; color: var(--warn); }
.tag-muted { background: #eef1f5; color: #8a9099; }

.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 6px; }
.btn-outline { background: #fff; border: 1px solid #dfe3e8; color: #5b6270; }
.btn-danger-outline { background: #fff; border: 1px solid #f3c6c6; color: var(--danger); }
.btn-primary-sm { background: var(--primary); color: #fff; }

.venue-card { cursor: pointer; }
.venue-card:active { background: #fafbfc; }
.venue-guige {
    font-size: 12px; color: var(--warn); background: #fdf3e2;
    border-radius: 6px; padding: 1px 8px; margin-left: 6px; vertical-align: 1px;
}

/* ---------------- 底部 tab ---------------- */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; height: 58px;
    display: flex; background: #fff; border-top: 1px solid var(--line);
    box-shadow: 0 -1px 8px rgba(31, 35, 41, .05); z-index: 100;
}
.tab-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #9aa0a8; text-decoration: none; font-size: 12px; gap: 2px;
}
.tab-item .tab-ico { font-size: 19px; }
.tab-item.active { color: var(--primary); font-weight: 600; }

/* ---------------- 下单弹层 ---------------- */
.sheet-mask {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .4);
    opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 200;
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 201;
    background: #fff; border-radius: 16px 16px 0 0;
    transform: translateY(100%); transition: transform .25s ease;
    max-height: 86vh; display: flex; flex-direction: column;
}
.sheet.show { transform: translateY(0); }
.sheet-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px; border-bottom: 1px solid var(--line);
}
.sheet-title { font-size: 16px; font-weight: 600; }
.sheet-close { color: var(--muted); font-size: 18px; cursor: pointer; padding: 0 4px; }
.sheet-body { padding: 16px; overflow-y: auto; flex: 1; }
.venue-brief {
    background: #f7f9fc; border-radius: 10px; padding: 12px;
    font-size: 13px; color: #5b6270; margin-bottom: 16px; line-height: 1.7;
}
.venue-brief strong { color: var(--text); font-size: 15px; display: block; margin-bottom: 2px; }
.sheet-foot { display: flex; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1; }

/* ---------------- toast ---------------- */
.toast {
    position: fixed; left: 50%; top: 44%; transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, .8); color: #fff; font-size: 14px;
    padding: 10px 18px; border-radius: 8px; max-width: 74vw; text-align: center;
    opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 300; line-height: 1.5;
}
.toast.show { opacity: 1; }

/* ---------------- 预约规则弹窗 ---------------- */
.rule-mask {
    position: fixed; inset: 0; z-index: 400;
    background: rgba(0, 0, 0, .5);
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.rule-mask.show { opacity: 1; pointer-events: auto; }
.rule-modal {
    position: fixed; left: 50%; top: 50%; z-index: 401;
    transform: translate(-50%, -50%) scale(.92);
    width: 88vw; max-width: 420px; max-height: 80vh;
    background: #fff; border-radius: 16px;
    display: flex; flex-direction: column;
    opacity: 0; pointer-events: none; transition: all .25s ease;
}
.rule-modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.rule-head {
    padding: 18px 18px 12px; border-bottom: 1px solid var(--line);
    text-align: center;
}
.rule-title { font-size: 17px; font-weight: 700; color: var(--text); }
.rule-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rule-body {
    padding: 16px 18px; overflow-y: auto; flex: 1;
    -webkit-overflow-scrolling: touch;
}
.rule-body h4 {
    font-size: 14px; font-weight: 700; color: var(--text);
    margin: 14px 0 6px;
}
.rule-body h4:first-child { margin-top: 0; }
.rule-body p {
    font-size: 13px; color: #5b6270; line-height: 1.7;
    margin: 4px 0; text-align: justify;
}
.rule-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

/* ---------------- 场馆搜索 ---------------- */
.search-bar { padding: 12px 16px 8px; position: relative; }
.search-bar .input { padding-left: 36px; padding-right: 34px; background: #f7f9fc; }
.search-ico {
    position: absolute; left: 28px; top: 50%;
    transform: translateY(calc(-50% - 4px));
    font-size: 14px; pointer-events: none;
}
.search-clear {
    position: absolute; right: 26px; top: 50%;
    transform: translateY(calc(-50% - 4px));
    color: var(--muted); font-size: 14px;
    cursor: pointer; padding: 6px;
}

/* ---------------- 预约提交确认弹窗 ---------------- */
.confirm-text { font-size: 14px; color: var(--text); line-height: 1.9; text-align: justify; }
.confirm-foot {
    display: flex; gap: 12px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
}
.confirm-foot .btn { flex: 1; }

/* ---------------- 日期选择框 / 时段网格（替代原生 select） ---------------- */
.field { position: relative; }
.input-pick { cursor: pointer; }
.pick-arrow {
    position: absolute; right: 14px; bottom: 12px;
    color: var(--muted); font-size: 12px; pointer-events: none;
}
.hour-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    margin-top: 2px;
}
.hour-btn {
    height: 38px; border: 1px solid var(--line); border-radius: 8px;
    background: #f7f9fc; color: var(--text); font-size: 13px;
    font-family: inherit; cursor: pointer; padding: 0;
}
.hour-btn.active {
    background: var(--primary); border-color: var(--primary);
    color: #fff; font-weight: 600;
}
/* 日期弹层列表 */
.pick-list { padding: 4px 0; max-height: 60vh; }
.pick-item {
    padding: 14px 18px; font-size: 14px; color: var(--text);
    border-bottom: 1px solid var(--line); cursor: pointer;
}
.pick-item:last-child { border-bottom: none; }
.pick-item.selected { color: var(--primary); font-weight: 600; }
.pick-item.selected::after { content: '✓'; float: right; }
