:root {
  --bg: #0f0f11;
  --card: #1a1a1d;
  --card2: #222226;
  --text: #e8e6e3;
  --text2: #9a9a9f;
  --gold: #d4af37;
  --gold2: #e8c96a;
  --line: #2a2a2e;
  --danger: #ff5c5c;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #0a0a0c; color: var(--text); }
a { text-decoration: none; color: inherit; }
img { -webkit-user-select: none; }

.app { max-width: 520px; margin: 0 auto; background: var(--bg); min-height: 100vh; position: relative; }

.topbar { position: sticky; top: 0; z-index: 10; background: #121214; border-bottom: 1px solid var(--line); padding: 10px 14px 0; }
.brandrow { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.logo { color: var(--text); font-size: 19px; font-weight: 800; letter-spacing: 1px; }
.logo span { color: var(--gold); margin-left: 2px; }
.catbtn { color: var(--text2); font-size: 13px; border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px; }
.catbtn:active { background: var(--card2); }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.nav::-webkit-scrollbar { display: none; }
.tab { flex-shrink: 0; color: var(--text2); font-size: 14px; padding: 8px 13px; border-radius: 8px 8px 0 0; white-space: nowrap; }
.tab.active { color: var(--gold); font-weight: 600; border-bottom: 2px solid var(--gold); }

.savebanner { margin: 10px 10px 0; background: linear-gradient(135deg, #1c1c1f, #24201a); border: 1px solid #3a3325; border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; }
.savebanner .sb-icon { font-size: 22px; }
.savebanner .sb-text { font-size: 13px; color: var(--text2); line-height: 1.5; }
.savebanner .sb-text b { color: var(--gold); font-size: 16px; }

.catbar { position: sticky; top: 58px; z-index: 9; background: #121214; display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.catbar::-webkit-scrollbar { display: none; }
.cat { flex-shrink: 0; font-size: 12px; color: var(--text2); background: var(--card); border-radius: 13px; padding: 4px 11px; white-space: nowrap; }
.cat.on { background: #2a2415; color: var(--gold); font-weight: 600; }

.boardbar { position: sticky; top: 58px; z-index: 9; background: #121214; display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.boardbar::-webkit-scrollbar { display: none; }
.board { flex-shrink: 0; font-size: 13px; color: var(--text2); background: var(--card); border-radius: 14px; padding: 5px 13px; white-space: nowrap; }
.board.active { background: #2a2415; color: var(--gold); font-weight: 600; }

.sortbar { position: sticky; top: 132px; z-index: 9; background: #121214; display: flex; gap: 14px; padding: 7px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.sortbar::-webkit-scrollbar { display: none; }
.sort { flex-shrink: 0; font-size: 12px; color: var(--text2); white-space: nowrap; }
.sort.active { color: var(--gold); font-weight: 600; }

.list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px; }
.list.flat { display: block; }
.list.flat .brandcats { margin: -10px -10px 4px; }
.list.flat .brandgrid { padding: 0; }
.list.flat .branditems { padding: 0; }
.card { background: var(--card); border-radius: 12px; overflow: hidden; border: 1px solid transparent; transition: transform .1s, border-color .1s; display: block; }
.card:active { transform: scale(.97); border-color: var(--gold); }
.thumb { position: relative; aspect-ratio: 1 / 1; background: #f5f5f7; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.save-tag { position: absolute; left: 6px; top: 6px; background: rgba(15,15,17,.82); color: var(--gold2); font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; backdrop-filter: blur(2px); }
.info { padding: 8px 10px 10px; }
.title { font-size: 13px; line-height: 1.45; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.pricerow { margin-top: 6px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.end { color: var(--gold); font-size: 19px; font-weight: 800; }
.end em { font-style: normal; font-size: 12px; }
.ori { color: #6a6a70; font-size: 11px; text-decoration: line-through; }
.coupon { color: var(--gold); border: 1px solid #4a3f1d; background: #2a2415; font-size: 10px; padding: 1px 5px; border-radius: 4px; }
.meta { margin-top: 5px; font-size: 10px; color: #6a6a70; display: flex; justify-content: space-between; }

.skeleton { background: var(--card); border-radius: 12px; overflow: hidden; }
.skeleton .sk-img { aspect-ratio: 1/1; }
.skeleton .sk-line { height: 13px; border-radius: 4px; margin: 8px 10px 0; }
.skeleton .sk-line.w70 { width: 70%; } .skeleton .sk-line.w40 { width: 40%; margin-bottom: 12px; }
.sk { background: linear-gradient(90deg, #222226 25%, #2a2a2e 37%, #222226 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
@keyframes listin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.list-anim { animation: listin .25s ease; }
.card-in { animation: listin .3s ease both; }

.detail { padding: 0 0 74px; }
.detail .backrow { position: sticky; top: 0; z-index: 10; background: rgba(18,18,20,.92); backdrop-filter: blur(6px); padding: 8px 14px; }
.detail .backrow a { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text); }
.detail .hero img { width: 100%; background: #f5f5f7; display: block; }
.detail .thumbs { display: flex; gap: 6px; padding: 8px 12px; background: var(--card); overflow-x: auto; }
.detail .thumbs img { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; flex-shrink: 0; border: 2px solid transparent; background: #f5f5f7; }
.detail .thumbs img.on { border-color: var(--gold); }
.detail .body { background: var(--card); padding: 14px; margin-top: 8px; }
.detail .title { font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--text); }
.detail .prices { display: flex; align-items: baseline; gap: 8px; margin: 12px 0 4px; flex-wrap: wrap; }
.detail .prices .end { color: var(--gold); font-size: 30px; font-weight: 800; }
.detail .prices .end em { font-style: normal; font-size: 16px; }
.detail .prices .ori { color: #6a6a70; font-size: 14px; text-decoration: line-through; }
.detail .savebig { display: inline-block; color: var(--gold2); font-size: 14px; font-weight: 700; margin-top: 2px; }
.detail .coupontip { display: inline-block; color: var(--gold); background: #2a2415; border: 1px solid #4a3f1d; font-size: 12px; padding: 3px 8px; border-radius: 5px; margin: 4px 0 8px; }
.detail .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.detail .tag { font-size: 11px; padding: 3px 8px; border-radius: 4px; background: var(--card2); color: var(--text2); }
.vote { display: flex; gap: 10px; margin-bottom: 12px; }
.vote-btn { flex: 1; text-align: center; font-size: 14px; padding: 8px 0; border-radius: 20px; border: 1px solid var(--line); background: var(--card2); color: var(--text2); }
.vote-btn em { font-style: normal; font-weight: 600; }
.vote-btn.vv.on { background: #16261a; color: #7fd08a; border-color: #2c5a38; }
.vote-btn.nv.on { background: #2a1512; color: #ff7a6e; border-color: #5a2c24; }
.vote-btn:active { transform: scale(.97); }
.detail .guide { margin-top: 6px; }
.detail .guide h3 { font-size: 14px; color: var(--gold); margin-bottom: 8px; }
.detail .guide .guide-box { background: #1c1b17; border: 1px dashed #4a3f1d; border-radius: 8px; padding: 10px; font-size: 14px; line-height: 1.7; color: #c9c7c2; }
.detail .desc { font-size: 13px; color: var(--text2); line-height: 1.7; margin-top: 12px; }
.detail .related { margin-top: 8px; background: var(--card); padding: 12px 14px; }
.detail .related h3 { font-size: 15px; margin-bottom: 10px; color: var(--text); }
.related-scroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.related-scroll::-webkit-scrollbar { display: none; }
.rel-card { flex-shrink: 0; width: 132px; }
.rel-card img { width: 132px; height: 132px; border-radius: 8px; background: #f5f5f7; object-fit: cover; display: block; }
.rel-card .t { font-size: 12px; line-height: 1.4; margin-top: 6px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rel-card .p { color: var(--gold); font-weight: 700; font-size: 15px; margin-top: 4px; }

.comments { margin-top: 8px; background: var(--card); padding: 12px 14px; }
.comments h3 { font-size: 15px; margin-bottom: 10px; color: var(--text); }
.cmt-count { font-size: 12px; color: var(--text2); font-weight: 400; }
.cmt-form input, .cmt-form textarea { width: 100%; border: 1px solid var(--line); background: var(--card2); color: var(--text); border-radius: 8px; padding: 8px 10px; font-size: 13px; margin-bottom: 8px; font-family: inherit; outline: none; box-sizing: border-box; }
.cmt-form input:focus, .cmt-form textarea:focus { border-color: var(--gold); }
.cmt-form button { width: 100%; background: linear-gradient(90deg, #a8892f, var(--gold)); color: #15130a; border: 0; border-radius: 20px; padding: 9px 0; font-size: 14px; font-weight: 700; }
.cmt-form button:active { opacity: .9; }
.cmt-list { margin-top: 12px; }
.cmt-empty { text-align: center; color: var(--text2); font-size: 13px; padding: 16px 0; }
.cmt { padding: 10px 0; border-bottom: 1px solid var(--line); }
.cmt:last-child { border-bottom: 0; }
.cmt-head { display: flex; justify-content: space-between; font-size: 12px; }
.cmt-head b { color: var(--text); }
.cmt-head span { color: #6a6a70; }
.cmt-body { font-size: 14px; color: #c9c7c2; line-height: 1.6; margin-top: 5px; word-break: break-all; }

.buybar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 520px; background: #141416; border-top: 1px solid var(--line); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 10px; box-shadow: 0 -2px 10px rgba(0,0,0,.4); z-index: 20; }
.buybar a { flex: 1; text-align: center; padding: 12px 0; border-radius: 24px; font-size: 15px; font-weight: 700; }
.buybar .coupon-btn { background: var(--card2); color: var(--gold); border: 1px solid #4a3f1d; }
.buybar .buy-btn { background: linear-gradient(90deg, #a8892f, var(--gold)); color: #15130a; }
.buybar .buy-btn:active { opacity: .9; }

.loadmore { text-align: center; color: var(--text2); padding: 14px 0 24px; font-size: 13px; }

.brandcats { display: flex; gap: 6px; padding: 10px 12px; overflow-x: auto; scrollbar-width: none; background: #121214; }
.brandcats::-webkit-scrollbar { display: none; }
.bcat { flex-shrink: 0; font-size: 12px; color: var(--text2); background: var(--card); border-radius: 13px; padding: 4px 11px; white-space: nowrap; }
.bcat.active { background: #2a2415; color: var(--gold); font-weight: 600; }
.brandgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px; }
.brandcell { min-width: 0; background: var(--card); border-radius: 10px; padding: 12px 6px 8px; text-align: center; border: 1px solid var(--line); }
.brandcell:active { transform: scale(.96); }
.brandcell .bimg { width: 52px; height: 52px; margin: 0 auto; border-radius: 50%; background: #f5f5f7; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.brandcell .bimg img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brandcell .bimg.noimg img { display: none; }
.brandcell .bfall { display: none; font-size: 22px; font-weight: 700; color: var(--gold); }
.brandcell .bimg.noimg .bfall { display: block; }
.brandcell .bn { font-size: 11px; color: var(--text2); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brandcell .bcount { font-size: 10px; color: var(--gold); margin-top: 2px; }
.bcat em { font-style: normal; font-size: 10px; color: var(--gold); margin-left: 3px; }
.todaybrand { position: relative; margin: 10px; border-radius: 12px; overflow: hidden; min-height: 90px; border: 1px solid #4a3f1d; }
.todaybrand::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,10,12,.92) 30%, rgba(10,10,12,.35)); }
.tb-inner { position: relative; padding: 14px; }
.tb-tag { display: inline-block; font-size: 11px; color: #15130a; background: var(--gold); border-radius: 4px; padding: 2px 7px; font-weight: 700; }
.tb-name { font-size: 18px; font-weight: 800; color: var(--text); margin-top: 7px; }
.tb-title { font-size: 12px; color: var(--text2); margin-top: 3px; }
.tb-go { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--gold2); border: 1px solid #4a3f1d; border-radius: 12px; padding: 3px 10px; }
.hotstrip { margin: 0 10px 4px; }
.hot-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 4px 0 8px; }
.hot-scroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.hot-scroll::-webkit-scrollbar { display: none; }
.hotcell { flex-shrink: 0; width: 64px; text-align: center; position: relative; }
.hotcell img { width: 48px; height: 48px; border-radius: 50%; background: #f5f5f7; object-fit: contain; display: block; margin: 0 auto; }
.hot-rank { position: absolute; top: -2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); color: #15130a; font-size: 11px; font-weight: 800; line-height: 18px; }
.hot-name { font-size: 10px; color: var(--text2); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsort { display: flex; gap: 14px; padding: 8px 14px; background: var(--card); margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.bsort::-webkit-scrollbar { display: none; }
.bsort-item { flex-shrink: 0; font-size: 12px; color: var(--text2); }
.bsort-item.on { color: var(--gold); font-weight: 600; }
.brandhead { background: var(--card); padding: 10px 14px 12px; margin-bottom: 10px; }
.bh-back { font-size: 13px; color: var(--text); margin-bottom: 8px; }
.bh-main { display: flex; gap: 10px; align-items: center; }
.bh-main img { width: 52px; height: 52px; border-radius: 50%; background: #f5f5f7; object-fit: contain; flex-shrink: 0; }
.bh-name { font-size: 17px; font-weight: 700; color: var(--text); }
.bh-plain { font-size: 12px; color: var(--text2); margin-top: 3px; }
.bh-guide { margin-top: 10px; background: #1c1b17; border: 1px dashed #4a3f1d; border-radius: 8px; padding: 10px; font-size: 13px; line-height: 1.7; color: #c9c7c2; }
.branditems { padding: 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.sheet-mask { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; }
.sheet { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; background: #17171a; border-radius: 16px 16px 0 0; padding: 16px 14px calc(20px + env(safe-area-inset-bottom)); animation: up .2s ease; }
@keyframes up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.sheet-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.sheet-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-height: 55vh; overflow-y: auto; }
.scat { text-align: center; font-size: 13px; color: var(--text2); background: var(--card); border-radius: 8px; padding: 10px 4px; }
.scat.active { background: #2a2415; color: var(--gold); font-weight: 600; }
