* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f6f8; color: #222; }
#app { min-height: 100vh; }
.view { min-height: 100vh; }
.hidden { display: none !important; }

/* 登录 */
.auth-card { max-width: 420px; margin: 0 auto; padding: 48px 24px; }
.auth-card h1 { font-size: 24px; text-align: center; color: #ff5722; }
.auth-card .sub { text-align: center; color: #888; margin: 8px 0 24px; font-size: 13px; }
.tabs { display: flex; border-bottom: 1px solid #eee; margin-bottom: 20px; }
.tab { flex: 1; background: none; border: none; padding: 12px; font-size: 16px; color: #999; border-bottom: 2px solid transparent; cursor: pointer; }
.tab.active { color: #ff5722; border-bottom-color: #ff5722; font-weight: 600; }
input { width: 100%; padding: 14px 12px; margin-bottom: 12px; border: 1px solid #ddd; border-radius: 10px; font-size: 15px; background: #fff; }
.agree { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #666; margin-bottom: 12px; }
.agree input { width: auto; margin: 0; }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.ghost { background: #fff; border: 1px solid #ff5722; color: #ff5722; border-radius: 10px; padding: 0 14px; font-size: 14px; white-space: nowrap; cursor: pointer; }
.primary { width: 100%; background: #ff5722; color: #fff; border: none; border-radius: 10px; padding: 14px; font-size: 16px; font-weight: 600; margin-top: 8px; cursor: pointer; }
.hint { font-size: 12px; color: #2e7d32; min-height: 16px; margin-bottom: 6px; }

/* 桌面顶部导航 */
.desktop-header { display: none; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 10; }
.desktop-header-inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 64px; }
.desktop-header .logo { font-size: 20px; font-weight: 700; color: #ff5722; }
.desktop-nav { display: flex; gap: 8px; }
.desktop-nav button { background: none; border: none; padding: 10px 18px; font-size: 15px; color: #555; border-radius: 8px; cursor: pointer; }
.desktop-nav button.active { color: #ff5722; background: #fff0eb; font-weight: 600; }

/* 移动端顶部标题栏 */
.topbar { background: #ff5722; color: #fff; padding: 14px; text-align: center; font-size: 17px; font-weight: 600; position: sticky; top: 0; z-index: 5; }
#content { padding: 16px; padding-bottom: 76px; max-width: 1100px; margin: 0 auto; }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid #eee; z-index: 8; }
.bottomnav button { flex: 1; border: none; background: none; padding: 12px 0; font-size: 13px; color: #999; cursor: pointer; }
.bottomnav button.active { color: #ff5722; font-weight: 600; }

/* 卡片通用 */
.card { background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.balance-big { font-size: 40px; font-weight: 700; color: #ff5722; }
.row { display: flex; justify-content: space-between; align-items: center; margin: 6px 0; font-size: 14px; }
.muted { color: #999; font-size: 12px; }
.btn-ad { width: 100%; background: linear-gradient(135deg,#ff7043,#ff5722); color: #fff; border: none; border-radius: 12px; padding: 18px; font-size: 18px; font-weight: 700; cursor: pointer; }
.btn-ad:disabled { background: #ccc; }
.section-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: #333; }

/* 首页横幅 */
.hero { background: linear-gradient(135deg,#ff7043,#ff5722); border-radius: 16px; padding: 28px 20px; color: #fff; margin-bottom: 16px; text-align: center; }
.hero h2 { font-size: 22px; margin-bottom: 8px; }
.hero p { font-size: 14px; opacity: 0.95; }

/* 积分卡片 */
.points-card { background: #fff; border-radius: 16px; padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-align: center; }
.points-card .label { color: #888; font-size: 13px; margin-bottom: 6px; }
.points-card .value { font-size: 42px; font-weight: 800; color: #ff5722; line-height: 1; }
.points-card .sub { margin-top: 12px; display: flex; justify-content: center; gap: 24px; font-size: 13px; color: #666; }

/* 快捷入口 */
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.quick-actions button { border: none; border-radius: 12px; padding: 16px; font-size: 15px; font-weight: 600; cursor: pointer; }
.quick-actions .watch { background: #ff5722; color: #fff; }
.quick-actions .mall { background: #fff; color: #ff5722; border: 1px solid #ff5722; }

/* 商品 */
.product-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.product { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); display: flex; flex-direction: column; }
.product .name { font-size: 16px; font-weight: 600; }
.product .muted { margin: 4px 0 8px; }
.product .price { color: #ff5722; font-weight: 700; margin: auto 0 10px; font-size: 15px; }
.product .buy { width: 100%; background: #ff5722; color: #fff; border: none; border-radius: 8px; padding: 10px; cursor: pointer; font-size: 15px; }
.product .buy:disabled { background: #ccc; }
.product { cursor: pointer; overflow: hidden; }
.product .p-cover { position: relative; width: 100%; padding-top: 66%; background: linear-gradient(135deg, #ffd9c9, #ffb59b); border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.product .p-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.product .p-cover.noimg { display: flex; align-items: center; justify-content: center; }
.product .p-cover.noimg span { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.product .price del { color: #bbb; font-weight: 400; font-size: 12px; margin-left: 6px; }
.product .price .pt { display: block; font-size: 12px; color: #ff8f00; font-weight: 500; margin-top: 2px; }
.product .price .tag.combo { background: #fff0eb; color: #ff5722; font-size: 12px; padding: 3px 8px; border-radius: 4px; font-weight: 600; margin-left: 4px; }
.product .small { font-size: 12px; margin-bottom: 10px; }

/* 分享 / 邀请按钮 */
.quick-actions .invite { background: #09bb07; color: #fff; }
button.invite { background: #09bb07; color: #fff; border: none; border-radius: 10px; padding: 14px; font-size: 15px; font-weight: 600; cursor: pointer; width: 100%; }
button.invite:hover { background: #08a306; }

/* 警告 / 提示 */
.warn { background: #fff7e6; color: #d48806; border: 1px solid #ffe7ba; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 8px 0; }
.muted.small { font-size: 12px; }

/* PC 专属楼层：移动端隐藏，桌面端展示为卡片横排 */
.pc-only { display: none; }
.pc-only .card { margin-bottom: 0; }

/* ===== 商品详情页 ===== */
.pd { position: fixed; inset: 0; background: #f5f6f8; z-index: 55; display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }
.pd-head { display: flex; align-items: center; gap: 8px; background: #ff5722; color: #fff; padding: 12px 14px; font-size: 16px; font-weight: 600; flex: none; }
.pd-back { background: none; border: none; color: #fff; font-size: 28px; line-height: 1; padding: 0 6px; cursor: pointer; }
.pd-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 12px; }
.pd-swiper { position: relative; width: 100%; height: 300px; background: linear-gradient(135deg, #ffd9c9, #ffb59b); overflow-x: auto; overflow-y: hidden; display: flex; scroll-snap-type: x mandatory; }
.pd-swiper::-webkit-scrollbar { display: none; }
.pd-swiper img { flex: 0 0 100%; width: 100%; height: 300px; object-fit: cover; scroll-snap-align: start; }
.pd-noimg { height: 220px; display: flex; align-items: center; justify-content: center; font-size: 60px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #ffd9c9, #ffb59b); }
.pd-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.pd-dots .dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.55); }
.pd-dots .dot.on { background: #ff5722; width: 16px; border-radius: 4px; }
.pd-sec { background: #fff; padding: 14px; margin-bottom: 10px; }
.pd-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pd-price .now { color: #ff5722; font-size: 26px; font-weight: 700; }
.pd-price del { color: #bbb; font-size: 13px; }
.pd-price .tag { background: #fff0eb; color: #ff5722; font-size: 12px; padding: 3px 8px; border-radius: 4px; font-weight: 600; }
.pd-title { font-size: 17px; font-weight: 600; margin-top: 8px; line-height: 1.4; }
.pd-sub { color: #888; font-size: 13px; margin-top: 4px; }
.pd-meta { display: flex; gap: 16px; color: #999; font-size: 12px; margin-top: 10px; }
.pd-label { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.pd-spec-group { margin-bottom: 12px; }
.pd-spec-group .gname { font-size: 13px; color: #888; margin-bottom: 6px; }
.pd-spec-vals { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-spec-vals button { border: 1px solid #ddd; background: #fafafa; color: #333; border-radius: 6px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.pd-spec-vals button.on { border-color: #ff5722; background: #fff0eb; color: #ff5722; font-weight: 600; }
.pd-spec-vals button:disabled { color: #ccc; background: #f5f5f5; cursor: not-allowed; }
.pd-promises { display: flex; flex-wrap: wrap; gap: 14px; color: #2e7d32; font-size: 12px; }
.pd-detail-body { font-size: 14px; line-height: 1.8; color: #444; }
.pd-detail-body img { width: 100%; border-radius: 8px; margin: 8px 0; display: block; }
.pd-bar { flex: none; display: flex; align-items: center; gap: 10px; background: #fff; border-top: 1px solid #eee; padding: 10px 14px; }
.pd-bar .bp { flex: 1; }
.pd-bar .bp .p1 { color: #ff5722; font-size: 20px; font-weight: 700; }
.pd-bar .bp .p2 { font-size: 12px; color: #ff8f00; }
.pd-bar .bbuy { background: #ff5722; color: #fff; border: none; border-radius: 22px; padding: 12px 28px; font-size: 15px; font-weight: 600; cursor: pointer; }
.pd-bar .bbuy:disabled { background: #ccc; }
.pd-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pd-cats .cat { border: 1px solid #ddd; background: #fff; color: #555; border-radius: 16px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.pd-cats .cat:hover { border-color: #ff5722; color: #ff5722; }

/* 商家广告 */
.merchant { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px; border-left: 4px solid #ffb300; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.merchant .mname { font-size: 13px; color: #ff8f00; }
.merchant .mtitle { font-size: 16px; font-weight: 600; margin: 4px 0; }
.merchant .view-btn { background: #ffb300; color: #fff; border: none; border-radius: 8px; padding: 8px 14px; font-size: 14px; cursor: pointer; }
.merchant .view-btn:disabled { background: #ccc; }

/* 空状态 */
.empty { text-align: center; color: #999; padding: 40px 0; font-size: 14px; }

/* 遮罩 */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 50; }
.video-box { text-align: center; color: #fff; }
.video-fake { font-size: 20px; padding: 60px; background: #222; border-radius: 12px; }

/* Toast */
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.8); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px; z-index: 60; }

/* ===== 桌面端适配 ===== */
@media (min-width: 900px) {
  .desktop-header { display: block; }
  .topbar { display: none; }
  .bottomnav { display: none; }
  #content { padding: 24px; padding-bottom: 24px; }
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  .quick-actions { grid-template-columns: repeat(3, 200px); justify-content: center; }
  .hero { padding: 40px; }
  .pc-only { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
  .pc-only .pc-download a.buy, .pc-only .pc-download a { display: inline-block; margin-top: 8px; }
  .hero h2 { font-size: 28px; }
  .points-card { display: flex; align-items: center; justify-content: space-between; text-align: left; }
  .points-card .left { flex: 1; }
  .points-card .right { text-align: right; }
}

/* 小屏手机微调 */
@media (max-width: 360px) {
  .bottomnav button { font-size: 12px; }
}
