:root {
  --bg: linear-gradient(180deg, #fdf4ff 0%, #f6fbff 50%, #ffffff 100%);
  --text: #1d1f32;
  --muted: #7a7d91;
  --accent: #8c5bff;
  --accent-strong: #ff6db7;
  --accent-rgb: 140, 91, 255;
  --accent-strong-rgb: 255, 109, 183;
  --header-bg: rgba(15, 16, 38, 0.8);
  --surface: rgba(255, 255, 255, 0.9);
  --border: rgba(28, 31, 46, 0.08);
  --font: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

.home-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.home-shell.site-lcnovel {
  --bg: linear-gradient(180deg, #fdf4ff 0%, #f6fbff 50%, #ffffff 100%);
  --text: #1d1f32;
  --muted: #7a7d91;
  --accent: #8c5bff;
  --accent-strong: #ff6db7;
  --accent-rgb: 140, 91, 255;
  --accent-strong-rgb: 255, 109, 183;
  --header-bg: rgba(15, 16, 38, 0.8);
  --surface: rgba(255, 255, 255, 0.9);
}

.home-shell.site-blnovel {
  --bg: linear-gradient(180deg, #f4fbff 0%, #f8fff9 50%, #ffffff 100%);
  --text: #17233a;
  --muted: #68758a;
  --accent: #1f6fe5;
  --accent-strong: #22b88f;
  --accent-rgb: 31, 111, 229;
  --accent-strong-rgb: 34, 184, 143;
  --header-bg: rgba(8, 35, 66, 0.9);
  --surface: rgba(255, 255, 255, 0.9);
}

.home-shell.site-fuzhu {
  --bg: linear-gradient(180deg, #f7fcf8 0%, #fff9ef 50%, #ffffff 100%);
  --text: #1d2b23;
  --muted: #6c776f;
  --accent: #2f7d52;
  --accent-strong: #d18d2f;
  --accent-rgb: 47, 125, 82;
  --accent-strong-rgb: 209, 141, 47;
  --header-bg: rgba(20, 56, 39, 0.9);
  --surface: rgba(255, 255, 255, 0.9);
}

.global-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 2rem;
  position: sticky;
  top: 0;
  background: var(--header-bg);
  color: #fff;
  backdrop-filter: blur(14px);
  z-index: 5;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
}

.brand-link img {
  width: 34px;
  height: 34px;
}

.brand-domain {
  letter-spacing: 0.12em;
  font-size: 0.9rem;
}

.brand-novel {
  font-size: 1.05rem;
  font-weight: 700;
  margin-left: 0.6rem;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.4);
  margin-left: 0.6rem;
}

.header-right {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.lang-select {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
}

.nav-btn {
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.nav-btn.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.home-main {
  width: min(1100px, 92vw);
  margin: 2rem auto 3rem;
}

.feature-stage {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 2rem;
  align-items: stretch;
}

.feature-card {
  border-radius: 34px;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 30px 80px rgba(14, 16, 30, 0.18);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.feature-chip {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.cover-frame {
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 25px 65px rgba(14, 16, 30, 0.3);
  background: rgba(255, 255, 255, 0.25);
  position: relative;
  aspect-ratio: 3 / 4;
  min-height: 320px;
  isolation: isolate;
}

.cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease;
  opacity: 0;
  filter: blur(8px) saturate(0.6);
  transform: scale(1.04);
}

.cover-frame.is-ready img {
  opacity: 1;
  filter: blur(0) saturate(1);
  transform: scale(1);
}

.cover-frame.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: cover-shimmer 1.6s ease-in-out infinite;
  opacity: 0.7;
  pointer-events: none;
}

.cover-frame.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(200, 210, 255, 0.2));
  z-index: -1;
}

@keyframes cover-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.feature-btn {
  position: absolute;
  top: 280px;
  right: 1rem;
  border-radius: 999px;
  border: none;
  padding: 0.55rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow: 0 10px 25px rgba(var(--accent-rgb), 0.35);
  text-decoration: none;
}

.feature-btn.is-disabled {
  cursor: default;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  box-shadow: none;
}

.feature-meta {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.feature-label {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: var(--muted);
}

.feature-meta h1 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.1;
}

.feature-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.feature-tag {
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(28, 31, 46, 0.12);
  font-size: 0.78rem;
  color: var(--muted);
}

.ai-panel {
  border-radius: 30px;
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 25px 60px rgba(14, 16, 30, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-panel h2 {
  margin: 0 0 1rem;
}

.ai-dialog {
  display: flex;
  gap: 1.2rem;
}

.ai-bot {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 15px 30px rgba(140, 91, 255, 0.25);
}

.ai-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.ai-messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ai-placeholder {
  margin: 0;
  color: var(--muted);
}

.ai-bubble {
  border-radius: 18px;
  padding: 0.9rem 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.ai-bubble.user {
  background: linear-gradient(135deg, rgba(255, 109, 183, 0.15), rgba(255, 255, 255, 0.8));
  border: 1px solid rgba(255, 109, 183, 0.25);
  align-self: flex-end;
  color: #81204c;
}

.ai-bubble.bot {
  background: linear-gradient(135deg, rgba(140, 91, 255, 0.15), rgba(255, 255, 255, 0.9));
  border-left: 4px solid var(--accent);
  color: #35195f;
}

.ai-status {
  font-size: 0.85rem;
  color: var(--muted);
  min-height: 1rem;
  display: none;
}

.ai-status.is-visible {
  display: block;
}

.ai-status.is-success {
  color: #19705d;
}

.ai-status.is-warning {
  color: #9a6400;
}

.ai-status.is-error {
  color: #bd3145;
}

.ai-recommendations {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: -0.3rem;
}

.recommendation-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 36px rgba(12, 16, 40, 0.12);
  display: flex;
  gap: 0.75rem;
}

.recommendation-card.is-strong {
  border-color: rgba(25, 112, 93, 0.25);
}

.recommendation-card.is-medium {
  border-color: rgba(140, 91, 255, 0.28);
}

.recommendation-card.is-closest {
  border-color: rgba(154, 100, 0, 0.22);
}

.recommendation-card h4 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.rec-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.rec-quality {
  flex: 0 0 auto;
  max-width: 45%;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  background: rgba(28, 31, 46, 0.06);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.3;
}

.rec-cover {
  width: 72px;
  min-width: 72px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 24px rgba(12, 16, 40, 0.18);
  background: rgba(0, 0, 0, 0.08);
}

.rec-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rec-body {
  flex: 1;
  min-width: 0;
}

.recommendation-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
  overflow-wrap: anywhere;
}

.recommendation-score {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 700;
}

.recommendation-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.recommendation-tags span {
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  background: rgba(140, 91, 255, 0.08);
  color: var(--accent);
  font-size: 0.75rem;
}

.recommendation-actions {
  margin-top: 0.75rem;
}

.recommendation-actions a {
  text-decoration: none;
  font-weight: 600;
  color: var(--accent);
}

.ai-input {
  margin-top: 1rem;
  display: flex;
  gap: 0.8rem;
}

.ai-input textarea {
  flex: 1;
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 0.8rem 1rem;
  min-height: 80px;
  font-family: var(--font);
}

.ai-input button {
  border-radius: 16px;
  border: none;
  padding: 0.8rem 1.2rem;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.prompt-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.prompt-pill {
  border-radius: 999px;
  border: 1px solid rgba(140, 91, 255, 0.35);
  padding: 0.35rem 0.9rem;
  background: transparent;
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.global-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  .home-main {
    width: min(960px, 94vw);
  }

  .feature-stage {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  }

  .ai-panel {
    padding: 1.5rem;
  }
}

@media (max-width: 900px) {
  .feature-stage {
    grid-template-columns: 1fr;
  }

  .feature-card,
  .ai-panel {
    border-radius: 28px;
  }

  .cover-frame img {
    height: 360px;
  }

  .feature-btn {
    position: static;
    margin-top: 1rem;
    align-self: flex-start;
  }
}

@media (max-width: 768px) {
  .global-header {
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
  }

  .header-right {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .home-main {
    width: min(620px, 92vw);
  }

  .brand-link img {
    width: 30px;
    height: 30px;
  }

  .feature-card {
    order: 2;
  }

  .ai-panel {
    order: 1;
  }

  .ai-dialog,
  .ai-input {
    flex-direction: column;
  }

  .recommendation-card {
    align-items: flex-start;
    text-align: left;
  }

  .rec-cover {
    width: 72px;
    min-width: 72px;
    height: 96px;
  }
}

@media (max-width: 520px) {
  .global-header {
    padding: 0.75rem 0.75rem;
  }

  .lang-select,
  .nav-btn {
    width: 100%;
    text-align: center;
  }

  .home-main {
    width: 92vw;
  }

  .cover-frame img {
    height: 260px;
  }

  .ai-panel {
    padding: 1.2rem;
  }

  .prompt-row {
    flex-direction: column;
  }

  .rec-title-row {
    flex-direction: column;
  }

  .rec-quality {
    max-width: 100%;
  }

  .feature-stage {
    gap: 1.2rem;
  }

  .feature-meta h1 {
    font-size: 1.05rem;
  }
}
