/* depot717 Phase 1 — unified design tokens + content surfaces
   Keep brand (dark/content hub). Do not invent a new visual identity. */

:root {
  --content-max-width: 1180px;
  --sidebar-width: 300px;
  --card-radius: 14px;
  --card-gap: 18px;
  --section-gap: 40px;
  --font-size-title: clamp(1.35rem, 1.1rem + 0.9vw, 1.85rem);
  --font-size-subtitle: 1.05rem;
  --font-size-body: 0.95rem;
  --font-size-meta: 0.78rem;
  --border-color: rgba(240, 195, 111, 0.18);
  --surface-color: rgba(28, 24, 18, 0.72);
  --surface-hover: rgba(40, 34, 26, 0.88);
  --muted-text: #b7a890;
  --accent-color: #e0b96f;
  --page-bg: #0c0b09;
  --card-surface: rgba(22, 19, 15, 0.92);
  --cover-ratio: 16 / 9;
  --btn-height: 42px;
}

body[data-theme="light"] {
  --border-color: rgba(167, 121, 52, 0.2);
  --surface-color: rgba(255, 250, 240, 0.72);
  --surface-hover: rgba(255, 252, 245, 0.92);
  --muted-text: #8a7a66;
  --accent-color: #a77934;
  --card-surface: rgba(255, 252, 246, 0.94);
}

/* —— Layout shell with optional sidebar ads —— */
.yc-layout-with-sidebar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  max-width: calc(var(--content-max-width) + var(--sidebar-width) + 48px);
  margin: 0 auto;
  padding: 0 20px;
}

.yc-layout-main { min-width: 0; }

.yc-layout-sidebar {
  display: none;
  width: var(--sidebar-width);
}

@media (min-width: 1100px) {
  .yc-layout-with-sidebar.has-sidebar {
    grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  }
  .yc-layout-with-sidebar.has-sidebar .yc-layout-sidebar {
    display: block;
  }
  .yc-ad-sidebar-sticky {
    position: sticky;
    top: 90px;
  }
}

@media (max-width: 1099px) {
  .yc-ad-slot-sidebar_primary,
  .yc-ad-slot-sidebar_secondary {
    display: none !important;
  }
}

/* —— ContentCard —— */
.yc-content-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  background: var(--card-surface);
  overflow: hidden;
  color: inherit;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.yc-content-card:hover {
  background: var(--surface-hover);
  border-color: color-mix(in srgb, var(--accent-color) 45%, transparent);
}

.yc-content-card-cover {
  position: relative;
  aspect-ratio: var(--cover-ratio);
  overflow: hidden;
  background: #12100e;
}

.yc-content-card-cover img,
.yc-content-card-cover .yc-cover-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.yc-content-card:hover .yc-content-card-cover img,
.yc-content-card:hover .yc-cover-fallback {
  transform: scale(1.03);
}

.yc-content-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
  flex: 1;
  min-height: 118px;
}

.yc-content-card-cat {
  font-size: var(--font-size-meta);
  letter-spacing: 0.04em;
  color: var(--accent-color);
  text-transform: none;
}

.yc-content-card-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

.yc-content-card-summary {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.yc-content-card-meta {
  margin-top: auto;
  font-size: var(--font-size-meta);
  color: var(--muted-text);
  opacity: 0.9;
}

.yc-content-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--card-gap);
}

@media (max-width: 1100px) {
  .yc-content-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .yc-content-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 430px) {
  .yc-content-grid { grid-template-columns: 1fr; }
}

/* —— CSS cover fallbacks (no gray empty box) —— */
.yc-cover-fallback {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 14px 16px;
  color: #f3ecdf;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  background:
    radial-gradient(circle at 78% 22%, rgba(224, 185, 111, 0.22), transparent 28%),
    linear-gradient(135deg, #121018 0%, #1c1628 48%, #0e1016 100%);
}

.yc-cover-fallback[data-kind="ai"] {
  background:
    radial-gradient(circle at 20% 30%, rgba(91, 141, 239, 0.28), transparent 32%),
    linear-gradient(135deg, #0b1220, #3b2a6d 55%, #0b1220);
}
.yc-cover-fallback[data-kind="hot"] {
  background:
    radial-gradient(circle at 80% 20%, rgba(226, 74, 74, 0.28), transparent 30%),
    linear-gradient(135deg, #141418, #5a1a1a 50%, #141418);
}
.yc-cover-fallback[data-kind="game"] {
  background:
    radial-gradient(circle at 30% 70%, rgba(61, 214, 195, 0.2), transparent 34%),
    linear-gradient(135deg, #0d1218, #1a3a2a 52%, #0d1218);
}
.yc-cover-fallback[data-kind="movie"] {
  background:
    radial-gradient(circle at 70% 40%, rgba(212, 165, 116, 0.22), transparent 32%),
    linear-gradient(135deg, #121014, #3a2040 50%, #121014);
}
.yc-cover-fallback[data-kind="tool"] {
  background:
    radial-gradient(circle at 40% 30%, rgba(110, 200, 255, 0.25), transparent 30%),
    linear-gradient(135deg, #0e1520, #1e3a5f 52%, #0e1520);
}
.yc-cover-fallback[data-kind="ent"],
.yc-cover-fallback[data-kind="topic"],
.yc-cover-fallback[data-kind="article"] {
  background:
    radial-gradient(circle at 60% 30%, rgba(240, 176, 96, 0.18), transparent 34%),
    linear-gradient(135deg, #12161c, #2a3540 55%, #101418);
}

/* —— Ads —— */
.yc-ad-slot {
  margin: 16px 0;
  border: 1px dashed color-mix(in srgb, var(--border-color) 80%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-color) 70%, transparent);
  text-align: center;
  overflow: hidden;
}

.yc-ad-label {
  display: block;
  padding: 6px 8px 0;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--muted-text);
  opacity: 0.75;
}

.yc-ad-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-text);
  font-size: 0.8rem;
}

.yc-ad-slot-pre_footer,
.yc-ad-slot-bottom_content {
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
}

.yc-ad-hide-mobile { }
@media (max-width: 768px) {
  .yc-ad-hide-mobile { display: none !important; }
}

/* —— Home density —— */
.yc-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.yc-home .yc-home-title {
  display: none;
}

.yc-cover-content h2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.yc-cover-content p,
.yc-ai-quick-body p,
.yc-hot-quick-card p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.yc-aeo-geo-panel,
.yc-home-aeo,
[class*="HomeAeo"],
.yc-section.yc-aeo-soft {
  opacity: 0.92;
}

/* Soften AEO blocks when placed lower */
.yc-aeo-geo-bottom,
#home-aeo-geo-bottom,
.yc-home .yc-aeo-soft {
  margin-top: var(--section-gap);
}

.yc-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.yc-section-more {
  font-size: var(--font-size-meta);
  color: var(--accent-color);
  white-space: nowrap;
}

/* —— Detail type shells —— */
.detail-facts dt { color: var(--muted-text); font-size: var(--font-size-meta); }
.detail-facts dd { margin: 0; }
.detail-facts:empty,
.detail-score-card.is-hidden { display: none !important; }

.detail-primary-action,
.yc-btn-primary {
  min-height: var(--btn-height);
  border-radius: 10px;
}

.detail-badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  font-size: var(--font-size-meta);
  color: var(--accent-color);
}

/* —— Search —— */
.yc-search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}

.yc-search-filter {
  border: 1px solid var(--border-color);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 6px 12px;
  min-height: 34px;
}

.yc-search-filter.is-active {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.yc-search-empty {
  padding: 48px 20px;
  text-align: center;
  border: 1px dashed var(--border-color);
  border-radius: var(--card-radius);
}

.yc-search-empty h2 { margin: 0 0 8px; }
.yc-search-empty p { color: var(--muted-text); }

.yc-search-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.yc-search-suggest a {
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: var(--font-size-meta);
}

/* —— Footer polish —— */
.yc-commercial-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px;
  max-width: var(--content-max-width);
  margin: 0 auto;
}

@media (max-width: 900px) {
  .yc-commercial-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .yc-commercial-footer-grid {
    grid-template-columns: 1fr;
  }
}

.yc-footer-qr { display: none; }

/* —— Category hero —— */
.yc-category-hero {
  max-width: var(--content-max-width);
  margin: 0 auto 20px;
  padding: 18px 20px;
}

.yc-category-hero h1 {
  margin: 0 0 8px;
  font-size: var(--font-size-title);
}

.yc-category-hero p {
  margin: 0;
  color: var(--muted-text);
  max-width: 52rem;
}

/* Mascot: never show error text block as content */
.mascot-missing { display: none !important; }
.mascot-widget.is-image-failed .mascot-body { display: none; }
.mascot-widget.is-image-failed .mascot-controls .mascot-style-toggle,
.mascot-widget.is-image-failed .mascot-controls .mascot-scale-btn { display: none; }

/* —— Phase1 professional: surfaces / type / explore / tabs —— */
:root {
  --font-size-hero: clamp(1.85rem, 1.4rem + 1.6vw, 2.5rem);
  --font-size-section: clamp(1.25rem, 1.05rem + 0.7vw, 1.65rem);
  --font-size-card-title: clamp(0.95rem, 0.9rem + 0.2vw, 1.15rem);
  --surface-0: transparent;
  --surface-1: rgba(28, 24, 18, 0.45);
  --surface-2: rgba(36, 30, 22, 0.72);
}
body[data-theme="light"] {
  --surface-1: rgba(255, 250, 240, 0.55);
  --surface-2: rgba(255, 252, 246, 0.88);
}
.yc-home .yc-home-title { font-size: var(--font-size-hero); font-weight: 800; letter-spacing: -0.02em; }
.yc-section { max-width: var(--content-max-width); margin: 0 auto var(--section-gap); padding: 18px 20px 22px; }
.yc-section.surface-0 { background: var(--surface-0); }
.yc-section.surface-1 { background: var(--surface-1); border-radius: calc(var(--card-radius) + 4px); }
.yc-section.surface-2 { background: var(--surface-2); border-radius: calc(var(--card-radius) + 4px); border: 1px solid var(--border-color); }
.yc-section-bordered { border: 1px solid var(--border-color); border-radius: calc(var(--card-radius) + 4px); }
.yc-section-title { margin: 0; font-size: var(--font-size-section); font-weight: 750; letter-spacing: -0.01em; }
.yc-section-desc { margin: 4px 0 0; font-size: var(--font-size-meta); color: var(--muted-text); }
.yc-section-head { align-items: flex-start; flex-wrap: wrap; gap: 12px 16px; }
.yc-section-actions { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-left: auto; }
.yc-btn-ghost { border: 1px solid var(--border-color); border-radius: 999px; padding: 5px 11px; }
.yc-explore { padding-top: 10px; padding-bottom: 12px; }
.yc-explore-track { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.yc-explore-item {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: 8px; row-gap: 2px; align-items: center; padding: 10px 12px;
  border: 1px solid var(--border-color); border-radius: 12px; background: var(--card-surface);
  min-height: 64px; transition: border-color .2s ease, background .2s ease;
}
.yc-explore-item:hover { border-color: color-mix(in srgb, var(--accent-color) 50%, transparent); background: var(--surface-hover); }
.yc-explore-icon { grid-row: 1 / span 2; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; color: var(--accent-color); }
.yc-explore-item strong { font-size: 0.92rem; font-weight: 700; }
.yc-explore-item small { grid-column: 2; color: var(--muted-text); font-size: 0.72rem; }
@media (max-width: 900px) {
  .yc-explore-track { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .yc-explore-item { flex: 0 0 148px; scroll-snap-align: start; }
}
.yc-tab-row { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.yc-tab { border: 1px solid transparent; background: transparent; color: var(--muted-text); border-radius: 999px; padding: 5px 11px; min-height: 30px; font-size: var(--font-size-meta); }
.yc-tab.is-active { color: var(--accent-color); border-color: color-mix(in srgb, var(--accent-color) 45%, transparent); }
.yc-tab-panel[hidden], .yc-factcheck-teaser[hidden] { display: none !important; }
.yc-tab-filter-item { min-width: 0; }
.yc-tab-filter-item > .yc-content-card { height: 100%; }
.yc-poster-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--card-gap); }
.yc-poster-card { display: flex; flex-direction: column; border-radius: var(--card-radius); overflow: hidden; border: 1px solid var(--border-color); background: var(--card-surface); }
.yc-poster-media { aspect-ratio: 2 / 3; background: #12100e; overflow: hidden; }
.yc-poster-media img, .yc-poster-media .yc-cover-fallback { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.yc-poster-card:hover .yc-poster-media img { transform: scale(1.03); }
.yc-poster-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; min-height: 72px; }
.yc-poster-body strong { font-size: var(--font-size-card-title); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yc-poster-body span, .yc-poster-body small { color: var(--muted-text); font-size: var(--font-size-meta); }
@media (max-width: 900px) { .yc-poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .yc-poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.yc-today-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.yc-hero-card { display: flex; flex-direction: column; border-radius: var(--card-radius); overflow: hidden; border: 1px solid var(--border-color); background: var(--card-surface); min-height: 100%; }
.yc-hero-card-media { aspect-ratio: 16 / 9; overflow: hidden; background: #12100e; }
.yc-hero-card-media img, .yc-hero-card-media .yc-cover-fallback { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.yc-hero-card:hover .yc-hero-card-media img { transform: scale(1.03); }
.yc-hero-card-body { padding: 14px 16px 16px; }
.yc-hero-card-body h3 { margin: 4px 0 8px; font-size: clamp(1.1rem, 1rem + 0.4vw, 1.35rem); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.yc-hero-card-body p { margin: 0; color: var(--muted-text); font-size: 0.9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.yc-compact-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.yc-compact-card { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; background: var(--card-surface); min-height: 72px; }
.yc-compact-media { aspect-ratio: 16 / 9; height: 100%; min-height: 72px; background: #12100e; }
.yc-compact-media img, .yc-compact-media .yc-cover-fallback { width: 100%; height: 100%; object-fit: cover; }
.yc-compact-card span { display: block; font-size: var(--font-size-meta); color: var(--accent-color); }
.yc-compact-card strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 0.92rem; }
@media (max-width: 860px) { .yc-today-layout { grid-template-columns: 1fr; } }
.yc-home-ribbon { display: none !important; }
.yc-tag-cloud a { border: 1px solid var(--border-color); border-radius: 999px; padding: 5px 11px; font-size: var(--font-size-meta); color: var(--muted-text); }
.yc-tag-cloud a:hover { color: var(--accent-color); }
.yc-aeo-soft { opacity: 0.78; max-width: var(--content-max-width); margin-left: auto; margin-right: auto; padding: 0 20px 24px; }
.yc-empty-inline { color: var(--muted-text); font-size: var(--font-size-meta); }
.yc-home .yc-ad-slot-bottom_content { display: none !important; }
.yc-home .yc-ad-slot-sidebar_primary,
.yc-home .yc-ad-slot-sidebar_secondary { display: none !important; }
