html { scroll-behavior: smooth; }

body {
  font-family: 'Figtree', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { font-family: 'Plus Jakarta Sans', sans-serif; color: var(--text-primary); }

h1 {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 60px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.header-inner {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.header-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.header-nav a:hover { color: var(--text-primary); }
.header-nav a.is-active { color: var(--text-primary); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-download-sm {
  display: inline-flex;
  align-items: center;
  background: var(--text-primary);
  color: var(--white);
  font-family: 'Figtree', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.btn-download-sm:hover { background: #333; }

.github-link {
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.github-link:hover { color: var(--text-primary); }
.github-link svg { width: 20px; height: 20px; }

/* ── Page Header ── */
.page-header {
  padding-top: 140px;
  padding-bottom: 60px;
}

.page-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.page-header h1 {
  margin-bottom: 16px;
}

.page-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 520px;
}

/* ── Filter Bar ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.filter-tab {
  padding: 12px 20px;
  font-family: 'Figtree', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
  margin-bottom: -1px;
}

.filter-tab:hover { color: var(--text-secondary); }

.filter-tab.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* ── Theme Grid ── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-bottom: 40px;
}

.theme-card {
  transition: transform 0.2s ease;
}

.theme-card:hover {
  transform: translateY(-2px);
}

.theme-card:hover .theme-preview {
  border-color: var(--border-dark);
}

.theme-preview {
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  position: relative;
  transition: border-color 0.2s ease;
}

.theme-info { padding: 0 2px; }

.theme-name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
}

.theme-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 10px;
}

.theme-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.theme-meta-author { font-weight: 500; color: var(--text-secondary); }

.theme-meta-stars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.theme-meta-engine {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── Preview Internals ── */

/* Flavor — dark editorial */
.preview-flavor {
  background: #1C1917;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
}
.preview-flavor .pf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: auto;
}
.preview-flavor .pf-logo {
  width: 8px;
  height: 8px;
  background: #D4870E;
  border-radius: 2px;
}
.preview-flavor .pf-nav {
  display: flex;
  gap: 10px;
}
.preview-flavor .pf-nav span {
  width: 24px;
  height: 3px;
  background: #44403C;
  border-radius: 2px;
}
.preview-flavor .pf-body {
  padding-bottom: 12px;
}
.preview-flavor .pf-title {
  width: 60%;
  height: 8px;
  background: #F5F3F0;
  border-radius: 2px;
  margin-bottom: 8px;
}
.preview-flavor .pf-text {
  width: 85%;
  height: 4px;
  background: #44403C;
  border-radius: 2px;
  margin-bottom: 5px;
}
.preview-flavor .pf-text:last-child { width: 55%; }
.preview-flavor .pf-accent-bar {
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #D4870E 0%, #D4870E 40%, transparent 40%);
  margin-bottom: 12px;
}

/* Letters — clean minimal */
.preview-letters {
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
}
.preview-letters .pl-header {
  text-align: center;
  margin-bottom: auto;
  padding-top: 8px;
}
.preview-letters .pl-logo {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 10px;
  font-weight: 700;
  color: #1A1A1A;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.preview-letters .pl-rule {
  width: 32px;
  height: 1px;
  background: #D4D4D2;
  margin: 0 auto;
}
.preview-letters .pl-body {
  padding-bottom: 8px;
}
.preview-letters .pl-title {
  width: 50%;
  height: 7px;
  background: #1A1A1A;
  border-radius: 1px;
  margin: 0 auto 10px;
}
.preview-letters .pl-date {
  width: 20%;
  height: 3px;
  background: #D4D4D2;
  border-radius: 1px;
  margin: 0 auto 12px;
}
.preview-letters .pl-text {
  width: 80%;
  height: 3px;
  background: #E8E8E6;
  border-radius: 1px;
  margin: 0 auto 5px;
}
.preview-letters .pl-text:nth-child(3) { width: 70%; }
.preview-letters .pl-text:last-child { width: 45%; }

/* Starter — default light */
.preview-starter {
  background: #F8F9FA;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.preview-starter .ps-topbar {
  height: 24px;
  background: #FFFFFF;
  border-bottom: 1px solid #E8E8E6;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
}
.preview-starter .ps-topbar span {
  width: 20px;
  height: 3px;
  background: #D4D4D2;
  border-radius: 2px;
}
.preview-starter .ps-topbar span:first-child {
  width: 6px;
  height: 6px;
  background: #4A90D9;
  border-radius: 2px;
  margin-right: 8px;
}
.preview-starter .ps-content {
  flex: 1;
  display: flex;
  padding: 12px;
  gap: 12px;
}
.preview-starter .ps-sidebar {
  width: 48px;
  flex-shrink: 0;
}
.preview-starter .ps-sidebar-item {
  width: 100%;
  height: 4px;
  background: #D4D4D2;
  border-radius: 2px;
  margin-bottom: 8px;
}
.preview-starter .ps-sidebar-item.active {
  background: #4A90D9;
}
.preview-starter .ps-main { flex: 1; }
.preview-starter .ps-main-title {
  width: 55%;
  height: 7px;
  background: #1A1A1A;
  border-radius: 2px;
  margin-bottom: 10px;
}
.preview-starter .ps-main-text {
  width: 90%;
  height: 3px;
  background: #D4D4D2;
  border-radius: 2px;
  margin-bottom: 5px;
}
.preview-starter .ps-main-text:nth-child(3) { width: 80%; }
.preview-starter .ps-main-text:last-child { width: 50%; }

/* Moonlight — dark purple */
.preview-moonlight {
  background: #1A1625;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
}
.preview-moonlight .pm-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: auto;
}
.preview-moonlight .pm-logo {
  width: 8px;
  height: 8px;
  background: #9D7AE8;
  border-radius: 50%;
}
.preview-moonlight .pm-links {
  display: flex;
  gap: 8px;
}
.preview-moonlight .pm-links span {
  width: 18px;
  height: 3px;
  background: #3D3553;
  border-radius: 2px;
}
.preview-moonlight .pm-body { padding-bottom: 12px; }
.preview-moonlight .pm-title {
  width: 65%;
  height: 8px;
  background: #E8E0F8;
  border-radius: 2px;
  margin-bottom: 10px;
}
.preview-moonlight .pm-text {
  width: 85%;
  height: 3px;
  background: #3D3553;
  border-radius: 2px;
  margin-bottom: 5px;
}
.preview-moonlight .pm-text:last-child { width: 50%; }
.preview-moonlight .pm-tag {
  display: inline-block;
  width: 28px;
  height: 10px;
  background: #9D7AE8;
  border-radius: 3px;
  opacity: 0.6;
  margin-top: 6px;
}

/* Paper — reading-focused */
.preview-paper {
  background: #F9F6F0;
  display: flex;
  flex-direction: column;
  height: 100%;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.preview-paper .pp-page {
  width: 70%;
  background: #FFFFFF;
  border: 1px solid #E8E4DC;
  border-radius: 2px;
  padding: 14px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.preview-paper .pp-h {
  width: 45%;
  height: 6px;
  background: #1A1A1A;
  border-radius: 1px;
  margin-bottom: 8px;
}
.preview-paper .pp-rule {
  width: 100%;
  height: 1px;
  background: #E8E4DC;
  margin-bottom: 8px;
}
.preview-paper .pp-line {
  width: 100%;
  height: 3px;
  background: #E8E4DC;
  border-radius: 1px;
  margin-bottom: 5px;
}
.preview-paper .pp-line:nth-child(4) { width: 90%; }
.preview-paper .pp-line:nth-child(5) { width: 75%; }
.preview-paper .pp-line:last-child { width: 60%; }

/* Zhihu — blue header bar */
.preview-zhihu {
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.preview-zhihu .pz-header {
  height: 22px;
  background: #0066FF;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
}
.preview-zhihu .pz-header span {
  width: 18px;
  height: 3px;
  background: rgba(255,255,255,0.5);
  border-radius: 2px;
}
.preview-zhihu .pz-header span:first-child {
  font-size: 0;
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,0.9);
  border-radius: 2px;
}
.preview-zhihu .pz-body {
  flex: 1;
  padding: 12px;
}
.preview-zhihu .pz-card {
  border: 1px solid #E8E8E6;
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 8px;
}
.preview-zhihu .pz-card-title {
  width: 60%;
  height: 5px;
  background: #1A1A1A;
  border-radius: 1px;
  margin-bottom: 6px;
}
.preview-zhihu .pz-card-text {
  width: 90%;
  height: 3px;
  background: #E8E8E6;
  border-radius: 1px;
  margin-bottom: 4px;
}
.preview-zhihu .pz-card-text:last-child { width: 70%; }
.preview-zhihu .pz-meta {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.preview-zhihu .pz-meta span {
  width: 16px;
  height: 3px;
  background: #0066FF;
  border-radius: 2px;
  opacity: 0.4;
}

/* ── Create Theme Section ── */
.create-section {
  background: var(--bg-alt);
  padding: 80px 0;
  margin-top: 80px;
}

.create-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.create-text h2 { margin-bottom: 16px; }

.create-text p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 440px;
  line-height: 1.7;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Figtree', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: 1px solid var(--accent);
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-ghost:hover {
  background: var(--accent-light);
}

.code-block {
  background: #1C1917;
  border-radius: 10px;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 6px;
  border-bottom: 1px solid #2E2A25;
}

.code-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3C3836;
}

.code-filename {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #6B6B6B;
  margin-left: 8px;
}

.code-body {
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: #A8A29E;
  overflow-x: auto;
}

.code-body .ck { color: #D4870E; }
.code-body .cs { color: #78716C; }
.code-body .ct { color: #E8E0F8; }
.code-body .cv { color: #87CEAB; }

/* ── Footer ── */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand-text {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-brand-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 240px;
}

.footer-col-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: 0.01em;
}

.footer-col ul { list-style: none; }

.footer-col li { margin-bottom: 10px; }

.footer-col a {
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.footer-col a:hover { color: var(--text-primary); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Fade In ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  animation: fadeUp 0.5s ease forwards;
}

.fade-in-d1 { animation-delay: 0.05s; }
.fade-in-d2 { animation-delay: 0.1s; }
.fade-in-d3 { animation-delay: 0.15s; }
.fade-in-d4 { animation-delay: 0.2s; }
.fade-in-d5 { animation-delay: 0.25s; }
.fade-in-d6 { animation-delay: 0.3s; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .theme-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .create-inner { grid-template-columns: 1fr; gap: 40px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  h1 { font-size: 36px; }
  h2 { font-size: 26px; }
}

@media (max-width: 600px) {
  .theme-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .header-nav { display: none; }
  .page-header { padding-top: 110px; padding-bottom: 40px; }
  h1 { font-size: 30px; }
  .filter-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .filter-tab { white-space: nowrap; padding: 10px 14px; font-size: 13px; }
  .create-section { padding: 48px 0; margin-top: 48px; }
}
