:root {
  --bg: #0a1020;
  --bg-soft: #f5f2eb;
  --card: rgba(255, 255, 255, 0.12);
  --card-line: rgba(255, 255, 255, 0.14);
  --text: #101010;
  --light: #fff8ef;
  --muted: rgba(255, 248, 239, 0.74);
  --accent: #cf6232;
  --accent-2: #f4c995;
  --shadow: 0 24px 60px rgba(8, 12, 28, 0.24);
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: "Noto Sans SC", sans-serif;
  background:
    linear-gradient(180deg, rgba(9, 15, 31, 0.76), rgba(18, 28, 50, 0.68)),
    url("./doubao-bg.png") center / cover no-repeat fixed,
    #10192f;
  color: var(--light);
}

.hidden {
  display: none !important;
}

.app {
  min-height: 100vh;
}

.builder-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.builder-shell {
  width: min(940px, 100%);
}

.eyebrow {
  margin: 0 0 12px;
  color: #f3b26f;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.8rem);
  line-height: 1;
  color: var(--light);
}

.builder-copy {
  margin: 16px 0 26px;
  max-width: 44rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.builder-card,
.result-card {
  background: rgba(255, 250, 242, 0.12);
  border: 1px solid var(--card-line);
  box-shadow: var(--shadow);
  border-radius: 30px;
  padding: 28px;
}

.field-label,
.success-message {
  display: block;
  margin-bottom: 12px;
  font-weight: 800;
  color: var(--light);
}

textarea,
input {
  width: 100%;
  border-radius: 22px;
  border: 1px solid rgba(255, 244, 231, 0.16);
  background: rgba(255, 255, 255, 0.1);
  color: var(--light);
  font: inherit;
}

textarea {
  min-height: 230px;
  resize: vertical;
  padding: 18px 20px;
  line-height: 1.75;
}

input {
  padding: 14px 16px;
}

textarea::placeholder,
input::placeholder {
  color: rgba(255, 248, 239, 0.48);
}

.builder-actions,
.link-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.builder-actions {
  margin-top: 18px;
}

.link-row {
  align-items: center;
}

.link-row input {
  flex: 1 1 360px;
}

.button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  background: linear-gradient(135deg, var(--accent) 0%, #d87a41 100%);
  color: #fff7ee;
}

.button.secondary {
  background: linear-gradient(135deg, #fff5de 0%, #ffe0b2 100%);
  color: #8e3f19;
}

.button.ghost {
  background: rgba(255, 248, 239, 0.14);
  color: var(--light);
  border: 1px solid rgba(255, 244, 231, 0.14);
}

.result-card {
  margin-top: 18px;
}

.copy-toast {
  margin: 10px 0 0;
  color: #ffd8b2;
  font-size: 0.92rem;
  font-weight: 700;
}

.share-view {
  min-height: 100vh;
  background: #f8f8f8;
  color: var(--text);
}

.scene-shell {
  display: grid;
  grid-template-columns: 434px 1fr;
  min-height: 100vh;
}

.scene-sidebar {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 12px;
  border-right: 1px solid rgba(20, 20, 20, 0.08);
  background: linear-gradient(180deg, #fbfbfb 0%, #f6f6f6 100%);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 0 20px;
}

.sidebar-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #dceefe 0%, #f8fbff 100%);
  border: 1px solid rgba(77, 120, 199, 0.12);
  font-size: 1.15rem;
  font-weight: 800;
}

.sidebar-brand-text {
  font-size: 1.28rem;
  font-weight: 800;
}

.sidebar-new-chat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(69, 123, 255, 0.36);
  border-radius: 22px;
  background: rgba(89, 149, 255, 0.08);
  color: #2567ff;
  font: inherit;
  font-weight: 800;
}

.sidebar-new-chat-icon {
  font-size: 1.1rem;
}

.sidebar-shortcut {
  color: rgba(69, 123, 255, 0.52);
  font-size: 0.92rem;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 1rem;
}

.sidebar-history-title {
  margin-top: 34px;
  color: rgba(16, 16, 16, 0.36);
  font-size: 0.96rem;
}

.sidebar-history-item {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: white;
  border: 1px solid rgba(16, 16, 16, 0.06);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 12px 8px;
  border-top: 1px solid rgba(16, 16, 16, 0.08);
  color: rgba(16, 16, 16, 0.56);
}

.scene-main {
  display: flex;
  flex-direction: column;
}

.scene-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px 14px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.08);
  background: rgba(255, 255, 255, 0.84);
}

.scene-topbar-left {
  font-size: 1.38rem;
  color: #222;
}

.scene-topbar-title {
  text-align: center;
}

.scene-topbar-title div {
  font-size: 1.1rem;
}

.scene-topbar-title p {
  margin: 4px 0 0;
  color: rgba(16, 16, 16, 0.24);
  font-size: 0.92rem;
}

.scene-topbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.scene-pill,
.scene-login {
  border-radius: 22px;
  padding: 14px 22px;
  font-weight: 700;
}

.scene-pill {
  border: 1px solid rgba(16, 16, 16, 0.08);
  background: rgba(255, 255, 255, 0.6);
}

.scene-login {
  background: #22262a;
  color: white;
}

.scene-body {
  position: relative;
  min-height: calc(100vh - 83px);
  padding: 26px 36px 24px;
  overflow: hidden;
}

.scene-center {
  padding-top: 12.5vh;
  text-align: center;
}

.scene-hello {
  margin: 0;
  font-size: clamp(2.9rem, 4.8vw, 4.1rem);
  font-weight: 800;
}

.scene-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  max-width: 1220px;
  margin: 54px auto 0;
}

.scene-tags span {
  padding: 14px 24px;
  border-radius: 20px;
  background: #f0f0f0;
  font-size: 0.98rem;
}

.scene-composer {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(1256px, calc(100% - 112px));
  border-radius: 34px;
  border: 1px solid rgba(125, 165, 255, 0.46);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 10px 32px rgba(136, 165, 224, 0.14);
  padding: 20px 26px 18px;
}

.prompt-preview {
  min-height: 108px;
  font-size: 1.36rem;
  line-height: 1.72;
  color: #2a2a2a;
  white-space: pre-wrap;
  word-break: break-word;
}

.prompt-preview.typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1.25em;
  margin-left: 4px;
  vertical-align: -0.15em;
  background: #5182ff;
  animation: blink 1s steps(1) infinite;
}

.composer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
  color: #292929;
  font-size: 0.96rem;
}

.composer-input-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin-top: 8px;
}

.typed-prompt {
  display: none;
}

.ask-button {
  border: 0;
  border-radius: 999px;
  padding: 16px 30px;
  background: linear-gradient(135deg, #22262a 0%, #3b3f45 100%);
  color: white;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 18px 30px rgba(31, 35, 41, 0.18);
}

.copy-prompt-button {
  border: 1px solid rgba(18, 18, 18, 0.12);
  border-radius: 999px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.86);
  color: #222;
  font: inherit;
  font-weight: 800;
  transition:
    background-color 220ms ease,
    border-color 220ms ease,
    color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

.copy-prompt-button.copied {
  border-color: rgba(65, 182, 111, 0.42);
  background: linear-gradient(135deg, #effcf3 0%, #dbf7e6 100%);
  color: #1d8f4c;
  box-shadow: 0 10px 24px rgba(65, 182, 111, 0.16);
  animation: copiedPulse 900ms ease;
}

.copy-prompt-button.attention {
  border-color: rgba(255, 184, 77, 0.72);
  background: linear-gradient(135deg, #fff8e8 0%, #ffe7b8 100%);
  color: #9a5a00;
  box-shadow: 0 0 0 8px rgba(255, 196, 87, 0.12);
  animation: attentionPulse 1.1s ease-in-out infinite;
}

.ask-button.reveal {
  animation: reveal 220ms ease-out both;
}

.copy-prompt-button.reveal {
  animation: reveal 220ms ease-out both;
}

.meme-popup {
  position: absolute;
  left: 39%;
  top: 36%;
  transform: translate(-50%, -50%);
  width: clamp(280px, 34vw, 420px);
  padding: 12px;
  border-radius: 28px;
  background: rgba(255, 250, 242, 0.94);
  box-shadow: 0 24px 50px rgba(79, 43, 10, 0.16);
  text-align: center;
}

.meme-popup img {
  display: block;
  width: 100%;
  border-radius: 18px;
}

.meme-title {
  display: block;
  margin-top: 10px;
  color: #171717;
  font-size: 1.5rem;
  font-weight: 900;
}

.meme-popup p {
  margin: 10px 8px 6px;
  color: #a04623;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.35;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.92);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes copiedPulse {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.06);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes attentionPulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 0 rgba(255, 196, 87, 0.16);
  }

  50% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 10px rgba(255, 196, 87, 0.04);
  }
}

@media (max-width: 900px) {
  .builder-view {
    padding: 18px;
  }

  .scene-shell {
    grid-template-columns: 1fr;
  }

  .scene-sidebar,
  .scene-topbar-right {
    display: none;
  }

  .scene-topbar {
    padding: 14px 16px;
  }

  .scene-center {
    padding-top: 10vh;
  }

  .scene-tags {
    gap: 10px;
  }

  .scene-tags span {
    padding: 12px 16px;
    font-size: 0.92rem;
  }

  .scene-composer {
    width: calc(100% - 24px);
    bottom: 12px;
    padding: 18px;
  }

  .meme-popup {
    left: 34%;
    top: 33%;
  }

  .prompt-preview {
    min-height: 110px;
    font-size: 1.2rem;
  }
}
