/* ============ 基础 ============ */
:root {
  --red: #e8362d;
  --red-dark: #c22a22;
  --orange: #ff7a18;
  --ink: #17181c;
  --ink-2: #3d4049;
  --gray: #6b7280;
  --gray-2: #9aa1ac;
  --line: #ebedf1;
  --bg: #f4f5f7;
  --card: #ffffff;
  --green: #12a150;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(23, 24, 28, .05);
  --shadow: 0 6px 24px -8px rgba(23, 24, 28, .14);
  --shadow-lg: 0 24px 60px -20px rgba(23, 24, 28, .28);
}

* { box-sizing: border-box; }

/* hidden 属性必须能覆盖 .modal / .load-more 等自带 display 的组件 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }

.wrap { width: min(1240px, calc(100% - 40px)); margin: 0 auto; }

/* ============ 按钮 ============ */
.btn-primary {
  border: 0;
  background: linear-gradient(135deg, var(--red), #ff5a3c);
  color: #fff;
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: 0 6px 16px -6px rgba(232, 54, 45, .7);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -8px rgba(232, 54, 45, .8); filter: saturate(1.1); }
.btn-primary:active { transform: translateY(0); }

.btn-outline {
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px 18px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--ink-2);
  transition: border-color .16s ease, color .16s ease, transform .16s ease;
}
.btn-outline:hover { border-color: var(--red); color: var(--red); transform: translateY(-1px); }

.btn-ghost {
  border: 1px solid transparent;
  background: transparent;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-weight: 500;
}
.btn-ghost:hover { background: #f2f3f5; }

.btn-lg { padding: 12px 26px; border-radius: 12px; font-size: 15px; }

/* ============ 顶部通栏 ============ */
.topbar {
  background: var(--ink);
  color: #c9ccd4;
  font-size: 12.5px;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
.topbar-left b { color: #fff; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, .18); }
.topbar-links { display: flex; gap: 18px; white-space: nowrap; }
.topbar-links a:hover { color: #fff; }
.topbar-links .is-strong { color: #fff; font-weight: 600; }

/* ============ 头部 ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 0 10px;
}

.logo { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.logo-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--red), #ff6b35);
  color: #fff;
  font-weight: 800;
  font-size: 21px;
  box-shadow: 0 8px 18px -8px rgba(232, 54, 45, .9);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.05; }
.logo-text b { font-size: 20px; letter-spacing: .5px; }
.logo-text i { font-size: 9.5px; letter-spacing: 2.4px; color: var(--gray-2); font-style: normal; }

.search {
  position: relative;
  flex: 1 1 auto;
  max-width: 640px;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 5px 5px 5px 12px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search:focus-within { border-color: var(--red); box-shadow: 0 0 0 4px rgba(232, 54, 45, .09); }
.search-ico {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: var(--gray-2); stroke-width: 2; stroke-linecap: round;
}
.search input {
  flex: 1;
  border: 0;
  outline: none;
  padding: 6px 10px;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
}
.search input::-webkit-search-cancel-button { display: none; }
.search-btn {
  flex: 0 0 auto;
  border: 0;
  background: linear-gradient(135deg, var(--red), #ff5a3c);
  color: #fff;
  padding: 8px 20px;
  border-radius: 9px;
  font-weight: 600;
}
.hot-words {
  position: absolute;
  left: 14px;
  bottom: -22px;
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--gray-2);
  white-space: nowrap;
}
.hot-words a:hover { color: var(--red); }

.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.count-pill {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* 导航 */
.navbar { border-top: 1px solid var(--line); }
.navbar-inner { display: flex; align-items: center; gap: 4px; height: 44px; }
.nav-item {
  position: relative;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 500;
  color: var(--ink-2);
  transition: color .15s ease, background .15s ease;
}
.nav-item:hover { color: var(--red); background: #fff5f4; }
.nav-item.is-active { color: var(--red); font-weight: 700; }
.nav-item.is-active::after {
  content: "";
  position: absolute; left: 50%; bottom: -9px;
  width: 18px; height: 3px; border-radius: 2px;
  background: var(--red);
  transform: translateX(-50%);
}
.nav-spacer { flex: 1; }
.nav-tip { font-size: 12px; color: var(--gray-2); }

/* ============ Hero ============ */
.hero {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  margin: 26px auto 30px;
}
.hero-main {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 330px;
  padding: 34px 20px 34px 40px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(900px 400px at 90% -10%, #ffe6dc 0%, transparent 60%),
    linear-gradient(135deg, #fff7f5, #ffffff 55%, #f6f8ff);
  border: 1px solid #f1e6e4;
  box-shadow: var(--shadow);
}
.hero-main::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(#e8362d 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .05;
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; flex: 1 1 55%; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(232, 54, 45, .08);
  color: var(--red);
  font-weight: 700;
  font-size: 12.5px;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: .3px;
}
.hero-copy h1 {
  margin: 14px 0 12px;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.24;
  letter-spacing: -.5px;
  font-weight: 800;
}
.hero-copy h1 span {
  background: linear-gradient(100deg, var(--red), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-copy p { color: var(--gray); max-width: 480px; font-size: 14.5px; }
.hero-actions { display: flex; gap: 10px; margin: 22px 0 24px; }
.hero-stats { display: flex; gap: 28px; }
.hero-stats > div { display: flex; flex-direction: column; }
.hero-stats b { font-size: 20px; letter-spacing: -.4px; }
.hero-stats span { font-size: 12px; color: var(--gray-2); }

.hero-visual {
  position: relative;
  flex: 0 0 300px;
  width: 300px;
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(140deg, #ffd9cf, #ffb59e);
  box-shadow: 0 24px 50px -22px rgba(200, 60, 40, .55);
}
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }
.hero-price-card {
  position: absolute;
  left: 14px; bottom: 14px;
  display: flex; flex-direction: column;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  padding: 8px 14px;
  box-shadow: var(--shadow);
}
.hp-label { font-size: 11px; color: var(--red); font-weight: 700; letter-spacing: .5px; }
.hp-price { font-size: 22px; font-weight: 800; color: var(--red); line-height: 1.2; }
.hp-was { font-size: 11.5px; color: var(--gray-2); text-decoration: line-through; }

.hero-side { display: flex; flex-direction: column; gap: 12px; }
.mini-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.mini-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #ffe0dc; }
.mini-thumb {
  width: 74px; height: 74px;
  flex: 0 0 auto;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(140deg, #eef1f6, #dfe4ec);
}
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-body { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; }
.mini-badge {
  align-self: flex-start;
  font-size: 10.5px; font-weight: 700;
  color: #fff;
  background: var(--red);
  padding: 1px 7px;
  border-radius: 5px;
}
.mini-badge.is-green { background: var(--green); }
.mini-body h4 {
  font-size: 13.5px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.mini-body p { display: flex; align-items: baseline; gap: 6px; }
.mini-body b { color: var(--red); font-size: 16px; }
.mini-body s { color: var(--gray-2); font-size: 11.5px; }
.mini-note {
  margin-top: auto;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--gray);
  background: #fff;
  border: 1px dashed #e3e6ec;
  border-radius: 12px;
  padding: 10px 12px;
}
.mini-note b { color: var(--ink); }

.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red);
  position: relative;
  flex: 0 0 auto;
}
.pulse::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--red);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(2.8); opacity: 0; }
}

/* ============ 布局 ============ */
.layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
  padding-bottom: 60px;
}

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-head h2 { font-size: 22px; letter-spacing: -.4px; display: flex; align-items: center; gap: 8px; }
.section-head h2::before {
  content: "";
  width: 4px; height: 20px; border-radius: 2px;
  background: linear-gradient(var(--red), var(--orange));
}
.section-head p { font-size: 12.5px; color: var(--gray-2); margin-top: 2px; }

.sort-tabs {
  display: flex;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px;
  flex: 0 0 auto;
}
.sort-tabs button {
  border: 0; background: transparent;
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--gray);
  font-weight: 500;
}
.sort-tabs button.is-active { background: var(--ink); color: #fff; font-weight: 600; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-2);
  transition: all .16s ease;
}
.chip:hover { border-color: #ffc8c3; color: var(--red); }
.chip.is-active {
  background: linear-gradient(135deg, var(--red), #ff5a3c);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 14px -8px rgba(232, 54, 45, .9);
}

.result-line {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--gray-2);
  margin-bottom: 12px;
}
.result-hint { color: var(--red); font-weight: 600; }
.rt-status { margin-left: auto; font-size: 12px; color: var(--gray-2); }
.rt-status.is-live { color: var(--green); font-weight: 600; }
.rt-status.is-mute { color: var(--gray-2); }

/* ============ 商品卡 ============ */
.deal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.deal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.deal-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #ffe2de; }
.deal-card:hover .deal-thumb img { transform: scale(1.06); }

.deal-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(140deg, #eef1f6, #dee3eb);
}
.deal-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .3, 1); }
.deal-badge {
  position: absolute; left: 10px; top: 10px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  box-shadow: 0 4px 10px -4px rgba(0, 0, 0, .35);
}
.deal-badge.is-green { background: var(--green); }
.deal-badge.is-orange { background: linear-gradient(120deg, #ff8a00, #ff5a00); }
.deal-store {
  position: absolute; right: 10px; top: 10px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
}

.deal-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px 14px; flex: 1; }
.deal-title {
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}
.deal-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.deal-tag {
  font-size: 11px;
  color: var(--gray);
  background: #f5f6f8;
  border-radius: 5px;
  padding: 2px 7px;
}
.deal-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dp-now { color: var(--red); font-weight: 800; font-size: 22px; letter-spacing: -.5px; }
.dp-now i { font-size: 13px; font-weight: 700; font-style: normal; margin-right: 1px; }
.dp-was { color: var(--gray-2); font-size: 12px; text-decoration: line-through; }
.dp-save {
  font-size: 11px; font-weight: 700; color: var(--red);
  background: #fff0ee; border-radius: 5px; padding: 1px 6px;
}
.dp-save.is-soft { background: #f1f3f6; color: var(--gray); font-weight: 500; }

.deal-rt {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  border-radius: 7px;
  background: #f2fbf5;
  border: 1px solid #d9f2e2;
  color: var(--green);
  font-size: 12px;
}
.deal-rt b { font-size: 14px; font-weight: 800; }
.deal-rt em {
  font-style: normal;
  font-size: 11px;
  color: #0b7f3f;
  background: #e2f7ea;
  border-radius: 4px;
  padding: 0 5px;
}
.rt-dot {
  width: 6px; height: 6px; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(18, 161, 80, .14);
}
.rt-time { margin-left: auto; font-size: 11px; color: #7aa48c; white-space: nowrap; }
.deal-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.votes { display: flex; align-items: center; gap: 6px; }
.vote {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--gray);
  transition: all .15s ease;
}
.vote b { font-weight: 700; color: var(--ink-2); }
.vote-up:hover, .vote-up.is-on { border-color: var(--red); color: var(--red); background: #fff3f1; }
.vote-up:hover b, .vote-up.is-on b { color: var(--red); }
.vote-down:hover, .vote-down.is-on { border-color: var(--ink-2); color: var(--ink-2); background: #f4f5f7; }
.deal-meta { font-size: 11.5px; color: var(--gray-2); white-space: nowrap; }

/* 空状态 / 加载更多 */
.empty { text-align: center; padding: 60px 20px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-ico { font-size: 34px; }
.empty h3 { margin: 10px 0 4px; font-size: 16px; }
.empty p { color: var(--gray-2); font-size: 13px; margin-bottom: 16px; }

.load-more {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-2);
  font-weight: 600;
  transition: all .16s ease;
}
.load-more:hover { border-color: var(--red); color: var(--red); background: #fffaf9; }

/* ============ 侧栏 ============ */
.sidebar { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 132px; }
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.panel-head h3 { font-size: 15.5px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--red); font-weight: 600; }

.rank-list { display: flex; flex-direction: column; }
.rank-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s ease;
}
.rank-item:hover { background: #fafbfc; }
.rank-no {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: #f0f2f5;
  color: var(--gray);
  font-size: 11.5px;
  font-weight: 800;
  margin-top: 1px;
}
.rank-item:nth-child(1) .rank-no { background: linear-gradient(135deg, #ff5a3c, var(--red)); color: #fff; }
.rank-item:nth-child(2) .rank-no { background: linear-gradient(135deg, #ff9a3c, #ff7a18); color: #fff; }
.rank-item:nth-child(3) .rank-no { background: linear-gradient(135deg, #ffc93c, #ffab00); color: #fff; }
.rank-body { min-width: 0; flex: 1; }
.rank-title {
  font-size: 13px; font-weight: 500; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rank-price { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.rank-price b { color: var(--red); font-size: 13.5px; }
.rank-price span { font-size: 11px; color: var(--gray-2); }
.panel-note { margin-top: 8px; font-size: 11px; color: var(--gray-2); text-align: right; }

.subscribe { background: linear-gradient(160deg, #1b1c21, #2c2f38); color: #fff; border: 0; }
.subscribe h3 { font-size: 15.5px; }
.subscribe p { font-size: 12.5px; color: #a9aebc; margin: 6px 0 12px; }
.sub-form { display: flex; gap: 8px; }
.sub-form input {
  flex: 1; min-width: 0;
  border: 1px solid #3a3e49;
  background: rgba(255, 255, 255, .06);
  border-radius: 9px;
  padding: 9px 12px;
  color: #fff;
  outline: none;
  font-size: 13px;
}
.sub-form input::placeholder { color: #868c9b; }
.sub-form input:focus { border-color: var(--red); }
.sub-form .btn-primary { padding: 9px 14px; border-radius: 9px; }
.sub-tip { display: block; margin-top: 9px; font-size: 11.5px; color: #8b91a0; }
.sub-tip.is-ok { color: #3ddc84; font-weight: 600; }

.topic-list { display: flex; flex-direction: column; gap: 4px; }
.topic {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 10px;
  transition: background .15s ease;
}
.topic:hover { background: #fff7f6; }
.topic-emoji {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: #f5f6f8;
  border-radius: 10px;
  font-size: 17px;
}
.topic span:last-child { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.topic b { font-size: 13px; font-weight: 600; }
.topic i { font-size: 11px; color: var(--gray-2); font-style: normal; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  font-size: 12px;
  color: var(--gray);
  background: #f5f6f8;
  border-radius: 999px;
  padding: 4px 11px;
  transition: all .15s ease;
}
.tag:hover { background: #fff0ee; color: var(--red); }

/* ============ 页脚 ============ */
.footer { background: #fff; border-top: 1px solid var(--line); padding-top: 34px; }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; padding-bottom: 26px; }
.footer-brand { display: flex; gap: 12px; align-items: flex-start; }
.footer-brand b { font-size: 16px; }
.footer-brand p { font-size: 12.5px; color: var(--gray-2); max-width: 320px; }
.footer-cols { display: flex; gap: 64px; }
.footer-cols > div { display: flex; flex-direction: column; gap: 7px; }
.footer-cols h5 { font-size: 13px; color: var(--ink); margin-bottom: 2px; }
.footer-cols a { font-size: 12.5px; color: var(--gray); }
.footer-cols a:hover { color: var(--red); }
.footer-bottom {
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding: 14px 0 22px;
  font-size: 11.5px;
  color: var(--gray-2);
}
.footer-bottom a:hover { color: var(--red); }

/* ============ 弹窗 ============ */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(18, 19, 23, .55); backdrop-filter: blur(4px); animation: fade .2s ease; }
.modal-card {
  position: relative;
  width: min(880px, 100%);
  max-height: min(88vh, 760px);
  display: grid;
  grid-template-columns: 340px 1fr;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: pop .24s cubic-bezier(.2, .8, .3, 1);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.modal-close {
  position: absolute; right: 12px; top: 10px; z-index: 3;
  width: 32px; height: 32px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--ink-2);
  font-size: 20px;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}
.modal-close:hover { background: #fff; color: var(--red); }

.modal-media { position: relative; background: linear-gradient(140deg, #eef1f6, #dee3eb); }
.modal-media img { width: 100%; height: 100%; object-fit: cover; }
.modal-badge {
  position: absolute; left: 14px; top: 14px;
  padding: 3px 10px; border-radius: 6px;
  background: var(--red); color: #fff;
  font-size: 12px; font-weight: 700;
}

.modal-body { padding: 26px 26px 22px; overflow-y: auto; }
.modal-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.modal-store {
  font-size: 11.5px; font-weight: 700;
  color: var(--red); background: #fff0ee;
  padding: 2px 8px; border-radius: 5px;
}
.modal-time { font-size: 11.5px; color: var(--gray-2); }
.modal-body h3 { font-size: 19px; line-height: 1.4; letter-spacing: -.2px; padding-right: 20px; }
.modal-price { display: flex; align-items: baseline; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.mp-now { font-size: 32px; font-weight: 800; color: var(--red); letter-spacing: -1px; }
.mp-was { font-size: 13px; color: var(--gray-2); text-decoration: line-through; }
.mp-save { font-size: 12px; font-weight: 700; color: #fff; background: var(--green); padding: 2px 9px; border-radius: 6px; }
.modal-desc { font-size: 13.5px; color: var(--ink-2); line-height: 1.75; }
.modal-points { margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
.modal-points li { position: relative; padding-left: 18px; font-size: 13px; color: var(--gray); }
.modal-points li::before {
  content: "✓";
  position: absolute; left: 0; top: 0;
  color: var(--green); font-weight: 800; font-size: 12px;
}
.modal-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.modal-note {
  background: #f7f8fa;
  border: 1px solid #eef0f4;
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 12px;
}
.modal-note p { font-size: 12px; color: var(--gray); line-height: 1.6; }
.modal-note p + p { color: var(--gray-2); }
#modalRt { color: #0b7f3f; font-weight: 600; }

.modal-vote { display: flex; align-items: center; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.modal-vote button {
  border: 1px solid var(--line); background: #fff;
  border-radius: 9px; padding: 7px 14px;
  font-size: 13px; font-weight: 600; color: var(--gray);
  transition: all .15s ease;
}
.vote-up:hover, .vote-up.is-on { border-color: var(--red); background: #fff3f1; color: var(--red); }
.vote-down:hover, .vote-down.is-on { border-color: var(--ink-2); background: #f4f5f7; color: var(--ink-2); }
.fav-btn { margin-left: auto; }
.fav-btn.is-on { border-color: var(--red); color: var(--red); background: #fff3f1; }

.modal-comments h4 { font-size: 13.5px; margin-bottom: 8px; }
.modal-comments h4 span { color: var(--gray-2); font-weight: 400; font-size: 12px; }
.modal-comments h4 em { font-style: normal; font-size: 11px; color: var(--gray-2); margin-left: 4px; }
.modal-comments li { display: flex; gap: 9px; padding: 8px 0; border-bottom: 1px solid #f4f5f7; font-size: 12.5px; }
.modal-comments li:last-child { border-bottom: 0; }
.avatar {
  width: 26px; height: 26px; flex: 0 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #ff9a3c, var(--red));
}
.modal-comments .c-body { min-width: 0; }
.c-name { font-weight: 600; margin-right: 6px; }
.c-text { color: var(--gray); }

.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn-primary { flex: 1; }

/* Toast */
.toast {
  position: fixed;
  left: 50%; bottom: 40px;
  transform: translate(-50%, 20px);
  background: rgba(23, 24, 28, .92);
  color: #fff;
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 300;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .deal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: 1fr; }
  .hero-side { flex-direction: row; flex-wrap: wrap; }
  .hero-side .mini-card { flex: 1 1 240px; }
  .mini-note { flex: 1 1 100%; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero-main { flex-direction: column; align-items: flex-start; padding: 26px; }
  .hero-visual { width: 100%; flex: none; aspect-ratio: 16 / 9; }
  .header-inner { flex-wrap: wrap; gap: 12px; padding: 12px 0; }
  .search { order: 3; max-width: none; flex: 1 1 100%; }
  .hot-words { display: none; }
  .header-actions { margin-left: auto; }
  .navbar-inner { overflow-x: auto; }
  .nav-tip { display: none; }
  .topbar-links a:nth-child(-n+3) { display: none; }
  .modal-card { grid-template-columns: 1fr; max-height: 90vh; }
  .modal-media { height: 200px; }
  .footer-cols { gap: 32px; }
}

@media (max-width: 620px) {
  .wrap { width: calc(100% - 28px); }
  .deal-grid { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: 1fr; }
  .hero-actions .btn-lg { flex: 1; padding: 11px 14px; font-size: 14px; }
  .hero-stats { gap: 20px; }
  .header-actions .btn-ghost { display: none; }
  .mini-body h4 { font-size: 13px; }
  .section-head { flex-wrap: wrap; }
  .footer-cols { gap: 24px; flex-wrap: wrap; }
}

/* ---------- 登录 / 注册 ---------- */

.user-chip {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #1f2430;
}

.user-chip.is-on { display: inline-flex; }

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7a5c, #e23c22);
  color: #fff;
  font-size: 12px;
  display: grid;
  place-items: center;
  flex: none;
}

.user-name {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.user-logout {
  border: 1px solid #e3e6ec;
  background: #fff;
  color: #6b7280;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
}

.user-logout:hover { border-color: #ffb4a4; color: #e23c22; }

.auth-card {
  display: block;
  max-width: 420px;
  width: calc(100% - 32px);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  padding: 28px 28px 24px;
  text-align: left;
}

.auth-title {
  margin: 0;
  font-size: 20px;
  color: #14161a;
}

.auth-sub {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: #7a8290;
}

.auth-tabs {
  display: flex;
  gap: 20px;
  margin-top: 18px;
  border-bottom: 1px solid #eceef2;
}

.auth-tab {
  border: 0;
  background: none;
  padding: 10px 2px;
  font-size: 15px;
  color: #8a919e;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.auth-tab.is-active {
  color: #e23c22;
  border-bottom-color: #e23c22;
  font-weight: 600;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.auth-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #5c6470;
}

.auth-field input {
  height: 40px;
  border: 1px solid #e3e6ec;
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  color: #14161a;
  background: #fbfcfd;
}

.auth-field input:focus {
  outline: none;
  border-color: #ff8a6e;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 106, 77, 0.12);
}

.auth-card[data-mode="login"] .auth-field[data-mode="register"],
.auth-card[data-mode="register"] .auth-field[data-mode="login"] {
  display: none;
}

.auth-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff1ee;
  color: #c8351c;
  font-size: 13px;
}

.auth-submit {
  width: 100%;
  height: 42px;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #ff7a5c, #e23c22);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.auth-submit:disabled { opacity: 0.6; cursor: default; }

.auth-tip {
  margin: 0;
  font-size: 12px;
  color: #9aa2b1;
  text-align: center;
}

@media (max-width: 560px) {
  .auth-card { padding: 22px 18px 18px; }
  .user-name { max-width: 64px; }
}

/* ---------- H5 移动端适配 ---------- */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; overflow-x: hidden; }

@media (max-width: 640px) {
  .topbar { padding-top: env(safe-area-inset-top); }
  .topbar-links { gap: 14px; }
  .hero { margin: 16px auto 22px; gap: 14px; }
  .hero-main { padding: 22px 18px; border-radius: 18px; }
  .hero-title { font-size: 26px; line-height: 1.28; }
  .chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 13px;
  }
  .sort-tabs button { min-height: 34px; padding: 0 14px; }
  .vote { min-height: 34px; padding: 0 12px; font-size: 12.5px; }
  .user-logout { min-height: 30px; }
  .modal { place-items: end stretch; padding: 0; }
  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    overscroll-behavior: contain;
  }
  .auth-card {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    overscroll-behavior: contain;
  }
  .modal-close { width: 38px; height: 38px; right: 10px; top: 8px; }
  .modal-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    margin-top: 12px;
  }
  .footer { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .footer-cols { gap: 18px 26px; }
  .footer-cols a { display: inline-block; padding: 5px 0; }
  .toast {
    bottom: calc(22px + env(safe-area-inset-bottom));
    max-width: calc(100% - 36px);
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 380px) {
  .wrap { width: calc(100% - 22px); }
  .hero-main { padding: 18px 14px; }
  .deal-grid { gap: 12px; }
  .deal-card { border-radius: 14px; }
}
