:root {
  --ink: #0b0a08;
  --panel: #151310;
  --panel-2: #1c1915;
  --line: #2e2923;
  --paper: #efe6d6;
  --muted: #9a8d7a;
  --ember: #d46a2e;
  --ember-deep: #8a3d16;
  --gold: #c9a227;
  --danger: #c45c4a;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --serif: "Noto Serif SC", "Songti SC", "Source Han Serif SC", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 600px at 10% -10%, #24180f 0%, var(--ink) 55%);
  color: var(--paper);
  font-family: var(--sans);
  letter-spacing: 0.01em;
}

body {
  position: relative;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 8;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

.site-header,
.site-footer,
.stage {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 18px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.wordmark-dali {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.wordmark-watch {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--ember);
}

.nav {
  display: flex;
  gap: 18px;
  font-size: 0.92rem;
}

.nav a {
  color: var(--muted);
}

.nav a:hover,
.nav a.active {
  color: var(--paper);
}

.stage {
  min-height: calc(100vh - 170px);
  padding: 28px 0 64px;
}

.site-footer {
  padding: 18px 0 36px;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--line);
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 28px;
}

.page-head h1,
.watch-copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 700;
}

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

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

.card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #4a3d32;
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f0d0b;
  overflow: hidden;
}

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

.thumb .placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  background: repeating-linear-gradient(
    -45deg,
    #14110e,
    #14110e 8px,
    #191511 8px,
    #191511 16px
  );
}

.duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(11, 10, 8, 0.82);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ember-deep);
  font-size: 0.72rem;
}

.card-body {
  padding: 14px 14px 16px;
}

.card-body h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
}

.meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.player-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.player-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.watch-copy {
  margin-top: 22px;
}

.watch-copy p {
  color: var(--muted);
  line-height: 1.8;
  max-width: 46rem;
}

.form {
  max-width: 560px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}

label {
  display: block;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

input[type="text"],
textarea,
.file-drop {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

.file-drop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.file-drop input {
  display: none;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  background: var(--ember);
  color: #1a0d06;
  font-weight: 600;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--paper);
  border: 1px solid var(--line);
}

.progress {
  margin-top: 16px;
  height: 8px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--ember-deep), var(--gold));
}

.status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty,
.error,
.loading {
  padding: 36px 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(21, 19, 16, 0.65);
}

.empty h2,
.error h2 {
  margin: 0 0 10px;
  font-family: var(--serif);
}

.empty p,
.error p,
.loading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.error {
  border-color: #5a332c;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  color: var(--gold);
}

.hint {
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .site-header {
    padding-top: 18px;
  }

  .wordmark-dali {
    font-size: 1.4rem;
  }

  .page-head {
    flex-direction: column;
    align-items: start;
  }
}
