:root {
  color-scheme: light;
  --ink: #1d2522;
  --muted: #69746f;
  --paper: #f2efe7;
  --panel: #fffdf8;
  --line: #d8d3c8;
  --accent: #b64a32;
  --accent-dark: #87311f;
  --green: #1f6b52;
  --shadow: 0 18px 50px rgba(39, 35, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.35)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(60, 54, 44, 0.035) 31px 32px),
    var(--paper);
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 42px max(28px, calc((100vw - 1480px) / 2));
  border-bottom: 1px solid var(--line);
}

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

h1 {
  max-width: 760px;
  margin-bottom: 10px;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.lede {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  font-size: 13px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c18f2d;
}

.system-status.ok .dot {
  background: var(--green);
}

.system-status.bad .dot {
  background: var(--accent);
}

.layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 22px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 28px 80px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.content {
  min-width: 0;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.93);
  box-shadow: var(--shadow);
}

.panel + .panel,
.content > * + * {
  margin-top: 18px;
}

.final-panel {
  border-color: #cbbeb2;
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(245, 236, 225, 0.92)),
    var(--panel);
}

.final-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.final-heading h2 {
  margin-bottom: 5px;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 30px;
  font-weight: 500;
}

.primary.compact {
  width: auto;
  min-width: 150px;
  margin: 0;
  padding: 10px 14px;
}

.final-prompt {
  max-height: 360px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 18px;
  border: 1px solid #ded1c5;
  border-radius: 12px;
  color: #2c332f;
  background: rgba(255, 255, 255, 0.82);
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.english-details,
.technical-details {
  margin-top: 16px;
}

.english-details summary,
.technical-details > summary {
  padding: 10px 0;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.technical-details > summary {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.9);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 21px;
  font-weight: 500;
}

.small,
.muted {
  color: var(--muted);
  font-size: 12px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
}

.file-field {
  display: none;
}

.field input[type="text"],
.field input[type="number"],
.field select {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 12px;
}

.dropzone {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  padding: 22px 16px;
  border: 1px dashed #a7a095;
  border-radius: 12px;
  background: rgba(242, 239, 231, 0.5);
  cursor: pointer;
  text-align: center;
}

.dropzone span {
  color: var(--muted);
  font-size: 12px;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: rgba(182, 74, 50, 0.06);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
}

.primary {
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.primary:hover {
  background: var(--accent-dark);
}

.primary:disabled {
  cursor: wait;
  opacity: 0.55;
}

.upload-progress {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  overflow: hidden;
  height: 4px;
  border-radius: 999px;
  background: #e7e1d6;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

.upload-progress p {
  margin: 8px 0 0;
}

.text-button {
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.job-list {
  display: grid;
  gap: 8px;
}

.job-item {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.job-item:hover,
.job-item.active {
  border-color: var(--line);
  background: #fff;
}

.job-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-item span {
  color: var(--muted);
  font-size: 11px;
}

.welcome {
  min-height: 360px;
  padding: clamp(28px, 5vw, 62px);
  background:
    linear-gradient(130deg, rgba(255, 253, 248, 0.98), rgba(239, 232, 219, 0.84)),
    var(--panel);
}

.welcome h2 {
  max-width: 760px;
  margin-bottom: 40px;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 500;
  line-height: 1.16;
}

.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 780px;
}

.steps div {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.steps b {
  color: var(--accent);
  font-family: Georgia, serif;
  font-weight: 500;
}

.steps span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.status-panel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.status-panel > div:first-child {
  min-width: 0;
  flex: 1;
}

.status-panel h2 {
  margin-bottom: 6px;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 30px;
  font-weight: 500;
}

.status-panel p {
  margin-bottom: 0;
}

.job-progress {
  max-width: 760px;
  margin-top: 18px;
}

.job-progress-track {
  height: 8px;
}

.progress-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.progress-ring {
  --progress: 0%;
  display: grid;
  place-items: center;
  width: 90px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress), #e7e1d6 0);
}

.progress-ring::before {
  grid-area: 1 / 1;
  width: 70px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--panel);
  content: "";
}

.progress-ring span {
  z-index: 1;
  grid-area: 1 / 1;
  font-family: Georgia, serif;
  font-size: 20px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.metric strong {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 500;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  text-decoration: none;
  font-size: 12px;
}

.overview {
  max-width: 920px;
  color: #3c4641;
  line-height: 1.8;
}

.quality-notice {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 3px solid #be8b4b;
  border-radius: 0 8px 8px 0;
  color: #6b5941;
  background: rgba(248, 238, 220, 0.72);
  font-size: 12px;
  line-height: 1.6;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  padding: 6px 9px;
  border-radius: 999px;
  color: #5f4a43;
  background: #f2e7df;
  font-size: 11px;
}

.segment-list {
  display: grid;
  gap: 14px;
}

.segment {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.segment-meta h3 {
  margin-bottom: 6px;
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 22px;
  font-weight: 500;
}

.segment-meta p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.segment-body {
  display: grid;
  gap: 12px;
}

.segment-refs {
  display: grid;
  grid-template-columns: repeat(2, 96px);
  gap: 7px;
  margin-top: 10px;
}

.segment-refs a {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #202522;
}

.segment-refs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.segment-refs span {
  position: absolute;
  top: 3px;
  left: 3px;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  font-size: 9px;
}

.prompt-box {
  position: relative;
  padding: 14px;
  border-radius: 10px;
  background: var(--paper);
}

.prompt-box strong {
  display: block;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 11px;
}

.prompt-box p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.7;
}

.copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 10px;
}

.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.shot-card {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.shot-images {
  display: grid;
  grid-template-rows: 1fr 1fr;
  background: #252a27;
}

.shot-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot-info {
  padding: 12px;
}

.shot-info h4 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 7px;
}

.shot-info h4 span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.shot-info p {
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.55;
}

.shot-info small {
  color: var(--muted);
}

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.sheet-grid a {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.sheet-grid img {
  display: block;
  width: 100%;
}

video {
  width: 100%;
  border-radius: 12px;
  background: #111;
}

.error-panel {
  border-color: #d9a696;
}

.error-panel pre {
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: #f7ebe6;
  white-space: pre-wrap;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 290px minmax(0, 1fr);
  }

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

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .layout {
    grid-template-columns: 1fr;
    padding-inline: 14px;
  }

  .steps,
  .sheet-grid {
    grid-template-columns: 1fr;
  }

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

  .shot-card {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
