/* ==========================================================================
   NodDrive 專題網站樣式表
   設計原則：專業、乾淨、簡潔。淺底、單一主色、大量留白。不用漸層、不用陰影。
   色票沿用 assets/interactive 既有互動檔，讓 SVG／互動檔／主站視覺一致。
   ========================================================================== */

/* ---- 1. 色彩變數 ---- */
:root{
  color-scheme: light dark;

  --bg:#ffffff;
  --surface:#F6F5F1;
  --surface-2:#EFEDE4;
  --border:#D8D6CD;
  --text:#2C2C2A;
  --text2:#5F5E5A;
  --accent:#0F6E56;
  --accent-strong:#085041;
  --on-accent:#ffffff;

  --warn-bg:#FAECE7;
  --warn-border:#993C1D;
  --warn-text:#712B13;

  --tag-muted-bg:#F1EFE8;
  --tag-muted-text:#5F5E5A;
  --tag-muted-border:#D3D1C7;

  --link:#0F6E56;

  --radius-sm:8px;
  --radius:12px;
  --radius-lg:16px;

  --header-h:56px;
  --sidebar-w:280px;
  --content-max:44rem;

  --font:"Noto Sans TC","Microsoft JhengHei","PingFang TC",system-ui,sans-serif;
}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#1a1a18;
    --surface:#262521;
    --surface-2:#2f2e29;
    --border:#3d3c38;
    --text:#E8E6DE;
    --text2:#B4B2A9;
    --accent:#5DCAA5;
    --accent-strong:#9FE1CB;
    --on-accent:#08201a;

    --warn-bg:#3a1c10;
    --warn-border:#C97A56;
    --warn-text:#F5C4B3;

    --tag-muted-bg:#2C2C2A;
    --tag-muted-text:#B4B2A9;
    --tag-muted-border:#444441;

    --link:#7fd9b8;
  }
}

/* ---- 2. Reset ＆ 基礎 ---- */
*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
html,body{ max-width:100%; overflow-x:clip; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font);
  font-weight:400;
  line-height:1.75;
  font-size:16px;
  word-break:break-word;
  overflow-wrap:break-word;
}
img,svg,video{ max-width:100%; height:auto; display:block; }
table{ max-width:100%; }
h1,h2,h3,h4{ font-weight:500; line-height:1.4; margin:0 0 .6em; color:var(--text); }
h1{ font-size:1.9rem; }
h2{ font-size:1.5rem; }
h3{ font-size:1.15rem; }
p{ margin:0 0 1em; }
ul,ol{ margin:0 0 1em; padding-left:1.4em; }
li{ margin:.35em 0; }
a{ color:var(--link); text-decoration-thickness:1.5px; text-underline-offset:2px; }
a:hover{ text-decoration-thickness:2px; }
strong{ font-weight:500; }
blockquote{
  margin:1em 0; padding:.7em 1em; border-left:3px solid var(--accent);
  background:var(--surface); border-radius:0 var(--radius-sm) var(--radius-sm) 0;
  color:var(--text); font-style:normal;
}
blockquote p:last-child{ margin-bottom:0; }
code,pre{ font-family:"SFMono-Regular",Consolas,"Noto Sans Mono TC",monospace; }
pre{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:1em; overflow-x:auto; font-size:.82rem; line-height:1.65;
}
hr{ border:none; border-top:1px solid var(--border); margin:2.5em 0; }
:focus-visible{ outline:3px solid var(--accent); outline-offset:2px; }

/* ---- 3. 跳到正文 ---- */
.skip-link{
  position:absolute; left:8px; top:-48px; z-index:1000;
  background:var(--accent); color:var(--on-accent);
  padding:.6em 1em; border-radius:var(--radius-sm); font-weight:500;
  transition:top .15s ease;
}
.skip-link:focus{ top:8px; }

/* ---- 4. 手機頂部固定列 ---- */
.topbar{
  position:fixed; top:0; left:0; right:0; z-index:60;
  display:flex; align-items:center; gap:.6em;
  height:calc(var(--header-h) + env(safe-area-inset-top));
  padding:env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background:var(--bg); border-bottom:1px solid var(--border);
}
.topbar .brand{ font-size:.95rem; font-weight:500; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar .brand small{ display:block; font-size:.68rem; font-weight:400; color:var(--text2); }
.hamburger{
  appearance:none; border:1px solid var(--border); background:var(--surface);
  width:44px; height:44px; min-width:44px; border-radius:var(--radius-sm);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
  cursor:pointer;
}
.hamburger span{ display:block; width:20px; height:2px; background:var(--text); border-radius:1px; }

/* ---- 5. 目錄（手機＝抽屜／桌機＝側欄） ---- */
.nav-overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:70;
  opacity:0; pointer-events:none; transition:opacity .18s ease;
}
.nav-overlay.is-open{ opacity:1; pointer-events:auto; }

.site-nav{
  position:fixed; top:0; bottom:0; left:0; z-index:80;
  width:min(84vw,320px);
  background:var(--bg); border-right:1px solid var(--border);
  transform:translateX(-100%);
  transition:transform .2s ease;
  overflow-y:auto;
  padding:calc(16px + env(safe-area-inset-top)) 8px calc(24px + env(safe-area-inset-bottom));
}
.site-nav.is-open{ transform:translateX(0); }
.site-nav .nav-head{ display:flex; align-items:center; justify-content:space-between; padding:0 8px 12px; }
.site-nav .nav-title{ font-size:.9rem; font-weight:500; color:var(--text2); }
.nav-close{
  appearance:none; border:1px solid var(--border); background:var(--surface); color:var(--text);
  width:36px; height:36px; border-radius:var(--radius-sm); cursor:pointer; font-size:1rem; line-height:1;
}
.toc-list{ list-style:none; margin:0; padding:0; }
.toc-list a{
  display:flex; align-items:baseline; gap:.5em;
  padding:.65em .8em; border-radius:var(--radius-sm);
  color:var(--text); text-decoration:none; font-size:.94rem;
}
.toc-list a .no{ color:var(--text2); font-variant-numeric:tabular-nums; font-size:.82em; min-width:1.4em; }
.toc-list a:hover{ background:var(--surface); }
.toc-list a[aria-current="true"]{
  background:var(--surface); color:var(--accent-strong); font-weight:500;
  box-shadow:inset 3px 0 0 var(--accent);
}
.nav-safety{
  margin:14px 8px 0; padding:.7em .8em; border:1px solid var(--warn-border);
  background:var(--warn-bg); color:var(--warn-text); border-radius:var(--radius-sm); font-size:.78rem; line-height:1.6;
}

@media (min-width:1024px){
  .topbar{ display:none; }
  .nav-overlay{ display:none; }
  .site-nav{
    transform:none; width:var(--sidebar-w); border-right:1px solid var(--border);
    padding:32px 12px 32px 24px;
  }
  .site-nav .nav-head{ display:none; }
}

/* ---- 6. 版面骨架 ---- */
.page{ min-height:100%; }
main{ padding-top:calc(var(--header-h) + env(safe-area-inset-top) + 20px); padding-bottom:40px; }
.container{
  max-width:var(--content-max);
  margin:0 auto;
  padding:0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
}
@media (min-width:1024px){
  main{ padding-top:56px; margin-left:var(--sidebar-w); }
  .container{ padding:0 32px; }
}

section{ padding:2.2em 0; border-bottom:1px solid var(--border); }
section:last-of-type{ border-bottom:none; }
.section-head{ margin-bottom:1.2em; }
.section-kicker{
  display:inline-block; font-size:.78rem; color:var(--text2);
  letter-spacing:.04em; margin-bottom:.4em;
}
.section-lead{ color:var(--text2); font-size:1.02rem; }

/* ---- 7. Hero ---- */
.hero{ padding-top:1.4em; }
.hero-badges{ display:flex; flex-wrap:wrap; gap:.5em; margin:.8em 0 1.2em; }
.hero h1{ font-size:1.7rem; }
@media (min-width:640px){ .hero h1{ font-size:2.2rem; } }
.hero-premises{
  list-style:none; margin:1.4em 0; padding:0;
  display:grid; gap:.8em; grid-template-columns:1fr;
}
@media (min-width:640px){ .hero-premises{ grid-template-columns:repeat(3,1fr); } }
.hero-premises li{
  margin:0; padding:1em 1.1em; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius); font-size:.92rem;
}
.hero-premises .n{ display:block; color:var(--accent-strong); font-weight:500; margin-bottom:.3em; }
.hero-cta{ display:flex; flex-wrap:wrap; gap:.7em; margin:1.4em 0; }

/* ---- 8. 按鈕 ---- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:.4em;
  padding:.7em 1.3em; border-radius:var(--radius-sm); font-size:.94rem; font-weight:500;
  border:1px solid var(--border); background:var(--surface); color:var(--text);
  cursor:pointer; text-decoration:none; min-height:44px;
}
.btn-primary{ background:var(--accent); border-color:var(--accent); color:var(--on-accent); }
.btn-primary:hover{ background:var(--accent-strong); border-color:var(--accent-strong); }
.btn-secondary:hover{ border-color:var(--text2); }
.btn:focus-visible{ outline-offset:2px; }

/* ---- 9. 標籤／徽章 ---- */
.badge{
  display:inline-flex; align-items:center; gap:.35em;
  font-size:.78rem; font-weight:500; padding:.28em .7em; border-radius:999px;
  border:1px solid var(--tag-muted-border); background:var(--tag-muted-bg); color:var(--tag-muted-text);
  white-space:nowrap;
}
.badge-current{ background:var(--surface); border-color:var(--accent); color:var(--accent-strong); }
.badge-current::before{ content:"\2713"; }
.badge-dropped{ background:var(--surface); border-color:var(--border); color:var(--text2); }
.badge-dropped::before{ content:"\2715"; }
.badge-replaced{ background:var(--surface); border-color:var(--border); color:var(--text2); }
.badge-replaced::before{ content:"\2192"; }
.badge-turn{ background:var(--warn-bg); border-color:var(--warn-border); color:var(--warn-text); }
.badge-turn::before{ content:"\1F511"; }

/* ---- 10. 提示框（safety／warn／note） ---- */
.callout{
  border:1px solid var(--border); background:var(--surface); border-radius:var(--radius);
  padding:1em 1.2em; margin:1.2em 0;
}
.callout h3,.callout p:last-child{ margin-bottom:0; }
.callout-title{ display:flex; align-items:center; gap:.5em; font-weight:500; margin-bottom:.4em; }
.callout-safety{
  border-color:var(--warn-border); background:var(--warn-bg); color:var(--warn-text);
}
.callout-safety .callout-title{ color:var(--warn-text); }
.callout-safety a{ color:var(--warn-text); text-decoration-thickness:2px; }
.callout-note{ border-style:dashed; }

/* ---- 11. 表格 ---- */
.table-wrap{ overflow-x:auto; margin:1.2em 0; border:1px solid var(--border); border-radius:var(--radius-sm); }
table.data{ width:100%; border-collapse:collapse; font-size:.9rem; min-width:420px; }
table.data caption{ caption-side:top; text-align:left; padding:.6em .8em; font-size:.82rem; color:var(--text2); }
table.data th,table.data td{ padding:.6em .8em; border-bottom:1px solid var(--border); text-align:left; vertical-align:top; }
table.data thead th{ background:var(--surface); font-weight:500; color:var(--text2); white-space:nowrap; }
table.data tbody tr:last-child td{ border-bottom:none; }
table.data tbody tr:hover{ background:var(--surface); }

/* ---- 12. 圖與圖說 ---- */
figure.fig{ margin:1.4em 0; }
.media{ border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; background:var(--surface); }
.media img{ width:100%; }
.media-fallback{
  margin:0; padding:2.2em 1em; text-align:center; color:var(--text2); font-size:.86rem; display:none;
}
.media.is-broken picture,.media.is-broken img{ display:none; }
.media.is-broken .media-fallback{ display:block; }
figcaption{ font-size:.84rem; color:var(--text2); margin-top:.6em; line-height:1.6; }
figcaption .ver{ color:var(--accent-strong); font-weight:500; }

.gallery{ display:grid; grid-template-columns:repeat(2,1fr); gap:.8em; }
@media (min-width:560px){ .gallery{ grid-template-columns:repeat(3,1fr); } }
.gallery figure.fig{ margin:0; }
.gallery figcaption{ font-size:.76rem; }

/* ---- 13. 卡片 ／ 統計格 ---- */
.grid-2{ display:grid; gap:1em; grid-template-columns:1fr; }
@media (min-width:640px){ .grid-2{ grid-template-columns:1fr 1fr; } }
.card{ border:1px solid var(--border); background:var(--surface); border-radius:var(--radius); padding:1.1em 1.2em; }
.card h3{ margin-bottom:.4em; font-size:1rem; }
.card p:last-child{ margin-bottom:0; }

/* ---- 14. 互動嵌入元件 ---- */
.embed{ margin:1.4em 0; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); overflow:hidden; }
.embed-preview{ padding:1.6em 1.2em; text-align:center; }
.embed-preview-art{
  height:120px; margin:0 auto 1em; max-width:220px;
  border:1px dashed var(--border); border-radius:var(--radius-sm);
  display:flex; align-items:center; justify-content:center;
  background:
    radial-gradient(circle at 30% 55%, var(--accent) 0 6px, transparent 7px),
    radial-gradient(circle at 70% 55%, var(--accent) 0 6px, transparent 7px);
  background-color:var(--bg);
  position:relative;
}
.embed-preview-art::before{
  content:""; position:absolute; left:30%; top:55%; width:40%; height:2px; background:var(--border);
  transform:translateY(-1px);
}
.embed-preview-text{ color:var(--text2); font-size:.9rem; max-width:32em; margin:0 auto 1em; }
.embed-frame-wrap{ position:relative; }
.embed-iframe{ display:block; width:100%; border:0; height:560px; background:var(--bg); }
.embed-error{
  margin:0; padding:1.2em; font-size:.86rem; color:var(--warn-text); background:var(--warn-bg);
}
.embed-loading{ margin:0; padding:1em 1.2em; font-size:.84rem; color:var(--text2); }
.embed-caption{ padding:.7em 1.2em; border-top:1px solid var(--border); font-size:.82rem; color:var(--text2); }

/* ---- 15. 設計演進時間軸 ---- */
.timeline{ list-style:none; margin:1.8em 0 0; padding:0; position:relative; }
.timeline::before{
  content:""; position:absolute; left:11px; top:6px; bottom:6px; width:2px; background:var(--border);
}
@media (min-width:1024px){ .timeline::before{ left:15px; } }
.tl-item{ position:relative; padding-left:32px; margin-bottom:1.6em; }
@media (min-width:1024px){ .tl-item{ padding-left:42px; } }
.tl-dot{
  position:absolute; left:2px; top:6px; width:20px; height:20px; border-radius:50%;
  background:var(--bg); border:2px solid var(--border); display:flex; align-items:center; justify-content:center;
}
@media (min-width:1024px){ .tl-dot{ width:28px; height:28px; left:2px; } }
.tl-item.is-current .tl-dot{ border-color:var(--accent); background:var(--accent); }
.tl-card{ border:1px solid var(--border); background:var(--surface); border-radius:var(--radius-lg); padding:1.2em 1.3em; }
.tl-head{ display:flex; flex-wrap:wrap; align-items:center; gap:.5em .6em; margin-bottom:.3em; }
.tl-ver{ font-size:1.05rem; font-weight:500; }
.tl-tagline{ color:var(--text2); margin:.2em 0 1em; }
.tl-block{ margin-top:1em; }
.tl-block h4{ font-size:.82rem; font-weight:500; color:var(--text2); margin:0 0 .4em; text-transform:none; }
.tl-block > p, .tl-block > ul, .tl-block > blockquote{ margin-top:0; }

.connector{
  position:relative; padding-left:32px; margin:0 0 1.6em;
}
@media (min-width:1024px){ .connector{ padding-left:42px; } }
.connector-card{
  border:1px dashed var(--border); border-radius:var(--radius); padding:1em 1.2em; background:transparent;
}
.connector-card h4{ margin:0 0 .4em; font-size:.92rem; }

/* ---- 16. 檢查清單 ---- */
.checklist{ list-style:none; margin:0 0 1em; padding:0; }
.checklist li{ display:flex; gap:.6em; align-items:flex-start; padding:.35em 0; }
.checklist li::before{ content:"\2610"; color:var(--text2); flex:none; line-height:1.5; }

/* ---- 17. 頁尾 ---- */
footer.site-footer{
  border-top:1px solid var(--border); padding:2em 0 calc(2em + env(safe-area-inset-bottom));
  color:var(--text2); font-size:.86rem;
}
@media (min-width:1024px){ footer.site-footer{ margin-left:var(--sidebar-w); } }
.footer-grid{ display:flex; flex-wrap:wrap; gap:.5em 1.4em; margin-bottom:1em; }
.footer-grid a{ color:var(--text2); }

