/* =========================================================
   deck.vista.tw 首頁（簡報庫索引）：vista.tw v3 課程簡報風（2026-10-10）
   token 照抄 vista-official-site/src/styles/v3.css，深淺色兩條路（系統 auto＋html[data-theme]）MUST 同步。
   只給首頁用；kit 頁仍用 brand.css。
   ========================================================= */
:root {
  --paper: #FBF6EC; --paper-2: #F3EADA; --card: #FFFFFF;
  --ink: #1A1714; --ink-2: #4A443C; --line: #E4DCCD;
  --yellow: #FFC21A;
  --blue-t: #2747D6; --teal-t: #08707A; --red-t: #B8320D; --pink-t: #B82A5E;
  --tint-yellow: #FFF1C2; --tint-blue: #E3E8FB; --tint-pink: #FBE1EA; --tint-red: #FBE3D9; --tint-teal: #DDF0EF;
  --tint-ink: #1A1714; --tint-ink-fg: #FBF6EC; --tint-ink-fg2: #D9D1C3;
  --shadow: 4px 4px 0 var(--ink);
  --font-body: 'Figtree', -apple-system, 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans TC', sans-serif;
  --f-title: 'Figtree', 'Vista Round TC', var(--font-body);
  --f-mono: 'JetBrains Mono', ui-monospace, var(--font-body);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #172A4A; --paper-2: #1E345C; --card: #22396A;
    --ink: #DDE4F0; --ink-2: #B9C4D8; --line: #34507F;
    --shadow: 4px 4px 0 #0B1528;
    --blue-t: #9DB2FF; --teal-t: #5CD6DC; --red-t: #FF9A7A; --pink-t: #FF8FB3;
    --tint-yellow: #3D3417; --tint-blue: #22365F; --tint-pink: #4A2440; --tint-red: #4A2A22; --tint-teal: #123F48;
    --tint-ink: #0B1528; --tint-ink-fg: #DDE4F0; --tint-ink-fg2: #B9C4D8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #172A4A; --paper-2: #1E345C; --card: #22396A;
  --ink: #DDE4F0; --ink-2: #B9C4D8; --line: #34507F;
  --shadow: 4px 4px 0 #0B1528;
  --blue-t: #9DB2FF; --teal-t: #5CD6DC; --red-t: #FF9A7A; --pink-t: #FF8FB3;
  --tint-yellow: #3D3417; --tint-blue: #22365F; --tint-pink: #4A2440; --tint-red: #4A2A22; --tint-teal: #123F48;
  --tint-ink: #0B1528; --tint-ink-fg: #DDE4F0; --tint-ink-fg2: #B9C4D8;
  color-scheme: dark;
}

/* [hidden] 的 display:none 來自 UA 樣式表，特異度輸給作者端的 display 宣告（見 CLAUDE.md） */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.75;
}
a { color: var(--blue-t); }
:is(a, button, input):focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
h1, h2, h3 { font-family: var(--f-title); font-weight: 800; line-height: 1.16; color: var(--ink); margin: 0; }
.mono { font-family: var(--f-mono); font-weight: 600; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }

/* ── 按鈕 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; font-weight: 900; font-size: 17px; padding: 10px 24px; border-radius: 14px; border: 2px solid var(--ink); text-decoration: none; white-space: nowrap; transition: transform .15s ease; }
.btn:hover { transform: translate(-1px, -1px); }
.btn--primary { background: var(--yellow); color: #1A1714; box-shadow: var(--shadow); }
.btn--ghost { background: var(--card); color: var(--ink); }
.btn--sm { min-height: 44px; font-size: 15px; padding: 0 16px; border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); }
.link-arrow { font-weight: 700; color: var(--blue-t); display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ── 頁首 ── */
.hd { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line); }
.hd-in { display: flex; align-items: center; gap: 16px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-title); font-weight: 800; font-size: 19px; color: var(--ink); text-decoration: none; flex: 0 0 auto; }
.logo-mark { background: #FFC21A; color: #1A1714; border: 2px solid #1A1714; border-radius: 8px; padding: 0 8px; font-size: 18px; line-height: 1.35; }
.hd-site { font-family: var(--f-title); font-weight: 800; font-size: 16px; color: var(--ink); text-decoration: none; padding-left: 14px; border-left: 2px solid var(--ink); line-height: 1.2; white-space: nowrap; }
.hd-nav { display: flex; gap: 2px; margin-left: auto; }
.hd-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 16px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.hd-nav a:hover { background: var(--paper-2); }
.hd .btn--sm { margin-left: 8px; }
@media (max-width: 860px) { .hd-nav { display: none; } .hd .btn--sm { margin-left: auto; } }
@media (max-width: 420px) {
  .hd-in { gap: 10px; }
  .logo { font-size: 17px; } .logo-mark { font-size: 16px; }
  .hd-site { padding-left: 10px; font-size: 15px; }
  .hd .btn--sm { padding: 0 12px; font-size: 14px; }
}

/* ── hero ── */
.hero { border-bottom: 2px solid var(--ink); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; align-items: center; padding-top: 56px; padding-bottom: 56px; }
.hero-kick { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); margin: 0 0 14px; }
.hero-kick::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--blue-t); }
.hero h1 { font-size: clamp(44px, 6vw, 64px); letter-spacing: -0.01em; }
.hl { color: #1A1714; background: linear-gradient(var(--yellow), var(--yellow)) no-repeat 0 88% / 100% 40%; padding: 0 .08em; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hl { background-size: 100% 100%; background-position: 0 0; } }
:root[data-theme="dark"] .hl { background-size: 100% 100%; background-position: 0 0; }
.hero-lead { font-size: 18px; line-height: 1.8; color: var(--ink-2); margin: 18px 0 0; max-width: 36em; }
.hero-lead a { font-weight: 700; }
.hero-side { display: grid; gap: 18px; }

/* 統計列：數字由 JS 算，三格各綁一色（照 vista.tw 首頁「寫了 30+ 年」列） */
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--card); border: 2px solid var(--ink); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; border-left: 2px solid var(--ink); }
.stat:first-child { border-left: 0; }
.stat-num { font-family: var(--f-title); font-weight: 800; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--blue-t); }
.stat:nth-child(2) .stat-num { color: var(--teal-t); }
.stat:nth-child(3) .stat-num { color: var(--red-t); }
.stat-label { font-size: 14px; font-weight: 700; color: var(--ink-2); }

/* 搜尋框 */
.search { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 10px 0 16px; background: var(--card); border: 2px solid var(--ink); border-radius: 14px; }
.search:focus-within { box-shadow: var(--shadow); }
.search-icon { width: 20px; height: 20px; flex: 0 0 auto; color: var(--ink-2); }
.search input { flex: 1 1 auto; min-width: 0; height: 52px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 16px; outline: none; }
.search input::placeholder { color: var(--ink-2); opacity: 1; }
.search input::-webkit-search-cancel-button { display: none; }
.search-hint { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
kbd { font-family: var(--f-mono); font-size: 12px; font-weight: 600; border: 1.5px solid var(--ink-2); border-radius: 6px; padding: 0 6px; color: var(--ink); }
.search-clear { min-height: 40px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }

/* ── 清單區 ── */
.list-sec { padding-top: 48px; padding-bottom: 72px; }
.deck-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; scroll-margin-top: 84px; }
.deck-section-head h2 { font-size: clamp(26px, 3vw, 32px); display: inline-flex; align-items: center; gap: 10px; }
.deck-section-head h2::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--ink); }
.deck-section-count { font-family: var(--f-mono); font-weight: 600; font-size: 14px; color: var(--ink-2); }
.deck-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 28px; }
.deck-filter button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; }
.deck-filter button:hover { background: var(--paper-2); }
.deck-filter button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.deck-filter .n { font-family: var(--f-mono); font-size: 12px; font-weight: 600; }

/* 卡片：整張是 <a>。上方色帶依主題上色（data-tone 由 JS 依 data-tags 給） */
.deck-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.deck-item {
  --tone: var(--tint-yellow);
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto 1fr;
  background: var(--card); color: var(--ink); text-decoration: none;
  border: 2px solid var(--ink); border-radius: 18px; overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.deck-item:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow); }
.deck-item:focus-visible { box-shadow: var(--shadow); }
.deck-item[data-tone="blue"] { --tone: var(--tint-blue); }
.deck-item[data-tone="pink"] { --tone: var(--tint-pink); }
.deck-item[data-tone="red"]  { --tone: var(--tint-red); }
.deck-item[data-tone="teal"] { --tone: var(--tint-teal); }
.deck-item::before { content: ""; grid-area: 1 / 1 / 2 / 3; background: var(--tone); border-bottom: 2px solid var(--ink); }
.deck-item-index { grid-area: 1 / 1; position: relative; padding: 12px 18px; font-family: var(--f-title); font-weight: 800; font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--ink); }
.deck-item-go { grid-area: 1 / 2; position: relative; align-self: center; margin-right: 14px; width: 36px; height: 36px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 50%; background: var(--card); font-weight: 800; color: var(--ink); transition: background .15s ease; }
.deck-item:hover .deck-item-go { background: var(--yellow); color: #1A1714; }
.deck-item-body { grid-column: 1 / 3; display: flex; flex-direction: column; padding: 16px 20px 18px; min-width: 0; }
.deck-item-head { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
.deck-item-title { font-size: 19px; line-height: 1.4; }
.deck-item-lock { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; line-height: 1; padding: 6px 10px 6px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.deck-item-lock::before {
  content: ""; width: 12px; height: 12px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 7V5a4 4 0 1 1 8 0v2h1v8H3V7h1zm2 0h4V5a2 2 0 1 0-4 0v2z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 7V5a4 4 0 1 1 8 0v2h1v8H3V7h1zm2 0h4V5a2 2 0 1 0-4 0v2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.deck-item-desc { margin: 10px 0 0; font-size: 15px; line-height: 1.7; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
/* 搜尋中展開全文：命中的字可能落在第四行之後 */
.is-searching .deck-item-desc { -webkit-line-clamp: unset; display: block; }
.deck-item-meta { margin: auto 0 0; padding-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.deck-item-meta span { font-size: 13px; font-weight: 700; line-height: 1; padding: 6px 9px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); }
.deck-item-meta span:first-child { font-family: var(--f-mono); font-weight: 600; background: var(--tone); color: var(--ink); }
mark { background: var(--yellow); color: #1A1714; border-radius: 3px; padding: 0 1px; }

.deck-empty { margin: 8px 0 0; padding: 28px; text-align: center; font-weight: 700; color: var(--ink-2); border: 2px dashed var(--ink); border-radius: 18px; }

/* 分頁：照 vista.tw 文章列表的 page-jump（墨框圓角按鈕） */
.deck-pager { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.deck-pager button { min-width: 44px; min-height: 44px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card); color: var(--ink); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; transition: transform .15s; }
.deck-pager button:hover:not(:disabled) { transform: translate(-1px, -1px); }
.deck-pager button[aria-current="page"] { background: var(--ink); color: var(--paper); }
.deck-pager button:disabled { cursor: default; border-color: var(--line); color: var(--ink-2); background: transparent; }
.deck-pager-gap { color: var(--ink-2); font-weight: 700; padding: 0 4px; }

/* ── 下一步：三張分類色卡（課程＝黃、邀課＝墨、電子報＝粉，照 vista.tw 首頁色彩編碼） ── */
.next { padding-bottom: 80px; }
.next-head { margin-bottom: 22px; }
.next-head h2 { font-size: clamp(26px, 3vw, 32px); }
.next-head p { margin: 8px 0 0; color: var(--ink-2); }
.next-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.next-card { display: flex; flex-direction: column; gap: 10px; padding: 24px; border: 2px solid var(--ink); border-radius: 18px; }
.next-card h3 { font-size: 22px; line-height: 1.3; }
.next-card p { margin: 0; font-size: 15.5px; line-height: 1.75; color: var(--ink-2); }
.next-card .mono { color: var(--ink-2); }
.next-card .btn, .next-card .link-arrow { margin-top: auto; align-self: flex-start; }
.next-card--yellow { background: var(--tint-yellow); box-shadow: var(--shadow); }
.next-card--pink { background: var(--tint-pink); }
.next-card--ink { background: var(--tint-ink); border-color: var(--tint-ink); }
.next-card--ink :is(h3, .mono) { color: var(--tint-ink-fg); }
.next-card--ink p { color: var(--tint-ink-fg2); }
.next-card--ink .btn { border-color: var(--yellow); }
.next-card--ink .link-arrow { color: var(--yellow); }
.next-card--ink :is(a):focus-visible { outline-color: var(--yellow); }

/* ── 頁尾（照 vista.tw 墨色頁尾） ── */
.ft { background: var(--tint-ink); color: var(--tint-ink-fg); padding: 56px 0 28px; }
.ft-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 32px; }
.ft-brand { font-family: var(--f-title); font-weight: 800; font-size: 22px; color: var(--tint-ink-fg); text-decoration: none; }
.ft-tag { margin: 8px 0 0; font-size: 15px; color: var(--tint-ink-fg2); }
.ft h3 { font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: .14em; color: var(--tint-ink-fg2); margin: 0 0 12px; }
.ft ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ft ul a { color: var(--tint-ink-fg); text-decoration: none; font-size: 15.5px; display: inline-flex; min-height: 32px; align-items: center; }
.ft ul a:hover { text-decoration: underline; text-underline-offset: 4px; }
.ft :is(a):focus-visible { outline-color: var(--yellow); }
.ft-copy { border-top: 1px solid rgba(255,255,255,.18); padding-top: 22px; text-align: center; font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; color: var(--tint-ink-fg2); margin: 0; }

/* ── 響應式 ── */
@media (max-width: 1100px) { .deck-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 960px) {
  .hero-in { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; padding-bottom: 40px; }
  .next-grid { grid-template-columns: 1fr; }
  .ft-grid { grid-template-columns: 1fr 1fr; }
  .ft-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .deck-list { grid-template-columns: 1fr; gap: 16px; }
  .stat { padding: 14px 12px; }
  .stat-num { font-size: 26px; }
  .stat-label { font-size: 13px; }
  .hero-lead { font-size: 16.5px; }
  .search-hint { display: none; }
  .list-sec { padding-top: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
