/* 色彩與字體：MaiAgent design system v23.0.1（鏡像自 maiagent-builder-plugin maiagent-deck design-tokens.md） */
:root {
  --brand: #3854D8;      /* --color-brand-blue */
  --brand-green: #00DC87;/* --color-brand-green（只作裝飾、漸層） */
  --brand-700: #1F359E;  /* --c-blue-700 */
  --brand-900: #13205E;  /* --c-blue-900 */
  --tint: #EEF0FC;       /* --c-blue-50 */
  --grad: linear-gradient(135deg, #3854D8, #00DC87); /* DS 主漸層 */
  --ink: #1A1A1A;        /* --color-text-primary */
  --ink2: #4D4D4D;       /* --color-text-secondary */
  --muted: #808080;      /* --color-text-tertiary */
  --line: #D9D9D9;       /* --color-border-subtle */
  --line2: #E4E4E4;      /* --color-border-faint */
  --bg: #F1F1F1;         /* --color-bg-canvas */
  --card: #FFFFFF;
  --ok: #228D6D; --okbg: #E8FCF7; --okline: #A3F5DF;
  --warn: #E37200; --warnbg: #FEF2E6; --warnline: #FDDBB9;
  --bad: #D93526; --badbg: #FEEDEC; --badline: #F7BFBA;
  --r: 12px;
  font-family: "Inter", "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.55; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
h2 { font-size: 24px; margin: 6px 0 4px; color: var(--ink); }
h3 { font-size: 17px; margin: 0 0 8px; color: var(--ink); }
.lead { color: var(--muted); margin: 0 0 18px; }
small { color: var(--muted); }

.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 28px; background: var(--brand); color: #fff; }
.brand { display: flex; gap: 12px; align-items: center; }
.mark { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 20px;
  background: linear-gradient(135deg, var(--brand), var(--brand)); color: #fff; }
.title { font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.sub { font-size: 12.5px; opacity: .75; }
.ctx { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ds-pick { display: flex; gap: 8px; align-items: center; font-size: 13px; opacity: .95; }
.ds-pick select { min-width: 260px; max-width: 360px; background: var(--brand-700); color: #fff; border: 1px solid #3c5a72; border-radius: 8px; padding: 6px 8px; }
.top .ghost { color: #fff; border-color: #3c5a72; background: transparent; }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: #2a4458; }
.pill.on { background: #228D6D; }

.steps { display: flex; gap: 4px; padding: 0 28px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.steps button { border: 0; background: none; padding: 14px 16px 12px; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; font-size: 15px; }
.steps button b { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 7px; border-radius: 50%; background: #E4E4E4; color: var(--ink); font-size: 12px; }
.steps button.on { color: var(--ink); font-weight: 700; border-bottom-color: var(--brand); }
.steps button.on b { background: var(--brand); color: #fff; }
.steps button.done b { background: var(--ok); color: #fff; }

main { max-width: 1240px; margin: 0 auto; padding: 24px 28px 80px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } .top, .steps, main { padding-left: 16px; padding-right: 16px; } }

.form label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-weight: 600; font-size: 14px; }
.form.compact { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.form.compact label { margin: 0; }
input, select, textarea { border: 1px solid #D9D9D9; border-radius: 8px; padding: 8px 10px; background: #fff; font-weight: 400; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
label.check { flex-direction: row !important; align-items: center; gap: 8px; font-weight: 400 !important; cursor: pointer; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

button { cursor: pointer; border-radius: 9px; padding: 8px 14px; border: 1px solid #D9D9D9; background: #fff; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--brand); color: #fff; border-color: var(--ink); font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--brand-700); }
button.ghost:hover:not(:disabled) { background: var(--tint); }
button.danger { color: var(--bad); border-color: #F7BFBA; background: #fff; }
button.big { padding: 11px 22px; font-size: 16px; }
kbd { font-family: ui-monospace, Menlo, monospace; font-size: 11px; padding: 1px 5px; margin-left: 4px; border-radius: 4px; background: rgba(255,255,255,.18); border: 1px solid rgba(0,0,0,.12); }
button.primary kbd { border-color: rgba(255,255,255,.35); }
.msg { color: var(--muted); font-size: 14px; }
.msg.err { color: var(--bad); }
.msg.ok { color: var(--ok); }
.link { color: var(--brand); text-decoration: underline; cursor: pointer; }

.drop { border: 2px dashed #BFC8F2; border-radius: var(--r); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 30px; text-align: center; min-height: 190px; transition: .15s; }
.drop.over { background: var(--tint); border-color: var(--brand); }
.drop-icon { font-size: 34px; color: var(--brand); }

.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; min-width: 128px; }
.stat .n { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 13px; color: var(--muted); }
.stat.ok .n { color: var(--ok); } .stat.bad .n { color: var(--bad); } .stat.warn .n { color: var(--warn); }
.stat.arrow { border: 0; background: none; min-width: 0; padding: 12px 0; color: #999999; align-self: center; font-size: 20px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12.5px; padding: 3px 10px; border-radius: 99px; background: #F1F1F1; color: #4D4D4D; border: 1px solid transparent; white-space: nowrap; }
button.chip { cursor: pointer; padding: 4px 11px; }
button.chip.on { background: var(--brand); color: #fff; }
.chip.warn { background: var(--warnbg); color: var(--warn); }
.chip.bad { background: var(--badbg); color: var(--bad); }
.chip.ok { background: var(--okbg); color: var(--ok); }
.chip.gold { background: #EEF0FC; color: var(--brand); border-color: #C9D1F5; }

.table-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.scroll { overflow: auto; max-height: 420px; }
.scroll.tall { max-height: 62vh; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th.num { text-align: right; }
.tbl th { position: sticky; top: 0; background: #F1F1F1; text-align: left; font-weight: 600; padding: 8px 10px; z-index: 1; }
.tbl td { border-top: 1px solid #E4E4E4; padding: 8px 10px; vertical-align: top; }
.tbl td.q { min-width: 260px; }
.tbl td.a { color: #4D4D4D; max-width: 460px; }
.tbl tr:hover td { background: #F7F8FD; }
.clip { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.num { font-variant-numeric: tabular-nums; text-align: right; }

.actionbar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 14px; padding: 14px 0; background: linear-gradient(transparent, var(--bg) 30%); }

.choice { position: relative; display: flex; flex-direction: column; gap: 10px; }
.choice p { margin: 0; color: var(--muted); }
.choice label { display: flex; gap: 8px; align-items: center; }
.badge { position: absolute; right: 16px; top: 16px; font-size: 12px; padding: 2px 9px; border-radius: 99px; }
.badge.rec { background: var(--brand); color: #fff; }
.kb-list, .bot-list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; padding: 4px 2px; }
.bot-list label { padding: 6px 8px; border-radius: 8px; }
.bot-list label:hover { background: var(--tint); }
.bot-list .tagA, .bot-list .tagB { font-size: 11px; padding: 1px 7px; border-radius: 99px; margin-left: auto; }
.progress { position: relative; height: 26px; background: #F1F1F1; border-radius: 8px; overflow: hidden; }
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand)); transition: width .4s; }
.progress span { position: relative; display: block; text-align: center; font-size: 13px; line-height: 26px; color: var(--ink); font-weight: 600; }

.review-head { display: flex; justify-content: space-between; align-items: center; }
.scope { gap: 28px !important; }
.seg { display: inline-flex; border: 1px solid #D9D9D9; border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { border: 0; border-radius: 0; padding: 7px 14px; background: none; }
.seg button + button { border-left: 1px solid #E4E4E4; }
.seg button.on { background: var(--brand); color: #fff; }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.filters #rv-search { min-width: 200px; }
#bulk-safe { margin-left: auto; }

.rv-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px 28px; box-shadow: 0 6px 24px rgba(19,32,94,.06); }
.rv-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 8px; gap: 10px; flex-wrap: wrap; }
.rv-q { font-size: 21px; font-weight: 700; color: var(--ink); margin-bottom: 16px; white-space: pre-wrap; }
.rv-label { font-weight: 600; font-size: 14px; display: block; margin-bottom: 6px; }
#rv-gt { font-size: 15.5px; line-height: 1.65; }
#rv-src { margin: 10px 0 0; font-size: 13.5px; color: #4D4D4D; }
#rv-src summary { cursor: pointer; color: var(--brand); }
#rv-src .srcp { background: var(--tint); border-radius: 8px; padding: 8px 10px; margin-top: 8px; white-space: pre-wrap; max-height: 160px; overflow: auto; }
.rv-tags { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.tog { font-size: 13.5px; }
.tog.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.rv-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid #E4E4E4; padding-top: 16px; }
.rv-actions #rv-prev { margin-right: auto; }
.rv-empty { text-align: center; font-size: 18px; padding: 40px; color: var(--muted); }
.flash-ok { animation: fok .35s; } @keyframes fok { from { box-shadow: 0 0 0 4px rgba(34,141,109,.35); } }

.bulkbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; }

.cmp-pick { flex-wrap: nowrap !important; }
.cmp-pick label { flex: 1; min-width: 0; }
.cmp-pick select { width: 100%; }
@media (max-width: 860px) { .cmp-pick { flex-wrap: wrap !important; } }
.gate { border-radius: var(--r); padding: 16px 20px; margin: 16px 0; font-size: 16px; border: 1px solid; }
.gate.ok { background: var(--okbg); border-color: #A3F5DF; color: #1A6B52; }
.gate.bad { background: var(--badbg); border-color: #F7BFBA; color: #A12A1F; }
.gate b { font-size: 19px; display: block; margin-bottom: 4px; }
.gate ul { margin: 6px 0 0; padding-left: 20px; }
.cmp-item { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 12px; }
.cmp-item.regressed { border-left: 5px solid var(--bad); }
.cmp-item.improved { border-left: 5px solid var(--ok); }
.cmp-item .q { font-weight: 700; color: var(--ink); font-size: 16.5px; margin: 6px 0 8px; }
.cmp-item .gt { background: var(--tint); padding: 8px 12px; border-radius: 8px; font-size: 14px; margin-bottom: 10px; }
.cmp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-col { border: 1px solid #E4E4E4; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.cmp-col h4 { margin: 0 0 6px; font-size: 13px; display: flex; justify-content: space-between; color: var(--muted); }
.cmp-col .ans { white-space: pre-wrap; max-height: 220px; overflow: auto; }
.cmp-col .why { margin-top: 8px; font-size: 12.5px; color: var(--muted); border-top: 1px dashed #E4E4E4; padding-top: 6px; }
.judge { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.judge button.on { background: var(--brand); color: #fff; border-color: var(--ink); }
@media (max-width: 860px) { .cmp-cols { grid-template-columns: 1fr; } }

dialog { border: 0; border-radius: 16px; padding: 24px; width: min(480px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog label { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-weight: 600; }
dialog menu { display: flex; justify-content: flex-end; gap: 10px; padding: 0; margin: 18px 0 0; }

#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 10px; opacity: 0; transition: .25s; pointer-events: none; z-index: 50; font-size: 14.5px; }
#toast.show { opacity: 1; }
#toast.err { background: var(--bad); }

@media print {
  .top, .steps, .filters, .cmp-pick, .actionbar, .judge, #toast { display: none !important; }
  section:not([data-panel="compare"]) { display: none !important; }
  main { padding: 0; }
  .cmp-col .ans { max-height: none; }
}

.keys { text-align: right; margin-top: 8px; }
.choice label.pick { white-space: nowrap; }
.choice label.pick select { flex: 1; min-width: 0; }
.scope label.check { align-items: center; margin: 0; }
#bot-filter { width: 100%; margin-bottom: 8px; }

/* ---- 2026-11-13 改版：區塊標題、草擬三選一、花費確認、人工確認、閉環 ---- */
h3.sec { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 18px; margin: 26px 0 10px; color: var(--ink); }
h3.sec b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 14px; flex-shrink: 0; }
h3.sec small { font-size: 14px; font-weight: 400; color: var(--muted); }
h3.sec[hidden] { display: none; }
.help { color: #4D4D4D; font-size: 14px; margin: 0 0 12px; background: var(--tint); border-radius: 8px; padding: 8px 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1000px) { .grid3 { grid-template-columns: 1fr; } }
.choice .pick select { width: 100%; }
.choice.off { opacity: .55; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 4px 0; font-size: 13.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; color: var(--ink); }
.run-box { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; border-color: var(--brand); }
.row.between { justify-content: space-between; }
.near-row { padding: 6px 0; border-top: 1px solid #E4E4E4; }
.rv-why { background: var(--badbg); border: 1px solid #F7BFBA; color: #A12A1F; border-radius: 10px; padding: 8px 12px; font-size: 13.5px; margin-bottom: 10px; }
.rv-why .why-t { display: block; font-weight: 700; margin-bottom: 2px; }
button.chip kbd { background: rgba(0,0,0,.08); border: 0; margin: 0 6px 0 0; padding: 0 5px; font-size: 11px; color: inherit; }
button.chip.on kbd { background: rgba(255,255,255,.22); }
button.chip.add { background: #fff; border: 1px dashed #BFC8F2; color: var(--brand); }
.chip.blue { background: #EEF0FC; color: #3854D8; }
dialog.wide { width: min(760px, 94vw); }
.tbl.cost td, .tbl.cost th { font-size: 13.5px; }
.cost-total { margin-top: 10px; font-size: 15px; }
.cost-total b { color: var(--ink); font-size: 17px; }
.cost-notes { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; }
.loop-steps { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; font-size: 14px; color: var(--muted); }
.loop-steps span:not(:nth-child(even)) { padding: 6px 12px; border-radius: 99px; background: #F1F1F1; }
.loop-steps .on { background: var(--brand) !important; color: #fff; }
.loop-steps .done { background: var(--okbg) !important; color: var(--ok); }
.loop-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.loop-card p { margin: 6px 0 10px; color: var(--muted); font-size: 14px; }
.loop-card.bad { border-color: #F7BFBA; background: #FEEDEC; }
.loop-card.warn { background: var(--warnbg); border-color: #FDDBB9; color: #8A4600; }
.lc-h { font-weight: 700; color: var(--ink); }
.lc-h b { font-size: 22px; margin-left: 6px; }
.fix-md { margin-top: 12px; font-size: 14px; line-height: 1.7; }
.fix-md:empty { display: none; }
.fix-md h4 { margin: 14px 0 6px; color: var(--ink); }
.fix-md h5 { margin: 12px 0 4px; font-size: 14.5px; color: var(--brand); }
.fix-md p { margin: 2px 0; }
.fix-md li { margin-left: 18px; }

[hidden] { display: none !important; }


/* ---- MaiAgent 版面（2026-11-16）：白色頂列＋品牌漸層細線、藍色主色 ---- */
body { background: linear-gradient(180deg, var(--tint) 0, #F7F8FD 260px, var(--bg) 640px) no-repeat, var(--bg); }
.top { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line2); position: relative; padding: 14px 28px; }
.top::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--grad); }
.brand { gap: 16px; }
.brand .logo { height: 26px; width: auto; display: block; }
.brand .divider { width: 1px; height: 30px; background: var(--line); }
.title { font-size: 17px; letter-spacing: 0; color: var(--ink); }
.sub { font-size: 12.5px; opacity: 1; color: var(--muted); }
.ds-pick { color: var(--ink2); font-weight: 500; }
.ds-pick select { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.top .ghost { color: var(--brand); border-color: var(--line); background: #fff; }
.top .ghost:hover:not(:disabled) { background: var(--tint); border-color: var(--brand); }
.pill { background: var(--bg); color: var(--ink2); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #999999; }
.pill.on { background: var(--okbg); color: var(--ok); border-color: var(--okline); }
.pill.on::before { background: var(--ok); }

.steps { background: #fff; border-bottom: 1px solid var(--line2); }
.steps button { color: var(--muted); font-weight: 500; }
.steps button:hover { color: var(--ink); }
.steps button b { background: var(--bg); color: var(--ink2); }
.steps button.on { color: var(--brand); border-bottom-color: var(--brand); }
.steps button.on b { background: var(--brand); color: #fff; }

h2 { font-size: 28px; font-weight: 700; letter-spacing: 0; }
.card { border-color: var(--line2); box-shadow: 0 1px 2px rgba(19,32,94,.04); }
input, select, textarea { border-color: var(--line); }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(56,84,216,.18); border-color: var(--brand); }
button { border-color: var(--line); border-radius: 8px; transition: background .15s, border-color .15s, color .15s; }
button.primary { background: var(--brand); border-color: var(--brand); }
button.primary:hover:not(:disabled) { background: var(--brand-700); border-color: var(--brand-700); }
button.ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
button.danger { border-color: var(--badline); }
.badge.rec { background: var(--grad); }
.progress i { background: var(--grad); }
#toast { background: var(--brand-900); }
.choice:hover { border-color: #BFC8F2; }
@media (max-width: 600px) {
  .brand { flex-direction: column; align-items: flex-start; gap: 8px; }
  .brand .divider { display: none; }
  .brand .logo { height: 22px; }
  .ctx { width: 100%; }
  .ds-pick { flex: 1; }
  .ds-pick select { min-width: 0; flex: 1; }
  h2 { font-size: 24px; }
}

/* ---- 連線頁：組織、金鑰教學、流程圖（2026-11-16） ---- */
.connect-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.connect-grid .card { margin-bottom: 0; }
.guide details { border-top: 1px solid var(--line2); padding: 10px 0; }
.guide details:first-child { border-top: 0; padding-top: 0; }
.guide summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; list-style: none; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.guide details:not([open]) summary::after { transform: rotate(-90deg); }
.g-no { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--tint); color: var(--brand); font-size: 12px; }
.guide ol { margin: 10px 0 6px; padding-left: 22px; font-size: 14px; color: var(--ink2); }
.guide ol li { margin: 4px 0; }
.guide b { color: var(--ink); }
.g-note { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.g-warn { margin: 8px 0 0; padding: 8px 12px 8px 28px; background: var(--warnbg); border: 1px solid var(--warnline); border-radius: 8px; font-size: 13px; color: #8A4600; }
.g-warn li { margin: 2px 0; }

.flow-title { margin-top: 36px; }
.flow { background: #fff; border: 1px solid var(--line2); border-radius: var(--r); padding: 22px 20px 18px; }
.flow-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px; }
.flow-steps li { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px 12px 12px; border: 1px solid var(--line2); border-radius: 10px; background: #fff; }
.flow-steps li::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: 10px 10px 0 0; background: var(--grad); }
.flow-steps li:not(:last-child)::after { content: "→"; position: absolute; right: -18px; top: 50%; transform: translateY(-50%); color: var(--brand); font-weight: 700; font-size: 16px; }
.flow-steps li > b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12.5px; }
.flow-steps h4 { margin: 0; font-size: 15.5px; color: var(--ink); }
.flow-steps p { margin: 0; font-size: 13px; color: var(--ink2); flex: 1; }
.flow-steps .out { font-size: 12.5px; color: var(--ok); background: var(--okbg); border: 1px solid var(--okline); border-radius: 6px; padding: 3px 8px; }
.flow-steps .out::before { content: "產出：" ; font-weight: 700; }
.flow-loop { position: relative; margin: 14px 0 0 calc((100% - 110px) * 4 / 6 + 88px); margin-right: 0; border: 2px dashed #BFC8F2; border-top: 0; border-radius: 0 0 12px 12px; height: 26px; }
.flow-loop span { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 6px); white-space: nowrap; font-size: 13px; color: var(--brand); background: #fff; }
.flow-when { margin: 44px 0 0; font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.flow-when span { background: var(--bg); border-radius: 99px; padding: 2px 10px; color: var(--ink2); }

@media (max-width: 1000px) {
  .connect-grid { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: 1fr; gap: 18px; }
  .flow-steps li:not(:last-child)::after { content: "↓"; right: auto; left: 50%; top: auto; bottom: -18px; transform: translateX(-50%); }
  .flow-loop { margin: 14px 0 0; border: 2px dashed #BFC8F2; border-radius: 12px; height: auto; padding: 8px 12px; }
  .flow-loop span { position: static; transform: none; white-space: normal; display: block; text-align: center; }
  .flow-loop span::before { content: "↺ "; }
  .flow-when { margin-top: 16px; }
}
.flow-loop::before { content: "▲"; position: absolute; left: -7px; top: -12px; font-size: 11px; color: #8A9AE8; }
@media (max-width: 1000px) { .flow-loop::before { display: none; } }
