:root {
  --bg: #ffffff;
  --bg-mute: #fafafa;
  --bg-hover: #f4f4f5;
  --text: #18181b;
  --text-2: #3f3f46;
  --muted: #71717a;
  --line: #e4e4e7;
  --line-2: #f4f4f5;
  --black: #09090b;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", sans-serif;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
ul { list-style: none; }

/* ---------- shell ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex: 0 0 240px;
  border-right: 1px solid var(--line);
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  padding: 4px 10px 16px;
}
.logo-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--black);
  color: #fff;
  font-size: 12px;
  display: grid;
  place-items: center;
}

.side-label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .04em;
  padding: 0 10px 6px;
}

.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-nav button {
  text-align: left;
  background: none;
  border: 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-2);
}
.side-nav button:hover { background: var(--bg-hover); }
.side-nav button.active { background: var(--bg-hover); color: var(--text); font-weight: 500; }

.side-foot {
  margin-top: auto;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.main { flex: 1; min-width: 0; }

.topbar {
  height: 56px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 20;
}
.crumb { font-size: 13px; color: var(--muted); }
.crumb b { color: var(--text); font-weight: 500; }
.top-actions { display: flex; gap: 8px; }

.btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-hover); }

.mobile-nav { display: none; }

.page { padding: 28px 32px 72px; max-width: 1120px; }

/* ---------- view ---------- */

.view { display: none; }
.view.active { display: block; }

h1 { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.25; }
.sub { color: var(--muted); margin: 8px 0 24px; max-width: 720px; }
.h2 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin: 32px 0 12px; }

/* ---------- cards ---------- */

.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.card.pad { padding: 4px 16px; }
.card.pad > .h2 { margin: 14px 0 6px; }

.cards-2, .split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
}
.row:last-child { border-bottom: 0; }
.k { color: var(--muted); font-size: 13px; flex: 0 0 auto; }
.v { color: var(--text); font-size: 13px; font-weight: 500; text-align: right; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 14px;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.metric b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.metric span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }

.list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
  color: var(--text-2);
}
.list li:last-child { border-bottom: 0; }

/* ---------- table ---------- */

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  background: var(--bg-mute);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  color: var(--text-2);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table td:first-child { color: var(--text); font-weight: 500; }

/* ---------- steps ---------- */

.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.step {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.step em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
}
.step h3 { font-size: 14px; font-weight: 600; margin: 6px 0 4px; }
.step p { font-size: 12px; color: var(--muted); line-height: 1.55; }

/* ---------- scenes ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--text-2);
}
.chip:hover { background: var(--bg-hover); }
.chip.active { background: var(--black); border-color: var(--black); color: #fff; }

/* align-items:start —— 混排 16:10 与 3:4 卡片时不让矮卡被拉高留白 */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }

.scene {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
  text-align: left;
  padding: 0;
  width: 100%;
  border-color: var(--line);
  transition: border-color .15s ease;
}
.scene:hover { border-color: #a1a1aa; }
.scene:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }

.thumb { position: relative; aspect-ratio: 16 / 10; background: var(--bg-hover); }
.scene.tall .thumb { aspect-ratio: 3 / 4; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--text-2);
}
.dur {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(9, 9, 11, .72);
  color: #fff;
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
}

.scene-body { padding: 12px 14px 14px; }
.scene-body h3 { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.scene-body p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, .45);
  display: none;
  place-items: center;
  padding: 24px;
  z-index: 60;
}
.modal.show { display: grid; }

.modal-card {
  width: min(880px, 100%);
  max-height: calc(100vh - 48px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
}
.modal-visual { position: relative; background: var(--bg-hover); min-height: 380px; }
.modal-visual img { width: 100%; height: 100%; object-fit: cover; }

.close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  z-index: 2;
}
.close:hover { background: var(--bg-hover); }

.modal-body { padding: 24px 24px 24px; overflow: auto; position: relative; }
.modal-body h3 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin: 6px 0 8px; }
/* 给右上角关闭按钮让位 */
.modal-body > .k, .modal-body h3 { padding-right: 40px; }
.modal-body p { font-size: 13px; color: var(--text-2); }
.modal-body ul { margin-top: 16px; border-top: 1px solid var(--line-2); }
.modal-body li {
  font-size: 13px;
  color: var(--text-2);
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.modal-body li:last-child { border-bottom: 0; }

.modal-note { margin-top: 16px; font-size: 12px; color: var(--muted); }

/* 说明弹层（复用 modal，单列） */
.modal-card.single { grid-template-columns: 1fr; width: min(560px, 100%); }
.modal-card.single .modal-visual { display: none; }

/* ---------- responsive ---------- */

.mobile-foot { display: none; }

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .metrics { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 980px) {
  .sidebar { display: none; }
  .topbar { padding: 0 16px; height: auto; min-height: 56px; flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 10px; }
  .page { padding: 20px 16px 64px; }
  .cards-2, .split, .metrics, .steps { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .modal-card { grid-template-columns: 1fr; max-height: calc(100vh - 48px); overflow: auto; }
  .modal-visual { min-height: 220px; }
  .mobile-nav {
    display: block;
    width: 100%;
    order: 3;
  }
  .mobile-nav select {
    width: 100%;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    font-size: 13px;
    color: var(--text);
    padding: 0 10px;
  }
  .mobile-foot {
    display: block;
    padding: 0 16px 32px;
    font-size: 12px;
    color: var(--muted);
  }
}
