:root {
  --paper: #1A1D22;
  --surface: #23272C;
  --raised: #2A2F37;
  --ink: #ECEAE3;
  --muted: #A2A8B1;
  --line: #343A44;
  --accent: #C64B31;
  --bone: #F1EEE7;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --line-soft: rgba(255, 255, 255, 0.06);
  --accent-soft: rgba(198, 75, 49, 0.10);
  --accent-line: color-mix(in srgb, var(--accent) 45%, transparent);
  --danger: #BF3B24;
  --shadow-card: 0 4px 12px rgba(0, 0, 0, 0.25);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
::selection { background: var(--accent); color: var(--paper); }

.wrap { width: min(1080px, 100% - 48px); margin-inline: auto; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 22px; height: 22px; background: var(--accent);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.brand-name { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: 0.02em; }
.nav-links { display: flex; gap: 28px; font-size: 14px; color: var(--muted); }
.nav-links a { transition: color 0.18s var(--ease); position: relative; }
.nav-links a:hover { color: var(--ink); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px;
  background: var(--accent); transition: width 0.24s var(--ease);
}
.nav-links a:hover::after { width: 100%; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 44px; max-width: 660px; }
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 20px;
}
.hero-title {
  font-family: var(--serif); font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 600; line-height: 1.32; letter-spacing: -0.01em; margin-bottom: 18px;
}
.hero-desc { font-size: 15px; color: var(--muted); line-height: 1.9; }

/* ---------- filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding-bottom: 34px; border-bottom: 1px solid var(--line); margin-bottom: 36px;
}
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 15px; border: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
  transition: all 0.18s var(--ease);
}
.chip:hover { border-color: var(--accent-line); color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip-n { font-family: var(--mono); font-size: 11px; opacity: 0.6; }

/* ---------- grid ---------- */
.grid {
  display: grid; gap: 30px 24px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  padding-bottom: 40px;
}
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px; }

/* ---------- video card ---------- */
.vcard { display: block; group: card; }
.vcard-thumb {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color 0.22s var(--ease);
}
.vcard-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s var(--ease), opacity 0.3s var(--ease);
}
.vcard:hover .vcard-thumb { border-color: var(--accent-line); }
.vcard:hover .vcard-thumb img { transform: scale(1.045); }
.thumb-empty {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 10px, var(--raised) 10px, var(--raised) 20px);
  color: var(--muted); font-size: 12px;
}
.vcard-dur {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0, 0, 0, 0.78); color: var(--bone);
  font-family: var(--mono); font-size: 11px; padding: 2px 7px; letter-spacing: 0.04em;
}
.vcard-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(26, 29, 34, 0.35); opacity: 0; transition: opacity 0.24s var(--ease);
}
.vcard-play::after {
  content: ""; width: 0; height: 0;
  border-left: 18px solid var(--bone);
  border-top: 11px solid transparent; border-bottom: 11px solid transparent;
  margin-left: 5px;
}
.vcard:hover .vcard-play { opacity: 1; }

.vcard-body { padding-top: 14px; }
.vcard-tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 8px;
}
.vcard-title {
  font-family: var(--serif); font-size: 18px; font-weight: 600; line-height: 1.45;
  margin-bottom: 7px; transition: color 0.18s var(--ease);
}
.vcard:hover .vcard-title { color: var(--accent); }
.vcard-sum {
  font-size: 13px; color: var(--muted); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vcard--sm .vcard-title { font-size: 15px; }
.vcard--sm .vcard-sum { display: none; }

/* ---------- pager ---------- */
.pager { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 20px 0 60px; }
.pager-num { font-family: var(--mono); font-size: 13px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 11px 24px; border: 1px solid var(--ink);
  background: transparent; color: var(--ink);
  font-family: var(--sans); font-size: 14px; line-height: 1; cursor: pointer;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--accent); border-color: var(--accent); color: var(--bone); }
.btn--ghost { border-color: var(--line); color: var(--muted); padding: 8px 16px; font-size: 13px; }
.btn--ghost:hover { border-color: var(--accent); background: transparent; color: var(--accent); }

/* ---------- watch ---------- */
.watch { padding-bottom: 80px; }
.player-shell {
  position: relative; aspect-ratio: 16 / 9; background: #000;
  border: 1px solid var(--line); margin-top: 32px;
}
.player { width: 100%; height: 100%; display: block; background: #000; }
.player-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em;
  pointer-events: none; transition: opacity 0.3s var(--ease);
}
.player-hint[hidden] { display: none; }

.watch-head { padding: 30px 0 0; border-bottom: 1px solid var(--line); padding-bottom: 26px; }
.watch-title {
  font-family: var(--serif); font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 600; line-height: 1.4; margin: 12px 0 14px;
}
.watch-meta {
  display: flex; flex-wrap: wrap; gap: 20px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.watch-meta span::before { content: "·"; margin-right: 8px; color: var(--line); }
.watch-meta span:first-child::before { content: none; margin: 0; }

/* ---------- prose ---------- */
.prose { padding: 40px 0; max-width: 760px; font-size: 15.5px; line-height: 1.95; color: #D8D6CE; }
.prose p { margin-bottom: 1.35em; }
.prose h2 {
  font-family: var(--serif); font-size: 23px; font-weight: 600; color: var(--ink);
  margin: 2em 0 0.8em; line-height: 1.5; padding-left: 14px; border-left: 2px solid var(--accent);
}
.prose h3 {
  font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink);
  margin: 1.7em 0 0.7em;
}
.prose a { color: var(--accent); border-bottom: 1px solid var(--accent-line); transition: border-color 0.18s; }
.prose a:hover { border-bottom-color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.35em 1.4em; }
.prose li { margin-bottom: 0.55em; }
.prose img { margin: 1.6em 0; border: 1px solid var(--line); }
.prose blockquote {
  border-left: 2px solid var(--line); padding: 4px 0 4px 20px;
  color: var(--muted); margin: 1.5em 0;
}
.prose code {
  font-family: var(--mono); font-size: 0.88em; background: var(--raised);
  padding: 2px 6px; color: var(--accent);
}
.prose pre {
  background: var(--surface); border: 1px solid var(--line); padding: 18px;
  overflow-x: auto; margin: 1.5em 0; font-size: 13px; line-height: 1.7;
}
.prose pre code { background: none; padding: 0; color: var(--ink); }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2.4em 0; }

/* ---------- link box ---------- */
.section-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 18px;
}
.linkbox { padding: 26px 0; border-top: 1px solid var(--line); }
.linklist { list-style: none; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.linklist li { background: var(--paper); }
.linklist a {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 16px 20px; transition: background 0.18s var(--ease), padding-left 0.22s var(--ease);
}
.linklist a:hover { background: var(--surface); padding-left: 26px; }
.linklist-t { font-size: 14.5px; color: var(--ink); }
.linklist a:hover .linklist-t { color: var(--accent); }
.linklist-u {
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46%;
}

.tags { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 8px; }
.tag { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.related { padding-top: 20px; border-top: 1px solid var(--line); margin-top: 30px; }

/* ---------- empty / 404 ---------- */
.empty { padding: 80px 0 100px; text-align: center; color: var(--muted); }
.empty p { margin-bottom: 24px; }
.notfound { padding: 120px 0 140px; }

/* ---------- foot ---------- */
.foot { margin-top: auto; border-top: 1px solid var(--line); }
.foot-inner { padding: 30px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.foot-note { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .wrap { width: 100% - 32px; width: min(1080px, calc(100% - 32px)); }
  .hero { padding: 44px 0 32px; }
  .grid { grid-template-columns: 1fr; gap: 26px; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .nav-links { gap: 18px; font-size: 13px; }
  .brand-name { font-size: 17px; }
  .prose { font-size: 15px; }
  .linklist a { flex-direction: column; align-items: flex-start; gap: 4px; }
  .linklist-u { max-width: 100%; }
  .watch-meta { gap: 14px; }
}

/* ---------- 返回链接 ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  margin: 26px 0 0; font-size: 13px; color: var(--muted);
  transition: color 0.18s var(--ease);
}
.back-link:hover { color: var(--accent); }
.back-link svg { transition: transform 0.18s var(--ease); }
.back-link:hover svg { transform: translateX(-3px); }
.back-link ~ .player-shell { margin-top: 16px; }

/* ---------- 联系方式：右下角悬浮 ---------- */
.contact {
  position: fixed; right: 26px; bottom: 26px; z-index: 60;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.contact-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 18px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 0;
  font-family: var(--sans); font-size: 14px; line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.contact-btn:hover {
  background: var(--raised); border-color: var(--accent-line); transform: translateY(-1px);
}
.contact-btn svg { color: var(--accent); flex: none; }

.contact-panel {
  width: 252px; padding: 9px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
  opacity: 0; visibility: hidden;
  transform: translateY(10px) scale(0.97); transform-origin: bottom right;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
}
.contact-panel.is-open { opacity: 1; visibility: visible; transform: none; }
.contact-panel img { width: 100%; height: auto; }
.contact-tip {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em;
  color: var(--muted); text-align: center; padding: 10px 0 2px;
}

@media (max-width: 720px) {
  .contact { right: 14px; bottom: 14px; gap: 10px; }
  .contact-panel { width: 216px; }
  .contact-btn { width: 50px; height: 50px; padding: 0; border-radius: 50%; justify-content: center; }
  .contact-btn span { display: none; }
  .back-link { margin-top: 18px; }
}
