@charset "UTF-8";

:root {
  color-scheme: dark;
  --bg: #101b1b;
  --panel: #14201f;
  --panel-light: #1b2927;
  --border: #ffffff0f;
  --text: #e4e6db;
  --muted: #83968e;
  --gold: #d7b879;
  --green: #8dbaa0;
  --danger: #dc9b86;
  --text-scale: 1;
  font-family: Inter, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: calc(14px * var(--text-scale));
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}
button,
input {
  font: inherit;
}
button {
  color: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
button:hover:not(:disabled) {
  background: #ffffff08;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
button.active {
  color: var(--gold);
}
[hidden] {
  display: none !important;
}
.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}
.eyebrow,
.small-label {
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: 1.5px;
}
.topbar {
  min-height: 80px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 25px;
  gap: 32px;
  background: #111c1c;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--gold);
  width: 195px;
  flex-shrink: 0;
}
.brand-mark {
  width: 34px;
  height: 40px;
}
.brand strong {
  font-size: 1.4286rem;
  font-weight: 600;
  letter-spacing: 4px;
  display: block;
}
.brand small {
  font-size: 1rem;
  letter-spacing: 2px;
  color: #a19d82;
  display: block;
  margin-top: 5px;
}
.world-heading {
  display: flex;
  gap: 13px;
  align-items: center;
  flex: 1;
}
.world-heading strong {
  font-size: 1rem;
  font-weight: 500;
}
.world-tag {
  font-size: 1rem;
  color: #8d9b8d;
  border: 1px solid #8797822e;
  padding: 4px 7px;
  border-radius: 3px;
  letter-spacing: 0.4px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.connection {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 1rem;
  color: var(--muted);
  margin-right: 12px;
}
.connection i,
.map-location i,
.live-label i {
  width: 5px;
  height: 5px;
  background: #677973;
  display: inline-block;
  border-radius: 50%;
}
.connection i.online {
  background: var(--green);
  box-shadow: 0 0 10px #87ba9855;
}
.icon-button {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.quiet-button {
  border: 1px solid var(--border);
  padding: 8px 13px;
  border-radius: 5px;
  color: #bfcbc0;
  font-size: 1rem;
}
.save-button {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid #cfb47944;
  background: #d7b8790e;
  padding: 9px 14px;
  border-radius: 5px;
  color: var(--gold);
  font-size: 1rem;
}
.save-button .icon {
  width: 16px;
  height: 16px;
}
.resourcebar {
  min-height: 49px;
  background: #14201f;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 25px;
  gap: 23px;
}
.population {
  display: flex;
  gap: 9px;
  align-items: center;
  border-right: 1px solid var(--border);
  padding-right: 23px;
  font-size: 1rem;
  color: var(--muted);
}
.population .icon {
  width: 17px;
  height: 17px;
  color: var(--gold);
}
.population strong {
  color: #d8decf;
  font-size: 1rem;
  font-weight: 500;
}
.resources {
  display: flex;
  align-items: center;
  gap: 25px;
}
.resource {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  white-space: nowrap;
  color: var(--muted);
}
.resource strong {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--text);
}
.resource-dot {
  width: 9px;
  height: 9px;
  background: var(--color);
  border-radius: 2px;
  transform: rotate(10deg);
}
.weather {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: #c4ba91;
  white-space: nowrap;
}
.weather .icon {
  width: 17px;
  height: 17px;
}
.weather-note {
  font-size: 1rem;
  color: #73857d;
  margin-left: 9px;
}
.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr) 280px;
}
.left-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: linear-gradient(160deg, #172421, #121e1c);
}
.sidebar-tabs {
  height: 57px;
  display: flex;
  margin: 0 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-tabs button {
  flex: 1;
  color: var(--muted);
  font-size: 1rem;
  position: relative;
}
.sidebar-tabs button.active {
  color: var(--gold);
}
.sidebar-tabs button.active:after {
  content: '';
  position: absolute;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  width: 19px;
  left: calc(50% - 9px);
}
.sidebar-content {
  padding: 20px 17px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #40504a transparent;
}
.tool-group {
  margin-bottom: 24px;
}
.tool-group-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 12px;
  color: #91a298;
  font-size: 1rem;
  letter-spacing: 1.8px;
}
.tool-group-heading span {
  color: #556d61;
  font-size: 1rem;
  letter-spacing: 0;
}
.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.tool-button {
  border: 1px solid #81998916;
  border-radius: 6px;
  background: #a7bb9803;
  min-height: 69px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  position: relative;
  font-size: 1rem;
  color: #aebcaf;
}
.tool-button .icon {
  color: #8a9c8e;
}
.tool-button:hover:not(:disabled) {
  border-color: #b6c8a538;
  background: #9fb99009;
}
.tool-button.active {
  border-color: #c7ac6570;
  background: #d7b8790b;
  color: var(--gold);
}
.tool-button.active .icon {
  color: var(--gold);
}
.tool-button kbd {
  font-size: 1rem;
  color: #5c6f63;
}
.tool-description {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--muted);
  background: #080e0d22;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin-top: 12px;
}
.tool-description strong {
  color: #d7cfb0;
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}
.sidebar-bottom {
  margin: 0 18px;
  border-top: 1px solid var(--border);
  padding: 17px 0;
  flex-shrink: 0;
}
.sidebar-bottom .small-label {
  font-size: 1rem;
  letter-spacing: 0.4px;
  margin-bottom: 10px;
}
.new-world-button {
  width: 100%;
  text-align: left;
  font-size: 1rem;
  color: #aabca9;
  padding: 7px 0;
}
.new-world-button span {
  float: right;
  color: var(--gold);
}
.map-section {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #0c1617;
}
#world-map {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline-offset: -3px;
}
.map-heading {
  pointer-events: none;
  position: absolute;
  top: 21px;
  left: 23px;
  right: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: space-between;
  font-size: 1rem;
  color: #b1bdae;
  text-shadow: 0 1px 4px #000;
}
.map-location {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  letter-spacing: 0.5px;
}
.map-location i {
  background: var(--gold);
}
#coordinates {
  font-size: 1rem;
  color: #84988d;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.map-right-tools {
  position: absolute;
  right: 19px;
  top: 58px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-button {
  width: 32px;
  height: 32px;
  background: #14201de0;
  backdrop-filter: blur(6px);
  border: 1px solid #c8d1b316;
  border-radius: 5px;
  color: #a8b8a3;
  font-size: 1.2857rem;
}
.map-button .icon {
  width: 16px;
  height: 16px;
}
.pause-notice {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 56px;
  border: 1px solid #dac18830;
  background: #15221eed;
  backdrop-filter: blur(6px);
  border-radius: 5px;
  padding: 9px 16px;
  color: var(--gold);
  font-size: 1rem;
  max-width: calc(100% - 120px);
  text-align: center;
  pointer-events: none;
}
.pause-notice > span {
  padding-right: 8px;
}
.pause-notice small {
  font-size: 1rem;
  margin-left: 12px;
  color: #91a38d;
}
.map-footer {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.layer-switch {
  display: flex;
  background: #12201bea;
  border: 1px solid #ccd5bd19;
  border-radius: 6px;
  padding: 4px;
  gap: 3px;
}
.layer-switch button {
  font-size: 1rem;
  padding: 7px 10px;
  border-radius: 3px;
  color: #9aa994;
  white-space: nowrap;
}
.layer-switch button.active {
  background: #cec49615;
  color: var(--gold);
}
kbd {
  font-family: inherit;
  font-size: 1rem;
  color: #687c69;
}
.layer-switch kbd {
  margin-left: 5px;
}
.map-hint {
  font-size: 1rem;
  color: #899c8a;
  white-space: normal;
  text-shadow: 0 1px 3px #000;
}
.map-scale {
  position: absolute;
  left: 24px;
  bottom: 74px;
  pointer-events: none;
}
.map-scale span {
  display: block;
  border: 1px solid #9eaf9166;
  border-top: 0;
  height: 4px;
  width: 80px;
}
.map-scale small {
  font-size: 1rem;
  color: #95a88e;
}
.plan-preview {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  background: #17261ff5;
  border: 1px solid #bba16377;
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: 0 10px 40px #0005;
  white-space: normal;
  max-width: calc(100% - 36px);
}
.plan-preview strong {
  font-size: 1rem;
  color: #dcca9d;
  font-weight: 500;
}
.plan-preview p {
  margin: 5px 0 0;
  font-size: 1rem;
  color: #94a58f;
}
.primary-button {
  border-radius: 5px;
  background: #d4b576;
  color: #202c22;
  padding: 10px 17px;
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid #d4b576;
}
.primary-button:hover:not(:disabled) {
  background: #e3c88e;
}
.right-sidebar {
  border-left: 1px solid var(--border);
  background: linear-gradient(140deg, #172421, #131f1d);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #40504a transparent;
  min-height: 0;
}
.day-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 20px 16px;
}
.day-panel .eyebrow {
  font-size: 1rem;
}
.day {
  display: flex;
  align-items: baseline;
  gap: 11px;
  margin-top: 8px;
}
.day > span {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 1px;
}
.day small {
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  color: #8e9f8e;
}
.season-symbol {
  font-size: 2.2857rem;
  color: #cbbb80;
  font-weight: 300;
  opacity: 0.9;
}
.time-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(calc(36px * var(--text-scale, 1)), 1fr));
  gap: 4px;
  margin: 0 20px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px;
  background: #09110e25;
}
.time-controls button {
  border-radius: 3px;
  min-width: 0;
  padding: 6px 2px;
  font-size: calc(14px * var(--text-scale, 1));
  color: #859882;
}
.time-controls button:first-child {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
}
.time-controls .icon {
  width: 13px;
  height: 13px;
}
.time-controls button.active {
  background: #a6b89110;
  color: var(--gold);
  box-shadow: inset 0 -2px var(--gold);
}
.speed-status {
  margin: 0 20px 18px;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.5;
}
#pause-button {
  color: var(--gold);
}
.overview-block {
  margin: 0 20px 19px;
  position: relative;
}
#minimap {
  display: block;
  width: 100%;
  height: 121px;
  background: #101a17;
  border: 1px solid #dce2c51a;
  border-radius: 5px;
  image-rendering: pixelated;
  cursor: crosshair;
}
.minimap-label {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  color: #758b76;
  letter-spacing: 0.4px;
  margin-top: 7px;
}
.detail-panel,
.journal-panel {
  margin: 0 20px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
}
.section-heading h2 {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 1px;
  margin: 0;
  color: #d3d8c5;
}
.subtle {
  font-size: 1rem;
  color: #789177;
}
.muted {
  font-size: 1rem;
  line-height: 1.9;
  color: var(--muted);
}
.goal-card {
  border: 1px solid #98ac7b25;
  background: #a8c68706;
  border-radius: 5px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.goal-number {
  font-size: 1rem;
  width: 21px;
  height: 21px;
  border: 1px solid #b9b88737;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  flex-shrink: 0;
}
.goal-card.complete {
  opacity: 0.6;
}
.goal-card.complete .goal-number {
  background: #8bb88d1a;
  border-color: #8bb88d55;
  color: #8bb88d;
}
.goal-card strong {
  font-size: 1rem;
  display: block;
  color: #bccbb1;
  font-weight: 500;
  margin-bottom: 5px;
}
.goal-card p {
  font-size: 1rem;
  line-height: 1.7;
  margin: 0;
  color: #7d967b;
}
.population-summary {
  display: flex;
  align-items: center;
  margin-top: 15px;
}
.avatar {
  background: color-mix(in srgb, var(--person) 13%, #10201b);
  border: 1px solid color-mix(in srgb, var(--person) 35%, transparent);
  color: var(--person);
  border-radius: 50%;
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.population-summary .avatar {
  margin-right: -7px;
  border-width: 2px;
}
.population-summary small {
  margin-left: 15px;
  color: #91a98a;
  font-size: 1rem;
}
.person-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.person-row {
  text-align: left;
  display: flex;
  gap: 10px;
  padding: 10px 3px;
  border-radius: 4px;
  border-bottom: 1px solid var(--border);
}
.person-row .avatar {
  width: 29px;
  height: 29px;
}
.person-row strong {
  font-size: 1rem;
  font-weight: 500;
  display: block;
  margin-bottom: 5px;
}
.person-row small {
  font-size: 1rem;
  color: var(--muted);
}
.person-detail {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
}
.person-detail .avatar {
  width: 39px;
  height: 39px;
  font-size: 1.0714rem;
}
.person-detail strong {
  display: block;
  font-size: 1.1429rem;
  font-weight: 500;
}
.person-detail small {
  display: block;
  font-size: 1rem;
  color: #8a9e83;
  margin-top: 5px;
}
.need {
  display: grid;
  grid-template-columns: 2em minmax(0, 1fr) 2em;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  color: #8a9c82;
  margin-bottom: 10px;
}
.need-track {
  height: 4px;
  background: #07150c88;
  border-radius: 4px;
  overflow: hidden;
}
.need-fill {
  height: 100%;
  background: var(--bar, #91a674);
  border-radius: 4px;
}
.need b {
  font-size: 1rem;
  font-weight: 400;
  text-align: right;
  color: #bbcab0;
}
.activity-card {
  background: #07170e45;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 11px;
  font-size: 1rem;
  line-height: 1.8;
  color: #bac5aa;
  margin: 15px 0 0;
}
.skill-list {
  margin-top: 14px;
  font-size: 1rem;
  line-height: 2;
  color: #81977e;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.skill-list b {
  color: #c0c8a6;
  font-weight: 500;
}
.journal-panel {
  padding-bottom: 24px;
}
.live-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #69896e;
  font-size: 1rem;
}
.live-label i {
  background: #709775;
  width: 4px;
  height: 4px;
}
.journal {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.journal-entry {
  padding-left: 13px;
  position: relative;
  color: #8fa386;
  font-size: 1rem;
  line-height: 1.8;
}
.journal-entry:before {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: #b4ac77;
  left: 0;
  top: 7px;
  border-radius: 50%;
}
.journal-entry time {
  display: block;
  font-size: 1rem;
  color: #607b63;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}
.journal-entry button {
  text-align: left;
  padding: 0;
  font-size: 1rem;
  line-height: 1.8;
  color: inherit;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 13px;
}
.detail-actions button {
  font-size: 1rem;
  padding: 7px 10px;
  border: 1px solid #bbcc9a22;
  border-radius: 4px;
  color: #b3c09c;
}
.task-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  color: #aabda0;
}
.task-item strong {
  font-weight: 500;
  font-size: 1rem;
  display: block;
  margin-bottom: 6px;
}
.task-item small {
  font-size: 1rem;
  color: #758d71;
}
.task-item progress {
  width: 100%;
  height: 3px;
  margin-top: 8px;
  accent-color: var(--gold);
}
.discovery-card {
  border: 1px solid var(--border);
  padding: 13px;
  border-radius: 5px;
  font-size: 1rem;
  line-height: 1.8;
  color: #8b9e84;
  margin-bottom: 12px;
}
.discovery-card strong {
  display: block;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 6px;
}
.statusbar {
  min-height: 30px;
  flex-wrap: wrap;
  background: #101b18;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 15px;
  color: #70886f;
  font-size: 1rem;
  letter-spacing: 0.3px;
}
.statusbar > span:first-child {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
}
.status-spark {
  width: 4px;
  height: 4px;
  background: #b4bb89;
  transform: rotate(45deg);
}
.connection-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d1913d9;
  backdrop-filter: blur(6px);
  z-index: 5;
}
.connection-card {
  text-align: center;
  padding: 30px;
  max-width: 400px;
}
.connection-card h1 {
  font-size: 1.4286rem;
  font-weight: 400;
  letter-spacing: 2px;
  color: #cdbd92;
  margin: 23px 0 12px;
}
.connection-card p {
  color: #8ca387;
  font-size: 1rem;
  line-height: 1.9;
  white-space: pre-line;
}
.connection-card button {
  margin-top: 15px;
}
.loading-mark {
  width: 30px;
  height: 30px;
  border: 1px solid #d1b97744;
  border-top-color: #d1b977;
  transform: rotate(45deg);
  margin: auto;
  animation: turn 3s linear infinite;
}
@keyframes turn {
  to {
    transform: rotate(405deg);
  }
}
.toast {
  position: fixed;
  bottom: 53px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(650px, 90vw);
  padding: 12px 20px;
  background: #223226;
  border: 1px solid #bfbd8277;
  box-shadow: 0 8px 40px #0004;
  border-radius: 6px;
  color: #dfd8b5;
  font-size: 1rem;
  line-height: 1.8;
  z-index: 20;
}
.toast.error {
  border-color: #c88a6577;
  color: #e5b89a;
}
dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: 85dvh;
  border: 1px solid #b6bc8b40;
  border-radius: 10px;
  background: #19271f;
  color: var(--text);
  padding: 25px 27px;
  box-shadow: 0 25px 100px #0009;
}
dialog::backdrop {
  background: #060e0bbd;
  backdrop-filter: blur(5px);
}
.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.modal-heading h2 {
  font-size: 1.2857rem;
  font-weight: 500;
  color: #d7c899;
  letter-spacing: 1px;
  margin: 0;
}
.modal-heading .icon-button {
  font-size: 1.7143rem;
}
#modal-content {
  font-size: 1rem;
  line-height: 1.9;
  color: #a1b397;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 23px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 17px 0;
}
.form-field input {
  width: 100%;
  padding: 11px;
  background: #0c1a12;
  border: 1px solid #aaba852d;
  border-radius: 5px;
  color: #d6dcc4;
  font-size: 1rem;
}
.save-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  width: 100%;
  padding: 14px;
  border: 1px solid #b8bc8b24;
  border-radius: 5px;
  margin-bottom: 10px;
  background: #112019;
}
.save-slot strong {
  display: block;
  font-size: 1rem;
  color: #c2d0b2;
  font-weight: 500;
}
.save-slot small {
  display: block;
  font-size: 1rem;
  color: #829a78;
  margin-top: 4px;
}
.save-slot > span:last-child {
  color: var(--gold);
  font-size: 1rem;
}
.help-row {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 9px 0;
}
.help-row kbd {
  color: #d7c491;
  font-size: 1rem;
}
.scope-note {
  border-left: 2px solid #c2a86b;
  padding: 9px 13px;
  background: #c2a86b08;
  color: #aab798;
  font-size: 1rem;
  line-height: 1.9;
  margin-top: 18px;
}
@media (min-width: 1600px) {
  .workspace {
    grid-template-columns: 244px minmax(0, 1fr) 308px;
  }
  .sidebar-content {
    padding: 24px 22px;
  }
  .tool-button {
    min-height: 76px;
  }
  .right-sidebar {
    padding: 0 5px;
  }
  .overview-block #minimap {
    height: 140px;
  }
}
@media (max-width: 1150px) {
  .workspace {
    grid-template-columns: 190px minmax(0, 1fr) 242px;
  }
  .topbar {
    padding: 0 18px;
    gap: 14px;
  }
  .brand {
    width: 165px;
  }
  .world-heading .eyebrow,
  .world-tag,
  .weather-note {
    display: none;
  }
  .resources {
    gap: 16px;
  }
  .resourcebar {
    gap: 16px;
    padding: 0 18px;
  }
  .resource:nth-child(n + 6) {
    display: none;
  }
  .map-hint {
    display: none;
  }
  .sidebar-content {
    padding: 18px 12px;
  }
  .topbar-right {
    gap: 7px;
  }
  .connection {
    margin-right: 4px;
  }
  .topbar-right .quiet-button {
    padding: 8px;
  }
  .day-panel,
  .overview-block,
  .time-controls,
  .detail-panel,
  .journal-panel {
    margin-left: 15px;
    margin-right: 15px;
  }
  .day-panel {
    padding-left: 0;
    padding-right: 0;
  }
  .plan-preview {
    gap: 8px;
    padding: 12px;
    flex-wrap: wrap;
    white-space: normal;
  }
  .plan-preview > div {
    width: 100%;
  }
}
@media (max-width: 850px) {
  .workspace {
    grid-template-columns: 150px minmax(0, 1fr);
  }
  .right-sidebar {
    display: none;
  }
  .world-heading {
    display: none;
  }
  .topbar {
    min-height: 65px;
  }
  .topbar-right {
    margin-left: auto;
  }
  .brand {
    width: auto;
  }
  .brand strong {
    font-size: 1.1429rem;
  }
  .brand small {
    font-size: 1rem;
  }
  .brand-mark {
    width: 27px;
  }
  .connection {
    display: none;
  }
  .resourcebar {
    min-height: 44px;
    padding: 0 12px;
    gap: 12px;
  }
  .population {
    padding-right: 12px;
    gap: 5px;
  }
  .resources {
    gap: 12px;
  }
  .weather {
    display: none;
  }
  .resource:nth-child(n + 5) {
    display: none;
  }
  .sidebar-tabs {
    margin: 0 8px;
  }
  .sidebar-tabs button {
    font-size: 1rem;
  }
  .tool-grid {
    gap: 5px;
  }
  .tool-button {
    min-height: 65px;
    font-size: 1rem;
  }
  .sidebar-content {
    padding: 16px 9px;
  }
  .sidebar-bottom {
    margin: 0 10px;
  }
  .sidebar-bottom .small-label {
    font-size: 1rem;
  }
  .map-heading {
    left: 14px;
    right: 14px;
  }
  .map-footer {
    left: 10px;
    right: 10px;
  }
  .layer-switch button {
    padding: 7px;
  }
  .pause-notice {
    top: 70px;
  }
  .pause-notice small {
    display: none;
  }
  .map-scale {
    display: none;
  }
  .statusbar {
    font-size: 1rem;
    padding: 0 10px;
  }
  .topbar-right .quiet-button {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* 操作面板采用同一字号比例，信息增加时通过滚动保持可达。 */
.sidebar-tabs { display: grid; grid-template-columns: repeat(3, 1fr); height: auto; min-height: 108px; gap: 2px; margin: 0 12px; }
.sidebar-tabs button { min-height: 34px; font-size: calc(14px * var(--text-scale)); padding: 5px 1px; }
button, input, select, textarea { font: inherit; }
p, .muted, .tool-description, .activity-card, .task-item, .discovery-card, .person-row small, .person-detail small, .detail-actions button, .goal-card p, .goal-card strong, .form-field, .help-row, .journal-entry button { font-size: calc(14px * var(--text-scale)); }
.tool-button { min-height: 52px; height: auto; padding: 10px 5px; font-size: calc(14px * var(--text-scale)); }
.tool-grid { gap: 5px; }
.tool-button span { min-width: 0; overflow-wrap: anywhere; }
.tool-group-heading, .section-heading h2, .person-row strong, .quiet-button, .save-button { font-size: calc(14px * var(--text-scale)); }
.resources { flex: 1; min-width: 0; overflow-x: auto; gap: 17px; padding: 4px 0; }
.resource { font-size: 1rem; }
.weather { max-width: 300px; min-width: 120px; }
.weather-note { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.topbar { gap: 12px 18px; padding: 8px 18px; flex-wrap: wrap; }
.brand { width: max-content; }
.topbar-right { gap: 6px; flex-wrap: wrap; }
.world-heading { gap: 8px; flex: 1 0 12rem; }
.world-heading .eyebrow { display: none; }
#overlay-select { background: #13231fe8; max-width: 100%; padding: 6px; border: 1px solid #81977e55; border-radius: 5px; color: var(--text); pointer-events: auto; }
.map-footer { gap: 10px; flex-wrap: wrap; }
.map-footer { position: relative; inset: auto; margin: auto 20px 20px; flex-shrink: 0; }
.plan-preview { position: relative; inset: auto; transform: none; margin: auto auto 10px; min-height: 0; flex-shrink: 1; }
.plan-preview:not([hidden]) + .map-footer { margin-top: 0; }
.map-footer .map-scale { position: static; }
.map-hint { max-width: 330px; line-height: 1.4; }
#login-form { margin-top: 20px; text-align: left; }
#login-form button { width: 100%; }
.connection-card { max-height: 90%; overflow: auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-field input, .form-field select, .form-field textarea { width: 100%; border: 1px solid #80948855; background: #0e1b17; border-radius: 5px; color: var(--text); padding: 9px 10px; min-width: 0; }
.form-field textarea { min-height: 92px; resize: vertical; }
.form-field input[type=checkbox] { width: auto; margin-right: 8px; }
.form-field input[type=range] { padding: 0; }
.form-field { margin: 14px 0; }
.form-section { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 10px; }
.form-actions, .inline-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.form-actions button, .inline-actions button, .data-card button { border: 1px solid #7d937c44; border-radius: 5px; padding: 7px 10px; }
.data-card { border: 1px solid var(--border); border-radius: 6px; padding: 12px; margin: 12px 0; overflow-wrap: anywhere; }
.data-card strong { display: block; margin-bottom: 5px; }
.data-card p { margin: 5px 0; line-height: 1.65; }
.data-card small { color: var(--muted); line-height: 1.6; }
.data-card .stat { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; }
.data-card .complete { color: var(--green); }
.data-card .blocked, .warning-text { color: var(--danger); }
.condition-list { padding-left: 0; list-style: none; line-height: 1.7; }
[data-task-status] { white-space: pre-line; }
.locked-tool small { color: var(--muted); font-size: 1rem; white-space: normal; }
.locked-tool { border-style: dashed; }
.resource-label { color: var(--muted); white-space: nowrap; }
.resources { gap: 16px; }
.companion-status { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 12px; line-height: 1.6; }
.companion-status:empty { display: none; }
.companion-status button, .modal-world-controls button { border: 1px solid var(--border); border-radius: 5px; padding: 6px 10px; }
.mark-toggle { display: flex; align-items: center; gap: 5px; background: #13231fe8; padding: 6px; border-radius: 5px; pointer-events: auto; }
.overview-block summary { cursor: pointer; padding: 8px 0; }
.modal-world-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.modal-heading, .modal-world-controls { flex-shrink: 0; }
.large-text .brand small, .large-text .brand-mark, .large-text .world-tag, .large-text .sidebar-bottom .small-label, .large-text .map-hint, .large-text .season-symbol { display: none; }
.large-text .brand { width: auto; }
.large-text .brand strong { font-size: 1rem; }
.large-text .topbar { padding: 6px 12px; gap: 6px 12px; }
.large-text .world-heading { flex: 1 1 auto; }
.large-text .day-panel { padding: 10px 12px; }
.large-text .day { flex-wrap: wrap; gap: 4px 10px; }
.large-text .statusbar { padding: 4px 10px; }
.large-text #performance-status { display: none; }
.large-text .tool-group-heading span { display: none; }
.large-text .form-grid, .large-text .lab-layout, .large-text .crystal-layout { grid-template-columns: minmax(0, 1fr); }
.detail-actions { flex-wrap: wrap; gap: 7px; }
.detail-actions button { padding: 7px 9px; }
.input-inline { display: flex; align-items: center; gap: 8px; }
.input-inline label { margin: 0; }
.input-inline input { min-width: 0; }
dialog { width: min(780px, 94vw); max-height: 92dvh; }
dialog.wide { width: min(1100px, 96vw); }
#modal-content { overflow: auto; }
.crystal-layout, .lab-layout { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(220px, 0.8fr); gap: 18px; align-items: start; }
.crystal-canvas { width: 100%; max-width: 520px; aspect-ratio: 1; image-rendering: pixelated; border: 1px solid #627e72; touch-action: none; background: #0a1714; }
.crystal-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.crystal-toolbar button { border: 1px solid #7d937c44; padding: 7px; border-radius: 4px; }
.crystal-toolbar button.active { border-color: var(--gold); background: #d7b87920; }
.crystal-legend { line-height: 1.8; color: var(--muted); }
.state-symbol { display: inline-flex; width: 1.4em; justify-content: center; }
.trace-list { max-height: 300px; overflow: auto; padding: 0; list-style: none; }
.trace-list li { border-top: 1px solid var(--border); padding: 8px 0; line-height: 1.6; }
.chat-list { max-height: 230px; overflow: auto; padding: 0; list-style: none; }
.chat-list li { padding: 8px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.chat-list time { color: var(--muted); margin-left: 9px; font-size: 1rem; }
.key-value { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; line-height: 1.6; }
.key-value dt { color: var(--muted); }
.key-value dd { margin: 0; overflow-wrap: anywhere; }
.inventory-table { width: 100%; border-collapse: collapse; }
.inventory-table td, .inventory-table th { padding: 7px 5px; text-align: left; border-bottom: 1px solid var(--border); }
.resource-chip { display: inline-block; border: 1px solid var(--border); padding: 3px 6px; margin: 3px; border-radius: 4px; }
.plan-preview { max-width: 95%; max-height: 45%; overflow: auto; flex-wrap: wrap; }
.plan-preview p { overflow-wrap: anywhere; }
#performance-status { white-space: nowrap; }
.alert-status { padding: 0 12px 10px; }
.alert-status button { border: 1px solid #dc9b8655; border-radius: 5px; padding: 7px; width: 100%; text-align: left; font-size: calc(14px * var(--text-scale)); }
@media (max-width: 1200px) {
  .world-tag, .weather-note, .topbar-right .connection { display: none; }
  .brand { width: 180px; }
  .workspace { grid-template-columns: 216px minmax(0, 1fr) 264px; }
  .map-hint { display: none; }
}
@media (max-width: 900px) {
  .workspace { grid-template-columns: 190px minmax(0, 1fr); }
  .right-sidebar { display: block; position: absolute; right: 0; top: 129px; bottom: 30px; width: 264px; transform: translateX(calc(100% - 18px)); z-index: 5; transition: transform 0.15s; }
  .right-sidebar:hover, .right-sidebar:focus-within { transform: none; }
  .world-heading, .brand small { display: none; }
  .topbar { padding: 0 8px; gap: 5px; }
  .topbar-right { margin-left: auto; }
  .crystal-layout, .lab-layout, .form-grid { grid-template-columns: 1fr; }
}
.desktop-notice { display: none; }
.goal-status { padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 1rem; line-height: 1.6; }
.goal-status button { margin-top: 4px; text-align: left; width: 100%; }
.goal-status .inline-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; }
.goal-status .inline-actions button { text-align: center; margin-top: 0; }
/* 小字和动态面板同样遵循正文下限；放大后的内容换行或在面板内滚动。 */
small { font-size: 1rem; }
.mark-message { white-space: pre-wrap; }
.world-heading, .day, .section-heading, .minimap-label, .layer-switch { flex-wrap: wrap; }
.left-sidebar { overflow-y: auto; }
.sidebar-content { flex-shrink: 0; flex-basis: 160px; }
.goal-number, .avatar { min-width: 1.6em; min-height: 1.6em; }
.map-button, .icon-button { min-width: 1.8rem; min-height: 1.8rem; }
@media (max-width: 1099px) {
  .desktop-notice { display: block; position: fixed; left: 12px; right: 12px; bottom: 38px; z-index: 20; background: #302b1c; color: #f0ddb0; border: 1px solid #b39a60; padding: 8px 12px; font-size: 1rem; }
}
