:root {
  --background: #fbf8ff;
  --canvas-top: #f8f9fd;
  --canvas-bottom: #edf1fb;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --glass-surface: rgba(255, 255, 255, 0.48);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-highlight: rgba(255, 255, 255, 0.92);
  --panel-stroke: rgba(113, 131, 214, 0.18);
  --panel-stroke-strong: rgba(99, 120, 255, 0.34);
  --text-primary: #24304f;
  --text-secondary: #7a84a6;
  --text-muted: #97a2c3;
  --primary: #6378ff;
  --primary-strong: #5167ee;
  --primary-soft: rgba(99, 120, 255, 0.12);
  --warm: #ee765b;
  --shadow-lg: 0 28px 72px rgba(47, 58, 103, 0.14);
  --shadow-md: 0 20px 44px rgba(63, 78, 132, 0.11);
  --shadow-sm: 0 12px 28px rgba(63, 78, 132, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --blur-strength: 22px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  overflow-x: hidden;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 255, 255, 0.98), transparent 24%),
    radial-gradient(circle at 82% 12%, rgba(141, 154, 224, 0.2), transparent 22%),
    radial-gradient(circle at 84% 86%, rgba(155, 176, 255, 0.16), transparent 24%),
    linear-gradient(180deg, var(--canvas-top) 0%, #f3f5fc 48%, var(--canvas-bottom) 100%);
  font-family: "Plus Jakarta Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei UI", sans-serif;
}

body,
button,
input,
textarea {
  font: inherit;
}

button,
input,
textarea {
  appearance: none;
}

a {
  color: inherit;
}

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

.site-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-slide {
  position: absolute;
  inset: -3%;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.06);
  animation: driftFade 21s infinite ease-in-out;
  filter: saturate(1.02);
}

.bg-slide-1 {
  background-image: url("./assets/caiyue-showcase-sunlit.png");
  animation-delay: 0s;
}

.bg-slide-2 {
  background-image: url("./assets/archive-showcase-library.png");
  animation-delay: 7s;
}

.bg-slide-3 {
  background-image: url("./assets/caiyue-showcase-morning.png");
  animation-delay: 14s;
}

.backdrop-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(248, 249, 253, 0.18) 0%, rgba(248, 249, 253, 0.56) 24%, rgba(251, 248, 255, 0.84) 56%, rgba(251, 248, 255, 0.96) 100%);
}

.backdrop-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 26%, rgba(255, 255, 255, 0.44), transparent 18%),
    radial-gradient(circle at 78% 18%, rgba(141, 154, 224, 0.16), transparent 18%),
    radial-gradient(circle at 76% 78%, rgba(238, 118, 91, 0.08), transparent 14%);
}

.ambient {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  width: 38vw;
  height: 38vw;
  max-width: 420px;
  max-height: 420px;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.5;
}

.ambient-left {
  top: -10vw;
  left: -8vw;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0));
}

.ambient-right {
  right: -10vw;
  bottom: -8vw;
  background: radial-gradient(circle, rgba(130, 145, 255, 0.2), rgba(130, 145, 255, 0));
}

.hidden {
  display: none !important;
}

.glass-panel {
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(var(--blur-strength));
}

.eyebrow,
.nav-overline {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: #8d9ae0;
}

.muted-note {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.72;
}

.small-text {
  font-size: 12px;
}

.hero-title,
.auth-head-stacked h2,
.showcase-copy h2,
.showcase-copy h3,
.manifest-card h3,
.brand-card h2,
.stage-hero-copy h2,
.stage-header h2,
.empty-state h3,
.nav-title {
  margin: 0;
  font-family: "Noto Serif SC", "Songti SC", serif;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1480px);
  margin: 0 auto;
  min-height: 100vh;
  padding: 20px 20px 28px;
}

.auth-view,
.chat-view {
  min-height: calc(100vh - 48px);
}

.auth-view {
  display: grid;
  gap: 24px;
  align-content: start;
}

.site-nav,
.chat-topbar {
  position: sticky;
  top: 18px;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 22px;
  border-radius: 999px;
}

.nav-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-brand-compact .nav-avatar {
  width: 48px;
  height: 48px;
}

.nav-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 14px 30px rgba(81, 103, 238, 0.16);
  background: rgba(255, 255, 255, 0.82);
  flex-shrink: 0;
}

.nav-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.nav-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.nav-title {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1;
  letter-spacing: 0.18em;
  color: var(--text-primary);
}

.nav-title-small {
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  transition: color 180ms ease, transform 180ms ease;
}

.nav-links a:hover {
  color: var(--primary);
  transform: translateY(-1px);
}

.landing-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 430px);
  gap: 24px;
  align-items: start;
}

.landing-copy,
.auth-column {
  min-width: 0;
  display: grid;
  gap: 20px;
}

.hero-card {
  padding: 30px 32px 32px;
  border-radius: 40px;
  display: grid;
  gap: 18px;
}

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

.hero-badges span,
.role-tag,
.local-badge,
.status-pill {
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid rgba(99, 120, 255, 0.14);
  background: rgba(255, 255, 255, 0.72);
  color: #6f7ca6;
  font-size: 13px;
  font-weight: 500;
}

.local-badge {
  border-color: rgba(238, 118, 91, 0.22);
  color: #b06149;
}

.status-pill {
  border-color: rgba(122, 132, 166, 0.16);
  color: var(--text-secondary);
}

.role-tag {
  border-color: rgba(99, 120, 255, 0.22);
  color: var(--primary-strong);
}

.hero-kicker {
  margin: 0;
  color: #7f8bb7;
  font-size: 15px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(48px, 7vw, 92px);
  line-height: 0.98;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  max-width: 9ch;
}

.hero-description {
  margin: 0;
  max-width: 64ch;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-quote {
  margin: 0;
  color: #8f99bf;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.showcase-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 18px;
}

.showcase-card {
  padding: 16px;
  border-radius: 32px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.showcase-card-main {
  grid-row: span 2;
}

.showcase-image,
.sidebar-hero-image,
.stage-hero-art {
  overflow: hidden;
  border-radius: calc(var(--radius-xl) - 8px);
  border: 1px solid rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.66);
}

.showcase-image {
  aspect-ratio: 16 / 10;
}

.showcase-card-main .showcase-image {
  aspect-ratio: 4 / 5;
}

.showcase-image img,
.sidebar-hero-image img,
.stage-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease;
}

.showcase-card:hover .showcase-image img,
.brand-card:hover .sidebar-hero-image img,
.stage-hero:hover .stage-hero-art img {
  transform: scale(1.03);
}

.manifest-card,
.stage-hero-copy {
  display: grid;
  gap: 10px;
}

.stage-hero-copy h2,
.manifest-card h3,
.brand-card h2,
.showcase-copy h2,
.showcase-copy h3 {
  font-size: clamp(20px, 3vw, 30px);
}

.showcase-copy p:last-child,
.manifest-card p:last-child,
.brand-card p:last-child,
.stage-hero-copy p:last-child {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.78;
}

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

.manifest-card {
  padding: 22px 24px;
  border-radius: 28px;
}

.auth-column {
  position: relative;
}

.auth-mark {
  display: grid;
  justify-items: center;
}

.auth-orb {
  width: 132px;
  height: 132px;
  padding: 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 255, 0.84));
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 56px rgba(99, 120, 255, 0.18);
}

.auth-avatar {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  object-fit: cover;
  object-position: center top;
}

.auth-copy-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.auth-quote,
.auth-side-note {
  margin: 0;
}

.auth-quote {
  color: #8090bb;
  font-size: 18px;
  letter-spacing: 0.08em;
}

.auth-side-note {
  color: #9aa4c2;
  font-size: 14px;
}

.auth-badges {
  justify-content: center;
}

.auth-card,
.brand-card,
.panel-card,
.conversation-shell,
.tool-drawer,
.plus-sheet,
.settings-sheet,
.composer,
.drawer-card,
.setting-card,
.cloud-settings-card {
  border-radius: var(--radius-xl);
}

.auth-card {
  position: relative;
  padding: 28px;
  display: grid;
  gap: 18px;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: 32px 32px 0 0;
  background: linear-gradient(90deg, var(--primary) 0%, rgba(99, 120, 255, 0.2) 100%);
}

.auth-head-stacked,
.panel-head,
.active-character,
.header-actions,
.account-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-head-stacked {
  display: grid;
  gap: 10px;
}

.auth-head-stacked h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
}

.auth-description {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.82;
}

.auth-mode-row,
.cloud-settings-grid,
.mode-row {
  display: grid;
  gap: 10px;
}

.auth-mode-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.field span,
.usage-label {
  font-size: 13px;
  font-weight: 600;
  color: #6f7ca6;
}

.field input,
.field textarea,
.composer textarea {
  width: 100%;
  border: 1px solid rgba(123, 139, 214, 0.22);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.field input:focus,
.field textarea:focus,
.composer textarea:focus {
  outline: none;
  border-color: var(--panel-stroke-strong);
  box-shadow: 0 0 0 4px rgba(99, 120, 255, 0.12);
}

.ghost-btn,
.secondary-btn,
.primary-btn,
.icon-btn,
.mode-btn,
.sheet-action,
.sticker-chip,
.sticker-card,
.kaomoji-pill,
.nav-cta,
.primary-link-btn {
  border: 1px solid var(--panel-stroke);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text-primary);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
  text-decoration: none;
}

.ghost-btn:hover,
.secondary-btn:hover,
.primary-btn:hover,
.icon-btn:hover,
.mode-btn:hover,
.sheet-action:hover,
.sticker-chip:hover,
.sticker-card:hover,
.kaomoji-pill:hover,
.nav-cta:hover,
.primary-link-btn:hover,
.link-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.ghost-btn,
.secondary-btn,
.primary-btn,
.mode-btn,
.sheet-action,
.kaomoji-pill {
  padding: 12px 14px;
}

.nav-cta,
.primary-link-btn,
.primary-btn {
  border-color: transparent;
  background: linear-gradient(180deg, #7186ff 0%, var(--primary-strong) 100%);
  color: #ffffff;
}

.nav-cta,
.primary-link-btn {
  padding: 12px 18px;
  font-weight: 700;
}

.secondary-btn {
  color: var(--primary-strong);
}

.mode-btn.active {
  border-color: transparent;
  color: white;
  background: linear-gradient(180deg, #7186ff 0%, var(--primary-strong) 100%);
}

.mode-btn[disabled] {
  opacity: 0.52;
  cursor: not-allowed;
}

.icon-btn {
  width: 50px;
  height: 50px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
}

.small-btn {
  padding: 8px 12px;
  font-size: 13px;
}

.auth-submit {
  width: 100%;
  min-height: 56px;
  font-weight: 700;
}

.chat-view {
  display: grid;
  gap: 18px;
  align-content: start;
}

.chat-topbar {
  border-radius: 28px;
}

.chat-topbar-copy {
  min-width: 0;
  max-width: 440px;
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.chat-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 20px;
}

.sidebar {
  min-width: 0;
  display: grid;
  gap: 16px;
  align-content: start;
  position: sticky;
  top: 108px;
  max-height: calc(100vh - 128px);
  overflow: auto;
  padding-right: 4px;
}

.brand-card,
.panel-card,
.tool-drawer,
.plus-sheet,
.settings-sheet {
  padding: 20px;
}

.brand-card,
.panel-card {
  display: grid;
  gap: 14px;
}

.sidebar-hero-image {
  aspect-ratio: 16 / 10;
}

.panel-head,
.header-actions {
  justify-content: space-between;
}

.panel-head h3,
.brand-card h2,
.stage-header h2,
.empty-state h3 {
  margin: 0;
}

.account-box {
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
}

.account-box strong {
  font-size: 20px;
}

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

.usage-grid > div,
.setting-card,
.cloud-settings-card,
.drawer-card {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(113, 131, 214, 0.14);
  display: grid;
  gap: 8px;
}

.character-list {
  display: grid;
  gap: 10px;
}

.character-card {
  width: 100%;
  padding: 12px;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid rgba(113, 131, 214, 0.16);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.character-card:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 120, 255, 0.3);
  box-shadow: var(--shadow-sm);
}

.character-card.active {
  border-color: rgba(99, 120, 255, 0.34);
  background: linear-gradient(145deg, rgba(99, 120, 255, 0.12), rgba(255, 255, 255, 0.94));
}

.character-card[disabled] {
  opacity: 0.56;
  cursor: not-allowed;
}

.character-card img,
.active-character img,
.empty-state img {
  width: 62px;
  height: 62px;
  border-radius: 22px;
  object-fit: cover;
  object-position: center top;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-sm);
}

.character-card strong {
  display: block;
  margin-bottom: 4px;
}

.character-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.58;
  color: var(--text-secondary);
}

.mini-sticker-list,
.sticker-grid,
.kaomoji-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sticker-chip,
.sticker-card {
  width: 74px;
  height: 74px;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.sticker-chip img,
.sticker-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-stage {
  min-width: 0;
  min-height: calc(100vh - 128px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto auto auto;
  gap: 14px;
}

.stage-hero {
  padding: 18px;
  border-radius: 36px;
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
}

.stage-hero-art {
  aspect-ratio: 4 / 3;
}

.stage-hero-copy {
  align-content: center;
}

.stage-header {
  padding: 18px 20px;
  border-radius: 28px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.active-character {
  min-width: 0;
  align-items: center;
}

.active-character > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.conversation-shell {
  position: relative;
  padding: 18px;
  min-height: 460px;
  overflow: hidden;
}

.message-list {
  min-height: 100%;
  max-height: calc(100vh - 430px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
}

.message-list .ghost-btn {
  align-self: center;
}

.message {
  max-width: min(78%, 720px);
  padding: 16px 18px;
  border-radius: 28px;
  border: 1px solid rgba(113, 131, 214, 0.14);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
  animation: message-in 220ms ease;
}

.message.user {
  align-self: flex-end;
  background: linear-gradient(145deg, rgba(99, 120, 255, 0.12), rgba(255, 255, 255, 0.96));
}

.message.assistant {
  align-self: flex-start;
}

.message.local-only {
  border-style: dashed;
}

.message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.message-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.message-body {
  line-height: 1.82;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
}

.message-body img {
  display: block;
  max-width: 100%;
  max-height: 280px;
  margin-top: 12px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.empty-state {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  max-width: 420px;
  margin: 0 auto;
  padding: 24px;
  border-radius: 28px;
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
  border: 1px dashed rgba(113, 131, 214, 0.26);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.settings-sheet,
.card-studio-sheet,
.tool-drawer,
.plus-sheet {
  display: grid;
  gap: 14px;
}

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

.cloud-settings-card {
  gap: 14px;
}

.cloud-settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mode-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.drawer-card {
  gap: 14px;
}

.download-source-list {
  display: grid;
  gap: 10px;
}

.link-chip {
  display: block;
  padding: 14px 15px;
  border-radius: 20px;
  border: 1px solid rgba(113, 131, 214, 0.16);
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.link-chip strong,
.link-chip div {
  display: block;
}

.plus-sheet {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sheet-action {
  min-height: 58px;
}

.card-studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr);
  gap: 12px;
  align-items: start;
}

.card-form-card {
  grid-row: span 3;
}

.card-upload-box {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.card-image-preview {
  aspect-ratio: 4 / 5;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-sm);
}

.card-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-upload-copy {
  display: grid;
  gap: 10px;
}

.card-upload-copy strong {
  font-size: 22px;
}

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

.card-form-span-2 {
  grid-column: 1 / -1;
}

.card-form-grid textarea {
  min-height: 110px;
  resize: vertical;
}

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

.card-actions > * {
  flex: 1 1 180px;
}

.card-list {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding-right: 2px;
}

.card-list-empty {
  padding: 14px;
  border-radius: 20px;
  border: 1px dashed rgba(113, 131, 214, 0.22);
  background: rgba(255, 255, 255, 0.54);
  color: var(--text-secondary);
  line-height: 1.7;
}

.card-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(113, 131, 214, 0.16);
  background: rgba(255, 255, 255, 0.72);
}

.card-item-art {
  width: 88px;
  height: 116px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}

.card-item-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-item-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.card-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-item-head strong {
  font-size: 18px;
}

.card-item-summary {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.72;
}

.card-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-tag {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(99, 120, 255, 0.1);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 600;
}

.card-item-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.card-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.composer {
  padding: 12px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.composer textarea {
  resize: none;
  min-height: 54px;
  max-height: 180px;
}

.send-btn {
  min-width: 92px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 30;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(47, 58, 103, 0.92);
  color: white;
  box-shadow: 0 18px 34px rgba(56, 67, 118, 0.22);
}

.mobile-only {
  display: none;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(129, 147, 255, 0.28);
  border-radius: 999px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

@keyframes driftFade {
  0%,
  25% {
    opacity: 0;
    transform: scale(1.06);
  }
  33%,
  58% {
    opacity: 1;
    transform: scale(1);
  }
  66%,
  100% {
    opacity: 0;
    transform: scale(1.06);
  }
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1240px) {
  .landing-shell {
    grid-template-columns: 1fr;
  }

  .auth-column {
    max-width: 520px;
    justify-self: end;
    width: 100%;
  }

  .chat-layout {
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  }

  .stage-hero {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .app-shell {
    padding: 16px;
  }

  .auth-view,
  .chat-view {
    min-height: calc(100vh - 32px);
  }

  .site-nav,
  .chat-topbar {
    top: 12px;
    padding: 14px 16px;
    border-radius: 26px;
  }

  .nav-links,
  .chat-topbar-copy {
    display: none;
  }

  .showcase-grid,
  .manifest-grid,
  .settings-grid,
  .card-studio-layout,
  .drawer-columns,
  .cloud-settings-grid,
  .mode-row,
  .plus-sheet,
  .usage-grid,
  .auth-mode-row {
    grid-template-columns: 1fr;
  }

  .showcase-card-main {
    grid-row: auto;
  }

  .showcase-card-main .showcase-image {
    aspect-ratio: 16 / 10;
  }

  .chat-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 74px auto 12px 12px;
    width: min(88vw, 340px);
    z-index: 20;
    transform: translateX(-112%);
    transition: transform 180ms ease;
    max-height: none;
    padding-right: 6px;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .mobile-only {
    display: inline-flex;
  }

  .chat-stage {
    min-height: 0;
    grid-template-rows: auto auto minmax(380px, 1fr) auto auto auto auto;
  }

  .stage-hero {
    grid-template-columns: 1fr;
  }

  .stage-hero-art {
    aspect-ratio: 16 / 10;
  }

  .card-upload-box,
  .card-form-grid {
    grid-template-columns: 1fr;
  }

  .card-form-card {
    grid-row: auto;
  }

  .stage-header {
    align-items: flex-start;
  }

  .header-actions {
    justify-content: flex-end;
  }

  .message-list {
    max-height: none;
    min-height: 340px;
  }

  .message {
    max-width: 92%;
  }

  .auth-copy-line {
    display: grid;
    gap: 6px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .hero-card,
  .auth-card,
  .brand-card,
  .panel-card,
  .tool-drawer,
  .plus-sheet,
  .settings-sheet,
  .card-studio-sheet,
  .conversation-shell,
  .stage-hero,
  .stage-header {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav-title {
    font-size: 24px;
    letter-spacing: 0.12em;
  }

  .nav-cta {
    padding: 10px 14px;
  }

  .hero-title {
    font-size: clamp(38px, 12vw, 56px);
  }

  .composer {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .send-btn {
    grid-column: 1 / -1;
  }

  .empty-state {
    left: 12px;
    right: 12px;
    padding: 20px;
  }

  .active-character img,
  .empty-state img,
  .character-card img {
    width: 56px;
    height: 56px;
  }

  .card-item {
    grid-template-columns: 1fr;
  }

  .card-item-art {
    width: 100%;
    height: 180px;
  }
}
