/* =========================================
   Lovart Light App Home Theme
   Muni 碎碎 - AI 情绪设计搭子
   Scope: body[data-page="gallery"]
========================================= */

body[data-page="gallery"] {
  --bg-main: #f8f8f6;
  --bg-surface: #ffffff;
  --bg-soft: #f1f1ef;
  --text-main: #111113;
  --text-muted: #858587;
  --border-light: #e1e1de;
  --accent: #111113;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "PingFang SC", sans-serif;
  --container-width: 1420px;
  --radius-card: 18px;
  --radius-pill: 999px;
  --ink: var(--text-main);
  --muted: var(--text-muted);
  --faint: #a1a1a3;
  --line: var(--border-light);
  --line-light: var(--border-light);
  --shadow: 0 18px 70px rgba(17, 17, 19, .10);
  --soft-shadow: 0 10px 34px rgba(17, 17, 19, .07);
  margin: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
body[data-page="gallery"]::before {
  display: none;
}

.lovart-home {
  min-height: 100vh;
  padding: 0 clamp(22px, 3.6vw, 64px) 96px;
}
.lovart-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  background: rgba(248,248,246,.82);
  backdrop-filter: blur(18px);
}
.lovart-topbar .wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
}
.lovart-topbar .wordmark span {
  font-size: 24px;
  font-weight: 780;
  letter-spacing: -.05em;
}
.lovart-topbar .wordmark em {
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.lovart-topbar nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 36px);
}
.lovart-topbar nav a {
  color: var(--text-muted);
  font-size: 14px;
  white-space: nowrap;
}
.lovart-topbar nav a:hover { color: var(--text-main); }
.lovart-topbar .nav-cta {
  padding: 9px 17px;
  border-radius: var(--radius-pill);
  color: #fff !important;
  background: var(--text-main);
}

.lovart-composer-hero {
  max-width: 1320px;
  margin: 0 auto;
  padding: clamp(54px, 7vw, 96px) 0 clamp(44px, 5vw, 72px);
  text-align: center;
}
.lovart-composer-hero h1 {
  margin: 0;
  font-size: clamp(48px, 6.4vw, 92px);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -.075em;
}
.lovart-composer-hero h1 span {
  display: inline-block;
  padding-left: .08em;
  font-style: italic;
}
.lovart-composer-hero > p {
  margin: 24px auto 38px;
  max-width: 720px;
  color: var(--text-muted);
  font-size: clamp(17px, 1.8vw, 25px);
  line-height: 1.45;
}

.lovart-prompt-box {
  max-width: 1320px;
  min-height: 210px;
  margin: 0 auto;
  padding: 26px 30px 18px;
  border: 1px solid var(--border-light);
  border-radius: 36px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(17,17,19,.08), inset 0 1px 0 rgba(255,255,255,.9);
  text-align: left;
}
.lovart-prompt-box textarea {
  width: 100%;
  min-height: 118px;
  border: 0;
  outline: 0;
  resize: none;
  color: var(--text-main);
  background: transparent;
  font: inherit;
  font-size: clamp(20px, 2vw, 29px);
  line-height: 1.45;
}
.lovart-prompt-box textarea::placeholder { color: #aaa; }
.lovart-prompt-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.tool-left,
.tool-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tool-icon,
.send-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  color: var(--text-main);
  background: transparent;
  font-size: 30px;
  line-height: 1;
}
.tool-icon:hover { background: var(--bg-soft); }
.tool-right span {
  color: var(--text-muted);
  font-size: 14px;
}
.send-btn {
  color: #999;
  background: #efefef;
  font-size: 26px;
}
.send-btn.ready,
.send-btn:hover {
  color: #fff;
  background: var(--text-main);
}

.lovart-style-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}
.style-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid #d6d6d3;
  border-radius: var(--radius-pill);
  color: var(--text-main);
  background: #fff;
  font-size: 17px;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.style-chip i { display: none; }
.style-chip:hover { transform: translateY(-1px); border-color: #bdbdb9; }
.style-chip.active { color: #7b4dff; border-color: #7b4dff; background: #f4efff; }

.lovart-recent,
.lovart-created {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: clamp(40px, 5vw, 70px) 0 0;
}
.lovart-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
.lovart-section-head h2,
.lovart-created h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 680;
  letter-spacing: -.04em;
}
.lovart-section-head a {
  color: var(--text-muted);
  font-size: 20px;
}
.recent-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 20px;
  overflow: visible;
}
.recent-card {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 178px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  background: #f4f4f2;
}
.recent-card.new-card {
  border: 1.5px dashed #cbcbc8;
  color: #888;
  background: transparent;
}
.recent-card .plus {
  color: #999;
  font-size: 42px;
  line-height: 1;
}
.recent-card em {
  position: absolute;
  left: 10px;
  bottom: -34px;
  color: var(--text-main);
  font-size: 18px;
  font-style: normal;
}

.lovart-created .mood-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin: 24px 0 30px;
  padding: 0;
}
.tab-btn {
  border: 0;
  border-radius: 14px;
  padding: 10px 18px;
  color: #555;
  background: transparent;
  font-size: 18px;
}
.tab-btn.active,
.tab-btn:hover {
  color: var(--text-main);
  background: #ededeb;
}
.lovart-template-wall {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  grid-auto-rows: auto;
  gap: 24px;
}
.lovart-template-wall .template-card {
  grid-row: auto !important;
  min-height: 0;
  aspect-ratio: 4 / 5;
  border: 0;
  border-radius: var(--radius-card);
  box-shadow: none;
  background: #eee;
}
.lovart-template-wall .template-card.tall { aspect-ratio: 9 / 13; }
.lovart-template-wall .template-card.short { aspect-ratio: 1 / 1; }
.lovart-template-wall .template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(17,17,19,.12);
  filter: none;
}
.lovart-template-wall .card-label {
  display: none;
}
.lovart-template-wall .poster-text p { font-size: 18px; }
.card-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 34px 14px 13px;
  color: #fff;
  background: linear-gradient(0deg, rgba(0,0,0,.56), transparent);
  opacity: 0;
  transition: opacity .24s ease;
}
.template-card:hover .card-foot { opacity: 1; }
.cf-avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #222;
  background: #fff;
  font-size: 12px;
}
.cf-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.cf-like { font-size: 13px; opacity: .88; }

.gen-result { display: grid; place-items: center; gap: 18px; margin-top: 32px; }
.gen-result .poster { width: min(300px, 78%); }
.gen-thinking { color: var(--text-muted); }

@media (max-width: 1180px) {
  .recent-strip,
  .lovart-template-wall { grid-template-columns: repeat(3, minmax(170px, 1fr)); }
}
@media (max-width: 760px) {
  .lovart-home { padding: 0 18px 70px; }
  .lovart-topbar nav a:not(.nav-cta) { display: none; }
  .lovart-composer-hero h1 { font-size: 43px; }
  .lovart-prompt-box { min-height: 180px; border-radius: 26px; padding: 20px; }
  .lovart-prompt-box textarea { font-size: 18px; min-height: 94px; }
  .style-chip { font-size: 14px; padding: 10px 14px; }
  .recent-strip,
  .lovart-template-wall { grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 14px; }
}
