/* === Human Copy - Design System === */
:root {
  --primary: #ff2442;
  --primary-hover: #e01e38;
  --primary-light: #ffe0e5;
  --primary-bg: #fff5f6;
  --bg: #fafafa;
  --card: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #666;
  --text-muted: #999;
  --border: #e8e8e8;
  --border-light: #f0f0f0;
  --success: #00b578;
  --success-bg: #f0fdf4;
  --warning: #ff8f1f;
  --error: #ff3b30;
  --error-bg: #fff5f5;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --max-width: 680px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
}

/* === Reset & Base === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* === Top Bar === */
.topbar {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo-emoji { font-size: 24px; line-height: 1; }
.badge {
  background: var(--success);
  color: white;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* === Container === */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* === Hero === */
.hero-section { text-align: center; margin-bottom: 24px; }
.free-notice {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
  font-weight: 600;
}
.hero-section h1 { font-size: 26px; font-weight: 800; margin-bottom: 6px; line-height: 1.3; }
.hero-subtitle { color: var(--text-secondary); font-size: 15px; }

/* === Inspo Section === */
.inspo-section { margin-bottom: 20px; }
.section-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.inspo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.inspo-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.inspo-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.inspo-card:active { transform: scale(0.97); }
.inspo-card .inspo-icon { font-size: 28px; margin-bottom: 6px; line-height: 1; }
.inspo-card .inspo-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.inspo-card .inspo-desc { font-size: 11px; color: var(--text-secondary); }

/* === Input Card === */
.input-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.input-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}
.topic-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
  font-family: var(--font);
  background: var(--bg);
}
.topic-input:focus { border-color: var(--primary); background: white; }
.topic-input::placeholder { color: var(--text-muted); }

.style-row {
  display: flex;
  gap: 8px;
  margin: 14px 0;
  flex-wrap: wrap;
}
.style-chip {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
  font-weight: 500;
  font-family: var(--font);
}
.style-chip:hover { border-color: var(--primary); color: var(--primary); }
.style-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.style-chip:active { transform: scale(0.96); }

.generate-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  letter-spacing: 0.5px;
}
.generate-btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow); }
.generate-btn:active { transform: scale(0.98); }
.generate-btn.loading { opacity: 0.8; pointer-events: none; }
.input-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* === Spinner === */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === Error Card === */
.error-card {
  background: var(--error-bg);
  border: 1px solid #ffcccc;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.error-icon { font-size: 20px; }
.error-msg { flex: 1; font-size: 14px; color: var(--error); min-width: 200px; }

/* === Result Card === */
.result-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  animation: fadeInUp 0.35s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.result-title { font-size: 16px; font-weight: 700; flex: 1; min-width: 200px; }
.ai-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--success-bg);
  color: var(--success);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.score-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.score-dot.green { background: var(--success); }
.score-dot.yellow { background: var(--warning); }
.score-dot.red { background: var(--error); }

.result-content {
  background: #fafbfc;
  border-radius: var(--radius-sm);
  padding: 20px;
  font-size: 15px;
  line-height: 1.9;
  white-space: pre-wrap;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  word-break: break-word;
  min-height: 60px;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* === Buttons === */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: #f0f0f0; color: var(--text); }
.btn-secondary:hover { background: #e4e4e4; }
.btn-outline { background: white; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-small { padding: 6px 14px; font-size: 13px; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; pointer-events: none; }

/* === Features === */
.features { margin-top: 40px; }
.features h3 { text-align: center; font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.feature-item {
  text-align: center;
  padding: 20px 12px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  transition: transform 0.2s;
}
.feature-item:hover { transform: translateY(-2px); }
.feature-item .feat-icon { font-size: 32px; margin-bottom: 8px; line-height: 1; }
.feature-item .feat-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.feature-item .feat-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }

/* === Trust Section === */
.trust-section {
  margin-top: 40px;
  text-align: center;
  padding: 32px 20px;
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}
.trust-section h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: var(--text-secondary); }
.trust-stats { display: flex; justify-content: center; gap: 40px; }
.trust-stat { text-align: center; }
.stat-number { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* === FAQ === */
.faq-section { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }
.faq-section h3 { text-align: center; font-size: 20px; font-weight: 700; margin-bottom: 20px; }
.faq-item { border-bottom: 1px solid var(--border-light); }
.faq-q {
  width: 100%;
  text-align: left;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  padding: 14px 0;
  background: none;
  border: none;
  font-family: var(--font);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
  transition: color 0.2s;
}
.faq-q:hover { color: var(--primary); }
.faq-arrow { font-size: 18px; color: var(--text-muted); transition: transform 0.2s; }
.faq-a {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 0 0 14px;
  display: none;
  line-height: 1.7;
}
.faq-item.open .faq-a { display: block; }
.faq-item.open .faq-arrow { transform: rotate(45deg); color: var(--primary); }

/* === Footer === */
.footer {
  text-align: center;
  padding: 40px 16px 20px;
  color: var(--text-muted);
  font-size: 13px;
}
.footer p { margin-bottom: 6px; }
.footer a { color: var(--text-secondary); text-decoration: none; transition: color 0.2s; }
.footer a:hover { color: var(--primary); }
.footer-links { display: flex; justify-content: center; gap: 8px; align-items: center; }
.footer-tagline { font-style: italic; color: var(--text-muted); margin-top: 8px; }

/* === Toast === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 9999;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2s forwards;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  max-width: 90vw;
  text-align: center;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

/* === Responsive === */
@media (max-width: 480px) {
  .container { padding: 16px 12px 40px; }
  .hero-section h1 { font-size: 22px; }
  .hero-subtitle { font-size: 14px; }
  .inspo-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .input-card { padding: 18px; }
  .result-card { padding: 18px; }
  .result-actions { flex-direction: column; }
  .result-actions .btn { justify-content: center; width: 100%; }
  .trust-stats { gap: 20px; }
  .stat-number { font-size: 22px; }
  .style-row { gap: 6px; }
  .style-chip { padding: 6px 12px; font-size: 12px; }
}

@media (max-width: 360px) {
  .inspo-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
}
