:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #687384;
  --line: #d8dee8;
  --surface: #ffffff;
  --soft: #f4f7fb;
  --blue: #2258f3;
  --blue-dark: #123bb5;
  --teal: #0f8b8d;
  --rose: #c74764;
  --amber: #a66a00;
  --shadow: 0 18px 46px rgba(25, 36, 52, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    linear-gradient(135deg, rgba(34, 88, 243, 0.13), transparent 34%),
    linear-gradient(155deg, transparent 35%, rgba(15, 139, 141, 0.12)),
    #edf2f7;
}

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

button {
  cursor: pointer;
}

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

.workspace {
  max-width: 1240px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 48px);
}

h2 {
  font-size: 20px;
}

.status-pill {
  min-width: 104px;
  padding: 9px 14px;
  border: 1px solid rgba(34, 88, 243, 0.22);
  border-radius: 999px;
  color: var(--blue-dark);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
}

.layout-grid {
  display: flex;
  gap: 18px;
  align-items: stretch;
}

.panel {
  border: 1px solid rgba(216, 222, 232, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.controls {
  display: grid;
  gap: 18px;
  padding: 22px;
  align-self: stretch;
  flex: 0.82 1 320px;
}

.field-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field-label {
  color: #2a3443;
  font-size: 14px;
  font-weight: 800;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.mode-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  color: #2a3443;
}

.mode-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.mode-toggle span::before {
  content: "普通";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 24px;
  margin-right: 8px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.mode-toggle:has(input:checked) span::before {
  content: "开启";
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

select,
input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

select,
input[type="text"],
input[type="number"] {
  height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 92px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

select:focus,
input:focus,
textarea:focus {
  border-color: rgba(34, 88, 243, 0.72);
  box-shadow: 0 0 0 3px rgba(34, 88, 243, 0.12);
}

.chip-grid {
  display: grid;
  gap: 8px;
}

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

.chip {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  text-align: center;
  font-size: 14px;
  font-weight: 750;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip:has(input:checked) {
  border-color: rgba(34, 88, 243, 0.88);
  color: #fff;
  background: var(--blue);
}

.actions,
.mini-actions,
.handoff {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-btn,
.ghost-btn,
.link-btn,
.mini-actions button {
  border-radius: 7px;
  border: 1px solid transparent;
  min-height: 42px;
  padding: 0 16px;
  font-weight: 850;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-btn {
  flex: 1 1 220px;
  color: #fff;
  background: var(--blue);
}

.primary-btn:hover {
  background: var(--blue-dark);
}

.ghost-btn,
.mini-actions button,
.link-btn {
  color: #273449;
  background: #fff;
  border-color: var(--line);
}

.ghost-btn:hover,
.mini-actions button:hover,
.link-btn:hover {
  border-color: rgba(15, 139, 141, 0.42);
  color: var(--teal);
}

.output-panel {
  align-self: stretch;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 16px;
  padding: 22px;
  min-height: 100%;
  flex: 1.18 1 460px;
}

.output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.result-box {
  min-height: 0;
  height: 100%;
  border-color: #cbd5e1;
  background: #fbfdff;
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    sans-serif;
  font-size: 15px;
}

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

  .topbar,
  .output-head {
    align-items: stretch;
    flex-direction: column;
  }

  .layout-grid {
    flex-direction: column;
  }

  .output-panel {
    position: static;
    grid-template-rows: auto minmax(360px, auto) auto;
  }

  .result-box {
    min-height: 360px;
    height: auto;
  }
}

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

  .controls,
  .output-panel {
    padding: 16px;
  }

  .topbar {
    gap: 12px;
  }

  h1 {
    font-size: 28px;
  }

  .status-pill {
    width: 100%;
  }

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

  .output-head {
    gap: 10px;
  }

  .mini-actions,
  .handoff,
  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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

  .mini-actions button,
  .handoff .link-btn,
  .ghost-btn {
    width: 100%;
  }

  .result-box {
    min-height: 320px;
    font-size: 14px;
  }
}
