:root {
  --blue-50: #eef4ff;
  --blue-100: #d9e8ff;
  --blue-200: #b8d4ff;
  --blue-400: #3d8bff;
  --blue-500: #0b5cff;
  --blue-600: #0047e0;
  --blue-700: #0036b3;
  --blue-900: #0a1628;
  --cyan: #00c2ff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --bg: #f0f4fb;
  --card: #ffffff;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow: 0 8px 30px rgba(11, 92, 255, 0.1);
  --shadow-lg: 0 20px 50px rgba(11, 92, 255, 0.15);
  --header-h: 64px;
  --sticky-search-h: 72px;
  --mobile-nav-h: 64px;
  --font: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --gradient-hero: linear-gradient(135deg, #0047e0 0%, #0b5cff 45%, #00a8ff 100%);
  --gradient-card: linear-gradient(145deg, #0b5cff 0%, #0066ff 50%, #00c2ff 100%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body.page-detail,
body:not(.admin-page) {
  padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(11, 92, 255, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(0, 194, 255, 0.08), transparent),
    var(--bg);
}

a {
  color: var(--blue-500);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--blue-600);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  min-width: 0;
}

.brand:hover {
  color: var(--text);
}

.brand-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--gradient-hero);
  color: #fff;
  box-shadow: 0 4px 14px rgba(11, 92, 255, 0.35);
}

.brand-icon svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-text strong {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text small {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--blue-50);
  color: var(--blue-500);
}

/* Sticky search */
.sticky-search-wrap {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  padding: 12px 0;
  background: rgba(240, 244, 251, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sticky-search-wrap.is-stuck {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

/* Daily update banner */
.daily-update-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.daily-update-icon {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  animation: daily-icon-pulse 2s ease-in-out infinite;
}

@keyframes daily-icon-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.daily-update-marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.daily-update-track {
  display: flex;
  width: max-content;
  animation: daily-marquee 36s linear infinite;
}

.daily-update-track.is-paused {
  animation-play-state: paused;
}

.daily-update-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding-right: 3rem;
  white-space: nowrap;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
}

.daily-update-num {
  display: inline-block;
  min-width: 2.5ch;
  font-weight: 700;
  color: #e5395a;
  font-variant-numeric: tabular-nums;
  transition: transform 0.35s ease, color 0.35s ease;
}

.daily-update-num.is-ticking {
  transform: translateY(-2px) scale(1.06);
  color: #ff2d6a;
}

.daily-update-sep {
  margin-left: 0.75em;
  color: var(--text-muted);
}

@keyframes daily-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .daily-update-track {
    animation: none;
    flex-wrap: wrap;
    width: auto;
  }

  .daily-update-icon {
    animation: none;
  }
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px 8px 14px;
  box-shadow: var(--shadow-sm);
}

.search-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.search-icon svg {
  width: 100%;
  height: 100%;
}

.search-bar input[type="search"] {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 8px 4px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  color: var(--text);
}

.search-bar input[type="search"]::placeholder {
  color: #94a3b8;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--gradient-hero);
  color: #fff;
  box-shadow: 0 4px 14px rgba(11, 92, 255, 0.3);
}

.btn-primary:hover {
  color: #fff;
  box-shadow: 0 6px 20px rgba(11, 92, 255, 0.4);
}

.btn-search {
  padding: 10px 20px;
}

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

.btn-ghost:hover {
  background: var(--blue-50);
  color: var(--blue-500);
}

.btn-outline {
  background: #fff;
  color: var(--blue-500);
  border: 1px solid var(--blue-200);
}

.btn-outline:hover {
  background: var(--blue-50);
  color: var(--blue-600);
}

.btn-clear {
  padding: 10px 14px;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
  color: #fff;
}

.btn-xl {
  width: 100%;
  padding: 16px 24px;
  font-size: 1.05rem;
  border-radius: var(--radius);
}

.btn-quark {
  background: var(--gradient-hero);
  color: #fff;
  box-shadow: 0 8px 28px rgba(11, 92, 255, 0.4);
}

.btn-quark:hover {
  color: #fff;
  box-shadow: 0 12px 36px rgba(11, 92, 255, 0.5);
}

.btn-copy {
  background: var(--card);
  color: var(--blue-600);
  border: 2px solid var(--blue-200);
}

.btn-copy:hover {
  background: var(--blue-50);
  border-color: var(--blue-400);
}

.btn-copy.is-copied {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #059669;
}

/* Hero */
.hero {
  position: relative;
  margin: 8px 0 28px;
  padding: 36px 28px 32px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gradient-hero);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.hero-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.2), transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(0, 194, 255, 0.25), transparent 45%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
}

.pill-hot {
  background: rgba(255, 200, 50, 0.25);
  border-color: rgba(255, 220, 100, 0.5);
}

.pill-quark {
  background: var(--blue-50);
  color: var(--blue-600);
  border: 1px solid var(--blue-200);
}

.detail-resource-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.pill-share {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border: 1px solid rgba(229, 57, 90, 0.35);
  border-radius: 999px;
  background: rgba(229, 57, 90, 0.08);
  color: #e5395a;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.pill-share svg {
  width: 14px;
  height: 14px;
}

.pill-share:hover,
.pill-share.is-shared {
  background: rgba(229, 57, 90, 0.16);
  border-color: #e5395a;
}

.pill-share:active {
  transform: scale(0.97);
}

.btn-share {
  background: linear-gradient(135deg, #ff6b8a 0%, #e5395a 100%);
  color: #fff;
  border: none;
  box-shadow: 0 8px 20px rgba(229, 57, 90, 0.22);
}

.btn-share:hover {
  filter: brightness(1.05);
  color: #fff;
}

.btn-share.is-shared {
  background: linear-gradient(135deg, #34c759 0%, #2db84d 100%);
  box-shadow: 0 8px 20px rgba(52, 199, 89, 0.22);
}

.cta-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.cta-actions .btn-xl {
  width: 100%;
}

.hero-title {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(90deg, #fff 0%, #b8e4ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  margin: 0 0 24px;
  font-size: 0.95rem;
  opacity: 0.9;
  max-width: 480px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-item strong {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat-item span {
  font-size: 0.78rem;
  opacity: 0.8;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.25);
}

/* Hot keywords */
.hot-keywords-section {
  margin-bottom: 24px;
}

.hot-keywords-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--blue-100);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.hot-keywords-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hot-keywords-toggle {
  display: none;
  padding: 4px 12px;
  border: 1px solid var(--blue-200);
  border-radius: 999px;
  background: var(--blue-50);
  color: var(--blue-600);
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

.hot-keywords-label {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.3;
}

.hot-keywords-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.hot-keywords-section.is-collapsed .hot-keywords-tags {
  max-height: 76px;
  overflow: hidden;
}

.hot-keywords-tags--compact {
  justify-content: center;
  margin-top: 16px;
}

.hot-keyword-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--blue-600);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
  line-height: 1.3;
}

.hot-keyword-chip:hover {
  color: var(--blue-700);
  background: var(--blue-100);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(11, 92, 255, 0.15);
}

.hot-keyword-chip.is-active {
  color: #fff;
  background: var(--gradient-hero);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(11, 92, 255, 0.35);
}

/* Tags */
.tags-section,
.list-section {
  margin-bottom: 32px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.section-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.pagination {
  margin-top: 24px;
  padding-top: 8px;
}

.pagination-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.page-numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.page-link:hover {
  border-color: var(--blue-300);
  color: var(--blue-500);
  background: var(--blue-50);
}

.page-link.is-active {
  border-color: var(--blue-500);
  background: var(--blue-500);
  color: #fff;
}

.page-link.is-disabled,
.page-ellipsis {
  color: var(--text-muted);
  border-color: var(--border);
  background: var(--surface);
}

.page-link.is-disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 38px;
}

.pagination-meta {
  margin: 10px 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
}

.tag-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -4px;
  padding: 4px;
}

.tag-scroll::-webkit-scrollbar {
  display: none;
}

.tag-cloud--compact {
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--blue-600);
  background: var(--card);
  border: 1px solid var(--blue-100);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-chip.is-active {
  color: #fff;
  background: var(--gradient-hero);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(11, 92, 255, 0.35);
}

.tag-chip--small {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.tag-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(11, 92, 255, 0.1);
  color: var(--blue-600);
}

.tag-chip.is-active .tag-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--blue-600);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
}

.drama-card-tags,
.detail-tags,
.admin-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.drama-card-tags {
  margin-bottom: 8px;
}

.detail-tags {
  margin: 0 0 12px;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-picker--inline {
  flex: 1;
  min-width: 0;
}

.tag-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-size: 0.84rem;
  user-select: none;
}

.tag-check input {
  accent-color: var(--blue-500);
}

.tag-check--compact {
  padding: 6px 10px;
  font-size: 0.78rem;
}

.auto-tag-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.auto-tag-toggle input {
  margin-top: 3px;
  accent-color: var(--blue-500);
}

.bulk-tag-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.bulk-tag-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.text-muted {
  color: var(--text-muted);
}

.tag-chip:hover {
  color: var(--blue-700);
  background: var(--blue-50);
  border-color: var(--blue-300, var(--blue-200));
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Drama grid — compact portrait cards */
.drama-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 160px));
  justify-content: center;
  gap: 12px;
}

.drama-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.drama-card:hover {
  color: var(--text);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--blue-200);
}

.drama-card-cover {
  position: relative;
  background: var(--gradient-card);
  line-height: 0;
  overflow: hidden;
}

.drama-card-cover:has(.cover-img) {
  background: #e2e8f0;
}

.cover-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.35) 100%),
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent 50%);
}

.cover-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 7;
  object-fit: contain;
  object-position: center center;
}

.drama-card-cover:has(.cover-img) .cover-icon {
  display: none;
}

.cover-img--large {
  border-radius: var(--radius-lg);
}

.cover-gradient--large {
  background:
    linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.4) 100%),
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.15), transparent 45%);
}

.cover-icon,
.cover-play {
  position: relative;
  z-index: 1;
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.drama-card:hover .cover-icon {
  transform: scale(1.15);
}

.episode-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.episode-badge--large {
  top: auto;
  bottom: 14px;
  right: 14px;
  font-size: 0.82rem;
  padding: 6px 14px;
}

.drama-card-body {
  padding: 10px 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.drama-card-title {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.drama-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.watch-hint {
  color: var(--blue-500);
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s;
}

.drama-card:hover .watch-hint {
  opacity: 1;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--blue-200);
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.empty-state p {
  margin: 0 0 8px;
  font-weight: 500;
}

.empty-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 400 !important;
  margin-bottom: 20px !important;
}

/* Detail page */
.detail-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 0 24px;
}

.detail-hero {
  margin-bottom: 24px;
}

.detail-cover {
  position: relative;
  width: 100%;
  max-width: 240px;
  margin: 0 auto 20px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gradient-card);
  line-height: 0;
  box-shadow: var(--shadow-lg);
}

.detail-cover:has(.cover-img) {
  background: #e2e8f0;
}

.detail-cover:has(.cover-img) .cover-play {
  display: none;
}

.detail-info h1 {
  margin: 10px 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.detail-meta svg {
  width: 16px;
  height: 16px;
}

.detail-tip {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.cta-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.cta-link-preview {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  word-break: break-all;
  text-align: center;
  line-height: 1.5;
}

.qr-panel {
  padding: 24px;
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  text-align: center;
  margin-bottom: 20px;
}

.qr-panel-head h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
}

.qr-panel-head p {
  margin: 0 0 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.qr-wrap {
  display: inline-flex;
  padding: 12px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.qr-wrap canvas,
.qr-wrap img {
  display: block;
  width: 200px;
  height: 200px;
}

.qr-hint {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.detail-actions-secondary {
  text-align: center;
}

.detail-sticky-bar {
  display: none;
}

.btn-icon {
  width: 52px;
  min-width: 52px;
  padding: 0;
  flex-shrink: 0;
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--mobile-nav-h) + 20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  z-index: 1000;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #fff;
  background: var(--blue-900);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  max-width: calc(100vw - 32px);
  text-align: center;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast--success {
  background: #059669;
}

.toast--error {
  background: #dc2626;
}

/* Related content */
.related-section {
  margin-top: 8px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
}

.related-inner {
  max-width: 720px;
}

.related-heading {
  margin: 0 0 20px;
  font-size: 1.15rem;
  font-weight: 700;
  text-align: center;
  color: var(--blue-900);
  letter-spacing: 0.02em;
}

.related-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: related-counter;
}

.related-item {
  counter-increment: related-counter;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(11, 92, 255, 0.12);
}

.related-item:last-child {
  border-bottom: none;
}

.related-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  transition: color 0.15s ease;
}

.related-link::before {
  content: counter(related-counter) ".";
  flex-shrink: 0;
  min-width: 1.6em;
  margin-right: 6px;
  font-weight: 600;
  color: #d4a574;
}

.related-link:hover {
  color: var(--blue-500);
}

.related-link:hover .related-title {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.related-title {
  font-weight: 500;
}

.related-episodes {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 400;
}

.page-detail .related-section {
  margin-top: 0;
}

/* Footer */
.site-footer {
  padding: 32px 16px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.footer-inner p {
  margin: 0 0 4px;
}

.footer-sub {
  opacity: 0.75;
}

.footer-disclaimer {
  max-width: 720px;
  margin: 0 auto 16px !important;
  padding: 12px 14px;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text-secondary);
  background: rgba(11, 92, 255, 0.04);
  border: 1px solid rgba(11, 92, 255, 0.1);
  border-radius: var(--radius-sm);
  text-align: left;
}

.footer-disclaimer a {
  color: var(--blue-500);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-disclaimer a:hover {
  color: var(--blue-600);
}

/* Info pages (tutorial, contact) */
.info-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 0 32px;
}

.info-page-head {
  margin-bottom: 28px;
}

.info-page-head h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  color: var(--blue-900);
}

.info-page-lead {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.tutorial-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tutorial-step {
  display: flex;
  gap: 14px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.tutorial-step-num {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  background: var(--gradient-card);
  border-radius: 50%;
}

.tutorial-step h2 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--text);
}

.tutorial-step p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.contact-card {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.contact-card p {
  margin: 0 0 10px;
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.contact-email {
  font-size: 1.1rem !important;
  font-weight: 600;
}

.contact-email a {
  color: var(--blue-500);
}

.contact-note {
  margin-top: 16px !important;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
}

.info-page-actions {
  margin-top: 28px;
  text-align: center;
}

/* Mobile bottom nav */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: stretch;
  height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  transition: color 0.15s;
}

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
}

.mobile-nav-item.is-active,
.mobile-nav-item:hover {
  color: var(--blue-500);
}

.main-content {
  padding-top: 8px;
}

/* Admin */
body.admin-page {
  padding-bottom: 0;
}

body.admin-page .mobile-bottom-nav {
  display: none;
}

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

.admin-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue-600);
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  margin-left: 8px;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  max-width: 560px;
}

.form-card h2 {
  margin: 0 0 20px;
  font-size: 1.2rem;
  font-weight: 700;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue-400);
  box-shadow: 0 0 0 3px rgba(11, 92, 255, 0.12);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.admin-table th {
  background: var(--blue-50);
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(11, 92, 255, 0.02);
}

.inline-form {
  display: inline;
}

.login-wrap {
  max-width: 420px;
  margin: 48px auto;
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand .brand-icon {
  margin: 0 auto 12px;
}

.desktop-nav {
  display: none;
}

.mobile-only {
  display: block;
}

@media (min-width: 768px) {
  body:not(.admin-page) {
    padding-bottom: 0;
  }

  .desktop-nav {
    display: flex;
  }

  .mobile-bottom-nav {
    display: none;
  }

  .toast {
    bottom: 32px;
  }

  .mobile-only {
    display: none;
  }

  .hero {
    padding: 44px 40px 36px;
  }

  .btn-xl {
    width: auto;
    min-width: 220px;
  }

  .cta-panel {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .cta-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .cta-panel .btn-xl,
  .cta-actions .btn-xl {
    flex: 1;
    min-width: 180px;
    width: auto;
  }

  .cta-link-preview {
    flex-basis: 100%;
  }
}

@media (max-width: 767px) {
  :root {
    --header-h: 52px;
    --sticky-search-h: 56px;
  }

  .container {
    padding: 0 12px;
  }

  .header-inner {
    min-height: var(--header-h);
    gap: 8px;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .brand-icon svg {
    width: 18px;
    height: 18px;
  }

  .brand-text strong {
    font-size: 0.95rem;
  }

  .brand-text small {
    display: none;
  }

  .sticky-search-wrap {
    top: var(--header-h);
    padding: 8px 0;
  }

  .search-bar {
    padding: 4px 6px 4px 10px;
    gap: 6px;
    border-radius: 12px;
  }

  .search-bar input[type="search"] {
    padding: 10px 2px;
    font-size: 16px;
  }

  .btn-search {
    padding: 10px 12px;
    font-size: 13px;
  }

  .btn-clear {
    padding: 8px 10px;
    font-size: 12px;
  }

  .hero {
    margin: 4px 0 16px;
    padding: 18px 16px 16px;
    border-radius: var(--radius);
  }

  .hero-badges {
    margin-bottom: 10px;
    gap: 6px;
  }

  .hero-badges .pill {
    padding: 3px 10px;
    font-size: 0.72rem;
  }

  .hero-title {
    font-size: 1.35rem;
    margin-bottom: 8px;
  }

  .hero-desc {
    display: none;
  }

  .hero-stats {
    gap: 12px;
  }

  .stat-item strong {
    font-size: 1.2rem;
  }

  .stat-item span {
    font-size: 0.72rem;
  }

  .stat-divider {
    display: none;
  }

  .hot-keywords-section {
    margin-bottom: 16px;
  }

  .daily-update-bar {
    margin-bottom: 10px;
    padding: 8px 12px;
  }

  .daily-update-item {
    font-size: 0.82rem;
    padding-right: 2rem;
  }

  .daily-update-track {
    animation-duration: 28s;
  }

  .hot-keywords-box {
    padding: 12px;
  }

  .hot-keywords-toggle {
    display: inline-flex;
    align-items: center;
  }

  .hot-keywords-tags {
    gap: 6px;
    padding-bottom: 2px;
  }

  .hot-keywords-section.is-collapsed .hot-keywords-tags {
    max-height: 68px;
    overflow: hidden;
  }

  .hot-keywords-section:not(.is-collapsed) .hot-keywords-tags {
    max-height: none;
  }

  .hot-keyword-chip {
    padding: 8px 12px;
    font-size: 0.8rem;
    flex-shrink: 0;
  }

  .section-head {
    margin-bottom: 10px;
  }

  .section-head h2 {
    font-size: 1rem;
  }

  .section-hint {
    font-size: 0.75rem;
  }

  .page-link {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    font-size: 0.8rem;
  }

  .pagination-meta {
    font-size: 0.75rem;
  }

  .list-section {
    margin-bottom: 20px;
  }

  .drama-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch;
  }

  .drama-card {
    border-radius: 12px;
  }

  .drama-card:hover {
    transform: none;
  }

  .drama-card-body {
    padding: 8px 8px 10px;
  }

  .drama-card-title {
    font-size: 0.75rem;
    line-height: 1.35;
    -webkit-line-clamp: 2;
  }

  .drama-card-tags {
    display: none;
  }

  .drama-card-meta time {
    display: none;
  }

  .watch-hint {
    display: none;
  }

  .episode-badge {
    top: 6px;
    right: 6px;
    padding: 2px 7px;
    font-size: 0.65rem;
  }

  .detail-page {
    padding: 0 0 16px;
  }

  body.page-detail .main-content {
    padding-bottom: calc(var(--mobile-nav-h) + 72px + env(safe-area-inset-bottom, 0px));
  }

  .detail-hero {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 12px;
    align-items: start;
    margin-bottom: 16px;
  }

  .detail-cover {
    max-width: none;
    margin: 0;
    border-radius: var(--radius);
  }

  .detail-info h1 {
    font-size: 1rem;
    margin: 6px 0;
    line-height: 1.45;
  }

  .detail-tip {
    display: none;
  }

  .detail-meta {
    font-size: 0.75rem;
    margin-bottom: 8px;
  }

  .detail-tags {
    gap: 4px;
    margin-bottom: 0;
  }

  .tag-chip--small {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .cta-panel {
    padding: 14px;
    margin-bottom: 14px;
  }

  .cta-link-preview {
    display: none;
  }

  .qr-panel {
    padding: 16px;
    margin-bottom: 14px;
  }

  .qr-panel-head p {
    font-size: 0.78rem;
  }

  .qr-wrap img {
    width: 160px;
    height: 160px;
  }

  .detail-sticky-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
    z-index: 95;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  }

  .detail-sticky-bar .btn-quark {
    flex: 1;
    padding: 14px 16px;
    font-size: 1rem;
  }

  .related-section {
    padding: 20px 0 24px;
  }

  .related-heading {
    font-size: 1rem;
    margin-bottom: 12px;
  }

  .related-link {
    font-size: 0.88rem;
  }

  .related-item {
    padding: 8px 0;
  }

  .site-footer {
    padding: 20px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    font-size: 0.75rem;
  }

  .footer-disclaimer {
    font-size: 0.72rem;
    line-height: 1.55;
    padding: 10px 12px;
  }

  .page-detail .site-footer {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 600px) {
  .brand-text small {
    display: none;
  }
}
