/* ===== 火花笔记 Note Spark - 样式 ===== */
/* 设计系统变量 */
:root {
  --red: #ff3b3b;
  --red-light: #ff6b6b;
  --red-bg: #fef4f4;
  --red-border: #ffd4d4;
  --red-hover: #fff5f5;
  --text: #222;
  --text-light: #555;
  --text-muted: #999;
  --text-tag: #bbb;
  --bg: #fef4f4;
  --card-bg: #fff;
  --shadow: 0 2px 16px rgba(255, 59, 59, 0.08);
  --shadow-hover: 0 4px 20px rgba(255, 59, 59, 0.15);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-pill: 28px;
  --max-width: 680px;
  --transition: 0.25s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

/* ===== 头部 ===== */
.header {
  background: linear-gradient(135deg, var(--red-light), var(--red));
  color: #fff;
  text-align: center;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(255, 59, 59, 0.2);
}
.header h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0;
}
.header .sub {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 4px;
  font-weight: 400;
}

/* ===== 主体容器 ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px 16px;
}

/* ===== 卡片 ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); }

.card h2 {
  font-size: 20px;
  color: var(--text);
  text-align: center;
  margin-bottom: 4px;
}
.card .desc {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 18px;
}

/* ===== 徽章行 ===== */
.badge-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.badge {
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.badge-free { background: #e6f7e6; color: #2ecc71; }
.badge-nologin { background: #f0f0ff; color: #5b7fff; }
.badge-fast { background: #fff3e0; color: #ff9800; }

/* ===== 热门话题 ===== */
.hot-topics {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  justify-content: center;
}
.hot-tag {
  padding: 7px 16px;
  background: var(--red-hover);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--red);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}
.hot-tag:hover, .hot-tag.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  transform: translateY(-1px);
}

/* ===== 输入区 ===== */
.input-wrap {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.topic-input {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
  border: 2px solid var(--red-border);
  border-radius: var(--radius-pill);
  font-size: 16px;
  outline: none;
  transition: border var(--transition);
  background: #fff;
  color: var(--text);
}
.topic-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 59, 59, 0.08);
}
.topic-input::placeholder { color: #ccc; }

/* ===== 按钮 ===== */
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn {
  flex: 1;
  min-width: 120px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, var(--red-light), var(--red));
  color: #fff;
  box-shadow: 0 4px 16px rgba(255, 59, 59, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 59, 59, 0.4);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn-random {
  background: #fff;
  color: var(--red);
  border: 2px solid var(--red-border);
}
.btn-random:hover { background: var(--red-hover); }

/* ===== 加载动画 ===== */
.loading {
  text-align: center;
  padding: 28px;
  display: none;
}
.loading.show { display: block; }
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #ffe0e0;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-muted); font-size: 14px; }
.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(3, end) infinite;
}
@keyframes dots {
  0% { content: ''; }
  33% { content: '.'; }
  66% { content: '..'; }
  100% { content: '...'; }
}

/* ===== 预览区 ===== */
.preview { display: none; }
.preview.show { display: block; }

/* 手机框 */
.phone-frame {
  width: 320px;
  max-width: 100%;
  margin: 0 auto 20px;
  background: #fff;
  border-radius: 32px;
  border: 3px solid #333;
  padding: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}
.phone-screen {
  border-radius: 24px;
  overflow: hidden;
  background: #fff;
  min-height: 300px;
}

/* 笔记内元素 */
.note-header {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  gap: 10px;
  border-bottom: 1px solid #f5f5f5;
}
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red-light), var(--red));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.username { font-size: 13px; font-weight: 600; color: var(--text); }
.post-time { font-size: 11px; color: var(--text-tag); }

.note-cover {
  width: 100%;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.note-title {
  font-size: 16px;
  font-weight: 700;
  padding: 14px 14px 4px;
  color: var(--text);
  line-height: 1.5;
}

.note-body {
  font-size: 13px;
  padding: 6px 14px 14px;
  color: var(--text-light);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: justify;
}

.note-tags {
  padding: 0 14px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.note-tag {
  font-size: 11px;
  color: #5b7fff;
  background: #f0f4ff;
  padding: 2px 10px;
  border-radius: 12px;
}
.note-stats {
  margin: 0 14px 14px;
  padding-top: 10px;
  border-top: 1px solid #f5f5f5;
  font-size: 11px;
  color: var(--text-tag);
  display: flex;
  gap: 16px;
}

/* ===== 操作按钮 ===== */
.actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.action-btn {
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}
.action-copy {
  background: #f0f0f0;
  color: var(--text-light);
}
.action-copy:hover { background: #e0e0e0; }
.action-download {
  background: var(--red);
  color: #fff;
}
.action-download:hover { background: #e63333; }
.action-share {
  background: #fff;
  color: var(--red);
  border: 1px solid var(--red-border);
}
.action-share:hover { background: var(--red-hover); }

/* ===== 分区标题 ===== */
.section { padding: 28px 0 10px; }
.section h3 {
  font-size: 19px;
  color: var(--text);
  margin-bottom: 14px;
  text-align: center;
  font-weight: 700;
}

/* ===== 示例区 ===== */
.examples {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.example-card {
  background: #fff;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  transition: all var(--transition);
}
.example-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}
.example-thumb {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.example-label {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-light);
  font-weight: 500;
  text-align: center;
  line-height: 1.4;
}

/* ===== 功能亮点 ===== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.feature-card {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}
.feature-icon { font-size: 36px; margin-bottom: 8px; }
.feature-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.feature-desc { font-size: 13px; color: var(--text-muted); }

/* ===== 数据展示 ===== */
.trusted-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.trusted-item { text-align: center; }
.trusted-num { font-size: 28px; font-weight: 800; color: var(--red); }
.trusted-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== FAQ ===== */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all var(--transition);
}
.faq-item:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.faq-q {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-q::after { content: '▾'; font-size: 12px; color: var(--text-muted); transition: transform var(--transition); }
.faq-item.open .faq-q::after { transform: rotate(180deg); }
.faq-a {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 0;
  max-height: 0;
  overflow: hidden;
  transition: all var(--transition);
}
.faq-item.open .faq-a { margin-top: 8px; max-height: 200px; }

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 32px 16px 40px;
  color: var(--text-tag);
  font-size: 12px;
  line-height: 1.8;
}
.footer .brand {
  color: var(--red);
  font-weight: 700;
}

/* ===== Toast提示 ===== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ===== 错误状态 ===== */
.error-msg {
  text-align: center;
  padding: 24px;
  color: var(--red);
  font-size: 14px;
  display: none;
}
.error-msg.show { display: block; }
.error-msg .retry-link {
  color: var(--red);
  text-decoration: underline;
  cursor: pointer;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
  .header h1 { font-size: 18px; }
  .card { padding: 20px 14px; }
  .card h2 { font-size: 17px; }
  .btn { font-size: 14px; padding: 12px 16px; }
  .topic-input { font-size: 15px; padding: 12px 16px; }
  .phone-frame { width: 100%; border-radius: 24px; border-width: 2px; padding: 6px; }
  .phone-screen { border-radius: 20px; }
  .note-cover { height: 200px; }
  .examples { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: repeat(2, 1fr); }
  .trusted-row { gap: 16px; }
  .trusted-num { font-size: 22px; }
}

@media (max-width: 320px) {
  .badge-row { gap: 4px; }
  .badge { font-size: 11px; padding: 4px 10px; }
}

/* ===== 动画 ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.section { animation: fadeInUp 0.5s ease both; }
.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }
