﻿/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f5f5; color: #333; min-height: 100vh; }

/* ===== 容器 ===== */
.app-container { display: flex; flex-direction: column; height: 100vh; max-width: 1400px; margin: 0 auto; }

/* ===== 头部 ===== */
.app-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: linear-gradient(135deg, #07c160 0%, #06ad56 100%); color: white; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.logo { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.badge { background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 12px; font-size: 12px; }

/* ===== 主布局 ===== */
.main-layout { display: flex; flex: 1; overflow: hidden; gap: 0; }

/* ===== 左侧面板 ===== */
.editor-panel { width: 380px; min-width: 380px; padding: 20px; overflow-y: auto; background: white; border-right: 1px solid #e8e8e8; }
.panel-section { margin-bottom: 20px; }
.panel-section h3 { font-size: 14px; color: #666; margin-bottom: 8px; font-weight: 600; }
input[type="text"], textarea { width: 100%; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; transition: border-color 0.2s; outline: none; font-family: inherit; }
input[type="text"]:focus, textarea:focus { border-color: #07c160; box-shadow: 0 0 0 3px rgba(7,193,96,0.1); }
textarea { resize: vertical; min-height: 40px; }

.type-selector { display: flex; flex-direction: column; gap: 8px; }
.type-btn { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 2px solid #eee; border-radius: 10px; background: white; cursor: pointer; text-align: left; transition: all 0.2s; }
.type-btn:hover { border-color: #b3e5c5; background: #f0faf4; }
.type-btn.active { border-color: #07c160; background: #e8f8ee; }
.type-icon { font-size: 22px; }
.type-label { font-weight: 600; font-size: 14px; color: #333; }
.type-desc { font-size: 12px; color: #999; display: block; margin-top: 2px; }

.style-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-label { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid #ddd; border-radius: 16px; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.radio-label:has(input:checked) { border-color: #07c160; background: #e8f8ee; color: #07c160; }
.radio-label input { accent-color: #07c160; }

.keywords-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.keyword-tag { padding: 4px 10px; background: #f0f0f0; border-radius: 12px; font-size: 12px; color: #666; cursor: pointer; transition: all 0.2s; }
.keyword-tag:hover { background: #07c160; color: white; }
.keyword-tag.active { background: #07c160; color: white; }

.btn { padding: 8px 16px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; transition: all 0.2s; font-weight: 500; }
.btn-primary { background: linear-gradient(135deg, #07c160, #06ad56); color: white; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(7,193,96,0.3); }
.btn-secondary { background: #f0f0f0; color: #333; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-large { width: 100%; padding: 14px; font-size: 16px; font-weight: 600; }
.btn-sm { padding: 4px 10px; font-size: 12px; background: #f0f0f0; border: 1px solid #ddd; border-radius: 4px; }
.btn-danger { color: #e74c3c; }
.panel-actions { display: flex; flex-direction: column; gap: 8px; }

/* ===== 右侧预览面板 ===== */
.preview-panel { flex: 1; display: flex; flex-direction: column; background: #f5f5f5; }
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 10px 20px; background: white; border-bottom: 1px solid #e8e8e8; }
.preview-title { font-weight: 600; font-size: 14px; }
.toolbar-actions { display: flex; gap: 6px; }
.article-preview { flex: 1; overflow-y: auto; padding: 20px; }
.preview-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #999; }
.placeholder-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.5; }
.placeholder-sub { font-size: 13px; margin-top: 4px; color: #bbb; }

/* ===== 公众号文章 - 全新排版 ===== */
.wx-article { 
  max-width: 680px; margin: 0 auto; background: white; 
  border-radius: 12px; overflow: hidden; 
  box-shadow: 0 2px 12px rgba(0,0,0,0.08); 
  font-size: 16px; line-height: 1.8; 
}

/* 公众号头部 */
.wx-header { 
  display: flex; align-items: center; padding: 20px 24px 16px; 
  border-bottom: 1px solid #f0f0f0; 
}
.wx-avatar { 
  width: 42px; height: 42px; background: #f0f0f0; border-radius: 50%; 
  display: flex; align-items: center; justify-content: center; 
  font-size: 22px; margin-right: 12px; 
}
.wx-name { font-weight: 600; font-size: 15px; color: #333; }
.wx-time { font-size: 12px; color: #999; margin-top: 2px; }

/* 正文区域 */
.wx-body { padding: 20px 24px; }

/* 文章元信息 */
.wx-meta { margin-bottom: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.wx-tag { padding: 2px 8px; background: #f0f0f0; border-radius: 4px; font-size: 12px; color: #666; }
.wx-tag.hot { background: #fff0e6; color: #e67e22; }

/* 文章标题 */
.wx-title { 
  font-size: 22px; font-weight: 700; line-height: 1.5; 
  margin-bottom: 20px; color: #222; letter-spacing: 0.5px; 
}

/* ===== 文字内容排版 ===== */
.wx-content { color: #333; }
.wx-content p { 
  font-size: 15px; line-height: 1.85; margin-bottom: 14px; 
  text-indent: 2em; text-align: justify; 
}

/* 分割线 - 段落间视觉区分 */
.wx-content .section-divider {
  width: 40px; height: 3px; background: #e0e0e0; border-radius: 2px;
  margin: 24px auto; text-indent: 0;
}
.wx-content .hook { 
  font-size: 16px; font-weight: 600; color: #07c160; 
  border-left: 3px solid #07c160; padding: 10px 16px; 
  margin: 16px 0; background: #f6fdf9; border-radius: 0 8px 8px 0;
  text-indent: 0; line-height: 1.6;
}
.wx-content .gold-sentence { 
  background: #fffbe6; border-left: 3px solid #ffd700; 
  padding: 12px 16px; margin: 16px 0; border-radius: 0 8px 8px 0; 
  font-weight: 500; text-indent: 0;
}
.wx-content .step { 
  background: #f8f8f8; padding: 14px 16px; margin: 14px 0; 
  border-radius: 8px; border-left: 3px solid #07c160; 
  text-indent: 0; line-height: 1.6;
}
.wx-content .step-num { 
  display: inline-block; background: #07c160; color: white; 
  width: 24px; height: 24px; text-align: center; line-height: 24px; 
  border-radius: 50%; font-size: 13px; margin-right: 8px; 
}
.wx-content strong { color: #222; }
.wx-content em { color: #07c160; font-style: normal; font-weight: 500; }
.wx-content h2 { 
  font-size: 18px; font-weight: 700; color: #222; 
  margin: 28px 0 14px; border-left: 4px solid #07c160; 
  padding-left: 12px; text-indent: 0; 
}
.wx-content h3 { 
  font-size: 16px; font-weight: 600; color: #333; 
  margin: 22px 0 12px; text-indent: 0; 
}

/* ===== 图片排版 - 全新优化 ===== */
.wx-content .wx-image { 
  margin: 20px 0 24px; border-radius: 10px; overflow: hidden; 
  background: #fafafa; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: box-shadow 0.3s;
}
.wx-content .wx-image:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.wx-content .wx-image img { 
  width: 100%; display: block; 
  max-height: 420px; object-fit: cover;
  background: #f0f0f0;
}
/* 图片淡入效果 */
.wx-content .wx-image img:not([src*="data:image/svg"]) {
  animation: imageFadeIn 0.5s ease;
}
@keyframes imageFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 结尾引导 ===== */
.wx-footer { 
  border-top: 1px solid #eee; padding: 24px; text-align: center; 
  background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}
.wx-footer .action-guide { 
  display: flex; justify-content: center; gap: 28px; margin-bottom: 14px; 
}
.wx-footer .action-item { 
  display: flex; flex-direction: column; align-items: center; gap: 4px; 
  font-size: 12px; color: #999; cursor: pointer; 
}
.wx-footer .action-item .icon { font-size: 22px; }
.wx-footer .qr-tip { 
  font-size: 14px; color: #07c160; font-weight: 600; 
  padding: 8px 20px; border: 1px solid #07c160; 
  border-radius: 20px; display: inline-block;
  background: #f6fdf9;
}

/* ===== 加载动画 ===== */
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.loading-box { background: white; padding: 40px; border-radius: 16px; text-align: center; min-width: 280px; }
.spinner { width: 48px; height: 48px; border: 4px solid #e0e0e0; border-top-color: #07c160; border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-box p { font-size: 15px; color: #666; }

/* ===== 模态框 ===== */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 2000; align-items: center; justify-content: center; }
.modal.show { display: flex; }
.modal-content { background: white; padding: 30px; border-radius: 12px; min-width: 400px; max-width: 500px; position: relative; }
.close { position: absolute; top: 10px; right: 16px; font-size: 24px; cursor: pointer; color: #999; }
.close:hover { color: #333; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.form-group small { display: block; color: #999; font-size: 12px; margin-top: 4px; }

/* ===== 底部 ===== */
.app-footer { display: flex; justify-content: space-between; padding: 8px 24px; background: white; border-top: 1px solid #e8e8e8; font-size: 12px; color: #999; }

/* ===== 主题推荐标签 ===== */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.section-header h3 { margin-bottom: 0; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.topic-chip { padding: 6px 14px; background: #f0faf4; border: 1px solid #b3e5c5; border-radius: 16px; font-size: 13px; color: #07c160; cursor: pointer; transition: all 0.2s; }
.topic-chip:hover { background: #07c160; color: white; border-color: #07c160; transform: translateY(-1px); }
.topic-chip.active { background: #07c160; color: white; border-color: #07c160; box-shadow: 0 2px 8px rgba(7,193,96,0.3); }
.selected-topic { font-size: 13px; color: #999; padding: 6px 0; min-height: 20px; }


/* ===== 结尾号召 ===== */
.wx-content .wx-cta {
  margin: 28px 0 10px; padding: 16px 20px;
  background: linear-gradient(135deg, #f6fdf9 0%, #e8f8ee 100%);
  border: 1px solid #b3e5c5; border-radius: 10px;
  text-align: center; font-size: 15px; color: #333;
  line-height: 1.6; text-indent: 0;
}
.wx-content .wx-cta strong {
  color: #e67e22; font-size: 18px;
}
/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .main-layout { flex-direction: column; }
  .editor-panel { width: 100%; min-width: unset; max-height: 50vh; border-right: none; border-bottom: 1px solid #e8e8e8; }
  .preview-panel { flex: 1; }
  .wx-body { padding: 16px; }
  .wx-title { font-size: 19px; }
}

