
/* luoshui home cinematic upgrade
   Safe additive layer: no backend/API changes, no login removal.
   Load after existing styles.css.
*/

:root{
  --luo-primary:#66ccff;
  --luo-primary-soft:#88ddff;
  --luo-violet:#b79cff;
  --luo-pink:#ffd1f3;
  --luo-bg-deep:#07111f;
  --luo-glass:rgba(255,255,255,.72);
  --luo-glass-dark:rgba(8,18,35,.64);
  --luo-border:rgba(102,204,255,.22);
  --luo-shadow:0 24px 80px rgba(25,75,135,.18);
}

body{
  background:
    radial-gradient(circle at 12% 8%, rgba(102,204,255,.28), transparent 34%),
    radial-gradient(circle at 86% 16%, rgba(183,156,255,.22), transparent 28%),
    linear-gradient(180deg, #f7fcff 0%, #eef8ff 46%, #f8fbff 100%);
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-2;
  pointer-events:none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.85) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(102,204,255,.55) 0 1px, transparent 1.5px);
  background-size: 84px 84px, 132px 132px;
  background-position: 0 0, 32px 48px;
  animation: luoStarDrift 22s linear infinite;
  opacity:.62;
}

body::after{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  pointer-events:none;
  background:linear-gradient(120deg, rgba(255,255,255,.16), rgba(102,204,255,.05), rgba(183,156,255,.08));
  backdrop-filter:none;
}

@keyframes luoStarDrift{
  from{background-position:0 0,32px 48px}
  to{background-position:84px 84px,164px 180px}
}

/* first screen: stronger anime/cinema feeling */
.hero,
.home-hero,
section.hero{
  position:relative;
  overflow:hidden;
  min-height:430px;
  border:1px solid rgba(102,204,255,.28)!important;
  box-shadow: var(--luo-shadow), inset 0 1px 0 rgba(255,255,255,.55)!important;
  background:
    linear-gradient(135deg, rgba(255,255,255,.78), rgba(235,249,255,.52)),
    radial-gradient(circle at 82% 22%, rgba(102,204,255,.34), transparent 34%),
    radial-gradient(circle at 70% 82%, rgba(183,156,255,.22), transparent 30%)!important;
}

.hero::before,
.home-hero::before,
section.hero::before{
  content:"";
  position:absolute;
  inset:-40% -20%;
  background:conic-gradient(from 210deg, transparent 0 15%, rgba(102,204,255,.18), transparent 32%, rgba(255,209,243,.12), transparent 58%);
  animation: luoAurora 14s ease-in-out infinite alternate;
  pointer-events:none;
}

.hero::after,
.home-hero::after,
section.hero::after{
  content:"";
  position:absolute;
  right:28px;
  bottom:28px;
  width:220px;
  height:220px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(102,204,255,.34), rgba(102,204,255,.1) 38%, transparent 72%);
  filter:blur(6px);
  pointer-events:none;
}

@keyframes luoAurora{
  from{transform:rotate(0deg) scale(1); opacity:.7}
  to{transform:rotate(10deg) scale(1.08); opacity:1}
}

.hero h1,
.home-hero h1,
section.hero h1{
  position:relative;
  font-size:clamp(42px, 7vw, 86px)!important;
  letter-spacing:.08em;
  line-height:1.02;
  color:#12324a;
  text-shadow:0 0 22px rgba(102,204,255,.32), 0 10px 34px rgba(30,90,145,.16);
}

.hero h1::after,
.home-hero h1::after,
section.hero h1::after{
  content:"";
  display:block;
  width:min(240px,46vw);
  height:3px;
  margin-top:18px;
  border-radius:999px;
  background:linear-gradient(90deg,var(--luo-primary),var(--luo-violet),transparent);
  box-shadow:0 0 18px rgba(102,204,255,.55);
}

.hero p,
.home-hero p,
section.hero p{
  max-width:720px;
  font-size:clamp(15px,1.4vw,18px);
  color:#375269;
}

.hero-badge,
.badge,
.site-badge{
  backdrop-filter:blur(14px);
  border:1px solid rgba(102,204,255,.24)!important;
  box-shadow:0 10px 32px rgba(102,204,255,.14);
}

/* visual weight hierarchy */
.section{
  scroll-margin-top:88px;
}

.section-head{
  align-items:flex-end;
  gap:18px;
}

.section-title{
  letter-spacing:.03em;
}

.section-desc{
  max-width:740px;
}

/* Works and articles should be the door of the site */
#works,
#featuredWorks,
#articles,
#featuredArticles,
section[data-home-priority="featured"],
.home-priority-section{
  position:relative;
  padding:30px;
  border-radius:30px;
  background:linear-gradient(135deg, rgba(255,255,255,.72), rgba(238,249,255,.42));
  border:1px solid rgba(102,204,255,.22);
  box-shadow:0 20px 64px rgba(41,103,154,.12);
}

#works .grid-3,
#featuredWorks .grid-3,
.home-featured-grid,
#articles .grid-3,
#featuredArticles .grid-3{
  display:grid!important;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr)!important;
  gap:20px!important;
}

#works .content-card:first-child,
#featuredWorks .content-card:first-child,
.home-featured-grid .content-card:first-child{
  grid-row:span 2;
  min-height:360px;
}

.article-card-compact,
#articles .content-card,
#featuredArticles .content-card{
  display:grid;
  grid-template-columns:120px minmax(0,1fr);
  align-items:center;
  gap:16px;
}

.article-card-compact img,
#articles .content-card img,
#featuredArticles .content-card img{
  width:120px!important;
  height:88px!important;
  border-radius:18px!important;
  object-fit:cover!important;
}

/* Sayings: small bubble timeline */
#sayings .grid-2,
#posts .grid-2,
.say-timeline{
  display:grid!important;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr))!important;
  gap:14px!important;
}

#sayings .content-card,
#posts .content-card,
.say-card{
  position:relative;
  padding:16px 16px 16px 22px!important;
  border-radius:22px!important;
  background:rgba(255,255,255,.64)!important;
  box-shadow:0 12px 38px rgba(37,95,148,.1)!important;
}

#sayings .content-card::before,
#posts .content-card::before,
.say-card::before{
  content:"";
  position:absolute;
  left:8px;
  top:20px;
  width:6px;
  height:calc(100% - 40px);
  border-radius:999px;
  background:linear-gradient(180deg,var(--luo-primary),var(--luo-violet));
}

.say-month-title{
  grid-column:1/-1;
  margin:12px 0 2px;
  font-weight:800;
  color:#274863;
  letter-spacing:.04em;
}

.say-more-btn,
.luo-inline-btn{
  border:0;
  background:rgba(102,204,255,.16);
  color:#27617f;
  border-radius:999px;
  padding:7px 12px;
  cursor:pointer;
  font-weight:700;
}

.say-more-btn:hover,
.luo-inline-btn:hover{
  background:rgba(102,204,255,.28);
}

/* albums */
.album-tile img,
#albums img{
  aspect-ratio: 4 / 3;
  object-fit:cover!important;
}

/* Interaction compression */
.home-interaction-dock,
#guestbook,
#questions,
#qa,
#community,
#communityPosts{
  position:relative;
}

.home-interaction-dock{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}

.interaction-entry,
.home-interaction-dock .panel,
#guestbook .panel,
#questions .panel,
#qa .panel,
#community .panel{
  border-radius:24px!important;
  background:rgba(255,255,255,.58)!important;
}

.login-locked,
.requires-login,
.luo-login-required{
  opacity:.78;
  pointer-events:none;
  filter:grayscale(.15);
}

.luo-login-tip{
  margin:10px 0;
  padding:12px 14px;
  border-radius:16px;
  background:rgba(102,204,255,.12);
  border:1px dashed rgba(102,204,255,.35);
  color:#315d79;
  font-size:14px;
}

/* Empty and loading states */
.skeleton-card,
.loading,
.empty,
.luo-empty-state{
  border-radius:22px!important;
  padding:22px!important;
  background:linear-gradient(135deg, rgba(255,255,255,.62), rgba(235,249,255,.42))!important;
  border:1px solid rgba(102,204,255,.18)!important;
  color:#587287!important;
}

.luo-empty-state{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.luo-empty-state strong{
  display:block;
  color:#244963;
  margin-bottom:4px;
}

.luo-empty-state .spark{
  width:42px;
  height:42px;
  border-radius:16px;
  background:radial-gradient(circle at 35% 35%, #fff, var(--luo-primary));
  box-shadow:0 0 22px rgba(102,204,255,.44);
  flex:0 0 auto;
}

/* image lightbox */
.image-lightbox{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:28px;
  background:rgba(5,12,24,.72);
  backdrop-filter:blur(16px);
}

.image-lightbox.is-open{
  display:flex;
}

.image-lightbox img{
  max-width:min(1120px,92vw);
  max-height:86vh;
  border-radius:24px;
  box-shadow:0 24px 90px rgba(0,0,0,.45);
  object-fit:contain;
}

.image-lightbox .close{
  position:fixed;
  top:22px;
  right:24px;
  width:44px;
  height:44px;
  border:0;
  border-radius:50%;
  background:rgba(255,255,255,.84);
  color:#18344c;
  font-size:22px;
  cursor:pointer;
}

/* Music entrance */
.luo-music-float{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:99;
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border-radius:999px;
  border:1px solid rgba(102,204,255,.25);
  background:rgba(255,255,255,.72);
  backdrop-filter:blur(16px);
  box-shadow:0 14px 42px rgba(39,100,150,.2);
  color:#24506b;
  font-weight:800;
  cursor:pointer;
}

.luo-music-float::before{
  content:"♪";
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius:50%;
  background:linear-gradient(135deg,var(--luo-primary),var(--luo-violet));
  color:white;
  box-shadow:0 0 20px rgba(102,204,255,.4);
}

/* micro interactions */
.content-card,
.feature-link,
.friend-card,
.album-tile,
.article-card-compact,
.panel{
  transition:transform .24s ease-out, box-shadow .24s ease-out, border-color .24s ease-out;
}

.content-card:hover,
.feature-link:hover,
.friend-card:hover,
.album-tile:hover,
.article-card-compact:hover{
  transform:translateY(-4px);
  box-shadow:0 20px 54px rgba(34,94,150,.16)!important;
  border-color:rgba(102,204,255,.36)!important;
}

/* Dark mode */
[data-theme="dark"] body,
body.dark,
html.dark body{
  background:
    radial-gradient(circle at 12% 8%, rgba(102,204,255,.18), transparent 32%),
    radial-gradient(circle at 86% 16%, rgba(183,156,255,.14), transparent 30%),
    linear-gradient(180deg, #07111f 0%, #0b1728 48%, #07111f 100%);
  color:#dbefff;
}

[data-theme="dark"] .hero,
body.dark .hero,
html.dark .hero{
  background:
    linear-gradient(135deg, rgba(15,30,52,.78), rgba(13,27,49,.58)),
    radial-gradient(circle at 82% 22%, rgba(102,204,255,.22), transparent 36%),
    radial-gradient(circle at 70% 82%, rgba(183,156,255,.18), transparent 32%)!important;
  border-color:rgba(102,204,255,.22)!important;
}

[data-theme="dark"] .hero h1,
body.dark .hero h1,
html.dark .hero h1{
  color:#eaf9ff;
}

[data-theme="dark"] .content-card,
[data-theme="dark"] .panel,
[data-theme="dark"] #works,
[data-theme="dark"] #articles,
body.dark .content-card,
body.dark .panel{
  background:rgba(12,26,46,.68)!important;
  border-color:rgba(102,204,255,.18)!important;
  color:#dcefff;
}

[data-theme="dark"] .meta,
body.dark .meta{
  color:#9fc5d9;
}

/* mobile */
@media (max-width: 980px){
  #works .grid-3,
  #featuredWorks .grid-3,
  .home-featured-grid,
  #articles .grid-3,
  #featuredArticles .grid-3{
    grid-template-columns:1fr!important;
  }

  #works .content-card:first-child,
  #featuredWorks .content-card:first-child,
  .home-featured-grid .content-card:first-child{
    grid-row:auto;
    min-height:auto;
  }

  .home-interaction-dock{
    grid-template-columns:1fr;
  }
}

@media (max-width: 640px){
  .hero,
  .home-hero,
  section.hero{
    min-height:360px;
    padding:24px!important;
  }

  .article-card-compact,
  #articles .content-card,
  #featuredArticles .content-card{
    grid-template-columns:1fr;
  }

  .article-card-compact img,
  #articles .content-card img,
  #featuredArticles .content-card img{
    width:100%!important;
    height:auto!important;
    aspect-ratio:16/9;
  }

  .luo-music-float{
    right:14px;
    bottom:14px;
    padding:10px 12px;
    font-size:13px;
  }

  button,
  .btn,
  input,
  textarea,
  select{
    min-height:44px;
  }
}
