:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #64748b;
  --line: #dbe4ee;
  --red: #b42318;
  --red-dark: #7f1d1d;
  --teal: #0f766e;
  --amber: #b7791f;
  --green: #2f7d32;
  --nav: #1f2937;
  --shadow: 0 18px 42px rgba(23, 32, 51, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.skip-link,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  width: auto;
  height: auto;
  margin: 12px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--red);
  z-index: 20;
  clip: auto;
}

.topbar {
  background: #111827;
  color: #e5edf6;
  font-size: 13px;
}

.topbar-inner,
.header-inner,
.nav-inner,
.section-heading,
.panel-header,
.listing-toolbar,
.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar p {
  margin: 0;
  padding: 9px 0;
}

.topbar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar-links a {
  color: #fef3c7;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: 112px;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 245px;
}

.brand-copy {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: var(--radius);
  background: var(--red);
  color: #fff;
  font-weight: 800;
  box-shadow: 8px 8px 0 #f4c430;
}

.brand-copy strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
}

.brand-copy small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  max-width: 340px;
}

.header-ad {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 90px;
  border: 1px dashed #b8c4d2;
  border-radius: var(--radius);
  background: #f8fafc;
  overflow: hidden;
}

.header-ad img {
  width: 100%;
  height: 90px;
  object-fit: cover;
}

.ad-placeholder {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0;
}

.main-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav);
  color: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
}

.nav-inner {
  min-height: 52px;
}

.home-link,
.nav-menu a,
.nav-toggle,
.back-link,
.primary-action,
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius);
}

.home-link {
  height: 38px;
  padding: 0 13px;
  background: var(--red);
  font-weight: 700;
}

.home-link svg,
.nav-toggle svg,
.back-link svg {
  width: 18px;
  height: 18px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.nav-menu a {
  min-height: 38px;
  padding: 0 12px;
  color: #edf2f7;
  font-weight: 700;
}

.nav-menu a:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.site-main {
  padding: 28px 0 56px;
}

.notice-band,
.section-block,
.page-head,
.listing-shell,
.post-detail,
.empty-state,
.setup-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notice-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border-left: 6px solid var(--red);
}

.notice-band h1,
.section-heading h2,
.page-head h1,
.post-detail h1,
.empty-state h1,
.setup-card h1 {
  margin: 0;
  letter-spacing: 0;
}

.notice-band h1 {
  font-size: clamp(28px, 4vw, 42px);
}

.notice-band p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--red);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.section-block {
  margin-top: 22px;
  padding: 20px;
}

.section-heading {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.section-heading h2 {
  font-size: 24px;
}

.trending-grid,
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.trending-card {
  min-height: 132px;
  padding: 16px;
  border-radius: var(--radius);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 22px rgba(23, 32, 51, 0.16);
}

.trending-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -24px;
  width: 92px;
  height: 92px;
  border: 16px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.trending-card span,
.trending-card strong,
.trending-card small {
  position: relative;
  z-index: 1;
  display: block;
}

.trending-card span {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.trending-card strong {
  margin: 12px 0 10px;
  font-size: 17px;
  line-height: 1.25;
}

.trending-card small {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 700;
}

.tone-1 {
  background: linear-gradient(135deg, #b42318, #7f1d1d);
}

.tone-2 {
  background: linear-gradient(135deg, #0f766e, #134e4a);
}

.tone-3 {
  background: linear-gradient(135deg, #b7791f, #7c4a03);
}

.tone-4 {
  background: linear-gradient(135deg, #2f7d32, #1b5e20);
}

.job-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}

.panel-header {
  min-height: 56px;
  padding: 14px 14px 12px;
  background: #f8fafc;
  border-bottom: 3px solid var(--red);
}

.panel-header h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.panel-header a {
  flex: 0 0 auto;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.post-list,
.footer-links,
.full-post-list,
.setup-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-list li {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid #edf2f7;
}

.post-list li:last-child {
  border-bottom: 0;
}

.post-list a,
.full-post-list a {
  color: #1f2937;
  font-weight: 700;
}

.brand-copy strong,
.brand-copy small,
.notice-band p,
.trending-card strong,
.post-list a,
.full-post-list a,
.panel-header h3 {
  overflow-wrap: anywhere;
}

.post-list a:hover,
.full-post-list a:hover,
.footer-links a:hover {
  color: var(--red);
}

.post-list span,
.full-post-list time,
.post-meta,
.page-head p,
.full-post-list p,
.post-detail .lead,
.post-content,
.site-footer p {
  color: var(--muted);
}

.post-list span {
  font-size: 12px;
  font-weight: 700;
}

.page-head,
.listing-shell,
.post-detail,
.empty-state {
  padding: 24px;
}

.page-head h1,
.post-detail h1 {
  font-size: clamp(28px, 4vw, 42px);
  margin-top: 12px;
}

.back-link {
  width: fit-content;
  color: var(--red);
  font-weight: 800;
}

.listing-shell,
.post-detail {
  margin-top: 22px;
}

.full-post-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.full-post-list li:last-child {
  border-bottom: 0;
}

.full-post-list p {
  margin: 6px 0 0;
}

.full-post-list time {
  white-space: nowrap;
  font-weight: 700;
}

.pagination {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.pagination a,
.primary-action {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  background: var(--red);
  color: #fff;
  font-weight: 800;
}

.post-meta {
  justify-content: flex-start;
  margin: 14px 0;
  flex-wrap: wrap;
}

.post-content {
  margin: 22px 0;
}

.post-content h2,
.post-content h3 {
  color: var(--ink);
}

.post-content ul {
  padding-left: 20px;
}

.post-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.post-section h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 24px;
}

.detail-table-wrap {
  overflow-x: auto;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.detail-table th,
.detail-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.detail-table th {
  width: 220px;
  background: #f8fafc;
  color: var(--ink);
}

.public-list,
.link-list {
  margin: 0;
  padding-left: 20px;
}

.public-list li + li,
.link-list li + li {
  margin-top: 8px;
}

.link-list {
  padding: 0;
  list-style: none;
}

.link-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.link-list a {
  color: var(--red);
  font-weight: 800;
}

.link-list span {
  color: var(--muted);
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
}

.faq-list details + details {
  margin-top: 10px;
}

.faq-list summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.empty-state {
  text-align: center;
}

.site-footer {
  background: #101827;
  color: #e5edf6;
  padding: 34px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 28px;
}

.site-footer h2,
.site-footer h3 {
  margin: 0 0 12px;
}

.footer-links li + li {
  margin-top: 8px;
}

.footer-links a {
  color: #fef3c7;
}

.setup-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.setup-card {
  width: min(680px, 100%);
  padding: 28px;
}

.setup-card pre {
  max-height: 220px;
  overflow: auto;
  padding: 14px;
  background: #111827;
  color: #f8fafc;
  border-radius: var(--radius);
}

.setup-list {
  margin: 16px 0;
}

.setup-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 1024px) {
  .trending-grid,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .header-inner,
  .notice-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-ad {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .container {
    width: min(100% - 20px, 1180px);
  }

  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
    padding-bottom: 8px;
  }

  .brand-copy strong {
    font-size: 24px;
  }

  .brand {
    min-width: 0;
    width: 100%;
  }

  .brand-copy small {
    max-width: 100%;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .nav-menu {
    display: none;
    position: absolute;
    left: 10px;
    right: 10px;
    top: 58px;
    margin: 0;
    padding: 10px;
    background: #1f2937;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu a {
    justify-content: flex-start;
  }

  .notice-band,
  .section-block,
  .page-head,
  .listing-shell,
  .post-detail {
    padding: 16px;
  }

  .trending-grid,
  .category-grid,
  .footer-grid,
  .full-post-list li {
    grid-template-columns: 1fr;
  }

  .full-post-list time {
    white-space: normal;
  }

  .listing-toolbar,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
