:root {
  color: #171715;
  background: #e8e4da;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  --ink: #171715;
  --paper: #f7f4ec;
  --paper-deep: #eee9de;
  --muted: #666257;
  --line: #c9c3b6;
  --red: #8f1d1d;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: #e8e4da;
}

button,
input {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
label:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

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

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  border-right: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.app-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, auto);
  gap: 28px;
  align-items: end;
  padding: clamp(22px, 4vw, 42px);
  border-bottom: 1px solid var(--ink);
}

.archive-code,
.panel-heading > span,
.site-code,
.light-card > span,
.progress-card > span,
.shot-section header span,
.fixed-weather span {
  color: var(--red);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 12em;
  margin: 10px 0 12px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(2rem, 5vw, 4.4rem);
  font-weight: 500;
  line-height: 0.98;
}

.app-header p {
  max-width: 52ch;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.header-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.network-state {
  flex-basis: 100%;
  margin-bottom: 3px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  text-align: right;
}

.network-state::before {
  margin-right: 7px;
  color: var(--red);
  content: "●";
}

.button,
.text-button {
  min-height: 38px;
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  font-size: 0.76rem;
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  background: var(--ink);
  color: #fff;
}

.button-secondary {
  background: transparent;
  color: var(--ink);
}

.text-button {
  padding: 0 6px;
  border-color: transparent;
  background: transparent;
  color: var(--red);
}

.boundary-note {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding: 14px clamp(22px, 4vw, 42px);
  border-bottom: 1px solid var(--ink);
  background: var(--paper-deep);
  font-size: 0.78rem;
}

.boundary-note strong {
  color: var(--red);
}

.boundary-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(220px, 0.32fr) minmax(0, 1fr);
}

.route-panel {
  padding: 28px 22px;
  border-right: 1px solid var(--ink);
  background: var(--paper-deep);
}

.panel-heading h2 {
  margin: 8px 0 24px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 1.35rem;
  font-weight: 500;
}

.route-panel ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.route-item {
  display: grid;
  grid-template-columns: 1fr auto;
  border-top: 1px solid var(--line);
}

.route-select {
  padding: 13px 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.route-select[aria-current="true"] {
  color: var(--red);
  font-weight: 800;
}

.route-order {
  display: flex;
  align-items: center;
}

.route-order button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.route-order button:disabled {
  cursor: default;
  opacity: 0.25;
}

.route-help {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.field-panel {
  min-width: 0;
  padding: clamp(24px, 4vw, 42px);
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.35fr);
  gap: 28px;
  align-items: end;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ink);
}

.site-header h2 {
  margin: 8px 0 10px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(1.75rem, 3.8vw, 3rem);
  font-weight: 500;
}

.site-header p,
.light-card p,
.progress-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.fixed-weather {
  padding-left: 18px;
  border-left: 3px solid var(--red);
}

.fixed-weather strong,
.fixed-weather small {
  display: block;
}

.fixed-weather strong {
  margin: 8px 0 5px;
  font-size: 0.9rem;
}

.fixed-weather small {
  color: var(--muted);
  font-size: 0.7rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 24px 0 30px;
  border: 1px solid var(--line);
}

.light-card,
.progress-card {
  min-width: 0;
  padding: 20px;
}

.progress-card {
  border-left: 1px solid var(--line);
}

.light-card h3,
.progress-card h3 {
  margin: 8px 0 12px;
  font-size: 1rem;
}

.light-card > strong,
.progress-card > strong {
  display: block;
  margin-bottom: 8px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 1.05rem;
}

.light-card small {
  display: block;
  margin-top: 12px;
  color: var(--red);
  line-height: 1.45;
}

progress {
  width: 100%;
  height: 8px;
  margin: 3px 0 10px;
  border: 0;
  background: var(--line);
  accent-color: var(--red);
}

.shot-section {
  margin-top: 26px;
}

.shot-section > header {
  display: flex;
  gap: 20px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 10px;
}

.shot-section h3 {
  margin: 6px 0 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: 1.2rem;
  font-weight: 500;
}

.shot-section header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.shot-list {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--ink);
  list-style: none;
}

.shot-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.shot-list li:first-child {
  border-top-color: var(--ink);
}

.shot-copy strong,
.shot-copy small {
  display: block;
}

.shot-copy strong {
  font-size: 0.84rem;
}

.shot-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.7rem;
}

.status-button {
  min-width: 62px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
}

.status-button[data-status="done"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.status-button[data-status="retake"] {
  border-color: var(--red);
  color: var(--red);
}

.notice {
  min-height: 1.4em;
  margin: 20px 0 0;
  color: var(--red);
  font-size: 0.76rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 760px) {
  .button,
  .text-button,
  .route-order button,
  .status-button {
    min-height: 44px;
  }

  .route-order button {
    min-width: 44px;
  }

  .app-shell {
    border: 0;
  }

  .app-header,
  .site-header,
  .workspace {
    grid-template-columns: 1fr;
  }

  .app-header {
    align-items: start;
  }

  .header-tools {
    justify-content: flex-start;
  }

  .network-state {
    text-align: left;
  }

  .boundary-note {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .route-panel {
    border-right: 0;
    border-bottom: 1px solid var(--ink);
  }

  .route-panel ol {
    grid-template-columns: 1fr;
  }

  .fixed-weather {
    padding-top: 12px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .progress-card {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .shot-section > header {
    display: block;
  }

  .shot-section header p {
    margin-top: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}
