:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #687385;
  --line: #d9dee7;
  --paper: #fbfaf8;
  --surface: #ffffff;
  --accent: #1f7a65;
  --accent-strong: #145c4b;
  --warn: #b45309;
  --danger: #a33a3a;
  --soft: #eef7f4;
  --shadow: 0 18px 45px rgba(31, 41, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  max-width: 1180px;
  min-height: calc(100vh - 48px);
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 32px;
  border-right: 1px solid var(--line);
  background: #f5f3ef;
}

.eyebrow,
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--accent-strong);
  flex: 0 0 20px;
  text-decoration: none;
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.brand-mark:hover,
.brand-mark:focus-visible {
  color: var(--accent);
  outline: 2px solid rgba(31, 122, 101, 0.2);
  outline-offset: 3px;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.intro,
.help,
.status-card p,
.muted {
  color: var(--muted);
  line-height: 1.65;
}

.status-card {
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.status-card span {
  display: block;
  margin-bottom: 12px;
  font-weight: 700;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: #e5e1da;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

.steps {
  display: grid;
  gap: 8px;
}

.step-dot {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.step-dot::before {
  content: attr(data-index);
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.step-dot.active,
.step-dot.done {
  color: var(--ink);
  font-weight: 700;
}

.step-dot.active::before,
.step-dot.done::before {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.panel {
  padding: 34px;
}

.notice {
  margin-bottom: 24px;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  background: var(--soft);
  line-height: 1.7;
}

.question-form {
  display: grid;
  gap: 28px;
}

.question-body {
  display: grid;
  gap: 14px;
}

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

.option {
  display: flex;
  gap: 12px;
  min-height: 78px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.option:hover {
  border-color: var(--accent);
}

.option input {
  margin-top: 4px;
  accent-color: var(--accent);
}

.option strong {
  display: block;
  margin-bottom: 5px;
}

.option span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

button {
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.primary:hover {
  background: var(--accent-strong);
}

.ghost {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.result {
  display: grid;
  gap: 18px;
}

.output-section {
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.situation-section {
  display: grid;
  gap: 18px;
  padding: 0;
  border: 0;
  background: transparent;
}

.hidden {
  display: none;
}

.result-hero {
  padding: 22px;
  background: #10231e;
  color: #fff;
}

.result-hero p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.card {
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.card small {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
}

.card strong {
  font-size: 20px;
}

.situation-cards .card strong {
  font-size: 17px;
  line-height: 1.35;
}

.tax-note {
  margin: -6px 0 0;
  padding: 12px 14px;
  border-left: 3px solid #d5a669;
  background: #fffaf3;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.scope-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: #f3faf7;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.signed-result {
  display: grid;
  gap: 18px;
  padding: 0;
  border: 0;
  background: transparent;
}

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

.checklist-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.checklist-item > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  background: var(--soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.checklist-item h3 {
  margin-bottom: 6px;
}

.checklist-item p,
.signed-note {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.signed-note {
  padding: 13px 15px;
  border-left: 3px solid var(--accent);
  background: var(--soft);
}

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

.path {
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
  line-height: 1.65;
}

.path.recommended {
  border-color: var(--accent);
  background: var(--soft);
}

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

.action-card {
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.action-card .kicker {
  margin-bottom: 6px;
}

.dont-card {
  border-color: #e5b37e;
  background: #fffaf3;
}

.target-card {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  background: #f9fbfa;
}

.target-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.section-title {
  margin-bottom: 14px;
}

.section-title h3 {
  margin-bottom: 0;
}

.focus-section {
  padding: 18px;
  border: 1px solid #b9d9ce;
  background: #f3faf7;
}

.critical-alerts {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.critical-alerts .kicker {
  margin-bottom: 0;
}

.critical-alert {
  padding: 14px 16px;
  border: 1px solid #e2b97f;
  border-left-width: 4px;
  background: #fffaf3;
}

.critical-alert.red {
  border-color: #d58a79;
  background: #fff6f4;
}

.critical-alert h3 {
  margin-bottom: 4px;
  font-size: 16px;
}

.critical-alert p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.focus-item {
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
  line-height: 1.65;
}

.focus-item.urgent {
  border-color: #e0a06e;
  background: #fffaf3;
}

.focus-item span {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 8px;
  background: var(--soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.focus-item.urgent span {
  background: #fdebd3;
  color: var(--warn);
}

.focus-item h3 {
  margin-bottom: 6px;
}

.focus-item p {
  margin-bottom: 0;
  color: var(--muted);
}

.warning-card {
  border-color: #e5b37e;
  background: #fffaf3;
}

.pressure-card {
  border-color: #d7a0a0;
  background: #fff7f7;
}

.list {
  display: grid;
  gap: 10px;
  padding-left: 18px;
  line-height: 1.7;
}

.script-box {
  padding: 16px;
  border: 1px dashed var(--accent);
  background: #fbfdfc;
  line-height: 1.8;
}

.qa-card {
  background: #fbfbfa;
}

.qa-item {
  border-top: 1px solid var(--line);
}

.qa-item summary {
  padding: 14px 0;
  cursor: pointer;
  font-weight: 800;
}

.qa-item p {
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.75;
}

.details-stack {
  display: grid;
  gap: 8px;
}

.result-detail {
  border: 1px solid var(--line);
  background: #fff;
}

.result-detail summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 800;
}

.detail-body {
  padding: 0 16px 16px;
}

.detail-body h3:not(:first-child) {
  margin-top: 20px;
}

.copy-button {
  width: 100%;
  margin-top: 12px;
}

.risk-strong {
  color: var(--danger);
}

.risk-mid {
  color: var(--warn);
}

@media (max-width: 860px) {
  .app-shell {
    padding: 0;
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: 100vh;
    border: 0;
  }

  .rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .panel {
    padding: 22px;
  }

  h1 {
    font-size: 34px;
  }

  h2 {
    font-size: 24px;
  }

  .card,
  .path,
  .notice,
  .status-card {
    padding: 16px;
  }

  .card strong {
    overflow-wrap: anywhere;
  }

  .option-grid,
  .field-grid,
  .cards,
  .path-grid,
  .focus-grid,
  .action-grid,
  .signed-checklist,
  .target-card {
    grid-template-columns: 1fr;
  }
}
