:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: #202124;
  background: #f5f5f7;
  font-size: 14px;
  line-height: 1.5;
  --muted: #61636a;
  --border: #e6e7eb;
  --blue: #0067cf;
  --blue-bg: #eaf2fd;
  --green: #245d40;
  --amber: #765018;
  --red: #992f3d;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .58; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
h1, h2, p, blockquote, ol, ul, dl { margin: 0; }
h1 { font-size: clamp(1.5rem, 3vw, 1.9rem); line-height: 1.25; letter-spacing: -.02em; font-weight: 700; }
h1:focus { outline: none; }
h2 { font-size: 1.1rem; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
small, .muted { color: var(--muted); font-size: .88rem; }
small { display: block; }
strong, b { font-weight: 630; }

.top { background: #fff; border-bottom: 1px solid var(--border); padding: 9px clamp(16px, 3vw, 40px); min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px 18px; flex-wrap: wrap; }
.brand, .top-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.brand { font-size: 1.02rem; }
.crumb { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.mark { color: #fff; background: #202124; border-radius: 5px; padding: 3px 7px; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.badge { display: inline-block; border-radius: 5px; background: #eeeef1; color: #555760; padding: 2px 7px; line-height: 1.45; font-size: .81rem; font-weight: 530; vertical-align: middle; }
.badge.blue { color: #0058b4; background: var(--blue-bg); }
.badge.green { color: var(--green); background: #e4f2e8; }
.badge.amber { color: var(--amber); background: #f9eed6; }
.badge.red { color: var(--red); background: #fbe9eb; }
.top .button { min-height: 32px; padding: 3px 8px; background: #fff; color: var(--muted); font-size: .86rem; }
.top .button:hover { background: #f0f0f2; }

main { width: min(100%, 1280px); margin-inline: auto; padding: 24px clamp(16px, 4vw, 40px) 48px; display: grid; align-items: start; gap: 20px; min-width: 0; }
main > * { min-width: 0; }

.workflow { display: flex; align-items: center; gap: clamp(10px, 3vw, 32px); }
.steps { display: flex; flex: 1; align-items: center; gap: 6px; }
.steps .step { display: flex; align-items: center; }
.steps .step > span { color: #62646c; white-space: nowrap; padding: 5px 7px; font-size: .9rem; }
.steps .step:not(:last-child) { flex: 1; }
.steps .step:not(:last-child)::after { content: ""; height: 1px; background: #dedfe4; flex: 1; margin-left: 4px; }
.steps span[aria-current] { color: #202124; background: white; border-radius: 7px; }
.steps .done b { color: var(--green); }
.segmented { display: flex; width: fit-content; padding: 3px; gap: 2px; border-radius: 8px; background: #ebebee; white-space: nowrap; }
.segmented button { border: 0; border-radius: 5px; background: transparent; color: var(--muted); padding: 5px 10px; font-size: .88rem; }
.segmented button[aria-pressed="true"] { background: white; color: #202124; box-shadow: 0 1px 2px #20212418; font-weight: 630; }

.page-heading { display: grid; gap: 4px; }
.page-heading p { color: var(--muted); }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 20px; }
.panel { min-width: 0; border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 18px 20px; }
.panel h2 { margin-bottom: 12px; }
blockquote { background: #f3f3f5; border-radius: 8px; padding: 15px 16px; margin-bottom: 10px; }
blockquote small { margin-bottom: 6px; }
.field-row { display: grid; gap: 4px 12px; grid-template-columns: minmax(68px, 19%) minmax(0, 1fr) auto; align-items: start; border-top: 1px solid var(--border); padding: 12px 0; }
.field-row:last-child { padding-bottom: 0; }
.field-row small { margin-top: 3px; }

form { display: grid; gap: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
label { color: #34353b; display: block; font-size: .94rem; font-weight: 600; }
input, select { display: block; width: 100%; min-width: 0; min-height: 40px; margin-top: 5px; padding: 8px 10px; border: 1px solid #d9dae0; border-radius: 7px; background: #fff; color: #202124; }
input[readonly] { background: #f5f5f7; }
.columns select + p { margin-top: 10px; }
.form-error { color: var(--red); }

.footer, .simulation { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; }
.footer small { margin-top: 3px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.button { color: #25262a; border: 1px solid transparent; background: #eeeef1; border-radius: 9px; min-height: 39px; padding: 7px 14px; font-weight: 590; }
.button:hover { background: #e2e3e8; }
.button.primary { background: var(--blue); color: white; }
.button.primary:hover { background: #0058b5; }
.simulation { background: #fcf8ef; border: 1px dashed #d3ba85; }
.simulation h2 { margin: 0; }
.simulation .button { border-color: #e5d9bf; background: white; }
.simulation .button:hover { background: #f9eed6; }
.notice { background: #f9eed6; color: var(--amber); padding: 12px 16px; border-radius: 9px; }

.table-wrap { overflow-x: auto; margin-inline: -6px; padding-inline: 6px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .94rem; }
th, td { text-align: left; padding: 9px 11px; vertical-align: top; overflow-wrap: anywhere; }
table small { margin-top: 3px; font-weight: 400; }
th[scope="col"] { border-bottom: 1px solid #dcdde3; color: #41434a; }
tbody tr + tr { border-top: 1px solid var(--border); }
th[scope="row"] { font-weight: 620; }
.selected-col { background: #f0f5fc; }
.plan-choice { border: 0; border-radius: 5px; background: transparent; color: #0058b4; font-weight: 720; text-decoration: underline; text-underline-offset: 3px; padding: 0; white-space: nowrap; }
.plan-choice:hover { color: #00366e; }
th .badge { margin-top: 4px; }

.timeline { margin: 5px 0 13px; font-size: .8rem; color: var(--muted); }
.timeline-axis { margin-left: 31px; display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.lane { display: grid; grid-template-columns: 31px 1fr; align-items: center; margin-top: 6px; }
.track { height: 25px; position: relative; background: repeating-linear-gradient(to right, transparent, transparent calc(25% - 1px), #e7e7eb calc(25% - 1px), #e7e7eb 25%); }
.slot { position: absolute; left: var(--start); width: var(--length); height: 100%; padding: 3px 4px; overflow: hidden; text-overflow: clip; white-space: nowrap; background: #eeeef2; color: #363740; border-left: 2px solid #777981; border-radius: 4px; }
.slot.locked { background: #e6e7eb; color: #40424a; border-color: #4d5058; }
.slot.rush { background: #e5efff; color: #0058b4; border-color: var(--blue); }
.slot.late { background: #f9eed6; color: var(--amber); border-color: #b57b27; }
.assumptions { padding-block: 13px; }
.assumptions summary { font-weight: 620; }
.assumptions dl { display: grid; grid-template-columns: minmax(90px, auto) 1fr; gap: 8px 14px; margin-top: 12px; }
.assumptions dt { font-weight: 600; }
.assumptions dd { margin: 0; color: var(--muted); }
.items { padding-left: 20px; }
.items li + li { margin-top: 7px; }
.activity { padding-left: 24px; font-variant-numeric: tabular-nums; }
.activity li { padding: 7px 0; }
.activity li + li { border-top: 1px solid var(--border); }
.versions { list-style: none; padding: 8px 0 0; }
.version { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 7px; }
.version details[open] { grid-column: 1 / -1; }

dialog { width: min(calc(100% - 30px), 560px); color: inherit; border: 1px solid var(--border); border-radius: 15px; padding: 24px; box-shadow: 0 14px 60px #2627382b; }
dialog::backdrop { background: #20212467; }
dialog h2 { margin-bottom: 16px; font-size: 1.35rem; }
dialog .actions { justify-content: flex-end; margin-top: 20px; }

@media (max-width: 740px) {
  main { gap: 14px; padding-top: 15px; }
  .workflow { flex-wrap: wrap; gap: 9px; }
  .steps { flex-basis: 100%; }
  .columns { grid-template-columns: 1fr; gap: 14px; }
  .panel { padding: 15px; }
  .top-controls { gap: 5px; }
  .top-controls .badge.blue { display: none; }
  th, td { padding: 7px 5px; font-size: .85rem; }
  table small { font-size: .77rem; }
  table .badge { font-size: .72rem; padding-inline: 4px; }
  .field-row { gap: 4px 8px; }
}

@media (max-width: 380px) {
  .form-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 66px minmax(0, 1fr); }
  .field-row > .badge { grid-column: 2; justify-self: start; }
}
