/* ============================================
   AI 改写文案 · Aurora Glow 视觉系统
   浅色底 + 多色 mesh 渐变 + 毛玻璃卡片,
   与首页统一品牌色 (#7C3AED),氛围更高端
   ============================================ */

/* 仅在 ai_writer.html 加载,覆盖 body 背景为多色 mesh 渐变 */
body {
  background: #F5F2EB !important;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 900px 520px at 14% 8%, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(ellipse 760px 520px at 84% 10%, rgba(56, 189, 248, 0.18), transparent 60%),
    radial-gradient(ellipse 960px 620px at 62% 100%, rgba(244, 114, 182, 0.14), transparent 60%),
    radial-gradient(ellipse 640px 440px at 4% 92%, rgba(124, 58, 237, 0.10), transparent 60%);
}
body > * { position: relative; z-index: 1; }


.aw-page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 48px 80px;
}

/* ===== Hero ===== */
.aw-hero {
  padding: 56px 0 56px;
  text-align: center;
  position: relative;
}
.aw-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  color: var(--accent, #7C3AED);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 28px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.12);
  letter-spacing: 0.01em;
}
.aw-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, #7C3AED);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.22);
  animation: aw-pulse 1.8s ease-out infinite;
}
@keyframes aw-pulse {
  50% { box-shadow: 0 0 0 9px rgba(124, 58, 237, 0); }
}

.aw-title {
  font-family: "Outfit", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(44px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--text-primary, #0F172A);
  margin: 0;
}
.aw-grad {
  background: linear-gradient(135deg, #7C3AED 0%, #EC4899 50%, #4F46E5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 28px rgba(124, 58, 237, 0.28));
  display: inline-block;
}
.aw-lede {
  font-size: 16.5px;
  color: var(--text-secondary, #475569);
  line-height: 1.75;
  margin: 26px auto 0;
  max-width: 640px;
}

.section-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary, #0F172A);
  margin-top: 12px;
  margin-bottom: 32px;
  text-align: center;
}

/* ===== 布局 ===== */
.aw-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 24px;
  align-items: start;
}

/* ===== 玻璃卡 ===== */
.aw-card {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 26px;
  padding: 32px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 24px 48px -18px rgba(15, 23, 42, 0.12),
    0 8px 24px -10px rgba(124, 58, 237, 0.08);
}
.aw-config {
  position: sticky;
  top: 84px;
}

.aw-section-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary, #94A3B8);
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.aw-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.12), transparent);
}

/* ===== 字段 ===== */
.aw-field {
  margin-bottom: 24px;
}
.aw-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #0F172A);
  margin-bottom: 12px;
}
.aw-point {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #7C3AED);
  display: inline-block;
  flex-shrink: 0;
}
.aw-label-meta {
  margin-left: auto;
  font-weight: 500;
  font-size: 12px;
  color: #DC2626;
  letter-spacing: 0.02em;
}

/* ===== 输入框 ===== */
.aw-textarea {
  width: 100%;
  min-height: 140px;
  border: 1.5px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 16px;
  font-size: 14px;
  line-height: 1.7;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.55);
  resize: vertical;
  color: var(--text-primary, #0F172A);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
  box-sizing: border-box;
}
.aw-textarea:focus {
  outline: none;
  border-color: var(--accent, #7C3AED);
  background: var(--bg-card);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

/* ===== 字数计数器 / 清空 ===== */
.aw-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-tertiary, #94A3B8);
  font-weight: 500;
}
.aw-counter-num {
  color: var(--accent, #7C3AED);
  font-weight: 700;
}
.aw-btn-clear {
  padding: 10px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.aw-btn-clear:hover {
  background: var(--bg-soft);
  border-color: rgba(15, 23, 42, 0.15);
}

/* ===== 芯片 ===== */
.aw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* 兼容 JS 的 .chip / .chip.active 选择器 */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #0F172A);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.18s ease;
}
.chip:hover {
  border-color: rgba(124, 58, 237, 0.45);
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-1px);
}
.chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.15);
}
.chip input { display: none; }

/* ===== 提交按钮 ===== */
.aw-submit {
  width: 100%;
  margin-top: 6px;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  background: var(--accent-grad);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
  transition: all 0.2s ease;
}
.aw-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}
.aw-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.aw-submit-icon {
  font-size: 14px;
}

/* ===== 结果卡 ===== */
.aw-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}
.aw-result-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary, #0F172A);
}
.aw-result-star {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--accent-grad, linear-gradient(135deg, #7C3AED 0%, #4F46E5 100%));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 8px 18px -4px rgba(124, 58, 237, 0.5);
}
.aw-result-loading {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(124, 58, 237, 0.2);
  border-top-color: var(--accent, #7C3AED);
  border-radius: 50%;
  animation: aw-spin 0.8s linear infinite;
  vertical-align: middle;
  margin-left: 6px;
}
@keyframes aw-spin { to { transform: rotate(360deg); } }

.aw-result-actions {
  display: flex;
  gap: 8px;
}
.aw-icon-btn {
  padding: 9px 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #0F172A);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.aw-icon-btn:hover:not(:disabled) {
  border-color: var(--accent, #7C3AED);
  color: var(--accent, #7C3AED);
  background: var(--bg-card);
}
.aw-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.aw-result-titles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.aw-title-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  padding: 16px 18px;
  position: relative;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-primary, #0F172A);
  min-height: 64px;
  word-break: break-word;
}
.aw-title-card .aw-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  padding: 3px 9px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(79, 70, 229, 0.12));
  color: var(--accent, #7C3AED);
  border-radius: 999px;
  font-weight: 600;
}
.aw-title-card .aw-title-text {
  display: block;
  padding-right: 56px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-primary, #0F172A);
  word-break: break-word;
}
.aw-title-card:empty::before {
  content: "生成中…";
  color: var(--text-tertiary, #94A3B8);
  font-weight: 400;
}

.aw-result-body {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  padding: 22px;
  font-size: 14.5px;
  line-height: 1.85;
  color: #1E293B;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 160px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  max-height: 520px;
  overflow-y: auto;
}
.aw-result-body:empty::before {
  content: "等待生成…";
  color: var(--text-tertiary, #94A3B8);
}

.aw-error {
  margin-top: 14px;
  padding: 14px 16px;
  background: #FEF2F2;
  color: #B91C1C;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.6;
}

/* 结果卡:无数据时显示头部 + 占位,触发 .show 后显示内容 */
.aw-result-card .aw-result-titles,
.aw-result-card .aw-error,
.aw-result-card .aw-result-body { display: none; }
.aw-result-card .aw-empty { display: flex; }
.aw-result-card.show .aw-result-titles { display: grid; }
.aw-result-card.show .aw-error { display: block; }
.aw-result-card.show .aw-result-body { display: block; }
.aw-result-card.show .aw-empty { display: none; }
.aw-result-body:empty::before { content: none; }
.aw-empty {
  padding: 48px 20px 36px;
  text-align: center;
  color: var(--text-tertiary, #94A3B8);
  font-size: 14px;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.aw-empty-ico {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(236, 72, 153, 0.08));
  color: var(--accent, #7C3AED);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border: 1px solid rgba(124, 58, 237, 0.18);
}
.aw-empty-text {
  color: var(--text-secondary, #475569);
  font-weight: 500;
  font-size: 14px;
}
.aw-empty-sub {
  color: var(--text-tertiary, #94A3B8);
  font-size: 12.5px;
}

/* ===== 自适应 ===== */
@media (max-width: 1080px) {
  .aw-layout {
    grid-template-columns: 1fr;
  }
  .aw-config {
    position: static;
  }
  .aw-result-titles {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .aw-page {
    padding: 16px 20px 60px;
  }
  .aw-hero {
    padding: 36px 0 32px;
  }
  .aw-card {
    padding: 24px 20px;
    border-radius: 22px;
  }
  .aw-result-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================
   Hero 紧凑覆盖(仅作用于 ai_writer 页)
   1) 缩 padding 2) 标题字号减半 3) 副标题行距收紧
   ============================================ */
.hero-section.aw-hero-compact {
  padding: 36px 24px 28px;
}
.hero-section.aw-hero-compact .hero-title {
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.2;
}
.hero-section.aw-hero-compact .hero-subtitle {
  font-size: clamp(13px, 1.05vw, 15px);
  line-height: 1.55;
  margin: 0 auto 8px;
  max-width: 720px;
}
.hero-section.aw-hero-compact .hero-subtitle.aw-subtitle-strong {
  color: var(--accent);
  font-weight: 600;
  font-size: clamp(14px, 1.2vw, 17px);
  margin-bottom: 6px;
}
.hero-section.aw-hero-compact .hero-subtitle.aw-subtitle-desc {
  color: var(--text-secondary);
}