:root {
  color-scheme: light;
  --bg: #eef2f6;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #172033;
  --muted: #657083;
  --line: #d9e1ea;
  --accent: #126bff;
  --accent-dark: #0d53c8;
  --danger-bg: #fff2e8;
  --danger: #ad4e00;
  font-family: "Inter", "SF Pro Text", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}

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

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

.page-head {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  line-height: 36px;
}

h2 {
  margin-bottom: 14px;
  font-size: 16px;
  line-height: 24px;
}

h3 {
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mode-panel {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  margin-bottom: 16px;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.72fr);
  gap: 16px;
  align-items: start;
}

.form-panel,
.preview-panel {
  padding: 18px;
}

.preview-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  margin-bottom: 14px;
}

.muted-note {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.field > span,
.field > label,
.field label {
  color: #2c3748;
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  background: #fff;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  outline: none;
}

textarea {
  min-height: 156px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 20px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 107, 255, 0.12);
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 4px;
  padding: 4px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segment,
.primary-btn,
.ghost-btn {
  min-height: 36px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
}

.segment {
  color: var(--muted);
  background: transparent;
  border: 0;
}

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

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

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

.ghost-btn {
  color: var(--accent);
  background: #fff;
  border: 1px solid #b9cdf7;
}

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

pre {
  min-height: 120px;
  padding: 12px;
  overflow: auto;
  color: #dbe8ff;
  font-size: 12px;
  line-height: 18px;
  background: #172033;
  border-radius: 6px;
}

.file-list {
  padding: 0;
  margin: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.file-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}

.file-list li:last-child {
  border-bottom: 0;
}

.warnings {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.warning {
  padding: 9px 10px;
  color: var(--danger);
  font-size: 12px;
  line-height: 18px;
  background: var(--danger-bg);
  border: 1px solid #ffd8bf;
  border-radius: 6px;
}

.hidden {
  display: none !important;
}

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

  .page-head,
  .mode-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .content-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
    max-height: none;
  }
}

