* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --main: #ff6f3c;        /* 主橙 */
  --main-dark: #e7551f;
  --gold: #ffb44d;        /* 金黄 */
  --ink: #3d3633;         /* 主文字 */
  --ink-2: #7a6f68;       /* 次要文字 */
  --ink-3: #b3a69c;       /* 弱文字 */
  --bg: #fdf7ee;
  --card: #ffffff;
  --line: #f2e4d3;
  --green: #3fb56a;
  --blue: #4a86d6;
  --purple: #9b6fe0;

  /* 主题衍生变量 */
  --g1: #ff8a4c;
  --g2: #ff6f3c;
  --g3: #f45a2b;
  --main-shadow: rgba(255,111,60,0.32);
  --main-shadow-hover: rgba(255,111,60,0.42);
  --main-line: #ffc7a8;
  --soft: #fff3ea;
  --ghost-line: #ffd0b4;
  --tag-line: #ffd9c0;
  --spinner-line: #ffe2cf;
  --card-shadow: rgba(214,140,90,0.13);
  --card-border: #f6ebdd;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", sans-serif;
  color: var(--ink);
  line-height: 1.75;
  background:
    radial-gradient(1200px 500px at 90% -10%, rgba(255,180,77,0.18), transparent 60%),
    radial-gradient(900px 420px at -10% 0%, rgba(255,111,60,0.12), transparent 55%),
    var(--bg);
  min-height: 100vh;
}

/* ============ 顶部演示横幅 ============ */
.demo-banner {
  background: linear-gradient(90deg, #6b7ae0, #8b7ee8);
  color: #fff;
  text-align: center;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
}

/* ============ 头部 ============ */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--g1) 0%, var(--g2) 45%, var(--g3) 100%);
  color: #fff;
  padding: 30px 20px 40px;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
}
.hero::before { width: 220px; height: 220px; top: -90px; right: -40px; }
.hero::after { width: 140px; height: 140px; bottom: -70px; left: 12%; background: rgba(255,255,255,0.08); }
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.logo {
  width: 62px; height: 62px;
  background: rgba(255,255,255,0.22);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.35);
  backdrop-filter: blur(4px);
}
.hero h1 { font-size: 30px; letter-spacing: 1px; line-height: 1.2; }
.tagline { font-size: 13.5px; opacity: 0.95; margin-top: 3px; }

.api-status {
  margin-left: auto;
  background: rgba(255,255,255,0.22);
  border-radius: 30px;
  padding: 7px 16px;
  font-size: 13px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.28);
}
.api-status .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(255,212,135,0.3); }
.api-status .dot.ok { background: #8af0a6; }
.api-status .dot.warn { background: var(--gold); }

/* ============ 主容器 ============ */
.container {
  max-width: 880px;
  margin: -18px auto 0;
  padding: 0 16px 30px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ============ 卡片 ============ */
.card {
  background: var(--card);
  border-radius: 20px;
  padding: 24px 24px 20px;
  box-shadow: 0 8px 28px var(--card-shadow);
  border: 1px solid var(--card-border);
}
.card h2 {
  font-size: 18px;
  color: var(--main-dark);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 16px;
}
.card h2::before {
  content: "";
  width: 5px; height: 18px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--gold), var(--main));
}

.field { margin-bottom: 15px; }
.field label { display: block; font-weight: 700; margin-bottom: 7px; font-size: 14px; }
.req { color: var(--main); }

select, textarea, input[type="text"] {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font-size: 14.5px;
  font-family: inherit;
  background: #fdfaf5;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ff6f3c' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}
select:focus, textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--main);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255,111,60,0.12);
}
textarea { resize: vertical; }
textarea::placeholder, input::placeholder { color: #c8b9ac; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.divider { border-top: 1.5px dashed #f0dfca; margin: 6px 0 16px; }

/* 案例 */
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }

/* 语音工具栏 */
.mic-toolbar { display: flex; align-items: center; gap: 10px; margin: 2px 0 8px; flex-wrap: wrap; }
.mic-btn {
  background: #fff; color: var(--main-dark);
  border: 1.5px solid var(--main-line);
  padding: 8px 16px; border-radius: 24px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.mic-btn:hover { background: var(--soft); border-color: var(--main); transform: translateY(-1px); }
.mic-btn.recording {
  background: var(--main); color: #fff; border-color: var(--main);
  animation: pulse 1.2s infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,111,60,0.45); }
  50%     { box-shadow: 0 0 0 9px rgba(255,111,60,0); }
}
.mic-state { font-size: 12.5px; color: var(--ink-3); }

/* 按钮 */
.btn-row { display: flex; gap: 10px; margin-top: 8px; }
.btn {
  padding: 12px 26px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.2s, opacity 0.2s;
  display: inline-block;
}
.btn.primary {
  background: linear-gradient(135deg, var(--main), var(--main-dark));
  color: #fff;
  box-shadow: 0 6px 16px var(--main-shadow);
}
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 9px 20px var(--main-shadow-hover); }
.btn.primary:active { transform: translateY(0); }
.btn.disabled { background: #f0c9b6; box-shadow: none; cursor: not-allowed; }
.btn.ghost {
  background: #fff; color: var(--main-dark);
  border: 1.5px solid var(--ghost-line);
  padding: 8px 16px; font-size: 13px; border-radius: 10px;
}
.btn.ghost:hover { background: var(--soft); }

/* ============ 结果 ============ */
.result-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.result-actions { display: flex; gap: 8px; }

.result-body { margin-top: 8px; }

/* 分区块卡片 */
.sect {
  border-radius: 14px;
  padding: 15px 16px 13px;
  margin-bottom: 12px;
  border: 1px solid;
  animation: fadeUp .4s ease both;
}
.sect-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 15px;
  margin-bottom: 8px;
}
.sect-title .badge {
  width: 26px; height: 26px; border-radius: 9px;
  color: #fff; font-size: 13px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sect-body { font-size: 14.5px; color: #554c46; }
.sect-body p { margin: 0 0 8px; }
.sect-body .lbl {
  display: inline-block;
  font-weight: 700; font-size: 12.5px;
  color: inherit; opacity: 0.95;
  margin: 6px 0 2px;
}

.sect-1 { background: #fff5ec; border-color: #ffd9bd; }
.sect-1 .badge { background: linear-gradient(135deg,#ff8a4c,#ff6f3c); }
.sect-1 .lbl { color: #d9531f; }
.sect-2 { background: #f0faf4; border-color: #cdeedb; }
.sect-2 .badge { background: linear-gradient(135deg,#46c97d,#2fae62); }
.sect-2 .lbl { color: #249a52; }
.sect-3 { background: #f1f6fd; border-color: #d3e0f7; }
.sect-3 .badge { background: linear-gradient(135deg,#5b96e3,#3f77c8); }
.sect-3 .lbl { color: #2f6cb8; }
.sect-4 { background: #f7f2fd; border-color: #e3d7f6; }
.sect-4 .badge { background: linear-gradient(135deg,#a97de6,#8f5fd0); }
.sect-4 .lbl { color: #7a4fc0; }
.sect-0 { background: #faf7f2; border-color: #efe3d2; }
.sect-0 .badge { background: #b9aa99; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* 生成中占位 */
.generating {
  padding: 22px;
  text-align: center;
  color: var(--ink-3);
}
.spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--spinner-line);
  border-top-color: var(--main);
  border-radius: 50%;
  margin: 0 auto 10px;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 调整 ============ */
.adjust-card {
  margin-top: 18px;
  border-top: 1.5px dashed var(--line);
  padding-top: 16px;
}
.adjust-card h3 { font-size: 15.5px; color: var(--main-dark); margin-bottom: 4px; }
.adjust-row { display: flex; gap: 8px; margin-top: 10px; }
.adjust-row input { flex: 1; }
.quick-tags { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.quick-tags span {
  background: var(--soft);
  color: var(--main-dark);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--tag-line);
  transition: all 0.2s;
}
.quick-tags span:hover { background: var(--main); color: #fff; border-color: var(--main); transform: translateY(-1px); }

/* ============ 错误 ============ */
.error { color: #d63a3a; font-size: 13px; margin-top: 8px; background:#ffecec; border-radius:8px; padding:7px 10px; }
.hidden { display: none; }

/* ============ 页脚 ============ */
footer { text-align: center; padding: 8px 16px 22px; color: var(--ink-3); font-size: 12px; }

/* ============ 响应式 ============ */
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .hero { padding: 22px 16px 34px; }
  .hero h1 { font-size: 24px; }
  .logo { width: 52px; height: 52px; font-size: 30px; }
  .card { padding: 18px 16px 16px; }
  .container { padding: 0 12px 24px; }
  .api-status { margin-left: 0; }
}

/* ============ 第二套主题：森林绿 ============ */
body.theme-green {
  --main: #2fa37f;
  --main-dark: #1d8a66;
  --gold: #8fd0b0;
  --bg: #f1faf5;
  --line: #d7ece0;
  --g1: #3cc98f;
  --g2: #2fa37f;
  --g3: #197e5d;
  --main-shadow: rgba(47,163,127,0.32);
  --main-shadow-hover: rgba(47,163,127,0.42);
  --main-line: #b9e2cd;
  --soft: #e9f7ef;
  --ghost-line: #bfe5d2;
  --tag-line: #b9e2cd;
  --spinner-line: #d2eee0;
  --card-shadow: rgba(47,163,127,0.12);
  --card-border: #dceee3;
}
body.theme-green select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232fa37f' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}
