:root {
  color-scheme: light;
  --bg: #f3f5f1;
  --paper: #ffffff;
  --paper-warm: #fffaf0;
  --ink: #1b2420;
  --muted: #62716a;
  --line: #d9e2dc;
  --accent: #1c6656;
  --accent-strong: #123d35;
  --accent-soft: #e4f1ec;
  --warm: #b27a2c;
  --warm-soft: #fbedd7;
  --mark: #fff0a8;
  --shadow: 0 18px 40px rgba(23, 48, 40, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Yu Gothic UI", sans-serif;
  line-height: 1.8;
}

a { color: inherit; }
a:hover { color: var(--accent); }

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

.site-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.site-name::before {
  content: "";
  width: 10px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), var(--warm));
}

.site-nav {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.site-nav a { text-decoration: none; }

.hero {
  position: relative;
  padding: 54px 0 34px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(228, 241, 236, 0.94), rgba(255, 250, 240, 0.92)),
    radial-gradient(circle at 82% 18%, rgba(178, 122, 44, 0.16), transparent 28%);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: max(18px, calc((100vw - 1080px) / 2));
  bottom: -42px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(28, 102, 86, 0.18);
  border-radius: 50%;
}

.hero .wrap {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.25;
  letter-spacing: 0;
}

.lead {
  margin-top: 14px;
  max-width: 760px;
  color: var(--muted);
  font-size: 16px;
}

.main {
  padding: 28px 0 48px;
}

.article-card,
.article-body,
.category-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.section-title {
  margin: 28px 0 12px;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: 0;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 22px;
  margin-right: 10px;
  border-radius: 999px;
  background: var(--warm);
  vertical-align: -4px;
}

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

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

.article-card {
  display: block;
  padding: 18px;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.card-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: -4px 0 14px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--accent-soft);
}

.article-card:hover,
.guide-card:hover,
.related-card:hover {
  border-color: rgba(28, 102, 86, 0.38);
  box-shadow: var(--shadow);
  color: inherit;
  transform: translateY(-2px);
}

.guide-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.guide-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
}

.guide-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.guide-card .status {
  margin-top: 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.guide-card .status::after {
  content: " →";
}

.guide-card.pending {
  color: var(--muted);
  background: #f9faf8;
}

.guide-card.pending .status {
  color: var(--muted);
}

.category-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 24px rgba(20, 48, 40, 0.04);
}

.category-card h3 {
  margin: 0;
  font-size: 17px;
}

.category-card ul {
  margin: 12px 0 0;
  padding-left: 1.2em;
}

.category-card li + li {
  margin-top: 8px;
}

.category-card a {
  text-decoration: none;
}

.policy-box {
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-warm);
  color: var(--muted);
}

.article-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
}

.article-card p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  align-items: start;
}

.article-body {
  padding: clamp(20px, 4vw, 38px);
  box-shadow: var(--shadow);
}

.article-body h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.35;
  letter-spacing: 0;
}

.hero-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 20px 0 26px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--accent-soft);
}

.section-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 14px 0 22px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--accent-soft);
}

.generated-article h2 {
  margin: 42px 0 16px;
  padding: 12px 14px;
  border-left: 5px solid var(--accent);
  border-bottom: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  font-size: 24px;
  line-height: 1.45;
}

.generated-article h3 {
  margin: 30px 0 10px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--accent-strong);
}

.generated-article h3::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--warm);
  vertical-align: 0.1em;
}

.generated-article p {
  margin: 20px 0;
  line-height: 2.0;
}

.generated-article ul,
.generated-article ol {
  margin: 20px 0;
  padding-left: 1.4em;
  line-height: 2.0;
}

.summary-box,
.note {
  margin: 20px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.summary-box {
  border-color: #cbded6;
  background: linear-gradient(180deg, #f7fbf8, #ffffff);
}

.note {
  border-color: #ead49b;
  background: #fff9e7;
}

.generated-article .faq-heading {
  margin-top: 44px;
}

.faq {
  margin: 18px 0 28px;
  padding: 0;
  border: 1px solid #cddbd5;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 26px rgba(20, 48, 40, 0.05);
  overflow: hidden;
}

.faq-item {
  padding: 18px 20px;
}

.faq-item + .faq-item {
  border-top: 1px solid var(--line);
}

.faq-q,
.faq-a {
  position: relative;
  margin: 0;
  padding-left: 34px;
}

.faq-q {
  color: var(--ink);
  font-weight: 700;
}

.faq-a {
  margin-top: 10px;
  color: #33413c;
}

.faq-q::before,
.faq-a::before {
  position: absolute;
  left: 0;
  top: 0.1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.faq-q::before {
  content: "Q";
  background: var(--accent);
  color: #fff;
}

.faq-a::before {
  content: "A";
  background: var(--accent-soft);
  color: var(--accent);
}

.marker {
  padding: 0 2px;
  background: linear-gradient(transparent 58%, var(--mark) 58%);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
}

th,
td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th { background: #f2f6f3; }

.sidebar {
  position: sticky;
  top: 84px;
}

.category-block {
  padding: 16px;
  box-shadow: 0 12px 28px rgba(20, 48, 40, 0.06);
}

.category-block h2 {
  margin: 0 0 10px;
  font-size: 16px;
}

.category-block ul {
  margin: 0;
  padding-left: 1.2em;
}

.category-block li + li {
  margin-top: 8px;
}

.sidebar-cat-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-cat-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-cat-list a {
  text-decoration: none;
  font-size: 14px;
}

.sidebar-cat-list a:hover {
  color: var(--accent);
}

.sidebar-cat-count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.related-links {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.related-links h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.related-card {
  display: block;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.related-card strong {
  display: block;
  line-height: 1.5;
}

.related-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  color: var(--muted);
  background: var(--paper);
}

@media (max-width: 820px) {
  .header-inner { align-items: flex-start; flex-direction: column; padding: 14px 0; }
  .portal-grid,
  .category-grid,
  .article-grid,
  .related-grid,
  .article-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
