:root {
  --bg: #100d12;
  --side: #16131a;
  --panel: #1c1822;
  --card: #241f2b;
  --ink: #f6f1f8;
  --muted: #b7adbc;
  --soft: #8d8494;
  --line: rgba(246, 241, 248, 0.1);
  --accent: #ee8b6d;
  --accent-2: #c9a6ff;
  --live: #ff4d6a;
  --sans: "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Arabic", "Noto Sans", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { color-scheme: dark; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(140, 80, 160, 0.28), transparent 60%),
    var(--bg);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
::placeholder { color: #6e6574; }

.app {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 14px 16px;
  background: rgba(16, 13, 18, 0.92);
  border-right: 1px solid var(--line);
  overflow: auto;
}
.brand-btn, .nav-btn, .chip, .icon-btn, .primary, .ghost, .text-btn {
  border: 0;
  background: transparent;
}
.brand-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: left;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd0c2, var(--accent));
}
.nav-label {
  margin: 14px 8px 6px;
  color: var(--soft);
  font-size: 12px;
}
.nav-btn, .filter-row button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  color: var(--muted);
  text-align: left;
}
.nav-btn.is-on, .filter-row button.is-on, .nav-btn:hover, .filter-row button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 4px 8px; }
.filter-row button {
  width: auto;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
}
.create-side {
  margin-top: 16px;
  height: 44px;
  border-radius: 999px;
  background: #f4f0f6;
  color: #1a1420;
  font-weight: 650;
}

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 64px;
  padding: 0 18px;
}
.top h1 {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 650;
}
.live-word {
  display: inline-block;
  margin: 0 4px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--live);
  color: white;
  font-size: 12px;
  letter-spacing: 0.08em;
}
.icon-btn, .primary, .ghost {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  white-space: nowrap;
  flex: none;
}
.icon-btn { border: 1px solid var(--line); color: var(--muted); }
.lang-switch {
  height: 36px;
  max-width: 132px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  flex: none;
}
.primary { background: linear-gradient(180deg, #f6b39a, #e88368); color: #2c120c; font-weight: 650; }
.ghost { border: 1px solid var(--line); background: transparent; }
.menu-btn { display: none; }

.content { flex: 1; min-height: 0; overflow: auto; padding: 6px 22px 28px; }
.hero { margin: 8px 0 18px; text-align: center; }
.hero h2 { margin: 0; font-size: clamp(28px, 4vw, 40px); letter-spacing: 0.04em; }
.block-title { margin: 28px 0 12px; font-size: 18px; font-weight: 600; }
.rail, .features { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kind-card, .feature {
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.kind-card strong, .feature strong { display: block; margin-bottom: 6px; font-size: 15px; }
.kind-card span, .feature span { color: var(--muted); font-size: 13px; line-height: 1.55; }
.scene-card {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 13px;
}
.hero p { margin: 8px auto 0; max-width: 36em; color: var(--muted); }

.ready-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(210px, 240px);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 18px;
  scroll-snap-type: x mandatory;
}
.ready {
  position: relative;
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  text-align: left;
  scroll-snap-align: start;
  background:
    radial-gradient(90px 70px at 50% 28%, rgba(255, 230, 214, 0.75), transparent 68%),
    linear-gradient(165deg, var(--b, #d7b4a4), var(--a, #2a2030) 70%);
}
.ready-copy {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.ready strong { font-size: 18px; }
.ready em {
  color: rgba(255, 255, 255, 0.86);
  font-style: normal;
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-pill {
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #2c120c;
  font-size: 13px;
  font-weight: 700;
}
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 18px; }
.plan { padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.plan.is-on { border-color: rgba(238, 139, 109, 0.7); }
.plan p { margin: 8px 0 14px; color: var(--muted); line-height: 1.55; font-size: 14px; }
.plan .primary { border: 0; }
.moods { display: flex; gap: 6px; }
.chip.is-on { background: rgba(238, 139, 109, 0.2); color: var(--ink); }
.origin-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 4px 0 22px; }
.origin-col h3 { margin: 0 0 10px; font-size: 16px; }
.origin-cards { display: grid; gap: 10px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.person, .create-card {
  position: relative;
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  text-align: left;
  background:
    radial-gradient(80px 60px at 50% 34%, rgba(255, 230, 214, 0.7), transparent 70%),
    linear-gradient(165deg, var(--b, #d7b4a4), var(--a, #2a2030) 72%);
}
.person-face { position: absolute; inset: 0; z-index: 0; }
.person-face.has-photo, .mini.has-photo {
  background-size: cover;
  background-position: center 18%;
  transform-origin: center 30%;
  animation: live-drift 8s ease-in-out infinite alternate;
}
.person::after, .ready::after, .stage-live::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 46%, rgba(8, 6, 12, 0.78));
}
.badge, .person-meta, .ready-copy, .stage-live .caption { z-index: 2; }
.person-meta, .create-card span {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
}
.person strong, .create-card strong { display: block; font-size: 16px; }
.person em, .create-card em { color: rgba(255,255,255,.78); font-style: normal; font-size: 13px; }
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--live);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.create-card {
  display: flex;
  align-items: flex-end;
  border: 1px dashed rgba(255,255,255,.2);
  background:
    linear-gradient(180deg, rgba(201,166,255,.18), rgba(20,16,24,.2)),
    #221c2a;
}

.feed, .creators { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.feed article, .creators article, .wizard, .chat, .modal {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(28, 24, 34, 0.92);
}
.feed article, .creators article { display: flex; gap: 12px; align-items: center; padding: 12px; }
.mini {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(150deg, var(--b), var(--a));
  color: #2c120c;
  font-weight: 700;
}
.feed p, .creators p { margin: 4px 0 0; color: var(--muted); }

.content.is-chat { padding: 0; overflow: hidden; }
.chat-shell {
  position: relative;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) minmax(280px, 34vw);
  grid-template-areas: "list main photo";
  height: calc(100dvh - 64px);
  background: #141218;
}
.chat-list { grid-area: list; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: #120f16; }
.chat-tabs { display: flex; gap: 8px; padding: 14px 12px 8px; }
.chat-tabs button { height: 34px; padding: 0 12px; border-radius: 999px; color: var(--muted); background: transparent; }
.chat-tabs button.is-on { background: #2c2833; color: var(--ink); }
.chat-items { overflow: auto; }
.chat-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border: 0;
  background: transparent;
}
.chat-item.is-on { background: rgba(255, 255, 255, 0.05); }
.chat-item strong { display: block; font-size: 14px; }
.chat-item em, .chat-item time { color: var(--soft); font-style: normal; font-size: 12px; }
.chat-item em { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-main { grid-area: main; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #1b1822; }
.chat-photo { grid-area: photo; position: relative; overflow: hidden; background: #100e14; }
.chat-photo .person-face { border-radius: 0; }
.list-toggle { display: none; }
.disclaimer, .day-line { margin: 0; color: var(--soft); font-size: 12px; text-align: center; }
.disclaimer { margin-top: auto; }
.send-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #d7b6ff, #ee8b6d);
  color: #2c120c;
  font-size: 18px;
  font-weight: 700;
}
.chat-head, .composer, .wizard-foot { display: flex; gap: 10px; align-items: center; padding: 12px; }
.chat-head .who { display: flex; gap: 10px; align-items: center; margin-right: auto; min-width: 0; }
.chat-head .who div { min-width: 0; }
.chat-head strong, .chat-head em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head em { display: block; color: var(--soft); font-style: normal; font-size: 12px; }
.stage-live {
  position: relative;
  margin: 0 12px;
  border-radius: 16px;
  background:
    radial-gradient(120px 80px at 50% 42%, rgba(255, 226, 210, 0.75), transparent 68%),
    linear-gradient(165deg, var(--b, #d7b4a4), #141018 74%);
}
.stage-live .caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  color: white;
  font-size: 13px;
}
.thread { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; }
.bubble { max-width: min(78%, 460px); margin: 0; padding: 10px 12px 6px; border-radius: 16px; background: #34303b; line-height: 1.55; }
.bubble time { display: block; margin-top: 4px; color: var(--soft); font-size: 11px; text-align: right; }
.bubble.me { align-self: flex-end; border-radius: 14px 14px 5px 14px; background: #3d2c34; }
.bubble.typing { display: flex; gap: 5px; align-items: center; width: 54px; min-height: 36px; }
.bubble.typing i { width: 6px; height: 6px; border-radius: 50%; background: #d9c6ea; animation: blink 1s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: .15s; }
.bubble.typing i:nth-child(3) { animation-delay: .3s; }
.presence { color: #f0a090; }
@keyframes blink { 50% { opacity: .25; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 8px; }
.chip { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.composer input, .field input, .search-input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #120f16;
  font-size: 16px;
}
.composer input { flex: 1; min-width: 0; }
.composer button, .wizard-foot .primary { border-radius: 999px; }

.photo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid rgba(238, 139, 109, 0.45);
  border-radius: 18px;
  background: linear-gradient(120deg, #3a2230, #241820);
}
.photo-banner strong { display: block; font-size: 18px; }
.photo-banner p { margin: 6px 0 0; color: var(--muted); line-height: 1.5; }
.photo-banner .primary { flex: none; }
.photo-studio {
  max-width: 760px;
  margin: 0 auto 18px;
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #1a1520;
}
.photo-studio h2 { margin: 0 16px 8px; font-size: 26px; text-align: center; }
.photo-lead { margin: 0 16px 14px; color: var(--muted); line-height: 1.6; text-align: center; }
.photo-drop { display: grid; grid-template-columns: 148px 1fr; gap: 16px; align-items: start; padding: 0 16px; }
.photo-preview {
  aspect-ratio: 3 / 4;
  border: 1px dashed rgba(255,255,255,.28);
  border-radius: 16px;
  background: #2a2433 center / cover no-repeat;
}
.photo-preview.has-photo { border-style: solid; border-color: var(--accent); }
.photo-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 0 0 12px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #201b27;
  cursor: pointer;
}
.photo-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-studio .field, .photo-studio .age-row { padding-left: 0; padding-right: 0; }
.photo-hint { margin: 0 0 10px; color: #f0a090; font-size: 13px; }
.photo-studio .primary { min-height: 44px; padding: 0 16px; border-radius: 999px; }
.wizard { max-width: 760px; margin: 0 auto; padding: 8px 8px 18px; }
.wizard h2 { margin: 8px 16px; font-size: 28px; text-align: center; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; padding: 8px 16px 16px; }
.choice-grid button, .seg button {
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #201b27;
}
.choice-grid button.is-on, .seg button.is-on { border-color: var(--accent-2); background: rgba(201, 166, 255, 0.14); }
.seg { display: flex; gap: 8px; justify-content: center; padding: 0 16px 12px; }
.seg button { min-height: 40px; padding: 0 18px; }
.age-row { display: flex; align-items: center; gap: 12px; padding: 0 16px 16px; color: var(--muted); }
.age-row input { flex: 1; }
.field { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 12px; color: var(--muted); font-size: 14px; }
.field input { border-radius: 14px; }
.wizard-foot { justify-content: space-between; }
.steps { margin: 0; color: var(--soft); font-size: 13px; }

.mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 6, 10, 0.72);
}
.modal { width: min(440px, 100%); padding: 22px; }
.modal h2 { margin: 0 0 8px; }
.modal p { margin: 0 0 14px; color: var(--muted); line-height: 1.6; }
.modal .primary, .modal .ghost { width: 100%; margin-top: 8px; }
.search-input { width: 100%; margin-bottom: 10px; }
.empty { color: var(--soft); text-align: center; padding: 32px 0; }
.noscript { margin: 24px; color: var(--muted); }

@media (max-width: 800px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; position: fixed; inset: 0 auto 0 0; z-index: 15; width: min(280px, 86vw); }
  .side.is-open { display: flex; }
  .menu-btn { display: inline-flex; align-items: center; }
  .watch-btn { display: none; }
  .top { padding: 0 10px; gap: 6px; }
  .top h1 { font-size: 14px; }
  .icon-btn, .primary { padding: 0 10px; }
  .chat-head { flex-wrap: nowrap; }
  .content { padding: 0 12px 20px; }
  .content.is-chat { padding: 0; }
  .origin-board { grid-template-columns: 1fr; }
  .photo-banner { flex-direction: column; align-items: stretch; }
  .lang-switch { max-width: 96px; }
  .photo-drop { grid-template-columns: 1fr; }
  .photo-preview { max-width: 180px; }
  .list-toggle { display: inline-flex; }
  .chat-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "photo" "main";
    grid-template-rows: 210px minmax(0, 1fr);
    height: calc(100dvh - 64px);
  }
  .chat-list { display: none; position: absolute; z-index: 6; inset: 0 auto 0 0; width: min(280px, 88vw); }
  .chat-shell.is-list .chat-list { display: flex; }
}
@keyframes live-drift {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to { transform: scale(1.12) translate3d(-1.6%, -2%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .has-photo, .bubble.typing i { animation: none; }
}
