/* ============================================================
   风土志 · 剧集目录
   黑白奶牛猫「墨与纸」：纸白底 + 墨黑 + 中性灰，克制无嫩色
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  color-scheme: light dark;
  --paper: #fafaf8;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f1f1ee;
  --text: #262624;
  --ink: #141413;
  --muted: #8b8b85;
  --line: #e7e7e2;
  --accent: #3a3a37;        /* 墨炭（主按钮/强调） */
  --accent-deep: #1c1c1a;
  --accent-soft: #eeeee9;
  --mint: #6f6f68;          /* 灰（原抹茶位，改中性） */
  --mint-soft: #f1f1ee;
  --butter: #b08d47;        /* 暗金（原奶油黄位，收敛） */
  --butter-soft: #f6f0e2;
  --card-line: #e7e7e2;
  --card-line-hover: #b6b6ad;
  --date-ink: #77776f;
  --rating-bg: #eeeee9;
  --rating-ink: #4a4a44;
  --snip-bg: #f8f8f5;
  --snip-line: #e8e8e3;
  --snip-ink: #7c7c74;
  --star-ink: #b8903f;
  --shadow: 0 6px 22px rgba(30, 30, 28, .06);
  --shadow-hover: 0 12px 32px rgba(30, 30, 28, .12);
  --r-lg: 20px;
  --r-md: 15px;
  --r-sm: 10px;
}

@media (prefers-color-scheme: dark) {
  .paw-icon { filter: invert(1) brightness(1.4); opacity: .65; }
  :root {
    --paper: #1a1a18;
    --bg: #141413;
    --surface: #1f1f1d;
    --surface-2: #292926;
    --text: #ecece6;
    --ink: #fafaf6;
    --muted: #9b9b93;
    --line: #34342f;
    --accent: #e6e6df;
    --accent-deep: #ffffff;
    --accent-soft: #2e2e2a;
    --mint: #a6a69e;
    --mint-soft: #262622;
    --butter: #d9b668;
    --butter-soft: #3a3226;
    --card-line: #34342f;
    --card-line-hover: #6f6f66;
    --date-ink: #b4b4ac;
    --rating-bg: #30302c;
    --rating-ink: #e8e8e0;
    --snip-bg: #242421;
    --snip-line: #37372f;
    --snip-ink: #b6b6ad;
    --star-ink: #d9b668;
    --shadow: 0 6px 22px rgba(0, 0, 0, .3);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, .45);
  }
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.65 'Nunito', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-attachment: fixed;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.wrap {
  max-width: 1160px;
  margin: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* 猫爪点缀（纯 CSS）——小尺寸、低调 */
.paw {
  display: inline-block;
  position: relative;
  width: 1.05em;
  height: .9em;
  vertical-align: -.08em;
}
.paw::before {
  content: '';
  position: absolute;
  left: 12%; bottom: 0;
  width: 76%; height: 62%;
  background: currentColor;
  border-radius: 48% 48% 42% 42%;
}
.paw::after {
  content: '';
  position: absolute;
  top: 0; left: 8%;
  width: 84%; height: 42%;
  background:
    radial-gradient(circle at 12% 60%, currentColor 0 22%, transparent 23%),
    radial-gradient(circle at 37% 30%, currentColor 0 22%, transparent 23%),
    radial-gradient(circle at 66% 30%, currentColor 0 22%, transparent 23%),
    radial-gradient(circle at 90% 60%, currentColor 0 22%, transparent 23%);
}

/* ---------- 3. 页头 ---------- */
header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(10px);
}

.nav {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: .01em;
  text-decoration: none;
  color: var(--ink);
}
.brand .cat {
  width: 30px;
  height: 30px;
  flex: none;
}

.navlink {
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
  background: var(--accent-soft);
  padding: 9px 16px;
  border-radius: 999px;
  transition: transform .15s ease, background .15s ease;
}
.navlink:hover { transform: translateY(-1px); background: var(--line); }

/* ---------- 4. Hero ---------- */
.hero { padding-top: 62px; padding-bottom: 48px; }

.eyebrow {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--muted);
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(36px, 6vw, 58px);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
}
/* h1 旁的猫爪：固定 16px 小图标，低调不抢标题 */
.paw-icon {
  width: 16px;
  height: 16px;
  margin-left: 12px;
  vertical-align: .06em;
  opacity: .8;
}

.intro {
  color: var(--muted);
  font-size: 19px;
  margin: 16px 0 30px;
}
.intro .paw { font-size: 15px; color: var(--butter); }

.search {
  max-width: 720px;
  background: var(--surface);
  border: 2px solid var(--card-line);
  border-radius: 999px;
  padding: 7px 7px 7px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search:focus-within { border-color: var(--accent); box-shadow: var(--shadow-hover); }
.search > span { font-size: 26px; line-height: 1; color: var(--accent); }

input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
}

.search button,
#more {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: var(--paper);
  font-weight: 800;
  padding: 11px 24px;
  min-height: 46px;
  box-shadow: 0 5px 14px rgba(30, 30, 28, .18);
  transition: transform .15s ease, box-shadow .15s ease;
}
.search button:hover,
#more:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(30, 30, 28, .26); }

.hint { color: var(--muted); font-size: 14px; margin: 14px 0 0 8px; }

/* ---------- 5. 目录区 ---------- */
.listings { padding-bottom: 72px; }

.sectionhead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 22px;
}

.sectionhead h2 { font-size: 27px; font-weight: 800; margin: 0; line-height: 1.25; color: var(--ink); }
.sectionhead .eyebrow { margin-bottom: 6px; }
#count { font-size: 14px; color: var(--muted); margin: 0; }

.date-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 18px;
  box-shadow: var(--shadow);
}
.date-controls label { font-weight: 800; color: var(--muted); font-size: 14px; }
.date-controls select {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  min-height: 42px;
}
.date-controls span { color: var(--muted); font-size: 14px; }

/* ---------- 6. 海报网格墙 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--card-line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--card-line-hover);
  box-shadow: var(--shadow-hover);
}

.cover {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--surface-2);
  overflow: hidden;
}
.cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 62%, rgba(0, 0, 0, .14));
  pointer-events: none;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform .35s ease;
}
.card:hover .cover img { transform: scale(1.04); }

/* 海报右上角评分角标 */
.cover .badge {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, .95);
  color: var(--rating-ink);
  font-weight: 800;
  font-size: 13px;
  padding: 5px 11px;
  border-radius: 999px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
}
@media (prefers-color-scheme: dark) {
  .cover .badge { background: rgba(31, 31, 29, .95); color: var(--rating-ink); }
}

.cardbody {
  padding: 16px 17px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 9px;
}

.date {
  color: var(--date-ink);
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: .02em;
  margin: 0;
}
.date::before { content: '· '; }

.card h3 {
  font-size: 17px;
  line-height: 1.45;
  font-weight: 800;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.rating { font-size: 14px; color: var(--muted); margin: 0; }
.card .rating-live {
  display: inline-flex;
  align-self: flex-start;
  background: var(--rating-bg);
  color: var(--rating-ink);
  border-radius: 999px;
  padding: 4px 11px;
  font-weight: 800;
  font-size: 13px;
}

.summary {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
  margin: 0;
}

.links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 4px;
}
.links a {
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  background: var(--accent-soft);
  padding: 8px 12px;
  border-radius: 999px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  transition: background .15s ease, transform .15s ease, color .15s ease;
}
.links a:hover { background: var(--accent); color: var(--paper); transform: translateY(-1px); }
.links .links-pending {
  font-size: 12.5px;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--line);
  padding: 7px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}

.more { text-align: center; margin-top: 36px; }
.message { padding: 32px 0; color: var(--muted); }

/* ---------- 7. 卡片内短评（网格版：只显示 1 条摘要） ---------- */
.card-reviews {
  border-top: 1px dashed var(--snip-line);
  margin-top: 6px;
  padding-top: 12px;
}
.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}
.review-head strong { font-size: 13px; color: var(--muted); }
.review-link { color: var(--text); text-decoration: none; white-space: nowrap; }
.review-link:hover { text-decoration: underline; }

.review-snippet {
  background: var(--snip-bg);
  border: 1px solid var(--snip-line);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  margin-top: 9px;
}
/* 网格卡片窄，只留第一条短评 */
.review-snippet:nth-of-type(n + 2) { display: none; }

.review-meta {
  display: flex;
  align-items: center;
  gap: 6px 9px;
  flex-wrap: wrap;
  color: var(--snip-ink);
  font-size: 12px;
}
.review-author { font-weight: 800; }
.review-stars { color: var(--star-ink); letter-spacing: .03em; }
.review-time { margin-left: auto; }

.review-text {
  font-size: 12.5px;
  line-height: 1.55;
  margin: 5px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: var(--text);
}
.review-empty { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }

/* ---------- 8. 页脚 ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 14px;
}
footer .foot-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink); }
footer .cat { width: 20px; height: 20px; }
footer p { margin: 8px 0 0; }

/* ---------- 9. 评价页 ---------- */
.review-page { padding-top: 40px; padding-bottom: 80px; }
.back {
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  padding: 8px 0;
  margin-bottom: 20px;
  font-weight: 700;
}
.review-page h1 { font-size: clamp(32px, 5vw, 46px); font-weight: 800; color: var(--ink); }
.lead { color: var(--muted); margin: 14px 0 30px; }

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--card-line);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow);
}
.panel h2, .section-title h2 { font-size: 21px; font-weight: 800; margin: 0; color: var(--ink); }
.panel p { margin: 8px 0 20px; color: var(--muted); font-size: 14px; }

.field { display: block; font-weight: 800; font-size: 15px; margin: 18px 0 6px; }
.control {
  display: block;
  width: 100%;
  min-height: 46px;
  border: 1.5px solid var(--card-line);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text);
  padding: 10px 13px;
  font: inherit;
}
.control:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea.control { resize: vertical; min-height: 130px; line-height: 1.6; }

.submit {
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: var(--paper);
  font-weight: 800;
  min-height: 48px;
  padding: 11px 20px;
  box-shadow: 0 5px 14px rgba(30, 30, 28, .18);
  transition: transform .15s ease;
}
.submit:hover { transform: translateY(-1px); }
.submit:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.status { font-size: 14px; color: var(--muted); min-height: 1.5em; margin: 12px 0 0 !important; }
.cf-turnstile { margin: 18px 0; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.section-title span { color: var(--muted); font-size: 14px; }
.review-filter { margin-bottom: 14px; }
.review-list { display: grid; gap: 14px; }

.review-card {
  border: 1px solid var(--card-line);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.review-card h3 { font-size: 16px; line-height: 1.5; font-weight: 800; margin: 0 0 8px; overflow-wrap: anywhere; color: var(--ink); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: 13.5px; }
.stars { color: var(--star-ink); letter-spacing: 1px; }
.review-content { margin: 12px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.empty { color: var(--muted); padding: 24px 0; }

.showmore {
  margin-top: 18px;
  min-height: 44px;
  border: 1px solid var(--card-line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  padding: 8px 20px;
}
.showmore:hover { background: var(--surface-2); }

.review-form { position: sticky; top: 20px; }

/* 剧名联想下拉 */
.drama-combo { position: relative; }
.drama-combo #drama { padding-right: 46px; }
.combo-toggle {
  position: absolute;
  right: 4px; top: 3px;
  width: 40px; height: 40px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--accent);
  font-size: 23px;
  cursor: pointer;
}
.combo-toggle:hover { background: var(--accent-soft); }
.combo-toggle:disabled { opacity: .5; }
.combo-menu {
  position: absolute;
  z-index: 10;
  left: 0; right: 0;
  top: calc(100% + 5px);
  background: var(--surface);
  border: 1px solid var(--card-line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-hover);
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
}
.combo-menu[hidden] { display: none; }
.combo-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1.4;
  padding: 10px;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.combo-option:hover, .combo-option.active { background: var(--accent-soft); color: var(--ink); }
.combo-hint { padding: 8px 10px; font-size: 13px; color: var(--muted); }

/* 星级选择 */
.star-field { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
.star-field legend { padding: 0; font-weight: 800; font-size: 15px; }
.star-picker { display: flex; align-items: center; flex-wrap: nowrap; width: 100%; gap: 0; margin: 4px 0; }
.star-choice {
  position: relative;
  display: inline-flex;
  flex: 0 1 40px;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  color: #c4c4bc;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.star-choice:hover { background: var(--accent-soft); }
.star-choice.active { color: var(--star-ink); }
.star-choice input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.star-choice:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.star-caption { color: var(--muted); font-size: 14px; white-space: nowrap; flex-shrink: 0; margin-left: 6px; }

/* ---------- 10. 响应式 ---------- */
@media (max-width: 800px) {
  .review-layout { grid-template-columns: 1fr; }
  .review-form { position: static; grid-row: 1; }
  .review-page { padding-top: 28px; }
  .panel { padding: 20px; }
}

@media (max-width: 540px) {
  .wrap { padding-left: 18px; padding-right: 18px; }
  .hero { padding-top: 46px; padding-bottom: 40px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .card { border-radius: 16px; }
  .cardbody { padding: 13px 13px 15px; gap: 7px; }
  .card h3 { font-size: 15px; }
  .summary { -webkit-line-clamp: 2; font-size: 12.5px; }
  .review-head strong { font-size: 12px; }
  .links a { padding: 7px 10px; font-size: 12px; }
  .sectionhead { align-items: start; }
  #count { text-align: right; }
  .review-time { margin-left: 0; }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
