:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef3ff;
  --text: #172033;
  --muted: #63708a;
  --primary: #3559c7;
  --primary-dark: #223d94;
  --accent: #7b4ce2;
  --border: #dfe5f0;
  --shadow: 0 16px 45px rgba(26, 39, 75, .10);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0 !important;
  min-height: 100vh;
  color: var(--text) !important;
  background:
    radial-gradient(circle at 12% 10%, rgba(123,76,226,.12), transparent 28rem),
    radial-gradient(circle at 88% 4%, rgba(53,89,199,.12), transparent 25rem),
    var(--bg) !important;
  font: 16px/1.65 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}

a { color: var(--primary); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--primary-dark); }

.site-header {
  color: #fff;
  background: linear-gradient(135deg, #1d2f6f 0%, #3559c7 52%, #7b4ce2 100%);
  padding: clamp(3rem, 8vw, 6rem) 1.25rem 4rem;
  position: relative;
  overflow: hidden;
}
.site-header::after {
  content: "";
  position: absolute;
  width: 32rem;
  height: 32rem;
  right: -12rem;
  top: -18rem;
  border-radius: 50%;
  background: rgba(255,255,255,.10);
}
.header-inner, .page-shell, .site-footer-inner { width: min(1120px, 100%); margin: 0 auto; }
.eyebrow {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  padding: .35rem .75rem;
  border: 1px solid rgba(255,255,255,.30);
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  font-size: .88rem;
  letter-spacing: .03em;
}
h1 {
  margin: 1rem 0 .75rem;
  max-width: 850px;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}
.lead { max-width: 780px; margin: 0; color: rgba(255,255,255,.86); font-size: 1.08rem; }

.page-shell { padding: 2rem 1.25rem 4rem; }
.notice {
  margin: -2.1rem auto 2rem;
  position: relative;
  z-index: 2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  color: var(--muted);
}
.notice strong { color: var(--text); }

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  margin: 1.25rem 0 2rem;
}
.search {
  width: 100%;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.search:focus { outline: 3px solid rgba(53,89,199,.18); border-color: var(--primary); }
.count { align-self: center; color: var(--muted); font-size: .93rem; white-space: nowrap; }

.category { margin: 2.5rem 0; }
.category-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.category h2 { margin: 0; font-size: clamp(1.35rem, 2vw, 1.75rem); letter-spacing: -.02em; }
.category-head p { margin: .25rem 0 0; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.card {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 24px rgba(26,39,75,.06);
  color: inherit;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(53,89,199,.45); color: inherit; }
.card-number { color: var(--primary); font-weight: 750; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
.card-title { margin: .6rem 0 1rem; font-weight: 720; font-size: 1.08rem; line-height: 1.35; }
.card-link { color: var(--muted); font-size: .91rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: 1rem;
  font-weight: 650;
  text-decoration: none;
}
.article {
  width: min(860px, 100%);
  margin: -2.2rem auto 2rem;
  position: relative;
  z-index: 2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 4vw, 3rem);
}
.article-header { border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; padding-bottom: 1.2rem; }
.article-header h1 { color: var(--text); margin: .45rem 0 .7rem; font-size: clamp(1.75rem, 4vw, 2.7rem); }
.tag {
  display: inline-block;
  border-radius: 999px;
  padding: .3rem .65rem;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: .82rem;
}
.article-content p, .article-content li, .article-content div, .article-content span {
  font-family: inherit !important;
  font-size: inherit !important;
  color: inherit !important;
  background: transparent !important;
}
.article-content p { margin: 0 0 1rem; }
.article-content ul, .article-content ol { padding-left: 1.4rem; margin: 0 0 1.25rem; }
.article-content li { margin: .45rem 0; }
.article-content strong { font-weight: 760; }
.article-content em { color: #34405a !important; }
.article-content > p:first-child { font-size: 1.04rem !important; }

.page-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .7rem 1rem;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
}
.button:hover { color: #fff; background: var(--primary-dark); }
.button.secondary { background: var(--surface-soft); color: var(--primary-dark); }

.site-footer { border-top: 1px solid var(--border); background: rgba(255,255,255,.72); }
.site-footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem 1.5rem; padding: 1.5rem 1.25rem; color: var(--muted); font-size: .92rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }
.hidden { display: none !important; }

@media (max-width: 680px) {
  .toolbar { grid-template-columns: 1fr; }
  .count { justify-self: start; }
  .site-header { padding-top: 2.5rem; }
  .article { border-radius: 14px; }
}
