/* AnimeStream Pro - Main frontend styles (design system) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --as-primary: #6366f1;
  --as-primary-dark: #4f46e5;
  --as-accent: #ec4899;
  --as-bg-base: #0f0f12;
  --as-bg-card: #18181c;
  --as-bg-elevated: #1f1f24;
  --as-text: #f4f4f5;
  --as-text-muted: #a1a1aa;
  --as-border: #27272a;
  --as-radius: 12px;
  --as-radius-sm: 8px;
  --as-font-sans: 'Outfit', system-ui, sans-serif;
}

body.as-light {
  --as-bg-base: #f4f4f5;
  --as-bg-card: #fff;
  --as-bg-elevated: #e4e4e7;
  --as-text: #18181b;
  --as-text-muted: #71717a;
  --as-border: #e4e4e7;
}

* {
  box-sizing: border-box;
}

body.as-body {
  margin: 0;
  background: var(--as-bg-base);
  color: var(--as-text);
  font-family: var(--as-font-sans);
  line-height: 1.5;
}

.as-content {
  min-height: 80vh;
}

/* Header */
.as-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 15, 18, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--as-border);
}

.as-header-inner {
  max-width: 100%;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.as-logo-text {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--as-text);
  text-decoration: none;
}

.as-logo a {
  text-decoration: none;
  color: inherit;
}

.as-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

.as-nav-list a {
  color: var(--as-text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.as-nav-list a:hover {
  color: var(--as-primary);
}

.as-header-actions {
  margin-left: auto;
}

.as-search-form {
  display: flex;
  gap: 0.5rem;
}

.as-search-form input[type="search"] {
  padding: 0.5rem 0.75rem;
  border-radius: var(--as-radius-sm);
  border: 1px solid var(--as-border);
  background: var(--as-bg-card);
  color: var(--as-text);
  min-width: 200px;
}

.as-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--as-radius-sm);
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

.as-btn-primary {
  background: var(--as-primary);
  color: #fff;
}

.as-btn-ghost {
  background: transparent;
  color: var(--as-text-muted);
}

/* Hero home */
.as-hero-home {
  position: relative;
  padding: 4rem 1.5rem;
  text-align: center;
  overflow: hidden;
}

.as-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--as-bg-card) 0%, var(--as-bg-base) 50%, rgba(99, 102, 241, 0.08) 100%);
}

.as-hero-inner {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
}

.as-hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.as-hero-subtitle {
  color: var(--as-text-muted);
  margin: 0 0 2rem;
}

.as-film-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.as-home .as-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.as-hero-search {
  display: flex;
  gap: 0.5rem;
  max-width: 400px;
  margin: 0 auto;
}

.as-hero-search input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--as-radius-sm);
  border: 1px solid var(--as-border);
  background: var(--as-bg-card);
  color: var(--as-text);
}

/* Sections */
.as-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.as-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

/* Trending horizontal scroll */
.as-horizontal-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
}

.as-trending-card {
  flex: 0 0 140px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s;
}

.as-trending-card:hover {
  transform: translateY(-4px);
}

.as-trending-poster {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--as-radius);
  overflow: hidden;
  background: var(--as-bg-card);
}

.as-trending-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.as-trending-score {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0,0,0,0.7);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.as-trending-title {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--as-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Latest episodes row */
.as-episode-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.as-latest-ep-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s;
}

.as-latest-ep-card:hover {
  transform: translateY(-2px);
}

.as-latest-ep-thumb {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--as-radius-sm);
  overflow: hidden;
  background: var(--as-bg-card);
}

.as-latest-ep-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.as-latest-ep-num {
  position: absolute;
  bottom: 0.25rem;
  right: 0.25rem;
  background: rgba(0,0,0,0.8);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.7rem;
}

.as-latest-ep-anime {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--as-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Genres grid */
.as-genre-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.as-genre-card {
  padding: 0.5rem 1rem;
  background: var(--as-bg-card);
  border-radius: 999px;
  color: var(--as-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  border: 1px solid var(--as-border);
  transition: all 0.2s;
}

.as-genre-card:hover {
  background: var(--as-primary);
  color: #fff;
  border-color: var(--as-primary);
}

.as-placeholder {
  color: var(--as-text-muted);
  font-size: 0.9rem;
}

/* Single anime hero */
.as-anime-hero {
  position: relative;
  padding: 2rem 1.5rem;
  min-height: 320px;
  background: var(--as-cover, var(--as-bg-card)) center/cover no-repeat;
}

.as-anime-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(15,15,18,0.95) 0%, rgba(15,15,18,0.6) 60%, transparent);
}

.as-anime-hero-content {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.as-anime-poster {
  flex-shrink: 0;
  width: 200px;
  border-radius: var(--as-radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.as-anime-poster img {
  width: 100%;
  display: block;
  aspect-ratio: 2/3;
  object-fit: cover;
}

.as-anime-info {
  flex: 1;
  min-width: 0;
}

.as-anime-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.as-anime-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.as-score {
  color: var(--as-accent);
  font-weight: 700;
}

.as-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.as-genre-tag {
  padding: 0.25rem 0.6rem;
  background: var(--as-bg-elevated);
  border-radius: 4px;
  font-size: 0.8rem;
  color: var(--as-text-muted);
  text-decoration: none;
}

.as-genre-tag:hover {
  color: var(--as-primary);
}

.as-synopsis {
  color: var(--as-text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.as-episode-list-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.as-episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.as-episode-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem;
  background: var(--as-bg-card);
  border-radius: var(--as-radius-sm);
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--as-border);
  transition: background 0.2s;
}

.as-episode-card:hover {
  background: var(--as-bg-elevated);
}

.as-ep-num {
  font-weight: 700;
  color: var(--as-primary);
}

.as-no-episodes {
  color: var(--as-text-muted);
}

/* Watch layout (single episode) */
.as-watch-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
}

@media (max-width: 900px) {
  .as-watch-layout {
    grid-template-columns: 1fr;
  }
}

.as-server-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.as-server-tab {
  padding: 0.4rem 0.75rem;
  background: var(--as-bg-card);
  border: 1px solid var(--as-border);
  border-radius: var(--as-radius-sm);
  color: var(--as-text-muted);
  cursor: pointer;
  font-size: 0.85rem;
}

.as-server-tab.active,
.as-server-tab:hover {
  background: var(--as-primary);
  color: #fff;
  border-color: var(--as-primary);
}

.as-video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--as-radius);
  background: #000;
}

.as-video-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.as-downloads-block {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--as-bg-card);
  border-radius: var(--as-radius-sm);
}

.as-downloads-block h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.as-download-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.as-download-list li {
  margin-bottom: 0.5rem;
}

.as-dl-link {
  color: var(--as-primary);
  text-decoration: none;
}

.as-dl-link:hover {
  text-decoration: underline;
}

.as-episode-sidebar {
  padding: 1rem;
  background: var(--as-bg-card);
  border-radius: var(--as-radius);
  height: fit-content;
  position: sticky;
  top: 80px;
}

.as-anime-mini-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  margin-bottom: 1rem;
}

.as-anime-mini-link img {
  width: 48px;
  height: 72px;
  object-fit: cover;
  border-radius: 4px;
}

.as-episode-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 400px;
  overflow-y: auto;
}

.as-episode-sidebar-list li {
  margin-bottom: 0.25rem;
}

.as-episode-sidebar-list a {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--as-text-muted);
  text-decoration: none;
  border-radius: 4px;
}

.as-episode-sidebar-list a:hover,
.as-episode-sidebar-list a.current {
  color: var(--as-primary);
}

.as-episode-sidebar-list a.current {
  font-weight: 600;
}

/* Archive grid */
.as-archive-header {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
}

.as-archive-title {
  font-size: 1.5rem;
  margin: 0;
}

.as-anime-grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1.25rem;
}

.as-card {
  border-radius: var(--as-radius);
  overflow: hidden;
  background: var(--as-bg-card);
  border: 1px solid var(--as-border);
  transition: transform 0.2s;
}

.as-card:hover {
  transform: translateY(-4px);
}

.as-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.as-card-image {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
}

.as-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.as-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 200px;
  background: var(--as-bg-elevated);
  color: var(--as-text-muted);
  font-size: 0.85rem;
}

.as-card-score {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0,0,0,0.75);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.as-card-body {
  padding: 0.75rem;
}

.as-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.as-card-meta {
  font-size: 0.75rem;
  color: var(--as-text-muted);
}

/* Footer */
.as-footer {
  margin-top: 4rem;
  padding: 2rem 1.5rem;
  background: var(--as-bg-card);
  border-top: 1px solid var(--as-border);
}

.as-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.as-footer-grid {
  display: flex;
  gap: 3rem;
  margin-bottom: 2rem;
}

.as-footer-brand a {
  color: var(--as-text);
  text-decoration: none;
  font-weight: 700;
}

.as-footer-desc {
  color: var(--as-text-muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

.as-footer-links h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.as-footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.as-footer-links a {
  color: var(--as-text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.as-footer-bottom {
  padding-top: 1rem;
  border-top: 1px solid var(--as-border);
}

.as-footer-bottom p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--as-text-muted);
}

/* Pagination */
.pagination,
.nav-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 2rem;
}

.pagination a,
.nav-links a,
.pagination span {
  padding: 0.5rem 0.75rem;
  background: var(--as-bg-card);
  border-radius: var(--as-radius-sm);
  color: var(--as-text);
  text-decoration: none;
}

.pagination a:hover,
.nav-links a:hover {
  background: var(--as-primary);
}

/* ========== Single Film (Post) + Ads ========== */
.as-main.as-single-film {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

.as-film-article {
  padding-top: 1rem;
}

.as-film-header {
  margin-bottom: 1rem;
}

.as-film-title {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.as-film-excerpt {
  color: var(--as-text-muted);
  font-size: 0.95rem;
  margin: 0;
}

.as-ad-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 1rem 0;
}

.as-ad-row .as-ad-col {
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--as-bg-card);
  border-radius: var(--as-radius-sm);
  border: 1px dashed var(--as-border);
  overflow: hidden;
}

.as-ad-row .as-ad-col .as-ad {
  width: 100%;
  min-height: 100px;
}

.as-ad-block {
  margin: 1rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--as-bg-card);
  border-radius: var(--as-radius-sm);
  border: 1px dashed var(--as-border);
  overflow: hidden;
}

.as-ad-block .as-ad {
  width: 100%;
}

.as-player-wrap {
  margin: 1rem 0;
  border-radius: var(--as-radius);
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.as-video-outer {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.as-video-outer .as-video-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.as-video-outer.as-video-upload .as-video-native {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.as-film-body {
  margin-top: 1.5rem;
  font-size: 1rem;
  line-height: 1.65;
}

.as-film-body p {
  margin-bottom: 1rem;
}

.as-ad-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
}

.as-ad-popup.is-visible {
  visibility: visible;
  opacity: 1;
}

.as-ad-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
}

.as-ad-popup-inner {
  position: relative;
  max-width: 90vw;
  max-height: 85vh;
  overflow: auto;
  background: var(--as-bg-elevated);
  border-radius: var(--as-radius);
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.as-ad-popup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--as-text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}

.as-ad-popup-close:hover {
  background: var(--as-bg-card);
  color: var(--as-text);
}

.as-ad-popup-content {
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .as-header-inner {
    flex-wrap: wrap;
    padding: 0.5rem 1rem;
  }
  .as-nav { order: 3; width: 100%; }
  .as-ad-row {
    grid-template-columns: 1fr;
  }
  .as-ad-row .as-ad-col {
    min-height: 80px;
  }
  .as-main.as-single-film {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .as-film-title { font-size: 1.25rem; }
}

@media (max-width: 480px) {
  .as-film-title { font-size: 1.15rem; }
}

/* ========== Donghua Anime Online style ========== */
.as-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.as-topbar {
  background: var(--as-bg-elevated);
  border-bottom: 1px solid var(--as-border);
  font-size: 0.85rem;
}

.as-topbar-inner {
  display: flex;
  justify-content: flex-end;
  padding: 0.4rem 1rem;
}

.as-topbar-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}

.as-topbar-links a {
  color: var(--as-text-muted);
  text-decoration: none;
}

.as-topbar-links a:hover {
  color: var(--as-primary);
}

.as-header .as-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.as-nav { flex: 1; min-width: 0; }
.as-nav-list { flex-wrap: wrap; gap: 0.5rem 1rem; }
.as-nav-surprise { color: var(--as-accent) !important; }
.as-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.as-btn-mode, .as-btn-telegram {
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
}
.as-btn-telegram { background: #0088cc; color: #fff; text-decoration: none; }
.as-btn-telegram:hover { opacity: 0.9; color: #fff; }
.as-search-form input[type="search"] { min-width: 140px; }
.as-icon-search { font-size: 1rem; }
.as-nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.as-nav-toggle span { display: block; width: 22px; height: 2px; background: var(--as-text); margin: 4px 0; }

/* Hero slider */
.as-hero-slider {
  position: relative;
  margin-bottom: 2rem;
  border-radius: var(--as-radius);
  overflow: hidden;
  max-height: 420px;
}

.as-slider-inner {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.as-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  position: relative;
  min-height: 380px;
}

.as-slide-link { display: block; height: 100%; text-decoration: none; color: inherit; position: relative; }
.as-slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.as-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, transparent 50%);
}
.as-slide-content {
  position: relative;
  padding: 2rem 1.5rem;
  max-width: 600px;
  bottom: 0;
  left: 0;
}
.as-slide-date { font-size: 0.8rem; color: var(--as-text-muted); }
.as-slide-title { font-size: 1.75rem; margin: 0.5rem 0; font-weight: 700; }
.as-slide-summary { font-size: 0.9rem; color: var(--as-text-muted); margin: 0.5rem 0; }
.as-slide-meta { margin-top: 0.5rem; }
.as-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  background: var(--as-primary);
  border-radius: 4px;
  font-size: 0.75rem;
  margin-right: 0.25rem;
}
.as-badge-type { background: var(--as-accent); }
.as-badge-4k { background: #22c55e; }
.as-slider-dots { display: flex; justify-content: center; gap: 0.5rem; padding: 0.5rem; }
.as-slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--as-text-muted);
  cursor: pointer;
  padding: 0;
}
.as-slider-dot.active { background: var(--as-primary); }

/* Section headings */
.as-section { padding: 1.5rem 0; }
.as-section-heading {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 1rem;
}
.as-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.as-view-all { color: var(--as-primary); text-decoration: none; font-size: 0.9rem; }
.as-view-all:hover { text-decoration: underline; }

/* Trending week */
.as-trending-card { background: var(--as-bg-card); border-radius: var(--as-radius); overflow: hidden; border: 1px solid var(--as-border); }
.as-trending-link { display: flex; flex-wrap: wrap; text-decoration: none; color: inherit; }
.as-trending-poster {
  flex: 0 0 280px;
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}
.as-trending-poster img { width: 100%; height: 100%; object-fit: cover; }
.as-trending-poster .as-badge-4k { position: absolute; top: 0.5rem; right: 0.5rem; }
.as-placeholder-img {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; background: var(--as-bg-elevated); color: var(--as-text-muted); font-size: 0.9rem; padding: 1rem;
}
.as-trending-info { flex: 1; padding: 1rem; min-width: 200px; }
.as-trending-title { margin: 0 0 0.5rem; font-size: 1.1rem; }
.as-trending-genres { font-size: 0.85rem; color: var(--as-text-muted); margin: 0; }
.as-rating { color: var(--as-accent); font-weight: 700; }

/* Popular today / episode grid */
.as-episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.as-ep-card { text-decoration: none; color: inherit; transition: transform 0.2s; }
.as-ep-card:hover { transform: translateY(-4px); }
.as-ep-thumb {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--as-radius-sm);
  overflow: hidden;
  background: var(--as-bg-card);
}
.as-ep-thumb img { width: 100%; height: 100%; object-fit: cover; }
.as-ep-badge {
  position: absolute;
  bottom: 0.25rem;
  left: 0.25rem;
  background: rgba(0,0,0,0.8);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.7rem;
}
.as-ep-4k { left: auto; right: 0.25rem; background: #22c55e; }
.as-ep-info { padding: 0.5rem 0; }
.as-ep-title { font-size: 0.9rem; margin: 0 0 0.25rem; font-weight: 600; }
.as-ep-sub { font-size: 0.75rem; color: var(--as-text-muted); }

/* Latest release grid */
.as-release-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}
.as-release-card { text-decoration: none; color: inherit; }
.as-release-thumb {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--as-radius-sm);
  overflow: hidden;
  background: var(--as-bg-card);
}
.as-release-thumb img { width: 100%; height: 100%; object-fit: cover; }
.as-release-badge, .as-release-4k {
  position: absolute;
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  background: rgba(0,0,0,0.8);
}
.as-release-4k { top: 0.25rem; right: 0.25rem; background: #22c55e; }
.as-release-badge { bottom: 0.25rem; left: 0.25rem; }
.as-release-title { font-size: 0.9rem; margin: 0.5rem 0 0.2rem; }
.as-release-meta { font-size: 0.75rem; color: var(--as-text-muted); }

/* Recommendation */
.as-genre-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.as-pill {
  padding: 0.4rem 0.85rem;
  background: var(--as-bg-card);
  border: 1px solid var(--as-border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--as-text-muted);
  text-decoration: none;
}
.as-pill:hover { background: var(--as-primary); color: #fff; border-color: var(--as-primary); }
.as-rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}
.as-rec-card { text-decoration: none; color: inherit; }
.as-rec-thumb {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--as-radius-sm);
  overflow: hidden;
  background: var(--as-bg-card);
}
.as-rec-thumb img { width: 100%; height: 100%; object-fit: cover; }
.as-rec-type, .as-rec-status {
  position: absolute;
  font-size: 0.65rem;
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
  background: rgba(0,0,0,0.85);
}
.as-rec-type { top: 0.25rem; left: 0.25rem; }
.as-rec-status { bottom: 0.25rem; left: 0.25rem; background: var(--as-primary); }
.as-rec-title { font-size: 0.85rem; margin: 0.4rem 0 0; }

/* Filter bar */
.as-filter-bar { background: var(--as-bg-card); border-radius: var(--as-radius); padding: 1.5rem; border: 1px solid var(--as-border); }
.as-filter-title { font-size: 1.1rem; margin: 0 0 1rem; }
.as-filter-form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.as-filter-row { display: flex; flex-direction: column; gap: 0.25rem; }
.as-filter-label { font-size: 0.8rem; color: var(--as-text-muted); }
.as-filter-select {
  padding: 0.4rem 0.6rem;
  border-radius: var(--as-radius-sm);
  border: 1px solid var(--as-border);
  background: var(--as-bg-base);
  color: var(--as-text);
  min-width: 120px;
}
.as-filter-search { flex-direction: row; align-items: center; }
.as-filter-input {
  padding: 0.5rem 0.75rem;
  border-radius: var(--as-radius-sm);
  border: 1px solid var(--as-border);
  background: var(--as-bg-base);
  color: var(--as-text);
  min-width: 180px;
}

/* Popular Donghua */
.as-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.as-tab {
  padding: 0.4rem 0.75rem;
  background: var(--as-bg-card);
  border: 1px solid var(--as-border);
  border-radius: var(--as-radius-sm);
  color: var(--as-text-muted);
  cursor: pointer;
  font-size: 0.9rem;
}
.as-tab.active, .as-tab:hover { background: var(--as-primary); color: #fff; border-color: var(--as-primary); }
.as-popular-list { display: flex; flex-direction: column; gap: 0.5rem; }
.as-popular-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem;
  background: var(--as-bg-card);
  border-radius: var(--as-radius-sm);
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--as-border);
}
.as-popular-item:hover { border-color: var(--as-primary); }
.as-popular-rank {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--as-primary);
  min-width: 28px;
  text-align: center;
}
.as-popular-poster {
  width: 60px;
  height: 84px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--as-bg-elevated);
}
.as-popular-poster img { width: 100%; height: 100%; object-fit: cover; }
.as-popular-detail { flex: 1; min-width: 0; }
.as-popular-title { margin: 0 0 0.25rem; font-size: 0.95rem; }
.as-popular-genres { margin: 0; font-size: 0.8rem; color: var(--as-text-muted); }
.as-popular-rating { font-weight: 700; color: var(--as-accent); }

/* New Donghua list */
.as-new-list { list-style: none; margin: 0; padding: 0; }
.as-new-item { margin-bottom: 0.75rem; }
.as-new-link { display: flex; gap: 1rem; text-decoration: none; color: inherit; padding: 0.5rem; border-radius: var(--as-radius-sm); }
.as-new-link:hover { background: var(--as-bg-card); }
.as-new-poster {
  width: 70px;
  height: 98px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--as-bg-card);
}
.as-new-poster img { width: 100%; height: 100%; object-fit: cover; }
.as-new-info { flex: 1; min-width: 0; }
.as-new-title { margin: 0 0 0.25rem; font-size: 0.95rem; }
.as-new-date { font-size: 0.8rem; color: var(--as-text-muted); }
.as-new-genres { margin: 0.25rem 0; font-size: 0.8rem; color: var(--as-text-muted); }
.as-new-studio { font-size: 0.75rem; color: var(--as-primary); }

/* Recent posts */
.as-recent-list { list-style: none; margin: 0; padding: 0; }
.as-recent-list li { margin-bottom: 0.5rem; }
.as-recent-list a { color: var(--as-text-muted); text-decoration: none; }
.as-recent-list a:hover { color: var(--as-primary); }

.as-footer .as-container { padding-top: 2rem; padding-bottom: 2rem; }
.as-disclaimer { font-size: 0.8rem; color: var(--as-text-muted); margin-top: 1rem; font-style: italic; }

@media (max-width: 768px) {
  .as-nav-toggle { display: block; }
  .as-nav { display: none; }
  .as-nav.is-open { display: block; width: 100%; order: 3; }
  .as-nav-list { flex-direction: column; }
  .as-trending-link { flex-direction: column; }
  .as-trending-poster { flex: none; width: 100%; }
  .as-filter-form { flex-direction: column; }
  .as-filter-row { width: 100%; }
  .as-filter-select, .as-filter-input { width: 100%; min-width: 0; }
}
