:root {
  --bg: #f5fafb;
  --surface: #ffffff;
  --surface-soft: #f8fcfd;
  --line: #dfeaed;
  --line-strong: #cfdde2;
  --text: #1c2b34;
  --muted: #6f7f89;
  --accent: #1aa6ad;
  --accent-deep: #127f89;
  --blue: #2f80ed;
  --shadow: 0 20px 50px rgba(34, 74, 92, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 1080px;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(26, 166, 173, 0.12), rgba(255, 255, 255, 0) 35%),
    linear-gradient(180deg, #f8fcfd 0%, var(--bg) 100%);
  font-family: "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 42px 0 56px;
}

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

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
.subtitle {
  margin: 0;
}

h1 {
  font-size: 34px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
}

h3 {
  font-size: 17px;
}

.subtitle {
  margin-top: 12px;
  color: var(--muted);
  font-size: 15px;
}

.status-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid rgba(26, 166, 173, 0.18);
  border-radius: 999px;
  background: #eafbfa;
  color: var(--accent-deep);
  font-size: 14px;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #33caa8;
  box-shadow: 0 0 0 6px rgba(51, 202, 168, 0.15);
}

.layout {
  display: grid;
  grid-template-columns: 410px 1fr;
  gap: 22px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.form-panel,
.result-panel {
  padding: 24px;
}

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

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field input {
  height: 46px;
}

.field textarea {
  min-height: 136px;
  padding-top: 12px;
  padding-bottom: 12px;
  line-height: 1.55;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(26, 166, 173, 0.75);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(26, 166, 173, 0.1);
}

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

.helper {
  display: grid;
  gap: 6px;
  margin: 4px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, #f5fcfd 0%, #ffffff 100%);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.helper strong {
  color: var(--accent-deep);
}

.form-divider {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}

.subsection-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.subsection-title.compact {
  margin-top: 24px;
}

.toggle-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(26, 166, 173, 0.18);
  border-radius: 999px;
  background: #eafbfa;
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 800;
}

.toggle-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary-button,
.secondary-button,
.text-button {
  height: 44px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.primary-button {
  background: linear-gradient(135deg, #22bdc4 0%, var(--blue) 100%);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(47, 128, 237, 0.18);
}

.secondary-button {
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--accent-deep);
}

.text-button {
  height: 34px;
  padding: 0 12px;
  border-color: var(--line);
  background: #ffffff;
  color: var(--muted);
}

.primary-button:hover,
.secondary-button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.summary-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.summary-grid span,
.summary-grid strong {
  display: block;
}

.summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.summary-grid strong {
  margin-top: 8px;
  font-size: 15px;
}

.count-badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(47, 128, 237, 0.08);
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.result-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.preview-section {
  margin-top: 26px;
  padding-top: 2px;
}

.structure-summary {
  grid-template-columns: 1fr 1fr 1fr;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

th {
  background: #f5fafb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td strong {
  color: var(--text);
  font-size: 18px;
}

.custom-input,
.structure-custom-input {
  width: 132px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
}

.custom-input:focus,
.structure-custom-input:focus {
  border-color: rgba(26, 166, 173, 0.75);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(26, 166, 173, 0.1);
}

.source-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf7ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.source-tag.custom {
  background: #eafbfa;
  color: var(--accent-deep);
}

tr:last-child td {
  border-bottom: none;
}

.empty-cell {
  height: 180px;
  color: var(--muted);
  text-align: center;
}

.empty-cell.compact {
  height: 110px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(16px);
  min-width: 240px;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(28, 43, 52, 0.92);
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
