:root {
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-2: #eef5f2;
  --ink: #17211f;
  --muted: #5f6f6b;
  --line: #d8e3de;
  --green: #2f7d57;
  --green-dark: #14533a;
  --blue: #2e6ea6;
  --amber: #ba7a18;
  --red: #b34c4c;
  --shadow: 0 18px 45px rgba(23, 33, 31, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(244, 247, 245, 0.96)),
    radial-gradient(circle at top left, rgba(47, 125, 87, 0.12), transparent 35%),
    var(--bg);
  color: var(--ink);
  font-family:
    "Noto Sans TC",
    "Microsoft JhengHei",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 12px clamp(18px, 4vw, 54px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: var(--green-dark);
  border-radius: 8px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  line-height: 1.25;
}

.brand small {
  color: var(--muted);
  font-size: 0.82rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.94rem;
}

.topnav a {
  padding: 8px 10px;
  border-radius: 6px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.topnav a:hover,
.topnav a:focus-visible,
.topnav a.is-active {
  color: var(--green-dark);
  background: var(--surface-2);
  outline: none;
}

.topnav a.is-active {
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.backend-menu {
  position: relative;
}

.backend-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--green-dark);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
}

.backend-menu summary::-webkit-details-marker {
  display: none;
}

.backend-menu summary:hover,
.backend-menu summary:focus-visible,
.backend-menu[open] summary {
  background: var(--surface-2);
  outline: none;
}

.backend-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  min-width: 280px;
  max-height: min(70vh, 620px);
  overflow-y: auto;
  padding: 8px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(20, 32, 29, 0.16);
}

.backend-menu-group {
  padding: 9px 11px 5px;
  color: var(--green-dark);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.backend-menu-panel a {
  padding: 10px 11px;
  color: var(--ink);
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}

.backend-menu-panel a:hover,
.backend-menu-panel a:focus-visible {
  color: var(--green-dark);
  background: var(--surface-2);
  outline: none;
}

main {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
}

.workspace-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 1.05fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  min-height: calc(100vh - 72px);
  padding: clamp(30px, 5vw, 72px) 0 clamp(26px, 4vw, 48px);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: clamp(8px, 1.6vw, 20px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(2rem, 4vw, 4.35rem);
  line-height: 1.16;
  letter-spacing: 0;
}

.hero-copy p:last-child {
  max-width: 710px;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.9;
}

.hero-console {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 540px;
  overflow: hidden;
  background: #0f1a17;
  border: 1px solid #22322f;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.console-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 0 18px;
  color: #c8d8d3;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.console-header strong {
  margin-left: auto;
  color: #fff;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: #47d18c;
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(71, 209, 140, 0.15);
}

.hud-preview {
  position: relative;
  min-height: 360px;
  background:
    linear-gradient(rgba(31, 71, 62, 0.42), rgba(13, 24, 22, 0.74)),
    url("fiddle-leaf-fig.jpg") center 38% / cover no-repeat;
}

.hud-preview::after {
  content: "";
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(148, 227, 196, 0.35);
  pointer-events: none;
}

.hud-reticle {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 118px;
  height: 84px;
  border: 2px solid #73e1ad;
  transform: translate(-50%, -50%);
}

.hud-reticle::before,
.hud-reticle::after {
  content: "";
  position: absolute;
  background: #73e1ad;
}

.hud-reticle::before {
  top: 50%;
  left: -28px;
  width: 174px;
  height: 2px;
}

.hud-reticle::after {
  top: -28px;
  left: 50%;
  width: 2px;
  height: 140px;
}

.hud-box {
  position: absolute;
  right: 34px;
  bottom: 92px;
  display: grid;
  gap: 2px;
  min-width: 178px;
  padding: 14px 16px;
  color: #dcfff0;
  background: rgba(20, 83, 58, 0.78);
  border: 1px solid rgba(115, 225, 173, 0.66);
  border-radius: 6px;
}

.hud-box strong {
  font-size: 2rem;
  line-height: 1;
}

.hud-line {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 28px;
  padding: 12px 14px;
  color: #f1fff9;
  background: rgba(0, 0, 0, 0.5);
  border-left: 4px solid #73e1ad;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.telemetry-grid span {
  display: grid;
  gap: 4px;
  padding: 16px;
  color: #b7c9c3;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.86rem;
}

.telemetry-grid span:last-child {
  border-right: 0;
}

.telemetry-grid b {
  color: #fff;
  font-size: 1.08rem;
}

.kpi-strip,
.section-grid,
.timeline-section,
.operations-section,
.reference-figure {
  margin: 24px 0;
}

.development-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: clamp(18px, 4vw, 48px);
  align-items: end;
  padding: clamp(34px, 6vw, 82px) 0 24px;
}

.development-hero h1 {
  margin-bottom: 16px;
}

.development-hero p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.85;
}

.progress-summary,
.development-column {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(23, 33, 31, 0.06);
}

.progress-summary {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.progress-summary span,
.progress-summary small {
  color: var(--muted);
}

.progress-summary strong {
  color: var(--green-dark);
  font-size: 2rem;
  line-height: 1;
}

.progress-meter {
  height: 12px;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 999px;
}

.progress-meter span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
}

.development-kpis {
  margin-top: 0;
}

.development-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.development-column {
  padding: 20px;
}

.development-column h3 {
  margin-bottom: 12px;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.kpi-strip article {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23, 33, 31, 0.05);
}

.kpi-strip span,
.kpi-strip small {
  display: block;
  color: var(--muted);
}

.kpi-strip strong {
  display: block;
  margin: 7px 0;
  color: var(--green-dark);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(230px, 0.72fr) minmax(440px, 1.45fr) minmax(300px, 0.88fr);
  gap: 18px;
  align-items: start;
  padding-top: 54px;
}

.section-heading h2,
.timeline-section h2,
.operations-section h2,
.reference-figure h2 {
  margin-bottom: 12px;
  font-size: clamp(1.6rem, 2.8vw, 2.5rem);
  line-height: 1.18;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.8;
}

.architecture-board,
.detail-panel,
.flow-card,
.phase-detail,
.ops-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(23, 33, 31, 0.06);
}

.architecture-board {
  overflow: hidden;
}

.layer-row {
  display: grid;
  grid-template-columns: 54px minmax(150px, 0.8fr) minmax(240px, 1.2fr);
  width: 100%;
  min-height: 84px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}

.layer-row:last-child {
  border-bottom: 0;
}

.layer-row span {
  display: flex;
  align-items: center;
  padding: 16px;
}

.layer-index {
  justify-content: center;
  color: var(--green);
  font-weight: 800;
  border-right: 1px solid var(--line);
}

.layer-title {
  font-weight: 800;
}

.layer-nodes {
  color: var(--muted);
  line-height: 1.55;
}

.layer-row:hover,
.layer-row:focus-visible,
.layer-row.is-active {
  background: var(--surface-2);
  outline: none;
}

.layer-row.is-active .layer-index {
  color: #fff;
  background: var(--green-dark);
}

.detail-panel {
  padding: 22px;
  position: sticky;
  top: 96px;
}

.detail-panel h3 {
  margin-bottom: 10px;
  font-size: 1.55rem;
}

.detail-panel p {
  color: var(--muted);
  line-height: 1.75;
}

.detail-list {
  display: grid;
  gap: 14px;
  margin: 20px 0 0;
}

.detail-list div {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-list dt {
  margin-bottom: 5px;
  color: var(--green-dark);
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.reference-figure {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.reference-figure img {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 10px;
  border: 1px solid var(--line);
}

.flow-section {
  grid-template-columns: minmax(230px, 0.72fr) minmax(440px, 1.25fr) minmax(290px, 0.92fr);
}

.flow-card {
  overflow: hidden;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--line);
}

.flow-step {
  min-height: 70px;
  padding: 12px;
  color: var(--muted);
  background: #fff;
  border: 0;
  border-right: 1px solid var(--line);
  font-weight: 700;
  cursor: pointer;
}

.flow-step:last-child {
  border-right: 0;
}

.flow-step:hover,
.flow-step:focus-visible,
.flow-step.is-active {
  color: #fff;
  background: var(--blue);
  outline: none;
}

.flow-detail {
  min-height: 270px;
  padding: 26px;
}

.flow-badge {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 6px 10px;
  color: #fff;
  background: var(--green-dark);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 800;
}

.flow-detail h3 {
  margin-bottom: 12px;
  font-size: 1.7rem;
}

.flow-detail p {
  color: var(--muted);
  line-height: 1.85;
}

.decision-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 24px;
  padding: 14px;
  background: var(--surface-2);
  border-left: 4px solid var(--amber);
}

.decision-line span {
  color: var(--muted);
}

.decision-line strong {
  color: var(--amber);
}

.reference-figure.compact {
  padding: 12px;
}

.reference-figure.compact img {
  margin: 0;
}

.timeline-section,
.operations-section {
  padding-top: 54px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(24, minmax(32px, 1fr));
  gap: 12px 4px;
  align-items: center;
  margin: 24px 0 16px;
  padding: 18px 14px;
  overflow-x: auto;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent calc((100% / 24) - 1px),
      rgba(47, 125, 87, 0.18) calc((100% / 24) - 1px),
      rgba(47, 125, 87, 0.18) calc(100% / 24)
    ),
    rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.phase {
  grid-column: var(--start) / span var(--span);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  min-width: 240px;
  min-height: 62px;
  padding: 10px 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(23, 33, 31, 0.06);
  cursor: pointer;
}

.phase:nth-child(1) {
  grid-row: 1;
}

.phase:nth-child(2) {
  grid-row: 2;
}

.phase:nth-child(3) {
  grid-row: 3;
}

.phase:nth-child(4) {
  grid-row: 4;
}

.phase:nth-child(5) {
  grid-row: 5;
}

.phase:nth-child(6) {
  grid-row: 6;
}

.phase:nth-child(7) {
  grid-row: 7;
}

.phase span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--green-dark);
  border-radius: 6px;
  font-weight: 800;
}

.phase small {
  color: var(--muted);
  font-weight: 800;
}

.phase:hover,
.phase:focus-visible,
.phase.is-active {
  border-color: var(--green);
  background: var(--surface-2);
  outline: none;
}

.phase-detail {
  padding: 20px;
}

.phase-detail strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.phase-detail p {
  color: var(--muted);
  line-height: 1.8;
}

.phase-detail span {
  color: var(--green-dark);
  font-weight: 800;
}

.ops-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.9fr 1fr;
  gap: 18px;
}

.ops-panel {
  padding: 20px;
}

.ops-panel h3 {
  margin-bottom: 14px;
}

.queue-item {
  display: grid;
  gap: 5px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.queue-item span {
  width: fit-content;
  padding: 4px 8px;
  color: #fff;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 800;
}

.queue-item small {
  color: var(--muted);
}

.queue-item.high span {
  background: var(--red);
}

.queue-item.medium span {
  background: var(--amber);
}

.queue-item.low span {
  background: var(--blue);
}

.heatmap {
  position: relative;
  height: 250px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.8) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(rgba(255, 255, 255, 0.8) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(135deg, #d8ebe4, #edf4f8);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.heatmap::before {
  content: "Field risk map";
  position: absolute;
  left: 14px;
  top: 12px;
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.heatmap span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(46px * var(--s));
  height: calc(46px * var(--s));
  background: rgba(179, 76, 76, 0.68);
  border: 8px solid rgba(179, 76, 76, 0.2);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 16px rgba(186, 122, 24, 0.16);
}

.heatmap-panel p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.risk-list {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.risk-list li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.risk-list strong {
  color: var(--green-dark);
}

.risk-list span {
  color: var(--muted);
  line-height: 1.6;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1440px, calc(100% - 32px));
  margin: 48px auto 0;
  padding: 24px 0 36px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.footer a {
  color: var(--green-dark);
  font-weight: 800;
}

@media (max-width: 1120px) {
  .workspace-hero,
  .section-grid,
  .ops-grid,
  .development-hero,
  .development-board {
    grid-template-columns: 1fr;
  }

  .workspace-hero {
    min-height: auto;
  }

  .detail-panel {
    position: static;
  }

  .reference-figure.compact {
    max-height: 720px;
    overflow: auto;
  }
}

@media (max-width: 760px) {
  main,
  .footer {
    width: min(100% - 20px, 1440px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    padding-bottom: 2px;
  }

  .topnav a {
    min-width: 0;
    text-align: center;
  }

  .header-actions {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
  }

  .backend-menu {
    width: 100%;
  }

  .backend-menu summary {
    justify-content: center;
    width: 100%;
  }

  .backend-menu-panel {
    right: auto;
    left: 0;
    width: min(100%, 360px);
    max-height: 58vh;
  }

  .workspace-hero {
    padding-top: 24px;
  }

  .hero-console {
    min-height: 470px;
  }

  .telemetry-grid,
  .kpi-strip,
  .flow-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .layer-row {
    grid-template-columns: 46px 1fr;
  }

  .layer-nodes {
    grid-column: 2;
    padding-top: 0;
  }

  .decision-line {
    grid-template-columns: 1fr;
  }

  .footer {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 2rem;
  }

  .topnav {
    gap: 6px;
    font-size: 0.88rem;
  }

  .hud-preview {
    min-height: 320px;
  }

  .hud-box {
    right: 20px;
    bottom: 88px;
  }

  .telemetry-grid,
  .kpi-strip,
  .flow-steps {
    grid-template-columns: 1fr;
  }

  .flow-step {
    min-height: 52px;
  }

  .risk-list li {
    grid-template-columns: 1fr;
  }
}
