/* 客户自助页共享皮肤：冷纸底 + 电光蓝交互
   用于到店预约 / 预约查询 / 延保 / 开票 / 开票进度 */

:root {
    --cf-bg: #f1f5f9;
    --cf-surface: #ffffff;
    --cf-muted-panel: #f8fafc;
    --cf-field: #ffffff;
    --cf-field-focus: #ffffff;
    --cf-border: #e2e8f0;
    --cf-border-strong: #93c5fd;
    --cf-ink: #0f172a;
    --cf-muted: #64748b;
    --cf-dim: #94a3b8;
    --cf-primary: #2563eb;
    --cf-primary-hover: #1d4ed8;
    --cf-primary-soft: #eff6ff;
    --cf-primary-ring: rgba(37, 99, 235, 0.18);
    --cf-success: #059669;
    --cf-danger: #dc2626;
    --cf-warn: #d97706;
    --cf-r-xl: 24px;
    --cf-r-lg: 16px;
    --cf-r-md: 12px;
    --cf-r-sm: 10px;
    --cf-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
    --cf-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html { height: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--cf-bg);
    color: var(--cf-ink);
    font-family: Inter, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

.bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(70% 42% at 50% -6%, rgba(37, 99, 235, 0.08), transparent 70%),
        radial-gradient(40% 30% at 100% 0%, rgba(14, 165, 233, 0.06), transparent 62%),
        var(--cf-bg);
}

.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 560px;
    padding: calc(env(safe-area-inset-top, 0px) + 0.85rem) 1.1rem 0.75rem;
}

.top-back,
.top-link {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--cf-r-md);
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    color: var(--cf-ink);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.top-back:hover,
.top-link:hover { border-color: #cbd5e1; }
.top-back:active,
.top-link:active { transform: scale(0.97); }

.top-title { flex: 1; min-width: 0; }
.top-title h1 {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.top-title p {
    margin: 2px 0 0;
    font-size: 0.75rem;
    color: var(--cf-muted);
}

.top-link {
    flex-shrink: 0;
    gap: 6px;
    padding: 0 13px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.wrap {
    flex: 1;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 1.1rem calc(env(safe-area-inset-bottom, 0px) + 2rem);
}

.wrap.has-submit-bar {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 7rem);
}

.card {
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-r-lg);
    padding: 1.15rem 1.1rem 1.25rem;
    margin-bottom: 0.85rem;
    box-shadow: var(--cf-shadow);
}

.sec-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 0.85rem;
}
.sec-idx {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    background: var(--cf-primary);
}
.sec-head h2 { margin: 0; font-size: 0.94rem; font-weight: 700; }
.sec-head .sec-note { margin-left: auto; font-size: 0.7rem; color: var(--cf-muted); font-weight: 500; }

.page-lead { margin: 0 0 1.05rem; }
.page-lead h1 {
    margin: 0 0 0.3rem;
    font-size: 1.28rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.page-lead .sub,
.sub {
    margin: 0;
    color: var(--cf-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--cf-muted);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 500;
    margin-bottom: 0.85rem;
    min-height: 44px;
}
.back:hover { color: var(--cf-primary); }

.notice,
.pay-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 13px;
    border-radius: var(--cf-r-md);
    font-size: 0.8rem;
    line-height: 1.55;
    margin-bottom: 0.9rem;
}
.notice {
    color: #1e3a5f;
    background: var(--cf-primary-soft);
    border: 1px solid #bfdbfe;
}
.notice i { color: var(--cf-primary); margin-top: 2px; }
.pay-note {
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
}
.pay-note i { margin-top: 0.15rem; color: var(--cf-warn); }

.flash {
    padding: 0.75rem 0.9rem;
    border-radius: var(--cf-r-md);
    font-size: 0.86rem;
    margin-bottom: 1rem;
    line-height: 1.45;
}
.flash-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.flash-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--cf-border);
    background: var(--cf-muted-panel);
    color: var(--cf-ink);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.18s var(--cf-ease), background 0.18s var(--cf-ease), transform 0.18s var(--cf-ease);
}
.chip:active { transform: scale(0.97); }
.chip.selected {
    background: var(--cf-primary-soft);
    border-color: #93c5fd;
    color: var(--cf-primary-hover);
    font-weight: 600;
}

.date-rail {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.date-rail::-webkit-scrollbar { display: none; }
.date-cell {
    flex: 0 0 auto;
    width: 60px;
    padding: 10px 0;
    border-radius: var(--cf-r-md);
    border: 1px solid var(--cf-border);
    background: var(--cf-muted-panel);
    text-align: center;
    cursor: pointer;
}
.date-cell:active { transform: scale(0.96); }
.date-cell .dc-week,
.date-cell .dc-mon { display: block; font-size: 0.66rem; color: var(--cf-muted); }
.date-cell .dc-day { display: block; font-size: 1.12rem; font-weight: 700; line-height: 1.3; }
.date-cell.selected {
    background: var(--cf-primary);
    border-color: var(--cf-primary);
    color: #fff;
}
.date-cell.selected .dc-week,
.date-cell.selected .dc-mon { color: rgba(255, 255, 255, 0.82); }

.slot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
@media (max-width: 360px) {
    .slot-grid { grid-template-columns: repeat(2, 1fr); }
}
.slot {
    padding: 10px 4px;
    border-radius: var(--cf-r-md);
    border: 1px solid var(--cf-border);
    background: var(--cf-muted-panel);
    text-align: center;
    cursor: pointer;
}
.slot:active { transform: scale(0.97); }
.slot .s-time { display: block; font-size: 0.86rem; font-weight: 600; }
.slot .s-left { display: block; font-size: 0.66rem; color: var(--cf-success); margin-top: 2px; }
.slot.tight .s-left { color: var(--cf-warn); }
.slot.disabled {
    opacity: 0.42;
    cursor: not-allowed;
    background: transparent;
}
.slot.disabled .s-left { color: var(--cf-muted); }
.slot.selected {
    background: var(--cf-primary);
    border-color: var(--cf-primary);
    color: #fff;
}
.slot.selected .s-left { color: rgba(255, 255, 255, 0.9); }
.slot-hint { font-size: 0.75rem; color: var(--cf-muted); padding: 1.2rem 0; text-align: center; }

.input-group { position: relative; margin-bottom: 0.85rem; }
.form-input,
.field input,
.field textarea {
    width: 100%;
    min-height: 48px;
    padding: 14px 15px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--cf-ink);
    background: var(--cf-field);
    border: 1.5px solid var(--cf-border);
    border-radius: var(--cf-r-md);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.input-group .form-input { padding-left: 44px; }
textarea.form-input,
.field textarea { min-height: 90px; resize: vertical; line-height: 1.55; }
.form-input::placeholder,
.field input::placeholder,
.field textarea::placeholder { color: #94a3b8; }
.form-input:focus,
.field input:focus,
.field textarea:focus {
    border-color: var(--cf-primary);
    box-shadow: 0 0 0 4px var(--cf-primary-ring);
}
.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cf-muted);
    font-size: 0.92rem;
    pointer-events: none;
}
.input-group .form-label {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--cf-muted);
    font-size: 0.95rem;
    pointer-events: none;
    transition: all 0.18s var(--cf-ease);
}
textarea.form-input + .input-icon { display: none; }
textarea.form-input ~ .form-label { left: 15px; top: 16px; transform: none; }
.form-input:focus ~ .form-label,
.form-input:not(:placeholder-shown) ~ .form-label {
    top: 7px;
    transform: none;
    font-size: 0.66rem;
    left: 44px;
    letter-spacing: 0.02em;
}
textarea.form-input:focus ~ .form-label,
textarea.form-input:not(:placeholder-shown) ~ .form-label { left: 15px; top: 7px; }
.form-input:focus,
.form-input:not(:placeholder-shown) { padding-top: 20px; padding-bottom: 8px; }
textarea.form-input:focus,
textarea.form-input:not(:placeholder-shown) { padding-top: 22px; }

.field { margin-bottom: 0.95rem; }
.field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.4rem;
}
.hint { font-size: 0.72rem; color: var(--cf-muted); margin-top: 0.35rem; line-height: 1.45; }
.req { color: var(--cf-danger); }

.type-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 8px;
    margin-bottom: 1rem;
}
.type-opt { position: relative; cursor: pointer; }
.type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 46px;
    padding: 0.7rem 0.4rem;
    border-radius: var(--cf-r-md);
    border: 1.5px solid var(--cf-border);
    background: var(--cf-muted-panel);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--cf-muted);
}
.type-opt input:checked + span {
    border-color: var(--cf-primary);
    background: var(--cf-primary-soft);
    color: var(--cf-primary-hover);
}
.type-opt input:focus-visible + span {
    box-shadow: 0 0 0 4px var(--cf-primary-ring);
}

.company-only { display: none; }
.company-only.show { display: block; }

.submit,
.btn-submit {
    width: 100%;
    min-height: 50px;
    padding: 0.9rem 1rem;
    border: none;
    border-radius: var(--cf-r-md);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    background: var(--cf-primary);
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.submit:hover,
.btn-submit:hover { background: var(--cf-primary-hover); }
.submit:active,
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.submit-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    padding: 0.75rem 1.1rem calc(env(safe-area-inset-bottom, 0px) + 0.85rem);
    background: linear-gradient(to top, rgba(241, 245, 249, 0.98) 62%, rgba(241, 245, 249, 0));
}
.submit-inner { max-width: 560px; margin: 0 auto; }
.summary-line {
    font-size: 0.74rem;
    color: var(--cf-muted);
    margin: 0 0 8px;
    text-align: center;
    min-height: 1.1em;
}
.summary-line b { color: var(--cf-ink); font-weight: 600; }

.links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1rem;
}
.links a {
    color: var(--cf-primary);
    font-size: 0.84rem;
    text-decoration: none;
    font-weight: 600;
}
.links a:hover { text-decoration: underline; }

.foot {
    width: 100%;
    max-width: 560px;
    text-align: center;
    padding: 0.4rem 1rem calc(env(safe-area-inset-bottom, 0px) + 1.2rem);
    color: var(--cf-muted);
    font-size: 0.75rem;
}

.toast {
    position: fixed;
    left: 50%;
    top: calc(env(safe-area-inset-top, 0px) + 18px);
    transform: translate(-50%, -140%);
    z-index: 60;
    max-width: calc(100% - 2rem);
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 16px;
    border-radius: var(--cf-r-md);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--cf-ink);
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
    transition: transform 0.28s var(--cf-ease);
}
.toast.show { transform: translate(-50%, 0); }
.toast.err { color: #991b1b; border-color: #fecaca; background: #fef2f2; }
.toast.ok { color: #065f46; border-color: #a7f3d0; background: #ecfdf5; }

.done-wrap { text-align: center; padding: 1.1rem 0 0.4rem; }
.done-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    color: #fff;
    border-radius: 50%;
    background: var(--cf-success);
}
.done-wrap h2 { margin: 0 0 6px; font-size: 1.22rem; font-weight: 700; }
.done-wrap > p { margin: 0 0 1.2rem; font-size: 0.84rem; color: var(--cf-muted); }
.kv-list { text-align: left; border-top: 1px solid var(--cf-border); }
.kv {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 2px;
    border-bottom: 1px solid var(--cf-border);
    font-size: 0.86rem;
}
.kv span { flex: 0 0 76px; color: var(--cf-muted); font-size: 0.78rem; }
.kv strong { flex: 1; font-weight: 600; word-break: break-all; }

.btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    padding: 12px;
    margin-top: 0.85rem;
    border-radius: var(--cf-r-md);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--cf-ink);
    background: var(--cf-muted-panel);
    border: 1px solid var(--cf-border);
    text-decoration: none;
    cursor: pointer;
}
.btn-ghost:active { background: #e2e8f0; }

.sheet-mask {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.36);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
.sheet-mask.show { opacity: 1; pointer-events: auto; }
.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 51;
    max-height: 82vh;
    overflow-y: auto;
    transform: translateY(102%);
    transition: transform 0.32s var(--cf-ease);
    background: var(--cf-surface);
    border-top: 1px solid var(--cf-border);
    border-radius: var(--cf-r-xl) var(--cf-r-xl) 0 0;
    padding: 1.1rem 1.15rem calc(env(safe-area-inset-bottom, 0px) + 1.4rem);
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.12);
}
.sheet.show { transform: translateY(0); }
.sheet-grip {
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: #cbd5e1;
    margin: 0 auto 1rem;
}
.sheet h3 { margin: 0 0 0.2rem; font-size: 1.05rem; font-weight: 700; }
.sheet .sheet-sub { margin: 0 0 1rem; font-size: 0.76rem; color: var(--cf-muted); }

.my-item,
.apt-item,
.result {
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-r-md);
    padding: 13px 14px;
    margin-bottom: 10px;
    background: var(--cf-muted-panel);
}
.my-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.my-time,
.apt-time { font-size: 0.9rem; font-weight: 700; }
.my-meta,
.apt-info p { font-size: 0.76rem; color: var(--cf-muted); }
.apt-feed { display: flex; flex-direction: column; gap: 0.65rem; }
.apt-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
    margin-bottom: 0;
}
.apt-info h2 { margin: 0; font-size: 0.9rem; font-weight: 700; }
.apt-time small { display: block; color: var(--cf-muted); font-weight: 400; font-size: 0.75rem; margin-top: 2px; }

.st,
.pill,
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.st-待确认,
.pill-待确认 { background: #fef3c7; color: #92400e; }
.st-已确认,
.pill-已确认 { background: #dbeafe; color: #1e40af; }
.st-已完成,
.pill-已完成 { background: #d1fae5; color: #065f46; }
.st-已取消,
.pill-已取消 { background: #e2e8f0; color: #334155; }
.st-已过期,
.pill-已过期 { background: #fee2e2; color: #991b1b; }
.st-待处理 { background: #fef3c7; color: #92400e; }
.st-处理中 { background: #dbeafe; color: #1e40af; }
.st-已开票 { background: #ede9fe; color: #5b21b6; }
.st-已发送 { background: #d1fae5; color: #065f46; }
.st-已拒绝 { background: #fee2e2; color: #991b1b; }

.btn-cancel-apt {
    margin-top: 8px;
    min-height: 36px;
    padding: 7px 13px;
    font-size: 0.74rem;
    font-weight: 600;
    font-family: inherit;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 9px;
    cursor: pointer;
}

.result .meta { font-size: 0.85rem; color: var(--cf-muted); line-height: 1.7; }
.result .meta strong { color: var(--cf-ink); font-weight: 600; }

.empty-state {
    padding: 2.2rem 1rem;
    text-align: center;
    color: var(--cf-muted);
}
.empty-state i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 16px;
    margin: 0 auto 0.7rem;
    background: var(--cf-primary-soft);
    color: var(--cf-primary);
    font-size: 1.2rem;
}
.empty-state p { margin: 0 0 4px; font-size: 0.88rem; color: var(--cf-ink); }
.empty-state small { font-size: 0.76rem; }

.privacy-note {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    color: var(--cf-muted);
    margin-top: 0.9rem;
}

.result-count {
    display: inline-flex;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--cf-primary-soft);
    color: #1e40af;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pop {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}
.card { animation: fadeUp 0.35s var(--cf-ease) both; }
.done-icon { animation: pop 0.45s var(--cf-ease) both; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
