:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-muted: #f0f3f7;
  --text: #1f2933;
  --muted: #556170;
  --line: #d6dde6;
  --line-dark: #bcc7d4;
  --accent: #2f5fa8;
  --accent-soft: #e7eef8;
  --accent-strong: #153a72;
  --code-bg: #0f1720;
  --code-text: #eef3f8;
  --success: #2e7d32;
  --warning: #8a5b00;
  --danger: #8b2f2f;
  --radius: 10px;
  --radius-small: 6px;
  --content-width: 1120px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 150px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
}

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

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

code,
pre {
  font-family: Consolas, Monaco, "Courier New", monospace;
}

pre {
  margin: 0;
  overflow-x: auto;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent-strong);
  color: #fff;
  padding: 10px 14px;
  z-index: 50;
}

.skip-link:focus {
  left: 12px;
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
}

.brand strong {
  display: block;
  font-size: 1rem;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.main-nav a {
  padding: 7px 10px;
  border-radius: var(--radius-small);
  text-decoration: none;
  color: var(--text);
  font-size: 0.94rem;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  padding: 8px 12px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-small);
  background: #fff;
  font: inherit;
}

.header-search-row {
  padding: 0 0 14px;
}

.site-search {
  position: relative;
}

.search-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.95rem;
}

.search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.site-search-input,
.library-search,
input,
button,
textarea,
select {
  font: inherit;
}

.site-search-input,
.library-search {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-small);
  background: #fff;
}

.site-search-input:focus,
.library-search:focus,
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.search-submit,
.copy-button,
.filter-chip,
button {
  padding: 10px 12px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-small);
  background: #fff;
  cursor: pointer;
}

.search-submit:hover,
.copy-button:hover,
.filter-chip:hover,
button:hover {
  background: var(--surface-muted);
}

.search-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.search-result,
.search-empty {
  display: block;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.search-result:first-child,
.search-empty:first-child {
  border-top: 0;
}

.search-result:hover {
  background: var(--surface-muted);
}

.search-result strong {
  display: block;
  margin-bottom: 2px;
}

.search-result span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.search-empty {
  color: var(--muted);
}

.hero {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--line);
  background: #eef2f6;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 360px);
  gap: 24px;
  align-items: start;
}

.breadcrumbs {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 3vw, 2.6rem);
  line-height: 1.15;
}

.hero-copy {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
}

.hero-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.hero-box h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.hero-box p {
  margin: 0;
  color: var(--muted);
}

.content-grid {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 30px;
  padding: 28px 0 60px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-card {
  position: sticky;
  top: 140px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.side-card:nth-child(2) {
  top: 410px;
}

.side-card:nth-child(3) {
  top: 620px;
}

.side-card h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.side-card nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 52vh;
  overflow: auto;
  padding-right: 4px;
}

.side-card nav a,
.plain-link-list a {
  text-decoration: none;
  color: var(--text);
  padding: 6px 8px;
  border-radius: var(--radius-small);
}

.side-card nav a:hover,
.plain-link-list a:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.compact-note p {
  margin: 0;
  color: var(--muted);
}

.plain-link-list {
  margin: 0;
  padding-left: 18px;
}

.article {
  min-width: 0;
}

.content-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.content-section:last-child {
  margin-bottom: 0;
}

.section-heading {
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 6px 0 0;
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  line-height: 1.25;
}

.section-badge {
  display: inline-block;
  padding: 4px 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: var(--radius-small);
  font-size: 0.8rem;
  font-weight: 700;
}

.section-intro {
  margin-top: 0;
  color: var(--muted);
}

.info-card-grid,
.route-grid,
.gallery-grid,
.thumb-grid {
  display: grid;
  gap: 16px;
}

.info-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 18px;
}

.info-card,
.link-panel,
.project-card,
.thumb-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  padding: 16px;
}

.info-card h3,
.link-panel h3,
.project-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.info-card p,
.link-panel p,
.project-card p {
  margin: 0;
  color: var(--muted);
}

.route-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.link-panel {
  text-decoration: none;
  color: inherit;
}

.link-panel:hover {
  background: var(--surface-muted);
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
}

.timeline-item span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-dark);
  background: var(--surface-muted);
  font-weight: 700;
}

.timeline-item h3 {
  margin: 0 0 4px;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 18px;
}

.meta-chip {
  display: inline-block;
  padding: 5px 8px;
  border-radius: var(--radius-small);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  font-size: 0.88rem;
}

.split-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #fbfcfd;
}

.split-box h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1rem;
}

.step-list,
.test-list,
.note-list,
.name-list {
  margin: 0;
  padding-left: 20px;
}

.step-list li,
.test-list li,
.note-list li,
.name-list li {
  margin-bottom: 8px;
}

.step-list li:last-child,
.test-list li:last-child,
.note-list li:last-child,
.name-list li:last-child {
  margin-bottom: 0;
}

.small-paragraph {
  margin-bottom: 0;
  color: var(--muted);
}

.note {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-small);
  border: 1px solid var(--line);
}

.note h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.note p,
.note ul {
  margin: 0;
}

.note-tip {
  background: #f7f9fc;
}

.note-warn {
  background: #fff9ef;
  border-color: #ead9a6;
}

.source-details {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  overflow: hidden;
  background: #fff;
}

.source-details summary {
  cursor: pointer;
  list-style: none;
  padding: 13px 16px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

.source-details summary::-webkit-details-marker {
  display: none;
}

.code-wrap {
  background: var(--code-bg);
  color: var(--code-text);
}

.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-head span {
  font-size: 0.92rem;
}

.code-head .copy-button {
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.22);
}

.code-wrap pre {
  padding: 16px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.tutorial-image {
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  overflow: hidden;
  background: #fff;
}

.thumb-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 18px;
}

.thumb-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 0;
  overflow: hidden;
}

.thumb-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.thumb-card span {
  display: block;
  padding: 10px 12px;
  font-size: 0.92rem;
}

.filter-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.filter-controls {
  display: grid;
  gap: 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-strong);
}

.results-count,
.card-track,
.card-link {
  margin: 0;
  font-size: 0.92rem;
}

.results-count,
.card-track {
  color: var(--muted);
}

.gallery-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.project-card h3 a {
  color: inherit;
  text-decoration: none;
}

.project-card h3 a:hover,
.card-link a:hover {
  text-decoration: underline;
}

.card-link {
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

.empty-state {
  padding: 16px;
  border: 1px dashed var(--line-dark);
  border-radius: var(--radius-small);
  background: var(--surface-muted);
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}

.data-table thead th {
  background: var(--surface-muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 24px;
  padding: 24px 0;
}

.footer-grid h2,
.footer-grid h3 {
  margin: 0 0 10px;
}

.footer-grid p {
  margin: 0;
  color: var(--muted);
}

.footer-links {
  margin: 0;
  padding-left: 18px;
}

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

.footer-bottom {
  padding: 14px 0 24px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  .content-grid,
  .hero-grid,
  .footer-grid,
  .split-box {
    grid-template-columns: 1fr;
  }

  .side-card,
  .side-card:nth-child(2),
  .side-card:nth-child(3) {
    position: static;
  }

  .side-card nav {
    max-height: none;
  }
}

@media (max-width: 860px) {
  .header-inner {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: inline-block;
  }

  .main-nav {
    display: none;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

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

  .search-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .wrap {
    width: min(var(--content-width), calc(100% - 20px));
  }

  .content-section,
  .hero-box {
    padding: 18px;
  }

  .code-wrap pre {
    font-size: 0.86rem;
  }

  .timeline-item {
    grid-template-columns: 34px 1fr;
  }

  .timeline-item span {
    width: 34px;
    height: 34px;
  }
}

/* IKT page tune */
.hero-copy code {
  white-space: nowrap;
}


.jump-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.jump-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  padding: 14px;
}

.jump-link strong {
  display: block;
  margin-bottom: 4px;
}

.jump-link span {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
}

.jump-link:hover {
  background: var(--surface-muted);
}

.tutorial-section + .tutorial-section {
  scroll-margin-top: 155px;
}

.data-table td,
.data-table th {
  vertical-align: top;
}

:root {
  color-scheme: light;
  --hero-bg: #eef2f6;
  --surface-strong: #ffffff;
  --surface-subtle: #fbfcfd;
  --note-tip-bg: #f7f9fc;
  --search-surface: #ffffff;
  --shadow-strong: 0 12px 28px rgba(15, 23, 32, 0.08);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f141b;
  --surface: #151d26;
  --surface-muted: #1b2631;
  --surface-strong: #1a2430;
  --surface-subtle: #111923;
  --search-surface: #18212b;
  --text: #e7edf5;
  --muted: #a7b5c5;
  --line: #2a3745;
  --line-dark: #3a4a5d;
  --accent: #8eb8ff;
  --accent-soft: rgba(142, 184, 255, 0.16);
  --accent-strong: #c7ddff;
  --hero-bg: #101923;
  --code-bg: #0a1118;
  --code-text: #eef4fb;
  --success: #7fd58f;
  --warning: #f0c36d;
  --danger: #f29494;
  --note-tip-bg: #101923;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-strong: 0 18px 38px rgba(0, 0, 0, 0.28);
}

body,
.site-header,
.site-footer,
.hero,
.hero-box,
.side-card,
.content-section,
.info-card,
.link-panel,
.project-card,
.thumb-card,
.site-search-input,
.library-search,
.search-submit,
.copy-button,
.filter-chip,
button,
.site-search-results,
.search-result,
.search-empty,
.jump-link,
.meta-chip,
.split-box,
.note,
.source-details,
.source-details summary,
.empty-state,
.data-table th,
.data-table td,
.brand-mark,
.theme-toggle,
.theme-toggle-track,
.theme-toggle-thumb {
  transition: background-color 220ms ease, color 220ms ease, border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease;
}

body {
  min-height: 100vh;
}

.site-header {
  background: var(--surface-strong);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.hero {
  background: var(--hero-bg);
}

.hero-box,
.side-card,
.content-section,
.source-details,
.tutorial-image,
.site-footer,
.site-search-results,
.site-search-input,
.library-search,
.search-submit,
.copy-button,
.filter-chip,
button,
.jump-link,
.data-table thead th {
  background: var(--surface-strong);
}

.site-search-input,
.library-search,
input,
textarea,
select,
.search-submit,
.copy-button,
.filter-chip,
button,
.site-search-results,
.source-details,
.jump-link,
.data-table th,
.data-table td {
  color: var(--text);
}

.site-search-input,
.library-search,
input,
textarea,
select {
  background: var(--search-surface);
}

.hero-box,
.side-card,
.content-section,
.info-card,
.link-panel,
.project-card,
.thumb-card,
.jump-link,
.source-details,
.tutorial-image,
.site-search-results {
  box-shadow: var(--shadow);
}

.info-card,
.link-panel,
.project-card,
.thumb-card,
.meta-chip,
.note,
.empty-state {
  background: var(--surface);
}

.split-box {
  background: var(--surface-subtle);
}

.note-tip {
  background: var(--note-tip-bg);
}

.note-warn {
  background: var(--surface);
  border-color: #8a5b00;
}

html[data-theme="dark"] .note-warn {
  background: #2b2416;
  border-color: #c99a47;
}

.search-result:hover,
.link-panel:hover,
.search-submit:hover,
.copy-button:hover,
.filter-chip:hover,
button:hover,
.jump-link:hover,
.side-card nav a:hover,
.plain-link-list a:hover,
.main-nav a:hover,
.main-nav a.active,
.filter-chip.active {
  background: var(--accent-soft);
}

.data-table thead th,
.source-details summary,
.timeline-item span {
  background: var(--surface-muted);
}

.theme-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  box-shadow: var(--shadow-strong);
}

.theme-toggle-track {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line-dark);
  background: var(--surface-muted);
  flex-shrink: 0;
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
}

.theme-toggle-text {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(24px);
}

html[data-theme="dark"] .theme-toggle-track {
  background: #233448;
}

html[data-theme="dark"] .brand-mark {
  background: linear-gradient(135deg, var(--accent), #5e94eb);
  color: #0d1520;
}

html[data-theme="dark"] .hero-copy code,
html[data-theme="dark"] .breadcrumbs a,
html[data-theme="dark"] a {
  color: var(--accent);
}

html[data-theme="dark"] .main-nav a,
html[data-theme="dark"] .side-card nav a,
html[data-theme="dark"] .plain-link-list a,
html[data-theme="dark"] .project-card h3 a {
  color: var(--text);
}

@media (max-width: 860px) {
  .theme-toggle {
    order: 3;
    margin-left: 0;
  }

  .main-nav {
    order: 4;
  }
}

@media (max-width: 560px) {
  .theme-toggle-text {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body,
  .site-header,
  .site-footer,
  .hero,
  .hero-box,
  .side-card,
  .content-section,
  .info-card,
  .link-panel,
  .project-card,
  .thumb-card,
  .site-search-input,
  .library-search,
  .search-submit,
  .copy-button,
  .filter-chip,
  button,
  .site-search-results,
  .search-result,
  .search-empty,
  .jump-link,
  .meta-chip,
  .split-box,
  .note,
  .source-details,
  .source-details summary,
  .empty-state,
  .data-table th,
  .data-table td,
  .brand-mark,
  .theme-toggle,
  .theme-toggle-track,
  .theme-toggle-thumb {
    transition: none;
  }
}
