:root {
  --purple: #c9a7eb;
  --purple-soft: #e9dcf7;
  --pink-soft: #fbe9f1;
  --yellow: #ffd447;
  --ink: #141414;
  --ink-soft: #4a4550;
  --card: #ffffff;
  --bg: #faf7fd;
}

* { box-sizing: border-box; }

/* 防禦：圖片／影片永遠不超出容器（即使樣式部分失效） */
img, video { max-width: 100%; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
}

a { color: inherit; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* Header */
header {
  background: rgba(250, 247, 253, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--purple-soft);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}
.wordmark {
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.wordmark .dot { color: var(--purple); }
.lang {
  display: flex;
  flex-wrap: wrap;                            /* 五種語言：窄螢幕自動換行 */
  justify-content: flex-end;
  gap: 4px;
  font-size: 0.85rem;
}
.lang a {
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--ink-soft);
}
.lang a:hover { background: var(--purple-soft); }
.lang a[aria-current="page"] {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
}

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--purple-soft) 0%, var(--pink-soft) 55%, var(--bg) 100%);
  text-align: center;
  padding: 64px 0 56px;
}
.hero .kicker {
  display: inline-block;
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.hero .avatar {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 8px 26px rgba(201, 167, 235, 0.6);
  margin: 0 auto 18px;
  display: block;
}
.stats {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 22px auto 4px;
  max-width: 380px;
}
.stats div {
  flex: 1;
  padding: 0 6px;
}
.stats .num {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}
.stats .label {
  font-size: 0.72rem;
  color: var(--ink-soft);
}
.stats div + div { border-left: 1px solid var(--purple-soft); }
.stats-note {
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin: 2px 0 0;
}
.hero h1 {
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  margin: 0 0 10px;
  letter-spacing: 0.01em;
}
.hero .sub {
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0 auto 28px;
  max-width: 34em;
}
.btn {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 13px 32px;
  border-radius: 999px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(20, 20, 20, 0.25);
}
.hero .jump {
  margin-top: 20px;
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 4px;
}
.hero .jump a {
  color: var(--ink-soft);
  padding: 4px 8px;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 1px dashed var(--purple);
}
.hero .jump a:hover { color: var(--ink); }

/* Sections */
section { padding: 48px 0; }
h2 {
  font-size: 1.4rem;
  margin: 0 0 8px;
}
h2 + .section-note {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0 0 24px;
}
h2 .bar {
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  border-radius: 3px;
  background: var(--purple);
  margin-right: 10px;
}

/* 即時字幕：整個 <section> 預設 hidden，只有她在直播、而且字幕來源接得上
   才由 live.js 打開。她沒開播時訪客完全不會看到這一區。 */
#subs[hidden] { display: none; }
.subs-list {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 640px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* 捲動時不要把整頁一起帶著跑 */
  overscroll-behavior: contain;
}
.subs-list .sub {
  background: var(--card);
  border: 1px solid var(--purple-soft);
  border-left: 3px solid var(--purple);
  border-radius: 14px;
  padding: 12px 15px;
  animation: sub-in 0.18s ease-out;
}
/* 她說越南語時換個顏色，一眼看得出這句原本是哪個語言 */
.subs-list .sub.from-vi { border-left-color: #7cb2e8; }
.subs-list .sub p { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }
.subs-list .sub-zh { font-size: 1rem; color: var(--ink); }
.subs-list .sub-vi { font-size: 0.9rem; color: var(--ink-soft); margin-top: 4px; }
.subs-status {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  margin-top: 12px;
  min-height: 1.2em;
}
@keyframes sub-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .subs-list .sub { animation: none; }
}

/* 直播徽章：預設 hidden，只有 /api/live 回報開播中才由 live.js 顯示 */
.live-badge {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  margin: 0 auto 16px;
  padding: 9px 18px;
  border-radius: 999px;
  background: #fdeaea;
  border: 1px solid #f5c2c2;
  color: #a11b1b;
  font-size: 0.9rem;
  line-height: 1.4;
}
.live-badge[hidden] { display: none; }
.live-badge .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e03131;
  flex: none;
  animation: live-pulse 1.6s ease-in-out infinite;
}
.live-badge .live-title {
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.live-badge .live-viewers { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}
@media (prefers-reduced-motion: reduce) {
  .live-badge .dot { animation: none; }
}

/* 訂閱開播通知：次要按鈕，不跟主 CTA 搶。預設 hidden，能力偵測過才顯示 */
.btn-sub {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--purple-soft);
  background: var(--card);
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
  max-width: 100%;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.btn-sub[hidden] { display: none; }
.btn-sub:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--purple); }
.btn-sub:disabled { cursor: default; opacity: 0.75; }
.btn-sub[data-state="on"] { border-color: var(--purple); color: var(--ink); }

/* Video */
.video-frame {
  max-width: 340px;
  margin: 0 auto;
}
.video-frame video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 20px;
  box-shadow: 0 14px 40px rgba(201, 167, 235, 0.55);
  background: var(--ink);
}
.video-caption {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-top: 14px;
}

/* 更多翻唱：站內自架可播放的影片卡（poster 縮圖也自架，TikTok 簽章網址會過期）。
   影片可在站內播放才拿得到 Google 影片複合式搜尋結果；標題再連出去 TikTok。 */
.covers-heading {
  text-align: center;
  font-size: 1rem;
  color: var(--ink-soft);
  font-weight: 600;
  margin: 32px 0 14px;
}
.covers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  max-width: 520px;
  margin-inline: auto;
}
.covers video {
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  display: block;
  border-radius: 16px;
  background: var(--ink);
  box-shadow: 0 8px 26px rgba(201, 167, 235, 0.45);
}
.covers .cover-title {
  display: block;
  margin-top: 10px;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--ink-soft);
  text-align: center;
}
.covers .cover-title a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--purple-soft);
}
.covers .cover-title a:hover,
.covers .cover-title a:focus-visible {
  color: var(--ink);
}

/* Profile card */
.profile-card {
  background: var(--card);
  border: 1px solid var(--purple-soft);
  border-radius: 20px;
  padding: 28px 28px 12px;
  box-shadow: 0 6px 24px rgba(201, 167, 235, 0.25);
}
.profile-card dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 24px;
  row-gap: 4px;
  margin: 0;
}
.profile-card dt {
  font-weight: 700;
  color: var(--ink-soft);
  padding: 8px 0;
}
.profile-card dd {
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px dashed var(--purple-soft);
}
.profile-card dd:last-of-type { border-bottom: none; }
.tag {
  display: inline-block;
  background: var(--purple-soft);
  border-radius: 999px;
  padding: 1px 12px;
  font-size: 0.9rem;
  margin-right: 6px;
}
.soon { color: var(--ink-soft); font-style: italic; }

/* Social links */
.social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.social-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--purple-soft);
  border-radius: 16px;
  padding: 14px 18px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.social-list a:hover {
  transform: translateY(-2px);
  border-color: var(--purple);
}
.social-list .icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
}
.icon.ig { background: linear-gradient(45deg, #f58529, #dd2a7b 55%, #8134af); }
.icon.yt { background: #ff0000; }
.icon.fb { background: #1877f2; }
.social-list .handle {
  color: var(--ink-soft);
  font-weight: 400;
  font-size: 0.88rem;
}

/* Footer */
footer {
  background: var(--ink);
  color: #cfc8d8;
  font-size: 0.88rem;
  margin-top: 40px;
  padding: 36px 0;
  text-align: center;
}
footer a { color: #fff; }
footer .footer-lang { margin-top: 10px; }
footer .footer-lang a {
  margin: 0 8px;
  text-decoration: none;
}
footer .footer-lang a:hover { text-decoration: underline; }
footer .origin { margin-top: 14px; color: #9a90a8; }

/* 404 */
.notfound {
  text-align: center;
  padding: 90px 20px;
}
.notfound .code {
  font-size: 4.5rem;
  font-weight: 800;
  color: var(--purple);
  line-height: 1;
}
.notfound ul {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 18px;
  justify-content: center;
}

/* FAQ */
.faq { display: grid; gap: 4px; }
.faq .qa { padding: 18px 0; border-bottom: 1px dashed var(--purple-soft); }
.faq .qa:last-child { border-bottom: none; }
.faq h3 { font-size: 1.05rem; margin: 0 0 6px; }
.faq p { margin: 0; color: var(--ink-soft); }

/* Mobile */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  /* 五種語言在手機一行放不下：讓語言列整組換到 wordmark 下方獨佔一列 */
  .header-row { flex-wrap: wrap; row-gap: 2px; }
  .lang { width: 100%; justify-content: flex-start; gap: 2px; }
  .lang a { padding: 8px 10px; }              /* 更大的觸控目標 */
  .hero { padding: 40px 0 44px; }
  .hero .avatar { width: 100px; height: 100px; margin-bottom: 14px; }
  .hero .sub { font-size: 1rem; margin-bottom: 24px; }
  .stats .num { font-size: 1.2rem; }
  section { padding: 40px 0; }
  h2 { font-size: 1.25rem; }
  .profile-card { padding: 24px 20px 10px; }
  .profile-card dl { column-gap: 16px; }
  .social-list a { padding: 13px 15px; }
}

@media (max-width: 360px) {
  .lang a { padding: 8px 8px; }
  .hero h1 { font-size: 2rem; }
}
