/* 帮主干活AI应用超市 - Shared Design System (Pretext-style: semantic, no-build, self-contained pages) */

:root {
  --brand-blue: #2563eb;
  --brand-blue-dark: #1e40af;
  --brand-blue-light: #eff6ff;
  --brand-orange: #f97316;
  --brand-orange-light: #fff7ed;
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-2: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.05);
  --shadow: 0 4px 6px -1px rgb(15 23 42 / 0.08), 0 2px 4px -2px rgb(15 23 42 / 0.04);
  --shadow-lg: 0 10px 15px -3px rgb(15 23 42 / 0.08), 0 4px 6px -4px rgb(15 23 42 / 0.04);
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --max-width: 1200px;
  --header-height: 4rem;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-blue); text-decoration: none; transition: color var(--transition); }
a:hover, a:focus { color: var(--brand-blue-dark); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; border-radius: 2px; }

/* Typography */
h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.25; font-weight: 700; }
p { margin: 0 0 1em; }

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--brand-blue-light);
  color: var(--brand-blue);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.125rem;
  max-width: 720px;
  margin: 0 auto 2.5rem;
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.section {
  padding: 5rem 0;
}

.section-alt { background: var(--surface); }

.text-center { text-align: center; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, var(--brand-blue), #60a5fa);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
}

.tagline {
  display: none;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border);
}

@media (min-width: 1024px) { .tagline { display: inline; } }

/* Navigation */
.main-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 1100px) { .main-nav { display: flex; } }

.nav-link {
  padding: 0.45rem 0.7rem;
  border-radius: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
}

.nav-link:hover, .nav-link:focus {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  color: var(--brand-blue);
  background: var(--brand-blue-light);
}

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: white;
  cursor: pointer;
}

@media (min-width: 1100px) { .menu-toggle { display: none; } }

.mobile-nav {
  display: none;
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
}

.mobile-nav.is-open { display: block; }

.mobile-nav a {
  display: block;
  padding: 0.75rem;
  border-radius: 0.5rem;
  color: var(--text);
  font-weight: 500;
}

.mobile-nav a:hover { background: var(--surface-2); text-decoration: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: 0.6rem;
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  text-decoration: none;
}

.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn-primary {
  background: var(--brand-blue);
  color: white;
  box-shadow: 0 4px 14px rgb(37 99 235 / 0.35);
}

.btn-primary:hover { background: var(--brand-blue-dark); color: white; }

.btn-accent {
  background: var(--brand-orange);
  color: white;
  box-shadow: 0 4px 14px rgb(249 115 22 / 0.35);
}

.btn-accent:hover { background: #ea580c; color: white; }

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline:hover { background: var(--surface); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }

/* Cards */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.card-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card-grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.card-grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card-grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

@media (min-width: 768px) {
  .card-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .card-grid-3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Feature icons */
.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.icon-blue { background: var(--brand-blue-light); color: var(--brand-blue); }
.icon-orange { background: var(--brand-orange-light); color: var(--brand-orange); }
.icon-red { background: #fef2f2; color: #ef4444; }
.icon-green { background: #f0fdf4; color: #22c55e; }
.icon-purple { background: #f3e8ff; color: #9333ea; }

/* Hero */
.hero {
  padding: 4rem 0 5rem;
  position: relative;
  overflow: hidden;
}

.hero-gradient {
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(37, 99, 235, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 50%, rgba(249, 115, 22, 0.08), transparent);
}

.hero-content { position: relative; z-index: 1; }

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }

/* Chat demo */
.chat-demo {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.chat-msg {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  animation: fadeIn 0.4s ease forwards;
}

.chat-msg.user { flex-direction: row-reverse; }

.chat-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  font-weight: 700;
}

.chat-avatar.ai { background: var(--brand-blue-light); color: var(--brand-blue); }
.chat-avatar.user { background: var(--surface-2); color: var(--text-muted); }

.chat-bubble {
  max-width: 80%;
  padding: 0.85rem 1.1rem;
  border-radius: 1rem;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
}

.chat-msg.user .chat-bubble { background: var(--brand-blue); color: white; }

.chat-meta {
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-top: 0.25rem;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* Comparison */
.comparison {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) { .comparison { grid-template-columns: 1fr 1fr; } }

.comparison-card {
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.comparison-bad { background: #fef2f2; border-color: #fecaca; }
.comparison-good { background: #f0f9ff; border-color: #bae6fd; }

/* Pricing tables */
.pricing-cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.pricing-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.pricing-card.featured {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 2px var(--brand-orange), var(--shadow-lg);
}

.pricing-badge {
  position: absolute;
  top: -0.75rem;
  right: 1.5rem;
  background: var(--brand-orange);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

.pricing-title { font-size: 1.25rem; margin-bottom: 0.25rem; }

.pricing-price {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  margin: 1rem 0 0.5rem;
}

.pricing-price small { font-size: 1rem; color: var(--text-muted); font-weight: 500; }

.pricing-desc { color: var(--text-muted); font-size: 0.9375rem; margin-bottom: 1.25rem; }

.pricing-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }

.pricing-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.pricing-list li::before {
  content: "✓";
  color: var(--brand-blue);
  font-weight: 700;
  flex-shrink: 0;
}

/* Marketplace */
.marketplace-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-pill {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.filter-pill:hover, .filter-pill.active {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

.search-box {
  padding: 0.55rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 220px;
  font-size: 0.9375rem;
}

.search-box:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }

.product-card {
  display: flex;
  flex-direction: column;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.product-thumb {
  height: 140px;
  background: linear-gradient(135deg, var(--brand-blue-light), var(--brand-orange-light));
  display: grid;
  place-items: center;
  font-size: 2.5rem;
}

.product-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }

.product-title { font-size: 1.1rem; margin-bottom: 0.35rem; }

.product-desc {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  flex: 1;
}

.product-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }

.tag {
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.product-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.author-avatar {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--brand-blue);
  color: white;
  display: grid;
  place-items: center;
  font-size: 0.625rem;
  font-weight: 700;
}

.price-badge {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--brand-orange-light);
  color: var(--brand-orange);
  font-size: 0.75rem;
  font-weight: 700;
}

/* Steps */
.steps {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  counter-reset: step;
}

.step {
  position: relative;
  padding: 1.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--brand-blue);
  color: white;
  font-weight: 800;
  margin-bottom: 1rem;
}

/* Footer */
.site-footer {
  background: var(--text);
  color: #cbd5e1;
  padding: 3rem 0 2rem;
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 2rem;
}

.footer-title { color: white; font-size: 1rem; margin-bottom: 1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: #94a3b8; }
.footer-links a:hover { color: white; }
.footer-bottom {
  border-top: 1px solid #334155;
  padding-top: 1.5rem;
  text-align: center;
  color: #64748b;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.modal-overlay.is-open { display: flex; }

.modal {
  background: white;
  border-radius: var(--radius-xl);
  width: min(100%, 480px);
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-body { padding: 1.5rem; }

.modal-close {
  width: 2rem;
  height: 2rem;
  border: none;
  background: var(--surface-2);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.form-group { margin-bottom: 1rem; }
.form-label { display: block; margin-bottom: 0.35rem; font-weight: 500; font-size: 0.9375rem; }
.form-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.9375rem;
}
.form-input:focus { outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }

/* Utilities */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-blue { background: var(--brand-blue-light); color: var(--brand-blue); }
.badge-orange { background: var(--brand-orange-light); color: var(--brand-orange); }

.text-muted { color: var(--text-muted); }
.text-blue { color: var(--brand-blue); }
.text-orange { color: var(--brand-orange); }
.bg-blue-light { background: var(--brand-blue-light); }
.bg-orange-light { background: var(--brand-orange-light); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }

.list-check { list-style: none; padding: 0; }
.list-check li { position: relative; padding-left: 1.5rem; margin-bottom: 0.5rem; }
.list-check li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--brand-blue);
  font-weight: 700;
}

.list-cross li::before { content: "✗"; color: #ef4444; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus visible */
:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }

button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }
