:root {
  color-scheme: light;
  --paper: #f3efe6;
  --ink: #282c33;
  --muted: #6f6558;
  --blue: #2148b8;
  --red: #d95b2b;
  --line: #2c3138;
  --soft-line: #c8bdac;
  --panel: #fffdf7;
  --wash: #e9dfcf;
  --shadow: 8px 8px 0 rgba(44, 49, 56, 0.18);
  font-family: "Inter", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
}

body {
  overflow-x: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(40, 44, 51, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 44, 51, 0.025) 1px, transparent 1px);
  background-size: 22px 22px;
}

.demo-shell {
  width: min(1680px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.demo-controls {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 3px solid var(--line);
  background: rgba(255, 253, 247, 0.94);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.demo-controls p {
  margin-bottom: 0;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1,
h2,
h3,
p,
strong {
  overflow-wrap: anywhere;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
  font-size: clamp(42px, 7vw, 96px);
  line-height: 0.88;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", "Noto Serif TC", serif;
  font-size: 34px;
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

p,
li {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

button {
  border: 3px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.lang-toggle,
.secondary-action {
  min-height: 44px;
  padding: 8px 16px;
  background: var(--panel);
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: 168px minmax(340px, 0.72fr) minmax(620px, 1.28fr);
  gap: 14px;
  align-items: stretch;
}

.timeline,
.main-panel,
.brief-panel {
  border: 3px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.timeline {
  padding: 14px;
}

.rail-label {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.step {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 8px;
  text-align: left;
  background: var(--paper);
}

.step span {
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 900;
}

.step strong {
  font-size: 14px;
}

.step.is-active {
  background: var(--blue);
  color: #fffdf7;
}

.step.is-active span,
.step.is-active strong {
  color: #fffdf7;
}

.main-panel,
.brief-panel {
  min-width: 0;
  padding: 20px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.demo-status {
  align-self: flex-start;
  border: 3px solid var(--blue);
  color: var(--blue);
  padding: 8px 12px;
  font-weight: 900;
  white-space: nowrap;
}

.input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.mode-option {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 14px;
  text-align: left;
  background: var(--paper);
}

.mode-option strong {
  font-size: 17px;
}

.mode-option span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mode-option.is-selected {
  border-color: var(--blue);
  background: #f9f5ea;
  box-shadow: inset 0 0 0 3px rgba(33, 72, 184, 0.12);
}

.mode-summary {
  margin: 0 0 14px;
  padding: 14px;
  border: 3px solid var(--blue);
  background: #fffbf1;
}

.mode-summary span {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.mode-summary strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 18px;
}

.mode-summary p {
  margin-bottom: 0;
}

.upload-card {
  min-height: auto;
  border: 3px solid var(--line);
  background: var(--paper);
  padding: 16px;
}

.upload-card.accent {
  background: #faf7ee;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.file-type {
  display: inline-grid;
  place-items: center;
  min-width: 54px;
  min-height: 42px;
  border: 3px solid var(--blue);
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.waveform {
  height: 72px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 7px;
  margin-top: 18px;
  padding: 12px;
  border: 3px solid var(--soft-line);
  background: #fffbf1;
}

.waveform span {
  height: var(--h);
  min-height: 12px;
  background: var(--blue);
}

ul {
  margin: 18px 0 0;
  padding-left: 20px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.primary-action {
  min-height: 52px;
  padding: 12px 22px;
  background: var(--blue);
  color: #fffdf7;
  font-weight: 900;
}

.secondary-action {
  min-height: 52px;
}

.process-board {
  display: grid;
  gap: 10px;
}

.process-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  padding: 14px;
  border: 2px solid var(--soft-line);
  background: #faf7ee;
}

.process-item strong {
  font-size: 17px;
}

.process-dot {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  border: 3px solid var(--line);
  background: var(--paper);
}

.process-item.is-done {
  border-color: var(--blue);
}

.process-item.is-done .process-dot {
  background: var(--blue);
}

.process-item.is-running {
  border-color: var(--red);
}

.process-item.is-running .process-dot {
  background: var(--red);
}

.brief-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brief-head {
  padding-bottom: 16px;
  border-bottom: 3px solid var(--line);
}

.record-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  align-items: center;
  border: 3px solid var(--line);
  background: var(--paper);
  padding: 14px;
}

.date-block {
  display: grid;
  place-items: center;
  min-height: 78px;
  border: 3px solid var(--line);
  color: var(--blue);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 900;
  line-height: 0.9;
}

.date-block small {
  color: var(--muted);
  font-size: 15px;
}

.brief-output {
  border: 3px solid var(--line);
  background: #fffbf1;
  padding: 18px;
  min-height: 560px;
  overflow: auto;
}

.brief-output h3 {
  margin-top: 22px;
  color: var(--blue);
  font-size: 22px;
}

.brief-output h3:first-child {
  margin-top: 0;
}

.brief-output strong {
  color: var(--ink);
}

.brief-output .signal {
  border-left: 5px solid var(--red);
  padding-left: 12px;
  margin: 14px 0;
}

.brief-output .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.brief-output .tag {
  border: 2px solid var(--soft-line);
  padding: 6px 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.workflow-list,
.pm-table,
.fit-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0 18px;
}

.workflow-list div,
.pm-table div,
.fit-grid div,
.op-card {
  border: 2px solid var(--soft-line);
  background: var(--panel);
  padding: 12px;
}

.workflow-list strong,
.pm-table strong,
.fit-grid strong,
.op-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.pm-table span {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.op-card {
  margin: 10px 0;
}

.op-card p,
.workflow-list p,
.pm-table p,
.fit-grid p {
  margin-bottom: 0;
}

.fit-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 154px minmax(0, 1fr);
  }

  .brief-panel {
    grid-column: 1 / -1;
  }

  .brief-output {
    min-height: 480px;
  }
}

@media (max-width: 760px) {
  .demo-shell {
    width: min(100% - 20px, 620px);
    padding-top: 14px;
  }

  .topbar,
  .panel-head,
  .demo-controls {
    flex-direction: column;
    align-items: stretch;
  }

  h1 {
    font-size: 44px;
    line-height: 0.96;
  }

  h2 {
    font-size: 24px;
  }

  .workspace,
  .input-grid,
  .mode-switch {
    grid-template-columns: 1fr;
  }

  .timeline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .rail-label {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }

  .step {
    margin: 0;
    grid-template-columns: 1fr;
  }

  .main-panel,
  .brief-panel {
    padding: 16px;
  }

  .demo-controls {
    top: 8px;
  }

  .fit-grid {
    grid-template-columns: 1fr;
  }

  .record-card {
    grid-template-columns: 74px 1fr;
  }
}
