/* fly-connectome 新版共用樣式：導覽、內頁版頭、頁尾，以及套在既有內容頁上的排版調整。
   由 scripts/build_new_site.py 產生的 site-new/ 內頁載入；首頁自帶樣式。 */
:root{
  --scene-bg:#03060b; --scene-ink:#dff4f7; --scene-muted:#7f9aa3; --scene-soft:#b4c9cf;
  --scene-cyan:#22e3d3; --scene-cyan2:#5ad0ff; --scene-main:#fb923c;
  --fc-sans:"IBM Plex Sans TC","Noto Sans TC","PingFang TC","Microsoft JhengHei",system-ui,sans-serif;
  --fc-mono:"IBM Plex Mono",ui-monospace,monospace;
}

/* 導覽 */
.fc-nav{display:flex;flex-wrap:wrap;align-items:center;gap:0 24px;padding:8px 32px;background:var(--scene-bg);border-bottom:1px solid rgba(127,154,163,.25);font:15px/1.6 var(--fc-sans);position:relative;z-index:5}
.fc-nav a{text-decoration:none}
.fc-nav a:focus-visible,.fc-foot a:focus-visible,.fc-phead a:focus-visible{outline:2px solid var(--scene-cyan);outline-offset:2px}
.fc-nav .fc-brand{font-family:var(--fc-mono);font-weight:500;color:var(--scene-ink);margin-right:auto;padding:12px 0}
.fc-nav.fc-left .fc-brand{margin-right:8px}
.fc-nav .fc-item{color:var(--scene-muted);font-size:13px;padding:12px 0;border-bottom:2px solid transparent}
.fc-nav .fc-item:hover{color:var(--scene-ink)}
.fc-nav .fc-item[aria-current="page"]{color:var(--scene-ink);font-weight:600;border-bottom-color:var(--scene-cyan)}

/* 內頁版頭：和首頁 hero 同一個深色場景 */
.fc-phead{position:relative;overflow:hidden;background:var(--scene-bg);color:var(--scene-ink);font-family:var(--fc-sans)}
.fc-phead::before,.fc-phead::after{content:"";position:absolute;border-radius:50%;pointer-events:none;opacity:.35}
.fc-phead::before{right:-90px;top:-150px;width:420px;height:420px;border:1px solid var(--scene-cyan)}
.fc-phead::after{right:60px;top:-40px;width:180px;height:180px;border:1px solid var(--scene-cyan2)}
.fc-phead-in{position:relative;max-width:1180px;margin:0 auto;padding:48px 32px 44px;display:flex;flex-direction:column;gap:12px}
.fc-kicker{font:12px/1.6 var(--fc-mono);letter-spacing:.08em;color:var(--scene-muted)}
.fc-kicker a{color:var(--scene-muted);text-decoration:none}
.fc-kicker a:hover{color:var(--scene-ink)}
.fc-phead h1{margin:0;font-size:40px;line-height:1.2;font-weight:600;color:var(--scene-ink);text-wrap:balance;max-width:24em}
.fc-phead .sub,.fc-phead p{margin:0;color:var(--scene-soft);font-size:15px;line-height:1.7;max-width:74ch}
.fc-phead .sub b,.fc-phead p b{color:var(--scene-ink);font-weight:600}
.fc-phead .sub a,.fc-phead p a{color:var(--scene-ink)}
.fc-phead .mono{font-family:var(--fc-mono)}

/* 頁尾 */
.fc-foot{border-top:1px solid var(--rule,#d5dbd9);font:13px/1.6 var(--fc-sans);color:var(--muted,#5e6b67);background:var(--ground,transparent)}
.fc-foot div{max-width:1180px;margin:0 auto;padding:24px 32px 40px;display:flex;flex-wrap:wrap;gap:8px 32px}
.fc-foot .fc-brand{font-family:var(--fc-mono);color:var(--ink,#15201d);margin-right:auto;text-decoration:none}

/* 既有內容頁：放寬主欄、拉開節奏 */
body.fc{margin:0;padding:0}
body.fc .wrap{max-width:1180px;padding:40px 32px 64px;gap:24px}
body.fc h2{font-size:24px;line-height:1.35;margin-top:24px;text-wrap:balance}
body.fc h3{font-size:15px}
body.fc a{text-underline-offset:3px}
body.fc a:hover{color:var(--pass)}
body.fc .note,body.fc .legend{font-size:14px;line-height:1.75;max-width:88ch}
body.fc .stage,body.fc .rp,body.fc .test,body.fc .plot{padding:18px}
body.fc .tests{gap:14px}
body.fc .test .n{font-size:34px}
body.fc table{font-size:14px}
body.fc th,body.fc td{padding:10px 10px}
body.fc button{min-height:36px}

/* 有些舊頁沒有定義成立 / 不成立的顏色，這裡補上（值和其他頁相同） */
:root{--pass:#0E8A74;--warn:#D2543A;--fail:#C9CFCD;--field:#E7ECEA}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){--pass:#37C2A5;--warn:#F07A5E;--fail:#333E3B;--field:#1E2826}}
:root[data-theme="dark"]{--pass:#37C2A5;--warn:#F07A5E;--fail:#333E3B;--field:#1E2826}
body.fc .note:has(.fc-fig){max-width:none}

/* 表格改成的圖 */
body.fc .fc-fig{margin:0;background:var(--panel);border:1px solid var(--rule);border-radius:10px;padding:18px;display:flex;flex-direction:column;gap:14px;color:var(--ink);font-size:14px}
body.fc .fc-fig figcaption{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 16px}
body.fc .fc-fig figcaption b{font-size:16px;font-weight:600}
body.fc .fc-fig figcaption>span{color:var(--muted);font-size:13px}
body.fc .fc-key{display:flex;flex-wrap:wrap;gap:4px 14px;margin-left:auto}
body.fc .fc-key span{display:inline-flex;align-items:center;gap:6px}
body.fc .fc-dot{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:50%;font:600 11px/1 var(--fc-sans);font-style:normal;flex:none;border:2px solid var(--muted);color:var(--muted)}
body.fc .fc-dot.pass{background:var(--pass);border-color:var(--pass);color:var(--panel)}
body.fc .fc-dot.fail{border-color:var(--warn);color:var(--warn)}
body.fc .fc-dot.mixed{border-color:var(--pass);color:var(--pass)}
body.fc .fc-seg{display:flex;gap:2px;height:8px}
body.fc .fc-seg i{border-radius:2px;background:var(--fail)}
body.fc .fc-seg i.pass{background:var(--pass)}
body.fc .fc-seg i.fail{background:var(--warn)}
body.fc .fc-seg i.mixed{background:repeating-linear-gradient(135deg,var(--pass) 0 4px,var(--field) 4px 8px)}
body.fc .fc-track{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:8px}
body.fc .fc-step{width:100%;height:100%;min-height:64px;display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr;gap:2px 8px;align-items:start;text-align:left;padding:10px;border-radius:6px;border:1px solid var(--rule);background:var(--ground);color:var(--ink);font:inherit;font-size:13px;line-height:1.4;cursor:pointer}
body.fc .fc-step:hover{border-color:var(--muted)}
body.fc .fc-step[aria-pressed="true"]{border-color:var(--ink);background:var(--panel)}
body.fc .fc-step .fc-dot{grid-row:1 / 3}
body.fc .fc-step .fc-n{font:12px/1.5 var(--fc-mono);color:var(--muted)}
body.fc .fc-step .fc-name{font-weight:600}
body.fc .fc-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
body.fc .fc-detail{margin:0;min-height:72px;padding:12px 14px;border-radius:6px;background:var(--field);color:var(--muted);font-size:14px;line-height:1.7;display:flex;flex-direction:column;gap:2px}
body.fc .fc-detail b{color:var(--ink);font-weight:600}
body.fc .fc-detail span{color:var(--ink)}
body.fc .fc-bars{position:relative;display:flex;flex-direction:column;gap:12px}
body.fc .fc-bar{display:grid;grid-template-columns:1fr minmax(8ch,auto);gap:3px 12px;align-items:center;font-size:13px}
body.fc .fc-bar>span{grid-column:1 / -1;display:flex;flex-wrap:wrap;align-items:center;gap:6px}
body.fc .fc-bar small{color:var(--muted);margin-left:6px}
body.fc .fc-bar>i{display:block;height:14px;border-radius:2px;background:linear-gradient(var(--fill),var(--fill)) left / var(--v) 100% no-repeat var(--field);--fill:var(--muted)}
body.fc .fc-bar.pass>i{--fill:var(--pass)}
body.fc .fc-bar>b{font-size:16px;font-weight:600;font-variant-numeric:tabular-nums;text-align:right}
body.fc .fc-thr{position:absolute;top:0;bottom:0;left:0;right:calc(8ch + 12px);pointer-events:none}
body.fc .fc-thr::before{content:"";position:absolute;top:0;bottom:0;left:var(--t);border-left:2px dashed var(--ink)}
body.fc .fc-thr span{position:absolute;left:var(--t);top:-4px;transform:translate(6px,-100%);font:12px/1.4 var(--fc-mono);color:var(--ink);white-space:nowrap}
body.fc .fc-chart:has(.fc-thr) .fc-bars{margin-top:14px}
body.fc .fc-stack{display:flex;flex-direction:column;gap:4px;font-size:13px}
body.fc .fc-stackbar{display:flex;gap:2px;height:30px}
body.fc .fc-stackbar i{display:grid;place-items:center;border-radius:2px;min-width:2px;overflow:hidden}
body.fc .fc-stackbar em{font:600 13px/1 var(--fc-sans);font-style:normal}
body.fc .fc-sw{display:inline-block;width:10px;height:10px;border-radius:2px}
body.fc .s0{background:var(--pass);color:var(--panel)}
body.fc .s1{background:var(--warn);color:var(--panel)}
body.fc .s2{background:var(--muted);color:var(--panel)}
body.fc .s3{background:var(--ink);color:var(--panel)}
body.fc .fc-scroll{overflow-x:auto}
body.fc .fc-fig details.fc-more{margin-top:0}

/* 收合的文字說明 */
body.fc .fc-text{display:flex;flex-direction:column;gap:0;margin-top:24px}
body.fc .fc-text>h2{font-size:12px;letter-spacing:.08em;font-weight:400;color:var(--muted);margin:0 0 8px}
body.fc details.fc-more{border-top:1px solid var(--rule)}
body.fc .fc-text details.fc-more:last-child{border-bottom:1px solid var(--rule)}
body.fc details.fc-more>summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:10px;min-height:44px;padding:8px 0;font-size:14px;font-weight:600;color:var(--ink)}
body.fc details.fc-more>summary::-webkit-details-marker{display:none}
body.fc details.fc-more>summary::before{content:"+";font-family:var(--fc-mono);font-weight:400;color:var(--muted);width:1ch}
body.fc details.fc-more[open]>summary::before{content:"−"}
body.fc details.fc-more>summary:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
body.fc details.fc-more>:not(summary){margin-bottom:16px}
body.fc section details.fc-more{margin-top:4px}

@media (max-width:720px){
  .fc-nav{padding-left:16px;padding-right:16px;gap:0 18px}
  .fc-nav .fc-brand{flex-basis:100%;padding-bottom:0}
  .fc-phead-in{padding:32px 16px 28px}
  .fc-phead h1{font-size:28px}
  .fc-foot div{padding-left:16px;padding-right:16px}
  body.fc .wrap{padding:28px 16px 48px}
  body.fc h2{font-size:20px}
  body.fc .stage,body.fc .rp,body.fc .test,body.fc .plot{padding:14px}
}
