﻿
:root {
  --bg: #ffffff;
  --card: #ffffff;
  --summary: #f3f1ec;
  --condition: #f1f1f1;
  --report: #f3f1ec;
  --link: #0645ad;
  --ink: #26221b;
  --muted: #6f675b;
  --line: #d9cfbd;
  --sidebar: #ece5d6;
  --shadow: 0 1px 6px rgba(58, 47, 31, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", "Noto Serif KR", serif;
  line-height: 1.5;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
  padding: 18px 12px 28px;
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
}

.sidebar-title {
  margin: 0 0 14px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.sidebar-title a {
  color: #40382f;
}

.mission-group {
  margin: 3px 0;
}

.mission-group summary {
  cursor: pointer;
  padding: 5px 8px;
  border-radius: 3px;
  color: #40382f;
  font-size: 14px;
  font-weight: 650;
}

.mission-group summary:hover {
  background: rgba(255, 255, 255, 0.55);
}

.mission-group ol {
  margin: 2px 0 8px;
  padding: 0;
  list-style: none;
}

.mission-group a {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 5px;
  align-items: start;
  padding: 4px 8px 4px 20px;
  border-radius: 3px;
  color: #3a332b;
  font-size: 13px;
  line-height: 1.35;
}

.mission-group a:hover,
.mission-group a.current {
  background: #dce9f7;
  text-decoration: none;
}

.sidebar-section {
  margin: 12px 0 16px;
}

.sidebar-section h2 {
  margin: 0 0 6px;
  padding: 0 8px;
  color: #5b5247;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.sidebar-folder-list {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-folder-list a {
  display: block;
  padding: 5px 8px 5px 18px;
  border-radius: 3px;
  color: #3a332b;
  font-size: 13px;
  line-height: 1.35;
}

.sidebar-folder-list a:hover,
.sidebar-folder-list a.current {
  background: #dce9f7;
  text-decoration: none;
}

.sidebar-separator {
  height: 1px;
  margin: 8px 6px;
  background: rgba(116, 101, 79, 0.24);
}

.mission-id {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.content {
  min-width: 0;
  padding: 24px 30px 44px;
}

.mission-article {
  max-width: 880px;
  margin: 0 auto;
}

.mission-header h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.japanese-title {
  margin: 6px 0 12px;
  color: #4d453c;
  font-size: 16px;
}

.original {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 14px;
}

.rule {
  margin: 18px 0;
  border-top: 1px solid var(--line);
}

.site-intro {
  margin: 0 0 22px;
  padding: 12px 14px;
  border-left: 4px solid #8a6a43;
  background: #f7f1e7;
}

.site-intro h2 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.25;
}

.site-intro p {
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.site-footer {
  max-width: 880px;
  margin: 34px auto 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 12px;
}

.site-search {
  margin: 0 0 24px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.site-search h2 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.25;
}

.search-form {
  display: grid;
  gap: 6px;
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
}

.search-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-form input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.search-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 13px;
}

.search-results {
  display: grid;
  gap: 0;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.search-results a {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.search-results small {
  color: var(--muted);
  font-size: 13px;
}

.sidebar .site-search {
  margin: 0 0 14px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.sidebar .site-search h2 {
  margin-bottom: 6px;
  color: #5b5247;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar .search-form label {
  font-size: 12px;
}

.sidebar .search-form input {
  padding: 6px 8px;
  font-size: 13px;
}

.sidebar .search-status {
  font-size: 12px;
}

.sidebar .search-results {
  max-height: 260px;
  overflow: auto;
}

.sidebar .search-results a {
  padding: 7px 0;
}

.sidebar .search-results strong {
  font-size: 13px;
  line-height: 1.3;
}

.sidebar .search-results small {
  font-size: 12px;
  line-height: 1.3;
}

.page-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 12px 0 16px;
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
}

.page-nav div:last-child {
  text-align: right;
}

.page-nav a,
.nav-disabled {
  display: inline-block;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 14px;
}

.nav-disabled {
  color: #9b9386;
}

.script-entries {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.conditional-block {
  background: #f7f1e7;
  border: 1px solid #dfd0bb;
  border-left: 3px solid #c8b79f;
  padding: 8px 10px;
}

.conditional-block summary {
  display: inline-block;
  cursor: pointer;
  color: var(--link);
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.5;
}

.conditional-block summary:hover {
  text-decoration: underline;
}

.conditional-content {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.choice-card,
.unknown-entry {
  border: 1px solid rgba(116, 101, 79, 0.18);
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.mission-summary,
.condition-card,
.report-card {
  border: 0;
  border-left: 4px solid #8a6a43;
  border-radius: 0;
  box-shadow: none;
}

.mission-summary {
  background: var(--summary);
  padding: 10px 12px;
}

.condition-card {
  background: var(--condition);
  padding: 9px 12px;
}

.report-card {
  background: var(--report);
  padding: 9px 12px;
}

.dialogue-card {
  display: flex;
  gap: 6px;
  align-items: baseline;
  background: transparent;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.choice-card {
  background: #fbfaf6;
  padding: 10px 12px;
}

.card-label {
  margin-bottom: 4px;
  color: #5b5247;
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.speaker {
  flex: 0 0 auto;
  margin-bottom: 0;
  color: var(--link);
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  font-weight: 700;
}

.speaker::after {
  content: ":";
  color: #4f463a;
}

.dialogue-body {
  min-width: 0;
}

.dialogue-body p,
.mission-summary p,
.condition-card p,
.report-card p,
.unknown-entry p,
.choice-card h2,
.narration span,
.location-box span {
  white-space: pre-wrap;
}

.dialogue-body p,
.mission-summary p,
.condition-card p,
.report-card p,
.unknown-entry p {
  margin: 0;
}

.narration {
  margin: 4px 0;
  color: #564d42;
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  font-style: italic;
  text-align: center;
}

.location-box {
  justify-self: stretch;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: #443c33;
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 17px;
  font-weight: 650;
  text-align: center;
}

.choice-card h2 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.4;
}

.choice-card ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.choice-card li::before {
  content: "□";
  margin-right: 8px;
  color: #5e564c;
}

.scene-break {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
}

.image-entry {
  margin: 0;
}

.image-entry img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.image-entry figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 13px;
}

.image-omitted {
  margin: 0;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 14px;
  text-align: center;
}

[data-tippy-content] {
  border-bottom: 1px dotted rgba(46, 111, 184, 0.55);
  cursor: help;
}

.index-list {
  display: grid;
  gap: 22px;
}

.index-list h2,
.folder-index h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.index-section ul {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.index-section a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.index-section span {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  font-size: 13px;
}

.index-list ol,
.folder-index ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 22px;
}

.folder-index ol {
  padding-left: 0;
  list-style: none;
}

.folder-index a {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.folder-index small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: 45vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .content {
    padding: 24px 16px 42px;
  }

  .mission-header h1 {
    font-size: 28px;
  }

  .japanese-title {
    font-size: 17px;
  }

  .page-nav {
    grid-template-columns: 1fr;
  }

  .page-nav div,
  .page-nav div:last-child,
  .list-link {
    text-align: center;
  }
}
