/* ====== 诚光圆圆 · 朋友圈智能体 ====== */

/* 提示词相关元素默认隐藏（保护护城河，对客户隐藏） */
/* JS加载完后，如果 showPromptCopy=true，body会添加.show-prompt类才显示 */
[data-admin-only] { display: none !important; }
body.show-prompt [data-admin-only] { display: '' !important; }

:root {
  --c-primary: #C8956D;
  --c-primary-dark: #B8854D;
  --c-primary-light: #F5E6D3;
  --c-bg: #FAF8F5;
  --c-card: #FFFFFF;
  --c-text: #2C2825;
  --c-text-muted: #8B8680;
  --c-text-light: #B5AFA8;
  --c-border: #EDE8E2;
  --c-border-light: #F5F2EE;
  --c-success: #5B8C5A;
  --c-error: #C75450;
  --shadow-sm: 0 1px 3px rgba(44, 40, 37, 0.06);
  --shadow-md: 0 4px 16px rgba(44, 40, 37, 0.08);
  --shadow-lg: 0 8px 32px rgba(44, 40, 37, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --header-h: 60px;
  --tabbar-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}

#app {
  max-width: 920px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.hidden { display: none !important; }

/* ====== 访问码门禁 ====== */
.gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #FAF8F5 0%, #F5E6D3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.gate-overlay.unlocked {
  opacity: 0;
  pointer-events: none;
}

.gate-card {
  text-align: center;
  max-width: 360px;
  width: 100%;
  animation: gateIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.gate-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #C8956D, #B8854D);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(200, 149, 109, 0.35);
}

.gate-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 8px;
}

.gate-desc {
  font-size: 14px;
  color: var(--c-text-muted);
  margin-bottom: 28px;
  line-height: 1.6;
}

.gate-input-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.gate-input {
  flex: 1;
  padding: 13px 16px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  text-align: center;
  letter-spacing: 2px;
  background: var(--c-card);
  transition: all 0.2s;
}

.gate-input:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(200, 149, 109, 0.1);
}

.gate-btn {
  padding: 13px 24px;
  background: linear-gradient(135deg, #C8956D, #B8854D);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(200, 149, 109, 0.3);
}

.gate-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(200, 149, 109, 0.4); }

.gate-error {
  font-size: 13px;
  color: var(--c-error);
  margin-bottom: 8px;
}

.gate-hint {
  font-size: 12px;
  color: var(--c-text-light);
  margin-top: 4px;
}

/* 注册表单 */
.gate-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.gate-input-text {
  text-align: left;
  letter-spacing: 0;
}

.gate-btn-full {
  width: 100%;
  margin-top: 4px;
}

.gate-switch {
  font-size: 13px;
  color: var(--c-primary);
  cursor: pointer;
  margin-top: 16px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gate-switch:hover {
  opacity: 0.8;
}

/* ====== 顶部导航 ====== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--c-border-light);
}

.header-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.logo-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #C8956D, #B8854D);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  font-family: 'Noto Sans SC', sans-serif;
  box-shadow: 0 2px 8px rgba(200, 149, 109, 0.3);
}

.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-title { font-size: 15px; font-weight: 600; color: var(--c-text); }
.logo-sub { font-size: 11px; color: var(--c-text-muted); letter-spacing: 1px; }

.header-nav { display: flex; align-items: center; gap: 4px; }

.nav-btn {
  background: none;
  border: none;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--c-text-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  font-family: inherit;
}

.nav-btn:hover { background: var(--c-primary-light); color: var(--c-primary); }
.nav-btn.active { color: var(--c-primary); font-weight: 500; }
.nav-settings { display: flex; align-items: center; justify-content: center; padding: 8px; }

/* ====== 主内容 ====== */
.app-main {
  flex: 1;
  padding: 24px 20px;
  padding-bottom: calc(var(--tabbar-h) + 24px);
}

.view { display: none; animation: fadeIn 0.3s ease; }
.view.active { display: block; }

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

/* ====== 首页 Hero ====== */
.home-hero { text-align: center; padding: 20px 0 32px; }

.hero-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--c-text);
  margin-bottom: 12px;
}

.hero-desc {
  font-size: 15px;
  color: var(--c-text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ====== 版块卡片区域 ====== */
.category-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

/* ====== Section 分隔线 ====== */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 4px;
}

.section-divider:first-child {
  margin-top: 0;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-muted);
  letter-spacing: 2px;
  white-space: nowrap;
}

/* ====== 分组容器 ====== */
.cat-group {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.cat-group::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--group-color, var(--c-primary));
  opacity: 0.85;
}

.cat-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--c-border-light);
}

.cat-group-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cat-group-icon svg {
  width: 20px;
  height: 20px;
}

.cat-group-text { line-height: 1.3; }

.cat-group-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--c-text);
}

.cat-group-sub {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 2px;
}

.cat-group-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

/* ====== 主版块卡片（专业圈本身 / 生活圈本身） ====== */
.cat-main-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 12px;
}

.cat-main-card:hover {
  border-color: var(--cat-color, var(--c-primary));
  background: var(--c-card);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.cat-main-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cat-main-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cat-main-icon svg {
  width: 21px;
  height: 21px;
  stroke: var(--cat-color, var(--c-primary));
}

.cat-main-text { line-height: 1.3; }

.cat-main-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 2px;
}

.cat-main-desc {
  font-size: 12px;
  color: var(--c-text-muted);
}

.cat-main-arrow {
  flex-shrink: 0;
  opacity: 0.5;
  transition: transform 0.2s;
}

.cat-main-card:hover .cat-main-arrow {
  transform: translateX(3px);
  opacity: 0.8;
}

/* ====== 分组内无子项目时去掉主卡片底部间距 ====== */
.cat-group:not(:has(.cat-group-items)) .cat-main-card {
  margin-bottom: 0;
}

/* ====== 子卡片 ====== */
.cat-sub-card {
  background: var(--c-bg);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cat-sub-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cat-color, var(--c-primary));
  opacity: 0;
  transition: opacity 0.25s;
}

.cat-sub-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--cat-color, var(--c-primary));
  background: var(--c-card);
}

.cat-sub-card:hover::before { opacity: 0.85; }
.cat-sub-card:active { transform: translateY(0); }

.cat-sub-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  background: var(--cat-bg, var(--c-primary-light));
}

.cat-sub-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--cat-color, var(--c-primary));
}

.cat-sub-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 4px;
}

.cat-sub-desc {
  font-size: 12px;
  color: var(--c-text-muted);
  line-height: 1.5;
}

/* ====== 独立大卡片（生活圈） ====== */
.cat-card {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px 18px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--cat-color, var(--c-primary));
  opacity: 0.85;
}

.cat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--cat-color, var(--c-primary));
}

.cat-card:active { transform: translateY(-1px); }

.cat-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  background: var(--cat-bg, var(--c-primary-light));
}

.cat-icon-wrap svg {
  width: 22px;
  height: 22px;
  stroke: var(--cat-color, var(--c-primary));
}

.cat-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 4px;
}

.cat-subtitle {
  font-size: 12px;
  color: var(--cat-color, var(--c-primary));
  font-weight: 500;
  margin-bottom: 6px;
}

.cat-desc {
  font-size: 13px;
  color: var(--c-text-muted);
  line-height: 1.5;
}

/* ====== 策略说明 ====== */
.home-footer { margin-top: 8px; }

.strategy-note {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
}

.strategy-note h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--c-text);
}

.strategy-note p {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.strategy-note .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.strategy-note b { color: var(--c-text); font-weight: 500; }

/* ====== 编辑器 ====== */
.editor-back { margin-bottom: 16px; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--c-text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 0;
  font-family: inherit;
  transition: color 0.2s;
}

.back-btn:hover { color: var(--c-primary); }

.editor-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--c-border-light);
}

.editor-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.editor-icon svg { width: 24px; height: 24px; }

.editor-header h2 { font-size: 20px; font-weight: 600; margin-bottom: 2px; }
.editor-header p { font-size: 13px; color: var(--c-text-muted); }

.editor-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ====== 输入区 ====== */
.editor-input { display: flex; flex-direction: column; }

/* 图片上传区 */
.image-upload-section { margin-bottom: 14px; }

.btn-upload {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 16px;
  border: 2px dashed var(--c-border); border-radius: var(--radius);
  background: var(--c-bg); color: var(--c-text-muted);
  font-size: 14px; cursor: pointer; transition: all 0.2s;
}
.btn-upload:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-light); }
.btn-upload:active { transform: scale(0.99); }

.image-preview {
  position: relative; margin-top: 10px; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--c-border); background: var(--c-card);
}
.image-preview img { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.image-preview-info { padding: 8px 12px; font-size: 13px; color: var(--c-text-muted); }
.btn-remove-image {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s;
}
.btn-remove-image:hover { background: rgba(0,0,0,0.8); }

.input-fields { display: flex; flex-direction: column; gap: 16px; }

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 6px;
}

.form-field label .required {
  color: var(--c-error);
  margin-left: 2px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--c-text);
  background: var(--c-bg);
  transition: all 0.2s;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  background: var(--c-card);
  box-shadow: 0 0 0 3px rgba(200, 149, 109, 0.1);
}

.form-field textarea {
  min-height: 80px;
  line-height: 1.6;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--c-text-light);
  white-space: pre-wrap;
}

.field-hint {
  font-size: 12px;
  color: var(--c-text-light);
  margin-top: 6px;
  line-height: 1.5;
}

/* ====== 编辑器按钮 ====== */
.editor-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-generate {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #C8956D, #B8854D);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(200, 149, 109, 0.3);
}

.btn-generate:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(200, 149, 109, 0.4); }
.btn-generate:active { transform: translateY(0); }
.btn-generate:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary {
  padding: 14px 18px;
  background: var(--c-card);
  color: var(--c-text-muted);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-secondary:hover { border-color: var(--c-text-muted); color: var(--c-text); }

/* ====== 输出区 ====== */
.editor-output {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 24px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.output-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--c-text-light);
  gap: 12px;
}

.output-placeholder svg { color: var(--c-border); }
.output-placeholder p { font-size: 14px; line-height: 1.6; }

.output-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--c-text);
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
  min-height: 100px;
}

.output-text .cursor-blink::after {
  content: '▋';
  color: var(--c-primary);
  animation: blink 0.8s infinite;
}

@keyframes blink { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }

.output-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--c-border-light);
}

.output-actions button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border: 1.5px solid var(--c-border);
  border-radius: 8px;
  background: var(--c-bg);
  color: var(--c-text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.output-actions button:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: var(--c-primary-light);
}

.btn-copy.copied {
  border-color: var(--c-success) !important;
  color: var(--c-success) !important;
  background: rgba(91, 140, 90, 0.1) !important;
}

/* ====== 加载状态 ====== */
.output-loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.loading-dots {
  display: flex;
  gap: 6px;
}

.loading-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-primary);
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

.loading-text {
  font-size: 14px;
  color: var(--c-text-muted);
}

/* ====== 错误状态 ====== */
.output-error {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.error-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(199, 84, 80, 0.1);
  color: var(--c-error);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}

.output-error p { font-size: 14px; color: var(--c-text-muted); max-width: 280px; }

/* ====== 历史 ====== */
.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.history-header h2 { font-size: 22px; font-weight: 600; }

.btn-clear-history {
  background: none;
  border: 1px solid var(--c-border);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--c-text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-clear-history:hover { border-color: var(--c-error); color: var(--c-error); }

.history-list { display: flex; flex-direction: column; gap: 12px; }

.history-item {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: all 0.2s;
}

.history-item:hover { box-shadow: var(--shadow-sm); }

.history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.history-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.history-date { font-size: 12px; color: var(--c-text-light); }

.history-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--c-text);
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 10px;
  max-height: 200px;
  overflow: hidden;
  position: relative;
}

.history-text.expanded { max-height: none; }

.history-actions { display: flex; gap: 8px; }

.history-actions button {
  background: none;
  border: 1px solid var(--c-border);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--c-text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.history-actions button:hover { border-color: var(--c-primary); color: var(--c-primary); }

.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--c-text-light);
  gap: 16px;
}

.history-empty p { font-size: 14px; line-height: 1.6; }

/* ====== 设置 ====== */
.settings-title { font-size: 22px; font-weight: 600; margin-bottom: 20px; }

.settings-section {
  background: var(--c-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.settings-section-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.settings-section-title svg { color: var(--c-primary); }

.settings-desc {
  font-size: 13px;
  color: var(--c-text-muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-primary {
  padding: 12px 24px;
  background: linear-gradient(135deg, #C8956D, #B8854D);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(200, 149, 109, 0.25);
  transition: all 0.2s;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(200, 149, 109, 0.35); }

.btn-test {
  padding: 12px 24px;
  background: var(--c-card);
  color: var(--c-text-muted);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-test:hover { border-color: var(--c-primary); color: var(--c-primary); }

.help-content { font-size: 14px; line-height: 1.8; color: var(--c-text-muted); }
.help-content b { color: var(--c-text); font-weight: 500; }
.help-content p { margin-bottom: 6px; }

.help-tip {
  margin-top: 14px;
  padding: 14px;
  background: var(--c-primary-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.7;
  color: var(--c-text);
}

.help-tip b { color: var(--c-primary-dark); }

.about-section { text-align: center; padding: 32px 24px; }
.about-text { font-size: 15px; font-weight: 600; color: var(--c-text); margin-bottom: 4px; }
.about-sub { font-size: 12px; color: var(--c-text-muted); letter-spacing: 2px; }

/* ====== Toast ====== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(44, 40, 37, 0.92);
  color: #fff;
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
}

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

.toast.success { background: rgba(91, 140, 90, 0.92); }
.toast.error { background: rgba(199, 84, 80, 0.92); }

/* ====== 底部 Tab Bar ====== */
.tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--c-border-light);
  padding: 0;
  z-index: 100;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 0;
  background: none;
  border: none;
  color: var(--c-text-light);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s;
}

.tab-btn.active { color: var(--c-primary); }
.tab-btn svg { width: 22px; height: 22px; }

/* ====== 响应式 ====== */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .tabbar { display: flex; }
  .app-main { padding-bottom: calc(var(--tabbar-h) + 20px); }
  
  .hero-title { font-size: 24px; }
  .hero-desc { font-size: 14px; }

  .category-grid { gap: 14px; }
  .cat-group { padding: 16px; }
  .cat-group-items { grid-template-columns: 1fr; gap: 10px; }
  .cat-sub-card { padding: 14px; }
  .cat-main-card { padding: 14px; margin-bottom: 10px; }
  .cat-main-icon { width: 38px; height: 38px; }
  .cat-main-icon svg { width: 19px; height: 19px; }

  .editor-body { grid-template-columns: 1fr; gap: 20px; }
  .editor-output { min-height: 200px; }

  .strategy-note { padding: 16px; }

  .home-hero { padding: 12px 0 24px; }
}

@media (max-width: 380px) {
  .hero-title { font-size: 21px; }
  .logo-title { font-size: 14px; }
  .logo-sub { font-size: 10px; }
}

/* ====== 滚动条 ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-light); }

/* ====== 选中文本 ====== */
::selection { background: rgba(200, 149, 109, 0.2); }

/* ====== 提示词模式提示 ====== */
.mode-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--c-primary-light);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--c-primary-dark);
  margin-bottom: 16px;
  line-height: 1.5;
}

.mode-banner svg { flex-shrink: 0; }

.api-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
}

.api-status.ready { background: rgba(91, 140, 90, 0.1); color: var(--c-success); }
.api-status.off { background: rgba(139, 134, 128, 0.1); color: var(--c-text-muted); }

.api-status .status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.api-status.ready .status-dot { background: var(--c-success); }
.api-status.off .status-dot { background: var(--c-text-light); }

/* 提示词预览弹窗 */
.prompt-preview {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(44, 40, 37, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.prompt-preview.show { opacity: 1; pointer-events: auto; }

.prompt-sheet {
  background: var(--c-card);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.prompt-preview.show .prompt-sheet { transform: translateY(0); }

.prompt-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--c-border-light);
}

.prompt-sheet-header h3 { font-size: 16px; font-weight: 600; }

.prompt-sheet-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--c-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

.prompt-sheet-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.prompt-sheet-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--c-text);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  background: var(--c-bg);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
}

.prompt-sheet-actions {
  padding: 16px 20px;
  border-top: 1px solid var(--c-border-light);
}

.prompt-sheet-actions button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #C8956D, #B8854D);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(200, 149, 109, 0.25);
}

@media (max-width: 768px) {
  .gate-input-wrap { flex-direction: column; }
  .gate-btn { width: 100%; }
  .prompt-sheet { border-radius: 20px 20px 0 0; }
}
