:root { --primary: #ff4e00; --primary2: #ff2a01; --orange: #ff6b01; --bg: #f5f5f5; }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, "PingFang SC", "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: #333; overflow-x: hidden; }
.app { max-width: 720px; margin: 0 auto; padding: 10px 10px 40px; }
.hidden { display: none !important; }

/* 搜索：卡片式文本框 + 全宽按钮，方便粘贴淘口令 */
.search-box { background: #fff; border-radius: 14px; padding: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.search-box textarea { width: 100%; border: 1.5px solid #f0f0f0; border-radius: 10px; padding: 11px 13px; font-size: 14px; line-height: 1.5; outline: none; resize: none; background: #fafafa; color: #333; font-family: inherit; transition: border-color .15s, background .15s; }
.search-box textarea:focus { border-color: var(--primary); background: #fff; }
.search-box textarea::placeholder { color: #bbb; }
.search-btn { width: 100%; height: 42px; margin-top: 10px; border-radius: 10px; padding: 0; }
.btn { border: none; border-radius: 24px; background: linear-gradient(90deg,var(--orange),var(--primary2)); color: #fff; font-size: 15px; font-weight: 600; padding: 0 22px; cursor: pointer; box-shadow: 0 2px 8px rgba(255,78,0,.25); }
.btn:disabled { opacity: .6; box-shadow: none; }
.notice { font-size: 12px; color: #999; text-align: center; margin: 8px 0 0; }

/* 更多优惠活动卡片 */
.activity-section { margin-top: 4px; }
.activity-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.activity-card { width: calc(50% - 5px); background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.06); cursor: pointer; text-decoration: none; transition: transform .12s; }
.activity-card:active { transform: scale(.98); }
.ac-cover { width: 100%; height: 92px; display: flex; align-items: center; justify-content: center; }
.ac-emoji { font-size: 46px; line-height: 1; filter: drop-shadow(0 2px 6px rgba(0,0,0,.18)); }
.ac-cover-txt { color: #fff; text-align: center; font-size: 15px; font-weight: 700; line-height: 1.25; text-shadow: 0 2px 8px rgba(0,0,0,.15); }
.ac-cover-txt b { display: block; font-size: 19px; font-weight: 800; letter-spacing: 1px; }
.activity-card-info { padding: 9px 10px 11px; }
.activity-card-name { font-weight: 600; font-size: 14px; color: #222; line-height: 1.3; }
.activity-card-desc { font-size: 11px; color: #999; margin-top: 4px; line-height: 1.35; }

/* 分类标签 */
.sec-title { font-size: 16px; font-weight: 700; color: #333; margin: 14px 2px 10px; display: flex; align-items: center; }
.tabs { display: flex; background: #fff; border-radius: 10px; margin: 12px 0 10px; padding: 6px 0; }
.tab { flex: 1; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 2px; padding: 4px 0; position: relative; }
.tab .t-main { font-size: 15px; color: #333; font-weight: 500; }
.tab .t-sub { font-size: 10px; color: #999; }
.tab.active .t-main { color: var(--primary); font-weight: 700; }
.tab.active::after { content: ''; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); width: 22px; height: 3px; border-radius: 2px; background: var(--primary); }

/* 商品列表：纵向，横向大卡片 */
.list { display: flex; flex-direction: column; gap: 10px; }
.card-item { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.05); cursor: pointer; transition: transform .12s; display: flex; padding: 10px; gap: 10px; width: 100%; }
.card-item:active { transform: scale(.99); }
.ci-img { width: 116px; height: 116px; flex-shrink: 0; border-radius: 8px; object-fit: cover; background: #f0f0f0; }
.ci-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ci-title { font-size: 15px; line-height: 1.4; color: #222; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ci-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 7px 0; }
.tag-combo { display: inline-flex; align-items: center; height: 17px; border-radius: 3px; overflow: hidden; font-size: 10px; line-height: 17px; }
.tag-combo .tc-key { padding: 0 5px; color: #fff; font-weight: 600; }
.tag-combo .tc-val { padding: 0 5px; border: 1px solid; border-left: none; border-radius: 0 3px 3px 0; font-weight: 600; }
.tag-coupon .tc-key { background: var(--primary); } .tag-coupon .tc-val { color: var(--primary); border-color: var(--primary); }
.tag-tlj .tc-key { background: var(--orange); } .tag-tlj .tc-val { color: var(--orange); border-color: var(--orange); }
.tag-gold .tc-key { background: #f0a000; } .tag-gold .tc-val { color: #d68000; border-color: #f0a000; }
.ci-coudan { display: inline-block; align-self: flex-start; font-size: 11px; color: #d68000; background: #fff5e6; border-radius: 4px; padding: 2px 7px; margin-bottom: 6px; }
.ci-bottom { margin-top: auto; display: flex; align-items: flex-end; gap: 6px; width: 100%; }
.ci-price-wrap { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; overflow: hidden; }
.ci-btn { flex-shrink: 0; }
.ci-price { color: var(--primary); font-size: 13px; font-weight: 600; }
.ci-price b { font-size: 25px; }
.ci-sales { font-size: 11px; color: #999; }
.ci-btn { position: relative; border: none; background: linear-gradient(90deg,var(--orange),var(--primary2)); color: #fff; border-radius: 16px; padding: 7px 20px; font-size: 14px; font-weight: 700; cursor: pointer; }
.ci-btn::before { content: ''; position: absolute; left: -4px; top: 50%; transform: translateY(-50%); width: 8px; height: 8px; background: #fff; border-radius: 50%; }
.ci-foot { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.foot-tag { font-size: 10px; color: var(--primary); border: 1px solid #ffd0bb; border-radius: 3px; padding: 1px 5px; }
.empty { text-align: center; color: #999; padding: 40px 0; font-size: 14px; }
.load-more { text-align: center; color: #888; padding: 14px; font-size: 14px; cursor: pointer; }

/* 详情全屏页 */
.detail-view { position: fixed; inset: 0; background: var(--bg); z-index: 30; display: flex; flex-direction: column; animation: slideIn .25s ease; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.detail-header { display: flex; align-items: center; padding: 12px 14px; background: #fff; border-bottom: 1px solid #f0f0f0; position: sticky; top: 0; z-index: 5; }
.back-btn { font-size: 30px; color: #333; cursor: pointer; padding: 0 12px 0 0; line-height: .8; }
.header-title { font-size: 16px; font-weight: 600; }
.detail-body { flex: 1; overflow-y: auto; padding-bottom: 78px; }
.swiper-wrap { position: relative; background: #fff; }
.swiper { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
.swiper img { width: 100%; aspect-ratio: 1/1; object-fit: cover; flex-shrink: 0; scroll-snap-align: start; }
.swiper::-webkit-scrollbar { display: none; }
.swiper-idx { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.5); color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 12px; }

/* 红色价格头条 */
.price-band { background: linear-gradient(90deg,var(--primary2),var(--orange)); padding: 14px 16px; color: #fff; }
.pb-left { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pb-price { font-size: 16px; font-weight: 600; }
.pb-price b { font-size: 32px; }
.pb-subsidy { background: #fff; color: var(--primary); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; }
.pb-orig { font-size: 13px; color: rgba(255,255,255,.8); text-decoration: line-through; }
.pb-lowest { font-size: 14px; color: #ffe54c; font-weight: 700; margin-top: 4px; }

.d-card { background: #fff; margin: 8px 0 0; padding: 14px 16px; }
.d-card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: #333; }
.d-tagrow { display: flex; align-items: center; justify-content: space-between; margin-top: 0; }
.d-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.d-getcoupon { color: var(--primary); font-size: 14px; font-weight: 600; flex-shrink: 0; cursor: pointer; }
.d-titlecard { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.d-title { font-size: 16px; line-height: 1.5; font-weight: 600; flex: 1; }
.d-share { text-align: center; color: #888; font-size: 18px; flex-shrink: 0; cursor: pointer; }
.d-share i { font-size: 11px; font-style: normal; }

/* 价格预估明细 */
.est-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 7px 0; }
.est-row .er-label { color: #333; } .est-row .er-sub { color: #999; font-size: 12px; }
.est-row .er-val { color: #333; }
.est-row.minus .er-label, .est-row.minus .er-val { color: var(--primary); }
.est-row.final { border-top: 1px solid #f0f0f0; margin-top: 4px; padding-top: 12px; font-weight: 700; }
.est-row.final .er-val { color: var(--primary); font-size: 17px; }

.d-shopcard .d-brand { font-size: 13px; color: #888; margin-bottom: 8px; }
.d-shopcard .d-brand b { color: #333; font-weight: 600; margin-left: 6px; }
.d-shop { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.shop-tag { font-size: 11px; color: var(--primary); border: 1px solid var(--primary); border-radius: 3px; padding: 1px 6px; font-weight: 400; }

/* 为您推荐 */
.rec-list { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.rec-loading { grid-column: 1 / -1; text-align: center; color: #bbb; font-size: 13px; padding: 14px 0; }
.rec-item { cursor: pointer; }
.rec-item:active { opacity: .8; }
.rec-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; background: #f0f0f0; display: block; }
.rec-title { font-size: 12px; line-height: 1.35; color: #444; margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 32px; }
.rec-bottom { display: flex; align-items: baseline; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.rec-cou { font-size: 9px; color: var(--primary); border: 1px solid var(--primary); border-radius: 2px; padding: 0 3px; }
.rec-price { color: var(--primary); font-size: 11px; }
.rec-price b { font-size: 16px; }

/* 底部双按钮 */
.detail-footer { position: fixed; bottom: 0; left: 0; right: 0; max-width: 720px; margin: 0 auto; display: flex; padding: 8px 12px; background: #fff; border-top: 1px solid #f0f0f0; z-index: 6; gap: 0; }
.detail-footer button { border: none; cursor: pointer; }
.d-btn-secondary { flex: 1; padding: 12px; background: linear-gradient(90deg,#ffb733,#ff9500); color: #fff; font-size: 15px; font-weight: 700; border-radius: 24px 0 0 24px; }
.d-btn-primary { flex: 1.1; padding: 8px; background: linear-gradient(90deg,var(--orange),var(--primary2)); color: #fff; border-radius: 0 24px 24px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.25; }
.d-btn-primary b { font-size: 15px; } .d-btn-primary i { font-size: 11px; font-style: normal; opacity: .95; }
.d-btn-primary:disabled, .d-btn-secondary:disabled { opacity: .6; }

/* 领取结果弹层 */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.sheet { background: #fff; width: 100%; max-width: 720px; border-radius: 16px 16px 0 0; padding: 20px 18px 28px; position: relative; animation: up .25s ease; }
@keyframes up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.close { position: absolute; right: 16px; top: 12px; font-size: 26px; color: #bbb; cursor: pointer; line-height: 1; }
.sheet-title { font-size: 16px; margin-bottom: 16px; text-align: center; }
.goods { display: flex; gap: 12px; margin-bottom: 18px; }
.g-img { width: 70px; height: 70px; border-radius: 8px; object-fit: cover; background: #f0f0f0; flex-shrink: 0; }
.g-info { flex: 1; min-width: 0; }
.g-title { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 6px; }
.result-text { font-size: 13px; color: #555; line-height: 1.6; word-break: break-all; }
.tpwd-box { background: #fff7f2; color: var(--primary); padding: 10px; border-radius: 6px; margin-top: 8px; font-size: 13px; word-break: break-all; }
.tpwd-tip { font-size: 12px; color: #888; margin-top: 6px; }
.btn-receive { display: block; text-align: center; text-decoration: none; padding: 13px; font-size: 16px; }

/* 优惠明细弹层（奇兔客同款卡片风） */
.promo-head { display: flex; align-items: center; justify-content: center; position: relative; padding: 4px 0 14px; }
.promo-head-title { font-size: 17px; font-weight: 700; color: #222; }
.promo-head .close { position: absolute; right: 0; top: 0; font-size: 24px; color: #999; cursor: pointer; line-height: 1; }
.promo-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.promo-card { display: flex; align-items: center; background: linear-gradient(90deg,#fff6f2,#fff); border: 1px solid #ffe2d6; border-radius: 12px; padding: 12px 14px; gap: 12px; }
.pc-amt { display: flex; flex-direction: column; align-items: center; min-width: 64px; padding-right: 12px; border-right: 1px dashed #ffcdb8; }
.pc-amt-v { color: var(--primary); font-size: 22px; font-weight: 800; line-height: 1.1; }
.pc-type { color: var(--primary); font-size: 11px; margin-top: 2px; }
.pc-mid { flex: 1; min-width: 0; }
.pc-cond { font-size: 14px; color: #333; font-weight: 600; }
.pc-sub { font-size: 11px; color: #999; margin-top: 3px; }
.promo-use { flex-shrink: 0; background: linear-gradient(90deg,var(--primary),var(--primary2)); color: #fff; border: none; border-radius: 16px; padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer; }
.promo-use:active { opacity: .85; }
.promo-empty { text-align: center; color: #999; padding: 24px 0; font-size: 14px; }
.promo-foot { font-size: 12px; color: #aaa; text-align: center; margin-top: 14px; }
.toast { position: fixed; left: 50%; top: 45%; transform: translateX(-50%); background: rgba(0,0,0,.8); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px; z-index: 99; }
.est-tip { font-size: 11px; color: #bbb; margin-top: 8px; text-align: center; }
.est-coudan { background: #fff3e6; color: #e67e22; font-size: 12px; padding: 6px 10px; border-radius: 6px; margin-bottom: 8px; text-align: center; }
.est-row.coupon .er-label, .est-row.coupon .er-val { color: #e74c3c; font-weight: 600; }

/* 顶部 Tab 切换 */
.tab-bar { display: flex; gap: 8px; margin: 12px 2px 4px; }
.tab-bar .tab-item { flex: 1; text-align: center; padding: 10px 0; font-size: 15px; font-weight: 600; color: #888; background: #fff; border-radius: 10px; cursor: pointer; transition: all .15s; }
.tab-bar .tab-item.active { color: #fff; background: linear-gradient(90deg,var(--orange),var(--primary2)); }
/* 直播分类横向滚动条 */
.live-cats { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px; -webkit-overflow-scrolling: touch; }
.live-cats::-webkit-scrollbar { display: none; }
.live-cats .live-cat { flex: 0 0 auto; padding: 6px 14px; font-size: 13px; color: #666; background: #fff; border: 1px solid #eee; border-radius: 16px; white-space: nowrap; cursor: pointer; }
.live-cats .live-cat.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.live-cats .empty { color: #999; font-size: 13px; padding: 6px; }
