:root {
  color-scheme: light;
  --paper: #f7f5ef;
  --surface: #fffdf8;
  --ink: #24211d;
  --muted: #6d675d;
  --line: #ded7c9;
  --accent: #176b62;
  --accent-strong: #0f514a;
  --warn: #a94b24;
  --warn-bg: #fff0e8;
  --ok-bg: #e8f4ef;
  --shadow: 0 14px 34px rgba(49, 44, 34, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(247, 245, 239, 0.98), rgba(247, 245, 239, 1)),
    url("./assets/images/2026-07-03_183550/issue_004_181s.jpg") center top / cover fixed;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -16px -16px 12px;
  padding: calc(16px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(247, 245, 239, 0.92);
  border-bottom: 1px solid rgba(223, 216, 202, 0.85);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 19px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  line-height: 1.25;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(49, 44, 34, 0.08);
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.metric,
.video-panel,
.issue-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(49, 44, 34, 0.1);
}

.metric {
  min-height: 82px;
  padding: 12px;
}

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

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.metric.urgent {
  color: #8e3216;
  background: var(--warn-bg);
  border-color: #f0c7b4;
}

.focus-band {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 12px;
  padding: 16px;
  color: #f7f5ef;
  background: #1f463f;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.focus-band .eyebrow,
.focus-band p {
  color: rgba(247, 245, 239, 0.76);
}

.focus-band p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.55;
}

.status-pill,
.tag,
.status-select {
  border-radius: 999px;
}

.status-pill {
  display: inline-flex;
  min-width: 58px;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  color: #17423b;
  background: #d8ece5;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.video-panel {
  margin-bottom: 12px;
  padding: 14px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.video-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.icon-button.small {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.icon-button.small svg {
  width: 19px;
  height: 19px;
}

.text-button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--accent-strong);
  background: #edf7f3;
  border: 1px solid #bad8cf;
  border-radius: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.video-select-wrap {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.video-select-wrap span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.video-select-wrap select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
}

.video-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(156px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.video-rail::-webkit-scrollbar,
.segmented::-webkit-scrollbar {
  display: none;
}

.video-card {
  display: grid;
  min-height: 96px;
  align-content: space-between;
  gap: 6px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  background: #f8f4ec;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.video-card.active {
  color: #fffdf8;
  background: var(--accent);
  border-color: var(--accent);
}

.video-name {
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-card strong {
  font-size: 26px;
  line-height: 1;
}

.video-meta {
  color: inherit;
  font-size: 12px;
  opacity: 0.72;
}

.controls {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-wrap svg {
  width: 20px;
  height: 20px;
  fill: var(--muted);
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(100px, 1fr);
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.segmented.compact {
  grid-auto-columns: minmax(78px, 1fr);
}

.segmented button {
  min-height: 40px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: nowrap;
}

.segmented button.active {
  color: #fffdf8;
  background: var(--accent);
  border-color: var(--accent);
}

.issue-list {
  display: grid;
  gap: 12px;
}

.issue-card {
  overflow: hidden;
}

.issue-image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  overflow: hidden;
  background: #ddd5c5;
  border: 0;
  cursor: zoom-in;
}

.issue-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.issue-image span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 8px;
  color: #fff;
  background: rgba(15, 29, 26, 0.78);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.missing-image {
  min-height: 160px;
}

.issue-body {
  padding: 14px;
}

.issue-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  color: var(--accent-strong);
  background: var(--ok-bg);
  font-size: 12px;
  font-weight: 800;
}

.tag.warn {
  color: var(--warn);
  background: var(--warn-bg);
}

.tag.neutral {
  color: var(--muted);
  background: #f0ebe2;
}

.summary {
  margin-bottom: 12px;
  color: #3d3931;
  font-size: 15px;
  line-height: 1.65;
}

.detail-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.detail-item {
  padding: 10px;
  background: #f6f2e9;
  border-radius: 8px;
}

.detail-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-item p {
  margin-bottom: 0;
  color: #403b33;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.copy-one {
  min-width: 92px;
}

.status-select {
  min-width: 116px;
  height: 38px;
  padding: 0 12px;
  color: var(--accent-strong);
  background: #edf7f3;
  border: 1px solid #bad8cf;
  font-weight: 800;
}

.empty {
  padding: 24px 14px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 253, 248, 0.8);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 20;
  max-width: 420px;
  margin: 0 auto;
  padding: 12px 14px;
  color: #fffdf8;
  background: rgba(31, 70, 63, 0.94);
  border-radius: 8px;
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.image-dialog {
  width: min(94vw, 900px);
  padding: 0;
  background: #111;
  border: 0;
  border-radius: 8px;
}

.image-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.image-dialog img {
  display: block;
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
}

.image-dialog p {
  margin: 0;
  padding: 12px 14px;
  color: #f7f5ef;
  font-size: 14px;
  line-height: 1.5;
}

.close-button {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
  border-color: rgba(255, 255, 255, 0.22);
}

@media (min-width: 760px) {
  .app-shell {
    padding-right: 24px;
    padding-left: 24px;
  }

  .topbar {
    margin-right: -24px;
    margin-left: -24px;
    padding-right: 24px;
    padding-left: 24px;
  }

  .summary-grid {
    gap: 12px;
  }

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

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

@media (max-width: 430px) {
  .section-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .video-actions {
    display: grid;
    grid-template-columns: 42px 42px 1fr;
  }

  .video-actions .text-button {
    width: 100%;
  }
}
