:root {
  --page: #f3f5f6;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --text: #24282c;
  --muted: #66727a;
  --line: #dbe2e5;
  --line-soft: #edf1f3;
  --accent: #8a1f3d;
  --accent-dark: #65162d;
  --accent-soft: #f7e9ee;
  --green: #2f6d61;
  --green-soft: #e8f3ef;
  --blue: #1d5b84;
  --gold: #a97723;
  --shadow: 0 18px 45px rgba(36, 40, 44, 0.08);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0, #ffffff 260px, var(--page) 260px),
    var(--page);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.9;
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
  vertical-align: middle;
}

a {
  color: var(--blue);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(138, 31, 61, 0.26);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-top: 5px solid var(--accent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.site-header__inner {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 24px;
  width: min(100% - 40px, var(--max));
  margin: 0 auto;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
  text-decoration: none;
}

.brand span {
  font-size: clamp(1.55rem, 2.4vw, 2.3rem);
  font-weight: 850;
  line-height: 1.12;
}

.brand small {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.global-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.global-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.global-nav a[aria-current="page"],
.global-nav a:hover {
  border-color: rgba(138, 31, 61, 0.38);
  background: var(--accent-soft);
  color: var(--accent);
}

.global-nav a:hover {
  transform: translateY(-1px);
}

.site-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 304px;
  gap: 44px;
  width: min(100% - 40px, var(--max));
  margin: 0 auto;
  padding: 46px 0 68px;
}

.page-content {
  min-width: 0;
  max-width: 820px;
}

.breadcrumb {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li:not(:last-child)::after {
  content: "/";
  margin-left: 6px;
  color: #9aa4aa;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.38;
}

h1 {
  position: relative;
  margin: 0 0 24px;
  padding: 0 0 18px;
  color: var(--text);
  font-size: clamp(1.9rem, 3vw, 2.85rem);
  font-weight: 850;
}

h1::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 88px;
  height: 4px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

h2 {
  margin: 46px 0 18px;
  padding: 11px 14px;
  border-left: 5px solid var(--green);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 1.32rem;
  font-weight: 800;
}

h3 {
  margin: 28px 0 10px;
  color: var(--accent);
  font-size: 1.08rem;
  font-weight: 800;
}

p {
  margin: 0 0 1.15em;
}

.page-content > p:first-of-type {
  color: #3f484e;
  font-size: 1.05rem;
}

strong {
  color: var(--text);
  font-weight: 800;
}

hr {
  height: 1px;
  margin: 20px 0;
  border: 0;
  background: var(--line);
}

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

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

th {
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.page-content table:not(.main) {
  border-collapse: separate;
  border-spacing: 0 14px;
}

.page-content table:not(.main) tr {
  background: var(--surface);
  box-shadow: var(--shadow);
}

.page-content table:not(.main) td {
  border-top: 0;
}

.page-content table:not(.main) td:first-child {
  width: 160px;
}

.page-content table:not(.main) img {
  display: block;
  width: 126px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.page-content table:not(.main) h3 {
  margin-top: 0;
  font-size: 1.12rem;
}

.page-content table:not(.main) h3 a {
  color: var(--text);
  text-decoration: none;
}

.page-content table:not(.main) h3 a:hover {
  color: var(--accent);
}

.page-content table:not(.main) p {
  margin-bottom: 0.85em;
}

.page-content ul,
.page-content ol {
  padding-left: 1.4em;
}

.page-content li {
  margin: 0.35em 0;
}

.scene-guide,
.link-cluster,
.notice-box,
.faq-block,
.toc {
  margin-top: 30px;
}

.guide-grid,
.category-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 4px;
}

.guide-grid a,
.category-panels a {
  display: flex;
  min-height: 112px;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(36, 40, 44, 0.05);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.guide-grid a:hover,
.category-panels a:hover {
  border-color: rgba(138, 31, 61, 0.38);
  box-shadow: 0 16px 32px rgba(36, 40, 44, 0.08);
  transform: translateY(-1px);
}

.guide-grid strong,
.category-panels strong {
  font-size: 1.02rem;
  line-height: 1.45;
}

.guide-grid span,
.category-panels span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.notice-box,
.faq-block,
.toc {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.notice-box {
  border-left: 5px solid var(--blue);
}

.faq-block {
  border-left: 5px solid var(--green);
}

.sample-box {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
}

.sample-box h3 {
  margin-top: 0;
}

.sample-box p:last-child {
  margin-bottom: 0;
}

.notice-box h2,
.faq-block h2,
.link-cluster h2 {
  margin-top: 0;
}

.toc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
}

.toc strong {
  margin-right: 4px;
}

.toc a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
  border-color: rgba(138, 31, 61, 0.38);
}

.check-list,
.step-list {
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.check-list li,
.step-list li {
  position: relative;
  margin: 10px 0;
  padding: 12px 14px 12px 42px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-soft);
}

.check-list li::before,
.step-list li::before {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 18px;
  text-align: center;
}

.check-list li::before {
  content: "✓";
}

.step-list {
  counter-reset: steps;
}

.step-list li {
  counter-increment: steps;
}

.step-list li::before {
  content: counter(steps);
  background: var(--accent);
}

.info-table {
  border: 1px solid var(--line);
  background: var(--surface);
}

.info-table th,
.info-table td {
  border-top: 1px solid var(--line);
}

.checklist-table th:last-child,
.checklist-table td:last-child {
  width: 72px;
  text-align: center;
  white-space: nowrap;
}

.content-support,
.related-pages,
.source-note,
.external-guide,
.page-meta {
  margin-top: 34px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(36, 40, 44, 0.04);
}

.content-support {
  border-left: 5px solid var(--green);
}

.source-note {
  border-left: 5px solid var(--gold);
}

.related-pages {
  border-left: 5px solid var(--accent);
}

.external-guide {
  border-left: 5px solid var(--blue);
}

.external-guide--money {
  border-left-color: var(--gold);
}

.content-support h2,
.related-pages h2,
.source-note h2,
.external-guide h2 {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 1.12rem;
}

.content-support ul,
.related-pages ul,
.source-note ul,
.external-guide ul {
  margin: 0;
}

.source-note p,
.external-guide p {
  color: var(--muted);
  font-size: 0.95rem;
}

.page-meta {
  padding: 12px 16px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.9rem;
  box-shadow: none;
}

.page-meta p {
  margin: 0;
}

.page-content form {
  margin-top: 24px;
}

.main {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}

.main td {
  border-top: 1px solid var(--line-soft);
}

input,
textarea,
select,
button {
  max-width: 100%;
  font: inherit;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: min(100%, 520px);
  padding: 11px 12px;
  border: 1px solid #b8c4ca;
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 168px;
}

input[type="submit"],
button {
  min-height: 44px;
  padding: 10px 22px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

input[type="submit"]:hover,
button:hover {
  background: var(--accent-dark);
}

.site-aside {
  position: sticky;
  top: 118px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-self: start;
  min-width: 0;
}

.site-aside section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(36, 40, 44, 0.05);
  overflow: hidden;
}

.site-aside h2 {
  margin: 0;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-soft);
  color: var(--accent);
  font-size: 0.98rem;
  font-weight: 850;
}

.category-list,
.link-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 8px 14px 14px;
  list-style: none;
}

.category-list a,
.link-list a {
  display: block;
  padding: 11px 4px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
}

.category-list li:last-child a,
.link-list li:last-child a {
  border-bottom: 0;
}

.category-list a:hover,
.link-list a:hover {
  color: var(--accent);
}

.category-list span {
  display: block;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.2;
}

.about-site p {
  margin: 0;
  padding: 14px 16px 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.about-site p:last-child {
  padding-bottom: 16px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #25292d;
  color: #dce2e5;
  padding: 30px 16px 36px;
  text-align: center;
}

.site-footer p {
  margin: 0.45em 0;
}

.site-footer a {
  color: #ffffff;
}

.box,
.boxn,
.boxl,
.index,
.detail,
#base,
#wrapper,
#wrapper1,
#container,
#header,
#unit,
#content,
#left,
#right,
#footer {
  all: unset;
}

@media (max-width: 980px) {
  .site-header {
    position: static;
  }

  .site-header__inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .global-nav {
    justify-content: flex-start;
  }

  .site-layout {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .page-content {
    max-width: none;
  }

  .site-aside {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-aside .about-site {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 15.5px;
    line-height: 1.85;
  }

  .site-header__inner,
  .site-layout {
    width: min(100% - 24px, var(--max));
  }

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

  .global-nav a {
    justify-content: center;
    min-height: 38px;
    padding: 8px 9px;
    font-size: 0.86rem;
  }

  h1 {
    font-size: 1.72rem;
  }

  h2 {
    margin-top: 36px;
    font-size: 1.18rem;
  }

  .guide-grid,
  .category-panels {
    grid-template-columns: 1fr;
  }

  .page-content table:not(.main),
  .page-content table:not(.main) tbody,
  .page-content table:not(.main) tr,
  .page-content table:not(.main) td,
  .page-content table:not(.main) th,
  .main,
  .main tbody,
  .main tr,
  .main td,
  .main th {
    display: block;
    width: 100%;
  }

  .page-content table:not(.main) tr {
    padding: 16px;
  }

  .page-content table:not(.main) td {
    padding: 0;
  }

  .page-content table:not(.main) td:first-child {
    width: 100%;
    margin-bottom: 12px;
  }

  .page-content table:not(.main) img {
    width: 100%;
    max-height: 210px;
  }

  .main td,
  .main th {
    padding: 10px 12px;
  }

  .site-aside {
    grid-template-columns: 1fr;
  }
}
