/* =============================================================
 *  羊毛生活 — smzdm-inspired layout
 *  Top header (logo + search + nav) / cat bar / 3-col main grid
 *  Center feed = horizontal deal cards w/ price chip + "去购买" CTA
 * ============================================================= */

:root {
  --accent:        #f04848;   /* smzdm red */
  --accent-hover:  #d93d3d;
  --accent-soft:   #fdf0f0;
  --price:         #f04848;   /* price chip */
  --bg:            #f5f5f5;
  --card:          #ffffff;
  --fg:            #2b2b2b;
  --muted:         #999;
  --border:        #ececec;
  --border-strong: #dcdcdc;
  --radius:        4px;
  --max-w:         1200px;
  --gap:           14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
               "Yu Gothic", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* --- Top header ----------------------------------------------- */
.site-header {
  background: var(--card);
  border-bottom: 2px solid var(--accent);
}
.header-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--fg);
}
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: var(--accent); color: white;
  font-weight: 700; font-size: 22px;
  border-radius: var(--radius);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-cn { font-size: 18px; font-weight: 700; }
.brand-en { font-size: 11px; color: var(--muted); }

.search {
  flex: 1; max-width: 460px;
  display: flex; border: 2px solid var(--accent); border-radius: var(--radius);
  overflow: hidden;
}
.search input {
  flex: 1; padding: 8px 12px; border: none; outline: none;
  font-size: 14px; background: var(--card);
}
.search button {
  padding: 0 18px; background: var(--accent); color: white;
  border: none; cursor: pointer; font-weight: 600;
}
.search button:hover { background: var(--accent-hover); }

.top-nav { display: flex; gap: 4px; align-items: center; margin-left: auto; }
.top-nav a {
  padding: 6px 14px; font-size: 14px; color: var(--fg);
  border-radius: var(--radius);
}
.top-nav a:hover { background: var(--accent-soft); color: var(--accent); }
.top-nav a.active { color: var(--accent); font-weight: 600; }
.top-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Category sub-nav ----------------------------------------- */
.cat-bar {
  background: var(--card); border-bottom: 1px solid var(--border);
}
.cat-bar-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 8px 20px;
  display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
}
.cat-label { color: var(--muted); font-size: 13px; margin-right: 4px; }
.cat-link {
  padding: 4px 10px; font-size: 13px; color: var(--fg);
  border-radius: 3px;
}
.cat-link:hover { background: var(--accent-soft); color: var(--accent); }

/* --- Main 3-column layout ------------------------------------- */
.layout {
  max-width: var(--max-w); margin: 16px auto; padding: 0 20px;
  display: grid;
  grid-template-columns: 160px 1fr 280px;
  gap: var(--gap);
}
.left-rail, .right-rail { display: flex; flex-direction: column; gap: var(--gap); }
.feed { min-width: 0; }

/* --- Rail cards ---------------------------------------------- */
.rail-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
}
.rail-card h3 {
  font-size: 14px; margin: 0 0 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  color: var(--fg);
}
.rail-list { list-style: none; margin: 0; padding: 0; }
.rail-list li { margin: 2px 0; }
.rail-list a {
  display: block; padding: 6px 8px; font-size: 13px;
  border-radius: 3px;
}
.rail-list a:hover { background: var(--accent-soft); color: var(--accent); }


.hot-list {
  list-style: none; counter-reset: hot; margin: 0; padding: 0;
}
.hot-list li {
  counter-increment: hot;
  margin: 6px 0; line-height: 1.4;
}
.hot-list li::before {
  content: counter(hot);
  display: inline-block; width: 18px; height: 18px;
  background: var(--border-strong); color: var(--fg);
  font-size: 11px; font-weight: 700;
  text-align: center; line-height: 18px;
  border-radius: 3px; margin-right: 6px;
}
.hot-list li:nth-child(-n+3)::before { background: var(--accent); color: white; }
.hot-list a {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px; font-size: 12px;
}
.hot-title { flex: 1; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.hot-price { color: var(--accent); font-weight: 600; flex-shrink: 0; }

/* --- Feed header --------------------------------------------- */
.feed-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.feed-head h2 { margin: 0; font-size: 18px; }
.feed-tabs { display: flex; gap: 12px; font-size: 13px; }
.feed-tabs .tab { cursor: default; }
.feed-tabs .tab.active { color: var(--accent); font-weight: 600;
  border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

/* --- Deal list (horizontal cards) ---------------------------- */
.deal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.deal {
  display: grid;
  grid-template-columns: 180px 1fr 140px;
  gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
  transition: border-color .1s ease, box-shadow .1s ease;
}
.deal:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(240,72,72,.08);
}

.deal-thumb-link { display: block; }
.deal-thumb {
  width: 180px; height: 130px;
  object-fit: cover; border-radius: var(--radius);
  background: #f0f0f0; display: block;
}
.deal-thumb-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: white; background: var(--accent);
  font-size: 48px; font-weight: 700;
}

.deal-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.deal-title-link { color: var(--fg); }
.deal-title {
  margin: 0; font-size: 16px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.deal-title-link:hover .deal-title { color: var(--accent); }

.deal-summary {
  margin: 0; color: #666; font-size: 13px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Original (Japanese) title shown below the translated one on the card */
.deal-title-original {
  margin: 2px 0 0; color: #888; font-size: 12px;
  font-weight: 400;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}

.deal-meta {
  display: flex; gap: 8px; align-items: center;
  margin-top: auto; padding-top: 6px;
  font-size: 12px; color: var(--muted);
}
.meta-spacer { flex: 1; }
.meta-stat { font-size: 12px; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 3px;
  font-size: 11px; font-weight: 600;
}
.badge-livedoor { background: #e6f0fb; color: #2a6db0; }
.badge-tokkataro { background: #fff4d6; color: #946800; }

/* Right column of each card: price + CTA */
.deal-aside {
  display: flex; flex-direction: column;
  justify-content: space-between; align-items: stretch;
  gap: 10px; min-width: 120px;
}
.deal-price {
  text-align: center;
  font-size: 22px; font-weight: 700;
  color: var(--price);
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 10px 8px;
  line-height: 1.1;
}
.deal-price-empty {
  font-size: 13px; color: var(--muted); font-weight: 400;
  background: transparent; border: 1px dashed var(--border-strong);
}

/* --- Buttons ------------------------------------------------ */
.btn {
  display: inline-block; padding: 6px 14px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--card); color: var(--fg); font-size: 13px;
  text-align: center;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); color: white; }
.btn-block { display: block; width: 100%; }
.btn-buy {
  background: var(--accent); color: white; border-color: var(--accent);
  text-align: center; padding: 8px 12px; font-weight: 600;
  font-size: 13px;
}
.btn-buy:hover { background: var(--accent-hover); color: white; }
.btn-lg { padding: 12px 28px; font-size: 15px; }

/* --- Detail page -------------------------------------------- */
.back { display: inline-block; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.back:hover { color: var(--accent); }

.deal-detail {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.deal-detail-head { padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.deal-detail-head h1 { font-size: 22px; margin: 8px 0 4px; }
.deal-detail-original { margin: 4px 0 6px; color: #888; font-size: 13px; }
.deal-detail .meta { font-size: 12px; }
.deal-detail .hero { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); margin-bottom: 16px; }

.price-banner {
  display: flex; align-items: baseline; gap: 14px;
  background: var(--accent-soft); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 16px;
}
.price-banner-label { font-size: 13px; color: var(--muted); }
.price-banner-value { font-size: 32px; font-weight: 700; color: var(--price); }

.summary p { margin: 10px 0; line-height: 1.7; font-size: 14px; }
.cta-row { margin: 24px 0 8px; }

/* --- Empty + pagination ------------------------------------- */
.empty { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 60px 20px; text-align: center; color: var(--muted); }
.empty p { margin: 6px 0; }
.pager { text-align: center; margin: 20px 0; }
code { background: #f4f4f4; padding: 2px 6px; border-radius: 3px; font-size: 13px; }
.dim { color: var(--muted); }

/* --- Footer ------------------------------------------------- */
.site-footer {
  background: var(--card); border-top: 1px solid var(--border);
  margin-top: 30px; padding: 24px 20px; font-size: 12px; color: var(--muted);
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; display: flex; gap: 40px; }
.footer-col { display: flex; flex-direction: column; gap: 4px; }
.footer-col h4 { margin: 0 0 6px; font-size: 12px; color: var(--fg); }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { flex: 1; text-align: right; }
.footer-bottom p { margin: 0; }

/* --- Responsive ---------------------------------------------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .left-rail, .right-rail { order: 2; }
  .deal { grid-template-columns: 120px 1fr; }
  .deal-aside { grid-column: 1 / -1; flex-direction: row; }
  .deal-price { flex: 1; }
}
@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; gap: 10px 12px; padding: 12px 16px; }
  .brand { flex: 1; min-width: 0; }
  .top-nav { margin-left: auto; }
  .top-nav a { padding: 6px 9px; }
  .search { order: 3; flex: 0 0 100%; max-width: none; }
  .deal { grid-template-columns: 1fr; }
  .deal-thumb, .deal-thumb-placeholder { width: 100%; height: 160px; }
  .deal-aside { flex-direction: row; }
}
.inline-vote-form { display: inline-flex; margin: 0; }
.meta-vote {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font: inherit;
}
.meta-vote:hover, .vote-btn:hover { color: var(--primary); }
.vote-btn { display: inline-flex; align-items: center; gap: 6px; }

.hot-votes { color: var(--muted); font-size: 12px; flex-shrink: 0; }
