
/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --primary: #2563eb;
  --primary-d: #1d4ed8;
  --text: #0f172a;
  --text-m: #475569;
  --text-s: #94a3b8;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(0,0,0,.07);
  --shadow-h: 0 4px 16px rgba(0,0,0,.12);
}
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh;
  display: flex; flex-direction: column; }
a { color: var(--primary); }
img { max-width: 100%; }

/* ===== CONTAINER ===== */
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ===== HEADER ===== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.site-header .container {
  display: flex; align-items: center; gap: 20px;
  padding-top: 14px; padding-bottom: 14px;
}
.logo { font-size: 1.15rem; font-weight: 800; text-decoration: none; color: var(--text); white-space: nowrap; }
.logo span { color: var(--primary); }
.main-nav { display: flex; gap: 6px; }
.main-nav a { padding: 7px 14px; border-radius: 8px; text-decoration: none;
  font-size: .9rem; font-weight: 500; color: var(--text-m); transition: background .15s, color .15s; }
.main-nav a:hover { background: var(--bg); color: var(--primary); }
.header-search { display: flex; margin-left: auto; border: 1px solid var(--border);
  border-radius: 50px; overflow: hidden; background: var(--bg); }
.header-search input { border: none; background: transparent; padding: 7px 16px;
  font-size: .88rem; outline: none; width: 200px; }
.header-search button { border: none; background: transparent; padding: 7px 12px;
  cursor: pointer; font-size: 1rem; color: var(--text-m); }
.header-search button:hover { color: var(--primary); }

/* ===== MAIN ===== */
main.container { padding-top: 32px; padding-bottom: 48px; flex: 1; }

/* ===== FOOTER ===== */
.site-footer { background: #1e293b; color: #cbd5e1; margin-top: auto; }
.site-footer .container { padding-top: 48px; padding-bottom: 48px; }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-cols strong { display: block; color: #f1f5f9; font-size: .95rem; margin-bottom: 12px; }
.footer-cols p { font-size: .88rem; color: #94a3b8; line-height: 1.7; }
.footer-cols ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-cols ul li a { color: #94a3b8; text-decoration: none; font-size: .88rem; transition: color .15s; }
.footer-cols ul li a:hover { color: #f1f5f9; }
.footer-bottom { border-top: 1px solid #334155; padding-top: 20px; }
.footer-bottom p { font-size: .82rem; color: #64748b; }

/* ===== BREADCRUMB ===== */
.breadcrumb { margin-bottom: 20px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; font-size: .83rem; color: var(--text-s); }
.breadcrumb ol li::after { content: "›"; margin-left: 6px; }
.breadcrumb ol li:last-child::after { content: ""; }
.breadcrumb ol li a { color: var(--text-s); text-decoration: none; }
.breadcrumb ol li a:hover { color: var(--primary); }

/* ===== SECTION ===== */
.section { margin-bottom: 48px; }

/* ===== CAT GRID ===== */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.cat-card { display: flex; flex-direction: column; padding: 20px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text); transition: transform .2s, box-shadow .2s; }
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-h); }
.cat-icon-big { font-size: 2rem; margin-bottom: 8px; display: block; }
.cat-name { font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.cat-count { font-size: .78rem; color: var(--text-s); }

/* ===== ARTICLE GRID (homepage latest) ===== */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.article-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.article-card-icon { font-size: 1.6rem; }
.article-cat { font-size: .78rem; }
.article-cat a { color: var(--primary); text-decoration: none; font-weight: 500; }
.article-card h3 { font-size: .95rem; font-weight: 600; }
.article-card h3 a { color: var(--text); text-decoration: none; }
.article-card h3 a:hover { color: var(--primary); }
.article-excerpt { font-size: .83rem; color: var(--text-m); }

/* ===== ARTICLE LIST ===== */
.article-list { display: flex; flex-direction: column; gap: 8px; }
.article-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; transition: box-shadow .2s, background .15s; box-shadow: var(--shadow); }
.article-row:hover { box-shadow: var(--shadow-h); }

/* ===== PAGINATION ===== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px;
  margin-top: 32px; padding: 20px 0; }
.pagination a { padding: 9px 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; color: var(--text-m); font-size: .9rem;
  transition: background .15s; }
.pagination a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination span { font-size: .88rem; color: var(--text-s); }

/* ===== ARTICLE CAT BADGE ===== */
.article-cat-badge { display: inline-block; background: var(--primary); color: #fff;
  padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600;
  text-decoration: none; margin-bottom: 8px; }

/* ===== HERO ===== */
.hero { background: linear-gradient(135deg, #1e3a8a 0%, #4f46e5 60%, #7c3aed 100%);
  color:#fff; border-radius: var(--radius); padding: 56px 48px; margin-bottom: 0; }
.hero-content { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.hero-text { flex: 1; }
.hero h1 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.hero-accent { color: #fbbf24; }
.hero-sub { font-size: 1.05rem; opacity: .9; margin-bottom: 28px; }
.hero-search { display: flex; max-width: 480px; border-radius: 50px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.25); }
.hero-search input { flex:1; padding: 14px 22px; border:none; font-size: 1rem; outline:none;
  border-radius: 50px 0 0 50px; }
.hero-search button { padding: 14px 28px; background: #fbbf24; color: #1e293b; border:none;
  font-weight: 700; font-size: 1rem; cursor:pointer; border-radius: 0 50px 50px 0; transition: background .2s; }
.hero-search button:hover { background: #f59e0b; }
.hero-visual { flex-shrink: 0; }
.hero-emojis { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.hero-emojis span { font-size: 2.4rem; background: rgba(255,255,255,.12); border-radius: 16px;
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }

/* ===== STATS BAR ===== */
.stats-bar { display: flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin: 20px 0 40px; overflow: hidden; box-shadow: var(--shadow); }
.stat { flex:1; display: flex; flex-direction: column; align-items: center; padding: 18px 12px;
  border-right: 1px solid var(--border); }
.stat:last-child { border-right: none; }
.stat-n { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stat-l { font-size: .78rem; color: var(--text-s); text-transform: uppercase;
  letter-spacing: .05em; margin-top: 2px; }

/* ===== SECTION HEADER ===== */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-header h2 { font-size: 1.4rem; font-weight: 700; margin: 0; }
.see-all { font-size: .88rem; color: var(--primary); text-decoration: none; font-weight: 500; }
.see-all:hover { text-decoration: underline; }

/* ===== CAT GRID BIG ===== */
.cat-grid--big { grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; }
.cat-card--big { padding: 24px 20px; position: relative; }
.cat-arrow { position: absolute; bottom: 14px; right: 16px; font-size: 1.1rem;
  color: var(--text-s); transition: transform .2s; }
.cat-card--big:hover .cat-arrow { transform: translateX(4px); }

/* ===== PAGE HERO ===== */
.page-hero { background: linear-gradient(135deg, var(--cat-bg, #dbeafe) 0%, #fff 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px 40px; margin-bottom: 28px;
  display: flex; align-items: center; gap: 20px; }
.page-hero--cats { background: linear-gradient(135deg,#ede9fe,#dbeafe); }
.page-hero-icon { font-size: 3rem; flex-shrink: 0; }
.page-hero h1 { font-size: clamp(1.5rem,3vw,2rem); font-weight: 800; margin-bottom: 4px; }
.page-hero p { color: var(--text-m); font-size: .92rem; }

/* ===== ARTICLE ROW RICH ===== */
.article-row--rich { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; position: relative; }
.article-row-num { font-size: .8rem; font-weight: 700; color: var(--text-s); min-width: 28px; padding-top: 4px; }
.article-row-icon { font-size: 1.4rem; flex-shrink: 0; padding-top: 2px; }
.article-row-body { flex: 1; }
.article-row-body h2 { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.article-row-body p { font-size: .85rem; color: var(--text-m); margin: 0; }
.article-row-meta { display: flex; gap: 12px; margin-top: 6px; }
.article-row-meta span { font-size: .78rem; color: var(--text-s); }
.article-row-arrow { align-self: center; font-size: 1.2rem; color: var(--text-s);
  text-decoration: none; padding: 0 4px; transition: transform .2s; }
.article-row--rich:hover .article-row-arrow { transform: translateX(3px); color: var(--primary); }
a.article-row--rich { text-decoration: none; display: flex; cursor: pointer; }
a.article-row--rich h2 { color: var(--text); }
a.article-row--rich:hover { background: #f0f4ff; box-shadow: var(--shadow-h); }
a.article-row--rich:hover h2 { color: var(--primary); }

/* ===== ARTICLE BANNER ===== */
.article-banner { background: linear-gradient(135deg, var(--cat-bg,#dbeafe) 0%, #fff 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px 40px; margin-bottom: 0;
  display: flex; align-items: flex-start; gap: 24px; }
.article-banner-icon { font-size: 4rem; flex-shrink: 0; filter: drop-shadow(0 2px 6px rgba(0,0,0,.12)); }
.article-banner-info { flex: 1; }
.article-banner-info h1 { font-size: clamp(1.4rem,2.5vw,2rem); font-weight: 800; margin: 8px 0 12px; }
.article-meta-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.article-meta-pills span { background: rgba(255,255,255,.75); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px 12px; font-size: .8rem; color: var(--text-m); }

/* ===== ARTICLE BODY ===== */
.single-article { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 24px; }
.article-body { padding: 36px 48px; font-size: 1.02rem; line-height: 1.9; }
.article-body p { margin-bottom: 1.1em; }
.article-body h3.ref-heading { font-size: 1.1rem; font-weight: 700; color: var(--primary);
  margin: 1.8em 0 .6em; padding-left: 12px; border-left: 4px solid var(--primary); }
.article-body ul.ref-list { margin: .6em 0 1.2em 1.4em; display: flex; flex-direction: column; gap: 5px; }
.article-body strong { font-weight: 700; }
.article-body em { color: #6366f1; font-style: italic; }

/* ===== ARTICLE FOOTER BAR ===== */
.article-footer-bar { display: flex; gap: 12px; padding: 20px 48px;
  border-top: 1px solid var(--border); background: var(--bg); }
.btn-back { display: inline-block; padding: 9px 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-m);
  text-decoration: none; font-size: .88rem; transition: background .15s; }
.btn-back:hover { background: var(--border); }

/* ===== RELATED ===== */
.related-articles { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 28px; }
.related-articles h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 10px; }
.related-card { display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--cat-bg,#f1f5f9); border-radius: var(--radius); text-decoration: none;
  color: var(--text); font-size: .88rem; font-weight: 500; transition: filter .15s; }
.related-card:hover { filter: brightness(.95); }
.related-icon { font-size: 1.2rem; flex-shrink: 0; }

/* ===== TOP LIST ===== */
.top-list { display: flex; flex-direction: column; gap: 10px; }
.top-item { display: flex; align-items: center; gap: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 20px;
  text-decoration: none; transition: box-shadow .2s, transform .2s; }
.top-item:hover { box-shadow: var(--shadow-h); transform: translateX(4px); }
.top-rank { font-size: 1.3rem; font-weight: 800; color: var(--primary); min-width: 28px; }
.top-icon { font-size: 1.5rem; }
.top-info { display: flex; flex-direction: column; gap: 2px; }
.top-title { font-weight: 600; color: var(--text); font-size: .97rem; }
.top-cat { font-size: .8rem; color: var(--text-s); }

/* ===== SEARCH FORM ===== */
.search-form { display: flex; gap: 10px; margin: 20px 0; }
.search-form input { flex: 1; padding: 12px 18px; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 1rem; outline: none; }
.search-form input:focus { border-color: var(--primary); }
.search-form button { padding: 12px 24px; background: var(--primary); color: #fff;
  border: none; border-radius: var(--radius); font-size: 1rem; cursor: pointer;
  font-weight: 600; transition: background .15s; }
.search-form button:hover { background: var(--primary-d); }
.search-count { color: var(--text-m); font-size: .9rem; margin-bottom: 16px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero { padding: 32px 20px; }
  .hero-visual { display: none; }
  .hero-search { max-width: 100%; }
  .stats-bar { flex-wrap: wrap; }
  .stat { flex-basis: 50%; }
  .footer-cols { grid-template-columns: 1fr; gap: 24px; }
  .article-body { padding: 24px 20px; }
  .article-footer-bar { padding: 16px 20px; flex-wrap: wrap; }
  .article-banner { flex-direction: column; padding: 24px 20px; }
  .page-hero { padding: 24px 20px; flex-direction: column; }
  .main-nav { display: none; }
  .header-search input { width: 140px; }
}
@media (max-width: 480px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .article-grid { grid-template-columns: 1fr; }
  .header-search { display: none; }
}
