:root {
  --ink: #111722;
  --paper: #f3f5f8;
  --muted: #667085;
  --line: #dbe1e9;
  --teal: #159a92;
  --teal-dark: #0f756f;
  --orange: #f27b2b;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: #dfe4ea;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
}

button,
input { font: inherit; }

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

.site-shell {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 40px rgb(15 23 42 / 10%);
}

.site-header {
  padding: 30px 22px 24px;
  color: #fff;
  text-align: center;
  background:
    linear-gradient(135deg, rgb(17 23 34 / 96%), rgb(17 23 34 / 86%)),
    radial-gradient(circle at top right, var(--orange), transparent 42%);
  border-bottom: 6px solid var(--orange);
}

.site-header h1 {
  margin: 7px 0 8px;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(30px, 8vw, 48px);
  line-height: 1.15;
}

.eyebrow {
  margin: 0;
  color: #ffbf8f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.header-note {
  margin: 0;
  color: #dbe4f0;
  font-size: 14px;
}

.content-panel { padding: 22px 16px 44px; }

.section-heading {
  padding: 20px 20px 18px;
  text-align: center;
  background: #f7fbfb;
  border: 1px solid #d2ecea;
  border-radius: 18px;
}

.section-heading p {
  margin: 0;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.section-heading h1 {
  margin: 7px 0 5px;
  font-size: clamp(24px, 6vw, 34px);
}

.section-heading span {
  color: var(--muted);
  font-size: 13px;
}

.search-field {
  display: grid;
  gap: 8px;
  margin: 18px 0;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.search-field input {
  width: 100%;
  padding: 13px 15px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  outline: none;
}

.search-field input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgb(21 154 146 / 14%);
}

.mechanism-list { display: grid; gap: 18px; }

.mechanism-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 25px rgb(15 23 42 / 8%);
}

.mechanism-title {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.mechanism-title h2 {
  margin: 0;
  font-size: clamp(18px, 4.8vw, 24px);
}

.mechanism-sequence {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 800;
}

.resource-grid {
  display: grid;
  gap: 1px;
  background: var(--line);
}

.resource-label {
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 9px 12px;
  color: #fff;
  text-align: center;
  background: #6a4a34;
  font-size: 14px;
  font-weight: 800;
}

.video-label,
.play-button,
.player-controls { background: var(--teal); }

.video-card,
.drawing-card {
  min-width: 0;
  margin: 0;
  background: #fff;
}

.video-cover-button,
.drawing-button {
  position: relative;
  width: 100%;
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 0;
  overflow: hidden;
  background: #0c1017;
  border: 0;
  cursor: pointer;
}

.video-cover {
  width: 100%;
  height: clamp(300px, 66vw, 430px);
  display: block;
  object-fit: contain;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.cover-ready .video-cover { opacity: 1; }

.cover-status {
  position: absolute;
  inset: auto 14px 14px;
  padding: 8px 12px;
  color: #fff;
  background: rgb(17 23 34 / 78%);
  border-radius: 999px;
  font-size: 12px;
  pointer-events: none;
}

.cover-ready .cover-status { display: none; }

.cover-error .cover-status {
  inset: 50% auto auto 50%;
  width: max-content;
  max-width: calc(100% - 30px);
  transform: translate(-50%, -50%);
}

.poster-play {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  color: #fff;
  background: rgb(17 23 34 / 74%);
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgb(0 0 0 / 32%);
  pointer-events: none;
}

.play-triangle {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 15px solid currentColor;
}

.play-button {
  width: 100%;
  min-height: 52px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 0;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
}

.play-button .play-triangle {
  border-top-width: 6px;
  border-bottom-width: 6px;
  border-left-width: 10px;
}

.drawing-button { padding: 10px; }

.drawing-button img {
  width: 100%;
  height: clamp(300px, 66vw, 430px);
  display: block;
  object-fit: contain;
}

.zoom-hint {
  position: absolute;
  right: 18px;
  bottom: 18px;
  padding: 7px 11px;
  color: #fff;
  background: rgb(17 23 34 / 78%);
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
}

.native-player,
.video-stage { background: #0c1017; }

.video-stage {
  position: relative;
  min-height: 300px;
  display: grid;
  place-items: center;
}

.video-player {
  width: 100%;
  min-height: 300px;
  max-height: 72vh;
  display: block;
  object-fit: contain;
  background: #0c1017;
}

.player-status {
  position: absolute;
  inset: auto 12px 12px;
  padding: 8px 12px;
  color: #fff;
  background: rgb(17 23 34 / 76%);
  border-radius: 999px;
  font-size: 13px;
  pointer-events: none;
}

.player-status:empty,
.player-status[hidden] { display: none; }

.player-controls {
  min-height: 70px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  color: #fff;
}

.control-button {
  min-width: 50px;
  min-height: 48px;
  display: grid;
  gap: 2px;
  place-content: center;
  padding: 5px 8px;
  color: #fff;
  background: rgb(0 0 0 / 15%);
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.control-main { min-width: 62px; }
.control-icon { min-height: 18px; font-size: 18px; line-height: 1; }
.progress-group { min-width: 0; display: grid; gap: 4px; }
.player-progress { width: 100%; height: 26px; margin: 0; accent-color: #fff; cursor: pointer; }
.player-time { display: flex; gap: 4px; justify-content: center; font-size: 11px; font-variant-numeric: tabular-nums; }

.native-player:fullscreen {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  background: #000;
}

.native-player:fullscreen .video-stage,
.native-player:fullscreen .video-player {
  width: 100%;
  height: 100%;
  max-height: none;
}

.empty-state {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
}

.empty-state strong { color: var(--ink); font-size: 18px; }

.image-lightbox {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  place-items: center;
  padding: 54px 12px 18px;
  color: #fff;
  background: rgb(5 8 13 / 96%);
  cursor: zoom-out;
}

.image-lightbox img {
  max-width: 96vw;
  max-height: 82vh;
  object-fit: contain;
  cursor: default;
}

.image-lightbox p { margin: 0; text-align: center; font-size: 14px; }

.lightbox-close {
  position: absolute;
  top: 10px;
  right: 14px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgb(255 255 255 / 14%);
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 50%;
  cursor: pointer;
  font-size: 30px;
}

@media (min-width: 720px) {
  .content-panel { padding: 30px 30px 50px; }
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .resource-grid.drawing-only { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 460px) {
  .site-header { padding-inline: 16px; }
  .content-panel { padding-inline: 12px; }
  .mechanism-title { padding-inline: 12px; }
  .video-cover-button,
  .drawing-button,
  .video-stage,
  .video-player { min-height: 270px; }
  .video-cover,
  .drawing-button img { height: 310px; }
  .player-controls { grid-template-columns: auto minmax(80px, 1fr) auto auto; gap: 5px; padding-inline: 7px; }
  .control-button { min-width: 44px; padding-inline: 5px; }
  .control-main { min-width: 52px; }
  .control-button span:last-child { font-size: 10px; }
}

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