/* 帧夜 — original dark poster wall. No third-party CSS. */
:root {
  --bg: #14120f;
  --bg-raise: #1e1a16;
  --ink: #f6f1e7;
  --muted: #b6aa98;
  --line: rgba(246, 241, 231, 0.16);
  --accent: #ef8b57;
  --accent-ink: #1a100c;
  --gold: #e0c27a;
  --danger: #ffb4ac;
  --ok: #c8e2b8;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Songti SC", "STSong", "Noto Serif SC", serif;
  --sans: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 8% -10%, rgba(239, 139, 87, 0.18), transparent 52%),
    radial-gradient(ellipse 50% 40% at 110% 0%, rgba(224, 194, 122, 0.12), transparent 48%),
    linear-gradient(180deg, #1a1714 0%, #100e0c 42%, #0c0b09 100%);
}

img { max-width: 100%; }

a { color: var(--gold); }

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.4em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(20, 18, 15, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.top-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.seal {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--gold);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 0 3px rgba(224, 194, 122, 0.25);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-size: 1.15rem; letter-spacing: 0.12em; }
.brand-text small { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.08em; }

.nav { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--gold); }

.search { display: flex; gap: 8px; flex: 1 1 220px; max-width: 420px; }
.search input { flex: 1; min-width: 0; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 16px 48px; }

.page-title { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: 0.08em; }
.lede, .field-hint, .url-note { color: var(--muted); }
.section-title { margin-top: 1.4rem; font-size: 1.2rem; }
.crumb { color: var(--muted); margin: 0 0 0.6rem; }
.crumb a { color: var(--muted); }

.poster-grid {
  list-style: none;
  padding: 0;
  margin: 1.2rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 22px 14px;
}

.poster-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
}

.poster-card h2 {
  margin: 10px 2px 0;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.poster {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 10px 10px 3px 3px;
  overflow: hidden;
  background: linear-gradient(165deg, #3a3128 0%, #221c17 58%, #14110e 100%);
  box-shadow: var(--shadow);
}

.poster::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(246, 241, 231, 0.32);
  pointer-events: none;
}

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

.poster.is-empty {
  display: flex;
  align-items: flex-end;
  padding: 14px;
  background-image:
    repeating-linear-gradient(-45deg, rgba(224, 194, 122, 0.09) 0 8px, transparent 8px 16px),
    linear-gradient(165deg, #3a3128 0%, #221c17 58%, #14110e 100%);
}

.glyph {
  font-family: var(--serif);
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--gold);
  line-height: 1;
}

@media (hover: hover) {
  .poster-card:hover .poster { transform: translateY(-4px); }
  .poster { transition: transform 0.18s ease; }
}

.detail {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.detail > .poster { width: min(100%, 280px); }

.blurb {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 1.02rem;
}

.ep-grid {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.ep-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  min-height: 44px;
}

.ep-btn.is-current {
  border-color: var(--accent);
  background: rgba(239, 139, 87, 0.16);
}

.ep-no { color: var(--gold); font-variant-numeric: tabular-nums; }

.stage {
  margin: 1rem 0 0.4rem;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.player {
  width: 100%;
  max-height: 72vh;
  background: #000;
  display: block;
}

.external-play { padding: 1.2rem; background: var(--bg-raise); }
.url-note { overflow-wrap: anywhere; font-size: 0.85rem; }

.hint { color: var(--gold); }

.empty-block {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin-top: 1rem;
}

.empty-poster { width: 140px; }

.empty { color: var(--muted); font-size: 1.05rem; }

.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 32px;
  color: var(--muted);
  font-size: 0.85rem;
}

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

input[type="search"],
input[type="password"],
input[type="text"],
input:not([type]),
textarea,
.form input,
.form textarea {
  width: 100%;
  background: #100e0c;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  min-height: 44px;
}

textarea { min-height: 8rem; resize: vertical; }

input:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  min-height: 44px;
  cursor: pointer;
}

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

.btn.danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255, 180, 172, 0.55);
}

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

.card {
  background: rgba(30, 26, 22, 0.92);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.login-card { max-width: 28rem; margin: 6vh auto; display: grid; gap: 0.7rem; }
.login-card h1 { margin-bottom: 0; }

.form { display: grid; gap: 0.45rem; margin-bottom: 1rem; }
.form label { margin-top: 0.35rem; }
.check { display: flex; align-items: center; gap: 0.5rem; min-height: 44px; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }

.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0.6rem; }
.form-actions.split form { margin: 0; }
.danger-zone { margin-top: 1.5rem; border-color: rgba(255, 180, 172, 0.35); }

.admin-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.table-wrap { overflow-x: auto; margin-top: 1rem; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.admin-table th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.row-actions { display: flex; gap: 12px; white-space: nowrap; }
.row-actions a { color: var(--gold); }

.flash, .warn, .error, .errors {
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
}
.flash { background: rgba(200, 226, 184, 0.12); color: var(--ok); }
.warn { background: rgba(224, 194, 122, 0.12); color: var(--gold); }
.error, .errors { background: rgba(255, 180, 172, 0.1); color: var(--danger); }
.errors { margin: 0 0 1rem; padding-left: 1.4rem; }

@media (min-width: 800px) {
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 28px 18px; }
  .detail { grid-template-columns: 240px 1fr; }
  .login-card { padding: 1.5rem; }
}

@media (max-width: 640px) {
  .search { max-width: none; width: 100%; }
  .admin-table { min-width: 520px; }
}
