/* Hallmark · Theme & Layout Tokens */
:root {
  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 180ms;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}
body.theme-dark {
  --bg-page: #0c0f14;
  --bg-card: #151921;
  --bg-elevated: #1e2430;
  --border: #262e3d;
  --border-focus: #3b82f6;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.12);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.12);
  --gold: #f59e0b;
  --gold-soft: rgba(245, 158, 11, 0.15);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
body.theme-light {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-elevated: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #2563eb;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.08);
  --green: #059669;
  --green-soft: rgba(5, 150, 105, 0.08);
  --gold: #d97706;
  --gold-soft: rgba(217, 119, 6, 0.1);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-main);
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.site-header { padding: 2rem 1.5rem 1rem; max-width: 1280px; margin: 0 auto; }
.header-container { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.badge-tag { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); margin-bottom: 0.5rem; }
.main-title { font-size: 1.75rem; font-weight: 700; line-height: 1.25; margin-bottom: 0.35rem; }
.subtitle { font-size: 0.95rem; color: var(--text-muted); max-width: 780px; }
.btn-theme { background: var(--bg-card); border: 1px solid var(--border); color: var(--text-main); padding: 0.5rem 0.9rem; border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; font-weight: 500; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); padding: 1.1rem; border-radius: var(--radius-md); box-shadow: var(--shadow); }
.stat-card.stat-winning { border-color: var(--gold); background: linear-gradient(135deg, var(--bg-card) 60%, var(--gold-soft)); }
.stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }
.main-container { max-width: 1280px; margin: 0 auto; padding: 1rem 1.5rem 3rem; }
.filter-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.25rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.search-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.input-search { flex: 1; min-width: 260px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.6rem 0.9rem; color: var(--text-main); font-size: 0.9rem; }
.input-search:focus { outline: 2px solid var(--border-focus); }
.filter-controls { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.btn-filter-toggle { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-main); padding: 0.55rem 0.9rem; border-radius: var(--radius-sm); font-size: 0.85rem; cursor: pointer; font-weight: 500; }
.btn-filter-toggle.active { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.select-filter { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-main); padding: 0.55rem 0.8rem; border-radius: var(--radius-sm); font-size: 0.85rem; cursor: pointer; }
.categories-nav { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 0.8rem; }
.pill { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-muted); padding: 0.4rem 0.8rem; border-radius: 9999px; font-size: 0.8rem; cursor: pointer; white-space: nowrap; }
.pill.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.result-bar { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap; gap: 0.5rem; border-top: 1px solid var(--border); padding-top: 0.75rem; }
.note-proxy { font-size: 0.75rem; opacity: 0.85; }
.ads-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 1.25rem; }
.ad-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.25rem; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); transition: transform var(--dur) var(--ease), border-color var(--dur); }
.ad-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.ad-card.winning-border { border-left: 4px solid var(--gold); }
.card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; gap: 0.5rem; }
.adv-title { font-size: 1rem; font-weight: 600; }
.adv-cat { font-size: 0.75rem; color: var(--text-muted); }
.badges-wrap { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.badge { font-size: 0.7rem; font-weight: 600; padding: 0.15rem 0.5rem; border-radius: var(--radius-sm); }
.badge-active { background: var(--green-soft); color: var(--green); border: 1px solid var(--green); }
.badge-inactive { background: var(--bg-elevated); color: var(--text-muted); border: 1px solid var(--border); }
.badge-winning { background: var(--gold-soft); color: var(--gold); border: 1px solid var(--gold); }
.card-hook { font-size: 0.92rem; font-weight: 600; line-height: 1.35; margin-bottom: 0.6rem; color: var(--text-main); }
.card-body-preview { font-size: 0.85rem; color: var(--text-muted); line-height: 1.45; margin-bottom: 0.8rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: 0.75rem; color: var(--text-muted); display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.35rem; margin-bottom: 0.9rem; padding: 0.6rem; background: var(--bg-elevated); border-radius: var(--radius-sm); }
.card-meta div span { font-weight: 600; color: var(--text-main); }
.card-actions { display: flex; gap: 0.5rem; align-items: center; }
.btn-detail { flex: 1; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-main); padding: 0.45rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 500; cursor: pointer; text-align: center; }
.btn-detail:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-meta-link { background: transparent; border: 1px solid var(--border); color: var(--accent); padding: 0.45rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.8rem; text-decoration: none; font-weight: 500; display: inline-flex; align-items: center; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.modal-backdrop.hidden { display: none; }
.modal-box { background: var(--bg-card); border: 1px solid var(--border); width: 100%; max-width: 680px; max-height: 90vh; border-radius: var(--radius-lg); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 1.25rem; overflow-y: auto; font-size: 0.9rem; line-height: 1.55; }
.btn-close { background: transparent; border: none; font-size: 1.4rem; color: var(--text-muted); cursor: pointer; }
.site-footer { text-align: center; padding: 2rem 1rem; font-size: 0.8rem; color: var(--text-muted); border-top: 1px solid var(--border); }
@media (max-width: 640px) {
  .ads-grid { grid-template-columns: 1fr; }
  .filter-controls { width: 100%; }
  .select-filter, .btn-filter-toggle { flex: 1; }
}
