/* ===== CSS Variables ===== */
:root {
  --pink: #e84393;
  --pink-light: #fd79a8;
  --pink-dark: #c4458a;
  --purple: #6c5ce7;
  --purple-light: #a29bfe;
  --bg: #fdf2f8;
  --bg-card: #ffffff;
  --text: #2d3436;
  --text-muted: #636e72;
  --border: #f0e6ef;
  --shadow: 0 4px 24px rgba(232, 67, 147, 0.08);
  --shadow-lg: 0 12px 40px rgba(232, 67, 147, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

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

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--pink);
  color: #fff;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 9999;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

/* ===== Header ===== */
.site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
}

.logo-icon {
  font-size: 1.4rem;
}

.nav {
  display: flex;
  gap: 4px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--pink);
  background: rgba(232, 67, 147, 0.08);
}

.btn-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.btn-icon:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ===== Hero ===== */
.hero {
  padding: 48px 0 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(253, 242, 248, 0) 0%, var(--bg) 100%);
}

.hero-badge {
  display: inline-block;
  background: rgba(232, 67, 147, 0.1);
  color: var(--pink-dark);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--pink-dark), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 auto 28px;
}

.features-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.feature-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  box-shadow: var(--shadow);
}

.feature-chip span {
  display: block;
  font-weight: 700;
  color: var(--pink);
  font-size: 0.95rem;
}

/* ===== Generator ===== */
.generator-section {
  padding: 24px 0 48px;
}

.generator-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.input-area {
  padding: 28px 28px 20px;
  background: linear-gradient(135deg, rgba(232, 67, 147, 0.04), rgba(108, 92, 231, 0.04));
  border-bottom: 1px solid var(--border);
}

.input-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

#text-input {
  width: 100%;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 1.15rem;
  font-family: var(--font);
  resize: vertical;
  min-height: 80px;
  transition: var(--transition);
  background: #fff;
  color: var(--text);
}

#text-input:focus {
  outline: none;
  border-color: var(--pink-light);
  box-shadow: 0 0 0 4px rgba(232, 67, 147, 0.12);
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.control-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

#font-size {
  width: 140px;
  accent-color: var(--pink);
}

#font-size-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pink);
  min-width: 40px;
}

.mix-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  user-select: none;
}

.mix-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 44px;
  height: 24px;
  background: #dfe6e9;
  border-radius: 999px;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.mix-toggle input:checked + .toggle-track {
  background: linear-gradient(135deg, var(--pink), var(--purple));
}

.mix-toggle input:checked + .toggle-track::after {
  left: 23px;
}

/* ===== Categories ===== */
.categories-wrap {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.categories {
  display: flex;
  gap: 8px;
  min-width: max-content;
}

.category-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.category-btn:hover {
  border-color: var(--pink-light);
  color: var(--pink);
}

.category-btn.active {
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  border-color: transparent;
}

.cat-icon {
  font-size: 0.95rem;
}

/* ===== Results ===== */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px 12px;
}

.results-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.result-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 4px 12px;
  border-radius: 999px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 0 20px 20px;
}

.result-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.result-card:hover {
  border-color: var(--pink-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.result-card.copied {
  border-color: var(--pink);
  background: rgba(232, 67, 147, 0.06);
}

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

.result-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fav-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: #b2bec3;
  transition: var(--transition);
  padding: 2px 6px;
  line-height: 1;
}

.fav-btn:hover,
.fav-btn.active {
  color: var(--pink);
  transform: scale(1.15);
}

.result-text {
  line-height: 1.5;
  min-height: 1.5em;
  color: var(--text);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  font-family: 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols 2', 'Noto Sans Math', 'Cambria Math', var(--font);
}

.copy-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--pink-light);
  margin-top: 10px;
  opacity: 0;
  transition: var(--transition);
}

.result-card:hover .copy-hint {
  opacity: 1;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 12px;
}

.btn-load-more {
  display: block;
  width: calc(100% - 40px);
  margin: 0 20px 24px;
  padding: 14px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-load-more:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

/* ===== Content Sections ===== */
.content-section {
  padding: 56px 0;
}

.content-section:nth-child(even) {
  background: rgba(255, 255, 255, 0.6);
}

.content-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  text-align: center;
  margin-bottom: 12px;
}

.section-intro {
  text-align: center;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 40px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.step-num {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  margin-bottom: 16px;
}

.step-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.step-tip {
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(232, 67, 147, 0.06);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.uses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.use-card {
  text-align: center;
  padding: 28px 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--transition);
}

.use-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.use-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.use-card h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.use-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ===== Style Examples ===== */
.style-examples {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.style-example {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.style-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.style-preview {
  font-size: 1.1rem;
  word-break: break-word;
  font-family: 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols 2', 'Noto Sans Math', 'Cambria Math', var(--font);
}

.styles-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.styles-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  font-size: 0.9rem;
}

.styles-table th,
.styles-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.styles-table th {
  background: rgba(232, 67, 147, 0.06);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.styles-table tr:last-child td {
  border-bottom: none;
}

.styles-table td:last-child {
  font-size: 1rem;
}

/* ===== FAQ ===== */
.faq-list {
  max-width: 680px;
  margin: 32px auto 0;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--bg-card);
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 18px 20px;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.faq-question::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--pink);
  transition: var(--transition);
}

.faq-item.open .faq-question::after {
  content: '−';
}

.faq-question:hover {
  color: var(--pink);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
  max-height: 200px;
}

.faq-answer p {
  padding: 0 20px 18px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.7);
  padding: 32px 0;
  margin-top: 24px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #fff;
}

.footer-copy {
  font-size: 0.85rem;
}

.footer-nav {
  display: flex;
  gap: 20px;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition);
}

.footer-nav a:hover {
  color: var(--pink-light);
}

/* ===== Favorites Panel ===== */
.favorites-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.favorites-panel.open {
  opacity: 1;
  visibility: visible;
}

.favorites-drawer {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  height: 100%;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
}

.favorites-panel.open .favorites-drawer {
  transform: translateX(0);
}

.favorites-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.favorites-header h2 {
  font-size: 1.1rem;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px 8px;
}

.favorites-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.favorites-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 0.9rem;
}

.favorite-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.favorite-item:hover {
  border-color: var(--pink-light);
  background: rgba(232, 67, 147, 0.04);
}

.favorite-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.favorite-text {
  font-size: 0.95rem;
  word-break: break-word;
  font-family: 'Segoe UI Symbol', 'Apple Symbols', 'Noto Sans Symbols 2', 'Noto Sans Math', 'Cambria Math', var(--font);
}

.fav-remove {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
}

.fav-remove:hover {
  color: var(--pink);
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .btn-label {
    display: none;
  }

  .header-inner {
    height: 56px;
  }

  .hero {
    padding: 32px 0 16px;
  }

  .input-area {
    padding: 20px 16px 16px;
  }

  .results-header {
    padding: 16px 16px 8px;
  }

  .results-grid {
    padding: 0 12px 16px;
    grid-template-columns: 1fr;
  }

  .btn-load-more {
    width: calc(100% - 24px);
    margin: 0 12px 16px;
  }

  .content-section {
    padding: 40px 0;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .features-row {
    gap: 8px;
  }

  .feature-chip {
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  .controls-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
