/* SDA Advocates — 重構 demo 樣式（視頻優先，配色取自原站）
   原站色卡：強調色 #23CE9A（hover/active/overlay）、視頻區 #2CA5C4、
             深色區 #322E43（footer）、正文 #333、中性 #fff/#ddd/#999
   Logo 主色：#0D67A0（深藍）／#C59952（金銅） */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f8f9;
  --bg-card: #ffffff;
  --line: #e4e9ea;
  --line-strong: #d5dcdd;
  --fg: #333333;
  --fg-strong: #1f2326;
  --fg-dim: #8b9298;
  --accent: #23ce9a;          /* 原站強調色 */
  --accent-dark: #17b487;
  --accent-soft: rgba(35, 206, 154, 0.10);
  --video: #2ca5c4;           /* 原站視頻區色 */
  --video-soft: rgba(44, 165, 196, 0.10);
  --brand-blue: #0d67a0;      /* Logo 深藍 */
  --brand-gold: #c59952;      /* Logo 金銅 */
  --dark: #322e43;            /* 原站 footer 深色 */
  --dark-fg: #b8b5c4;
  --radius: 8px;
  --maxw: 1200px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ── Header ───────────────────────────── */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(50, 46, 67, 0.05);
}
header.site .wrap { display: flex; align-items: center; gap: 26px; height: 84px; }
.brand { display: flex; align-items: center; flex-shrink: 0; }
/* Logo 為方形堆疊版（持續智庫／SD ADVOCATES），依原站比例放到頁頭高度約 86% 才看得清字 */
.brand img { height: 62px; width: auto; }
.brand .txt { display: none; }

nav.main { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
nav.main a {
  padding: 8px 14px; border-radius: 6px; font-size: 15px; color: #555;
  transition: .15s; white-space: nowrap;
}
nav.main a:hover { color: var(--accent-dark); background: var(--bg-soft); }
nav.main a.active { color: var(--accent-dark); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.lang { font-size: 13px; color: var(--fg-dim); border-left: 1px solid var(--line); padding-left: 16px; white-space: nowrap; }
.lang a:hover { color: var(--accent-dark); }

/* ── Hero ─────────────────────────────── */
.hero { padding: 30px 0 6px; background: linear-gradient(180deg, var(--bg-soft), #fff); }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 28px; align-items: start;
}
.player {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 6px 22px rgba(50, 46, 67, 0.16);
}
.player iframe, .player img { width: 100%; height: 100%; border: 0; object-fit: cover; }
.player .play-btn {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.35)); cursor: pointer;
}
.player .play-btn svg { width: 76px; height: 76px; filter: drop-shadow(0 4px 14px rgba(0,0,0,.35)); transition: transform .18s; }
.player .play-btn:hover svg { transform: scale(1.07); }

.hero-side h1 { font-size: 26px; line-height: 1.4; margin: 6px 0 10px; color: var(--fg-strong); }
.hero-side .meta { color: var(--fg-dim); font-size: 13.5px; margin-bottom: 14px; }
.hero-side p { color: #5d6469; font-size: 15px; margin: 0 0 18px; }
.hero-side .more { color: var(--accent-dark); font-weight: 600; font-size: 14.5px; }
.hero-side .more:hover { text-decoration: underline; }

/* ── Sections ─────────────────────────── */
section.block { padding: 34px 0; }
.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.sec-head h2 { font-size: 20px; margin: 0; color: var(--fg-strong); letter-spacing: .3px; }
.sec-head h2::before {
  content: ''; display: inline-block; width: 4px; height: 18px; background: var(--accent);
  border-radius: 2px; margin-right: 10px; vertical-align: -3px;
}
.sec-head .more { margin-left: auto; font-size: 13.5px; color: var(--fg-dim); }
.sec-head .more:hover { color: var(--accent-dark); }

/* ── Video grid ───────────────────────── */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 22px; }
.vcard {
  background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: .18s; display: flex; flex-direction: column;
}
.vcard:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 10px 24px rgba(50, 46, 67, 0.12); }
.vthumb { position: relative; aspect-ratio: 16/9; background: #000; overflow: hidden; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.vcard:hover .vthumb img { transform: scale(1.04); }
.vthumb .badge {
  position: absolute; left: 9px; top: 9px; font-size: 11.5px; font-weight: 600;
  padding: 3px 10px; border-radius: 3px; background: var(--video); color: #fff;
  letter-spacing: .3px;
}
.vthumb .badge.none { background: rgba(50, 46, 67, .55); }
.vthumb .pl {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(44, 165, 196, 0); opacity: 0; transition: .18s;
}
.vcard:hover .pl { opacity: 1; background: rgba(44, 165, 196, .18); }
.vthumb .pl svg { width: 48px; height: 48px; }
.vbody { padding: 13px 15px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.vbody h3 { font-size: 15px; line-height: 1.55; margin: 0; font-weight: 600; color: var(--fg-strong);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard:hover .vbody h3 { color: var(--brand-blue); }
.vbody .d { font-size: 12.5px; color: var(--fg-dim); margin-top: auto; }

/* ── Filter bar ───────────────────────── */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.filters button {
  background: #fff; border: 1px solid var(--line-strong); color: #666;
  padding: 7px 16px; border-radius: 20px; font-size: 14px; cursor: pointer; font-family: inherit;
  transition: .15s;
}
.filters button:hover { color: var(--accent-dark); border-color: var(--accent); background: var(--accent-soft); }
.filters button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ── Article list ─────────────────────── */
.alist { display: flex; flex-direction: column; gap: 0; }
.arow {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px;
  padding: 16px 6px; border-bottom: 1px solid var(--line); align-items: baseline;
  transition: background .15s;
}
.arow:hover { background: var(--bg-soft); }
.arow .dt { color: var(--fg-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.arow h3 { font-size: 16px; margin: 0 0 6px; font-weight: 600; line-height: 1.55; color: var(--fg-strong); transition: color .15s; }
.arow:hover h3 { color: var(--brand-blue); }
.arow .tags { display: flex; gap: 7px; flex-wrap: wrap; }
.tag {
  font-size: 11.5px; padding: 2px 9px; border-radius: 3px;
  background: var(--accent-soft); color: var(--accent-dark); border: 1px solid rgba(35, 206, 154, .3);
}
.tag.grey { background: var(--video-soft); color: #1d7f99; border-color: rgba(44, 165, 196, .3); }
.tag.gold { background: rgba(197, 153, 82, .12); color: #96702f; border-color: rgba(197, 153, 82, .35); }

/* ── Article page ─────────────────────── */
article.post { max-width: 790px; margin: 0 auto; padding: 34px 0 10px; }
article.post h1 { font-size: 30px; line-height: 1.45; margin: 0 0 12px; color: var(--fg-strong); }
article.post .meta {
  color: var(--fg-dim); font-size: 14px; padding-bottom: 20px;
  border-bottom: 1px solid var(--line); margin-bottom: 26px;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
article.post .meta a { color: var(--brand-blue); }
article.post .content { font-size: 16.5px; color: #3d4448; }
article.post .content p { margin: 0 0 1.15em; }
article.post .content img { border-radius: 6px; margin: 18px 0; }
article.post .content a { color: var(--brand-blue); text-decoration: underline; }
article.post .content h2, article.post .content h3 { margin: 1.6em 0 .6em; line-height: 1.45; color: var(--fg-strong); }
article.post .content blockquote {
  margin: 1.4em 0; padding: 6px 20px; border-left: 3px solid var(--accent);
  background: var(--bg-soft); color: #4a5155;
}
article.post .content ul, article.post .content ol { padding-left: 1.5em; }
article.post .content table { border-collapse: collapse; width: 100%; font-size: 15px; }
article.post .content td, article.post .content th { border: 1px solid var(--line); padding: 7px 10px; }

/* ── Video watch page ─────────────────── */
.watch { max-width: 1040px; margin: 0 auto; padding: 28px 0 10px; }
.watch .player { margin-bottom: 22px; }
.watch h1 { font-size: 26px; line-height: 1.45; margin: 8px 0 10px; color: var(--fg-strong); }
.watch .meta { color: var(--fg-dim); font-size: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.watch .meta a { color: var(--brand-blue); }
.watch .desc { color: #5d6469; font-size: 15.5px; }
.watch .desc a { color: var(--brand-blue); }

/* ── Pagination ───────────────────────── */
.pager { display: flex; gap: 7px; justify-content: center; padding: 26px 0 6px; flex-wrap: wrap; }
.pager button {
  background: #fff; border: 1px solid var(--line-strong); color: #666;
  min-width: 38px; padding: 7px 11px; border-radius: 6px; cursor: pointer; font-family: inherit; font-size: 14px;
}
.pager button:hover { color: var(--accent-dark); border-color: var(--accent); }
.pager button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* ── Footer ───────────────────────────── */
footer.site { background: var(--dark); color: var(--dark-fg); margin-top: 46px; padding: 32px 0 46px; font-size: 13.5px; }
footer.site .wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
footer.site strong { color: #fff; font-weight: 600; }
footer.site .demo-note { margin-left: auto; font-size: 12.5px; opacity: .75; }

/* ── Responsive ───────────────────────── */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  header.site .wrap { height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; gap: 12px; }
  .brand img { height: 48px; }
  nav.main { margin-left: 0; }
  .lang { margin-left: auto; border-left: 0; }
  .arow { grid-template-columns: 1fr; gap: 6px; }
  .arow .dt { order: 2; }
}
