:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --text: #111827;
  --text-soft: #5b6476;
  --line: rgba(17, 24, 39, 0.1);
  --primary: #4f46e5;
  --primary-soft: rgba(79, 70, 229, 0.16);
  --success: #059669;
  --danger: #dc2626;
  --shadow: 0 12px 32px rgba(31, 41, 55, 0.12);
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --container: min(1180px, 92vw);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0f1f;
  --bg-soft: #111935;
  --surface: rgba(17, 25, 53, 0.62);
  --surface-strong: rgba(17, 25, 53, 0.92);
  --text: #ecf2ff;
  --text-soft: #97a1bc;
  --line: rgba(236, 242, 255, 0.14);
  --primary: #8b7dff;
  --primary-soft: rgba(139, 125, 255, 0.2);
  --success: #34d399;
  --danger: #f87171;
  --shadow: 0 14px 40px rgba(2, 6, 23, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 90% 0%, rgba(79, 70, 229, 0.2), transparent 45%),
    radial-gradient(circle at 5% 60%, rgba(6, 182, 212, 0.2), transparent 40%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  transition: background-color 0.35s ease, color 0.35s ease;
}

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

img {
  max-width: 100%;
  display: block;
}

.icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
}

.page-shell {
  position: relative;
  overflow: hidden;
}

.orb-layer {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: -1;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.45;
}

.orb-a {
  width: 320px;
  height: 320px;
  right: -60px;
  top: -100px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.45), rgba(79, 70, 229, 0.05));
  animation: spinLinear 22s linear infinite;
}

.orb-b {
  width: 260px;
  height: 260px;
  left: -80px;
  top: 35vh;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.35), rgba(6, 182, 212, 0.04));
  animation: floatEase 8s cubic-bezier(0.42, 0, 0.2, 1) infinite alternate;
}

.orb-c {
  width: 240px;
  height: 240px;
  right: 12vw;
  bottom: -70px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.24), rgba(236, 72, 153, 0.04));
  animation: floatEase 7s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate-reverse;
}

@keyframes spinLinear {
  from {
    transform: rotate(0deg) translateY(0px);
  }
  to {
    transform: rotate(360deg) translateY(0px);
  }
}

@keyframes floatEase {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(14px, -16px, 0) scale(1.08);
  }
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-icon {
  width: 1.8rem;
  height: 1.8rem;
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.icon-btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface);
  border-radius: 999px;
  transition: transform 0.24s ease, border-color 0.24s ease, background-color 0.24s ease;
}

.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
}

.btn {
  height: 42px;
  padding: 0 18px;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 70, 229, 0.4);
}

.btn.primary {
  border-color: transparent;
  background: linear-gradient(120deg, var(--primary), #06b6d4);
  color: #fff;
}

.btn.ghost {
  background: transparent;
}

.glass-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.hero {
  padding: 14px 0 24px;
}

.hero-box {
  padding: clamp(18px, 4vw, 34px);
  display: grid;
  gap: 20px;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.6rem, 4.6vw, 2.8rem);
  line-height: 1.14;
}

.hero-sub {
  margin: 0;
  max-width: 68ch;
  color: var(--text-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: var(--surface-strong);
}

.search-wrap input {
  border: none;
  outline: none;
  width: 100%;
  color: var(--text);
  background: transparent;
  font-size: 0.95rem;
}

.search-wrap input::placeholder {
  color: var(--text-soft);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 14px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.stat-label {
  font-size: 0.84rem;
  color: var(--text-soft);
}

.stat-value {
  margin-top: 3px;
  font-size: 1.2rem;
  font-weight: 700;
}

.feature-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.feature-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-card .icon {
  color: var(--primary);
}

.section-title {
  margin: 18px 0 12px;
  font-size: 1.15rem;
}

.state-box {
  margin: 18px 0;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line);
  color: var(--text-soft);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.theme-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.24s ease;
}

.theme-card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 70, 229, 0.36);
}

.theme-preview-wrap {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.theme-preview,
.theme-preview.fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.theme-preview.fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, rgba(79, 70, 229, 0.2), rgba(6, 182, 212, 0.2));
  color: var(--primary);
}

.preview-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.45));
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  border-radius: 999px;
  padding: 4px 10px;
  color: #fff;
  background: rgba(17, 24, 39, 0.42);
}

.theme-content {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.theme-title {
  margin: 0;
  font-size: 1.06rem;
}

.theme-description {
  margin: 0;
  min-height: 2.6em;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.meta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 0.86rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  padding: 2px 8px;
  color: var(--text-soft);
}

.card-actions {
  display: flex;
  justify-content: flex-end;
}

.footer {
  margin: 34px 0 22px;
  color: var(--text-soft);
  font-size: 0.84rem;
}

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

.detail-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: 1.1fr 0.9fr;
}

.detail-gallery {
  padding: 14px;
}

.detail-main-image {
  width: 100%;
  border-radius: 14px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.thumb-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.thumb-btn {
  border: 1px solid var(--line);
  background: transparent;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}

.thumb-btn img {
  width: 100%;
  height: 66px;
  object-fit: cover;
}

.thumb-btn.active {
  border-color: var(--primary);
}

.detail-meta {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.meta-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  background: var(--surface-strong);
}

.meta-k {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.meta-v {
  margin-top: 2px;
  font-size: 0.95rem;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.json-block {
  margin-top: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.85);
  color: #e2e8f0;
  padding: 12px;
  overflow: auto;
  max-height: 380px;
  font-size: 0.84rem;
}

.builder-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.builder-panel {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.field-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  font-size: 0.82rem;
  color: var(--text-soft);
}

input,
textarea,
select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  padding: 9px 10px;
  font-size: 0.92rem;
}

textarea {
  min-height: 86px;
  resize: vertical;
}

input[type="color"] {
  padding: 2px;
  height: 38px;
}

.preview-mock {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--surface-strong);
  display: grid;
  gap: 10px;
}

.mock-screen {
  border-radius: 12px;
  padding: 14px;
  min-height: 220px;
  border: 1px solid var(--line);
  display: grid;
  align-content: space-between;
  gap: 10px;
}

.mock-card {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px;
}

.builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.mono {
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace;
}

@media (max-width: 980px) {
  .detail-layout,
  .builder-layout {
    grid-template-columns: 1fr;
  }

  .feature-row,
  .stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .top-nav {
    padding: 12px 0;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 8px;
  }

  .theme-grid {
    grid-template-columns: 1fr;
  }
}

