:root {
  --bg: #f8f4ef;
  --surface: rgba(255, 250, 245, 0.76);
  --surface-strong: rgba(255, 252, 248, 0.92);
  --border: rgba(146, 90, 45, 0.16);
  --text: #2d241f;
  --muted: #625248;
  --accent: #c9672f;
  --accent-strong: #b65421;
  --shadow: 0 18px 45px rgba(130, 90, 60, 0.14);
  --sidebar: rgba(255, 252, 248, 0.88);
  --sidebar-soft: rgba(255, 248, 242, 0.96);
  --sidebar-text: #2d241f;
  --sidebar-muted: #8a7667;
  --chat-bg: transparent;
}

body.dark {
  --bg: #16131f;
  --surface: rgba(28, 26, 39, 0.72);
  --surface-strong: rgba(34, 31, 48, 0.92);
  --border: rgba(255, 211, 188, 0.12);
  --text: #f5eee8;
  --muted: #c4b6ad;
  --accent: #ff9152;
  --accent-strong: #ff7d33;
  --shadow: 0 24px 48px rgba(5, 5, 12, 0.35);
  --sidebar: rgba(33, 29, 43, 0.9);
  --sidebar-soft: rgba(42, 37, 55, 0.96);
  --sidebar-text: #f4f4f5;
  --sidebar-muted: #b3abbd;
  --chat-bg: transparent;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Outfit", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 137, 107, 0.6), transparent 20%),
    radial-gradient(circle at 60% 15%, rgba(250, 193, 93, 0.44), transparent 18%),
    radial-gradient(circle at 42% 38%, rgba(255, 154, 204, 0.42), transparent 14%),
    radial-gradient(circle at 86% 12%, rgba(127, 174, 255, 0.58), transparent 22%),
    linear-gradient(180deg, #f7e6dc 0%, #eceff8 58%, #f5f5f3 100%);
}

body.dark {
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 122, 89, 0.28), transparent 22%),
    radial-gradient(circle at 70% 10%, rgba(118, 139, 255, 0.34), transparent 20%),
    radial-gradient(circle at 50% 42%, rgba(241, 151, 255, 0.18), transparent 16%),
    linear-gradient(180deg, #16131f 0%, #191b27 52%, #12131c 100%);
}

button,
textarea {
  font: inherit;
}

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

.app-shell {
  min-height: 100vh;
}

.landing-screen,
.chat-screen {
  display: none;
  min-height: 100vh;
}

.landing-screen.active,
.chat-screen.active {
  display: block;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 28px;
}

.theme-toggle,
.lang-switch,
.cta-button,
.new-chat,
.sidebar-item,
.sidebar-link,
.header-chip,
.quick-chip,
.send-button,
.case-use,
.modal-close {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle,
.lang-switch {
  width: 42px;
  height: 42px;
  border-radius: 999px;
}

.lang-switch {
  width: auto;
  padding: 0 14px;
}

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 24px 72px;
}

.hero-copy {
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-size: 0.8rem;
}

.hero-copy h1 {
  margin: 0;
  font-family: "ZCOOL XiaoWei", serif;
  font-size: clamp(3.1rem, 8vw, 5.8rem);
  line-height: 1;
  color: #b65d33;
  text-shadow: 0 8px 28px rgba(255, 241, 232, 0.45);
}

body.dark .hero-copy h1 {
  color: #ffb183;
}

.subtitle {
  width: min(680px, 92%);
  margin: 20px auto 0;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  line-height: 1.7;
}

.cta-button {
  margin-top: 34px;
  padding: 15px 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff6f1;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 32px rgba(201, 103, 47, 0.24);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 58px auto 0;
  width: min(980px, 100%);
}

.feature-card {
  display: grid;
  grid-template-columns: 24px 1fr;
  column-gap: 10px;
  row-gap: 8px;
  align-items: start;
  align-content: start;
  min-height: 112px;
  padding: 22px 24px;
  border: 1px solid rgba(120, 110, 100, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 252, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(70, 78, 95, 0.08);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 24px;
  border-radius: 0;
  background: transparent;
  color: #28313c;
  font-size: 1.02rem;
  line-height: 1;
  transform: translateY(2px);
}

.feature-card h2 {
  margin: 0;
  color: #111827;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}

.feature-card p {
  grid-column: 2;
  margin: 0;
  color: #1f2937;
  line-height: 1.55;
  font-size: 0.98rem;
}

body.dark .feature-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(34, 31, 42, 0.88);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
}

body.dark .feature-icon,
body.dark .feature-card h2 {
  color: #f7f2ed;
}

body.dark .feature-card p {
  color: #d6c9bf;
}

.chat-screen.active {
  display: grid;
  grid-template-columns: 260px 1fr;
  background: transparent;
  height: 100vh;
  overflow: hidden;
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  gap: 18px;
  background: var(--sidebar);
  color: var(--sidebar-text);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(16px);
  height: 100vh;
  overflow: hidden;
}

.sidebar-brand {
  display: grid;
  gap: 14px;
}

.new-chat {
  padding: 12px 14px;
  border-radius: 14px;
  text-align: left;
  background: var(--sidebar-soft);
  color: var(--sidebar-text);
  border-color: var(--border);
}

.brand-kicker,
.chat-model,
.sidebar-title,
.modal-kicker {
  margin: 0 0 6px;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

.brand-block h2,
.chat-header h3,
.modal-header h4 {
  margin: 0;
}

.brand-block p:last-child {
  margin: 6px 0 0;
  color: var(--sidebar-muted);
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sidebar-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 0;
  flex: 1;
}

.sidebar-item,
.sidebar-link {
  padding: 11px 12px;
  border-radius: 12px;
  text-align: left;
  background: var(--sidebar-soft);
  color: var(--sidebar-text);
  border-color: var(--border);
}

.sidebar-item.active {
  background: rgba(201, 103, 47, 0.1);
}

.sidebar-item {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 0 auto;
  min-height: 44px;
}

.sidebar-bottom {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

body.dark .sidebar-bottom {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  background: transparent;
  overflow: hidden;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 20px 28px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
}

body.dark .chat-header {
  background: rgba(31, 33, 37, 0.82);
}

.chat-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-chip {
  padding: 10px 14px;
  border-radius: 999px;
}

.user-menu {
  position: relative;
}

.user-menu::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 12px;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  display: none;
  min-width: 188px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 252, 248, 0.99), rgba(255, 246, 239, 0.98));
  box-shadow: 0 22px 54px rgba(82, 48, 24, 0.2);
  backdrop-filter: blur(14px);
  transform-origin: top right;
  animation: dropdownIn 0.16s ease both;
}

body.dark .user-dropdown {
  background:
    linear-gradient(180deg, rgba(39, 35, 48, 0.99), rgba(33, 29, 43, 0.98));
}

.user-menu.logged-in.menu-open .user-dropdown {
  display: grid;
  gap: 4px;
}

.user-dropdown button {
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 11px 12px;
  text-align: left;
  transition: background 0.16s ease, transform 0.16s ease;
}

.user-dropdown button:hover {
  background: rgba(201, 103, 47, 0.1);
  transform: translateX(2px);
}

@keyframes dropdownIn {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.credits-chip {
  background: rgba(201, 103, 47, 0.1);
  color: var(--accent-strong);
  font-weight: 700;
}

.chat-messages {
  flex: 1;
  width: 100%;
  margin: 0;
  padding: 30px 24px 200px;
  min-height: 0;
  overflow-y: auto;
  background: transparent;
}

.message {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 24px;
  width: min(920px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.message.user {
  flex-direction: row-reverse;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f3b37f, #d87c52);
  color: #fffaf5;
  font-size: 0.88rem;
  font-weight: 700;
  flex: 0 0 auto;
  box-shadow: 0 8px 20px rgba(201, 103, 47, 0.18);
}

.message.user .avatar {
  background: #4f46e5;
}

.bubble {
  max-width: min(760px, calc(100% - 48px));
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(247, 247, 248, 0.9);
  border: 1px solid var(--border);
  line-height: 1.72;
}

body.dark .bubble {
  background: rgba(42, 45, 50, 0.92);
}

.message.user .bubble {
  background: rgba(79, 70, 229, 0.1);
}

.bubble p {
  margin: 0;
  white-space: pre-wrap;
}

.image-result {
  display: grid;
  gap: 12px;
}

.image-text {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.image-frame {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.45);
}

body.dark .image-frame {
  background: rgba(255, 255, 255, 0.04);
}

.image-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.image-caption {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.download-panel {
  max-width: 1180px;
}

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

.download-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--chat-bg);
}

.download-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(30, 23, 18, 0.62);
  color: #fff;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  backdrop-filter: blur(10px);
}

.download-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.download-card-copy {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.download-card-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.download-action {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.download-empty {
  padding: 24px 4px;
  color: var(--muted);
}

.auth-panel {
  max-width: 460px;
}

.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.active {
  display: grid;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
}

.auth-tab {
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.auth-tab.active {
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(130, 90, 60, 0.12);
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

.field-error {
  min-height: 18px;
  color: #c2410c;
  font-size: 0.85rem;
  line-height: 1.4;
}

.auth-form input.input-error {
  border-color: rgba(194, 65, 12, 0.55);
  box-shadow: 0 0 0 4px rgba(194, 65, 12, 0.08);
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
  font: inherit;
}

.auth-hint,
.credits-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.94rem;
}

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

.modal-close.ghost {
  color: var(--muted);
}

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

.credits-panel {
  max-width: 980px;
}

.code-guide-panel {
  max-width: 920px;
}

.code-guide {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(201, 103, 47, 0.18);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 248, 241, 0.92), rgba(255, 255, 255, 0.72)),
    radial-gradient(circle at top left, rgba(201, 103, 47, 0.08), transparent 45%);
}

body.dark .code-guide {
  background: rgba(255, 255, 255, 0.05);
}

.code-guide-copy {
  display: grid;
  align-content: center;
  gap: 10px;
}

.code-guide-kicker {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.code-guide-copy h5 {
  margin: 0;
  font-size: 1.32rem;
  line-height: 1.4;
}

.code-guide-copy p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.code-guide-preview {
  display: flex;
  align-items: center;
  justify-content: center;
}

.code-guide-preview img {
  width: 100%;
  max-width: 320px;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  object-fit: cover;
}

.credits-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.credit-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.45);
}

body.dark .credit-card {
  background: rgba(255, 255, 255, 0.05);
}

.credit-card.featured {
  border-color: rgba(201, 103, 47, 0.45);
  box-shadow: 0 18px 36px rgba(201, 103, 47, 0.14);
}

.credit-medal {
  font-size: 1.9rem;
}

.credit-card h5 {
  margin: 0;
  font-size: 1.1rem;
}

.credit-card strong {
  color: var(--text);
}

.credit-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.credits-note {
  margin-top: 16px;
}

.credit-ledger {
  display: grid;
  gap: 10px;
}

.ledger-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
}

body.dark .ledger-item {
  background: rgba(255, 255, 255, 0.05);
}

.ledger-item div:first-child {
  display: grid;
  gap: 5px;
}

.ledger-item span,
.ledger-amount small {
  color: var(--muted);
  font-size: 0.88rem;
}

.ledger-amount {
  display: grid;
  gap: 4px;
  text-align: right;
  font-weight: 700;
}

.ledger-amount.plus {
  color: #15803d;
}

.ledger-amount.minus {
  color: #c2410c;
}

.context-menu {
  position: fixed;
  display: none;
  z-index: 40;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 252, 248, 0.98);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

body.dark .context-menu {
  background: rgba(31, 33, 37, 0.98);
}

.context-menu.active {
  display: grid;
}

.context-menu-item {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.context-menu-item:hover {
  background: rgba(201, 103, 47, 0.08);
}

.context-menu-item.danger {
  color: #c2410c;
}

.composer-wrap {
  display: none;
  position: fixed;
  left: 260px;
  right: 0;
  bottom: 0;
  padding: 18px 24px 24px;
  background: linear-gradient(180deg, rgba(248, 244, 239, 0) 0%, rgba(248, 244, 239, 0.72) 28%);
}

body.dark .composer-wrap {
  background: linear-gradient(180deg, rgba(22, 19, 31, 0) 0%, rgba(22, 19, 31, 0.72) 28%);
}

.composer-wrap.active {
  display: block;
}

.composer-box {
  max-width: 920px;
  margin: 0 auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 252, 248, 0.9);
  box-shadow: var(--shadow);
}

body.dark .composer-box {
  background: rgba(42, 45, 50, 0.96);
}

.composer-upload {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.upload-button,
.remove-upload {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.upload-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.45);
}

.upload-preview[hidden] {
  display: none;
}

body.dark .upload-preview {
  background: rgba(255, 255, 255, 0.05);
}

.upload-preview img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 12px;
}

.upload-preview-copy {
  display: grid;
  gap: 6px;
}

.upload-preview-copy span {
  color: var(--muted);
  font-size: 0.9rem;
}

#messageInput {
  width: 100%;
  min-height: 34px;
  max-height: 180px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
}

.composer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.composer-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.send-button,
.case-use,
.modal-close {
  padding: 10px 14px;
  border-radius: 999px;
}

.pro-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 243, 230, 0.84)),
    radial-gradient(circle at 0 0, rgba(255, 183, 92, 0.45), transparent 42%);
  color: var(--text);
  font-size: 0.92rem;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(201, 103, 47, 0.11);
}

.pro-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.pro-toggle-ui {
  display: grid;
  gap: 1px;
}

.pro-toggle-ui strong {
  line-height: 1;
  color: var(--accent-strong);
  letter-spacing: 0.04em;
}

.pro-toggle-ui small {
  color: var(--muted);
  font-size: 0.76rem;
}

body.dark .pro-toggle {
  background:
    linear-gradient(135deg, rgba(54, 48, 68, 0.9), rgba(69, 53, 41, 0.92)),
    radial-gradient(circle at 0 0, rgba(255, 145, 82, 0.28), transparent 42%);
}

.pro-toggle:has(input:checked) {
  border-color: rgba(201, 103, 47, 0.46);
  background:
    linear-gradient(135deg, rgba(255, 239, 214, 0.98), rgba(255, 250, 245, 0.94)),
    radial-gradient(circle at 12% 18%, rgba(255, 166, 85, 0.65), transparent 44%);
  box-shadow: 0 16px 34px rgba(201, 103, 47, 0.2);
}

body.dark .pro-toggle:has(input:checked) {
  background:
    linear-gradient(135deg, rgba(82, 54, 38, 0.98), rgba(55, 45, 65, 0.96)),
    radial-gradient(circle at 12% 18%, rgba(255, 145, 82, 0.42), transparent 44%);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(10px);
  z-index: 20;
}

.modal-overlay.active {
  display: flex;
}

.modal-panel {
  width: min(1120px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  padding: 20px;
  border-radius: 28px;
  background: rgba(255, 252, 248, 0.98);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
}

body.dark .modal-panel {
  background: rgba(31, 33, 37, 0.98);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

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

.case-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--chat-bg);
}

.case-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 5 / 7;
  object-fit: cover;
}

.case-copy {
  padding: 16px;
}

.case-copy h5 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.case-copy p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.theme-toggle:hover,
.lang-switch:hover,
.cta-button:hover,
.new-chat:hover,
.sidebar-item:hover,
.sidebar-link:hover,
.header-chip:hover,
.send-button:hover,
.case-use:hover,
.modal-close:hover {
  transform: translateY(-1px);
}

@media (max-width: 980px) {
  .feature-grid,
  .modal-grid,
  .download-grid,
  .credits-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .code-guide {
    grid-template-columns: 1fr;
  }

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

  .chat-sidebar {
    min-height: auto;
  }

  .composer-wrap {
    left: 0;
  }
}

@media (max-width: 640px) {
  .topbar,
  .chat-header,
  .composer-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    padding: 36px 16px 48px;
  }

  .subtitle {
    width: 100%;
  }

  .feature-grid,
  .modal-grid,
  .download-grid,
  .credits-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .chat-header,
  .composer-bottom,
  .modal-header {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .code-guide {
    padding: 16px;
  }
}
