/* =========================================================
   Soloco — shared subpage shell v2
   Depends on tokens.css (must be linked before this file)
   ========================================================= */

/* ---------- header ---------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in oklch, var(--background), transparent 25%);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid transparent;
  padding: 1rem 0;
  transition:
    padding var(--duration-base) var(--ease-out-soft),
    background-color var(--duration-base) var(--ease-out-soft),
    border-color var(--duration-base) var(--ease-out-soft),
    box-shadow var(--duration-base) var(--ease-out-soft);
}
.header.scrolled {
  padding: 0.625rem 0;
  background: color-mix(in oklch, var(--background), transparent 5%);
  border-bottom-color: color-mix(in oklch, var(--border), transparent 30%);
  box-shadow: 0 1px 0 color-mix(in oklch, var(--border), transparent 70%);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; }
.logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--foreground); }
.logo img { height: 1.5rem; width: auto; }
.dark .logo img,
.dark .footer-brand img { filter: brightness(0) invert(1); }
.logo .wordmark {
  font-size: var(--fs-sm);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.nav { display: flex; align-items: center; gap: 0.125rem; font-size: var(--fs-sm); }
.nav-link {
  color: var(--muted-foreground);
  text-decoration: none;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast) var(--ease-out-soft), background-color var(--duration-fast);
  font-weight: 450;
  white-space: nowrap;
}
.nav-link:hover { color: var(--foreground); background: var(--accent); }
.nav-link.active {
  color: var(--foreground);
  background: color-mix(in oklch, var(--primary-soft), transparent 40%);
}
.nav-gap { width: 0.75rem; flex-shrink: 0; }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.125rem; height: 2.125rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: color var(--duration-fast), background-color var(--duration-fast), border-color var(--duration-fast);
  margin-right: 0.5rem;
}
.theme-toggle:hover { color: var(--foreground); background: var(--accent); border-color: var(--border-strong); }
.theme-toggle .theme-icon { width: 1.05rem; height: 1.05rem; }
.theme-toggle .theme-icon-moon { display: none; }
.dark .theme-toggle .theme-icon-sun { display: none; }
.dark .theme-toggle .theme-icon-moon { display: inline-block; }

/* ---------- button ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out-soft);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  text-decoration: none;
  font-family: inherit;
  white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); background: var(--accent); }
.btn-primary {
  background: var(--foreground);
  color: var(--background);
  border-color: var(--foreground);
}
.btn-primary:hover {
  background: color-mix(in oklch, var(--foreground), transparent 12%);
  border-color: transparent;
}
.btn-lg { padding: 0.75rem 1.5rem; font-size: var(--fs-body); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.75rem 0.25rem;
  color: var(--muted-foreground);
  font-size: var(--fs-body);
  text-decoration: none;
  font-weight: 450;
  transition: color var(--duration-fast);
  background: transparent;
  border: none;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--foreground); }

/* ---------- page-hero (shared artwork hero for subpages) ---------- */
.page-hero {
  position: relative;
  padding: clamp(3.5rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background: var(--grad-page);
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(1000px 400px at 80% -10%, color-mix(in oklch, var(--primary), transparent 90%), transparent 60%);
  pointer-events: none;
}
.page-hero .container { position: relative; }
.page-hero .eyebrow { margin-bottom: 1.25rem; }
.page-hero h1 {
  font-size: clamp(2rem, 4.2vw, var(--fs-h1));
  font-weight: 450;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  margin-bottom: 1rem;
  max-width: 28ch;
}
.page-hero h1 em {
  font-style: italic;
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--primary);
  padding-right: 0.03em;
}
.page-hero .lead {
  font-size: var(--fs-body-lg);
  color: var(--muted-foreground);
  max-width: 42rem;
  line-height: 1.7;
  text-wrap: pretty;
}
.page-hero .hero-meta {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem;
  margin-top: 1.75rem;
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
}
.page-hero .hero-meta .meta-item {
  display: inline-flex; align-items: center; gap: 0.5rem;
}

/* ---------- page-title ----------
 * 子页用的轻量标题区 — 替代厚重的 page-hero。
 * 用户已经在 nav 里知道身处哪个板块，这里只需一个"路牌级"的标题。
 */
.page-title {
  padding: clamp(2rem, 3.5vw, 2.75rem) 0 clamp(1.25rem, 2vw, 1.75rem);
  border-bottom: 1px solid var(--border-subtle);
}
.page-title h1 {
  font-size: clamp(1.5rem, 2.4vw, 1.875rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 0;
  color: var(--foreground);
}
.page-title .page-sub {
  margin-top: 0.5rem;
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  line-height: 1.6;
  max-width: 44rem;
}

/* ---------- page-body ---------- */
.page-body { padding: clamp(3rem, 6vw, 5rem) 0 clamp(4rem, 8vw, 7rem); }
.page-body.tight { padding-top: 0; }

/* ---------- prose ---------- */
.prose {
  max-width: var(--container-prose);
  margin: 0 auto;
  color: color-mix(in oklch, var(--foreground), var(--muted-foreground) 15%);
}
.prose h2 {
  font-size: var(--fs-h3);
  font-weight: 500;
  color: var(--foreground);
  margin: 3rem 0 1rem;
  letter-spacing: var(--tracking-snug);
}
.prose h2:first-child { margin-top: 0; }
.prose h2::before {
  content: "";
  display: block;
  width: 24px; height: 2px;
  background: var(--primary);
  margin-bottom: 0.875rem;
  border-radius: 2px;
  opacity: 0.6;
}
.prose h3 {
  font-size: var(--fs-h4);
  font-weight: 500;
  color: var(--foreground);
  margin: 2rem 0 0.625rem;
}
.prose p {
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
  margin: 0 0 1rem;
}
.prose .lead { font-size: var(--fs-body-lg); color: var(--muted-foreground); }
.prose ul, .prose ol { margin: 0 0 1.25rem; padding-left: 1.5rem; }
.prose li {
  margin: 0.5rem 0;
  font-size: var(--fs-body);
  line-height: 1.7;
}
.prose li::marker { color: color-mix(in oklch, var(--primary), transparent 40%); }
.prose strong { color: var(--foreground); font-weight: 600; }
.prose em { color: var(--foreground); }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: color-mix(in oklch, var(--accent), transparent 35%);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-xs);
  color: var(--primary-deep);
  border: 1px solid color-mix(in oklch, var(--border), transparent 40%);
}
.prose pre {
  background: color-mix(in oklch, var(--foreground), transparent 94%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.125rem 1.375rem;
  overflow-x: auto;
  margin: 1.25rem 0 1.75rem;
  font-size: var(--fs-sm);
  line-height: 1.65;
  box-shadow: var(--shadow-xs);
}
.prose pre code {
  background: transparent;
  border: none;
  color: var(--foreground);
  padding: 0;
  font-size: inherit;
}
.prose a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklch, var(--primary), transparent 70%);
  transition: border-color var(--duration-fast);
}
.prose a:hover { border-bottom-color: var(--primary); }
.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}
.prose blockquote {
  border-left: 2px solid var(--primary);
  padding: 0.25rem 0 0.25rem 1.125rem;
  margin: 1.5rem 0;
  color: var(--muted-foreground);
  font-style: italic;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: var(--fs-sm);
}
.prose th, .prose td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.prose th {
  font-weight: 500;
  color: var(--muted-foreground);
  background: color-mix(in oklch, var(--accent), transparent 60%);
}

/* ---------- surface ---------- */
.surface-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--duration-fast), transform var(--duration-fast), box-shadow var(--duration-fast);
}
.surface-card.hoverable:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.surface-card.featured {
  border-color: color-mix(in oklch, var(--primary), transparent 40%);
  box-shadow: 0 0 0 1px color-mix(in oklch, var(--primary), transparent 50%), var(--shadow-md);
  background: linear-gradient(180deg, color-mix(in oklch, var(--primary-soft), transparent 60%), var(--card) 40%);
}
.surface-elevated {
  background: var(--elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ---------- card-grid ---------- */
.card-grid { display: grid; gap: 1rem; }
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- section head (shared with home.css) ---------- */
.section { padding: var(--section-y) 0; }
.section-head { max-width: 48rem; margin-bottom: 2.75rem; }
.section-head .eyebrow { margin-bottom: 1.25rem; }
.section-title {
  font-size: clamp(1.75rem, 3vw, var(--fs-h2));
  font-weight: 450;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-snug);
  margin-bottom: 0.875rem;
}
.section-lead {
  font-size: var(--fs-body-lg);
  color: var(--muted-foreground);
  line-height: 1.7;
  max-width: 40rem;
}

/* =========================================================
   Pricing
   ========================================================= */
.pricing-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: stretch;
}
.pricing-tier {
  padding: 2rem 1.75rem;
  display: flex; flex-direction: column; gap: 1rem;
}
.pricing-tier .tier-name {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--muted-foreground);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.pricing-tier h3 { font-size: var(--fs-h3); font-weight: 500; letter-spacing: var(--tracking-snug); }
.pricing-tier .price {
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  display: flex; align-items: baseline; gap: 0.25rem;
}
.pricing-tier .price em {
  font-style: normal;
  font-family: var(--font-serif);
  color: var(--primary);
}
.pricing-tier .per {
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  font-weight: normal;
}
.pricing-tier .desc {
  font-size: var(--fs-body);
  color: var(--muted-foreground);
  line-height: 1.7;
  min-height: 3.2em;
}
.pricing-tier ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.625rem;
  font-size: var(--fs-body);
  color: color-mix(in oklch, var(--foreground), var(--muted-foreground) 20%);
  flex: 1;
  padding: 1rem 0 1.25rem;
  border-top: 1px solid var(--border);
}
.pricing-tier ul li {
  display: flex; gap: 0.5rem; align-items: baseline;
  line-height: 1.55;
}
.pricing-tier ul li::before {
  content: "✓";
  color: var(--primary);
  font-size: var(--fs-sm);
  font-weight: 600;
  flex-shrink: 0;
  padding-top: 0.1em;
}
.pricing-tier .btn {
  justify-content: center;
  padding: 0.75rem 1rem;
  font-size: var(--fs-sm);
}

/* =========================================================
   Changelog (product-native — GOAL-XXXX styled)
   ========================================================= */
.changelog-list {
  max-width: var(--container-prose);
  margin: 0 auto;
  position: relative;
}
.changelog-list::before {
  content: "";
  position: absolute;
  left: 5.75rem;
  top: 0.5rem; bottom: 0.5rem;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border) 5%, var(--border) 95%, transparent);
}
.changelog-entry {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 2rem;
  padding: 1.75rem 0 2rem;
  position: relative;
}
.changelog-entry:last-child { padding-bottom: 0; }
.changelog-left {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding-top: 0.25rem;
}
.changelog-date {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
.changelog-cycle {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: color-mix(in oklch, var(--muted-foreground), transparent 20%);
  letter-spacing: var(--tracking-mono);
}
.changelog-content { position: relative; padding-left: 1.25rem; }
.changelog-content::before {
  content: "";
  position: absolute;
  left: -1.5rem; top: 0.4rem;
  width: 0.6rem; height: 0.6rem;
  border-radius: 50%;
  background: var(--background);
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 4px var(--background);
}
.changelog-entry.minor .changelog-content::before { border-color: var(--muted-foreground); }
.changelog-content h3 {
  font-size: var(--fs-h4);
  font-weight: 500;
  margin-bottom: 0.875rem;
  letter-spacing: var(--tracking-snug);
}
.changelog-content .changelog-goal {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--muted-foreground);
  letter-spacing: var(--tracking-mono);
  margin-bottom: 0.25rem;
  display: inline-block;
}
.changelog-content ul {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.375rem;
}
.changelog-content li {
  display: flex; gap: 0.625rem; align-items: flex-start;
  padding: 0.25rem 0;
  font-size: var(--fs-body);
  color: color-mix(in oklch, var(--foreground), var(--muted-foreground) 10%);
  line-height: 1.65;
}
.changelog-content li::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--muted-foreground);
  flex-shrink: 0;
  margin-top: 0.65em;
}
.changelog-content li.feat::before { background: var(--succeed); }
.changelog-content li.fix::before { background: var(--primary); }
.changelog-content li.refactor::before { background: var(--awaits); }
.changelog-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-right: 0.375rem;
  min-width: 3em;
  text-align: center;
}
.changelog-tag.feat { background: var(--succeed-soft); color: color-mix(in oklch, var(--succeed), black 22%); }
.changelog-tag.fix { background: var(--primary-soft); color: var(--primary-deep); }
.changelog-tag.refactor { background: var(--awaits-soft); color: color-mix(in oklch, var(--awaits), black 22%); }

/* =========================================================
   Footer
   ========================================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 5rem 0 2rem;
  background: color-mix(in oklch, var(--background), var(--foreground) 2%);
  position: relative;
  overflow: hidden;
}
.footer::before {
  content: "";
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%);
  width: 80%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.4;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2.4fr 1fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}
.footer-brand img { height: 1.5rem; margin-bottom: 1rem; }
.footer-brand .footer-tagline,
.footer-brand .tagline {
  font-size: var(--fs-sm);
  color: var(--muted-foreground);
  line-height: 1.7;
  margin-bottom: 1.25rem;
  max-width: 22rem;
}
.footer-status {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  color: var(--muted-foreground);
  padding: 5px 10px 5px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--card);
  letter-spacing: var(--tracking-mono);
}
.footer-col h5 {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 1.25rem;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.footer-col a {
  color: var(--foreground);
  text-decoration: none;
  font-size: var(--fs-sm);
  transition: color var(--duration-fast);
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.75rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--muted-foreground);
  letter-spacing: var(--tracking-mono);
}
.footer-social { display: flex; gap: 1.5rem; }
.footer-social a {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color var(--duration-fast);
}
.footer-social a:hover { color: var(--foreground); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 960px) {
  .card-grid.cols-3, .card-grid.cols-4 { grid-template-columns: 1fr; }
  .card-grid.cols-2 { grid-template-columns: 1fr; }
  .pricing-row { grid-template-columns: 1fr; }
  .pricing-tier .price { font-size: 1.875rem; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }

  .changelog-entry { grid-template-columns: 1fr; gap: 0.75rem; }
  .changelog-list::before { left: 0.3rem; }
  .changelog-content { padding-left: 0; }
  .changelog-content::before { display: none; }
  .changelog-left { padding-left: 1.5rem; position: relative; }
  .changelog-left::before {
    content: ""; position: absolute; left: 0; top: 0.6rem;
    width: 0.6rem; height: 0.6rem; border-radius: 50%;
    background: var(--background); border: 2px solid var(--primary);
  }

  .nav { gap: 0; font-size: var(--fs-xs); }
  .nav-link { padding: 0.4rem 0.6rem; }
  .nav-gap { display: none; }
}
@media (max-width: 620px) {
  :root { --gutter: 1.25rem; }
  .nav-link { display: none; }
  .nav .btn { display: inline-flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; }
}
