/* ========== 预约登记系统 移动端样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff4ff;
    --success: #16a34a;
    --danger: #dc2626;
    --warn: #d97706;
    --text: #1f2937;
    --text-2: #6b7280;
    --border: #e5e7eb;
    --bg: #f3f5f9;
    --radius: 14px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}

.page { max-width: 520px; margin: 0 auto; padding-bottom: 48px; }

/* ---------- 顶部 ---------- */
.hero {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 55%, #60a5fa 100%);
    padding: 42px 24px 66px;
    text-align: center;
    color: #fff;
}
.hero h1 { font-size: 22px; font-weight: 700; letter-spacing: 1px; }
.hero-desc { margin-top: 8px; font-size: 13px; opacity: .9; }

/* ---------- 卡片 ---------- */
.card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(17, 24, 39, .06);
    padding: 20px;
    margin: -38px 16px 16px;
}
.card + .card { margin-top: -6px; }
.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title::before {
    content: "";
    width: 4px; height: 16px;
    background: var(--primary);
    border-radius: 2px;
}
.date-tip { font-size: 12px; color: var(--text-2); font-weight: 400; }

/* ---------- 表单 ---------- */
.form-item { margin-bottom: 16px; }
.form-item:last-child { margin-bottom: 0; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.req { color: var(--danger); font-style: normal; margin-right: 2px; }

.input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fafbfc;
    font-size: 16px;
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.input::placeholder { color: #9ca3af; }

.err-msg { color: var(--danger); font-size: 12px; min-height: 0; margin-top: 4px; display: none; }
.form-item.invalid .input, .form-item.invalid select.input { border-color: var(--danger); }
.form-item.invalid .err-msg { display: block; }

/* radio 选项按钮组 */
.radio-group { display: flex; flex-wrap: wrap; gap: 10px; }
.radio-item { flex: 1; min-width: 80px; }
.radio-item input { display: none; }
.radio-item span {
    display: flex; align-items: center; justify-content: center;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fafbfc;
    font-size: 15px;
    cursor: pointer;
    transition: all .15s;
    user-select: none;
}
.radio-item input:checked + span {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

select.input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ---------- 时段选择 ---------- */
.slot-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.slot-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all .15s;
    background: #fafbfc;
    position: relative;
}
.slot-item .slot-name { font-size: 15px; font-weight: 600; }
.slot-item .slot-time { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.slot-item .slot-remain { font-size: 12px; margin-top: 6px; }
.remain-ok { color: var(--success); }
.remain-few { color: var(--warn); }
.slot-item.full { opacity: .55; cursor: not-allowed; background: #f3f4f6; }
.slot-item.full .slot-remain { color: var(--text-2); }
.slot-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 1px var(--primary);
}
.slot-item.selected .slot-name { color: var(--primary); }
.slot-item.selected::after {
    content: "✓";
    position: absolute; top: 8px; right: 10px;
    width: 20px; height: 20px;
    background: var(--primary); color: #fff;
    border-radius: 50%;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
}

/* ---------- 提交 ---------- */
.submit-btn {
    display: block;
    width: calc(100% - 32px);
    max-width: 488px;
    margin: 20px auto 0;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
    transition: transform .1s, opacity .15s;
}
.submit-btn:active { transform: scale(.98); }
.submit-btn:disabled { opacity: .6; cursor: not-allowed; }
.form-footer { text-align: center; color: var(--text-2); font-size: 12px; margin-top: 12px; }

/* ---------- 成功遮罩（底部弹层，移动端友好） ---------- */
.mask {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, .55);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 99;
}
.mask-card {
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding: 28px 20px calc(28px + env(safe-area-inset-bottom));
    text-align: center;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: slideUp .28s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.success-icon {
    width: 64px; height: 64px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #ecfdf5;
    color: var(--success);
    font-size: 32px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--success);
}
.success-title { font-size: 19px; font-weight: 700; }
.success-sub { color: var(--warn); font-size: 13px; margin: 6px 0 16px; }

/* 预约凭证区 */
.voucher-box {
    background: var(--primary-light);
    border: 1px dashed var(--primary);
    border-radius: 14px;
    padding: 18px 16px 14px;
    margin-bottom: 16px;
}
.voucher-qr {
    display: inline-block;
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 1px 6px rgba(17, 24, 39, .08);
}
.voucher-qr canvas, .voucher-qr img { display: block; }
.voucher-code {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--primary);
    margin-top: 12px;
    font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
    word-break: break-all;
}
.voucher-tip { font-size: 12px; color: var(--text-2); margin-top: 4px; }

/* 预约详情列表 */
.voucher-info { text-align: left; margin-bottom: 18px; }
.vi-row {
    display: flex; justify-content: space-between;
    padding: 11px 2px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}
.vi-row:last-child { border-bottom: none; }
.vi-label { color: var(--text-2); flex-shrink: 0; margin-right: 16px; }
.vi-value { color: var(--text); font-weight: 600; text-align: right; word-break: break-all; }

.mask-btn {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, .3);
}

/* ---------- 提示卡片 ---------- */
.notice-card { text-align: center; padding: 36px 24px; }
.notice-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.notice-card p { color: var(--text-2); font-size: 14px; }

/* ---------- 加载中 ---------- */
.loading-tip { text-align: center; color: var(--text-2); font-size: 13px; padding: 8px 0; }
