/* 商城 2.0 公共组件：沿用官网配色（陶土橙 #CE643D）、衬线标题与 12px 圆角弹层 */
:root {
    --gm2-accent: #CE643D;
    --gm2-accent-hover: #b5552f;
    --gm2-accent-soft: rgba(206, 100, 61, .08);
    --gm2-ink: #1D1D1F;
    --gm2-muted: #6e6e6e;
    --gm2-line: #e6e6e6;
    --gm2-bg: #fefdf8;
    --gm2-card: #f6f5f1;
    --gm2-serif: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
}

.gm2-hidden { display: none !important; }

/* ---------- 按钮 ---------- */
.gm2-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 0 22px; border-radius: 6px; border: 1px solid var(--gm2-ink);
    background: #fff; color: var(--gm2-ink); font-size: 14px; font-weight: 500; cursor: pointer;
    transition: background .2s, color .2s, border-color .2s, opacity .2s; text-decoration: none; white-space: nowrap;
}
.gm2-btn:hover { background: var(--gm2-card); }
.gm2-btn-primary { background: var(--gm2-accent); border-color: var(--gm2-accent); color: #fff; }
.gm2-btn-primary:hover { background: var(--gm2-accent-hover); border-color: var(--gm2-accent-hover); }
.gm2-btn-dark { background: var(--gm2-ink); border-color: var(--gm2-ink); color: #fff; }
.gm2-btn-dark:hover { background: #000; }
.gm2-btn-block { width: 100%; }
.gm2-btn[disabled], .gm2-btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.gm2-link { background: none; border: 0; padding: 0; color: var(--gm2-accent); font-size: 13px; cursor: pointer; text-decoration: none; }
.gm2-link:hover { text-decoration: underline; }

/* ---------- 标签 ---------- */
.gm2-tag {
    display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 2px;
    background: var(--gm2-accent); color: #fff; font-size: 12px; letter-spacing: .08em; font-weight: 500;
}
.gm2-tag-soft { background: var(--gm2-accent-soft); color: var(--gm2-accent); }
.gm2-tag-sm { height: 20px; padding: 0 7px; font-size: 11px; letter-spacing: .04em; }

/* ---------- 倒计时 ---------- */
.gm2-countdown { display: inline-flex; gap: 6px; align-items: center; }
.gm2-countdown .gm2-cd-box {
    display: inline-flex; flex-direction: column; align-items: center; min-width: 44px; padding: 6px 4px;
    border-radius: 4px; background: rgba(29, 29, 31, .86); color: #fff; line-height: 1.1;
}
.gm2-countdown .gm2-cd-box b { font-family: var(--gm2-serif); font-size: 18px; font-weight: 600; }
.gm2-countdown .gm2-cd-box span { font-size: 10px; opacity: .75; margin-top: 2px; }
.gm2-countdown.is-compact .gm2-cd-box { min-width: 34px; padding: 4px 3px; }
.gm2-countdown.is-compact .gm2-cd-box b { font-size: 14px; }
.gm2-countdown.is-light .gm2-cd-box { background: var(--gm2-accent-soft); color: var(--gm2-accent); }

/* ---------- 弹层 / 抽屉 ---------- */
.gm2-modal { position: fixed; inset: 0; z-index: 10050; display: none; align-items: center; justify-content: center; }
.gm2-modal.is-open { display: flex; }
.gm2-modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.gm2-modal-card {
    position: relative; width: 480px; max-width: calc(100vw - 32px); max-height: calc(100vh - 64px); overflow: auto;
    background: #fff; border: 1px solid var(--gm2-line); border-radius: 12px; padding: 28px 28px 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18); color: var(--gm2-ink);
}
.gm2-modal-card.is-wide { width: 640px; }
.gm2-modal-close {
    position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border: 0; border-radius: 50%;
    background: transparent; color: var(--gm2-muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.gm2-modal-close:hover { background: var(--gm2-card); color: var(--gm2-ink); }
.gm2-modal-title { font-family: var(--gm2-serif); font-size: 20px; font-weight: 600; margin: 0 0 6px; }
.gm2-modal-sub { font-size: 13px; color: var(--gm2-muted); margin: 0 0 18px; line-height: 1.6; }
.gm2-modal-actions { display: flex; gap: 12px; margin-top: 22px; }
.gm2-modal-actions .gm2-btn { flex: 1; }

.gm2-modal.is-drawer { justify-content: flex-end; align-items: stretch; }
.gm2-modal.is-drawer .gm2-modal-card {
    width: 460px; max-width: 100vw; max-height: none; height: 100%; border-radius: 0; border: 0;
    display: flex; flex-direction: column; padding: 28px 28px 0;
}
.gm2-modal.is-drawer .gm2-drawer-body { flex: 1; overflow: auto; padding-bottom: 20px; }
.gm2-modal.is-drawer .gm2-drawer-foot { border-top: 1px solid var(--gm2-line); padding: 16px 0 24px; background: #fff; }

/* ---------- Toast ---------- */
.gm2-toast {
    position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 10100;
    max-width: 360px; padding: 12px 20px; border-radius: 8px; background: rgba(0, 0, 0, .78);
    color: #fff; font-size: 14px; line-height: 1.6; text-align: center; pointer-events: none;
    opacity: 0; transition: opacity .2s;
}
.gm2-toast.is-show { opacity: 1; }

/* ---------- 芯片（规格 / 赠品 SKU）---------- */
.gm2-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.gm2-chip {
    display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 110px;
    padding: 10px 14px; border: 1px solid var(--gm2-line); border-radius: 6px; background: #fff;
    color: var(--gm2-ink); font-size: 14px; cursor: pointer; text-align: left; transition: border-color .2s, background .2s;
}
.gm2-chip small { font-size: 12px; color: var(--gm2-muted); }
.gm2-chip:hover { border-color: var(--gm2-ink); }
.gm2-chip.is-active { border-color: var(--gm2-accent); background: var(--gm2-accent-soft); }
.gm2-chip.is-active small { color: var(--gm2-accent); }
.gm2-chip[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- 券卡 ---------- */
.gm2-coupon-list { display: flex; flex-direction: column; gap: 12px; }
.gm2-coupon {
    display: flex; align-items: center; gap: 16px; padding: 14px 16px; border-radius: 8px;
    border: 1px solid rgba(206, 100, 61, .25); background: var(--gm2-accent-soft);
}
.gm2-coupon-value { min-width: 84px; font-family: var(--gm2-serif); font-size: 24px; font-weight: 600; color: var(--gm2-accent); }
.gm2-coupon-value small { font-size: 13px; font-weight: 500; }
.gm2-coupon-main { flex: 1; min-width: 0; }
.gm2-coupon-main strong { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.gm2-coupon-main p { margin: 2px 0 0; font-size: 12px; color: var(--gm2-muted); line-height: 1.5; }
.gm2-coupon .gm2-btn { min-height: 34px; padding: 0 14px; font-size: 13px; }
.gm2-coupon.is-muted { border-color: var(--gm2-line); background: var(--gm2-card); }
.gm2-coupon.is-muted .gm2-coupon-value { color: var(--gm2-muted); }
.gm2-coupon-actions { display: flex; flex-direction: column; gap: 8px; }
.gm2-coupon-tip { color: var(--gm2-accent); }

.gm2-claim-icon {
    width: 56px; height: 56px; margin: 4px auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 26px; color: #fff; background: var(--gm2-accent);
}
.gm2-claim-icon.is-fail { background: #8c8c8c; }
.gm2-claim-result { text-align: center; }
.gm2-claim-result .gm2-coupon { text-align: left; margin-top: 16px; }
.gm2-claim-reason { margin: 14px 0 0; font-size: 14px; color: #c0392b; }

/* ---------- 表单 ---------- */
.gm2-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gm2-form .is-full { grid-column: 1 / -1; }
.gm2-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--gm2-muted); }
.gm2-input, .gm2-form select, .gm2-form textarea {
    width: 100%; box-sizing: border-box; min-height: 42px; padding: 9px 12px; border: 1px solid var(--gm2-line);
    border-radius: 6px; background: #fff; font-size: 14px; color: var(--gm2-ink); font-family: inherit;
}
.gm2-form textarea { min-height: 72px; resize: vertical; }
.gm2-input:focus, .gm2-form select:focus, .gm2-form textarea:focus { outline: none; border-color: var(--gm2-accent); }
.gm2-region { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gm2-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--gm2-ink); cursor: pointer; }
.gm2-check input { width: 16px; height: 16px; accent-color: var(--gm2-accent); }

/* ---------- 分段选择 ---------- */
.gm2-seg { display: inline-flex; border: 1px solid var(--gm2-line); border-radius: 6px; overflow: hidden; }
.gm2-seg button { border: 0; background: #fff; padding: 8px 16px; font-size: 13px; color: var(--gm2-ink); cursor: pointer; }
.gm2-seg button + button { border-left: 1px solid var(--gm2-line); }
.gm2-seg button.is-active { background: var(--gm2-accent); color: #fff; }
.gm2-seg button.is-soft-disabled { color: #b8b8b8; }

/* ---------- 订阅授权 ---------- */
.gm2-qr-wrap { display: flex; gap: 18px; align-items: center; padding: 16px; border-radius: 8px; background: var(--gm2-card); }
.gm2-qr { width: 132px; height: 132px; flex: none; background: #fff; display: flex; align-items: center; justify-content: center; border-radius: 6px; overflow: hidden; }
.gm2-qr img, .gm2-qr canvas { width: 120px !important; height: 120px !important; }
.gm2-qr-text { font-size: 13px; line-height: 1.7; color: var(--gm2-muted); }
.gm2-qr-text strong { display: block; color: var(--gm2-ink); font-size: 14px; margin-bottom: 4px; }

/* ---------- 开售日期 ---------- */
.gm2-sale-date { text-align: center; }
.gm2-sale-date .gm2-sale-time { font-family: var(--gm2-serif); font-size: 22px; font-weight: 600; margin: 14px 0 6px; }
.gm2-sale-date .gm2-countdown { margin: 12px 0 4px; }

/* ---------- 明细行 ---------- */
.gm2-bill { margin: 0; padding: 0; list-style: none; }
.gm2-bill li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; color: var(--gm2-muted); }
.gm2-bill li span:last-child { color: var(--gm2-ink); }
.gm2-bill li.is-total { border-top: 1px dashed var(--gm2-line); margin-top: 6px; padding-top: 10px; font-weight: 600; }
.gm2-bill li.is-total span { color: var(--gm2-ink); }

.gm2-empty { padding: 40px 0; text-align: center; color: var(--gm2-muted); font-size: 14px; }

/* ---------- 个人中心：券包（Tab 样式同订单状态 Tab）---------- */
.gm2-wallet-tabs { display: flex; align-items: center; gap: 4px; background: rgba(0, 0, 0, .04); border-radius: 10px; padding: 4px; margin-bottom: 20px; overflow-x: auto; }
.gm2-wallet-tab { display: flex; align-items: center; gap: 6px; padding: 8px 18px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 14px; color: var(--gm2-muted); white-space: nowrap; transition: all .2s; }
.gm2-wallet-tab:hover { color: var(--gm2-ink); }
.gm2-wallet-tab.is-active { background: #fff; color: var(--gm2-ink); font-weight: 500; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.gm2-wallet-count { font-size: 12px; padding: 2px 6px; border-radius: 999px; background: var(--gm2-line); color: var(--gm2-muted); line-height: 1.4; }
.gm2-wallet-tab.is-active .gm2-wallet-count { background: rgba(206, 100, 61, .12); color: var(--gm2-accent); }
.gm2-wallet-list { display: flex; flex-direction: column; gap: 12px; }
.gm2-wallet-list .gm2-coupon { background: #fff; border-color: var(--gm2-line); }
.gm2-wallet-list .gm2-coupon:not(.is-muted) { border-left: 4px solid var(--gm2-accent); }

/* ---------- 开票弹层 ---------- */
.gm2-invoice-no { margin: 0 0 12px; color: var(--gm2-muted); font-size: 13px; }
.gm2-invoice-form { border: 1px solid var(--gm2-line); border-radius: 12px; overflow: hidden; background: #fff; }
.gm2-invoice-row {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    margin: 0; padding: 14px 16px; border-bottom: 1px solid #f3eee8; font-size: 14px;
}
.gm2-invoice-row:last-child { border-bottom: 0; }
.gm2-invoice-row > span:first-child { flex: none; color: var(--gm2-muted); white-space: nowrap; }
.gm2-invoice-row input[type="text"],
.gm2-invoice-row input[type="email"],
.gm2-invoice-row input[type="tel"] {
    flex: 1; min-width: 0; border: 0; background: none; text-align: right; color: var(--gm2-ink); outline: none; font-size: 14px;
}
.gm2-invoice-row input::placeholder { color: #b7b1a8; }
.gm2-invoice-row em { font-style: normal; color: var(--gm2-muted); }
.gm2-invoice-row.is-mail { justify-content: flex-start; }
.gm2-invoice-row.is-mail span { display: inline-flex; align-items: center; gap: 8px; color: var(--gm2-ink); }
.gm2-invoice-note { margin: 14px 0 0; font-size: 12px; color: var(--gm2-muted); line-height: 1.7; }
.gm2-invoice-ok { font-family: var(--gm2-serif); font-size: 22px; font-weight: 600; margin: 0 0 10px; }
.gm2-invoice-result p { margin: 6px 0; font-size: 14px; color: var(--gm2-muted); line-height: 1.6; }
.gm2-invoice-fail { color: #c0392b; }

@media (max-width: 767px) {
    .gm2-modal-card { padding: 22px 18px 18px; }
    .gm2-form { grid-template-columns: 1fr; }
    .gm2-modal.is-drawer .gm2-modal-card { width: 100vw; padding: 22px 18px 0; }
}

/* 商详规格 chip（附件：名称 +「SKU · 有货/无货」，无货不整块置灰） */
.gm2-chip-spec { align-items: center; text-align: center; min-width: 128px; padding: 12px 20px; border-radius: 12px; }
.gm2-chip-spec.is-active small { color: var(--gm2-muted); }
.gm2-chip.is-soldout { opacity: 1; }
.gm2-chip.is-soldout:hover { border-color: var(--gm2-line, #dbd5cd); }

/* 配件卡价格行：有货为陶土色文字，无货为灰藕色文字（附件配件选购） */
.gm2p-card-cart {
    background: none; border: 0; padding: 0; margin: 0;
    color: var(--gm2-accent); font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit;
}
.gm2p-card-cart:hover { text-decoration: underline; }
.gm2p-card-oos { color: #c4b0a4; font-size: 14px; font-weight: 500; }

/* 购物车行无货 tag（三期库存 4.6） */
.gm2-tag-soldout { background: #eee9e2; color: var(--gm2-muted); }
