:root {
  color-scheme: light;
  --background: #f6f7fb;
  --ink: #172139;
  --muted: #56627c;
  --line: #e1e5ef;
  --violet: #5141bc;
  --violet-dark: #4031a1;
  --violet-soft: #eeebfc;
  --done: #137454;
  --active: #5141bc;
  --blocked: #92520e;
  --pending: #58657d;
  font-family: Inter, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background: var(--background); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, input, select, textarea { color: inherit; }
button:focus-visible, a.button:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid #7866e1; outline-offset: 3px; }
button:disabled { opacity: .4; cursor: default; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: middle; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1520px; height: 67px; padding: 0 44px; margin: 0 auto; display: flex; gap: 24px; align-items: center; }
.brand { display: flex; gap: 11px; align-items: center; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: #252050; color: #fff; }
.brand-mark svg { width: 21px; height: 21px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .035em; line-height: 1.3; }
.brand small { font-size: 9px; color: var(--muted); letter-spacing: .12em; margin-top: 3px; font-weight: 700; }
.top-meta { display: flex; gap: 22px; align-items: center; }
.top-divider { height: 27px; width: 1px; background: var(--line); }
.workspace-name { font-size: 13px; font-weight: 650; color: var(--muted); }
.demo-label { margin-left: auto; border: 1px solid #e2dff3; background: #f7f5fe; border-radius: 30px; padding: 7px 11px; color: #53438a; font-size: 12px; font-weight: 650; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.demo-label span { width: 6px; height: 6px; border-radius: 50%; background: #7764ca; }
.demo-label b { font-weight: inherit; }
main { max-width: 1520px; margin: auto; padding: 34px 44px 20px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-bottom: 30px; }
.project-kicker { display: flex; align-items: center; gap: 9px; font: 700 11px/1.4 ui-monospace, Consolas, monospace; letter-spacing: .13em; color: var(--violet-dark); }
.kicker-line { display: inline-block; width: 18px; height: 2px; background: #7359dd; }
.project-id { border: 1px solid #ded9f3; border-radius: 5px; padding: 3px 6px; background: #f0edfa; letter-spacing: .065em; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(27px, 3.15vw, 46px); line-height: 1.25; letter-spacing: -.05em; margin: 9px 0 8px; font-weight: 760; }
.hero p { font-size: 14px; line-height: 1.65; color: var(--muted); }
.total-card { flex: 0 0 274px; border: 1px solid var(--line); border-radius: 15px; background: #fff; padding: 14px 17px; box-shadow: 0 2px 5px #20245006; }
.total-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.total-top strong { font-size: 13px; }
.total-top b { color: var(--violet-dark); font: 750 23px/1.2 ui-monospace, Consolas, monospace; }
.progress { overflow: hidden; height: 5px; border-radius: 10px; background: #e9eaf1; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--violet); transition: width .18s ease; }
.total-card .progress { height: 7px; margin: 9px 0 8px; }
.total-card small { color: var(--muted); font-size: 11px; }
.total-card .system-status { display: block; margin-top: 3px; font-weight: 650; }
.cloud-panel { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px 14px; border: 1px solid var(--line); border-radius: 11px; padding: 10px 13px; background: #fff; margin: -13px 0 14px; }
.cloud-panel strong { font-size: 13px; }
.cloud-panel p { color: var(--muted); font-size: 12px; line-height: 1.5; margin-top: 2px; }
.cloud-panel[data-mode="conflict"], .cloud-panel[data-mode="error"] { background: #fff7eb; border-color: #edd0a6; }
.cloud-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cloud-actions .button { min-height: 32px; font-size: 12px; }
.toolbar, .board-head, .board-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toolbar { margin-bottom: 13px; flex-wrap: wrap; }
.view-switch, .actions { display: flex; align-items: center; gap: 7px; }
.view-switch { border: 1px solid #e0e3ee; padding: 3px; border-radius: 10px; background: #eceef5; }
.view-button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; font-size: 13px; font-weight: 650; background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--muted); white-space: nowrap; }
.view-button[aria-pressed="true"] { color: var(--violet-dark); background: #fff; border-color: #e3e4ed; box-shadow: 0 1px 3px #2427470e; }
.view-button svg, .button svg, .filter svg { width: 16px; height: 16px; }
.button, .filter { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; border-radius: 8px; border: 1px solid #dce1ed; background: #fff; font-size: 13px; font-weight: 650; white-space: nowrap; }
.button:hover, .filter:hover { background: #f7f5ff; border-color: #beb3eb; }
.filter { padding-right: 6px; }
.filter select { background: transparent; border: 0; padding: 6px 4px 6px 0; cursor: pointer; }
.export { background: #282153; border-color: #282153; color: white; }
.export:hover { background: #3e3377; border-color: #3e3377; }
.add-module { border-color: #cfc4f2; color: var(--violet-dark); background: #f5f1ff; }
.add-module:hover { background: #ebe4ff; }
.board { background: #fff; border: 1px solid #dce1ed; border-radius: 16px; overflow: hidden; box-shadow: 0 6px 21px #242e5707; }
.board-head { min-height: 59px; padding: 10px 19px; }
.board-heading { display: flex; align-items: center; gap: 10px; }
.board-head h2 { font-size: 16px; }
.module-count { font-size: 11px; color: #54478d; background: #f1eefb; padding: 4px 7px; border-radius: 5px; font-weight: 650; white-space: nowrap; }
.board-head p { color: var(--muted); font-size: 12px; text-align: right; }
.map-actions { display: flex; align-items: center; gap: 12px; }
.layout-toggle { min-height: 34px; }
.layout-toggle[aria-pressed="true"] { color: #fff; background: var(--violet-dark); border-color: var(--violet-dark); }
.layout-help { background: #f3effd; border-top: 1px solid #e5dcf7; color: #43377e; padding: 9px 19px; font-size: 12px; line-height: 1.6; }
.map-viewport { overflow: auto; background: #f8f9fd; background-image: radial-gradient(#cbd1e4 1px, transparent 1px); background-size: 18px 18px; border-block: 1px solid var(--line); scrollbar-color: #a7a4c9 #eef0f8; }
.map-size { margin-inline: auto; position: relative; }
.map-canvas { height: 400px; position: absolute; transform-origin: top left; }
.lane { position: absolute; top: 0; height: 100%; border-inline: 1px solid #dee2f052; background: linear-gradient(180deg, #ecebf79c, #f4f3fa45 82%, transparent); pointer-events: none; }
.stage { position: absolute; top: 25px; display: flex; align-items: center; gap: 10px; }
.stage > div { min-width: 0; }
.stage-num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #e9e4fa; color: #4e3aa4; font: 750 13px ui-monospace, Consolas, monospace; }
.stage h3 { font-size: 15px; letter-spacing: .01em; }
.stage p { font-size: 11px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.edge { stroke: #a1a8c3; stroke-width: 1.8; }
.edge.ready { stroke: #7769bc; }
.edge.waiting { stroke-dasharray: 4 4; }
.node { position: absolute; height: 133px; display: flex; flex-direction: column; text-align: left; border: 1px solid #dce1ed; border-radius: 12px; background: #fff; padding: 12px 13px; box-shadow: 0 4px 10px #28365b0c; transition: border-color .15s, box-shadow .15s; }
.node:hover { border-color: #9e90df; box-shadow: 0 5px 17px #4536a326; }
.node[data-status="active"] { border-color: #bcb1ef; box-shadow: 0 4px 14px #5442b616; }
.node[data-status="na"] { background: #f5f6fb; }
.map-canvas[data-editing="true"] .node { cursor: grab; touch-action: none; }
.map-canvas .node.dragging { z-index: 5; cursor: grabbing; opacity: .86; box-shadow: 0 8px 21px #4536a346; }
.map-canvas .node.link-target { border: 2px solid #7866dc; background: #f9f7ff; }
.map-port { position: absolute; z-index: 3; width: 20px; height: 20px; padding: 0; transform: translate(-50%, -50%); border-radius: 50%; border: 0; background: #f8f9fd; display: grid; place-items: center; touch-action: none; cursor: crosshair; }
.map-port::after { content: ""; width: 8px; height: 8px; border: 1.5px solid var(--violet); border-radius: 50%; background: #fff; }
.map-port:hover::after, .map-port[aria-pressed="true"]::after, .map-port.link-target::after { background: var(--violet); }
.map-canvas.dragging-card .map-port { opacity: .35; }
.layout-edge, .drop-marker { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.layout-edge { width: 100%; height: 100%; overflow: visible; }
.layout-edge path { stroke: var(--violet); stroke-width: 2; stroke-dasharray: 4 3; }
.drop-marker { inset: auto; height: 3px; border-radius: 3px; background: var(--violet); }
.drop-marker.invalid { background: #b24235; }
.node-top, .node-title, .node-bottom { display: flex; align-items: center; justify-content: space-between; gap: 4px; width: 100%; }
.node-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: #efecfb; color: #5643ad; flex: none; }
.node-icon svg { width: 17px; height: 17px; }
.node-title { margin-top: 7px; font-size: 16px; font-weight: 750; letter-spacing: -.02em; }
.node-title > span, .host { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-title svg { width: 13px; height: 13px; color: #747e99; }
.host { margin-top: 3px; color: var(--muted); font: 600 11px/1.3 ui-monospace, Consolas, "Microsoft JhengHei", monospace; }
.map-canvas.compact .node { padding-inline: 10px; }.map-canvas.compact .node-title { font-size: 14px; }.map-canvas.compact .host { font-size: 10px; }
.node-bottom { margin-top: auto; }
.node-bottom .progress { flex: 1; }
.node-bottom b { color: var(--muted); font: 650 11px ui-monospace, Consolas, monospace; margin-left: 4px; }
.status { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 5px; font-size: 11px; font-weight: 700; line-height: 1.1; white-space: nowrap; }
.status::before, .legend-dot { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.status.done { color: var(--done); background: #e8f6ee; }
.status.active { color: var(--active); background: #eeeafb; }
.status.blocked { color: var(--blocked); background: #fff1db; }
.status.pending, .status.na { color: var(--pending); background: #edf0f6; }
[data-status="done"] .progress > span { background: #369773; }
.board-foot { min-height: 58px; padding: 9px 17px; }
.legend { display: flex; gap: 13px; align-items: center; flex-wrap: wrap; color: var(--muted); }
.legend > span { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 11px; }
.legend-dot.done { color: var(--done); }.legend-dot.active { color: var(--active); }.legend-dot.blocked { color: var(--blocked); }.legend-dot.pending { color: #7f8ba1; }
.legend-link { margin-left: 4px; }.legend svg { width: 15px; height: 15px; color: #6b639b; }
.zoom { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); }
.zoom button, .icon-button { border: 0; background: transparent; padding: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; }
.zoom button:hover, .icon-button:hover { background: #f0edfa; }
.zoom svg { width: 15px; height: 15px; }.zoom span { text-align: center; min-width: 43px; font: 700 11px ui-monospace, Consolas, monospace; }.zoom .fit { border-left: 1px solid var(--line); border-radius: 0 6px 6px 0; }
.page-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 1px 0; font-size: 11px; color: var(--muted); }.page-foot svg { width: 14px; height: 14px; margin-right: 3px; }.page-foot b { font-family: ui-monospace, Consolas, monospace; }
.module-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 16px; border-top: 1px solid var(--line); background: #f8f9fd; }
.list-card { padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.list-open { display: flex; align-items: center; text-align: left; gap: 9px; width: 100%; background: none; border: none; border-radius: 5px; padding: 0; }
.list-open:hover strong { color: var(--violet-dark); }.list-open small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; }.list-open .status { margin-left: auto; }
.list-tasks { margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); display: grid; gap: 6px; list-style: none; font-size: 12px; color: var(--muted); }.list-tasks svg { width: 13px; height: 13px; color: var(--done); margin-right: 4px; }.list-tasks .unmarked { display: inline-block; width: 9px; height: 9px; border: 1px solid #a2abc0; border-radius: 3px; margin: 0 7px 0 2px; }
dialog { position: fixed; inset: 0 0 0 auto; width: min(490px, 100vw); height: 100%; max-width: none; max-height: none; padding: 0; margin: 0; border: 0; color: var(--ink); background: #fff; box-shadow: -8px 0 36px #1b234230; overflow: auto; }
dialog::backdrop { background: #2023405e; } body:has(dialog[open]) { overflow: hidden; }
.detail-head { background: #f9f8ff; padding: 24px; border-bottom: 1px solid var(--line); }.detail-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; font-weight: 650; }.detail-title-row { display: flex; align-items: center; gap: 10px; margin: 12px 0 7px; }.detail-title-row h2 { font-size: 25px; line-height: 1.2; }.detail-description { color: var(--muted); font-size: 13px; line-height: 1.65; }.detail-progress { display: flex; align-items: center; gap: 8px; margin-top: 13px; font-size: 11px; color: var(--muted); }.detail-progress .progress { flex: 1; height: 6px; }
.detail-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 18px; }.detail-tabs button { padding: 12px 9px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: 13px; font-weight: 650; }.detail-tabs button[aria-pressed="true"] { border-color: var(--violet); color: var(--violet-dark); }
.detail-body { padding: 19px 24px; }.detail-context { font-size: 12px; color: var(--muted); margin-bottom: 12px; line-height: 1.6; }.detail-body h3 { font-size: 15px; margin: 0 0 9px; }.checks { display: grid; gap: 7px; margin-bottom: 17px; }.task { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer; }.task input { margin: 0; accent-color: var(--violet); width: 17px; height: 17px; flex: none; }.task .task-title { flex: 1; }.task input:checked + .task-title { color: var(--muted); text-decoration: line-through; }.tag { flex: none; color: #55498a; padding: 3px 5px; border-radius: 4px; background: #f0edfb; font-size: 10px; white-space: nowrap; }
.add-task { display: flex; flex-wrap: wrap; gap: 7px; }.add-task input { flex: 1; min-width: 145px; }.add-task select { padding-right: 3px; }.add-task input, .add-task select, .editor { min-height: 38px; padding: 7px 9px; border: 1px solid #d8ddeb; border-radius: 7px; background: #fff; font-size: 13px; }.editor { display: block; width: 100%; min-height: 176px; line-height: 1.65; margin: 0 0 9px; resize: vertical; }.evidence .editor { min-height: 84px; }.detail-body .primary { color: #fff; background: var(--violet-dark); border-color: var(--violet-dark); }.detail-body .primary:hover { background: #5141bc; }
.detail-foot { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 24px 24px; }.empty { padding: 13px; color: var(--muted); background: #f5f6fb; border-radius: 8px; font-size: 13px; }.env-row { padding: 11px 0; border-bottom: 1px solid var(--line); }.env-row strong { font-size: 13px; }.env-row small { font-size: 11px; color: var(--muted); }.env-row summary { cursor: pointer; line-height: 1.6; }.evidence { padding: 10px 0 1px; }
.detail-title-row h2, .detail-context, .detail-description { overflow-wrap: anywhere; }
.detail-description { white-space: pre-line; }
.workspace-form, .edit-grid { display: grid; gap: 12px; }
.edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.workspace-form fieldset { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: 9px; padding: 12px; }
.workspace-form legend { font-weight: 750; font-size: 13px; padding: 0 5px; }
.workspace-form .checks, .workspace-form .checks > p { margin-bottom: 0; }
.workspace-form .task input:checked + .task-title { color: var(--ink); text-decoration: none; }
.edit-field { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 650; }
.edit-field input, .edit-field select, .edit-field textarea { width: 100%; min-width: 0; min-height: 38px; padding: 8px 9px; border: 1px solid #d8ddeb; border-radius: 7px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 400; }
.edit-field textarea { resize: vertical; }
.editor-actions { display: flex; justify-content: flex-end; gap: 8px; }
.editor-error { padding: 9px 11px; border-radius: 7px; background: #fff0ed; color: #982925; font-size: 13px; line-height: 1.5; }
.remove-module { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 12px; font-size: 13px; color: #982925; }
.remove-module summary { cursor: pointer; }.remove-module p { margin: 8px 0; color: var(--muted); }
.danger { border-color: #edc1b9; color: #982925; }.danger:hover { border-color: #d99588; background: #fff0ed; }
.delivery-preview { inset: 0; margin: auto; width: min(780px, calc(100% - 24px)); height: fit-content; max-height: calc(100% - 24px); border: 1px solid var(--line); border-radius: 16px; }
.delivery-inner { display: grid; gap: 14px; padding: 22px; }
.delivery-head, .delivery-actions { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.delivery-head h2 { font-size: 24px; overflow-wrap: anywhere; margin: 4px 0; }
.delivery-kicker { color: var(--violet-dark); font-size: 11px; font-weight: 750; letter-spacing: .09em; }
.delivery-head #delivery-source, .delivery-actions p { color: var(--muted); font-size: 12px; }
.delivery-summary { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.delivery-inner textarea { width: 100%; min-width: 0; min-height: 180px; height: min(52dvh, 500px); resize: vertical; padding: 12px; line-height: 1.65; border: 1px solid var(--line); border-radius: 8px; background: #f8f9fd; font: 13px/1.65 ui-monospace, Consolas, "Microsoft JhengHei", monospace; }
.delivery-actions { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.delivery-actions p { margin-right: auto; }
.delivery-actions a { text-decoration: none; }
.toast { position: fixed; z-index: 4; bottom: 18px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100vw - 25px); padding: 10px 15px; border-radius: 8px; background: #252050; color: white; font-size: 13px; box-shadow: 0 5px 14px #24274730; }
@media (max-width: 940px) { main { padding-inline: 24px; }.top-inner { padding-inline: 24px; } }
@media (max-width: 620px) {
  .top-inner { height: 58px; padding-inline: 15px; gap: 8px; }.top-meta { display: none; }.brand-mark { width: 33px; height: 33px; }.demo-label { font-size: 10px; padding: 6px 8px; }
  main { padding: 22px 12px 15px; }.hero { display: grid; gap: 13px; margin-bottom: 17px; }.hero p { font-size: 12px; }.total-card { padding: 9px 12px; }.total-top b { font-size: 19px; }.total-card .progress { margin: 6px 0 4px; }
  .toolbar { flex-wrap: wrap; gap: 7px; }.actions { flex-wrap: wrap; }.view-button { padding: 6px; }.button, .filter { min-height: 35px; padding-inline: 7px; }.toolbar button, .filter { font-size: 12px; }.board-head { padding: 8px 10px; min-height: 47px; }.board-head h2 { font-size: 14px; }.board-head p { font-size: 10px; }.board-heading { gap: 5px; }.module-count { font-size: 10px; }
  .board-foot { flex-wrap: wrap; padding: 8px 10px; gap: 9px; }.legend { gap: 7px; }.legend > span { font-size: 10px; }.zoom { margin-left: auto; }.module-list { grid-template-columns: 1fr; padding: 10px; }.page-foot { font-size: 10px; }.detail-head, .detail-body { padding-inline: 16px; }.detail-foot { padding-inline: 16px; }
  .map-actions #map-hint { display: none; }.layout-help { padding-inline: 10px; }
  .cloud-panel { margin-top: -5px; }
  .delivery-inner { padding: 14px; }.delivery-actions p { flex-basis: 100%; }.delivery-head h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
