/* ====================================================
   バクトク.jp — Design System (Redesign 2025)
   ==================================================== */

/* ===== Design Tokens ===== */
:root {
  /* Paper (backgrounds) */
  --paper:   #FAF7F2;
  --paper-2: #F2EEE6;
  --paper-3: #E8E2D6;

  /* Ink (text) */
  --ink:   #1A1815;
  --ink-2: #4A453E;
  --ink-3: #8B8478;
  --ink-4: #B8B0A2;

  /* Lines / borders */
  --line:   #E5DFD3;
  --line-2: #D8D1C2;

  /* Brand (warm orange-red) */
  --brand:      #e05a1e;
  --brand-deep: #b84010;
  --brand-soft: #faeee4;
  --brand-tint: #fdf5f0;

  /* Status colors */
  --good:      #2e7d32;
  --good-soft: #e8f5e9;
  --info:      #1565c0;
  --info-soft: #e3f2fd;

  /* Border radius */
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(60,40,20,.04), 0 2px 6px rgba(60,40,20,.04);
  --shadow-md: 0 2px 8px rgba(60,40,20,.06), 0 12px 24px rgba(60,40,20,.06);
  --shadow-lg: 0 4px 12px rgba(60,40,20,.08), 0 24px 48px rgba(60,40,20,.08);

  /* Backward-compat aliases (used by admin/auth/post/mypage) */
  --primary:       var(--brand);
  --primary-dark:  var(--brand-deep);
  --primary-light: var(--brand-soft);
  --bg:            var(--paper);
  --card:          var(--paper-2);
  --border:        var(--line);
  --text:          var(--ink);
  --text-muted:    var(--ink-3);
  --text-light:    var(--ink-4);
  --hot:           var(--brand);
  --discount:      var(--good);
  --radius:        var(--r-md);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:   #15130F;
    --paper-2: #1C1A15;
    --paper-3: #25221C;
    --ink:   #F2EEE6;
    --ink-2: #BFB7A6;
    --ink-3: #8B8478;
    --ink-4: #5A554B;
    --line:   #2A2620;
    --line-2: #383128;
    --brand-soft: #2e1e10;
    --brand-tint: #221608;
    --info-soft:  #0d1a2e;
    --good-soft:  #0d1a0e;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.3);
    --shadow-md: 0 2px 8px rgba(0,0,0,.4), 0 12px 24px rgba(0,0,0,.3);
  }
}

[data-theme="dark"] {
  --paper:   #15130F;
  --paper-2: #1C1A15;
  --paper-3: #25221C;
  --ink:   #F2EEE6;
  --ink-2: #BFB7A6;
  --ink-3: #8B8478;
  --ink-4: #5A554B;
  --line:   #2A2620;
  --line-2: #383128;
  --brand-soft: #2e1e10;
  --brand-tint: #221608;
  --info-soft:  #0d1a2e;
  --good-soft:  #0d1a0e;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 2px 6px rgba(0,0,0,.3);
  --shadow-md: 0 2px 8px rgba(0,0,0,.4), 0 12px 24px rgba(0,0,0,.3);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
               "Yu Gothic", "YuGothic", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
a { text-decoration: none; color: inherit; }
input, select, textarea { font-family: inherit; }

/* ===== Header ===== */
.bk-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 80;
  backdrop-filter: saturate(150%) blur(10px);
}
.bk-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Brand mark */
.bk-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
}
.bk-brand .mark {
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}
.bk-brand .mark .accent { color: var(--brand); }
.bk-brand .tag {
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .04em;
  font-weight: 500;
}

/* Search (desktop only) */
.bk-search {
  flex: 1 1 0;
  max-width: 440px;
  position: relative;
}
.bk-search input {
  width: 100%;
  height: 38px;
  padding: 0 16px 0 40px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: .15s;
}
.bk-search input:focus { border-color: var(--brand); background: var(--paper); }
.bk-search input::placeholder { color: var(--ink-3); }
.bk-search .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
  font-size: 14px;
}

/* Header actions */
.bk-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.bk-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  transition: background .15s, color .15s;
  position: relative;
  font-size: 15px;
  cursor: pointer;
}
.bk-icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.bk-icon-btn .dot-badge {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  background: var(--brand);
  border-radius: 50%;
  border: 2px solid var(--paper);
}

.bk-post-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: .15s;
  text-decoration: none;
}
.bk-post-btn:hover { background: var(--brand); transform: translateY(-1px); }

.bk-login-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line-2);
  display: inline-flex;
  align-items: center;
  transition: .15s;
  text-decoration: none;
}
.bk-login-btn:hover { border-color: var(--brand); color: var(--brand); }

.bk-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-soft), var(--brand-tint));
  color: var(--brand-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  border: 1.5px solid var(--line);
  cursor: pointer;
  flex-shrink: 0;
}
.bk-avatar-menu { position: relative; }
.bk-avatar-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 100;
}
.bk-avatar-dropdown.open { display: block; }
.bk-user-greeting {
  font-size: 12px;
  color: var(--ink-3);
  padding: 10px 14px 6px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bk-avatar-dropdown a,
.bk-avatar-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  transition: background .12s;
  cursor: pointer;
}
.bk-avatar-dropdown a:hover,
.bk-avatar-dropdown button:hover { background: var(--paper-2); color: var(--ink); }
.bk-avatar-dropdown .dd-divider { height: 1px; background: var(--line); margin: 4px 0; }

/* ===== Category Nav ===== */
.bk-cats {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 61px;
  z-index: 70;
}
.bk-cats-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.bk-cats-inner::-webkit-scrollbar { display: none; }
.bk-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: .15s;
  flex-shrink: 0;
  cursor: pointer;
}
.bk-cat:hover { color: var(--ink); }
.bk-cat.active { color: var(--ink); border-bottom-color: var(--brand); font-weight: 700; }
.bk-cat .em { font-size: 14px; }

/* ===== Main Layout ===== */
.bk-main {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 100px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 36px;
  align-items: start;
}

/* ===== Section Headers ===== */
.bk-sec-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}
.bk-sec-head h2 {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.01em;
}
.bk-sec-head .num {
  font-weight: 800;
  color: var(--brand);
  font-size: 15px;
}
.bk-sec-head .sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-left: auto;
}

/* ===== Hero Section ===== */
.bk-hero { margin-bottom: 36px; }
.bk-hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 12px;
}
.bk-hero-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: .2s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.bk-hero-card:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.bk-hero-img {
  aspect-ratio: 16/10;
  position: relative;
  overflow: hidden;
  background: var(--paper-3);
}
.bk-hero-card.lead .bk-hero-img { aspect-ratio: 4/3; }
.bk-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* 自動投稿の低解像度画像：引き伸ばさず余白付きで表示 */
.bk-hero-img img.img-contain,
.bk-row-thumb img.img-contain {
  object-fit: contain;
  padding: 14%;
  box-sizing: border-box;
  background: var(--paper-3);
}
.bk-hero-img .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: var(--paper-3);
}
.bk-hero-card.lead .bk-hero-img .placeholder { font-size: 64px; }

.bk-hero-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--paper);
  color: var(--ink);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}
.bk-hero-card.lead .bk-hero-rank {
  width: 42px;
  height: 42px;
  font-size: 20px;
  background: var(--brand);
  color: #fff;
}
.bk-hero-discount-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--ink);
  color: var(--paper);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}
.bk-hero-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.bk-hero-cat {
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: .05em;
  font-weight: 600;
  text-transform: uppercase;
}
.bk-hero-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bk-hero-card.lead .bk-hero-title { font-size: 17px; -webkit-line-clamp: 3; }
.bk-hero-prices {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.bk-hero-sale {
  font-weight: 800;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -.01em;
}
.bk-hero-card.lead .bk-hero-sale { font-size: 28px; color: var(--brand); }
.bk-hero-orig { font-size: 12px; color: var(--ink-3); text-decoration: line-through; }
.bk-hero-meta {
  font-size: 11px;
  color: var(--ink-3);
  display: flex;
  gap: 8px;
}
.bk-hero-meta .store { color: var(--ink-2); font-weight: 600; }

/* ===== Feed Toolbar ===== */
.bk-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.bk-tab {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 6px 0;
  position: relative;
  transition: color .15s;
  cursor: pointer;
}
.bk-tab:hover { color: var(--ink-2); }
.bk-tab.active { color: var(--ink); font-weight: 700; }
.bk-tab.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  bottom: -13px;
  height: 2px;
  background: var(--brand);
}
.bk-tab-divider {
  width: 1px;
  height: 14px;
  background: var(--line-2);
  margin: 0 4px;
}
/* ===== Feed Rows ===== */
.bk-feed { display: flex; flex-direction: column; gap: 10px; }

.bk-row {
  display: grid;
  grid-template-columns: 32px 88px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  padding: 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.bk-row:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }

.bk-row-rank {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}
.bk-row.is-hot .bk-row-rank { color: var(--brand); }

.bk-row-thumb {
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: var(--paper-3);
  transition: transform .2s;
}
.bk-row:hover .bk-row-thumb { transform: scale(1.02); }
.bk-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bk-row-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: var(--paper-3);
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(255,255,255,.1) 0, rgba(255,255,255,.1) 6px,
    rgba(0,0,0,.04) 6px, rgba(0,0,0,.04) 12px
  );
}

.bk-row-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.bk-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.bk-row-cat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--paper-3);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: .02em;
}
.bk-row-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  letter-spacing: .04em;
}
.bk-row-badge.hot { background: var(--brand); color: #fff; }
.bk-row-badge.new { background: var(--info-soft); color: var(--info); }
.bk-row-badge.ended { background: var(--paper-3); color: var(--ink-3); }

/* ===== 終了した投稿（履歴として残すが目立たなくする） ===== */
.ended-strike { text-decoration: line-through; color: var(--ink-4); }
.bk-row.is-ended { opacity: .6; }
.bk-row.is-ended:hover { opacity: .85; }
.bk-row.is-ended .bk-row-thumb { filter: grayscale(60%); }
.badge-ended {
  display: inline-block;
  background: var(--paper-3); color: var(--ink-3);
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: var(--r-pill);
  letter-spacing: .04em;
}
.bk-row-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-4);
  flex-shrink: 0;
}

.bk-row-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bk-row-prices {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.bk-row-sale {
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -.01em;
}
.bk-row.is-hot .bk-row-sale { color: var(--brand); }
.bk-row-orig { font-size: 12px; color: var(--ink-3); text-decoration: line-through; }
.bk-row-discount { font-size: 11px; font-weight: 700; color: var(--good); letter-spacing: .02em; }
.bk-row-store { font-size: 12px; color: var(--ink-2); }
.bk-row-store strong { color: var(--ink); font-weight: 600; }
.bk-row-excerpt {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bk-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding-top: 4px;
}
.bk-row-vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  transition: .15s;
  min-width: 52px;
  cursor: pointer;
}
.bk-row-vote:hover,
.bk-row-vote.voted { border-color: var(--brand); background: var(--brand-tint); }
.bk-row-vote .arrow { font-size: 10px; color: var(--ink-3); font-weight: 700; }
.bk-row-vote .count {
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.bk-row-vote.voted .arrow,
.bk-row-vote.voted .count { color: var(--brand-deep); }
.bk-row-stats {
  font-size: 10px;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
}

/* Empty state */
.bk-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-3);
}

/* ===== Pagination ===== */
.bk-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.bk-page-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
}
.bk-page-btn:hover:not(:disabled) { border-color: var(--line-2); background: var(--paper-2); }
.bk-page-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.bk-page-btn:disabled { opacity: .4; cursor: default; }
.bk-page-ellipsis { color: var(--ink-4); font-size: 13px; padding: 0 2px; }
.bk-empty-state p { font-size: 14px; line-height: 2.2; }

/* ===== Sidebar ===== */
.bk-aside {
  position: sticky;
  top: 130px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.aside-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.aside-title .tag {
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: .04em;
}

/* Ranking list */
.aside-rank { display: flex; flex-direction: column; }
.aside-rank-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: opacity .15s;
}
.aside-rank-item:last-child { border-bottom: none; }
.aside-rank-item:hover { opacity: .7; }
.aside-rank-num {
  font-weight: 800;
  font-size: 16px;
  color: var(--ink-3);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.aside-rank-item:nth-child(1) .aside-rank-num,
.aside-rank-item:nth-child(2) .aside-rank-num,
.aside-rank-item:nth-child(3) .aside-rank-num { color: var(--brand); }
.aside-rank-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.aside-rank-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.aside-rank-meta { font-size: 10px; color: var(--ink-3); }
.aside-rank-price { font-weight: 700; font-size: 13px; color: var(--brand); white-space: nowrap; }

/* Category stats */
.aside-stats { display: flex; flex-direction: column; }
.aside-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 12px;
  border-bottom: 1px dashed var(--line);
}
.aside-stat-row:last-child { border-bottom: none; }
.aside-stat-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
}
.aside-stat-label .em { font-size: 13px; }
.aside-stat-bar {
  flex: 1;
  height: 3px;
  background: var(--paper-2);
  margin: 0 10px;
  border-radius: 2px;
  overflow: hidden;
  max-width: 70px;
}
.aside-stat-bar-fill { height: 100%; background: var(--brand); border-radius: 2px; }
.aside-stat-count {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 20px;
  text-align: right;
  font-size: 11px;
}

/* Guide card */
.aside-guide {
  background: var(--paper-2);
  border-radius: var(--r-md);
  padding: 16px 18px;
  border: 1px solid var(--line);
}
.aside-guide h3 {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
  color: var(--ink);
}
.aside-guide p {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.7;
  padding: 3px 0;
  display: flex;
  gap: 8px;
}
.aside-guide p::before {
  content: "—";
  color: var(--brand);
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== Notification Bell ===== */
.bk-notif-wrap { position: relative; }
.bk-notif-popup {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 100;
}
.bk-notif-popup.open { display: block; }
.bk-notif-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.bk-notif-popup-head h4 { font-weight: 700; font-size: 13px; }
.bk-notif-popup-head button {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
  cursor: pointer;
}
.bk-notif-popup-head button:hover { color: var(--brand); }
.bk-notif-list-inner { max-height: 320px; overflow-y: auto; }
.bk-notif-item {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s;
}
.bk-notif-item:hover { background: var(--paper-2); }
.bk-notif-item .pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  margin-top: 5px;
}
.bk-notif-item.read .pip { background: var(--ink-4); }
.bk-notif-item .text { font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.bk-notif-item .text strong { color: var(--ink); font-weight: 700; }
.bk-notif-item .when { font-size: 10px; color: var(--ink-3); margin-top: 3px; }
.bk-notif-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-3);
}

/* ===== Bottom Nav ===== */
.bk-bnav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 62px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  z-index: 90;
  padding: 4px 0;
}
.bk-bnav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s;
}
.bk-bnav-btn.active { color: var(--brand); }
.bk-bnav-btn .lbl { font-size: 10px; }
.bk-bnav-btn .ic {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.bk-bnav-btn.cta .ic {
  width: 42px;
  height: 42px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  margin-top: -20px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== Toast ===== */
.bk-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 999;
  white-space: nowrap;
}
.bk-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Detail Modal ===== */
.bk-modal-bg {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(26,24,21,.55);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.bk-modal-bg.open { display: flex; }
.bk-modal {
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  background: var(--paper);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}
.bk-modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.bk-modal-head h2 { font-size: 16px; font-weight: 700; flex: 1; }
.bk-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
}
.bk-modal-close:hover { background: var(--paper-2); color: var(--ink); }
.bk-modal-body { padding: 0; overflow-y: auto; flex: 1; }

/* ===== Responsive ===== */
@media (max-width: 1000px) {
  .bk-main { grid-template-columns: 1fr; }
  .bk-aside { display: none; }
}
@media (max-width: 720px) {
  .bk-header-inner { padding: 10px 14px; gap: 10px; }
  .bk-search { display: none; }
  .bk-brand .tag { display: none; }
  .bk-cats-inner { padding: 0 14px; }
  .bk-main { padding: 16px 14px 90px; }
  .bk-hero-grid { grid-template-columns: 1fr; }
  .bk-hero-card:not(.lead) { display: none; }
  .bk-row {
    grid-template-columns: 20px 64px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px;
  }
  .bk-row-side {
    align-items: flex-end;
    gap: 6px;
    padding-top: 2px;
  }
  .bk-row-vote { min-width: 40px; padding: 5px 8px; }
  .bk-row-vote .count { font-size: 13px; }
  .bk-row-stats { font-size: 9px; }
  .bk-row-thumb { width: 64px; height: 64px; }
  .bk-row-title { font-size: 14px; }
  .bk-row-sale { font-size: 16px; }
  .bk-row-excerpt { display: none; }
  .bk-bnav { display: flex; }
  .bk-toast { bottom: 76px; }
  .bk-modal-bg { padding: 0; align-items: flex-end; }
  .bk-modal { max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
}


/* ======================================================
   BACKWARD-COMPAT — admin / auth / post / mypage / detail
   (These pages still use old class names from the previous
   design. Keeping them functional with the new token set.)
   ====================================================== */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 80;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 20px; }
.logo-text { font-size: 17px; font-weight: 800; color: var(--ink); }
.logo-sub { font-size: 11px; color: var(--ink-3); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.btn-dark-toggle {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 5px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: .15s;
}
.btn-dark-toggle:hover { background: var(--paper-3); }
.btn-write {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--r-pill);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: .15s;
}
.btn-write:hover { background: var(--brand-deep); }
.user-info { display: flex; align-items: center; gap: 8px; }
.user-name { font-size: 12px; color: var(--ink-3); }
.header-admin-btn,
.header-mypage-btn,
.header-logout-btn {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: .15s;
  text-decoration: none;
  color: var(--ink-2);
  background: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.header-admin-btn:hover,
.header-mypage-btn:hover,
.header-logout-btn:hover { background: var(--paper-2); color: var(--ink); }

/* Old notification bell (used by notifications.js) */
.notif-bell { position: relative; }
.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--brand);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 4px;
  line-height: 1.4;
}
.notif-wrap { position: relative; }
.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 300px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}
.notif-list { max-height: 280px; overflow-y: auto; }
.notif-empty { padding: 20px; text-align: center; font-size: 12px; color: var(--ink-3); }

/* Old category nav (used by other pages) */
.category-nav {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }
.category-inner {
  display: flex;
  gap: 4px;
  padding: 8px 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.cat-btn {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: transparent;
  border: 1px solid transparent;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
  transition: .15s;
}
.cat-btn:hover { background: var(--paper-2); color: var(--ink); }
.cat-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }

/* Old main layout */
.main-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; }
}

/* Old post cards (used by search results, etc.) */
.post-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: .15s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.post-card:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.vote-col { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 40px; }
.vote-btn { font-size: 18px; cursor: pointer; transition: transform .15s; }
.vote-btn:hover { transform: scale(1.2); }
.vote-count { font-weight: 700; font-size: 13px; color: var(--ink-3); }
.post-thumb { width: 100px; height: 100px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.post-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge-cat {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--paper-3);
  color: var(--ink-2);
}
.badge-hot { background: var(--brand); color: #fff; }
.badge-new { background: var(--info-soft); color: var(--info); }
.post-time { font-size: 11px; color: var(--ink-3); }
.post-title { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.price-row { display: flex; align-items: baseline; gap: 8px; }
.price-sale { font-size: 18px; font-weight: 800; color: var(--brand); }
.price-original { font-size: 12px; color: var(--ink-3); text-decoration: line-through; }
.price-discount { font-size: 11px; font-weight: 700; color: var(--good); }
.post-store { font-size: 12px; color: var(--ink-2); }
.post-store span { font-weight: 600; }
.post-excerpt { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.post-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.post-link-btn {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  transition: .15s;
}
.post-link-btn:hover { background: var(--brand-deep); }
.post-stat { font-size: 11px; color: var(--ink-3); }
.hot-deal { border-left: 3px solid var(--brand); }

/* Sidebar (used by other pages) */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.sidebar-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.sidebar-card h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.hot-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.hot-list li {
  display: flex; gap: 8px; align-items: flex-start;
  cursor: pointer; padding: 4px 0; border-bottom: 1px solid var(--line);
}
.hot-list li:last-child { border-bottom: none; }
.hot-rank { font-size: 16px; font-weight: 800; color: var(--ink-3); min-width: 20px; }
.hot-list li:nth-child(-n+3) .hot-rank { color: var(--brand); }
.hot-info { flex: 1; min-width: 0; }
.hot-title { font-size: 12px; font-weight: 600; color: var(--ink); }
.hot-price { font-size: 12px; color: var(--brand); font-weight: 700; }
.hot-votes { font-size: 11px; color: var(--ink-3); }
.cat-stats { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.cat-stats li {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--ink-2);
  padding: 3px 0; border-bottom: 1px dashed var(--line);
}
.cat-stats li:last-child { border-bottom: none; }
.stat-count { font-weight: 700; color: var(--ink-3); }
.guide-card ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.guide-card li {
  font-size: 12px; color: var(--ink-2); line-height: 1.5;
  padding-left: 14px; position: relative;
}
.guide-card li::before { content: "—"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }

/* Old search/sort toolbar */
.feed-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search-box { flex: 1; min-width: 180px; position: relative; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.search-box input {
  width: 100%; height: 38px; padding: 0 14px 0 36px;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--paper-2); font-size: 13px; color: var(--ink); outline: none; transition: .15s;
}
.search-box input:focus { border-color: var(--brand); }
.sort-btns { display: flex; gap: 4px; }
.sort-btn {
  padding: 6px 12px; border-radius: var(--r-pill); font-size: 12px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); cursor: pointer; transition: .15s;
}
.sort-btn:hover { background: var(--paper-2); }
.sort-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }

/* Old bottom nav */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--paper); border-top: 1px solid var(--line); z-index: 90; height: 60px;
}
.bottom-nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--ink-3); font-size: 10px; cursor: pointer; text-decoration: none; transition: color .15s;
}
.bottom-nav-btn.active { color: var(--brand); }
.nav-icon { font-size: 18px; }
.post-btn .post-icon {
  width: 38px; height: 38px; background: var(--brand); color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  margin-top: -14px; box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* Old modals */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(26,24,21,.55); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 600px; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
}
.modal-header h2 { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; color: var(--ink-2); font-size: 14px; cursor: pointer;
}
.modal-close:hover { background: var(--paper-2); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }

/* Old toast */
.toast {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink); color: var(--paper); padding: 10px 20px;
  border-radius: var(--r-pill); font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 999; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Old empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty-state p { font-size: 14px; line-height: 2.2; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); background: var(--paper); color: var(--ink);
  font-size: 14px; outline: none; transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--brand); }
.form-group textarea { resize: vertical; min-height: 100px; line-height: 1.6; }

.btn-primary {
  height: 44px; padding: 0 24px; border-radius: var(--r-sm);
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; border: none; transition: .15s;
}
.btn-primary:hover { background: var(--brand-deep); }
.btn-ghost {
  height: 44px; padding: 0 20px; border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink-2); font-size: 14px;
  font-weight: 600; cursor: pointer; border: 1px solid var(--line-2); transition: .15s;
}
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* Page containers */
.page-container { max-width: 900px; margin: 0 auto; padding: 28px 20px 80px; }
.auth-page { max-width: 420px; margin: 80px auto; padding: 0 20px; }
.auth-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 36px 32px; box-shadow: var(--shadow-md);
}
