@font-face {
  font-family: Pretendard;
  src: url("assets/PretendardVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #f6f7f9;
  --surface: #fff;
  --ink: #202733;
  --muted: #626b78;
  --line: #e3e6ec;
  --accent: #405ad6;
  --accent-soft: #edf0ff;
  --radius: 14px;
  --sans: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 var(--sans);
  letter-spacing: -0.02em;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
a,
button,
input,
select,
textarea,
summary {
  touch-action: manipulation;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1 {
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: -0.055em;
  font-weight: 750;
}
h2 {
  font-size: 21px;
  line-height: 1.4;
  letter-spacing: -0.04em;
  font-weight: 700;
}
h3 {
  font-size: 17px;
  line-height: 1.4;
}
small {
  font-size: 12px;
}
p {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
button,
a {
  transition:
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}
::selection {
  background: #dce3ff;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip {
  position: fixed;
  left: 16px;
  top: -100px;
  z-index: 100;
  background: white;
  padding: 12px;
}
.skip:focus {
  top: 12px;
}
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 32px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: relative;
  z-index: 5;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.05em;
}
.brand-icon {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
}
.version-label {
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  padding: 1px 6px;
  margin-left: 4px;
  font-weight: 500;
  letter-spacing: 0;
}
.header-note {
  font-size: 13px;
  color: var(--muted);
}
.account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 13px;
}
.account:hover {
  background: var(--bg);
}
.account img {
  width: 29px;
  height: 29px;
  object-fit: cover;
  border-radius: 50%;
}
.shell {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  height: calc(100dvh - 64px);
}
.character {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 28px 16px 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}
.nav-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 12px 10px;
}
nav {
  display: grid;
  gap: 5px;
}
nav a {
  height: 43px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 550;
  color: #596170;
  font-size: 14px;
}
nav a > span {
  font-size: 20px;
  width: 20px;
  text-align: center;
  font-weight: 400;
}
nav a:hover {
  background: var(--bg);
}
nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: #334cbd;
  font-weight: 700;
  box-shadow: inset 3px 0 #405ad6;
}
.character-content {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.portrait-button {
  display: flex;
  gap: 10px;
  text-align: left;
  align-items: center;
  padding: 8px;
  width: 100%;
  border-radius: 8px;
  margin-bottom: 12px;
}
.portrait-button:hover {
  background: var(--bg);
}
.portrait-button img {
  width: 40px;
  height: 44px;
  object-fit: cover;
  border-radius: 9px;
}
.portrait-button strong {
  display: block;
  font-size: 15px;
}
.portrait-button small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.sect-pill {
  display: inline-block;
  color: white;
  font-size: 11px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 5px;
  margin-left: 8px;
}
.my-art {
  font-size: 12px;
  color: var(--muted);
  margin: 9px 8px 16px;
}
.character .outline-button {
  font-size: 12px;
  width: 100%;
  min-height: 36px;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 22px 8px 0;
  color: var(--muted);
  font-size: 11px;
}
.population-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.population-summary p {
  font-size: 12px;
}
.population-summary strong {
  font-size: 18px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.population-summary small {
  font-size: 11px;
  font-weight: 400;
  margin-left: 4px;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #748581;
  margin-right: 5px;
}
#main {
  min-width: 0;
  overflow: auto;
  outline: none;
}
.content-page {
  padding: 32px 38px 40px;
}
.page-head {
  margin-bottom: 24px;
}
.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: 0;
}
.page-head p {
  color: var(--muted);
  margin-top: 10px;
  font-size: 14px;
}
.primary-button,
.outline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 40px;
  padding: 9px 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}
.primary-button {
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
}
.primary-button:hover {
  background: #3048bd;
}
.outline-button {
  border: 1px solid var(--line);
  background: white;
}
.outline-button:hover {
  background: var(--bg);
  border-color: #b9c1ce;
}
.text-button {
  display: inline-block;
  color: var(--accent);
  font-size: 13px;
  padding: 9px 0;
}
.text-button:hover {
  text-decoration: underline;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.demo-notice {
  background: #f1f3f6;
  border-radius: 7px;
  padding: 10px 13px;
  font-size: 12px;
  color: #586272;
  margin: 16px 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 16px;
}
.section-heading h2 {
  font-size: 20px;
}
.section-heading .eyebrow {
  margin-bottom: 3px;
}
.count-badge {
  font-size: 12px;
  font-weight: 600;
  background: #e9ecf3;
  color: #566174;
  padding: 3px 7px;
  border-radius: 5px;
  margin-left: 5px;
  vertical-align: middle;
}
.faction-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--faction);
  color: white;
  font-size: 22px;
  flex-shrink: 0;
}
.sect-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sect-title small {
  color: var(--muted);
}
.ornament {
  height: 1px;
  background: var(--line);
  font-size: 0;
  margin: 22px 0;
}
.panel-label {
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 12px;
}
.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  padding: 20px;
}
.map-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}
.map-viewport {
  position: relative;
  flex: 1;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eee;
}
.map-canvas {
  position: absolute;
  inset: 0;
  transform-origin: center;
  touch-action: pan-y;
}
.map-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}
.map-heading {
  position: absolute;
  z-index: 2;
  top: 20px;
  left: 22px;
  pointer-events: none;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
}
.map-heading h1 {
  font-size: 26px;
}
.map-heading .eyebrow {
  font-size: 11px;
  margin-bottom: 3px;
}
.map-heading p {
  font-size: 12px;
  color: #59616b;
  margin-top: 5px;
}
.map-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #ced3d6;
  box-shadow: 0 3px 12px #2934411a;
  white-space: nowrap;
  text-align: left;
  min-width: 122px;
}
.map-marker strong {
  display: block;
  font-size: 15px;
  line-height: 1.4;
}
.map-marker small {
  display: block;
  font-size: 12px;
  color: #626b78;
  font-variant-numeric: tabular-nums;
}
.map-marker i {
  font-style: normal;
  margin: 0 3px;
}
.map-marker .faction-mark {
  width: 31px;
  height: 31px;
  border-radius: 8px;
  font-size: 20px;
}
.map-marker.selected {
  outline: 2px solid var(--faction);
  outline-offset: 3px;
}
.map-marker em {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--faction);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  font-style: normal;
}
.map-caption {
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-size: 11px;
  background: #ffffffd9;
  padding: 4px 9px;
  border-radius: 5px;
  color: #545e62;
}
.map-tools {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 2px;
  background: white;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 8px #1c253312;
}
.map-tools button {
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 12px;
}
.map-tools button:hover {
  background: var(--bg);
}
.map-tools output {
  font-size: 11px;
  min-width: 36px;
  text-align: center;
}
.zoomed {
  cursor: grab;
}
.zoomed .map-canvas {
  touch-action: none;
}
.population-bar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 16px 20px;
}
.bar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.bar-heading h2 {
  font-size: 14px;
}
.bar-heading > span {
  font-size: 11px;
  color: var(--muted);
}
.segments {
  height: 7px;
  display: flex;
  gap: 3px;
  overflow: hidden;
  border-radius: 4px;
}
.segments button {
  height: 7px;
  padding: 0;
}
.population-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}
.population-labels button {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.population-labels button > span {
  color: var(--faction);
  font-size: 18px;
}
.population-labels strong {
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
}
.detail-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  overflow: auto;
}
.sect-landscape {
  height: 110px;
  background: url("assets/jianghu-map-light-v1.webp");
  background-size: 280%;
  border-radius: 9px;
  margin-bottom: 18px;
}
.sect-title h2 {
  font-size: 24px;
}
.motto {
  font-size: 13px;
  margin-top: 13px;
  color: var(--muted);
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.stats span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.stats strong {
  font-size: 27px;
  letter-spacing: -0.045em;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.stats small {
  font-size: 12px;
  margin-left: 3px;
  font-weight: 400;
}
.representative > span {
  font-size: 11px;
  color: var(--muted);
}
.representative > a {
  display: flex;
  justify-content: space-between;
  font-weight: 650;
  font-size: 15px;
  margin: 4px 0 16px;
}
.detail-panel > .primary-button {
  width: 100%;
}
.news-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.news-heading h3 {
  font-size: 13px;
}
.news-heading a {
  font-size: 11px;
  color: var(--muted);
}
.news-row {
  width: 100%;
  text-align: left;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.news-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-row small {
  font-size: 10px;
  color: var(--muted);
}
.detail-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 20px;
}
.other-sect-note {
  font-size: 13px;
  color: var(--muted);
}
.board-banner {
  border-radius: var(--radius);
  padding: 25px 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  background:
    linear-gradient(90deg, #fffffffa 30%, #ffffff30),
    url("assets/jianghu-map-light-v1.webp");
  background-size: cover;
  border: 1px solid var(--line);
  min-height: 142px;
}
.board-banner .faction-mark {
  width: 50px;
  height: 50px;
  font-size: 30px;
  border-radius: 14px;
}
.board-banner p {
  font-size: 12px;
  color: var(--muted);
}
.board-banner h1 {
  font-size: 28px;
  margin: 2px 0 4px;
}
.board-banner span:not(.faction-mark) {
  font-size: 13px;
  color: #53606a;
}
.board-banner > a {
  margin-left: auto;
  background: white;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 12px;
  border: 1px solid var(--line);
}
.board-body {
  margin-top: 24px;
}
.board-toolbar,
.art-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 20px 0 12px;
}
.filters {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.filters button {
  padding: 8px 13px;
  font-size: 13px;
  border-radius: 7px;
  color: var(--muted);
  min-height: 38px;
  border: 1px solid transparent;
}
.filters button:hover {
  background: #e9ecf1;
}
.filters button[aria-pressed="true"] {
  background: white;
  border-color: #c5cde4;
  color: #334cbd;
  font-weight: 700;
  box-shadow: 0 1px 3px #1c25330d;
}
.search {
  display: flex;
  align-items: center;
  position: relative;
}
.search input {
  width: 218px;
  min-height: 39px;
  border: 1px solid var(--line);
  padding: 9px 12px;
  background: white;
  border-radius: 8px;
  font-size: 13px;
}
.search > span:not(.sr-only) {
  display: none;
}
input::placeholder,
textarea::placeholder {
  color: #687385;
}
.list-head,
.post-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 50px;
  gap: 16px;
  align-items: center;
}
.list-head {
  padding: 10px 20px;
  font-size: 11px;
  color: var(--muted);
  background: #f0f2f6;
  border-radius: 9px 9px 0 0;
}
.post-row {
  background: white;
  width: 100%;
  text-align: left;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-top: 0;
  font-size: 12px;
  min-height: 74px;
}
.post-row:last-child {
  border-radius: 0 0 9px 9px;
}
.post-row:hover {
  background: #f9faff;
}
.post-row > span:not(:first-child) {
  color: var(--muted);
}
.post-title {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.post-title strong {
  font-size: 14px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-title em {
  font-size: 10px;
  color: var(--muted);
  font-style: normal;
  white-space: nowrap;
}
.category {
  background: #f0f2f7;
  border-radius: 4px;
  padding: 3px 7px;
  white-space: nowrap;
  font-size: 11px;
}
.board-footnote {
  font-size: 12px;
  color: var(--muted);
  padding: 20px 0;
}
.empty {
  grid-column: 1/-1;
  text-align: center;
  background: #fff;
  border: 1px dashed #c8d0dc;
  border-radius: 12px;
  padding: 40px 20px;
}
.empty p {
  color: var(--muted);
  font-size: 13px;
  margin: 9px 0 18px;
}
.learning-intro {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: center;
  background: #eef1fc;
  border: 1px solid #dfe4f5;
  border-radius: var(--radius);
  padding: 20px 26px;
}
.learning-intro h2 {
  font-size: 23px;
  line-height: 1.38;
  letter-spacing: -0.05em;
}
.learning-intro .eyebrow {
  color: #4b5ba0;
  font-size: 11px;
}
.learning-intro p {
  font-size: 13px;
  color: #606b82;
  margin-top: 9px;
}
.learning-intro .primary-button {
  margin-top: 14px;
}
.learning-path {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 330px;
  justify-self: center;
  width: 100%;
}
.learning-path li {
  display: flex;
  gap: 14px;
  align-items: center;
}
.learning-path li > span {
  font-size: 12px;
  font-weight: 650;
  background: #fff;
  border: 1px solid #dbe0f0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #5367af;
}
.learning-path strong {
  font-size: 14px;
  font-weight: 650;
}
.learning-path p {
  font-size: 12px;
  margin-top: 1px;
}
.library > .section-heading {
  margin-top: 28px;
}
.art-toolbar {
  margin-top: 10px;
  flex-wrap: wrap;
}
.art-search-controls {
  display: flex;
  gap: 8px;
}
.art-search-controls select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 10px;
  font-size: 12px;
  min-height: 39px;
}
.result-count {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0 12px;
}
.art-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.art-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 20px;
  position: relative;
}
.art-card:hover {
  border-color: #aab9ea;
  box-shadow: 0 4px 14px #3649790b;
}
.book-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 11px;
  color: var(--muted);
}
.art-sect {
  display: flex;
  align-items: center;
  gap: 7px;
}
.art-sect .faction-mark {
  width: 23px;
  height: 23px;
  border-radius: 6px;
  font-size: 15px;
}
.type-chip {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fafbfc;
  font-size: 11px;
  white-space: nowrap;
}
.art-card h3 {
  font-size: 21px;
  letter-spacing: -0.05em;
  margin-bottom: 8px;
}
.art-principle {
  font-size: 15px;
  font-weight: 550;
  line-height: 1.6;
}
.art-description {
  font-size: 14px;
  color: var(--muted);
  margin: 7px 0 20px;
  line-height: 1.7;
}
.card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  border-top: 1px solid #edf0f4;
  padding-top: 13px;
  font-size: 11px;
  color: var(--muted);
}
.read-link {
  font-size: 12px;
  color: #4058bb;
  font-weight: 600;
  white-space: nowrap;
}
.archive-footnote {
  font-size: 12px;
  color: var(--muted);
  margin-top: 24px;
}
.lesson-breadcrumb {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  margin-bottom: 18px;
  color: var(--muted);
}
.lesson-breadcrumb a {
  color: var(--accent);
  font-weight: 550;
}
.lesson-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 30px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 21px 26px;
  align-items: center;
  border-top: 3px solid var(--faction);
}
.lesson-hero .faction-mark {
  float: left;
  margin-right: 12px;
  margin-top: 1px;
  width: 42px;
  height: 42px;
}
.lesson-hero .eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
}
.lesson-hero h1 {
  font-size: 30px;
}
.lesson-hero > div > p {
  font-size: 16px;
  margin-top: 14px;
  font-weight: 550;
}
.lesson-summary {
  padding: 8px 0 8px 24px;
  border-left: 1px solid var(--line);
}
.lesson-summary > span {
  font-size: 11px;
  color: var(--muted);
}
.lesson-hero .lesson-summary p {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 8px;
}
.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 254px;
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}
.lesson-content {
  display: grid;
  gap: 16px;
}
.lesson-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: white;
}
.step-label {
  font-size: 11px;
  color: #5166ad;
  font-weight: 650;
  display: block;
  margin-bottom: 8px;
}
.lesson-section h2 {
  font-size: 21px;
  margin-bottom: 12px;
}
.lesson-section > p {
  font-size: 14px;
  color: var(--muted);
}
.scene-box {
  border-left: 3px solid #b4c1ea;
  background: #f5f7fd;
  padding: 12px 16px;
  margin-top: 14px;
  border-radius: 0 8px 8px 0;
}
.scene-box > span {
  font-size: 11px;
  color: #566695;
  font-weight: 600;
}
.scene-box p {
  font-size: 14px;
  margin-top: 5px;
}
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.choice-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 17px;
  background: #fafbfd;
}
.choice-label {
  font-size: 11px;
  color: var(--muted);
}
.choice-card h3 {
  margin: 6px 0;
  font-size: 15px;
}
.choice-card p {
  font-size: 13px;
  color: #5d6877;
}
.lesson-aside {
  border: 1px solid var(--line);
  background: white;
  border-radius: 12px;
  padding: 22px;
  position: sticky;
  top: 0;
}
.lesson-aside h3 {
  font-size: 17px;
}
.lesson-aside dl {
  margin: 18px 0;
}
.lesson-aside dt {
  font-size: 11px;
  font-weight: 650;
  color: #4f60a4;
  margin-bottom: 4px;
}
.lesson-aside dd {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
}
.lesson-aside .outline-button {
  width: 100%;
  font-size: 12px;
}
.lesson-aside .text-button {
  font-size: 12px;
  display: block;
  text-align: center;
}
.deep-reading {
  border: 1px solid #dce1ed;
  background: #f0f3fc;
  border-radius: 12px;
}
.deep-reading summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.deep-reading summary::-webkit-details-marker {
  display: none;
}
.deep-reading summary small {
  display: block;
  color: #536497;
  font-size: 11px;
  margin-bottom: 4px;
}
.deep-reading summary strong {
  font-size: 16px;
  font-weight: 650;
}
.deep-reading[open] .expand-icon {
  transform: rotate(45deg);
}
.deep-reading > div {
  padding: 4px 24px 24px;
}
.deep-reading h3 {
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.deep-reading p {
  font-size: 14px;
  color: #596580;
  line-height: 1.8;
}
.deep-reading .reflection {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #d8deee;
}
.world-hero {
  background:
    linear-gradient(90deg, #eef1f5 18%, #f6f8fa20),
    url("assets/jianghu-map-light-v1.webp") center 56% / cover;
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 184px;
  padding: 24px 28px;
}
.world-hero h2 {
  font-size: 26px;
  line-height: 1.4;
  letter-spacing: -0.05em;
}
.world-hero p {
  color: #505e68;
  font-size: 13px;
  margin-top: 12px;
}
.world-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.world-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.world-image {
  height: 120px;
  background-image: url("assets/jianghu-map-light-v1.webp");
  background-size: 270%;
}
.world-copy {
  padding: 22px;
}
.world-copy .sect-title {
  margin-bottom: 12px;
  gap: 10px;
}
.world-copy .sect-title h3 {
  font-size: 21px;
}
.world-copy h4 {
  font-size: 14px;
  margin: 8px 0;
}
.world-copy > p:not(.eyebrow) {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
  margin: 10px 0;
}
.world-copy > a {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--accent);
  font-weight: 550;
}
.glossary {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
}
.glossary h2 {
  font-size: 18px;
}
.glossary dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0 0;
}
.glossary dt {
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 4px;
}
.glossary dd {
  font-size: 13px;
  margin: 0;
  color: var(--muted);
}
dialog {
  width: min(620px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  box-shadow: 0 22px 80px #18233933;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #18223866;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 25px;
  margin: 8px 30px 12px 0;
  line-height: 1.4;
}
dialog h3 {
  margin-bottom: 12px;
}
.dialog-close {
  position: absolute;
  right: 16px;
  top: 14px;
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 7px;
}
.dialog-close:hover {
  background: var(--bg);
}
dialog .muted {
  font-size: 13px;
}
form {
  margin-top: 22px;
}
form > label {
  display: block;
  font-size: 13px;
  font-weight: 550;
  margin: 15px 0;
}
form input:not([type="radio"]),
form select,
form textarea,
#comment-body {
  display: block;
  width: 100%;
  border: 1px solid #cfd6e1;
  border-radius: 8px;
  background: white;
  padding: 11px 12px;
  margin-top: 6px;
  font-size: 14px;
  min-height: 42px;
}
textarea {
  resize: vertical;
  max-height: 45vh;
}
fieldset {
  border: 0;
  margin: 20px 0;
  padding: 0;
}
legend {
  font-size: 13px;
  font-weight: 550;
  margin-bottom: 10px;
}
.profile-sects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.profile-sects label {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 14px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
}
.profile-sects label:has(:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.profile-sects input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}
.profile-sects span {
  color: var(--faction);
  font-size: 20px;
}
.profile-portraits {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.profile-portraits label,
.profile-arts label {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px 8px;
  cursor: pointer;
}
.profile-portraits label {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  font-size: 13px;
}
.profile-portraits img {
  width: 100%;
  max-width: 120px;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 50%;
}
.profile-portraits input,
.profile-arts input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.profile-portraits label:has(:checked),
.profile-arts label:has(:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.profile-portraits label:focus-within,
.profile-arts label:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.profile-arts {
  display: grid;
  gap: 8px;
}
.profile-arts label {
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-arts small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}
.profile-navigation {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.form-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 10px;
}
.form-error {
  font-size: 13px;
  color: #ad293b;
  margin: 10px 0;
  min-height: 0;
}
.form-error:empty {
  display: none;
}
.post-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}
.post-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.85;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.comments {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 24px;
}
.comments h3 {
  font-size: 15px;
}
.comment {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.comment strong {
  font-size: 12px;
}
.comment p {
  font-size: 14px;
  white-space: pre-wrap;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.danger {
  color: #ad293b;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: #273145;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  z-index: 20;
  font-size: 13px;
  transition: 0.2s;
  max-width: 90vw;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.storage-error {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff1dc;
  color: #76461a;
  padding: 12px 24px;
  z-index: 30;
  font-size: 13px;
}
.storage-error[hidden] {
  display: none;
}
@media (min-width: 1600px) {
  .content-page {
    padding-left: max(40px, calc((100% - 1220px) / 2));
    padding-right: max(40px, calc((100% - 1220px) / 2));
  }
  .map-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
  }
}
@media (max-height: 800px) and (min-width: 1101px) {
  .map-layout {
    gap: 16px;
    padding: 16px;
  }
  .detail-panel {
    padding: 16px;
  }
  .sect-landscape {
    height: 75px;
    margin-bottom: 12px;
  }
  .stats {
    padding: 12px 0;
    margin-bottom: 12px;
  }
  .motto {
    font-size: 12px;
  }
  .detail-panel .ornament {
    margin: 16px 0;
  }
  .detail-note {
    margin-top: 12px;
  }
  .character {
    padding-top: 20px;
  }
  .character-content {
    margin-top: 22px;
    padding-top: 20px;
  }
}
@media (max-width: 1200px) {
  .shell {
    grid-template-columns: 184px minmax(0, 1fr);
  }
  .content-page {
    padding: 26px;
  }
  .map-layout {
    grid-template-columns: minmax(0, 1fr) 244px;
    gap: 14px;
    padding: 16px;
  }
  .detail-panel {
    padding: 16px;
  }
  .map-caption {
    display: none;
  }
  .art-grid {
    gap: 12px;
  }
  .art-card {
    padding: 16px;
  }
  .card-footer {
    flex-wrap: wrap;
    gap: 5px;
  }
  .learning-intro {
    padding: 24px;
  }
  .lesson-layout {
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 18px;
  }
  .post-title em {
    display: none;
  }
}
@media (max-width: 1100px) {
  .map-layout {
    grid-template-columns: 1fr;
    display: block;
  }
  .map-column {
    height: 610px;
  }
  .detail-panel {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 24px;
  }
  .detail-panel .sect-landscape {
    grid-row: 2/5;
    height: 150px;
    margin: 0;
  }
  .detail-panel .panel-label {
    grid-column: 1/-1;
    margin: 0;
  }
  .detail-panel .stats {
    margin: 0;
    padding: 0;
  }
  .detail-panel .ornament {
    display: none;
  }
  .detail-panel .detail-note {
    grid-column: 1/-1;
    margin: 0;
  }
  .detail-panel .motto {
    margin: 0;
  }
  .art-toolbar {
    align-items: start;
  }
  .world-copy {
    padding: 16px;
  }
  .world-copy > p {
    font-size: 12px;
  }
  .lesson-layout {
    grid-template-columns: 1fr;
  }
  .lesson-aside {
    position: static;
    display: block;
  }
  .lesson-aside dl {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px;
  }
  .lesson-aside dd {
    margin: 0;
  }
  .lesson-aside .outline-button {
    width: auto;
  }
  .lesson-aside .text-button {
    display: inline-block;
    margin-left: 16px;
  }
  .art-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  body {
    font-size: 14px;
  }
  .topbar {
    height: 58px;
    padding: 0 16px;
    gap: 12px;
  }
  .brand {
    font-size: 19px;
  }
  .brand-icon {
    width: 27px;
    height: 27px;
    font-size: 20px;
  }
  .version-label {
    display: none;
  }
  .header-note {
    display: none;
  }
  .shell {
    display: block;
    height: auto;
  }
  .character {
    padding: 8px 12px;
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 4;
    overflow: visible;
  }
  .character > .nav-label,
  .character-content,
  .sidebar-bottom {
    display: none;
  }
  nav {
    display: flex;
    gap: 5px;
    justify-content: space-between;
  }
  nav a {
    font-size: 12px;
    padding: 0 9px;
    height: 40px;
    gap: 6px;
    justify-content: center;
    flex: 1;
    white-space: nowrap;
  }
  nav a > span {
    font-size: 17px;
    width: auto;
  }
  nav a[aria-current="page"] {
    box-shadow: inset 0 -2px var(--accent);
  }
  #main {
    overflow: visible;
  }
  .content-page {
    padding: 24px 18px 36px;
  }
  h1 {
    font-size: 28px;
  }
  .page-head {
    margin-bottom: 20px;
  }
  .page-head p {
    font-size: 13px;
    line-height: 1.7;
  }
  .map-layout {
    padding: 14px;
  }
  .map-column {
    height: 570px;
    gap: 12px;
  }
  .map-viewport {
    min-height: 400px;
  }
  .map-heading {
    left: 12px;
    top: 12px;
    padding: 10px 12px;
  }
  .map-heading h1 {
    font-size: 23px;
  }
  .map-heading p {
    font-size: 11px;
  }
  .map-marker {
    padding: 7px 9px;
    gap: 6px;
    min-width: 105px;
  }
  .map-marker strong {
    font-size: 13px;
  }
  .map-marker small {
    font-size: 10px;
  }
  .map-marker .faction-mark {
    width: 25px;
    height: 25px;
    font-size: 17px;
  }
  .map-marker[data-select="hwa"] {
    left: 24% !important;
    top: 39% !important;
  }
  .map-marker[data-select="sha"] {
    left: 75% !important;
    top: 43% !important;
  }
  .map-marker[data-select="wu"] {
    top: 73% !important;
  }
  .population-bar {
    padding: 14px;
  }
  .population-labels button {
    padding: 0;
    font-size: 11px;
    gap: 4px;
  }
  .population-labels strong {
    margin-left: 2px;
  }
  .bar-heading h2 {
    font-size: 13px;
  }
  .bar-heading > span {
    font-size: 10px;
  }
  .detail-panel {
    gap: 12px 16px;
    padding: 18px;
  }
  .detail-panel .sect-landscape {
    height: 135px;
  }
  .detail-panel .sect-title {
    gap: 8px;
  }
  .sect-title h2 {
    font-size: 20px;
  }
  .stats strong {
    font-size: 24px;
  }
  .detail-panel > .primary-button {
    font-size: 12px;
  }
  .detail-panel .representative {
    margin: 0;
  }
  .representative > a {
    font-size: 14px;
    margin-bottom: 0;
  }
  .news-heading {
    grid-column: 1/-1;
    margin: 6px 0 0;
  }
  .news-row {
    grid-column: 1/-1;
  }
  .learning-intro {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 22px;
  }
  .learning-intro h2 {
    font-size: 24px;
  }
  .learning-path {
    max-width: none;
    justify-self: start;
    gap: 12px;
    border-top: 1px solid #d9e0f3;
    padding-top: 20px;
  }
  .learning-path li > span {
    width: 29px;
    height: 29px;
    font-size: 11px;
  }
  .learning-path p {
    font-size: 12px;
  }
  .learning-path strong {
    font-size: 13px;
  }
  .section-heading h2 {
    font-size: 19px;
  }
  .art-grid {
    grid-template-columns: 1fr;
  }
  .art-card {
    padding: 20px;
  }
  .book-top {
    margin-bottom: 16px;
  }
  .card-footer {
    flex-wrap: nowrap;
  }
  .art-toolbar {
    gap: 12px;
  }
  .filters {
    gap: 2px;
  }
  .filters button {
    padding: 7px 11px;
    font-size: 12px;
  }
  .art-search-controls {
    width: 100%;
  }
  .art-search-controls .search {
    flex: 1;
    min-width: 0;
  }
  .art-search-controls .search input {
    width: 100%;
    min-width: 0;
  }
  .board-banner {
    padding: 20px;
    gap: 12px;
    min-height: 130px;
  }
  .board-banner > a {
    display: none;
  }
  .board-banner h1 {
    font-size: 24px;
  }
  .board-banner .faction-mark {
    width: 40px;
    height: 40px;
    font-size: 25px;
  }
  .board-banner span:not(.faction-mark) {
    font-size: 12px;
  }
  .board-toolbar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .board-toolbar .search,
  .board-toolbar .search input {
    width: 100%;
  }
  .board-body .section-heading {
    gap: 10px;
  }
  .board-body .section-heading .eyebrow {
    font-size: 11px;
  }
  .board-body .primary-button {
    font-size: 12px;
    min-height: 38px;
    padding: 8px 12px;
  }
  .list-head,
  .post-row {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 8px;
    padding: 14px 12px;
  }
  .list-head > span:nth-child(2),
  .post-row > span:nth-child(2) {
    display: none;
  }
  .post-title {
    gap: 8px;
    flex-wrap: wrap;
  }
  .post-title strong {
    font-size: 13px;
    white-space: normal;
    line-height: 1.6;
    flex: 1;
    min-width: 160px;
  }
  .list-head {
    font-size: 11px;
  }
  .world-hero {
    min-height: 220px;
    padding: 24px;
  }
  .world-hero h2 {
    font-size: 25px;
  }
  .world-hero p {
    font-size: 12px;
  }
  .world-cards {
    grid-template-columns: 1fr;
  }
  .world-image {
    height: 150px;
  }
  .world-copy {
    padding: 22px;
  }
  .world-copy > p:not(.eyebrow) {
    font-size: 14px;
  }
  .glossary dl {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .lesson-hero {
    grid-template-columns: 1fr;
    padding: 22px;
    gap: 20px;
  }
  .lesson-summary {
    padding: 16px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .lesson-hero h1 {
    font-size: 27px;
  }
  .lesson-hero > div > p {
    font-size: 15px;
  }
  .lesson-section {
    padding: 20px;
  }
  .lesson-section h2 {
    font-size: 19px;
  }
  .choice-grid {
    grid-template-columns: 1fr;
  }
  .deep-reading summary {
    padding: 18px;
  }
  .deep-reading summary strong {
    font-size: 15px;
  }
  .deep-reading > div {
    padding: 4px 18px 20px;
  }
  .lesson-aside .text-button {
    display: block;
    margin: 8px 0 0;
    text-align: left;
  }
  .lesson-breadcrumb {
    font-size: 12px;
  }
  .toast {
    width: max-content;
    text-align: center;
  }
  dialog {
    padding: 25px 20px;
    max-height: calc(100dvh - 32px);
  }
  dialog h2 {
    font-size: 22px;
  }
  .profile-sects {
    gap: 6px;
  }
  .profile-sects label {
    padding: 12px 7px;
    gap: 5px;
    font-size: 12px;
  }
  .profile-sects span {
    display: none;
  }
  .account {
    padding: 4px 0;
  }
  .account img {
    width: 26px;
    height: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

.world-story {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 12px;
  font-size: 13px;
}
.world-story summary {
  cursor: pointer;
  font-weight: 550;
  color: #53607a;
}
.world-story p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.world-copy > a {
  display: block;
  margin-top: 16px;
}
.world-copy .eyebrow {
  font-size: 12px;
}
/* Keep the mobile catalog close to the introductory reading path. */
@media (max-width: 760px) {
  .learning-path {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    padding-top: 16px;
  }
  .learning-path li {
    display: block;
  }
  .learning-path li > span {
    margin-bottom: 7px;
  }
  .learning-path strong {
    font-size: 12px;
    line-height: 1.6;
    display: block;
  }
  .learning-path p {
    display: none;
  }
  .learning-intro {
    gap: 18px;
  }
  .art-description {
    font-size: 14px;
  }
}
[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  .topbar {
    gap: 8px;
    flex-wrap: wrap;
    height: auto;
    min-height: 58px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .topbar .text-button {
    font-size: 11px;
    padding: 5px;
  }
  .topbar #import-local {
    order: 4;
    width: 100%;
    text-align: left;
  }
  .topbar .brand {
    margin-right: auto;
  }
  .topbar .account {
    margin-left: 0;
  }
}
