/* ==========================================================================
   AnimeList — AniList-inspired dark-first redesign
   ========================================================================== */

:root {
  /* ── Core palette (dark-first, AniList inspired) ─────────────────────── */
  --c-bg:          #0b0e14;
  --c-surface:     #151b28;
  --c-card:        #1a2235;
  --c-border:      #252d3d;
  --c-text:        #e8eaf0;
  --c-muted:       #7b8da6;

  /* ── Accent ───────────────────────────────────────────────────────────── */
  --c-brand:       #3db4f2;
  --c-brand-d:     #2196d5;
  --c-brand-light: #1a3a52;
  --c-accent:      #f0a541;
  --c-accent-d:    #d97706;

  /* ── Backward-compat aliases ─────────────────────────────────────────── */
  --c-primary:     var(--c-brand);
  --c-primary-d:   var(--c-brand-d);
  --c-hover:       #1f2d42;
  --c-link:        var(--c-brand);

  /* ── Inputs ──────────────────────────────────────────────────────────── */
  --c-input-bg:    #1a2235;
  --c-input-border:#252d3d;

  /* ── Tags ────────────────────────────────────────────────────────────── */
  --c-tag-bg:      #1a3a52;
  --c-tag-text:    #3db4f2;

  /* ── Code ────────────────────────────────────────────────────────────── */
  --c-code-bg:     #151b28;

  /* ── Geometry & motion ───────────────────────────────────────────────── */
  --radius:        6px;
  --radius-lg:     10px;
  --shadow:        0 2px 8px rgba(0,0,0,0.4);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.35);
  --shadow-lg:     0 4px 20px rgba(0,0,0,0.6);
  --transition:    150ms cubic-bezier(0.4,0,0.2,1);
  --content-max:   1100px;
  --gap:           1rem;
  --gap-lg:        1.5rem;
}

/* ── Light mode override (html.light class) ──────────────────────────────── */
html.light {
  --c-bg:          #f0f2f5;
  --c-surface:     #ffffff;
  --c-card:        #ffffff;
  --c-border:      #e4e8ee;
  --c-text:        #1a2235;
  --c-muted:       #6b7a90;
  --c-brand:       #2b6cb0;
  --c-brand-d:     #1a4d8f;
  --c-brand-light: #ebf4ff;
  --c-hover:       #eef2f7;
  --c-link:        #2b6cb0;
  --c-input-bg:    #ffffff;
  --c-input-border:#d1d5db;
  --c-tag-bg:      #ebf4ff;
  --c-tag-text:    #1a4d8f;
  --c-code-bg:     #f3f4f6;
  --shadow:        0 2px 8px rgba(0,0,0,0.1);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg:     0 4px 20px rgba(0,0,0,0.15);
}

/* ── Dark class (explicit user toggle) ─────────────────────────────────────
   Default variables already are dark — html.dark just ensures the class
   overrides any stale prefers-color-scheme:light cascade.                  */
html.dark {
  --c-bg:          #0b0e14;
  --c-surface:     #151b28;
  --c-card:        #1a2235;
  --c-border:      #252d3d;
  --c-text:        #e8eaf0;
  --c-muted:       #7b8da6;
  --c-brand:       #3db4f2;
  --c-brand-d:     #2196d5;
  --c-brand-light: #1a3a52;
  --c-hover:       #1f2d42;
  --c-link:        #3db4f2;
  --c-input-bg:    #1a2235;
  --c-input-border:#252d3d;
  --c-tag-bg:      #1a3a52;
  --c-tag-text:    #3db4f2;
  --c-code-bg:     #151b28;
  --shadow:        0 2px 8px rgba(0,0,0,0.4);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.35);
  --shadow-lg:     0 4px 20px rgba(0,0,0,0.6);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: 'Inter', -apple-system, 'Hiragino Sans', 'Meiryo', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

a {
  color: var(--c-link);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  background: rgba(11,14,20,0.95);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem var(--gap);
  flex-wrap: wrap;
}

/* ── Logo ──────────────────────────────────────────────────────────────────── */
.site-logo,
.site-title {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark,
.site-title-mark {
  width: 30px; height: 30px;
  background: var(--c-brand);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.logo-text,
.site-title-text {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--c-text);
}

/* ── Main nav ─────────────────────────────────────────────────────────────── */
.header-nav {
  display: flex;
  gap: 0.15rem;
  align-items: center;
  margin-left: 0.5rem;
}

.nav-link {
  padding: 0.35rem 0.7rem;
  color: var(--c-muted);
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-link:hover { color: var(--c-text); background: var(--c-hover); text-decoration: none; }
.nav-link--new { color: var(--c-brand); font-weight: 700; }

/* ── Header right cluster ────────────────────────────────────────────────── */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  flex-wrap: nowrap;
  margin-left: auto;
}

/* ── Header search ───────────────────────────────────────────────────────── */
.header-search,
.search-form {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex: 1 1 180px;
  min-width: 0;
}

.header-search input,
.search-form input[type="search"],
.search-form input[type="number"] {
  padding: 0.4rem 0.75rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  color: var(--c-text);
  font: inherit;
  font-size: 0.875rem;
  transition: border-color var(--transition);
}
.header-search input { width: 200px; }
.search-form input[type="search"] { flex: 2 1 180px; min-width: 130px; }
.search-form input[type="number"] { flex: 1 1 80px; max-width: 100px; }
.header-search input:focus,
.search-form input:focus {
  outline: none;
  border-color: var(--c-brand);
}

.header-search input::placeholder,
.search-form input::placeholder { color: var(--c-muted); }

.header-search button,
.search-form button {
  padding: 0.4rem 0.85rem;
  background: var(--c-brand);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
  white-space: nowrap;
}
.header-search button:hover,
.search-form button:hover { background: var(--c-brand-d); }

/* ── Header tool buttons ─────────────────────────────────────────────────── */
.header-tools {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.tool-btn,
.fav-filter-btn,
.dark-mode-btn {
  padding: 0.3rem 0.55rem;
  background: none;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  color: var(--c-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
  line-height: 1;
}
.tool-btn:hover,
.fav-filter-btn:hover,
.dark-mode-btn:hover {
  color: var(--c-text);
  border-color: var(--c-brand);
  background: var(--c-hover);
  text-decoration: none;
}

.fav-filter-btn.fav-filter-on {
  background: rgba(240,165,65,0.15);
  border-color: var(--c-accent);
  color: var(--c-accent);
  font-weight: 600;
}

/* ── Tag / format nav bar ───────────────────────────────────────────────── */
.fmt-nav,
.tag-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0.45rem var(--gap);
  border-top: 1px solid var(--c-border);
}

.tag-nav-label {
  font-size: 0.75rem;
  color: var(--c-muted);
  font-weight: 600;
  white-space: nowrap;
  margin-right: 0.2rem;
}

.fmt-nav .format-badge {
  font-size: 0.72rem;
  padding: 0.2em 0.6em;
  border-radius: 99px;
  text-decoration: none;
}

/* ==========================================================================
   Hero / Page headings
   ========================================================================== */
.hero {
  padding: var(--gap-lg) 0 var(--gap);
}
.hero h1,
.hero-title {
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}
.hero-desc,
.hero-lead {
  color: var(--c-muted);
  margin: 0 0 0.6rem;
}
.hero-fav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.25rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--gap);
  margin: var(--gap-lg) 0 var(--gap);
}
.page-header h1 { font-size: 1.5rem; margin: 0; }
.result-count { font-size: 1rem; font-weight: 400; color: var(--c-muted); }
.page-range-info { margin: 0.2rem 0 0; font-size: 0.82rem; color: var(--c-muted); }
.page-subtitle { color: var(--c-muted); font-size: 0.88rem; margin: 0.2rem 0 0; }

/* ==========================================================================
   Table
   ========================================================================== */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--gap-lg);
}

.anime-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.anime-table th,
.anime-table td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  vertical-align: middle;
}
.anime-table tbody td { vertical-align: top; }

.anime-table thead th {
  background: var(--c-card);
  color: var(--c-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.anime-table tbody tr {
  transition: background var(--transition);
}
.anime-table tbody tr:hover { background: var(--c-hover); }
.anime-table tbody tr:last-child td { border-bottom: none; }

/* alternating subtle row tint */
.anime-table tbody tr:nth-child(even) { background: rgba(21,27,40,0.5); }
.anime-table tbody tr:nth-child(even):hover { background: var(--c-hover); }

.anime-table .col-year     { width: 5rem;   white-space: nowrap; }
.anime-table .col-link     { width: 8.5rem; white-space: nowrap; }
.anime-table .col-fetched  { width: 7rem;   color: var(--c-muted); white-space: nowrap; font-size: 0.82rem; }
.anime-table .col-title    { word-break: break-word; overflow-wrap: anywhere; line-height: 1.4; }

/* ── Year group header row ───────────────────────────────────────────────── */
.year-group-header td.year-group-label {
  background: linear-gradient(90deg, var(--c-brand-light), transparent);
  color: var(--c-brand);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.8rem;
  border-top: 1px solid var(--c-border);
  scroll-margin-top: 4rem;
}

/* ==========================================================================
   Search summary / conditions
   ========================================================================== */
.search-summary {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  margin: 0 0 var(--gap);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}
.search-conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  padding: 0; margin: 0;
}
.search-conditions li {
  background: var(--c-brand-light);
  color: var(--c-brand);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}
.cond-key { font-weight: 600; color: var(--c-muted); }
.sort-form { display: flex; gap: 0.35rem; align-items: center; font-size: 0.88rem; }

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  margin: var(--gap) 0 var(--gap-lg);
}
.pagination-summary { color: var(--c-muted); font-size: 0.88rem; }
.pagination-links {
  display: flex;
  gap: 0.3rem;
  list-style: none;
  padding: 0; margin: 0;
  align-items: center;
  flex-wrap: wrap;
}
.pagination-links li { display: inline-flex; }
.pagination-links a,
.pagination-links span {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-brand);
  text-decoration: none;
  font-size: 0.88rem;
  transition: all var(--transition);
}
.pagination-links a:hover {
  background: var(--c-hover);
  border-color: var(--c-brand);
  text-decoration: none;
}
.pagination-links li.disabled span { color: var(--c-muted); background: var(--c-card); }
.pagination-current {
  background: var(--c-brand);
  color: #fff !important;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--c-brand);
  font-size: 0.88rem;
}

/* ── Pager (alternative pagination) ─────────────────────────────────────── */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
  margin: 1rem 0 0.5rem;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition);
}
.pager-btn:hover {
  background: var(--c-hover);
  border-color: var(--c-brand);
  color: var(--c-brand);
  text-decoration: none;
}
.pager-btn--current {
  background: var(--c-brand);
  color: #fff;
  border-color: var(--c-brand);
  font-weight: 600;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(61,180,242,0.25);
}
.pager-ellipsis {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.2rem;
  color: var(--c-muted);
  font-size: 0.875rem;
}

/* ==========================================================================
   Breadcrumbs / year nav
   ========================================================================== */
.breadcrumbs { margin: var(--gap) 0 0.5rem; color: var(--c-muted); font-size: 0.88rem; }
.breadcrumbs .sep { margin: 0 0.35rem; }
.breadcrumb { display: flex; align-items: center; gap: 0.35rem; font-size: 0.82rem; color: var(--c-muted); margin-bottom: 1.25rem; }
.breadcrumb a { color: var(--c-brand); text-decoration: none; }
.breadcrumb-sep { color: var(--c-muted); }
.year-nav { display: flex; gap: 0.4rem; }

/* ==========================================================================
   Year chart
   ========================================================================== */
.chart-section { padding: var(--gap) 0 var(--gap-lg); }
.chart-section--compact { padding: 0.5rem 0 0.75rem; }
/* Compact search chart: cap height so a wide viewport doesn't blow the bar
   chart up to ~400px (Chart.js with maintainAspectRatio:false fills its
   parent, so the height lives here rather than the <canvas height> attr). */
.chart-section--compact .chart-wrap {
  height: 140px;
  position: relative;
}
.chart-section--compact .chart-wrap canvas {
  height: 140px !important;
}
.chart-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem;
}
.chart-wrap { overflow: visible; }
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 160px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--c-border);
  position: relative;
  width: 100%;
}
.chart-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-decoration: none;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  position: relative;
}
.chart-bar-wrap:hover .chart-bar   { opacity: 1; background: var(--c-brand); }
.chart-bar-wrap:hover .chart-label { color: var(--c-brand); font-weight: 600; }
.chart-bar-wrap:hover .chart-cnt   { opacity: 1; }
.chart-bar {
  display: block;
  width: 100%;
  height: calc(var(--h) * 1.36px);
  min-height: 2px;
  background: var(--c-brand);
  opacity: 0.35;
  border-radius: 3px 3px 0 0;
  transition: opacity 0.15s, background 0.15s;
  flex-shrink: 0;
}
.chart-label {
  position: absolute;
  bottom: -22px;
  font-size: 0.5rem;
  color: var(--c-muted);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  white-space: nowrap;
  line-height: 1;
  transition: color 0.15s;
  height: 20px;
  overflow: hidden;
}
.chart-cnt {
  position: absolute;
  top: -1.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  color: var(--c-brand);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

/* ==========================================================================
   Year grid (top page)
   ========================================================================== */
.years-section { padding: var(--gap) 0 var(--gap-lg); }
.year-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.6rem;
}
.year-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 0.5rem;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--c-text);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.year-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--c-brand);
  text-decoration: none;
  transform: translateY(-2px);
}
.year-card-year { font-size: 1.25rem; font-weight: 700; color: var(--c-brand); }
.year-card-count { font-size: 0.77rem; color: var(--c-muted); margin-top: 0.2rem; }
.year-card-count strong { color: var(--c-text); }
.col-char { color: var(--c-muted); font-size: 0.85rem; white-space: nowrap; }
.char-search-link { color: var(--c-muted); font-size: 0.85rem; }
.char-search-link:hover { color: var(--c-brand); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  background: var(--c-brand);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid var(--c-brand);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.btn:hover { background: var(--c-brand-d); text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: var(--c-brand);
  border: 1px solid var(--c-border);
}
.btn-ghost:hover { background: var(--c-hover); }
.btn-sm { font-size: 0.82rem; padding: 0.25rem 0.65rem; }
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--c-text);
  text-decoration: none;
  background: var(--c-card);
  transition: background var(--transition);
}
.btn-back:hover { background: var(--c-hover); text-decoration: none; }

/* ==========================================================================
   Misc utilities
   ========================================================================== */
.empty-message {
  padding: 2rem 1.5rem;
  background: var(--c-surface);
  border: 1px dashed var(--c-border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--c-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}
.empty-message::before {
  content: "（・_・？）";
  display: block;
  font-size: 1.5rem;
  color: var(--c-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}
.empty-message code {
  background: var(--c-brand-light);
  color: var(--c-brand);
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.error-page { text-align: center; padding: 4rem 1rem; }
.error-code { font-size: 4rem; font-weight: 700; color: var(--c-brand); margin: 0; line-height: 1; }
.error-message { color: var(--c-muted); margin-bottom: 1.5rem; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--c-border);
  color: var(--c-muted);
  background: var(--c-surface);
  text-align: center;
  font-size: 0.82rem;
}
.site-footer a { color: var(--c-brand); }

/* ==========================================================================
   Anime Detail page
   ========================================================================== */
.detail-hero {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.4rem 1.2rem;
  margin: var(--gap) 0 var(--gap-lg);
  box-shadow: var(--shadow);
}
.detail-hero-inner { overflow: hidden; }
.detail-main-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0 0 0.55rem;
  line-height: 1.25;
  word-break: break-word;
}
.detail-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.detail-year-badge {
  display: inline-block;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  background: var(--c-brand);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}
.detail-year-badge:hover { opacity: 0.85; text-decoration: none; }
.detail-meta-badge {
  display: inline-block;
  padding: 0.18em 0.55em;
  border-radius: 999px;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  font-size: 0.8rem;
  color: var(--c-muted);
}
.detail-score {
  color: var(--c-accent);
  border-color: rgba(240,165,65,0.3);
  background: rgba(240,165,65,0.08);
  position: relative;
  overflow: hidden;
  padding-left: 0.5em;
}
.detail-score .score-bar {
  position: absolute; inset: 0; left: 0;
  width: calc(var(--pct) * 1%);
  background: currentColor;
  opacity: 0.15;
  pointer-events: none;
}
.detail-score .score-num { position: relative; }
.detail-score.score-high { color: #4ade80; border-color: rgba(74,222,128,0.3); background: rgba(74,222,128,0.08); }
.detail-score.score-mid  { color: var(--c-accent); border-color: rgba(240,165,65,0.3); background: rgba(240,165,65,0.08); }
.detail-score.score-low  { color: #f87171; border-color: rgba(248,113,113,0.3); background: rgba(248,113,113,0.08); }

.genre-badge {
  display: inline-block;
  padding: 0.12em 0.5em;
  border-radius: 999px;
  background: var(--c-brand-light);
  color: var(--c-brand);
  font-size: 0.75rem;
  border: 1px solid rgba(61,180,242,0.2);
}
.detail-genres { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.45rem; }

.detail-cover-img {
  float: right;
  width: 120px;
  border-radius: var(--radius);
  margin: 0 0 0.5rem 1rem;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.detail-synopsis {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-brand);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.9rem 1.1rem;
  margin: 0;
  color: var(--c-text);
  line-height: 1.75;
  font-size: 0.92rem;
}

.detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-lg);
  margin-bottom: 2.5rem;
}
.detail-section {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.detail-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-brand);
  border-left: 3px solid var(--c-brand);
  background: linear-gradient(90deg, var(--c-brand-light), transparent);
  border-bottom: 1px solid var(--c-border);
  padding: 0.55rem 1rem 0.55rem 0.8rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.section-count {
  background: var(--c-border);
  color: var(--c-muted);
  border-radius: 999px;
  padding: 0.1em 0.55em;
  font-size: 0.82em;
  font-weight: 600;
}
.detail-section--staff { align-self: start; }
.detail-section--cast  { align-self: start; }

/* Staff table */
.detail-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.detail-table tr:not(:last-child) td,
.detail-table tr:not(:last-child) th { border-bottom: 1px solid var(--c-border); }
.detail-role {
  padding: 0.5rem 0.85rem;
  font-weight: 600;
  color: var(--c-muted);
  font-size: 0.8rem;
  white-space: nowrap;
  width: 10rem;
  vertical-align: top;
  background: rgba(0,0,0,0.15);
}
.detail-names { padding: 0.5rem 1rem; line-height: 1.6; }
.name-item { display: inline; }
.name-sep { color: var(--c-muted); }
.staff-link {
  display: inline-block;
  color: var(--c-accent);
  text-decoration: none;
  border-radius: 3px;
  padding: 0 0.15em;
  transition: background 0.15s;
}
.staff-link:hover { background: rgba(240,165,65,0.15); text-decoration: underline; }

/* Cast grid */
.cast-grid { padding: 0.65rem; display: flex; flex-direction: column; gap: 0.25rem; }
.cast-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius);
  background: var(--c-bg);
  font-size: 0.85rem;
  transition: background var(--transition);
}
.cast-card:hover { background: var(--c-hover); }
.cast-char { font-weight: 600; color: var(--c-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast-sep  { color: var(--c-muted); font-size: 0.78em; }
.cast-actor { color: var(--c-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.detail-empty {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--c-muted);
  border: 1px dashed var(--c-border);
  border-radius: var(--radius);
  margin-bottom: 2rem;
}
.detail-memo-section { margin-top: 1.5rem; }

/* ==========================================================================
   Character / Cast grid  (char-grid)
   ========================================================================== */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
  margin-top: var(--gap);
}

.char-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 0;
  text-align: center;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  position: relative;
}
.char-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

/* Cover-image-first layout inside char-card */
.char-card .char-img,
.char-card .char-img--placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  height: auto;
  object-fit: cover;
  border-radius: 0;
  display: block;
  transition: transform var(--transition);
}
.char-card:hover .char-img { transform: scale(1.05); }

/* Overlay title on hover */
.char-info {
  width: 100%;
  padding: 0.45rem 0.5rem;
  background: var(--c-card);
}

.char-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 0.3rem;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.va-info {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  justify-content: center;
  margin-top: 0.2rem;
}
.va-img { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.va-name { font-size: 0.72rem; color: var(--c-muted); }

/* ==========================================================================
   Series grid (series page / related works)
   ========================================================================== */
.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem;
}

.series-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--c-card);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.series-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); text-decoration: none; }
.series-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  transition: transform var(--transition);
}
.series-card:hover img { transform: scale(1.05); }
.series-card-info {
  padding: 0.4rem 0.45rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.series-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--c-text);
}
.series-card-meta { font-size: 0.68rem; color: var(--c-muted); }

/* ==========================================================================
   Favorite button
   ========================================================================== */
.fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  width: 1.8rem; height: 1.8rem;
  font-size: 1rem;
  color: var(--c-muted);
  cursor: pointer;
  line-height: 1; padding: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  vertical-align: middle;
}
.fav-btn:hover { border-color: var(--c-accent); color: var(--c-accent); }
.fav-btn.fav-on {
  background: rgba(240,165,65,0.15);
  border-color: var(--c-accent);
  color: var(--c-accent);
}
.fav-btn--sm {
  width: 1.3rem; height: 1.3rem;
  font-size: 0.75rem;
  border-width: 1px;
  margin-right: 0.25rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Streaming links
   ========================================================================== */
.stream-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem; height: 1.4rem;
  border-radius: 3px;
  font-size: 0.66rem;
  font-weight: 700;
  text-decoration: none;
  line-height: 1;
  transition: opacity 0.15s;
  position: relative;
  cursor: pointer;
  border: none; padding: 0;
}
.stream-btn:hover { opacity: 0.8; }
.stream-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.88);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 3px 6px;
  border-radius: 3px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 9999;
}
.stream-btn[data-tip]:hover::after { opacity: 1; }
.stream-btn--google  { background: #4285f4; color: #fff; margin-right: 0.2rem; }
.stream-btn--youtube { background: #ff0000; color: #fff; margin-right: 0.2rem; }
.stream-btn--netflix { background: #e50914; color: #fff; margin-right: 0.2rem; }
.stream-btn--prime   { background: #00a8e0; color: #fff; margin-right: 0.2rem; }
.stream-btn--abema   { background: #00d4aa; color: #fff; margin-right: 0.2rem; }
.stream-btn--danime  { background: #e60012; color: #fff; margin-right: 0.2rem; }
.col-stream { white-space: nowrap; width: 13rem; }
.stream-links { display: inline-flex; align-items: center; gap: 0.2rem; }
.detail-hero-meta .stream-links .stream-btn {
  width: 1.7rem; height: 1.7rem;
  font-size: 0.75rem; border-radius: 4px;
}

/* ==========================================================================
   Watch status buttons
   ========================================================================== */
.ws-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  width: 1.5rem; height: 1.5rem;
  font-size: 0.7rem;
  color: var(--c-muted);
  cursor: pointer;
  padding: 0; line-height: 1;
  margin-left: 0.3rem;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  flex-shrink: 0;
}
.ws-btn:hover { border-color: var(--c-brand); color: var(--c-text); }
.ws-btn.ws-plan     { background: rgba(59,130,246,0.15); border-color: #3b82f6; color: #60a5fa; }
.ws-btn.ws-watching { background: rgba(34,197,94,0.15);  border-color: #22c55e; color: #4ade80; }
.ws-btn.ws-done     { background: rgba(74,222,128,0.1);  border-color: #4ade80; color: #4ade80; }

/* ws-btns inline cluster */
.ws-btns { display: inline-flex; gap: 0.15rem; margin-left: 0.35rem; vertical-align: middle; }
.ws-btn--plan.ws-btn--active    { background: rgba(59,130,246,0.2);  color: #60a5fa; border-color: #3b82f6; }
.ws-btn--watching.ws-btn--active { background: rgba(251,191,36,0.2); color: #fbbf24; border-color: #fbbf24; }
.ws-btn--done.ws-btn--active    { background: rgba(74,222,128,0.15); color: #4ade80; border-color: #4ade80; }

/* ==========================================================================
   Year inline (in title cell)
   ========================================================================== */
.col-title-right {
  float: right;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.4rem;
}
.col-year-inline { font-size: 0.75rem; color: var(--c-muted); white-space: nowrap; }
.col-year-inline a { color: inherit; text-decoration: none; }
.col-year-inline a:hover { text-decoration: underline; }

/* ==========================================================================
   Search sections
   ========================================================================== */
.search-section { margin-bottom: 1.75rem; }
.search-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-text);
  border-left: 3px solid var(--c-accent);
  padding-left: 0.55rem;
  margin: 0 0 0.65rem;
}
.search-empty { color: var(--c-muted); font-size: 0.88rem; padding: 0.4rem 0; margin: 0; }
.col-date { font-size: 0.75rem; color: var(--c-muted); white-space: nowrap; }
.fav-log-on  { color: var(--c-accent); font-size: 0.8rem; font-weight: 700; white-space: nowrap; }
.fav-log-off { color: var(--c-muted);  font-size: 0.8rem; font-weight: 700; white-space: nowrap; }

/* ==========================================================================
   Format badges
   ========================================================================== */
.format-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1em 0.45em;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 0.25rem;
  white-space: nowrap;
  background: var(--c-card);
  color: var(--c-muted);
  border: 1px solid var(--c-border);
}
.format-badge--tv      { background: rgba(59,130,246,0.12); color: #60a5fa; border-color: rgba(59,130,246,0.25); }
.format-badge--movie   { background: rgba(245,158,11,0.12); color: #fbbf24; border-color: rgba(245,158,11,0.25); }
.format-badge--ova     { background: rgba(139,92,246,0.12); color: #a78bfa; border-color: rgba(139,92,246,0.25); }
.format-badge--ona     { background: rgba(16,185,129,0.12); color: #34d399; border-color: rgba(16,185,129,0.25); }
.format-badge--special { background: rgba(236,72,153,0.12); color: #f472b6; border-color: rgba(236,72,153,0.25); }
.format-badge--manga   { background: rgba(248,113,113,0.12); color: #f87171; border-color: rgba(248,113,113,0.25); }
.format-badge--music   { background: rgba(14,165,233,0.12);  color: #38bdf8; border-color: rgba(14,165,233,0.25); }
.format-badge.format-large { font-size: 0.88rem; padding: 0.28em 0.85em; border-radius: 99px; }
.format-section { margin: 1.25rem 0; }
.format-list { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.45rem; }

a.format-badge--tv:hover      { background: #3b82f6;  color: #fff; border-color: #3b82f6; }
a.format-badge--movie:hover   { background: #f97316;  color: #fff; border-color: #f97316; }
a.format-badge--ova:hover     { background: #8b5cf6;  color: #fff; border-color: #8b5cf6; }
a.format-badge--ona:hover     { background: #10b981;  color: #fff; border-color: #10b981; }
a.format-badge--special:hover { background: #ec4899;  color: #fff; border-color: #ec4899; }
a.format-badge--manga:hover   { background: #ef4444;  color: #fff; border-color: #ef4444; }

.air-schedule-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1em 0.45em;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 0.35rem;
  white-space: nowrap;
  background: rgba(52,211,153,0.12);
  color: #34d399;
}

.last-air-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1em 0.45em;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 0.35rem;
  white-space: nowrap;
  background: rgba(148,163,184,0.12);
  color: #94a3b8;
}
.last-air-badge--future {
  background: rgba(251,191,36,0.12);
  color: #fbbf24;
}

/* ==========================================================================
   Search filter bar
   ========================================================================== */
.search-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.65rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  margin-bottom: 0.4rem;
}
.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-muted);
  white-space: nowrap;
  min-width: 3rem;
}
.filter-label--year { min-width: auto; }

.sort-tabs { display: flex; gap: 0.2rem; flex-wrap: wrap; }
.sort-tab {
  padding: 0.25rem 0.85rem;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-bg);
  color: var(--c-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.sort-tab:hover:not(.sort-tab--active) {
  background: var(--c-hover);
  border-color: var(--c-brand);
  color: var(--c-brand);
}
.sort-tab--active {
  background: var(--c-brand);
  color: #fff;
  border-color: var(--c-brand);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(61,180,242,0.25);
}

.filter-select,
.filter-year {
  padding: 0.25rem 0.45rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.filter-year { width: 5rem; }
.filter-year-sep { font-size: 0.85rem; color: var(--c-muted); align-self: center; }
.filter-submit-btn {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--c-brand);
  border-radius: var(--radius);
  background: var(--c-brand);
  color: #fff;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.filter-submit-btn:hover { background: var(--c-brand-d); }

/* ==========================================================================
   Recommendations page
   ========================================================================== */
.rec-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 3rem 0;
  color: var(--c-muted);
}
.rec-spinner {
  width: 2rem; height: 2rem;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.rec-error { color: #f87171; padding: 1rem 0; }
.rec-empty { padding: 2rem 0; color: var(--c-muted); line-height: 1.8; }
.rec-meta  { font-size: 0.82rem; color: var(--c-muted); margin-bottom: 1.1rem; }

.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.rec-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.rec-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.rec-card-head { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--c-muted); }

.rec-match-label {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 2rem;
  font-size: 0.7rem;
  font-weight: 600;
}
.label-author   { background: rgba(251,191,36,0.15);  color: #fbbf24; }
.label-director { background: rgba(59,130,246,0.15);  color: #60a5fa; }
.label-series   { background: rgba(14,165,233,0.15);  color: #38bdf8; }
.label-chara    { background: rgba(167,139,250,0.15); color: #a78bfa; }
.label-studio   { background: rgba(148,163,184,0.12); color: #94a3b8; }
.label-va       { background: rgba(52,211,153,0.15);  color: #34d399; }
.label-genre    { background: rgba(244,114,182,0.15); color: #f472b6; }
.label-world    { background: rgba(139,92,246,0.15);  color: #a78bfa; }
.label-other    { background: var(--c-border);        color: var(--c-muted); }

.rec-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--c-brand);
  text-decoration: none;
  line-height: 1.3;
}
.rec-title:hover { text-decoration: underline; }
.rec-reason { font-size: 0.8rem; color: var(--c-muted); margin: 0; line-height: 1.5; flex: 1; }
.rec-actions { display: flex; gap: 0.2rem; margin-top: 0.2rem; }

.rec-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  margin-bottom: 1rem;
}
.rec-filter-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.rec-filter-tab {
  padding: 0.18rem 0.65rem;
  border: 1px solid var(--c-border);
  border-radius: 2rem;
  background: transparent;
  color: var(--c-muted);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.rec-filter-tab:hover,
.rec-filter-tab.active { background: var(--c-brand); color: #fff; border-color: var(--c-brand); }
.rec-refresh-btn {
  margin-left: auto;
  padding: 0.22rem 0.7rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--c-muted);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.12s;
}
.rec-refresh-btn:hover  { background: var(--c-surface); color: var(--c-text); }
.rec-refresh-btn:disabled { opacity: 0.5; cursor: default; }
.rec-fav-btn { margin-left: auto; }
.rec-cache-note { font-size: 0.72rem; color: var(--c-muted); margin-left: 0.35rem; }

/* ==========================================================================
   Favorites page
   ========================================================================== */
.fav-section { margin-bottom: 2.25rem; }
.fav-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-border);
  padding-bottom: 0.35rem;
  margin-bottom: 0.85rem;
}
.fav-empty { color: var(--c-muted); font-size: 0.88rem; padding: 0.4rem 0; }
.memo-row td { padding: 0.2rem 0.7rem 0.65rem !important; }
.memo-cell { display: flex; gap: 0.4rem; align-items: flex-start; }
.memo-input {
  flex: 1;
  font-size: 0.8rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 0.35rem 0.55rem;
  resize: vertical;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: inherit;
  min-width: 0;
}
.memo-input:focus { outline: 2px solid var(--c-brand); }
.memo-save-btn {
  flex-shrink: 0;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-surface);
  color: var(--c-text);
  cursor: pointer;
  white-space: nowrap;
}
.memo-save-btn:hover { background: var(--c-hover); }

/* ==========================================================================
   Voice actor page
   ========================================================================== */
.va-anime-grid { display: flex; flex-direction: column; gap: 0.4rem; }
.va-year-group { margin: 0.85rem 0 0.2rem; border-bottom: 1px solid var(--c-border); padding-bottom: 0.2rem; }
.va-year-label { font-size: 0.95rem; font-weight: 700; color: var(--c-muted); }
.va-anime-card { border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface); overflow: hidden; }
.va-anime-card-link {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.45rem;
  color: inherit;
  text-decoration: none;
}
.va-anime-card-link:hover { background: var(--c-hover); }
.va-anime-thumb {
  width: 50px; min-width: 50px; height: 70px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
}
.va-anime-thumb--placeholder { background: var(--c-border); border-radius: 3px; }
.va-anime-card-info { flex: 1; min-width: 0; }
.va-anime-title { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.2rem; }
.va-char-list { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.va-char-name {
  font-size: 0.75rem;
  padding: 0.08rem 0.35rem;
  border: 1px solid var(--c-border);
  border-radius: 3px;
  background: var(--c-bg);
  color: var(--c-text);
  text-decoration: none;
}
.va-char-name:hover { background: var(--c-hover); }

.va-tags { display: inline-flex; flex-wrap: wrap; gap: 0.15rem; margin-left: 0.25rem; vertical-align: middle; }
.va-tag {
  display: inline-block;
  padding: 0.08rem 0.4rem;
  border-radius: 2rem;
  font-size: 0.65rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(52,211,153,0.1);
  color: #34d399;
  border: 1px solid rgba(52,211,153,0.25);
  transition: background 0.15s;
}
.va-tag:hover { background: rgba(52,211,153,0.2); }

.va-tags-section {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0.7rem;
  padding: 0.45rem 0.2rem;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
}

/* ==========================================================================
   Character hero
   ========================================================================== */
.char-hero { display: flex; flex-direction: column; align-items: center; margin: 1.25rem 0 0.5rem; }
.char-hero-img {
  width: 120px; height: 170px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.char-hero-name { font-size: 1.05rem; font-weight: 600; margin-top: 0.45rem; color: var(--c-text); }
.char-hero--no-img { margin: 1rem 0 0.5rem; justify-content: flex-start; }

/* ==========================================================================
   Tag badges
   ========================================================================== */
.tag-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  background: var(--c-tag-bg);
  color: var(--c-tag-text);
  border: 1px solid rgba(61,180,242,0.2);
  transition: background var(--transition), transform var(--transition);
  margin-left: 0.2rem;
  vertical-align: middle;
}
.tag-badge:hover { transform: scale(1.05); text-decoration: none; }
.tag-nav .tag-badge { margin-left: 0; }

/* ── Tag color palette ────────────────────────────────────────────────────── */
.tag-badge.tag-gag           { background: rgba(251,191,36,0.12); color: #fbbf24; border-color: rgba(251,191,36,0.25); }
.tag-badge.tag-high_school   { background: rgba(244,114,182,0.12); color: #f472b6; border-color: rgba(244,114,182,0.25); }
.tag-badge.tag-fantasy       { background: rgba(167,139,250,0.12); color: #a78bfa; border-color: rgba(167,139,250,0.25); }
.tag-badge.tag-romance       { background: rgba(251,113,133,0.12); color: #fb7185; border-color: rgba(251,113,133,0.25); }
.tag-badge.tag-sci_fi        { background: rgba(56,189,248,0.12);  color: #38bdf8; border-color: rgba(56,189,248,0.25); }
.tag-badge.tag-action        { background: rgba(248,113,113,0.12); color: #f87171; border-color: rgba(248,113,113,0.25); }
.tag-badge.tag-adventure     { background: rgba(251,191,36,0.12);  color: #fbbf24; border-color: rgba(251,191,36,0.25); }
.tag-badge.tag-love_comedy   { background: rgba(232,121,249,0.12); color: #e879f9; border-color: rgba(232,121,249,0.25); }
.tag-badge.tag-magical_girl  { background: rgba(196,124,253,0.12); color: #c47cfd; border-color: rgba(196,124,253,0.25); }
.tag-badge.tag-mystery       { background: rgba(52,211,153,0.12);  color: #34d399; border-color: rgba(52,211,153,0.25); }
.tag-badge.tag-horror        { background: rgba(248,113,113,0.1);  color: #f87171; border-color: rgba(248,113,113,0.2); }
.tag-badge.tag-jidaigeki     { background: rgba(251,146,60,0.12);  color: #fb923c; border-color: rgba(251,146,60,0.25); }
.tag-badge.tag-boys_love     { background: rgba(96,165,250,0.12);  color: #60a5fa; border-color: rgba(96,165,250,0.25); }
.tag-badge.tag-yuri          { background: rgba(251,113,133,0.12); color: #fb7185; border-color: rgba(251,113,133,0.25); }
.tag-badge.tag-kids          { background: rgba(52,211,153,0.12);  color: #34d399; border-color: rgba(52,211,153,0.25); }
.tag-badge.tag-sports        { background: rgba(74,222,128,0.12);  color: #4ade80; border-color: rgba(74,222,128,0.25); }
.tag-badge.tag-drama         { background: rgba(251,146,60,0.12);  color: #fb923c; border-color: rgba(251,146,60,0.25); }
.tag-badge.tag-slice_of_life { background: rgba(45,212,191,0.12);  color: #2dd4bf; border-color: rgba(45,212,191,0.25); }
.tag-badge.tag-supernatural  { background: rgba(167,139,250,0.12); color: #a78bfa; border-color: rgba(167,139,250,0.25); }
.tag-badge.tag-ecchi         { background: rgba(251,146,60,0.12);  color: #fb923c; border-color: rgba(251,146,60,0.25); }
.tag-badge.tag-mecha         { background: rgba(148,163,184,0.12); color: #94a3b8; border-color: rgba(148,163,184,0.25); }
.tag-badge.tag-psychological { background: rgba(196,124,253,0.12); color: #c47cfd; border-color: rgba(196,124,253,0.25); }
.tag-badge.tag-music         { background: rgba(251,191,36,0.12);  color: #fbbf24; border-color: rgba(251,191,36,0.25); }
.tag-badge.tag-thriller      { background: rgba(148,163,184,0.08); color: #94a3b8; border-color: rgba(148,163,184,0.2); }

.tag-badge.tag-large { font-size: 0.82rem; padding: 0.28rem 0.85rem; }
.tag-count { font-size: 0.72em; opacity: 0.7; margin-left: 0.15rem; }

/* ── Tags section ────────────────────────────────────────────────────────── */
.tags-section { margin: 1.25rem 0; }
.section-heading {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--c-muted);
  margin-bottom: 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--c-border);
}
.tags-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags-list .tag-badge { margin-left: 0; }

/* ==========================================================================
   Anime thumbnail in table
   ========================================================================== */
.col-thumb { width: 46px; padding: 0.12rem 0.25rem 0.12rem 0; vertical-align: middle; }
.anime-thumb {
  width: 42px; height: 60px;
  object-fit: cover;
  border-radius: 3px;
  display: block;
  background: var(--c-border);
}
.anime-thumb--placeholder {
  width: 42px; height: 60px;
  border-radius: 3px;
  background: var(--c-border);
  opacity: 0.4;
}
.anime-table--thumb td.col-title { vertical-align: middle; }
.anime-row-year { font-size: 0.7rem; color: var(--c-muted); margin-left: 0.25rem; white-space: nowrap; }

/* ==========================================================================
   Watchlist
   ========================================================================== */
.watchlist-summary {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.watchlist-stat { text-align: center; }
.watchlist-stat-num { display: block; font-size: 1.4rem; font-weight: 800; color: var(--c-brand); }
.watchlist-stat--done .watchlist-stat-num { color: #4ade80; }
.watchlist-stat-label { font-size: 0.75rem; color: var(--c-muted); }
.watchlist-progress { flex: 1; min-width: 120px; }
.watchlist-progress-bar {
  height: 7px;
  border-radius: 99px;
  background: var(--c-border);
  position: relative;
  overflow: hidden;
  margin-bottom: 0.25rem;
}
.watchlist-progress-bar::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: calc(var(--pct) * 1%);
  background: #4ade80;
  border-radius: 99px;
  transition: width 0.5s ease;
}
.watchlist-progress-label { font-size: 0.75rem; color: var(--c-muted); }

/* ==========================================================================
   Wiki link button
   ========================================================================== */
.wiki-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.12rem 0.5rem;
  border-radius: 2rem;
  font-size: 0.7rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  background: rgba(51,102,204,0.12);
  color: #60a5fa;
  border: 1px solid rgba(51,102,204,0.25);
  transition: background 0.15s;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.wiki-link::before { content: "W"; font-family: serif; font-weight: 700; font-size: 0.88em; }
.wiki-link:hover { background: rgba(51,102,204,0.22); text-decoration: none; }

/* ==========================================================================
   News / Updates pages
   ========================================================================== */
.news-page { max-width: 860px; margin: 0 auto; }
.news-page .page-header { margin-bottom: 1.75rem; }
.news-page .page-title  { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.35rem; }
.news-page .page-desc   { color: var(--c-muted); font-size: 0.9rem; }

.news-list { display: flex; flex-direction: column; gap: 0.75rem; }
.news-card {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  background: var(--c-card);
  transition: box-shadow var(--transition), transform var(--transition);
}
.news-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.news-card-link  { display: block; padding: 1.1rem 1.35rem; text-decoration: none; color: inherit; }
.news-card-meta  { font-size: 0.78rem; color: var(--c-muted); margin-bottom: 0.35rem; }
.news-card-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.4rem; color: var(--c-text); }
.news-card-summary { font-size: 0.88rem; color: var(--c-muted); margin: 0 0 0.65rem; line-height: 1.5; }
.news-card-more { font-size: 0.8rem; color: var(--c-brand); font-weight: 600; }

.news-detail-page { max-width: 860px; margin: 0 auto; }
.news-article {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.75rem;
}
.news-article-header { margin-bottom: 1.75rem; border-bottom: 1px solid var(--c-border); padding-bottom: 1.1rem; }
.news-article-date  { font-size: 0.8rem; color: var(--c-muted); display: block; margin-bottom: 0.45rem; }
.news-article-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.65rem; line-height: 1.3; }
.news-article-summary { font-size: 0.95rem; color: var(--c-muted); margin: 0; line-height: 1.6; }
.news-article-body  { line-height: 1.75; }
.news-article-body h2 { font-size: 1.2rem; font-weight: 700; margin: 1.75rem 0 0.65rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--c-border); }
.news-article-body h3 { font-size: 1rem; font-weight: 700; margin: 1.25rem 0 0.45rem; }
.news-article-body p  { margin: 0 0 0.9rem; }
.news-article-body ul, .news-article-body ol { margin: 0 0 0.9rem 1.35rem; }
.news-article-body li { margin-bottom: 0.25rem; }
.news-article-body code { font-family: monospace; background: var(--c-hover); padding: 0.08em 0.3em; border-radius: 3px; font-size: 0.9em; }

.feat-diagram { background: var(--c-hover); border: 1px solid var(--c-border); border-radius: var(--radius-lg); padding: 1.1rem; margin: 1.1rem 0; overflow-x: auto; }
.feat-diagram svg { display: block; max-width: 100%; height: auto; }
.feat-step-list { display: flex; flex-direction: column; gap: 0.65rem; margin: 0.9rem 0; }
.feat-step { display: flex; align-items: flex-start; gap: 0.65rem; padding: 0.65rem 0.9rem; background: var(--c-card); border: 1px solid var(--c-border); border-radius: var(--radius); }
.feat-step-num { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--c-brand); color: #fff; font-weight: 700; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }
.feat-step-body { flex: 1; }
.feat-step-title { font-weight: 600; font-size: 0.92rem; margin-bottom: 0.15rem; }
.feat-step-desc  { font-size: 0.82rem; color: var(--c-muted); }
.feat-badge { display: inline-block; padding: 0.18em 0.55em; border-radius: 3px; font-size: 0.75rem; font-weight: 700; background: rgba(59,130,246,0.12); color: #60a5fa; border: 1px solid rgba(59,130,246,0.25); margin-right: 0.25rem; }
.feat-badge--new     { background: rgba(52,211,153,0.12);  color: #34d399;  border-color: rgba(52,211,153,0.25); }
.feat-badge--improve { background: rgba(251,191,36,0.12);  color: #fbbf24;  border-color: rgba(251,191,36,0.25); }
.news-back { margin-top: 0.85rem; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
  .detail-body { grid-template-columns: 1fr; }
  .anime-table .col-fetched { display: none; }
  .year-grid { grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); }
  .header-nav { display: none; } /* hide main nav on small screens */
}

@media (max-width: 600px) {
  .header-inner { flex-wrap: wrap; gap: 0.4rem; padding: 0.45rem var(--gap); }
  .header-right { flex-wrap: wrap; }
  .header-search input { width: 130px; }
  .hero h1, .hero-title { font-size: 1.35rem; }
  .page-header h1 { font-size: 1.2rem; }
  .year-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.4rem; }
  .year-card { padding: 0.65rem; }
  .year-card-year { font-size: 1.1rem; }
  .anime-table th, .anime-table td { padding: 0.5rem 0.55rem; }
  .anime-table .col-stream { display: none; }
  .detail-body { grid-template-columns: 1fr; }
  .detail-main-title { font-size: 1.25rem; }
  .sort-tab { font-size: 0.75rem; padding: 0.2rem 0.6rem; }
  .filter-label { font-size: 0.7rem; min-width: 2.4rem; }
  .char-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* ==========================================================================
   Input / select global overrides (dark-first)
   ========================================================================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
  background: var(--c-input-bg);
  color: var(--c-text);
  border-color: var(--c-input-border);
}

/* ==========================================================================
   Print styles
   ========================================================================== */
@media print {
  .site-header,
  .fmt-nav,
  .tag-nav,
  .search-form,
  .header-search,
  .filter-row,
  .sort-tabs,
  .pager,
  .fav-btn,
  .ws-btn,
  .fav-filter-btn,
  .tool-btn,
  .rec-section,
  footer { display: none !important; }

  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; text-decoration: none; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 0.75em; color: #555; }
  a[href^="#"]::after,
  a[href^="javascript:"]::after { content: ""; }

  .anime-table { border-collapse: collapse; width: 100%; }
  .anime-table th,
  .anime-table td { border: 1px solid #ccc; padding: 0.3rem 0.5rem; }
  .anime-table .col-stream { display: none; }
  .detail-body { display: block; }
  .detail-cover { max-width: 150px; float: left; margin-right: 1rem; }
  .container { max-width: 100%; padding: 0; }
  .page-header { margin-bottom: 0.5rem; }
}

/* ==========================================================================
   Phase 1: Anime Card Grid (.ac) — AniList-style vertical cards
   ========================================================================== */
/* ──────────────────────────────────────────────────────────────────────────
   Search / year result list (.ac items)

   Reworked from a portrait card grid to a 2-column horizontal list. Most
   results have no cover art (~2/3 are placeholders), so the old grid showed
   rows of ▶ placeholders with uneven heights and large vertical gaps. Each
   item is now a single low row: ★fav · thumb · title (flex) · year · score.
   Rows are laid out with flexbox so heights are natural — no stretch, no gap.
   ────────────────────────────────────────────────────────────────────────── */
.anime-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* always 2 columns */
  align-items: start;             /* don't stretch rows to tallest item */
  gap: 0.5rem;
  margin: 0.75rem 0 1.5rem;
}

/* ── List item ── */
.ac {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.55rem;
  border-radius: var(--radius);
  background: var(--c-card);
  border: 1px solid var(--c-border);
  text-decoration: none;
  color: var(--c-text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
}
.ac:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  text-decoration: none;
  border-color: var(--c-brand);
}

/* ── Favorite button (left edge, always visible) ── */
.ac-fav {
  flex: 0 0 auto;
  background: transparent !important;
  border: none !important;
  color: var(--c-muted) !important;
  font-size: 0.95rem !important;
  padding: 0 !important;
  line-height: 1;
}
.ac-fav.fav-on { color: var(--c-accent) !important; }

/* ── Thumbnail (small, 3:4) ── */
.ac-cover {
  flex: 0 0 auto;
  width: 40px;
  height: 54px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm, 4px);
  background: var(--c-surface);
}
.ac-cover--placeholder {
  width: 40px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: var(--radius-sm, 4px);
  background: linear-gradient(135deg, var(--c-surface) 0%, var(--c-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ac-cover--placeholder::after {
  content: "▶";
  font-size: 0.9rem;
  color: var(--c-muted);
  opacity: 0.4;
}

/* ── Body: title (takes the remaining width) ── */
.ac-body {
  flex: 1 1 auto;
  min-width: 0; /* allow the title to truncate inside flex */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ac-title {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: var(--c-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Meta (right edge): year + score ── */
.ac-meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  text-align: right;
}
.ac-year {
  font-size: 0.68rem;
  color: var(--c-brand);
  font-weight: 600;
  white-space: nowrap;
}
.ac-score {
  color: var(--c-accent);
  font-weight: 700;
  font-size: 0.7rem;
  white-space: nowrap;
}

/* ==========================================================================
   Phase 2: Detail page hero banner
   ========================================================================== */
.detail-hero--banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  min-height: 260px;
}

/* Blurred background fill */
.detail-hero--banner .detail-hero-blur {
  position: absolute;
  inset: 0;
  background-image: var(--cover-url);
  background-size: cover;
  background-position: center top;
  filter: blur(28px) brightness(0.25) saturate(1.4);
  transform: scale(1.08);
  z-index: 0;
}

.detail-hero--banner .detail-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  align-items: flex-start;
}

.detail-hero-cover {
  flex-shrink: 0;
}
.detail-hero-cover .detail-cover-img {
  width: 140px;
  border-radius: var(--radius);
  box-shadow: 0 6px 24px rgba(0,0,0,0.6);
  display: block;
}

.detail-hero--banner .detail-hero-inner {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: flex-end;
}

.detail-hero--banner .detail-main-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.25;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}
.detail-hero--banner .title-google-link { color: var(--c-text) !important; }
.detail-hero--banner .title-google-link:hover { color: var(--c-brand) !important; text-decoration: none; }

.detail-hero--banner .detail-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.detail-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.25rem;
}

/* ==========================================================================
   Phase 3: Top page — "最近追加" larger grid cards
   ========================================================================== */
.new-arrivals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin: 0.75rem 0 0.5rem;
}

/* Reuse .ac inside new-arrivals — the series-card now uses ac styling */
.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin: 0.5rem 0;
}

/* Series card image sizing fix */
.series-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c-card);
  border: 1px solid var(--c-border);
  text-decoration: none;
  color: var(--c-text);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  cursor: pointer;
}
.series-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
  border-color: var(--c-brand);
  text-decoration: none;
}

.series-card-img,
.series-card > img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--c-surface);
  display: block;
  flex-shrink: 0;
}
.series-card-info {
  padding: 0.4rem 0.5rem 0.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.series-card-title {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--c-text);
}
.series-card-meta {
  font-size: 0.68rem;
  color: var(--c-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Existing series-card inside detail page (series section) */
.series-card > .series-title {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.5rem 0.15rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.series-card > .series-year {
  font-size: 0.68rem;
  color: var(--c-muted);
  padding: 0 0.5rem 0.45rem;
  display: block;
}
.series-card > div {
  padding: 0.4rem 0.5rem 0.5rem;
  flex: 1;
}
.series-card > img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

/* ==========================================================================
   Phase 4: Header polish — hamburger menu for mobile
   ========================================================================== */
.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  color: var(--c-muted);
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  font-size: 1.1rem;
  line-height: 1;
  transition: color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}
.hamburger:hover { color: var(--c-text); border-color: var(--c-brand); }

@media (max-width: 768px) {
  .hamburger { display: inline-flex; align-items: center; justify-content: center; }

  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.4rem 0;
    z-index: 200;
    box-shadow: var(--shadow-lg);
  }
  .header-nav.open { display: flex; }
  .nav-link { padding: 0.6rem 1rem; border-radius: 0; }
}

/* ==========================================================================
   Phase 5: News page — hero article + category badges
   ========================================================================== */
.news-hero {
  background: linear-gradient(135deg, var(--c-card), var(--c-surface));
  border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-brand);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}
.news-hero-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--c-brand);
  margin-bottom: 0.5rem;
}
.news-hero-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}
.news-hero-title a { color: var(--c-text); }
.news-hero-title a:hover { color: var(--c-brand); text-decoration: none; }
.news-hero-summary { font-size: 0.9rem; color: var(--c-muted); margin: 0 0 0.75rem; line-height: 1.55; }
.news-hero-meta { font-size: 0.78rem; color: var(--c-muted); }

.news-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2em 0.6em;
  border-radius: 3px;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.news-badge--new    { background: rgba(52,211,153,0.12); color: #34d399; border: 1px solid rgba(52,211,153,0.3); }
.news-badge--update { background: rgba(251,191,36,0.12); color: #fbbf24; border: 1px solid rgba(251,191,36,0.3); }
.news-badge--fix    { background: rgba(239,68,68,0.12);  color: #f87171; border: 1px solid rgba(239,68,68,0.3);  }
.news-badge--info   { background: rgba(99,102,241,0.12); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); }

.news-card { position: relative; }
.news-card-badge {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
}

/* Result list stays at a fixed 2 columns at every width (see .anime-card-grid
   above) — wider screens just give each row more breathing room, so no
   per-breakpoint column override here. */
@media (min-width: 900px) {
  .detail-hero--banner .detail-main-title { font-size: 1.85rem; }
}

@media (max-width: 600px) {
  .detail-hero--banner .detail-hero-content {
    flex-direction: column;
    padding: 1rem;
  }
  .detail-hero-cover .detail-cover-img {
    width: 100px;
  }
  .detail-hero--banner .detail-main-title { font-size: 1.25rem; }
}
