/* ===== 牛来 merch · lo-fi ink-wash zine ===== */
:root {
  --paper: #EDE3CE;
  --paper-2: #E2D4B6;
  --surface: #F4ECDA;
  --ink: #211D16;
  --ink-soft: #4C4538;
  --muted: #7A6F59;
  --line: #2a241b;
  --accent: #C23B2B;      /* vermillion / 朱砂 */
  --accent-ink: #FFFFFF;
  --cow: #EABE3A;         /* 牛来黄牛 */
  --cow-ink: #211D16;
  --teal: #2E4A47;        /* 黛色远山 */
  --gold: #C9A24B;
  --shadow-hard: 5px 5px 0 var(--ink);
  --shadow-hard-sm: 3px 3px 0 var(--ink);
  --maxw: 1180px;
  --display: "STKaiti", "KaiTi", "Kaiti SC", "Songti SC", "Noto Serif SC", serif;
  --title-font: "ZCOOL KuaiLe", "STKaiti", "KaiTi", "Kaiti SC", "Noto Serif SC", serif;
  --body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: "SFMono-Regular", "Menlo", "Consolas", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1C1813;
    --paper-2: #271F16;
    --surface: #251E15;
    --ink: #EFE3CC;
    --ink-soft: #B7A98C;
    --muted: #998C72;
    --line: #EFE3CC;
    --accent: #E8553F;
    --accent-ink: #1A1109;
    --teal: #5C807A;
    --gold: #D8B25E;
    --shadow-hard: 5px 5px 0 #000;
    --shadow-hard-sm: 3px 3px 0 #000;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overscroll-behavior: none; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
  /* 移动端：禁止文字被点击选中 / 长按弹出菜单 / 点击高亮 */
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  /* 关掉边缘橡皮筋回弹与下拉刷新，避免页面“随便就能滑” */
  overscroll-behavior: none;
}
/* 输入框保持可选中（登录/注册需要） */
input, textarea { -webkit-user-select: text; user-select: text; }
/* film grain overlay */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 9000;
  opacity: 0.07; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: var(--paper); border-bottom: 2px solid var(--ink);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark {
  width: 42px; height: 42px; border-radius: 50%;
  object-fit: cover; object-position: center;
  background: var(--accent);
  border: 2px solid var(--ink); box-shadow: var(--shadow-hard-sm); transform: rotate(-3deg);
  display: block;
}
.brand .txt { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: 1px; }
.brand small { font-family: var(--mono); font-weight: 600; font-size: 11px; color: var(--muted); letter-spacing: 1px; display: block; }
.nav-actions { display: flex; align-items: center; gap: 12px; }

.btn {
  border: 2px solid var(--ink); border-radius: 999px;
  padding: 10px 20px; font-weight: 800; font-size: 15px;
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-hard-sm);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-ghost { background: var(--surface); color: var(--ink); }
.user-chip {
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 2px solid var(--ink); border-radius: 999px; padding: 5px 6px 5px 14px; font-weight: 800; font-size: 14px;
  box-shadow: var(--shadow-hard-sm); transform: rotate(1deg);
}
.user-chip .avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-size: 13px; font-family: var(--display); }

/* ---------- ticker ---------- */
.ticker { border-bottom: 2px solid var(--ink); background: var(--paper-2); overflow: hidden; white-space: nowrap; }
.ticker-track { display: inline-block; padding: 8px 0; font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 1px; animation: scroll 26s linear infinite; }
.ticker-track span { margin: 0 18px; }
.ticker-track .dot { color: var(--accent); }

/* ===== 非官方声明横幅 ===== */
.disclaim {
  border-bottom: 2px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
  padding: 7px 14px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 1px;
  text-align: center;
}
.disclaim .tag {
  background: var(--cow); color: var(--cow-ink);
  padding: 2px 9px; border-radius: 3px; white-space: nowrap;
  box-shadow: 2px 2px 0 var(--accent);
}
.disclaim .x { color: var(--accent); }
@media (max-width: 640px) {
  .disclaim { font-size: 11px; gap: 6px; padding: 6px 10px; }
  .disclaim .tag { padding: 1px 6px; }
}

/* 品牌区非官方徽章 */
.brand .badge {
  font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .5px;
  background: transparent; color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: 999px;
  padding: 2px 8px; align-self: center;
}
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- hero ---------- */
.hero { padding: 60px 0 36px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 36px; align-items: center; }
.eyebrow {
  display: inline-block; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 2px;
  color: var(--accent); border: 2px solid var(--accent); padding: 4px 10px; border-radius: 4px; transform: rotate(-1.5deg);
}
.hero h1 { font-family: var(--display); font-size: clamp(36px, 6vw, 64px); line-height: 1.04; font-weight: 800; letter-spacing: 1px; margin: 16px 0 14px; }
/* 官网主标题：牛来 谷子店 —— 牛来超大 + 站酷快乐体 */
.site-title { display: flex; align-items: baseline; flex-wrap: wrap; font-family: var(--title-font); font-weight: 400; line-height: .92; margin: 14px 0 16px; }
.site-title .big { font-size: clamp(76px, 15vw, 150px); color: var(--ink); transform: rotate(-2deg); text-shadow: var(--shadow-hard); }
.site-title .small { font-size: clamp(30px, 6vw, 58px); color: var(--accent); margin-left: .28em; transform: rotate(2.5deg); align-self: flex-end; }
.hero h1 .pop { color: var(--accent); }
.hero p.sub { color: var(--ink-soft); font-size: 17px; max-width: 32ch; margin-bottom: 24px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art {
  background: var(--surface); border: 2px solid var(--ink); box-shadow: var(--shadow-hard);
  padding: 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; transform: rotate(1deg);
}
.hero-art img { border: 2px solid var(--ink); background: var(--paper-2); aspect-ratio: 1; object-fit: cover; width: 100%; }
.hero-art img:nth-child(2) { transform: rotate(-2deg); }
.hero-art img:nth-child(3) { transform: rotate(2deg); }
.hero-art img:nth-child(4) { transform: rotate(-3deg); }
.kuso-price { color: var(--cow-ink); background: var(--cow); padding: 2px 8px; border: 2px solid var(--ink); transform: rotate(-2deg); display: inline-block; }
/* ---------- sections ---------- */
.section { padding: 38px 0; }
.section h2 { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: 1px; }
.section .lead { color: var(--ink-soft); margin: 6px 0 20px; }
.stamp {
  display: inline-block; font-family: var(--mono); font-weight: 800; font-size: 12px; letter-spacing: 2px;
  color: var(--accent); border: 2px solid var(--accent); padding: 3px 8px; border-radius: 4px;
  transform: rotate(4deg); margin-left: 10px; opacity: 0.9;
}

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }

/* vote budget bar */
.vote-budget {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 6px 0 20px; padding: 12px 16px;
  border: 2px solid var(--ink); border-radius: 12px;
  background: rgba(255,255,255,.55);
  box-shadow: var(--shadow-hard-sm);
  font-family: var(--display);
}
.vote-budget .vb-label { font-size: 15px; font-weight: 700; }
.vote-budget .vb-bar {
  position: relative; flex: 1; min-width: 150px; height: 18px;
  border: 2px solid var(--ink); border-radius: 20px; background: #fff; overflow: hidden;
}
.vote-budget .vb-fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  background: var(--accent); transition: width .3s ease;
}
.vote-budget .vb-fill.full { background: var(--cow); }
.vote-budget .vb-num { font-size: 15px; font-weight: 700; white-space: nowrap; }
.vote-budget .vb-num b { color: var(--accent); }
.vote-budget .vb-num.full b { color: #B8860B; }
@media (prefers-reduced-motion: reduce) { .vote-budget .vb-fill { transition: none; } }
.chip {
  border: 2px solid var(--ink); background: var(--surface); border-radius: 4px;
  padding: 8px 16px; font-weight: 800; font-size: 14px; font-family: var(--mono); letter-spacing: 1px;
  box-shadow: var(--shadow-hard-sm); transition: all .12s ease;
}
.chip:nth-child(odd) { transform: rotate(-1.5deg); }
.chip:nth-child(even) { transform: rotate(1.5deg); }
.chip:hover { transform: rotate(0); }
.chip.active { background: var(--accent); color: var(--accent-ink); }

/* ---------- grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px 22px; }
.card {
  background: var(--surface); border: 2px solid var(--ink); box-shadow: var(--shadow-hard);
  display: flex; flex-direction: column; position: relative; transition: transform .15s ease, box-shadow .15s ease;
}
.card:nth-child(3n+1) { transform: rotate(-1.2deg); }
.card:nth-child(3n+2) { transform: rotate(0.6deg); }
.card:nth-child(3n)   { transform: rotate(1.4deg); }
.card:hover { transform: rotate(0) translateY(-6px); box-shadow: 7px 7px 0 var(--ink); }
.card-img { aspect-ratio: 1; background: var(--paper-2); position: relative; border-bottom: 2px solid var(--ink); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-tag {
  position: absolute; top: 10px; left: 10px; background: var(--paper); color: var(--ink);
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 1px;
  padding: 3px 9px; border: 2px solid var(--ink); transform: rotate(-3deg);
}
.card-body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-family: var(--display); font-size: 19px; font-weight: 800; letter-spacing: 0.5px; }
.card-body .blurb { color: var(--ink-soft); font-size: 14px; flex: 1; }
.price-row { display: flex; align-items: baseline; gap: 6px; }
.price { font-family: var(--display); font-size: 22px; font-weight: 800; color: var(--accent); }
.price small { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 600; }
.vote-btn {
  margin-top: 4px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-hard-sm); border-radius: 999px; padding: 10px 14px;
  font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all .12s ease;
}
.vote-btn:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.vote-btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.vote-btn.voted { background: var(--accent); color: var(--accent-ink); }
.vote-btn.out { opacity: .42; cursor: not-allowed; box-shadow: none; }
.vote-btn.out:hover { transform: none; box-shadow: none; }
.vote-btn .count { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ---------- leaderboard ---------- */
.board { display: flex; flex-direction: column; gap: 12px; }
.board-row {
  display: grid; grid-template-columns: 46px 58px 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border: 2px solid var(--ink); box-shadow: var(--shadow-hard-sm); padding: 10px 14px;
}
.board-row:nth-child(even) { transform: rotate(-0.6deg); }
.board-row .rank { font-family: var(--display); font-size: 22px; font-weight: 800; color: var(--muted); text-align: center; }
.board-row.top1 .rank, .board-row.top2 .rank, .board-row.top3 .rank { color: var(--accent); }
.board-row img { width: 58px; height: 58px; border: 2px solid var(--ink); object-fit: cover; background: var(--paper-2); }
.board-row .meta { min-width: 0; }
.board-row .meta b { font-family: var(--display); font-weight: 800; font-size: 16px; }
.board-row .meta span { display: block; color: var(--muted); font-size: 13px; font-family: var(--mono); }
.board-row .votes { font-family: var(--display); font-weight: 800; font-size: 20px; }
.board-row .votes small { font-family: var(--mono); font-weight: 600; font-size: 12px; color: var(--muted); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 14, 8, 0.6);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border: 2px solid var(--ink); box-shadow: var(--shadow-hard);
  padding: 26px; width: 100%; max-width: 380px; animation: pop .16s ease;
}
@keyframes pop { from { transform: scale(.94) rotate(-1deg); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { font-family: var(--display); font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.modal .hint { color: var(--ink-soft); font-size: 14px; margin: 4px 0 16px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button { flex: 1; border: 2px solid var(--ink); background: var(--paper); padding: 8px; font-weight: 800; font-family: var(--mono); letter-spacing: 1px; color: var(--ink-soft); }
.tabs button.active { background: var(--ink); color: var(--paper); }
.field { margin-bottom: 12px; }
.field label { display: block; font-family: var(--mono); font-size: 12px; font-weight: 700; letter-spacing: 1px; margin-bottom: 5px; }
.field input {
  width: 100%; border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  border-radius: 4px; padding: 11px 13px; font-size: 15px; font-family: var(--body);
}
.field input:focus { outline: none; box-shadow: var(--shadow-hard-sm); }
.modal .err { color: var(--accent); font-size: 13px; font-weight: 700; min-height: 18px; margin-bottom: 6px; }
.modal .btn { width: 100%; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 4px; font-weight: 800; font-size: 14px;
  border: 2px solid var(--accent); opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- footer ---------- */
.foot { border-top: 2px solid var(--ink); padding: 24px 0; color: var(--muted); font-size: 13px; font-family: var(--mono); margin-top: 36px; }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { width: 100%; max-width: none; margin: 0 auto; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 移动端：内容居中 + 紧凑化 ===== */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .nav-inner { height: 56px; gap: 8px; }
  .brand .txt { font-size: 20px; }
  .brand .badge { display: none; }
  .nav-actions .btn { padding: 8px 14px; font-size: 14px; }

  .hero { padding: 34px 0 22px; }
  .hero-grid { text-align: center; gap: 22px; }
  .hero h1 { font-size: clamp(30px, 9vw, 44px); }
  .hero .site-title { justify-content: center; }
  .hero p.sub { max-width: none; margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-art { width: 100%; max-width: none; }

  .section { padding: 30px 0; }
  .section h2, .section .lead { text-align: center; }
  .section .lead { margin-left: auto; margin-right: auto; max-width: 34ch; }
  .filters { justify-content: center; }
  .vote-budget { justify-content: center; text-align: center; }

  .card { transform: none !important; }
  .card-body { text-align: center; align-items: center; }
  .card-body .price-row { justify-content: center; }
  .vote-btn { width: 100%; }

  .board-row { grid-template-columns: 32px 46px 1fr auto; gap: 10px; }
  .foot .wrap { text-align: center; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .nav-actions .btn-ghost { display: none; }
}

/* ---------- 满票烟花 ---------- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 8000; overflow: hidden; }
.fx-head {
  position: absolute; top: 0; left: 0;
  width: 46px; height: 46px; margin: -23px 0 0 -23px;
  border-radius: 50%; object-fit: cover;
  border: 2px solid var(--ink); background: var(--cow);
  box-shadow: var(--shadow-hard-sm);
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto; }
}

/* ---------- 微信分享二维码弹层 ---------- */
.wx-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: none; align-items: center; justify-content: center;
  background: rgba(28, 22, 18, 0.55);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  padding: 20px;
}
.wx-overlay.show { display: flex; }
.wx-modal {
  position: relative; width: min(360px, 92vw);
  background: var(--paper); border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px; box-shadow: var(--shadow-hard);
  padding: 26px 24px 22px; text-align: center; color: var(--ink);
  animation: wxPop 0.18s ease-out;
}
@keyframes wxPop { from { transform: translateY(8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.wx-close {
  position: absolute; top: 10px; right: 12px;
  width: 30px; height: 30px; border: none; background: transparent;
  font-size: 22px; line-height: 1; color: var(--ink); opacity: 0.6; cursor: pointer;
}
.wx-close:hover { opacity: 1; }
.wx-title {
  margin: 0 0 6px; font-family: var(--display);
  font-size: 20px; letter-spacing: 0.04em;
}
.wx-tip { font-size: 13px; line-height: 1.5; color: rgba(0,0,0,0.6); margin-bottom: 16px; }
.wx-qrwrap {
  width: 200px; height: 200px; margin: 0 auto 14px;
  padding: 10px; background: #fff; border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.08); box-shadow: var(--shadow-hard-sm);
}
.wx-qr { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.wx-qr img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wx-url {
  font-size: 12px; color: rgba(0,0,0,0.45);
  word-break: break-all; line-height: 1.4;
}
