/* RedNote Craft - 小红书AI文案生成器 样式表 */

:root {
  --primary: #FF2442;
  --primary-dark: #D41E35;
  --primary-light: #FFF0F2;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-muted: #999;
  --bg: #fafafa;
  --card-bg: #fff;
  --border: #e8e8e8;
  --border-light: #f0f0f0;
  --success: #07C160;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 顶部导航 */
.header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 20px; }
.logo-text { font-size: 17px; font-weight: 600; color: var(--text); }
.usage-badge {
  font-size: 13px;
  color: var(--text-secondary);
  background: #f5f5f5;
  padding: 5px 12px;
  border-radius: 20px;
}
.usage-badge strong { color: var(--primary); }

/* 主容器 */
.main-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px;
}

/* 工具卡片 */
.tool-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
}

/* 表单 */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 10px;
}

/* 选择器芯片 */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}

/* 输入框 */
.keyword-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.keyword-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255,36,66,0.1); }
.keyword-input::placeholder { color: #bbb; }
.input-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* 按钮 */
.action-row { display: flex; gap: 10px; }
.btn {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-primary {
  flex: 1;
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }
.btn-secondary {
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-outline {
  flex: 1;
  background: var(--card-bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-text {
  display: block;
  margin: 16px auto 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.btn-text:hover { color: var(--primary); }

/* 错误提示 */
.error-msg {
  margin-top: 12px;
  padding: 10px 16px;
  background: #FFF0F0;
  border-radius: var(--radius-sm);
  color: #E24B4A;
  font-size: 13px;
}

/* 加载中 */
.loading-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 48px 24px;
  margin-bottom: 16px;
  text-align: center;
  border: 1px solid var(--border-light);
}
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 14px; color: var(--text-secondary); }

/* 结果卡片 */
.result-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow);
  position: relative;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.result-label { font-size: 13px; color: var(--text-muted); }
.result-tag {
  font-size: 12px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}
.result-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.4;
}
.result-body {
  font-size: 15px;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
  margin-bottom: 20px;
}
.result-actions { display: flex; gap: 8px; }
.copy-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  display: none;
  z-index: 10;
  pointer-events: none;
}
.copy-toast.show { display: block; animation: toastIn 0.3s ease, toastOut 0.3s ease 1.5s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%,-50%) scale(0.9); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* 示例区 */
.examples-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
}
.examples-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 16px;
}
.examples-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.example-card {
  background: #fafafa;
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.example-card:hover { border-color: var(--primary-light); background: #fff5f5; }
.example-card-scene { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.example-card-topic { font-size: 14px; font-weight: 500; color: var(--text); }
.example-card-style { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* FAQ */
.faq-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
}
.faq-title { font-size: 15px; font-weight: 500; margin-bottom: 16px; }
.faq-list { display: flex; flex-direction: column; }
.faq-item {
  border-bottom: 1px solid var(--border-light);
  padding: 14px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: right; font-size: 18px; color: var(--text-muted); }
.faq-item[open] summary::after { content: '−'; }
.faq-item p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
  padding-left: 0;
  line-height: 1.7;
}

/* 底部 */
.footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  text-align: center;
}
.footer-text { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.footer-links { font-size: 12px; color: var(--text-muted); }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--primary); }
.footer-divider { margin: 0 8px; }

/* 响应式 */
@media (max-width: 480px) {
  .main-container { padding: 12px; }
  .tool-card { padding: 18px; }
  .action-row { flex-direction: column; }
  .examples-grid { grid-template-columns: repeat(2, 1fr); }
  .result-title { font-size: 17px; }
  .result-body { font-size: 14px; }
}
