/* PDLC 異常案例學習庫 — 共用樣式
   品牌 token 沿用 startek-pdlc-busbar/index.html，色彩嚴格限品牌清單。 */

:root {
  --conf-h: 32px;
  --startek-blue: #004AB5;
  --startek-blue-deep: #003A8F;
  --startek-blue-pale: #E6EEFA;
  --warm-grey: #EBEAE7;
  --warm-grey-pale: #F5F4F1;
  --text-black: #1a1a2e;
  --text-grey: #6a6a72;
  --text-grey-light: #6a6a72;
  --danger: #D64545;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-12: 48px;
  --sp-16: 64px;

  --maxw: 1120px;
  --pad-x: clamp(24px, 5vw, 64px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; color-scheme: light; }
body {
  font-family: 'Noto Sans TC', 'Inter', 'PingFang TC', sans-serif;
  background: var(--warm-grey-pale);
  color: var(--text-black);
  -webkit-font-smoothing: antialiased;
  line-height: 1.65;
  letter-spacing: 0.3px;
}
a { color: var(--startek-blue); text-decoration: none; }
img { display: block; max-width: 100%; }
strong { color: var(--startek-blue); font-weight: 700; }

.container { max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad-x); padding-right: var(--pad-x); }

/* ====== Header ====== */
.site-header {
  position: sticky; top: var(--conf-h); z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--warm-grey);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.site-header .logo img { height: 28px; width: auto; }
.nav-desktop { display: flex; gap: var(--sp-6); align-items: center; }
.nav-desktop a {
  font-size: 0.9375rem; color: var(--text-grey); font-weight: 500;
  padding: 6px 2px; border-bottom: 2px solid transparent; transition: color .15s;
}
.nav-desktop a:hover { color: var(--startek-blue); }
.nav-desktop a.current { color: var(--startek-blue); border-bottom-color: var(--startek-blue); font-weight: 700; }

.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 44px; height: 44px; flex-direction: column; gap: 5px;
  align-items: center; justify-content: center;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--text-black); display: block; }
.nav-mobile { display: none; }

/* ====== Hero（首頁，主藍實心）====== */
.hero {
  background: var(--startek-blue);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.hero .container { padding-top: var(--sp-16); padding-bottom: var(--sp-16); }
.hero .mark {
  position: absolute; top: 28px; right: var(--pad-x);
  height: 40px; opacity: 0.6;
}
.hero .mark img { height: 100%; width: auto; filter: brightness(0) invert(1); }
.hero .eyebrow { color: #fff; opacity: 0.85; }
.eyebrow {
  font-family: 'Inter', sans-serif; font-size: 0.75rem; letter-spacing: 3px;
  font-weight: 600; text-transform: uppercase; color: var(--startek-blue);
  display: inline-flex; align-items: center; gap: 8px;
}
.hero h1 {
  font-family: 'Noto Sans TC', 'Inter', sans-serif;
  font-weight: 700; font-size: 2.75rem; line-height: 1.25; letter-spacing: 1px;
  margin: var(--sp-4) 0 var(--sp-6);
}
.hero h1 .num { font-family: 'Inter', sans-serif; font-weight: 200; }
.hero .lead { font-size: 1.1875rem; line-height: 1.7; color: rgba(255,255,255,0.9); max-width: 640px; font-weight: 400; }
.trust-row { display: flex; gap: var(--sp-4); margin-top: var(--sp-12); flex-wrap: wrap; }
.trust-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  padding: var(--sp-6) var(--sp-8);
  min-width: 140px;
}
.trust-card .n { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 2rem; color: #fff; line-height: 1.1; }
.trust-card .l { font-size: 0.9375rem; color: rgba(255,255,255,0.85); margin-top: 4px; }

/* ====== Section 標題（首頁區塊）====== */
.section { padding: var(--sp-16) 0; }
.section-head { margin-bottom: var(--sp-8); }
.section-head .eyebrow { color: var(--startek-blue); margin-bottom: var(--sp-2); }
.section-head h2 {
  font-size: 1.625rem; font-weight: 700; line-height: 1.35; color: var(--text-black);
}
.section-head p { color: var(--text-grey); font-size: 1rem; margin-top: var(--sp-2); }

/* ====== 分類導覽卡（首頁四大入口）====== */
.cat-grid {
  display: grid; gap: var(--sp-6);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.cat-card {
  background: #fff;
  border: 1px solid var(--warm-grey);
  border-top: 3px solid var(--startek-blue);
  border-radius: 12px;
  padding: var(--sp-6);
  display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,74,181,0.10);
  border-color: var(--startek-blue);
}
.cat-card .cnum {
  font-family: 'Inter', sans-serif; font-weight: 200; font-size: 2.5rem;
  color: rgba(0,74,181,0.35); line-height: 1;
}
.cat-card .ctitle { font-size: 1.125rem; font-weight: 700; color: var(--startek-blue); margin-top: var(--sp-2); }
.cat-card .crule { width: 32px; height: 3px; background: var(--startek-blue); margin: var(--sp-3) 0; border-radius: 2px; }
.cat-card .cdesc { font-size: 0.875rem; color: var(--text-grey); flex: 1; }
.cat-card .cfoot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: var(--sp-6); font-size: 0.75rem; font-weight: 600; color: var(--text-grey);
  letter-spacing: 1px;
}
.cat-card .cfoot .arrow { color: var(--startek-blue); font-size: 1rem; }

/* ====== Filter chips ====== */
.filter-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-6); }
.chip {
  border: 1px solid var(--warm-grey); background: #fff; color: var(--text-grey);
  border-radius: 100px; padding: 8px 16px; font-size: 0.8125rem; font-weight: 600;
  cursor: pointer; transition: all .15s; min-height: 38px;
}
.chip:hover { border-color: var(--startek-blue); color: var(--startek-blue); }
.chip.active { background: var(--startek-blue); border-color: var(--startek-blue); color: #fff; }

/* ====== 案例卡（首頁案例牆）====== */
.case-wall {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.case-card {
  background: #fff; border: 1px solid var(--warm-grey); border-radius: 12px;
  padding: var(--sp-4); display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.case-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,74,181,0.10);
  border-color: var(--startek-blue);
}
/* 卡頂一行：tag 左、badge 右（唯一允許的並排）*/
.case-card .card-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-2); flex-wrap: wrap; margin-bottom: var(--sp-3);
}
.case-card h3 { font-size: 1.0625rem; font-weight: 700; color: var(--text-black); line-height: 1.4; }
.case-card .one-line {
  font-size: 0.875rem; color: var(--text-grey); margin-top: var(--sp-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.case-card .read {
  margin-top: var(--sp-4); text-align: right; font-size: 0.8125rem;
  font-weight: 600; color: var(--startek-blue);
}

/* tag pill */
.tag {
  display: inline-block; background: var(--startek-blue-pale); color: var(--startek-blue);
  border-radius: 100px; padding: 3px 12px; font-family: 'Inter', sans-serif;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  white-space: nowrap;
}

/* status badge */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: 100px; padding: 3px 11px; font-size: 0.6875rem; font-weight: 700;
  letter-spacing: 0.5px; white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge.full { background: var(--startek-blue-pale); color: var(--startek-blue); }
.badge.full .dot { background: var(--startek-blue); }
.badge.wip { background: var(--warm-grey); color: var(--text-black); }
.badge.wip .dot { width: 7px; height: 7px; border: 1.5px solid var(--text-grey); background: transparent; }

/* ====== 分類頁 Hero ====== */
.cat-hero { background: var(--startek-blue); color: #fff; position: relative; overflow: hidden; }
.cat-hero .container { padding-top: var(--sp-12); padding-bottom: var(--sp-12); }
.cat-hero .mark { position: absolute; top: 24px; right: var(--pad-x); height: 36px; opacity: 0.6; }
.cat-hero .mark img { height: 100%; width: auto; filter: brightness(0) invert(1); }
.cat-hero .eyebrow { color: #fff; opacity: 0.85; }
.cat-hero h1 { font-size: 2.125rem; font-weight: 700; line-height: 1.3; margin: var(--sp-3) 0 var(--sp-3); letter-spacing: 1px; }
.cat-hero p { font-size: 1.0625rem; color: rgba(255,255,255,0.9); max-width: 680px; line-height: 1.7; }
.cat-hero .count { margin-top: var(--sp-4); font-family: 'Inter', sans-serif; font-size: 0.875rem; color: rgba(255,255,255,0.85); letter-spacing: 1px; }

/* ====== 分類 sticky tab ====== */
.cat-tabs { position: sticky; top: calc(64px + var(--conf-h)); z-index: 90; background: #fff; border-bottom: 1px solid var(--warm-grey); }
.cat-tabs .container { display: flex; gap: var(--sp-2); overflow-x: auto; padding-top: 0; padding-bottom: 0; }
.cat-tabs a {
  padding: 14px 4px; font-size: 0.9375rem; font-weight: 600; color: var(--text-grey);
  border-bottom: 2px solid transparent; white-space: nowrap; margin-right: var(--sp-4);
}
.cat-tabs a:hover { color: var(--startek-blue); }
.cat-tabs a.current { color: var(--startek-blue); border-bottom-color: var(--startek-blue); font-weight: 700; }

/* ====== 分類頁主體：左目錄 + 右內容 ====== */
.cat-body { display: grid; grid-template-columns: 240px 1fr; gap: var(--sp-12); padding: var(--sp-12) 0; }
.case-toc { position: sticky; top: calc(128px + var(--conf-h)); align-self: start; }
.case-toc .toc-label {
  font-family: 'Inter', sans-serif; font-size: 0.6875rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-grey); font-weight: 700; margin-bottom: var(--sp-3);
}
.case-toc ol { list-style: none; }
.case-toc li { margin-bottom: var(--sp-2); }
.case-toc a {
  display: block; font-size: 0.875rem; color: var(--text-grey); padding: 6px 10px;
  border-left: 2px solid var(--warm-grey); border-radius: 0 4px 4px 0; line-height: 1.4;
}
.case-toc a:hover { color: var(--startek-blue); background: var(--startek-blue-pale); border-left-color: var(--startek-blue); }

.toc-mobile { display: none; }

/* ====== 案例 section ====== */
.case { scroll-margin-top: calc(140px + var(--conf-h)); padding-bottom: var(--sp-12); margin-bottom: var(--sp-12); border-bottom: 1px solid var(--warm-grey); }
.case:last-child { border-bottom: none; }
.breadcrumb { font-size: 0.75rem; color: var(--text-grey); margin-bottom: var(--sp-4); }
.breadcrumb span { color: var(--text-grey-light); }
.case-meta {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3);
}
.case-meta .case-no { font-family: 'Inter', sans-serif; font-size: 0.75rem; letter-spacing: 2px; font-weight: 700; color: var(--text-grey); }
.case h2 { font-size: 1.625rem; font-weight: 700; line-height: 1.35; color: var(--text-black); margin-bottom: var(--sp-3); }
.case .case-lead { font-size: 1.1875rem; line-height: 1.7; color: var(--text-grey); margin-bottom: var(--sp-8); }

.block-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.125rem; font-weight: 700; margin-bottom: var(--sp-3); color: var(--text-black);
}
.block-label .ico { font-family: 'Inter', sans-serif; font-weight: 800; }
.block-label.phenomenon .ico { color: var(--danger); }

/* 現象＋照片 兩欄 */
.phen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); align-items: start; margin-bottom: var(--sp-8); }
.card-plain {
  background: #fff; border: 1px solid var(--warm-grey); border-radius: 12px; padding: var(--sp-6);
}
.card-plain p { color: var(--text-black); font-size: 1rem; }
.card-plain ul { list-style: none; }
.card-plain ul li { position: relative; padding-left: 18px; margin-bottom: var(--sp-2); color: var(--text-black); font-size: 1rem; }
.card-plain ul li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--startek-blue); }

/* 照片占位 */
.photo-ph {
  background: var(--warm-grey-pale);
  border: 1.5px dashed var(--warm-grey);
  border-radius: 14px;
  aspect-ratio: 16 / 10;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
}
.photo-ph svg { opacity: 0.3; }
.photo-ph .ph-text { color: var(--text-grey-light); font-size: 0.8125rem; letter-spacing: 1px; }

/* 已接入照片 */
.photo-set { display: grid; gap: var(--sp-3); }
.photo-set.cols-2 { grid-template-columns: 1fr 1fr; }
.photo-figure { margin: 0; }
.photo-figure img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--warm-grey);
  border-radius: 12px;
}
.photo-figure figcaption {
  margin-top: var(--sp-2);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-grey);
}
@media (max-width: 760px) {
  .photo-set.cols-2 { grid-template-columns: 1fr; }
  .photo-figure img { max-height: 300px; }
}

/* 成因 */
.cause-block { margin-bottom: var(--sp-8); }

/* STARTEK 解法（主藍實心卡，視覺最重）*/
.solution {
  background: var(--startek-blue); color: #fff; border-radius: 12px;
  padding: var(--sp-8); margin-bottom: var(--sp-8);
}
.solution .block-label { color: #fff; }
.solution .block-label .ico { color: #fff; }
.solution ol { list-style: none; counter-reset: sol; }
.solution ol li {
  position: relative; padding-left: 30px; margin-bottom: var(--sp-3);
  color: #fff; font-size: 1rem; line-height: 1.65;
}
.solution ol li::before {
  counter-increment: sol; content: counter(sol);
  position: absolute; left: 0; top: 1px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(255,255,255,0.18); color: #fff;
  font-family: 'Inter', sans-serif; font-size: 0.75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.solution p { color: #fff; font-size: 1rem; }
.solution strong { color: #fff; }

/* 學習重點 callout */
.takeaway {
  background: var(--startek-blue-pale);
  border-left: 4px solid var(--startek-blue);
  border-radius: 0 12px 12px 0;
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
}
.takeaway .tk-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.0625rem; font-weight: 700; color: var(--startek-blue); margin-bottom: var(--sp-2);
}
.takeaway .tk-label .sq { width: 4px; height: 18px; background: var(--startek-blue); border-radius: 2px; }
.takeaway p { color: var(--text-black); font-size: 1rem; line-height: 1.65; }

/* deck-link */
.deck-link {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--startek-blue); color: var(--startek-blue);
  border-radius: 8px; padding: 10px 18px; font-weight: 700; font-size: 0.9375rem;
  margin-bottom: var(--sp-6); transition: background .15s, color .15s;
}
.deck-link:hover { background: var(--startek-blue); color: #fff; }

.pagefoot { font-size: 0.75rem; color: var(--text-grey-light); }

/* ====== Footer ====== */
.site-footer { background: var(--startek-blue); color: #fff; }
.site-footer .container { padding-top: var(--sp-16); padding-bottom: var(--sp-16); }
.site-footer .foot-logo img { height: 30px; width: auto; filter: brightness(0) invert(1); }
.site-footer .slogan {
  font-family: 'Inter', sans-serif; letter-spacing: 3px; font-weight: 700;
  color: rgba(255,255,255,0.9); margin-top: var(--sp-4); font-size: 0.9375rem;
}
.site-footer .foot-title { margin-top: var(--sp-8); font-size: 1rem; font-weight: 700; color: #fff; }
.site-footer .foot-links { margin-top: var(--sp-2); display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.site-footer .foot-links a { color: rgba(255,255,255,0.85); font-size: 0.9375rem; }
.site-footer .foot-links a:hover { color: #fff; }
.site-footer .disclaimer { margin-top: var(--sp-8); font-size: 0.8125rem; color: rgba(255,255,255,0.7); line-height: 1.6; }

/* ====== 行動版 ====== */
@media (max-width: 760px) {
  html { font-size: 15px; }
  .nav-desktop { display: none; }
  .nav-toggle { display: flex; }
  .nav-mobile.open { display: block; background: #fff; border-bottom: 1px solid var(--warm-grey); }
  .nav-mobile a {
    display: block; padding: 14px var(--pad-x); min-height: 44px; font-size: 1rem;
    color: var(--text-black); border-bottom: 1px solid var(--warm-grey-pale);
  }
  .nav-mobile a.current { color: var(--startek-blue); font-weight: 700; }

  .hero h1 { font-size: 1.875rem; }
  .hero .lead { font-size: 1rem; }
  .trust-row { gap: var(--sp-3); }
  .trust-card { min-width: 0; flex: 1; padding: var(--sp-4); }
  .trust-card .n { font-size: 1.5rem; }
  .trust-card .l { font-size: 0.875rem; }

  .section { padding: var(--sp-12) 0; }
  .section-head h2 { font-size: 1.375rem; }
  .cat-grid { grid-template-columns: 1fr; }
  .case-wall { grid-template-columns: 1fr; }

  .cat-hero h1 { font-size: 1.625rem; }
  .cat-hero p { font-size: 1rem; }
  .cat-tabs { top: 64px; }

  .cat-body { grid-template-columns: 1fr; gap: 0; padding: var(--sp-6) 0; }
  .case-toc { display: none; }
  .toc-mobile {
    display: block; position: sticky; top: calc(110px + var(--conf-h)); z-index: 80; margin-bottom: var(--sp-6);
  }
  .toc-mobile select {
    width: 100%; padding: 12px 14px; font-size: 1rem; min-height: 44px;
    border: 1px solid var(--warm-grey); border-radius: 8px; background: #fff;
    color: var(--text-black); font-family: inherit;
  }

  .case h2 { font-size: 1.3125rem; }
  .case .case-lead { font-size: 1rem; margin-bottom: var(--sp-6); }
  .phen-grid { grid-template-columns: 1fr; gap: var(--sp-4); }
  .solution { padding: var(--sp-6); }

  .site-footer .container { padding-top: var(--sp-12); padding-bottom: var(--sp-12); }
}

@media (max-width: 360px) {
  .trust-row { flex-direction: column; }
  .trust-card { width: 100%; }
}

/* Confidential notice */
.conf-bar{position:sticky;top:0;z-index:110;background:#003A8F;color:#fff;text-align:center;
  font-size:12px;letter-spacing:.06em;line-height:1.4;height:var(--conf-h);
  display:flex;align-items:center;justify-content:center;padding:0 16px;}
.conf-bar .conf-short{display:none;}
@media (max-width: 720px){
  .conf-bar{font-size:11px;}
  .conf-bar .conf-long{display:none;}
  .conf-bar .conf-short{display:inline;}
}
.site-footer .conf-foot{font-weight:700;font-size:0.8125rem;color:#fff;margin-top:var(--sp-8);line-height:1.6;}

/* Lightbox 點圖放大 */
.photo-figure img{cursor:zoom-in;}
.lightbox{position:fixed;inset:0;z-index:200;background:rgba(10,10,10,0.9);display:none;
  flex-direction:column;align-items:center;justify-content:center;padding:4vh 4vw;cursor:zoom-out;}
.lightbox.open{display:flex;}
.lightbox img{max-width:92vw;max-height:80vh;object-fit:contain;border-radius:4px;background:#fff;}
.lightbox .lb-cap{color:#fff;font-size:0.875rem;margin-top:14px;text-align:center;line-height:1.6;max-width:80ch;}
.lightbox .lb-close{position:absolute;top:14px;right:20px;background:none;border:none;color:#fff;
  font-size:34px;line-height:1;cursor:pointer;padding:8px;}

/* i18n 中英切換 */
html[data-lang="en"] .i18n.zh{display:none;}
html:not([data-lang="en"]) .i18n.en{display:none;}
.lang-toggle{font-family:'Inter','Noto Sans TC',sans-serif;font-size:0.8125rem;font-weight:700;
  color:#004AB5;background:none;border:1.5px solid #004AB5;border-radius:100px;
  padding:4px 14px;cursor:pointer;letter-spacing:0.5px;margin-left:8px;}
.lang-toggle:hover{background:#E6EEFA;}
