/* ==========================================================================
   团购站（webgroup）· 白标 H5 样式
   一个企业一个独立团购网页：页面不出现住潮到家，颜色/文案/图片全部来自后台「团购站」配置。
   设计令牌全部收在 :root；主题色 --brand 由 JS 按后台配置注入，并派生加深色/淡底色。
   ========================================================================== */

:root {
    /* 主题色（后台可改；JS 会覆盖并派生 --brand-dark / --brand-soft） */
    --brand: #E2231A;
    --brand-on: #FFFFFF;
    --brand-dark: #B8160F;
    --brand-soft: #FDECEA;
    /* 价格牌：团购的「红 + 金」，金色只用在价格上 */
    --gold: #FFB800;
    --gold-ink: #2B1A00;
    /* 中性色（暖灰，避免纯白纯黑） */
    --bg: #F6F4F1;
    --surface: #FFFFFF;
    --sunken: #FAF8F6;
    --ink: #1F1B18;
    --ink-2: #4A433E;
    --muted: #6F6761;
    --line: #EDE8E3;
    /* 语义色 */
    --success: #1E7A45;
    --success-soft: #E6F5EC;
    --warn: #A84E09;
    --warn-soft: #FDF1DF;
    --danger: #C81E1E;

    --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans",
        "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
    --font-num: "DIN Alternate", "Bahnschrift", "Helvetica Neue", "Arial Narrow", Arial, sans-serif;

    --r-s: 8px;
    --r-m: 12px;
    --r-l: 16px;
    --r-pill: 999px;

    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-8: 32px;

    --ease: cubic-bezier(.2, 0, 0, 1);
    --dur-fast: 100ms;
    --dur: 150ms;
    --dur-in: 240ms;

    --shadow-s: 0 1px 2px rgba(31, 27, 24, .06), 0 2px 8px rgba(31, 27, 24, .04);
    --shadow-m: 0 12px 32px rgba(31, 27, 24, .16);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --tap: 44px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--s-8) + var(--safe-bottom));
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
}

button,
input,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: 0;
    background: none;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
}

.num {
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.icon {
    width: 20px;
    height: 20px;
    flex: none;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── 布局壳：手机单列（内容宽 ≤480），桌面双列 ── */
.shell {
    max-width: 480px;
    margin: 0 auto;
}

/* ── 顶栏 ── */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: var(--s-3);
    height: 52px;
    padding: 0 var(--s-3);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    min-width: 0;
    flex: 1;
}

.brand__logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--brand);
    color: var(--brand-on);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
}

.brand__name {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar__btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: var(--tap);
    padding: 0 var(--s-3);
    border-radius: var(--r-pill);
    font-size: 13px;
    letter-spacing: .02em;
    color: var(--ink-2);
}

.topbar__btn--primary {
    background: var(--brand);
    color: var(--brand-on);
    font-weight: 600;
}

.topbar__btn:active {
    transform: scale(.98);
}

/* ── 头图轮播 ── */
.hero {
    position: relative;
    margin: var(--s-3) var(--s-3) 0;
    border-radius: var(--r-l);
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: var(--brand-dark);
    box-shadow: var(--shadow-s);
}

.hero__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 400ms var(--ease);
    pointer-events: none;
}

.hero__slide.is-on {
    opacity: 1;
    pointer-events: auto;
}

.hero__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 生成图主体在右、左侧留给标题：取景偏右 */
    object-position: 64% center;
}

.hero__shade {
    position: absolute;
    inset: 0;
    /* 左侧压暗到约八成宽，保证白字标题在亮色客厅图上也够对比度 */
    background: linear-gradient(90deg, rgba(20, 10, 6, .74) 0%, rgba(20, 10, 6, .5) 46%, rgba(20, 10, 6, .22) 76%, rgba(20, 10, 6, 0) 96%),
        linear-gradient(0deg, rgba(20, 10, 6, .38) 0%, rgba(20, 10, 6, 0) 42%);
}

/* 文字块整体抬高：下沿要避开压在头图底部的「今日名额」卡片 */
.hero__text {
    position: absolute;
    left: var(--s-4);
    right: 20%;
    bottom: calc(var(--s-6) + var(--s-3));
    color: #FFFFFF;
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px var(--s-2);
    border-radius: var(--r-pill);
    background: var(--brand);
    color: var(--brand-on);
    font-size: 11px;
    letter-spacing: .06em;
    font-weight: 600;
}

.hero__title {
    margin-top: var(--s-2);
    font-size: 26px;
    line-height: 1.2;
    letter-spacing: -.01em;
    font-weight: 700;
    text-wrap: balance;
}

.hero__sub {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.5;
    letter-spacing: .01em;
    color: rgba(255, 255, 255, .94);
    text-wrap: balance;     /* 两行均分，避免最后一个字孤零零掉到下一行 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero__dots {
    position: absolute;
    right: var(--s-4);
    bottom: calc(var(--s-6) + var(--s-2));
    display: flex;
    gap: 6px;
}

.hero__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
}

.hero__dot.is-on {
    width: 16px;
    border-radius: 3px;
    background: #FFFFFF;
}

/* 头图没有配图时的纯色底（保持文字可读） */
.hero--plain .hero__slide:first-child img {
    display: none;
}

.hero--plain .hero__shade {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
}

/* ── 今日名额条（压在头图下沿） ── */
.live {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin: calc(var(--s-6) * -1) var(--s-4) 0;
    padding: var(--s-3) var(--s-4);
    background: var(--surface);
    border-radius: var(--r-m);
    box-shadow: var(--shadow-s);
}

.live__num {
    font-size: 30px;
    line-height: 1;
    font-weight: 700;
    color: var(--brand);
}

.live__num small {
    font-size: 12px;
    font-weight: 500;
    color: var(--muted);
    margin-left: 2px;
}

.live__label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.live__next {
    margin-left: auto;
    font-size: 13px;
    color: var(--brand);
    font-weight: 600;
    text-align: right;
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
}

/* ── 公告 ── */
.notice {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin: var(--s-3) var(--s-4) 0;
    padding: 0 var(--s-3);
    min-height: 36px;
    border-radius: var(--r-pill);
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 12px;
}

.notice__tag {
    flex: none;
    font-weight: 700;
    letter-spacing: .04em;
}

.notice__text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 保障点 ── */
.trust {
    display: flex;
    gap: var(--s-2);
    margin: var(--s-3) var(--s-3) 0;
    padding: 2px 2px 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.trust::-webkit-scrollbar {
    display: none;
}

.trust__item {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 var(--s-3);
    border-radius: var(--r-pill);
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 12px;
    color: var(--ink-2);
}

.trust__item .icon {
    width: 16px;
    height: 16px;
    color: var(--brand);
}

/* ── 卡片 ── */
.card {
    margin: var(--s-3) var(--s-3) 0;
    padding: var(--s-4);
    background: var(--surface);
    border-radius: var(--r-l);
    box-shadow: var(--shadow-s);
}

.card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-3);
    margin-bottom: var(--s-3);
}

.card__title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.3;
}

.card__sub {
    font-size: 12px;
    color: var(--muted);
    text-align: right;
}

/* ── 预约日历：日期条 ── */
.dates {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: var(--s-3);
}

.date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-height: 58px;
    padding: 4px 0;
    border-radius: var(--r-m);
    border: 1.5px solid transparent;
    color: var(--ink-2);
}

.date__week {
    font-size: 11px;
    letter-spacing: .02em;
    color: var(--muted);
}

.date__day {
    font-size: 17px;
    line-height: 1.2;
    font-weight: 600;
}

.date__left {
    font-size: 11px;
    color: var(--brand);
}

.date__left--none {
    color: var(--muted);
}

.date[aria-pressed="true"] {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.date[aria-pressed="true"] .date__week,
.date[aria-pressed="true"] .date__left {
    color: var(--brand-dark);
}

.date:disabled {
    opacity: .45;
}

/* ── 预约日历：场次格 ── */
.slots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--s-3);
}

.slot {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 112px;     /* 带「某某 N 分钟前占了位」一行时也不挤 */
    padding: var(--s-3);
    text-align: left;
    border-radius: var(--r-m);
    border: 1.5px solid var(--line);
    background: var(--surface);
    transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}

.slot:active {
    transform: scale(.985);
}

.slot__time {
    font-size: 20px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: -.01em;
}

.slot__state {
    font-size: 13px;
    color: var(--muted);
}

.slot__seats {
    display: flex;
    gap: 4px;
    margin-top: auto;
    padding-top: 4px;
}

.seat {
    width: 14px;
    height: 8px;
    border-radius: 4px;
    background: var(--line);
}

.seat--taken {
    background: var(--brand);
}

.seat--hold {
    background: repeating-linear-gradient(135deg, var(--brand) 0 3px, transparent 3px 6px);
}

.slot__recent {
    font-size: 11px;
    color: var(--warn);
}

/* 等人成团：高亮成「还差 1 人」 */
.slot[data-status="waiting"] {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.slot[data-status="waiting"] .slot__state {
    color: var(--brand-dark);
    font-weight: 600;
}

/* 选中 */
.slot[aria-pressed="true"] {
    border-color: var(--brand);
    border-width: 2px;
    padding: calc(var(--s-3) - .5px);
    background: var(--brand-soft);
}

.slot[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--brand) center / 12px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

/* 约满 / 截止 / 已开始：退到背景里 */
.slot[data-status="full"],
.slot[data-status="cutoff"],
.slot[data-status="past"] {
    background: var(--sunken);
    border-style: dashed;
    color: var(--muted);
}

.slot[data-status="full"] .slot__time,
.slot[data-status="cutoff"] .slot__time,
.slot[data-status="past"] .slot__time {
    color: var(--ink-2);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.slot:disabled {
    cursor: not-allowed;
}

.rule-line {
    margin-top: var(--s-3);
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted);
}

/* 当天约满 / 还没开场时的提示条 */
.hint {
    display: flex;
    align-items: flex-start;
    gap: var(--s-2);
    margin-top: var(--s-3);
    padding: var(--s-3);
    border-radius: var(--r-m);
    background: var(--warn-soft);
    color: var(--warn);
    font-size: 13px;
    line-height: 1.5;
}

.hint .icon {
    color: currentColor;
    margin-top: 2px;
}

.hint__link {
    margin-left: auto;
    flex: none;
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── 商品 ── */
.product {
    display: flex;
    gap: var(--s-3);
    width: 100%;
    padding: var(--s-3);
    text-align: left;
    border-radius: var(--r-m);
    transition: background-color var(--dur) var(--ease);
}

.product + .product {
    border-top: 1px solid var(--line);
}

.product:active {
    background: var(--sunken);
}

.product__img {
    flex: none;
    width: 88px;
    height: 88px;
    border-radius: var(--r-m);
    object-fit: cover;
    background: var(--brand-soft);
}

.product__img--empty {
    display: grid;
    place-items: center;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 600;
}

.product__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.product__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product__meta {
    margin-top: 2px;
    font-size: 12px;
    color: var(--muted);
}

.product__foot {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;      /* 窄屏放不下时按钮换到下一行右对齐，不横向溢出 */
    gap: var(--s-2);
    margin-top: auto;
    padding-top: var(--s-2);
}

.price-tag {
    display: inline-flex;
    align-items: baseline;
    padding: 2px var(--s-2) 2px var(--s-2);
    border-radius: 6px var(--r-pill) var(--r-pill) 6px;
    background: var(--gold);
    color: var(--gold-ink);
    line-height: 1.1;
}

.price-tag__cur {
    font-size: 12px;
    font-weight: 700;
}

.price-tag__num {
    font-size: 20px;
    font-weight: 700;
}

.price-tag__dec {
    font-size: 12px;
    font-weight: 700;
}

.price-old {
    font-size: 12px;
    color: var(--muted);
    text-decoration: line-through;
    white-space: nowrap;
}

/* 商品副标题（本站独立文案，一行截断） */
.product__desc {
    margin-top: 2px;
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product__btn {
    margin-left: auto;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 var(--s-4);
    border-radius: var(--r-pill);
    background: var(--brand);
    color: var(--brand-on);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .02em;
    max-width: 46%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── 怎么拼：三步竖排（图标在左，文字在右），窄屏也不挤 ── */
.how {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
}

.step {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
        "icon no"
        "icon title"
        "icon desc";
    column-gap: var(--s-3);
    align-items: start;
    padding: var(--s-3);
    border-radius: var(--r-m);
    background: var(--sunken);
}

.step__icon {
    grid-area: icon;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.step__icon .icon {
    width: 22px;
    height: 22px;
}

.step__no {
    grid-area: no;
    justify-self: end;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    line-height: 1.5;
}

.step__title {
    grid-area: title;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
}

.step__desc {
    grid-area: desc;
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

/* ── 常见问题 ── */
.faq {
    border-top: 1px solid var(--line);
}

.faq__item {
    border-bottom: 1px solid var(--line);
}

.faq__q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    min-height: 52px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.faq__q::-webkit-details-marker {
    display: none;
}

.faq__q .icon {
    color: var(--muted);
    transition: transform var(--dur) var(--ease);
}

.faq__item[open] .faq__q .icon {
    transform: rotate(45deg);
}

.faq__a {
    padding: 0 var(--s-6) var(--s-3) 0;
    font-size: 13px;
    line-height: 1.7;
    color: var(--ink-2);
}

/* ── 页脚 ── */
.footer {
    margin: var(--s-6) var(--s-4) 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.8;
    color: var(--muted);
}

.footer a {
    color: var(--ink-2);
}

/* ── 按钮 ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: 48px;
    padding: 0 var(--s-5);
    border-radius: var(--r-pill);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .02em;
    white-space: nowrap;
    transition: transform var(--dur-fast) var(--ease), opacity var(--dur) var(--ease);
}

.btn:active {
    transform: scale(.985);
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--brand);
    color: var(--brand-on);
}

.btn--ghost {
    border: 1.5px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
}

.btn--soft {
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.btn--block {
    width: 100%;
}

.btn--sm {
    min-height: 36px;
    padding: 0 var(--s-4);
    font-size: 14px;
}

/* ── 底部动作条 ── */
.actionbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    padding: var(--s-2) var(--s-3) calc(var(--s-2) + var(--safe-bottom));
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--line);
    transform: translateY(110%);
    transition: transform var(--dur-in) var(--ease);
}

.actionbar.is-on {
    transform: translateY(0);
}

.actionbar__inner {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    max-width: 480px;
    margin: 0 auto;
}

.actionbar__sum {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.actionbar__slot {
    font-size: 15px;
    font-weight: 700;
}

.actionbar__goods {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.actionbar .btn {
    flex: none;
    padding: 0 var(--s-5);
}

/* ── 底部抽屉（选时段 / 确认占位 / 分享 / 我的订单 / 支付结果） ── */
.backdrop {
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(31, 27, 24, .52);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-in) var(--ease);
}

.backdrop.is-on {
    opacity: 1;
    pointer-events: auto;
}

.sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    max-width: 520px;
    margin: 0 auto;
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--s-2) var(--s-4) calc(var(--s-5) + var(--safe-bottom));
    background: var(--surface);
    border-radius: var(--r-l) var(--r-l) 0 0;
    box-shadow: var(--shadow-m);
    transform: translateY(102%);
    transition: transform var(--dur-in) var(--ease);
    visibility: hidden;
}

.sheet.is-open {
    transform: translateY(0);
    visibility: visible;
}

/* 抽屉打开时把焦点移到抽屉本身（读屏从抽屉开始读），但程序聚焦不画外框 */
.sheet:focus,
.sheet:focus-visible {
    outline: none;
}

.sheet__grip {
    width: 36px;
    height: 4px;
    margin: 0 auto var(--s-2);
    border-radius: 2px;
    background: var(--line);
}

.sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-3);
    margin-bottom: var(--s-3);
}

.sheet__title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.sheet__close {
    display: grid;
    place-items: center;
    width: var(--tap);
    height: var(--tap);
    margin-right: calc(var(--s-3) * -1);
    border-radius: 50%;
    color: var(--muted);
}

.sheet__close:active {
    background: var(--sunken);
}

.sheet__sub {
    font-size: 13px;
    color: var(--muted);
    margin: calc(var(--s-2) * -1) 0 var(--s-3);
}

.sheet .slots {
    margin-bottom: var(--s-3);
}

/* ── 表单 ── */
.form {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.field__label {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
}

.field__hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.field__error {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--danger);
}

.field__error .icon {
    width: 14px;
    height: 14px;
    margin-top: 3px;
}

.input {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 0 var(--s-3);
    border: 1.5px solid var(--line);
    border-radius: var(--r-m);
    background: var(--surface);
    font-size: 16px;
    color: var(--ink);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.input::placeholder {
    color: #A39B95;
}

.input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.input[aria-invalid="true"] {
    border-color: var(--danger);
}

.input:disabled {
    background: var(--sunken);
    color: var(--ink-2);
}

textarea.input {
    padding: var(--s-2) var(--s-3);
    min-height: 76px;
    resize: none;
}

.row {
    display: flex;
    gap: var(--s-2);
}

.row > * {
    flex: 1;
    min-width: 0;
}

.code-row {
    display: flex;
    gap: var(--s-2);
}

.code-row .input {
    flex: 1;
}

.code-row .btn {
    flex: none;
}

/* 地址只读区（省市区来自团购站配置，业主只填楼栋门牌） */
.region {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
    padding: var(--s-2) var(--s-3);
    border-radius: var(--r-m);
    background: var(--sunken);
    font-size: 13px;
    color: var(--ink-2);
}

.region__tag {
    padding: 1px var(--s-2);
    border-radius: var(--r-pill);
    background: var(--surface);
    border: 1px solid var(--line);
}

/* ── 确认占位的订单摘要 ── */
.summary {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    padding: var(--s-3);
    border-radius: var(--r-m);
    background: var(--sunken);
    font-size: 13px;
}

.summary__row {
    display: flex;
    justify-content: space-between;
    gap: var(--s-3);
}

.summary__row dt {
    color: var(--muted);
    flex: none;
}

.summary__row dd {
    text-align: right;
    font-weight: 600;
}

.summary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-top: 2px;
    padding-top: var(--s-2);
    border-top: 1px dashed var(--line);
}

.summary__total dd {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand);
}

.summary__total dd small {
    font-size: 13px;
}

/* ── 进度 / 结果 ── */
.result {
    text-align: center;
    padding: var(--s-4) 0 var(--s-2);
}

.result__icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto var(--s-3);
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
}

.result__icon--wait {
    background: var(--warn-soft);
    color: var(--warn);
}

.result__icon--wait .icon,
.result__icon .icon {
    width: 30px;
    height: 30px;
}

.result__title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.result__desc {
    margin-top: var(--s-2);
    font-size: 13px;
    color: var(--muted);
}

.members {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--s-2);
    margin: var(--s-4) 0;
}

.members__list {
    display: flex;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--surface);
    background: var(--brand-soft);
    object-fit: cover;
    margin-left: -8px;
}

.avatar:first-child {
    margin-left: 0;
}

.avatar--empty {
    display: grid;
    place-items: center;
    color: var(--brand-dark);
    font-size: 15px;
    font-weight: 700;
}

.avatar--leader {
    box-shadow: 0 0 0 2px var(--gold);
}

.members__plus {
    font-size: 22px;
    font-weight: 700;
    color: var(--muted);
}

.members__need {
    width: 44px;
    height: 44px;
    margin-left: -8px;
    border-radius: 50%;
    border: 2px dashed var(--brand);
    display: grid;
    place-items: center;
    font-size: 11px;
    color: var(--brand-dark);
    font-weight: 700;
    background: var(--surface);
}

.countdown {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: var(--s-2) var(--s-4);
    border-radius: var(--r-pill);
    background: var(--warn-soft);
    color: var(--warn);
    font-size: 13px;
}

.countdown b {
    font-size: 18px;
}

.result__actions {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin-top: var(--s-4);
}

/* ── 分享 ── */
.seg {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin: calc(var(--s-2) * -1) 0 var(--s-3);
    border-radius: var(--r-pill);
    background: var(--sunken);
}

.seg__btn {
    flex: 1;
    height: 40px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
}

.seg__btn.is-on {
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-s);
}

/* 表单里的页签（登录方式）：去掉分享抽屉那套贴边外边距 */
.seg--form {
    margin: 0;
}

.share__qr {
    width: 208px;
    height: 208px;
    margin: 0 auto;
    padding: var(--s-2);
    border-radius: var(--r-m);
    border: 1px solid var(--line);
    background: var(--surface);
}

.share-qrbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--s-4) 0 var(--s-3);
    border-radius: var(--r-m);
    background: var(--brand-soft);
}

.share-qrbox__cap {
    margin-top: var(--s-2);
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-dark);
}

.share__actions {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin: var(--s-3) 0;
}

.share__actions .btn[hidden] {
    display: none;
}

.share__qr img,
.share__qr canvas {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.share__link {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-bottom: var(--s-3);
}

.share__link .input {
    font-size: 12px;
    color: var(--muted);
}

.share__tip {
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

/* ── 宣传物料（海报） ── */
.poster {
    border: 1px solid var(--line);
    border-radius: var(--r-m);
    overflow: hidden;
    background: #fff;
}

.poster img {
    display: block;
    width: 100%;
    height: auto;
}

.poster__state {
    padding: 56px 16px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
}

.poster__actions {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin-top: var(--s-3);
}

/* ── 我的订单 ── */
.order {
    padding: var(--s-3);
    border-radius: var(--r-m);
    border: 1px solid var(--line);
}

.order + .order {
    margin-top: var(--s-2);
}

.order__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-2);
    font-size: 12px;
    color: var(--muted);
}

.order__stage {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-dark);
}

.order__stage--done {
    color: var(--success);
}

.order__stage--closed {
    color: var(--muted);
}

.order__body {
    display: flex;
    gap: var(--s-3);
    margin-top: var(--s-2);
}

.order__img {
    flex: none;
    width: 56px;
    height: 56px;
    border-radius: var(--r-s);
    object-fit: cover;
    background: var(--brand-soft);
}

.order__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.order__meta {
    font-size: 12px;
    color: var(--muted);
}

.order__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-2);
    margin-top: var(--s-2);
}

.order__fee {
    font-size: 16px;
    font-weight: 700;
}

.order__fee small {
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
}

.order__actions {
    display: flex;
    gap: var(--s-2);
}

/* 确认抽屉里的「已登录」账号条 */
.logged {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    min-height: var(--tap);
    padding: var(--s-1) var(--s-2) var(--s-1) var(--s-3);
    border-radius: var(--r-m);
    background: var(--success-soft);
    color: var(--success);
    font-size: 14px;
}

.logged .icon {
    flex: none;
}

.logged__text {
    color: var(--ink-2);
}

.logged__text b {
    margin-left: 2px;
    font-size: 16px;
    color: var(--ink);
}

.logged .hint__link {
    color: var(--muted);
    font-size: 13px;
}

/* 订单抽屉顶部账号条（窄屏放不下时按钮整体换行） */
.account {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s-2) var(--s-3);
    margin-bottom: var(--s-4);
    padding: var(--s-2) var(--s-2) var(--s-2) var(--s-3);
    border-radius: var(--r-m);
    background: var(--sunken);
}

.account__avatar {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--brand-on);
    font-size: 14px;
    font-weight: 700;
}

.account__body {
    flex: 1 1 120px;
    min-width: 0;
}

.account__mobile {
    font-size: 17px;
    font-weight: 700;
}

.account__meta {
    margin-top: 1px;
    font-size: 12px;
    color: var(--muted);
}

.account .btn {
    flex: none;
}

/* ── 服务详情抽屉：上半部分滚动（图片 / 价格 / 参数 / 图文），底部按钮固定 ── */
.sheet--detail {
    display: flex;
    flex-direction: column;
    height: 92vh;
    height: 92dvh;
    /* 左右不留内边距：图片天然通栏，文字区自己带边距（内容区出现竖滚动条时图片也不会错位） */
    padding-right: 0;
    padding-bottom: 0;
    padding-left: 0;
    overflow: hidden;
}

.sheet--detail .sheet__head {
    padding: 0 var(--s-4);
}

.detail {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.detail__skeleton {
    aspect-ratio: 1 / 1;
    border-radius: 0;
}

.detail__gallery {
    position: relative;
    background: var(--sunken);
}

/* 多图：横滑切换（scroll-snap），不显示滚动条 */
.detail__slides {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    background: var(--sunken);
}

.detail__slides::-webkit-scrollbar {
    display: none;
}

.detail__slides:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: -3px;
}

.detail__slide {
    flex: 0 0 100%;
    aspect-ratio: 1 / 1;
    scroll-snap-align: start;
    background: var(--sunken);
}

.detail__slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail__slide--empty {
    display: grid;
    place-items: center;
    padding: var(--s-5);
    color: var(--muted);
    font-size: 15px;
    text-align: center;
}

.detail__count {
    position: absolute;
    right: var(--s-3);
    bottom: var(--s-3);
    padding: 2px 10px;
    border-radius: var(--r-pill);
    background: rgba(31, 27, 24, .58);
    color: #FFFFFF;
    font-size: 12px;
    pointer-events: none;
}

.detail__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--s-2);
    display: flex;
    justify-content: center;
    gap: 6px;
    pointer-events: none;
}

.detail__dot {
    width: 6px;
    height: 6px;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, .55);
    transition: width var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.detail__dot.is-on {
    width: 16px;
    background: #FFFFFF;
}

.detail__head {
    padding: var(--s-4) var(--s-4) 0;
}

.detail__price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: var(--s-2) var(--s-3);
}

.detail__price-tag {
    padding: 4px var(--s-2) 4px var(--s-2);
}

.detail__price .price-tag__num {
    font-size: 30px;
}

.detail__badge {
    align-self: center;
    padding: 2px 10px;
    border-radius: var(--r-pill);
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 600;
}

.detail__title {
    margin-top: var(--s-3);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
}

.detail__sub {
    margin-top: var(--s-1);
    font-size: 14px;
    color: var(--ink-2);
    line-height: 1.55;
}

.detail__meta {
    margin-top: var(--s-2);
    font-size: 12px;
    color: var(--muted);
}

.detail__sec {
    margin: var(--s-5) var(--s-4) 0;
    padding-top: var(--s-4);
    border-top: 1px solid var(--line);
}

.detail__sec-title {
    margin-bottom: var(--s-3);
    font-size: 16px;
    font-weight: 700;
}

.detail__params {
    display: grid;
    grid-template-columns: 5.5em minmax(0, 1fr);
    gap: var(--s-2) var(--s-3);
    font-size: 14px;
    line-height: 1.5;
}

.detail__params dt {
    color: var(--muted);
}

.detail__params dd {
    margin: 0;
    color: var(--ink);
    white-space: pre-line;
    overflow-wrap: break-word;
}

/* 图文详情：后台富文本原样展示，只兜住宽度（图片不撑破抽屉） */
.detail__rich {
    font-size: 15px;
    line-height: 1.75;
    color: var(--ink);
    overflow-wrap: break-word;
}

.detail__rich img {
    display: block;
    max-width: 100% !important;
    height: auto !important;
    margin: var(--s-2) auto;
    border-radius: var(--r-s);
}

.detail__rich video,
.detail__rich iframe,
.detail__rich audio,
.detail__rich script {
    display: none !important;
}

.detail__rich table {
    max-width: 100%;
    margin: var(--s-2) 0;
    border-collapse: collapse;
    font-size: 13px;
}

.detail__rich td,
.detail__rich th {
    padding: 6px var(--s-2);
    border: 1px solid var(--line);
}

.detail__rich a {
    color: var(--brand-dark);
}

.detail__empty {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

.detail__bar {
    flex: none;
    padding: var(--s-3) var(--s-4) calc(var(--s-3) + var(--safe-bottom));
    border-top: 1px solid var(--line);
    background: var(--surface);
}

/* ── 状态块：加载 / 页面级错误 / 空态 ── */
.state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--s-8) var(--s-5);
}

.state__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: var(--s-3);
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.state__icon .icon {
    width: 26px;
    height: 26px;
}

.state__title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.state__desc {
    margin-top: var(--s-2);
    max-width: 30ch;
    font-size: 13px;
    color: var(--muted);
}

.state__actions {
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin-top: var(--s-4);
    min-width: 200px;
}

/* ── 小程序收银台交接抽屉（微信内 URL Link / 微信外小程序码） ── */
.pay-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--s-2) 0 var(--s-1);
}

.pay-box__fee {
    font-size: 32px;
    font-weight: 800;
    color: var(--brand);
    line-height: 1.15;
}

.pay-box__fee small {
    font-size: 16px;
    font-weight: 700;
    margin-right: 2px;
}

.pay-box__meta {
    margin-top: 6px;
    font-size: 13px;
    color: var(--muted);
}

.pay-box__timer {
    margin-top: var(--s-2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--r-pill);
    background: var(--warn-soft);
    color: var(--warn);
    font-size: 12px;
    font-weight: 600;
}

.pay-box__qr {
    width: 208px;
    height: 208px;
    margin: var(--s-4) auto var(--s-2);
    padding: var(--s-2);
    border-radius: var(--r-m);
    border: 1px solid var(--line);
    background: var(--surface);
    display: grid;
    place-items: center;
}

.pay-box__qr img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pay-box__qr-err {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    padding: var(--s-2);
}

.pay-box__tip {
    font-size: 13px;
    color: var(--ink-2);
    line-height: 1.55;
    margin-top: var(--s-2);
    max-width: 30ch;
}

.pay-box__actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--s-2);
    margin-top: var(--s-4);
}

.btn--wx {
    background: #07C160;
    color: #fff;
    border-color: #07C160;
    box-shadow: 0 6px 16px rgba(7, 193, 96, .24);
}

.btn--wx:hover {
    background: #06ad56;
}

.btn--wx:active {
    background: #059b4d;
}

.pay-box__safe {
    margin-top: var(--s-3);
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
}

.skeleton {
    border-radius: var(--r-m);
    background: linear-gradient(90deg, var(--line) 25%, var(--sunken) 50%, var(--line) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

/* ── 轻提示 ── */
.toast {
    position: fixed;
    left: 50%;
    top: 68px;
    z-index: 60;
    max-width: calc(100% - 32px);
    padding: var(--s-2) var(--s-4);
    border-radius: var(--r-pill);
    background: rgba(31, 27, 24, .92);
    color: #FFFFFF;
    font-size: 14px;
    transform: translate(-50%, -8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.toast.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast--error {
    background: var(--danger);
}

[hidden] {
    display: none !important;
}

/* ── 平板：单列放宽 ── */
@media (min-width: 481px) {
    .shell {
        max-width: 560px;
    }

    .actionbar__inner {
        max-width: 560px;
    }
}

/* ── 桌面：左「头图 + 日历」固定，右「商品 + 玩法 + 问答」滚动 ── */
@media (min-width: 1024px) {
    body {
        padding-top: var(--s-4);
    }

    .topbar {
        top: var(--s-4);
        max-width: 1080px;
        margin: 0 auto;
        border: 1px solid var(--line);
        border-radius: var(--r-l);
    }

    .shell {
        max-width: 1080px;
        display: grid;
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
        gap: var(--s-5);
        align-items: start;
    }

    .shell__main {
        position: sticky;
        top: 84px;
    }

    .shell__aside .card:first-child {
        margin-top: var(--s-3);
    }

    .hero {
        aspect-ratio: 4 / 3;
    }

    /* 宽屏放得下，保障点直接换行铺开，不再横向滚动 */
    .trust {
        flex-wrap: wrap;
        overflow: visible;
        padding: 2px 0;
    }

    .hero__title {
        font-size: 32px;
    }

    .actionbar {
        padding-bottom: var(--s-2);
    }

    .actionbar__inner {
        max-width: 1080px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
