@charset "UTF-8";

:root {
  --ink: #1d2a27;
  --ink-soft: #5f6c66;
  --forest: #173f38;
  --forest-2: #24584d;
  --paper: #fbfaf6;
  --canvas: #eeece5;
  --line: #dcded5;
  --line-dark: #bdc4b9;
  --accent: #b45d40;
  --gold: #b89a5b;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, serif;
  --sans: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --shadow: 0 16px 45px rgba(32, 43, 37, .07);
  --topbar: 72px;
  --sidebar: 284px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
::selection { background: #d7e2d8; color: #102f2a; }

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 26px;
  background: rgba(251, 250, 246, .95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  flex: 0 0 auto;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #f7f2e8;
  background: var(--forest);
  border-radius: 4px 12px 4px 4px;
  font: 700 20px var(--serif);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.brand strong { display: block; font: 700 18px var(--serif); letter-spacing: .12em; }
.brand small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 8px; letter-spacing: .21em; }
.topbar-rule { width: 1px; height: 26px; background: var(--line); }
.save-state { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.save-dot { width: 6px; height: 6px; border-radius: 50%; background: #739583; }
.save-state.saving .save-dot { background: var(--gold); animation: pulse 1s infinite; }
.save-state.error .save-dot { background: #a33d35; }
@keyframes pulse { 50% { opacity: .35; } }
.actions { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.tool-button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  transition: background .18s, color .18s, border-color .18s;
}
.tool-button { padding: 0 12px; color: #52615a; font-size: 12px; }
.tool-button svg { width: 17px; height: 17px; }
.tool-button:hover, .icon-button:hover { background: #ecefe8; color: var(--forest); }
.tool-button.primary { color: #fff; background: var(--forest); border-color: var(--forest); }
.tool-button.primary:hover { background: var(--forest-2); }
.tool-button.primary[aria-pressed="true"] { color: var(--forest); background: #e2ebe3; border-color: #9fb3a4; }
.icon-button { width: 38px; padding: 0; }
.icon-button svg { width: 19px; height: 19px; }
.mobile-menu { display: none; }

.app-shell { min-height: 100vh; padding-top: var(--topbar); }
.sidebar {
  position: fixed;
  top: var(--topbar);
  bottom: 0;
  left: 0;
  z-index: 35;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 26px 18px 22px;
  overflow-y: auto;
  color: #e8ece5;
  background:
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 22px 0 / 42px 100%,
    var(--forest);
  box-shadow: 8px 0 28px rgba(20, 47, 41, .09);
  scrollbar-width: thin;
  scrollbar-color: #52736a transparent;
}
.sidebar::after {
  content: "";
  position: fixed;
  top: var(--topbar);
  bottom: 0;
  left: 13px;
  width: 1px;
  pointer-events: none;
  background: rgba(255,255,255,.08);
}
.sidebar-heading { display: flex; justify-content: space-between; padding: 0 10px; color: #a9beb4; font-size: 9px; letter-spacing: .2em; }
.sidebar-heading span:last-child { font-size: 11px; letter-spacing: 0; }
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  margin: 19px 5px 14px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 6px;
  background: rgba(255,255,255,.055);
}
.search-box:focus-within { border-color: rgba(255,255,255,.38); background: rgba(255,255,255,.09); }
.search-box svg { width: 16px; height: 16px; color: #a9beb4; }
.search-box input { width: 100%; min-width: 0; padding: 0; color: #f5f6f2; border: 0; outline: 0; background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #9db2a9; }
kbd { padding: 2px 5px; border: 1px solid currentColor; border-radius: 4px; opacity: .55; font: 10px var(--sans); }
.search-box kbd { color: #b8c7c0; }
.search-results { margin: -5px 5px 14px; padding: 6px; border: 1px solid rgba(255,255,255,.16); border-radius: 7px; background: #204b42; box-shadow: 0 12px 25px rgba(0,0,0,.16); }
.search-result { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 8px; color: #eef3ec; border: 0; border-radius: 4px; background: none; text-align: left; }
.search-result:hover, .search-result:focus { background: rgba(255,255,255,.09); }
.search-result b { flex: 0 0 25px; color: #d9bd7e; font: 20px var(--serif); }
.search-result span { min-width: 0; }
.search-result strong, .search-result small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result strong { font-size: 12px; font-weight: 500; }
.search-result small { margin-top: 3px; color: #a9beb4; font-size: 10px; }
.search-empty { margin: 0; padding: 15px 9px; color: #b7c6bf; font-size: 12px; text-align: center; }
.binder-label { display: flex; align-items: center; justify-content: space-between; margin: 5px 9px 10px; color: #a9beb4; font-size: 10px; }
.binder-label small { letter-spacing: .18em; }
.letter-nav { display: flex; flex-direction: column; gap: 3px; }
.letter-tab {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 45px;
  padding: 5px 10px 5px 7px;
  color: #c4d1ca;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  transition: background .15s, color .15s;
}
.letter-tab:hover { color: #fff; background: rgba(255,255,255,.06); }
.letter-tab.active { color: #173f38; background: #f0eee5; box-shadow: 0 5px 16px rgba(0,0,0,.12); }
.letter-tab.active::before { content: ""; position: absolute; left: -18px; width: 3px; height: 24px; background: #d1b370; }
.letter-symbol { font: 24px var(--serif); text-align: center; }
.letter-tab.active .letter-symbol { color: var(--forest); }
.letter-copy { min-width: 0; }
.letter-copy strong, .letter-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.letter-copy strong { font: 500 12px var(--serif); }
.letter-copy small { margin-top: 3px; color: #819d91; font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.letter-tab.active .letter-copy small { color: #7a867e; }
.letter-state { width: 5px; height: 5px; border-radius: 50%; background: #66867a; }
.letter-state.completed { background: #d1b370; }
.letter-state.planned { background: #d68868; }
.letter-tab.active .letter-state.completed { background: #6d8f7d; }
.sidebar-foot { margin: auto 12px 0; padding-top: 34px; color: #9fb4aa; }
.mini-route { display: flex; align-items: center; width: 120px; margin-bottom: 15px; }
.mini-route span { width: 7px; height: 7px; border: 1px solid #b9c9c0; border-radius: 50%; }
.mini-route i { flex: 1; height: 1px; background: #66867a; }
.sidebar-foot p { margin: 0 0 9px; font: 14px/1.8 var(--serif); }
.sidebar-foot small { font-size: 9px; letter-spacing: .15em; }

.main {
  min-width: 0;
  min-height: calc(100vh - var(--topbar));
  margin-left: var(--sidebar);
  outline: none;
  background:
    radial-gradient(circle at 90% 4%, rgba(179, 153, 96, .08), transparent 27%),
    var(--canvas);
}
#content { max-width: 1180px; margin: 0 auto; padding: 46px 50px 30px; }
.page-footer { display: flex; justify-content: space-between; gap: 20px; max-width: 1080px; margin: 28px auto 0; padding: 22px 0 32px; color: #7a847e; border-top: 1px solid #d5d7d0; font-size: 9px; letter-spacing: .1em; }
.page-footer span:first-child { letter-spacing: .18em; }

.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 9px; font-weight: 600; letter-spacing: .23em; text-transform: uppercase; }
.overview-intro { position: relative; padding: 22px 0 38px; overflow: hidden; }
.overview-intro::after { content: "α"; position: absolute; right: 4%; top: -60px; color: rgba(23,63,56,.055); font: 250px/1 var(--serif); pointer-events: none; }
.overview-intro h1 { position: relative; max-width: 700px; margin: 0; font: 700 clamp(34px, 4.2vw, 54px)/1.35 var(--serif); letter-spacing: .04em; }
.overview-intro h1 em { color: var(--forest); font-style: normal; }
.overview-intro .intro-text { position: relative; max-width: 640px; margin: 18px 0 0; color: var(--ink-soft); font: 15px/1.95 var(--serif); }
.overview-stats { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; max-width: 760px; margin-top: 30px; background: #ccd2c9; border: 1px solid #ccd2c9; }
.overview-stat { padding: 18px 20px; background: rgba(251,250,246,.8); }
.overview-stat strong { display: block; font: 500 27px var(--serif); }
.overview-stat strong small { margin-left: 3px; color: var(--ink-soft); font: 10px var(--sans); }
.overview-stat span { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 10px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 12px 0 17px; }
.section-heading h2 { margin: 0; font: 600 22px var(--serif); }
.section-heading p { margin: 6px 0 0; color: var(--ink-soft); font-size: 11px; }
.section-heading .text-button { flex: 0 0 auto; }
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.overview-card {
  position: relative;
  min-height: 210px;
  padding: 25px 26px 22px;
  overflow: hidden;
  border: 1px solid #d9dcd3;
  border-radius: 3px;
  background: var(--paper);
  box-shadow: 0 5px 16px rgba(39,49,42,.035);
  text-align: left;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.overview-card:hover { transform: translateY(-3px); border-color: #aebbb0; box-shadow: var(--shadow); }
.overview-card .big-letter { position: absolute; right: 16px; top: -14px; color: rgba(23,63,56,.075); font: 112px var(--serif); }
.card-top { position: relative; display: flex; align-items: center; gap: 9px; color: var(--ink-soft); font-size: 10px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 20px; color: #426151; background: #e5ece4; font-size: 9px; }
.status-badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.status-badge.planned { color: #985239; background: #f3e6df; }
.status-badge.unplanned { color: #727a74; background: #ecece7; }
.overview-card h3 { position: relative; margin: 22px 0 7px; font: 600 20px var(--serif); }
.overview-card .card-english { position: relative; margin: 0; color: #859088; font-size: 9px; letter-spacing: .09em; }
.card-stats { position: relative; display: flex; gap: 19px; margin-top: 24px; color: var(--ink-soft); font-size: 10px; }
.card-stats b { margin-right: 3px; color: var(--ink); font: 500 15px var(--serif); }
.card-open { position: absolute; right: 22px; bottom: 21px; display: grid; place-items: center; width: 30px; height: 30px; color: var(--forest); border: 1px solid #d4dcd3; border-radius: 50%; }
.card-open svg { width: 15px; height: 15px; }
.future-strip { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 7px; margin-top: 15px; }
.future-letter { padding: 13px 4px; color: #6c7871; border: 1px dashed #c7cdc4; background: rgba(251,250,246,.35); text-align: center; }
.future-letter:hover { color: var(--forest); border-style: solid; background: var(--paper); }
.future-letter b { display: block; font: 23px var(--serif); }
.future-letter small { display: block; margin-top: 6px; font-size: 8px; text-transform: uppercase; }
.archive-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; padding: 20px 0 0; border-top: 1px solid #d5d7d0; }
.text-button, .soft-button, .danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #cbd2c8;
  border-radius: 5px;
  background: rgba(251,250,246,.65);
  color: #52615a;
  font-size: 11px;
}
.text-button:hover, .soft-button:hover { color: var(--forest); border-color: #94a99a; background: #f7f8f2; }
.text-button svg, .soft-button svg, .danger-button svg { width: 14px; height: 14px; }
.danger-button { color: #984c3d; border-color: #dec8c0; background: #fbf5f1; }
.danger-button:hover { border-color: #c79687; }

.trip-sheet { position: relative; }
.trip-cover {
  position: relative;
  padding: 34px 38px 31px;
  overflow: hidden;
  border: 1px solid #dbddd4;
  border-top: 4px solid var(--trip-accent, var(--forest));
  border-radius: 3px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.trip-cover::after { content: ""; position: absolute; left: 38px; right: 38px; bottom: 0; height: 1px; background: #e2e3dc; }
.cover-watermark { position: absolute; right: 28px; top: -38px; color: rgba(23,63,56,.055); font: 210px/1 var(--serif); pointer-events: none; }
.cover-meta { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--ink-soft); font-size: 10px; }
.trip-code { color: var(--trip-accent, var(--forest)); font-weight: 600; letter-spacing: .12em; }
.cover-title-row { position: relative; display: flex; align-items: flex-start; gap: 25px; margin-top: 22px; }
.cover-title { flex: 1; min-width: 0; }
.cover-title h1 { margin: 0; font: 700 clamp(28px, 3.5vw, 43px)/1.45 var(--serif); letter-spacing: .025em; }
.cover-english { margin: 8px 0 0; color: #7f8a82; font: 10px var(--sans); letter-spacing: .15em; text-transform: uppercase; }
.cover-stats { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 28px; padding: 20px 0; border-top: 1px solid #e0e2da; border-bottom: 1px solid #e0e2da; }
.cover-stat { padding: 0 20px; border-right: 1px solid #e0e2da; }
.cover-stat:first-child { padding-left: 0; }
.cover-stat:last-child { border-right: 0; }
.cover-stat strong { font: 500 26px var(--serif); }
.cover-stat strong small { margin-left: 3px; color: var(--ink-soft); font: 9px var(--sans); }
.cover-stat > span { display: block; margin-top: 5px; color: #7a867e; font-size: 9px; letter-spacing: .12em; }
.cover-quote { position: relative; max-width: 820px; margin: 25px 0 0; padding-left: 18px; color: #4f5f56; border-left: 2px solid var(--trip-accent, var(--gold)); font: 14px/1.95 var(--serif); }
.cover-summary { position: relative; margin: 17px 0 0; color: #67736c; font: 12px/1.9 var(--sans); }
.trip-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 25px 0 14px; }
.trip-toolbar h2 { margin: 0; font: 600 20px var(--serif); }
.trip-toolbar h2 small { margin-left: 9px; color: #7c8880; font: 10px var(--sans); }
.trip-toolbar-actions { display: flex; gap: 7px; }

.stages { display: flex; flex-direction: column; gap: 15px; }
.stage-card { overflow: hidden; border: 1px solid #d9ddd4; border-radius: 3px; background: var(--paper); box-shadow: 0 5px 16px rgba(39,49,42,.03); scroll-margin-top: 90px; }
.stage-card:target, .stage-card.search-focus { animation: stageFlash 1.8s ease; }
@keyframes stageFlash { 0%, 45% { border-color: #b48a45; box-shadow: 0 0 0 4px rgba(180,138,69,.13); } }
.stage-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 21px 24px; cursor: pointer; list-style: none; }
.stage-summary::-webkit-details-marker { display: none; }
.stage-heading { display: flex; align-items: center; gap: 14px; min-width: 0; }
.stage-roman { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; color: var(--trip-accent, var(--forest)); border: 1px solid #cfd6cd; border-radius: 50%; font: 17px var(--serif); }
.stage-name { min-width: 0; }
.stage-name h3 { margin: 0; font: 600 19px var(--serif); }
.mode-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 6px; color: #77837b; font-size: 10px; }
.mode-badge { display: inline-flex; align-items: center; padding: 3px 7px; color: #346051; border-radius: 3px; background: #e4ede6; }
.mode-badge[data-category="地铁"] { color: #3f5f7d; background: #e6ebf0; }
.mode-badge[data-category="铁路"] { color: #8c503e; background: #f1e6e0; }
.mode-badge[data-category="市郊铁路"], .mode-badge[data-category="市域铁路"] { color: #725879; background: #ece6ee; }
.stage-progress { display: flex; align-items: center; gap: 13px; }
.progress-number { color: var(--trip-accent, var(--forest)); font: 500 22px var(--serif); }
.progress-number small { margin-left: 2px; font: 9px var(--sans); }
.stage-chevron { display: grid; place-items: center; width: 27px; height: 27px; color: #718078; border: 1px solid #d7dcd3; border-radius: 50%; transition: transform .18s; }
.stage-chevron svg { width: 13px; height: 13px; }
details[open] .stage-chevron { transform: rotate(180deg); }
.stage-body { border-top: 1px solid #e1e3dc; }
.stage-metrics { display: flex; flex-wrap: wrap; gap: 0; padding: 14px 24px; background: #f4f3ed; }
.stage-metric { min-width: 120px; padding: 0 25px; border-right: 1px solid #d9ddd4; }
.stage-metric:first-child { padding-left: 0; }
.stage-metric:last-child { border-right: 0; }
.stage-metric span { display: block; color: #7c8880; font-size: 9px; }
.stage-metric strong { display: block; margin-top: 5px; font: 500 15px var(--serif); }
.stage-metric strong small { margin-left: 3px; color: #6f7b74; font: 9px var(--sans); }
.progress-track { height: 2px; background: #e2e5dc; }
.progress-track span { display: block; height: 100%; background: var(--trip-accent, var(--forest)); }
.station-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.station-table th { height: 38px; padding: 0 12px; color: #8a938d; border-bottom: 1px solid #e6e7e1; font-size: 9px; font-weight: 500; letter-spacing: .08em; text-align: left; }
.station-table th:first-child, .station-table td:first-child { width: 64px; padding-left: 25px; }
.station-table th:nth-child(3), .station-table td:nth-child(3) { width: 126px; text-align: right; }
.station-table th:nth-child(4), .station-table td:nth-child(4) { width: 93px; padding-right: 25px; text-align: right; }
.station-row td { position: relative; height: 38px; padding: 8px 12px; border-bottom: 1px solid #eeeee8; font-size: 12px; vertical-align: middle; }
.station-row:last-child td { border-bottom: 0; }
.station-row:hover td { background: #f5f5ef; }
.station-seq { color: #8b948e; font: 10px var(--sans); font-variant-numeric: tabular-nums; }
.station-name { position: relative; padding-left: 15px !important; font-family: var(--serif); }
.station-name::before { content: ""; position: absolute; left: 0; top: 50%; width: 5px; height: 5px; margin-top: -2px; border: 1px solid #8ca294; border-radius: 50%; background: var(--paper); }
.station-name::after { content: ""; position: absolute; left: 3px; top: 26px; bottom: -14px; width: 1px; background: #dce1d9; }
.station-row:last-child .station-name::after { display: none; }
.station-km, .station-time { color: #66736b; font-variant-numeric: tabular-nums; }
.station-time { font-family: var(--sans); }
.stage-note { margin: 0 24px 20px; padding: 14px 16px; color: #66746a; border-left: 2px solid #b8c6b8; background: #f3f5ee; font: 12px/1.8 var(--serif); }
.stage-note strong { display: block; margin-bottom: 4px; color: #455d50; font: 9px var(--sans); letter-spacing: .12em; }
.stage-event { display: flex; align-items: center; gap: 10px; margin: 0 24px 20px; padding: 12px 14px; color: #7b6448; border: 1px dashed #d8c8ad; background: #faf6ed; font-size: 11px; }
.stage-event svg { flex: 0 0 auto; width: 15px; height: 15px; }
.stage-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 15px 24px; border-top: 1px solid #e4e6df; background: #f7f6f0; }
.add-stage-wrap { display: flex; justify-content: center; padding: 8px 0 15px; }
.add-stage { min-height: 40px; padding: 0 18px; border-style: dashed; }

.empty-page { position: relative; min-height: 570px; padding: 55px 45px; overflow: hidden; border: 1px solid #d9ddd4; background: var(--paper); box-shadow: var(--shadow); }
.empty-page::after { content: attr(data-symbol); position: absolute; right: 20px; bottom: -65px; color: rgba(23,63,56,.055); font: 330px var(--serif); }
.empty-code { color: var(--accent); font-size: 10px; letter-spacing: .18em; }
.empty-page h1 { position: relative; margin: 25px 0 13px; font: 600 36px var(--serif); }
.empty-page > p { position: relative; max-width: 500px; color: var(--ink-soft); font: 14px/1.9 var(--serif); }
.empty-lines { position: relative; max-width: 580px; margin: 45px 0 35px; }
.empty-lines i { display: block; height: 42px; border-bottom: 1px solid #e2e3dc; }
.empty-actions { position: relative; display: flex; flex-wrap: wrap; gap: 9px; }
.empty-actions .primary-action { color: #fff; border-color: var(--forest); background: var(--forest); }

.edit-field { width: 100%; min-width: 0; padding: 7px 9px; color: var(--ink); border: 1px dashed #b8c3b8; border-radius: 4px; outline: none; background: #fffef9; }
.edit-field:focus { border-style: solid; border-color: #5d8572; box-shadow: 0 0 0 3px rgba(73,113,90,.09); }
textarea.edit-field { resize: vertical; line-height: 1.7; }
.cover-title h1 .edit-field { font: inherit; }
.cover-english .edit-field { font: inherit; }
.cover-quote .edit-field, .cover-summary .edit-field { display: block; font: inherit; }
.edit-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 17px; }
.edit-meta label { display: grid; gap: 5px; color: var(--ink-soft); font-size: 9px; }
.edit-meta .edit-field { min-width: 155px; font-size: 11px; }
.stage-edit-grid { display: grid; grid-template-columns: 70px minmax(130px, 1fr) minmax(130px, 1fr) 130px; gap: 9px; padding: 18px 24px 10px; background: #f2f3ec; }
.stage-edit-grid label, .station-edit-cell label { display: grid; gap: 4px; color: #7a867e; font-size: 8px; }
.stage-numbers { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.stage-note-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 24px 18px; background: #f2f3ec; }
.stage-note-editor label { display: grid; gap: 5px; color: #6f7b73; font-size: 9px; }
.edit-stations { padding: 10px 20px 18px; }
.edit-station-head, .edit-station-row { display: grid; grid-template-columns: 54px minmax(150px, 1fr) 105px 90px 34px; gap: 8px; align-items: center; }
.edit-station-head { padding: 0 4px 7px; color: #7b867e; font-size: 9px; }
.edit-station-row { margin-bottom: 6px; }
.edit-station-row .edit-field { padding: 6px 7px; font-size: 11px; }
.edit-station-row .station-name-input { font-family: var(--serif); }
.row-delete { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; color: #a07163; border: 0; border-radius: 4px; background: transparent; }
.row-delete:hover { background: #f3e6df; color: #8e4436; }
.row-delete svg { width: 14px; height: 14px; }
.edit-hint { margin: 0 24px 18px; color: #7d887f; font-size: 10px; line-height: 1.7; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; max-width: min(90vw, 520px); padding: 11px 17px; color: #f5f6f1; border-radius: 6px; background: #173f38; box-shadow: 0 10px 28px rgba(0,0,0,.18); font-size: 12px; opacity: 0; transform: translate(-50%, 15px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #873f34; }
.help-dialog { width: min(760px, calc(100vw - 30px)); max-height: calc(100vh - 40px); padding: 0; color: var(--ink); border: 1px solid #d5dbd1; border-radius: 8px; background: var(--paper); box-shadow: 0 25px 90px rgba(14,38,31,.25); }
.help-dialog::backdrop { background: rgba(16,36,31,.52); backdrop-filter: blur(4px); }
.dialog-inner { position: relative; padding: 38px; }
.dialog-close { position: absolute; right: 17px; top: 17px; }
.dialog-inner h2 { margin: 0 0 27px; font: 600 29px var(--serif); }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.help-grid section > span { color: var(--accent); font: 12px var(--serif); }
.help-grid h3 { margin: 7px 0; font: 600 15px var(--serif); }
.help-grid p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.shortcut-row { display: flex; flex-wrap: wrap; gap: 17px; margin-top: 27px; padding: 16px 0; color: #68766d; border-top: 1px solid #e0e2da; border-bottom: 1px solid #e0e2da; font-size: 10px; }
.dialog-note { color: #7d887f; font-size: 10px; line-height: 1.8; }
.dialog-primary { width: 100%; min-height: 42px; margin-top: 10px; color: #fff; border: 0; border-radius: 5px; background: var(--forest); }

/* Access modes, publication states and editorial additions */
.mode-button { border-color: #d6dcd3; background: #f2f3ed; }
.developer-mode .mode-button { color: #f7f3e9; border-color: #795d37; background: #795d37; }
.developer-mode .mode-button:hover { color: #fff; background: #654b2c; }
.letter-state.published { background: #8fa4c1; }
.letter-state.unplanned { background: #66867a; }
.status-badge.published { color: #496781; background: #e6edf2; }
.status-badge.completed { color: #426151; background: #e5ece4; }
.overview-controls { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
.sort-control { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 10px; white-space: nowrap; }
.sort-control select { min-height: 34px; padding: 0 28px 0 10px; color: var(--ink); border: 1px solid #cbd2c8; border-radius: 5px; background: var(--paper); outline: none; }
.sort-control select:focus { border-color: #789383; }
.card-stats { flex-wrap: wrap; gap: 10px 16px; padding-right: 32px; }
.mode-badge svg { width: 11px; height: 11px; }
.unpublished-badge { color: #875d3d; background: #f1e9dd; }
.station-row td { height: auto; min-height: 38px; }
.station-name-content { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 13px; }
.station-title { flex: 0 0 auto; }
.station-remarks { display: inline-flex; flex: 1 1 210px; flex-wrap: wrap; gap: 3px 11px; min-width: 0; }
.station-remark { font: 9px/1.65 var(--sans); letter-spacing: .025em; text-align: left; }
.station-remark.district { color: #54786d; }
.station-remark.exit { color: #a05c47; }
.station-remark.platform { color: #77658e; }
.restricted-banner { position: relative; display: flex; align-items: flex-start; gap: 10px; margin-top: 24px; padding: 13px 15px; color: #795f42; border: 1px solid #ded2be; background: #f7f2e8; font-size: 11px; line-height: 1.75; }
.restricted-banner svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; }
.restricted-stage { border-style: dashed; }
.restricted-stations > p { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 20px 24px; color: #89918b; background: #faf9f4; font-size: 10px; text-align: center; }
.restricted-stations > p svg { flex: 0 0 auto; width: 13px; height: 13px; }
.stage-notice { display: flex; align-items: flex-start; gap: 10px; margin: 0 24px 20px; padding: 12px 14px; color: #914d40; border: 1px dashed #d7aaa0; background: #fbefeb; font-size: 11px; line-height: 1.7; }
.stage-notice svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 2px; }
.archive-permission { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; margin-right: auto; color: #7b867e; font-size: 10px; }
.archive-permission svg { width: 14px; height: 14px; }
.empty-lock { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 11px; color: #77837b; border: 1px dashed #cbd2c8; border-radius: 5px; font-size: 11px; }
.empty-lock svg { width: 14px; height: 14px; }
.direction-editor { grid-column: 1 / -1; }
.direction-editor > label { display: grid; gap: 4px; color: #7a867e; font-size: 8px; }
.notice-editor textarea { border-color: #d6aaa0; background: #fffaf7; }
.dialog-intro { margin: -12px 0 22px; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.password-field { display: grid; gap: 7px; color: #65736b; font-size: 11px; }
.password-field input { width: 100%; min-height: 43px; padding: 0 12px; color: var(--ink); border: 1px solid #bfc9bd; border-radius: 5px; background: #fffef9; outline: none; }
.password-field input:focus { border-color: #5d8572; box-shadow: 0 0 0 3px rgba(73,113,90,.09); }
.password-error { min-height: 20px; margin: 7px 0 0; color: #9a493d; font-size: 11px; }
.developer-dialog { width: min(490px, calc(100vw - 30px)); }
.edit-station-head, .edit-station-row { grid-template-columns: 54px minmax(120px, .8fr) minmax(175px, 1.2fr) 105px 90px 34px; }
.edit-station-row .station-remark-input { color: #6c6256; }

@media (max-width: 1080px) {
  :root { --sidebar: 250px; }
  #content { padding: 38px 30px 25px; }
  .topbar { padding: 0 18px; gap: 14px; }
  .topbar-rule, .save-state { display: none; }
  .future-strip { grid-template-columns: repeat(6, 1fr); }
  .stage-edit-grid { grid-template-columns: 60px 1fr 1fr; }
  .stage-edit-grid > label:nth-child(4) { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  :root { --topbar: 64px; }
  .topbar { gap: 8px; padding: 0 12px; }
  .mobile-menu { display: inline-flex; }
  .brand-mark { width: 34px; height: 34px; font-size: 17px; }
  .brand strong { font-size: 16px; }
  .brand small { display: none; }
  .tool-button { width: 36px; padding: 0; }
  .tool-button span { display: none; }
  .optional-action { display: none; }
  .sidebar { width: min(310px, 88vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 18px 0 50px rgba(9,31,25,.25); }
  .sidebar.open { transform: translateX(0); }
  .sidebar::after { display: none; }
  .sidebar-backdrop { position: fixed; inset: var(--topbar) 0 0; z-index: 30; border: 0; background: rgba(17,39,33,.38); }
  .main { margin-left: 0; }
  #content { padding: 28px 20px 20px; }
  .overview-intro { padding-top: 15px; }
  .overview-intro h1 { font-size: 37px; }
  .overview-stats { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .future-strip { grid-template-columns: repeat(6, 1fr); }
  .page-footer { margin: 20px 20px 0; }
  .trip-cover { padding: 27px 25px; }
  .cover-watermark { right: 5px; font-size: 170px; }
  .stage-edit-grid, .stage-note-editor { padding-left: 18px; padding-right: 18px; }
  .edit-stations { padding-left: 12px; padding-right: 12px; overflow-x: auto; }
  .edit-station-head, .edit-station-row { min-width: 760px; }
}

@media (max-width: 560px) {
  .topbar { gap: 4px; }
  .brand { gap: 7px; }
  .brand strong { font-size: 14px; letter-spacing: .06em; }
  .actions { gap: 2px; }
  .tool-button, .icon-button { width: 34px; min-height: 34px; }
  #help-button { display: none; }
  #content { padding: 20px 12px; }
  .overview-intro h1 { font-size: 31px; }
  .overview-intro .intro-text { font-size: 13px; }
  .overview-stat { padding: 15px; }
  .overview-stat strong { font-size: 23px; }
  .overview-card { min-height: 200px; padding: 22px; }
  .future-strip { grid-template-columns: repeat(3, 1fr); }
  .section-heading { align-items: flex-start; }
  .overview-controls { gap: 5px; }
  .sort-control { gap: 0; font-size: 0; }
  .sort-control select { max-width: 112px; padding-left: 7px; font-size: 10px; }
  .section-heading .text-button { font-size: 0; width: 34px; padding: 0; }
  .section-heading .text-button svg { width: 16px; height: 16px; }
  .trip-cover { padding: 23px 19px; }
  .cover-title h1 { font-size: 28px; }
  .cover-stats { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
  .cover-stat { padding: 0 14px; }
  .cover-stat:nth-child(2) { border-right: 0; }
  .cover-stat:nth-child(3) { padding-left: 0; }
  .cover-stat strong { font-size: 23px; }
  .cover-quote { font-size: 13px; }
  .trip-toolbar { align-items: flex-start; }
  .trip-toolbar h2 { font-size: 18px; }
  .trip-toolbar h2 small { display: block; margin: 5px 0 0; }
  .trip-toolbar-actions .text-button span { display: none; }
  .stage-summary { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; padding: 17px 14px; }
  .stage-heading { gap: 10px; }
  .stage-roman { flex-basis: 34px; width: 34px; height: 34px; font-size: 14px; }
  .stage-name h3 { font-size: 17px; }
  .stage-progress { gap: 6px; }
  .progress-number { font-size: 18px; }
  .stage-chevron { width: 23px; height: 23px; }
  .stage-metrics { padding: 12px 14px; }
  .stage-metric { min-width: 33.33%; padding: 0 10px; }
  .stage-metric strong { font-size: 13px; }
  .station-table th:first-child, .station-table td:first-child { width: 42px; padding-left: 12px; padding-right: 5px; }
  .station-table th:nth-child(3), .station-table td:nth-child(3) { width: 76px; padding-left: 5px; padding-right: 5px; }
  .station-table th:nth-child(4), .station-table td:nth-child(4) { width: 66px; padding-left: 5px; padding-right: 12px; }
  .station-row td { height: 36px; padding: 7px 5px; font-size: 11px; }
  .station-name { padding-left: 12px !important; }
  .station-remarks { flex-basis: 100%; gap: 2px 8px; }
  .stage-note, .stage-event, .stage-notice { margin-left: 14px; margin-right: 14px; }
  .stage-actions { padding-left: 14px; padding-right: 14px; }
  .stage-edit-grid { grid-template-columns: 55px 1fr; padding: 15px 14px 8px; }
  .stage-edit-grid > label:nth-child(3), .stage-edit-grid > label:nth-child(4) { grid-column: 1 / -1; }
  .stage-numbers { grid-template-columns: 1fr; }
  .stage-note-editor { grid-template-columns: 1fr; padding: 8px 14px 15px; }
  .empty-page { min-height: 520px; padding: 35px 25px; }
  .empty-page h1 { font-size: 29px; }
  .page-footer { flex-direction: column; gap: 8px; margin: 15px 12px 0; }
  .help-grid { grid-template-columns: 1fr; gap: 18px; }
  .dialog-inner { padding: 30px 23px; }
  .shortcut-row { flex-direction: column; gap: 10px; }
}

@media print {
  @page { size: A4; margin: 13mm; }
  :root { --topbar: 0px; }
  body { color: #000; background: #fff; font-size: 10pt; }
  .topbar, .sidebar, .trip-toolbar-actions, .stage-actions, .add-stage-wrap, .archive-tools, .page-footer, .toast, .help-dialog, .developer-dialog, .edit-hint, .overview-controls { display: none !important; }
  .app-shell { padding: 0; }
  .main { margin: 0; background: #fff; }
  #content { max-width: none; padding: 0; }
  .trip-cover, .overview-card, .stage-card, .empty-page { box-shadow: none; break-inside: avoid; }
  .trip-cover { padding: 20px; }
  .stage-card { margin-bottom: 12px; }
  .stage-card > .stage-body { display: block !important; }
  .station-row { break-inside: avoid; }
  .station-row td { height: 28px; padding-top: 5px; padding-bottom: 5px; }
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .overview-card { min-height: 160px; }
  .edit-field { border: 0; background: transparent; }
  .cover-watermark, .big-letter { opacity: .5; }
}
