:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #172033;
  background: #f4f7fb;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f4f7fb; }
button, input, select, textarea, a { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .75rem 1rem; border-radius: .75rem; color: #172033; background: #fff; box-shadow: 0 8px 24px rgba(15, 23, 42, .18); }
.skip-link:focus { top: 1rem; }

.hero { padding: 3.5rem 1.25rem 5rem; color: #fff; background: linear-gradient(135deg, #5b3df5, #8b5cf6 55%, #ec4899); }
.hero__content { display: flex; align-items: center; justify-content: space-between; gap: 2rem; max-width: 1020px; margin: 0 auto; }
.eyebrow, .section-kicker { margin: 0 0 .5rem; font-size: .75rem; font-weight: 800; letter-spacing: .18em; }
.eyebrow { opacity: .8; }
h1 { margin: 0; font-size: clamp(2.25rem, 6vw, 4.25rem); line-height: 1; }
h2 { margin: 0; color: #172033; font-size: clamp(1.35rem, 3vw, 1.8rem); }
.hero__description { max-width: 42rem; margin: 1rem 0 0; font-size: 1.05rem; line-height: 1.65; opacity: .9; }
.page-navigation, .footer-navigation { display: flex; }
.navigation-link { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .75rem 1.1rem; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; color: #fff; background: rgba(255,255,255,.16); text-decoration: none; }
.navigation-link:hover, .navigation-link:focus-visible { background: rgba(255,255,255,.26); }

.page-shell { position: relative; width: min(1020px, calc(100% - 2rem)); margin: -2rem auto 4rem; }
.snapshot-panel, .ai-analysis { padding: 1.5rem; border: 1px solid #e2e8f0; border-radius: 1.25rem; background: #fff; box-shadow: 0 18px 48px rgba(23, 32, 51, .1); }
.ai-analysis { margin-top: 1.25rem; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-kicker { color: #7c3aed; }
.snapshot-summary { margin: 0; color: #64748b; line-height: 1.6; text-align: right; }
.snapshot-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.filter-field, .ai-field { display: grid; gap: .45rem; min-width: 0; }
.filter-field > span, .ai-field > span, .platform-selection legend { color: #334155; font-size: .88rem; font-weight: 750; }
select, .ai-field input, .ai-field textarea { width: 100%; min-height: 2.75rem; padding: .7rem .8rem; border: 1px solid #cbd5e1; border-radius: .75rem; color: #172033; background: #fff; }
select:focus, input:focus, textarea:focus, summary:focus-visible, button:focus-visible, a:focus-visible { border-color: #7c3aed; outline: 3px solid rgba(124, 58, 237, .2); outline-offset: 2px; }

#ai-analysis-form { display: grid; gap: 1.25rem; }
.platform-selection { min-width: 0; margin: 0; padding: 1rem; border: 1px solid #e2e8f0; border-radius: .9rem; }
.field-help { margin: .3rem 0 .8rem; color: #64748b; font-size: .8rem; line-height: 1.55; }
.platform-options { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: .65rem; }
.platform-option { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.5rem; padding: .5rem .75rem; border: 1px solid #cbd5e1; border-radius: 999px; color: #334155; background: #f8fafc; cursor: pointer; }
.platform-option--all { border-color: #c4b5fd; background: #f5f3ff; }
.platform-option:focus-within { outline: 3px solid rgba(124, 58, 237, .2); outline-offset: 2px; }
.platform-option input { width: 1rem; height: 1rem; accent-color: #6d28d9; }
.ai-field textarea { min-height: 7rem; resize: vertical; line-height: 1.6; }
.ai-settings { padding: 1rem; border: 1px solid #e2e8f0; border-radius: .9rem; background: #f8fafc; }
.ai-settings summary { color: #334155; font-weight: 750; cursor: pointer; }
.ai-settings__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.ai-field--wide { grid-column: 1 / -1; }
.ai-analysis__actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.ai-button { min-height: 2.75rem; padding: .7rem 1.1rem; border-radius: .75rem; font-weight: 750; }
.ai-button--primary { border: 1px solid #6d28d9; color: #fff; background: linear-gradient(135deg, #5b3df5, #8b5cf6); }
.ai-button--secondary { border: 1px solid #cbd5e1; color: #334155; background: #fff; }
.ai-button:disabled { cursor: not-allowed; opacity: .55; }

.notice { display: flex; align-items: center; gap: .75rem; margin-top: 1rem; padding: 1rem; border-radius: .9rem; line-height: 1.55; }
.notice--loading { color: #4338ca; background: #eef2ff; }
.notice--error { color: #9f1239; background: #fff1f2; }
.notice--stale { color: #92400e; background: #fffbeb; }
.spinner { width: 1.1rem; height: 1.1rem; flex: 0 0 auto; border: 2px solid rgba(67, 56, 202, .25); border-top-color: #4338ca; border-radius: 50%; animation: spin .75s linear infinite; }
.ai-result { margin-top: 1.25rem; padding: 1.25rem; border: 1px solid #ddd6fe; border-radius: 1rem; background: #faf5ff; }
.ai-result__title { margin: 0 0 .8rem; color: #5b21b6; }
.ai-result__content { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; color: #263247; font: inherit; line-height: 1.75; }
.footer-navigation { margin-top: 1.25rem; justify-content: center; }
.footer-navigation .navigation-link { border-color: #c4b5fd; color: #5b21b6; background: #fff; }
.footer-navigation .navigation-link:hover, .footer-navigation .navigation-link:focus-visible { background: #f5f3ff; }
.noscript-notice { margin: 1rem; padding: 1rem; color: #9f1239; background: #fff1f2; border-radius: .75rem; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .hero { padding-top: 2.5rem; }
  .hero__content, .section-heading { align-items: stretch; flex-direction: column; }
  .page-navigation { align-self: flex-start; }
  .page-shell { width: min(100% - 1rem, 1020px); }
  .snapshot-summary { text-align: left; }
  .snapshot-filters, .ai-settings__grid { grid-template-columns: 1fr; }
  .ai-field--wide { grid-column: auto; }
}

@media (max-width: 430px) {
  .hero { padding: 2.25rem 1rem 4rem; }
  .hero__content { gap: 1.25rem; }
  .snapshot-panel, .ai-analysis { padding: 1rem; border-radius: 1rem; }
  .platform-options, .ai-analysis__actions { align-items: stretch; flex-direction: column; }
  .platform-option, .ai-button { width: 100%; }
  .ai-button { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}