﻿:root {
  --bg: #f4efe6;
  --bg-deep: #eadfcf;
  --panel: rgba(255, 250, 242, 0.82);
  --panel-strong: rgba(255, 252, 247, 0.94);
  --ink: #231a14;
  --subtle: #6a5446;
  --line: rgba(78, 47, 29, 0.12);
  --accent: #cf5b2a;
  --accent-strong: #a2431b;
  --accent-soft: rgba(207, 91, 42, 0.12);
  --danger: #b6402a;
  --shadow: 0 18px 60px rgba(51, 28, 12, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 221, 180, 0.75), transparent 28%),
    linear-gradient(145deg, #f9f3eb, var(--bg) 52%, var(--bg-deep));
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(16px);
  opacity: 0.42;
  pointer-events: none;
}

.ambient-one {
  width: 360px;
  height: 360px;
  background: rgba(207, 91, 42, 0.18);
  top: -120px;
  right: -80px;
}

.ambient-two {
  width: 260px;
  height: 260px;
  background: rgba(97, 131, 90, 0.18);
  bottom: 8%;
  left: -90px;
}

.page-shell {
  position: relative;
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

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

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--accent-strong);
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 0.98;
}

.hero-copy {
  max-width: 680px;
  margin: 14px 0 0;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--subtle);
}

.hero-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.text-link {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 600;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(420px, 1fr);
  gap: 22px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.input-panel,
.output-panel {
  padding: 24px;
}

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

.panel-head h2,
.section-title-row h3 {
  margin: 0;
  font-size: 1.35rem;
}

.status-pill,
.meta-line span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--subtle);
  border: 1px solid var(--line);
  font-size: 0.92rem;
}

.meta-line {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.source-box,
.role-section,
.custom-role-section,
.history-section {
  margin-bottom: 18px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.94rem;
  font-weight: 700;
}

.field-tip {
  margin: 8px 0 0;
  color: var(--subtle);
  font-size: 0.9rem;
  line-height: 1.5;
}

.inline-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

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

input,
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  outline: none;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

textarea {
  resize: vertical;
  min-height: 280px;
  line-height: 1.7;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(207, 91, 42, 0.5);
  box-shadow: 0 0 0 4px rgba(207, 91, 42, 0.1);
}

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

.field-group:last-child {
  grid-column: 1 / -1;
}

.field-group-span {
  grid-column: 1 / -1;
}

.env-tip {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(207, 91, 42, 0.08);
  border: 1px solid rgba(207, 91, 42, 0.12);
  color: var(--accent-strong);
  line-height: 1.65;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.model-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  cursor: pointer;
  text-align: left;
}

.model-option.active {
  border-color: rgba(207, 91, 42, 0.38);
  box-shadow: 0 10px 28px rgba(84, 40, 15, 0.08);
  background: rgba(255, 247, 240, 0.92);
}

.model-option strong {
  font-size: 1rem;
}

.model-option-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.model-option-copy span {
  color: var(--subtle);
  line-height: 1.55;
  font-size: 0.9rem;
}

.model-option-mark {
  min-width: 18px;
  color: var(--accent-strong);
  font-size: 1rem;
  line-height: 1.2;
  transform: translateY(2px);
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 12px;
}

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

.role-card {
  position: relative;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.role-card:hover,
.role-card.active {
  transform: translateY(-1px);
  border-color: rgba(207, 91, 42, 0.42);
  box-shadow: 0 10px 28px rgba(84, 40, 15, 0.08);
}

.role-badge {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

.role-card h4,
.custom-role-item h4,
.history-head h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.role-card p,
.custom-role-head p {
  margin: 0;
  color: var(--subtle);
  line-height: 1.55;
  font-size: 0.9rem;
}

.editor-card,
.custom-role-item,
.history-item,
.placeholder-card,
.result-card,
.draft-card,
.title-card,
.image-card {
  padding: 18px;
  border-radius: 20px;
  background: var(--panel-strong);
  border: 1px solid rgba(84, 40, 15, 0.08);
}

.custom-role-actions,
.primary-actions,
.custom-role-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.custom-role-list,
.history-list {
  display: grid;
  gap: 12px;
}

.custom-role-head,
.history-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.custom-role-item {
  background: rgba(255, 255, 255, 0.62);
}

.custom-role-item.active {
  border-color: rgba(207, 91, 42, 0.4);
  box-shadow: 0 10px 28px rgba(84, 40, 15, 0.08);
}

.custom-role-preview,
.history-meta,
.history-summary,
.placeholder-card p,
.result-card p,
.title-card p,
.image-card p {
  margin: 0;
  color: var(--subtle);
  line-height: 1.7;
}

.custom-role-empty,
.history-empty {
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px dashed var(--line);
  color: var(--subtle);
}

.primary-button,
.secondary-button,
.ghost-button,
.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition), background var(--transition);
}

.mini-button {
  min-height: 34px;
  padding: 0 14px;
  background: rgba(207, 91, 42, 0.08);
  border-color: rgba(207, 91, 42, 0.18);
  color: var(--accent-strong);
}

.danger-button {
  background: rgba(182, 64, 42, 0.08);
  border-color: rgba(182, 64, 42, 0.18);
  color: var(--danger);
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 14px 30px rgba(162, 67, 27, 0.22);
}

.secondary-button {
  background: rgba(207, 91, 42, 0.1);
  border-color: rgba(207, 91, 42, 0.18);
  color: var(--accent-strong);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
  color: var(--ink);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tab-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--subtle);
  cursor: pointer;
}

.tab-button.active {
  background: rgba(207, 91, 42, 0.12);
  border-color: rgba(207, 91, 42, 0.35);
  color: var(--accent-strong);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.card-gap {
  margin-top: 14px;
}

.placeholder-card h3,
.result-card h3,
.draft-card h3,
.title-card h3,
.image-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.result-list,
.title-list,
.image-list {
  margin: 14px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.result-list li,
.title-list li,
.image-list li {
  margin-bottom: 8px;
  color: var(--ink);
}

.draft-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.draft-summary {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(207, 91, 42, 0.08);
  color: var(--accent-strong);
}

.draft-editor {
  min-height: 320px;
  margin-bottom: 16px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.94rem;
}

.draft-html {
  line-height: 1.85;
}

.draft-html h1 {
  margin: 0 0 18px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 2rem;
  line-height: 1.2;
}

.draft-html h2 {
  margin: 30px 0 10px;
  font-size: 1.15rem;
}

.draft-html p,
.draft-html li {
  margin: 10px 0;
}

.draft-html blockquote {
  margin: 18px 0;
  padding: 12px 16px;
  border-left: 4px solid rgba(207, 91, 42, 0.45);
  background: rgba(207, 91, 42, 0.06);
  border-radius: 0 16px 16px 0;
}

.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.chip {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  color: var(--subtle);
  font-size: 0.9rem;
}

.loading {
  animation: pulse 1.3s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.55;
  }
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1320px);
    padding-top: 28px;
  }

  .input-panel,
  .output-panel {
    padding: 18px;
  }

  .config-grid,
  .role-grid,
  .model-picker {
    grid-template-columns: 1fr;
  }

  .inline-field {
    grid-template-columns: 1fr;
  }

  .section-title-row,
  .panel-head,
  .history-head,
  .custom-role-head {
    flex-direction: column;
  }

  .hero-actions,
  .primary-actions,
  .custom-role-actions,
  .custom-role-buttons {
    width: 100%;
  }

  .primary-button,
  .secondary-button,
  .ghost-button,
  .mini-button {
    width: 100%;
  }
}
