/* AliCast: Alibaba Cloud orange on a clean light theme, with a dark theme (system default or the toggle). */
:root {
  --orange: #ff6a00;
  --orange-dark: #e15c00;
  --orange-soft: #fff0e5;
  --orange-ink: #c24f00;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f1f4;
  --ink: #16181d;
  --ink-2: #4b5060;
  --ink-3: #868b98;
  --line: #e3e5ea;
  --hero: #0f1115;
  --hero-ink: #ffffff;
  --hero-ink-2: #b9bdc7;
  --shadow: 0 1px 2px rgba(16, 18, 24, 0.04), 0 8px 24px rgba(16, 18, 24, 0.06);
  --cat-model: #ff6a00;
  --cat-deal: #1354ee;
  --cat-funding: #0f9d76;
  --cat-partner: #7a4fe0;
  --cat-adopt: #e0a100;
  --cat-policy: #d6336c;
  --cat-infra: #0b8bbd;
  --cat-research: #6b7a90;
  --cat-other: #a2a7b3;
  --radius: 12px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --orange-soft: rgba(255, 106, 0, 0.14);
  --orange-ink: #ff9a4d;
  --bg: #0d0f12;
  --surface: #16191e;
  --surface-2: #1d2127;
  --ink: #eceef2;
  --ink-2: #b4b9c4;
  --ink-3: #7c8290;
  --line: #2a2f37;
  --hero: #08090b;
  --shadow: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --orange-soft: rgba(255, 106, 0, 0.14);
    --orange-ink: #ff9a4d;
    --bg: #0d0f12;
    --surface: #16191e;
    --surface-2: #1d2127;
    --ink: #eceef2;
    --ink-2: #b4b9c4;
    --ink-3: #7c8290;
    --line: #2a2f37;
    --hero: #08090b;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  transition: background-color 0.2s, color 0.2s;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 6px; }

/* ---------- nav ---------- */
.nav { background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.nav-in { height: 68px; display: flex; align-items: center; gap: 40px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.ac-logo { height: 19px; width: auto; display: block; }
.brand-sep { width: 1px; height: 18px; background: var(--line); }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.nav-links { display: flex; align-items: center; gap: 6px; margin: 0 auto; }
.nav-links a { text-decoration: none; padding: 8px 16px; border-radius: 999px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink-2); white-space: nowrap; transition: background-color 0.15s, color 0.15s; }
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links a.active { color: var(--orange-ink); background: var(--orange-soft); }
.nav-tools { display: flex; gap: 8px; flex: none; margin-left: auto; }
.nav-links + .nav-tools { margin-left: 0; }
.tool { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.tool:hover { color: var(--orange-ink); border-color: var(--orange); }
.tool svg { width: 19px; height: 19px; }

/* ---------- hero ---------- */
.hero {
  background-color: var(--hero);
  background-image:
    radial-gradient(600px 320px at 85% 20%, rgba(255, 106, 0, 0.22), transparent 70%),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: auto, 44px 44px, 44px 44px;
  color: var(--hero-ink);
  border-bottom: 3px solid var(--orange);
}
.hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 72px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; color: var(--orange); font-weight: 700; font-size: 12.5px; letter-spacing: 0.12em; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.25); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(255, 106, 0, 0.08); } }
.hero h1 { margin: 0 0 18px; font-size: 46px; line-height: 1.22; letter-spacing: -0.035em; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--orange); }
.lede { margin: 0; color: var(--hero-ink-2); font-size: 17px; max-width: 31em; }
.hero-cta { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 11px 18px; font-weight: 700; font-size: 15px; text-decoration: none; border: 1px solid transparent; }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--orange); color: #fff; }
.btn.primary:hover { background: var(--orange-dark); }
.btn.ghost { border-color: rgba(255, 255, 255, 0.22); color: #fff; }
.btn.ghost:hover { border-color: var(--orange); }
.stats { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 8px 32px; margin: 36px 0 0; }
.stats div { min-width: 0; }
.stats dt { color: var(--hero-ink-2); font-size: 13px; }
.stats dd { margin: 2px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats dd small { font-size: 14px; font-weight: 600; color: var(--hero-ink-2); margin-left: 2px; }

/* latest episode card */
.latest { background: var(--surface); color: var(--ink); border-radius: 16px; padding: 28px; min-height: 260px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35); border: 1px solid var(--line); }
.latest-empty { color: var(--ink-3); display: flex; align-items: center; justify-content: center; min-height: 204px; text-align: center; }
.latest-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--orange-ink); background: var(--orange-soft); padding: 4px 10px; border-radius: 999px; }
.latest .date { color: var(--ink-3); font-size: 14px; }
.latest h3 { margin: 12px 0 6px; font-size: 24px; line-height: 1.35; letter-spacing: -0.02em; }
.latest p.sum { margin: 0; color: var(--ink-2); font-size: 15px; }
.wave { display: flex; align-items: center; gap: 3px; height: 46px; margin: 20px 0 16px; }
.wave i { flex: 1; min-width: 2px; border-radius: 2px; background: var(--line); height: var(--h); transform-origin: center; transition: background 0.3s; }
.wave.on i { background: var(--orange); animation: bounce 1.1s ease-in-out infinite; animation-delay: var(--d); }
@keyframes bounce { 50% { transform: scaleY(0.45); } }
.latest-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.play-big { display: inline-flex; align-items: center; gap: 10px; background: var(--orange); color: #fff; border: 0; border-radius: 999px; padding: 11px 22px 11px 16px; font-weight: 700; font-size: 16px; }
.play-big:hover { background: var(--orange-dark); }
.play-big svg { width: 22px; height: 22px; }
.meta { color: var(--ink-3); font-size: 14px; }
.act { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; text-decoration: none; padding: 8px 6px; background: none; border: 0; border-radius: 8px; }
.act:hover { color: var(--orange-ink); }
.act svg { width: 18px; height: 18px; }
.chapters { list-style: none; margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.chapters li button { width: 100%; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left; background: none; border: 0; padding: 7px 8px; border-radius: 8px; font-size: 14px; color: var(--ink-2); }
.chapters li button:hover, .chapters li button.now { background: var(--surface-2); color: var(--ink); }
.chapters .t { color: var(--orange-ink); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.chapters .h { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- next-episode countdown ---------- */
.next { background: var(--surface); border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.next-in { display: flex; align-items: center; gap: 10px; min-height: 44px; flex-wrap: wrap; }
.next-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); flex: none; }
.next-count { color: var(--orange-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.next-last { margin-left: auto; color: var(--ink-3); }

/* ---------- sections ---------- */
.block { padding: 64px 0 0; }
.block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.kicker { margin: 0 0 4px; color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: 0.14em; }
.block h2 { margin: 0; font-size: 28px; letter-spacing: -0.025em; line-height: 1.25; }
.block-sub { margin: 0; color: var(--ink-3); font-size: 14px; }

.cat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.cat::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--cat-other)); }
.tag-kr { color: var(--orange-ink); background: var(--orange-soft); border-radius: 4px; padding: 1px 7px; font-size: 12px; font-weight: 700; }

.stories { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.story { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px; display: flex; flex-direction: column; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.story::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--cat-other)); }
.story-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.story-top .num { font-variant-numeric: tabular-nums; color: var(--ink-3); }
.jump { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 10px 3px 7px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.jump:hover { border-color: var(--orange); color: var(--orange-ink); }
.jump svg { width: 13px; height: 13px; }
.story h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.42; letter-spacing: -0.01em; }
.story p { margin: 0 0 14px; color: var(--ink-2); font-size: 15px; }
.sources { margin: auto 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); list-style: none; display: flex; flex-wrap: wrap; gap: 6px 8px; font-size: 12.5px; }
.sources a { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); text-decoration: none; background: var(--surface-2); padding: 3px 9px; border-radius: 6px; }
.sources a:hover { color: var(--orange-ink); }
.sources a svg { width: 11px; height: 11px; }

/* trends */
.trend-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 14px; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: calc(13px + var(--w, 0) * 4px); font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--orange); color: var(--orange-ink); }
.chip small { color: var(--ink-3); font-weight: 600; font-size: 11.5px; }
.chip b { color: var(--orange-ink); font-size: 12px; }
.catbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.catbar span { background: var(--c); min-width: 4px; }
.legend { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 13.5px; color: var(--ink-2); }
.legend li { display: flex; justify-content: space-between; gap: 8px; }
.legend b { font-variant-numeric: tabular-nums; color: var(--ink); }
.kr-ratio { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.kr-ratio .bar { height: 8px; border-radius: 4px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.kr-ratio .bar span { display: block; height: 100%; background: var(--orange); }

/* archive */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { flex: 1 1 280px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--ink-3); }
.search:focus-within { border-color: var(--orange); }
.search svg { width: 18px; height: 18px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 15px; padding: 11px 0; outline: none; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.fbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.fbtn[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.month { margin: 26px 0 10px; font-size: 14px; font-weight: 800; color: var(--ink-3); letter-spacing: 0.02em; }
.month:first-child { margin-top: 0; }
.episodes { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ep { border-top: 1px solid var(--line); }
.ep:first-child { border-top: 0; }
.ep-row { display: grid; grid-template-columns: 76px 1fr auto; gap: 18px; align-items: center; padding: 18px 22px; }
.ep-date { line-height: 1.2; }
.ep-date b { display: block; font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ep-date span { color: var(--ink-3); font-size: 13px; }
.ep-main { min-width: 0; }
.ep-title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.4; }
.ep-sum { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ep-cats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; align-items: center; }
.ep-more { background: none; border: 0; padding: 0; color: var(--ink-3); font-size: 13px; font-weight: 600; }
.ep-more:hover { color: var(--orange-ink); }
.ep-side { display: flex; align-items: center; gap: 6px; }
.ep-len { color: var(--ink-3); font-size: 13px; margin-right: 6px; white-space: nowrap; }
.ibtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: var(--ink); text-decoration: none; flex: none; }
.ibtn:hover { border-color: var(--orange); color: var(--orange-ink); }
.ibtn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.ibtn.primary:hover { background: var(--orange-dark); color: #fff; }
.ibtn svg { width: 18px; height: 18px; }
.archived { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.ep-detail { padding: 0 22px 22px 116px; }
.ep-detail h4 { margin: 14px 0 8px; font-size: 13px; color: var(--ink-3); font-weight: 800; letter-spacing: 0.04em; }
.ep-detail .story { box-shadow: none; background: var(--surface-2); border: 0; padding: 16px 18px; margin-bottom: 10px; }
.ep-detail .sources a { background: var(--surface); }
.transcript { background: var(--surface-2); border-radius: var(--radius); padding: 16px 18px; max-height: 440px; overflow: auto; font-size: 15px; }
.transcript p { margin: 0 0 10px; }
.transcript b { color: var(--orange-ink); margin-right: 8px; }
.transcript .seg { margin: 16px 0 8px; font-size: 12.5px; font-weight: 800; color: var(--ink-3); }
.transcript .seg:first-child { margin-top: 0; }
.no-match { color: var(--ink-3); text-align: center; padding: 28px 0; }

/* footer */
.foot { margin-top: 80px; border-top: 1px solid var(--line); background: var(--surface); padding: 30px 0 120px; color: var(--ink-3); font-size: 14px; }
.foot-in { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.foot-brand { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot-brand img { height: 18px; width: auto; }
.foot-brand p { margin: 0; }
.foot strong { color: var(--ink); }
.foot-links { display: flex; gap: 18px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--orange-ink); }

/* bottom player */
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #0f1115; color: #fff; border-top: 3px solid var(--orange); }
.player-in { display: flex; align-items: center; gap: 16px; height: 80px; }
.p-controls { display: flex; align-items: center; gap: 6px; flex: none; }
.p-skip { width: 38px; height: 38px; border-radius: 50%; border: 1px solid #343842; background: none; color: #d6d9df; font-size: 11.5px; font-weight: 800; }
.p-skip:hover { border-color: var(--orange); color: #fff; }
.pbtn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--orange); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pbtn svg { width: 22px; height: 22px; }
.p-meta { flex: 1; min-width: 0; }
.p-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-chapter { color: var(--orange); margin-left: 10px; font-weight: 700; }
.p-bar { display: flex; align-items: center; gap: 10px; }
.p-time { font-size: 12px; color: #a9aeb8; font-variant-numeric: tabular-nums; min-width: 38px; }
.p-time:last-child { text-align: right; }
.p-track { position: relative; flex: 1; display: flex; align-items: center; }
.p-track input { width: 100%; accent-color: var(--orange); height: 4px; margin: 8px 0; }
.p-marks { position: absolute; left: 0; right: 0; top: 50%; height: 0; pointer-events: none; }
.p-marks i { position: absolute; top: -7px; width: 2px; height: 6px; background: #8b909a; border-radius: 1px; }
.p-speed { background: #1d2127; border: 1px solid #343842; color: #fff; border-radius: 8px; padding: 5px 10px; font-size: 13px; min-width: 54px; }
.p-icon { width: 38px; height: 38px; border: 0; background: none; color: #c9ccd3; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.p-icon:hover { color: #fff; }
.p-icon svg { width: 20px; height: 20px; }

.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 40; box-shadow: var(--shadow); }

@media (prefers-reduced-motion: reduce) {
  .wave.on i, .eyebrow .dot { animation: none; }
  html { scroll-behavior: auto; }
}
@media (max-width: 1100px) {
  .nav-in { gap: 24px; }
  .nav-links a { padding: 8px 12px; }
}
@media (max-width: 980px) {
  .nav-links { display: none; }
  .hero-in { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: 48px; padding-bottom: 48px; }
  .hero h1 { font-size: 36px; }
  .stories, .trend-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .ac-logo { height: 15px; }
  .brand-name { font-size: 17px; }
  .brand { gap: 10px; }
  .hero h1 { font-size: 29px; }
  .lede { font-size: 15.5px; }
  .stats { grid-template-columns: repeat(2, auto); gap: 12px 28px; }
  .latest { padding: 20px; }
  .latest h3 { font-size: 20px; }
  .block h2 { font-size: 24px; }
  .next-in { padding: 10px 0; gap: 4px 10px; }
  .next-last { margin-left: 17px; flex-basis: 100%; }
  .legend { grid-template-columns: 1fr; }
  .ep-row { grid-template-columns: 1fr auto; gap: 12px; padding: 16px; }
  .ep-date { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; }
  .ep-date b { display: inline; font-size: 15px; }
  .ep-len { display: none; }
  .ep-detail { padding: 0 16px 18px; }
  .player-in { gap: 10px; height: 76px; }
  .p-skip, .p-speed, #p-dl, .p-chapter { display: none; }
}
