:root {
  color-scheme: light;
  --bg: #f0efea;
  --surface: #fffdf7;
  --surface-2: #f6f2e9;
  --ink: #101614;
  --text: #26322e;
  --muted: #65716b;
  --line: #d9d0c2;
  --accent: #127263;
  --accent-strong: #0b5d50;
  --accent-soft: #e3f0ea;
  --warning: #9b5a15;
  --success: #0f7b56;
  --danger: #a13e33;
  --shadow: 0 18px 58px rgba(16, 22, 20, 0.1);
  --radius: 14px;
  --radius-sm: 8px;
  font-family: "MiSans", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(16, 22, 20, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(16, 22, 20, 0.03) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px, 44px 44px, auto;
  color: var(--ink);
  font-size: 15px;
}

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

button {
  cursor: pointer;
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: 16px;
  top: -56px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { top: 16px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 72px;
  padding: 14px max(18px, calc((100vw - 1320px) / 2));
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  background: rgba(246, 242, 233, 0.88);
  border-bottom: 1px solid rgba(217, 208, 194, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--ink);
  color: #f5f0e7;
  font-weight: 900;
  letter-spacing: 0;
}

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

.brand strong {
  font-size: 17px;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.app-header nav {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.app-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.app-header nav a:hover,
.app-header nav a:focus-visible {
  color: var(--ink);
  outline: none;
}

.header-status {
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.74);
  color: var(--text);
  font-weight: 800;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(155, 90, 21, 0.12);
}

main {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero-panel,
.workspace-shell,
.feedback-section {
  border: 1px solid rgba(217, 208, 194, 0.86);
  background: rgba(255, 253, 247, 0.9);
  box-shadow: var(--shadow);
}

.hero-panel {
  min-height: 270px;
  padding: clamp(24px, 4vw, 46px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: end;
  border-radius: 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 16%, rgba(18, 114, 99, 0.16), transparent 28%),
    linear-gradient(135deg, rgba(255, 253, 247, 0.96), rgba(246, 242, 233, 0.9));
}

.surface-label {
  width: fit-content;
  margin: 0 0 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: 46px;
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 68ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.service-card {
  padding: 22px;
  border: 1px solid rgba(217, 208, 194, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.9);
}

.service-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.service-card strong {
  display: block;
  margin-top: 6px;
  color: var(--warning);
  font-size: 26px;
}

.service-card p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.workspace-shell {
  margin-top: 18px;
  min-height: 720px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 390px;
  border-radius: 20px;
  overflow: hidden;
}

.workflow-nav,
.task-panel,
.result-panel {
  min-width: 0;
  padding: 24px;
}

.workflow-nav {
  background: #111916;
  color: #f4efe6;
}

.nav-head h2,
.task-head h2,
.result-head h2,
.feedback-section h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
}

.workflow-nav .surface-label {
  background: rgba(255, 255, 255, 0.08);
  color: #d6eee5;
}

.category-tabs {
  margin: 20px 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-tab {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: transparent;
  color: rgba(244, 239, 230, 0.74);
  font-weight: 800;
}

.category-tab.active {
  background: #f4efe6;
  color: var(--ink);
}

.workflow-list {
  display: grid;
  gap: 10px;
}

.workflow-item {
  width: 100%;
  padding: 14px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #f4efe6;
}

.workflow-item:hover,
.workflow-item:focus-visible {
  border-color: rgba(255, 255, 255, 0.34);
  outline: none;
}

.workflow-item.active {
  background: #f4efe6;
  color: var(--ink);
}

.workflow-item strong,
.workflow-item span {
  display: block;
}

.workflow-item strong {
  font-size: 16px;
}

.workflow-item span {
  margin-top: 6px;
  color: currentColor;
  opacity: 0.68;
  font-size: 12px;
}

.workflow-mode {
  display: inline-flex;
  margin-top: 10px;
  padding: 4px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: currentColor;
  opacity: 0.84;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.task-panel {
  border-right: 1px solid var(--line);
}

.task-head,
.result-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.task-head p,
.feedback-section p {
  max-width: 66ch;
  color: var(--muted);
  line-height: 1.72;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 900;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffefa;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  min-height: 118px;
  resize: vertical;
  padding: 12px;
  line-height: 1.65;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(18, 114, 99, 0.12);
}

::placeholder {
  color: #6b756f;
  opacity: 1;
}

.field-help {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.action-row,
.result-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 44px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: 900;
  text-decoration: none;
}

.primary-button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--accent-strong);
  outline: 3px solid rgba(18, 114, 99, 0.18);
  outline-offset: 2px;
}

.primary-button:disabled {
  cursor: wait;
  background: #67827b;
  border-color: #67827b;
  opacity: 0.86;
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--line);
  background: #fffefa;
  color: var(--text);
}

.secondary-button:hover,
.secondary-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  outline: none;
}

.form-note {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.result-panel {
  background: var(--surface-2);
}

.result-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(155, 90, 21, 0.11);
  color: var(--warning);
  font-size: 12px;
  font-weight: 900;
}

.result-output {
  min-height: 450px;
  max-height: 610px;
  margin: 18px 0 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid rgba(22, 32, 28, 0.12);
  border-radius: var(--radius);
  background: #101614;
  color: #e8f4ee;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.75;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
}

.empty-state {
  min-height: 28px;
  margin-top: 12px;
  color: var(--success);
  font-weight: 800;
}

.feedback-section {
  margin-top: 18px;
  padding: 28px;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 26px;
  border-radius: 20px;
}

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

.feedback-form button {
  width: fit-content;
}

.feedback-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  button,
  a,
  input,
  textarea,
  select,
  .workflow-item {
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  }
  .primary-button:active,
  .secondary-button:active,
  .ghost-button:active,
  .workflow-item:active {
    transform: translateY(1px);
  }
}

@media (max-width: 1180px) {
  .workspace-shell {
    grid-template-columns: 280px minmax(0, 1fr);
  }
  .result-panel {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }
  .result-output {
    min-height: 260px;
  }
}

@media (max-width: 820px) {
  .app-header {
    position: static;
    grid-template-columns: 1fr;
    align-items: start;
  }
  .app-header nav {
    justify-content: start;
  }
  .hero-panel,
  .workspace-shell,
  .feedback-section {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 34px;
  }
  .workflow-nav {
    max-height: none;
  }
  .task-panel {
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .field-grid,
  .feedback-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  main {
    width: min(100% - 18px, 1320px);
    padding-top: 12px;
  }
  .hero-panel,
  .workflow-nav,
  .task-panel,
  .result-panel,
  .feedback-section {
    padding: 18px;
  }
  .task-head,
  .result-head {
    display: grid;
  }
  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }
}
