:root {
  --bg: #fbfbf8;
  --panel: rgba(255, 255, 255, 0.92);
  --line: rgba(37, 48, 74, 0.1);
  --line-strong: rgba(37, 48, 74, 0.16);
  --text: #1a1d27;
  --muted: #8a91a3;
  --brand: #6078ff;
  --brand-soft: #edf1ff;
  --shadow: 0 18px 40px rgba(79, 95, 140, 0.08);
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  font-family: "Manrope", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(135, 160, 255, 0.1), transparent 20%),
    radial-gradient(circle at bottom right, rgba(200, 236, 226, 0.16), transparent 18%),
    var(--bg);
  color: var(--text);
}

button,
textarea {
  font: inherit;
}

.hidden {
  display: none !important;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 264px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 12px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(249, 250, 252, 0.96));
  border-right: 1px solid rgba(39, 48, 73, 0.08);
  backdrop-filter: blur(18px);
  box-shadow: 10px 0 30px rgba(35, 45, 70, 0.08);
  overflow: hidden;
  transition:
    opacity 0.24s ease,
    transform 0.24s ease;
}

.app-shell.sidebar-collapsed .sidebar {
  opacity: 0;
  transform: translateX(-100%);
  pointer-events: none;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #4c6cff;
  font-weight: 800;
  font-size: 0.98rem;
}

.sidebar-brand-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.sidebar-collapse-btn,
.sidebar-new-chat svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-collapse-btn {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #70778b;
  cursor: pointer;
}

.sidebar-collapse-btn:hover {
  background: rgba(96, 120, 255, 0.08);
}

.sidebar-new-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  border: 1px solid rgba(54, 67, 98, 0.08);
  border-radius: 999px;
  background: #fff;
  color: #23293a;
  box-shadow: 0 8px 22px rgba(79, 95, 140, 0.08);
  cursor: pointer;
  flex-shrink: 0;
}

.conversation-list {
  flex: 1;
  overflow: auto;
  padding: 2px 4px 0 2px;
}

.conversation-group {
  margin-bottom: 18px;
}

.conversation-group-label {
  margin: 0 0 8px;
  padding: 0 10px;
  color: #8d93a3;
  font-size: 0.86rem;
  font-weight: 600;
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(48, 57, 80, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding-right: 40px;
}

.sidebar-account-wrap {
  position: relative;
  margin-top: auto;
}

.sidebar-account-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef2ff, #dfe9ff);
  color: #5066e1;
  font-weight: 800;
  flex-shrink: 0;
}

.sidebar-account-meta {
  min-width: 0;
  flex: 1;
  text-align: left;
}

.sidebar-account-meta strong,
.sidebar-account-meta span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-account-meta strong {
  font-size: 0.94rem;
  color: #1f2432;
}

.sidebar-account-meta span {
  margin-top: 2px;
  font-size: 0.78rem;
  color: var(--muted);
}

.sidebar-account-more {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #80879a;
  flex-shrink: 0;
  cursor: pointer;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.sidebar-account-more:hover {
  background: rgba(96, 120, 255, 0.08);
}

.sidebar-account-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  min-width: 130px;
  padding: 8px;
  border: 1px solid rgba(48, 57, 80, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 36px rgba(35, 45, 70, 0.14);
}

.sidebar-account-menu-item {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  color: #d23d4d;
  cursor: pointer;
}

.sidebar-account-menu-item:hover {
  background: rgba(210, 61, 77, 0.08);
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 4px 0;
}

.conversation-item-main {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.conversation-item-main:hover,
.conversation-item.active .conversation-item-main {
  background: #dfeaff;
}

.conversation-item.active .conversation-title {
  color: #4a63eb;
}

.conversation-title {
  display: block;
  font-size: 0.94rem;
  line-height: 1.5;
  color: #222737;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-time {
  display: none;
}

.conversation-more {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #7d8598;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.conversation-item:hover .conversation-more,
.conversation-more:focus-visible,
.conversation-more.is-open {
  opacity: 1;
  pointer-events: auto;
}

.conversation-more:hover,
.conversation-more.is-open {
  background: rgba(74, 99, 235, 0.12);
  color: #4a63eb;
}

.conversation-menu {
  position: fixed;
  z-index: 60;
  min-width: 148px;
  padding: 8px;
  border: 1px solid rgba(48, 57, 80, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 36px rgba(35, 45, 70, 0.14);
}

.conversation-menu-item {
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  color: #273047;
  cursor: pointer;
}

.conversation-menu-item:hover {
  background: rgba(96, 120, 255, 0.08);
}

.conversation-menu-item.danger {
  color: #e04857;
}

.conversation-menu-item.danger:hover {
  background: rgba(224, 72, 87, 0.08);
}

.empty-history {
  padding: 14px 12px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.main-panel {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 14px 28px 24px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-mark img {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(55, 68, 102, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(79, 95, 140, 0.08);
}

.topbar-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #1a1d27;
  cursor: pointer;
}

.topbar-btn:hover {
  background: rgba(96, 120, 255, 0.08);
}

.topbar-btn svg,
.icon-btn svg,
.send-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-title {
  display: none !important;
}

.content-area {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.hero {
  max-width: 760px;
  margin: min(18vh, 170px) auto 0;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.hero-icon img {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hero p {
  max-width: 800px;
  margin: 12px auto 0;
  color: var(--muted);
  line-height: 1.7;
}

.chat-screen {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.intro-screen {
  flex: 1;
  min-height: 0;
}

body:not(.chat-active) .content-area {
  flex: 0 0 auto;
}

body:not(.chat-active) .intro-screen {
  flex: 0 0 auto;
  padding-top: 0;
}

body:not(.chat-active) .hero {
  margin-top: 0;
}

body:not(.chat-active) .composer-shell {
  margin-top: 18px;
}

body:not(.chat-active) .main-panel {
  justify-content: center;
}

body:not(.chat-active) .topbar {
  display: flex;
  position: absolute;
  top: 14px;
  left: 28px;
  right: 28px;
  z-index: 12;
}



body:not(.chat-active) .hero {
  text-align: center;
}

body:not(.chat-active) .hero p {
  margin-top: 10px;
}

body:not(.chat-active) .composer-shell {
  width: min(780px, 100%);
}

.messages-wrap {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 12px 0 20px;
  scroll-padding-bottom: 20px;
}

.messages {
  width: min(760px, 100%);
  margin: 0 auto;
}

.intro-card,
.message {
  animation: fadeUp 0.26s ease;
}

.intro-card {
  margin-top: 8px;
  color: #2a2f3d;
  line-height: 1.9;
  font-size: 1rem;
}

.intro-card ul {
  margin: 0 0 14px 20px;
  padding: 0;
}

.intro-card p {
  margin: 0;
}

.message {
  margin-bottom: 22px;
}

.message.user {
  display: flex;
  justify-content: flex-end;
}

.message.user .message-bubble {
  max-width: min(72%, 420px);
  padding: 14px 18px;
  border-radius: 22px;
  background: #edf3ff;
  color: #1f2330;
}

.message.assistant .message-bubble {
  padding: 0;
  background: transparent;
  color: #202536;
}

.message-role {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.message-role-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}

.typing-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

.message.assistant .message-bubble {
  padding: 0;
  background: transparent;
  color: #202536;
}

.message-content {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 1rem;
  line-height: 1.9;
}

.markdown-body {
  white-space: normal;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body pre,
.markdown-body blockquote,
.markdown-body table,
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 0 0 14px;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 24px;
}

.markdown-body li + li {
  margin-top: 6px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  line-height: 1.4;
  font-weight: 800;
}

.markdown-body h1 {
  font-size: 1.4rem;
}

.markdown-body h2 {
  font-size: 1.22rem;
}

.markdown-body h3 {
  font-size: 1.08rem;
}

.markdown-body h4 {
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 800;
}

.markdown-body code {
  padding: 0.12em 0.42em;
  border-radius: 8px;
  background: rgba(96, 120, 255, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

.markdown-body code.color-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.color-token {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

.color-token-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.color-swatch {
  width: 0.82em;
  height: 0.82em;
  border: 1px solid rgba(40, 46, 62, 0.12);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  flex: 0 0 auto;
}

.code-block {
  position: relative;
}

.code-copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  padding: 4px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #5d6780;
  font-size: 0.76rem;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(28, 36, 58, 0.08);
}

.code-copy-btn:hover {
  background: #fff;
  color: #2f3750;
}

.markdown-body pre {
  padding: 14px 16px;
  border-radius: 16px;
  overflow: auto;
  background: #f3f6ff;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
}

.markdown-body a {
  color: #4a63eb;
  text-decoration: none;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.markdown-body blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 10px 14px;
  border-left: 4px solid rgba(96, 120, 255, 0.45);
  border-radius: 10px;
  background: rgba(96, 120, 255, 0.06);
  color: #2f3750;
}

.markdown-body blockquote > :last-child {
  margin-bottom: 0;
}

.md-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(62, 74, 104, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
}

.markdown-body table {
  width: 100%;
  min-width: 440px;
  border-collapse: collapse;
}

.markdown-body th,
.markdown-body td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(62, 74, 104, 0.1);
  vertical-align: top;
}

.markdown-body thead th {
  background: rgba(96, 120, 255, 0.08);
  color: #303856;
  font-weight: 700;
}

.markdown-body tbody tr:last-child td {
  border-bottom: 0;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  color: #8c94a7;
}

.message-actions button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.message-actions svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 0;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b2b8c7;
  animation: pulse 1.1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.3s;
}

.typing-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: 10px 14px;
  border-radius: 18px;
  background: #f2f5fb;
  margin-top: 8px;
  margin-left: 0;
}

.composer-shell {
  position: relative;
  width: min(780px, 100%);
  margin: 0 auto;
  padding-top: 10px;
  z-index: 8;
  flex-shrink: 0;
}

.composer {
  position: relative;
  display: block;
  padding: 18px 16px 14px;
  border: 1px solid rgba(55, 68, 102, 0.1);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.composer-login-hitbox {
  position: absolute;
  inset: 0 0 78px 0;
  z-index: 2;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.composer textarea {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 92px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.6;
}

.composer textarea::placeholder {
  color: #b1b6c4;
}

.composer textarea.auth-locked {
  cursor: pointer;
}

.poster-quick-actions {
  position: relative;
  z-index: 1;
  margin-bottom: 14px;
}

.poster-quick-title {
  margin: 0 0 10px;
  color: #7f8798;
  font-size: 0.88rem;
}

.poster-quick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.poster-quick-btn {
  padding: 9px 14px;
  border: 1px solid rgba(79, 112, 255, 0.14);
  border-radius: 999px;
  background: rgba(244, 247, 255, 0.92);
  color: #4d5b7c;
  font-size: 0.9rem;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.poster-quick-btn:hover {
  border-color: rgba(79, 112, 255, 0.28);
  background: rgba(237, 242, 255, 1);
  color: #3658f0;
  transform: translateY(-1px);
}

.composer-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

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

.toolbar-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px; /* 增加左右内边距，根据内容宽度自适应 */
  width: auto; /* 确保不固定宽度 */
  border: 1px solid rgba(62, 74, 104, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: #2b3140;
  font-size: 0.94rem;
}

.select-chip {
  position: relative;
  gap: 4px;
  overflow: hidden;
}

.select-wrap {
  position: static;
  display: inline-grid;
  align-items: center;
  pointer-events: none;
}

.select-wrap::after {
  content: attr(data-value);
  grid-area: 1 / 1;
  color: #64748b;
  font-size: 0.94rem;
  font-weight: 400; /* 与 select 保持一致，取消加粗 */
  white-space: nowrap;
  pointer-events: none;
}

.select-wrap select {
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  outline: 0;
  cursor: pointer;
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.select-chevron {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: 0.85;
}

.toggle-chip {
  gap: 10px;
  cursor: pointer;
  color: #64748b; /* 默认灰色，与另外两个下拉框一致 */
  font-weight: 400; /* 默认取消加粗，与另外两个下拉框一致 */
  transition: all 0.2s ease;
  width: auto; /* 确保不固定宽度 */
  padding: 8px 16px; /* 增加左右内边距，根据内容宽度自适应 */
}

.toggle-chip:hover:not(.active),
.toolbar-chip:hover:not(.active) {
  background: rgba(0, 0, 0, 0.05); /* 浅灰色背景 */
  color: #2b3140;
}

.toggle-chip.active {
  color: #4f70ff; /* 选中时显示蓝色 */
  border-color: #4f70ff; /* 选中时边框也显示蓝色 */
}



.utility-actions {
  display: flex;
  align-items: center;
  gap: 0;
}

.send-btn {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
}

.send-btn {
  border: 0;
  background: linear-gradient(180deg, #d8dce8, #c1c8da); /* 默认没输入内容时显示灰色 */
  color: white;
  box-shadow: 0 4px 12px rgba(32, 41, 69, 0.08); /* 调整默认阴影，使其更柔和 */
  transition: background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.send-btn.is-ready {
  background: linear-gradient(180deg, #7f99ff, #4f70ff);
  box-shadow: 0 14px 28px rgba(79, 112, 255, 0.32);
}

.send-btn.is-stop {
  background: linear-gradient(180deg, #617cff, #3658f0);
  box-shadow: 0 14px 28px rgba(54, 88, 240, 0.32);
}

.send-btn:disabled {
  opacity: 1;
  cursor: default;
}

.composer-footnote {
  margin: 8px 0 0;
  text-align: center;
  color: #a2a8b6;
  font-size: 0.82rem;
}

.generated-image {
  max-width: min(100%, 520px);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(62, 74, 104, 0.12);
}

.generated-image img {
  width: 100%;
  display: block;
}

.generated-caption {
  padding: 12px 14px;
  color: #4f5668;
  font-size: 0.92rem;
  line-height: 1.6;
}

.login-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 24, 36, 0.22);
  backdrop-filter: blur(6px);
}

.login-card {
  position: relative;
  width: min(420px, calc(100vw - 28px));
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 60px rgba(32, 41, 69, 0.18);
}

.login-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.login-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.login-form {
  margin-top: 18px;
}

.login-form label {
  display: block;
  margin-bottom: 12px;
  color: #323848;
  font-size: 0.92rem;
}

.login-form input {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(62, 74, 104, 0.14);
  border-radius: 14px;
  background: #fff;
  outline: 0;
}

.form-hint {
  display: block;
  margin-top: 6px;
  color: #99a1b3;
  font-size: 0.8rem;
  line-height: 1.5;
}

.login-error {
  margin: 6px 0 0;
  color: #d23d4d;
  font-size: 0.9rem;
}

.login-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.login-btn {
  min-width: 88px;
  height: 42px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
}

.login-btn.ghost {
  background: #f2f4f8;
  color: #2f3545;
}

.login-btn.primary {
  background: linear-gradient(180deg, #d8dce8, #c1c8da); /* 默认浅灰色 */
  color: #fff;
  transition: all 0.2s ease;
}

.login-btn.primary.is-ready {
  background: linear-gradient(180deg, #7f99ff, #4f70ff); /* 输入内容后变为深蓝色 */
  box-shadow: 0 4px 12px rgba(79, 112, 255, 0.24);
}

.chat-active .hero {
  display: none;
}

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

@keyframes pulse {
  0%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

@media (max-width: 900px) {
  .topbar-title {
    margin-right: 0;
    font-size: 0.88rem;
  }

  .messages,
  .hero {
    width: min(100%, 680px);
  }
}

@media (max-width: 720px) {
  .login-card {
    width: min(360px, calc(100vw - 32px));
    padding: 18px;
    border-radius: 20px;
  }

  .login-form {
    margin-top: 14px;
  }

  .login-form label {
    margin-bottom: 10px;
    font-size: 0.88rem;
  }

  .login-form input,
  .login-form textarea,
  .login-form select {
    padding: 10px 12px;
    border-radius: 12px;
  }

  .sidebar {
    width: min(264px, calc(100vw - 32px));
  }

  .main-panel {
    height: 100vh;
    padding: 12px 14px 18px;
  }

  body:not(.chat-active) .topbar {
    top: 12px;
    left: 14px;
    right: 14px;
  }

  .hero {
    margin-top: 13vh;
  }

  body:not(.chat-active) .hero {
    margin-top: 0;
  }

  body:not(.chat-active) .intro-screen {
    padding-top: 0;
  }

  body:not(.chat-active) .composer-shell {
    margin-top: 12px;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .composer-shell {
    width: 100%;
    padding-top: 8px;
  }

  .composer {
    border-radius: 24px;
    padding: 16px 14px 14px;
  }

  .composer textarea {
    min-height: 108px;
    font-size: 1rem;
  }

  .poster-quick-actions {
    margin-bottom: 10px;
  }

  .poster-quick-title {
    font-size: 0.8rem;
  }

  .poster-quick-list {
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    flex-wrap: nowrap;
  }

  .poster-quick-btn {
    flex: 0 0 auto;
    padding: 7px 10px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .composer-actions {
    flex-direction: row;
    align-items: flex-end;
    gap: 10px;
  }

  .toolbar-actions {
    flex: 1;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-start;
    overflow: hidden;
  }

  .utility-actions {
    flex-shrink: 0;
    justify-content: flex-end;
  }

  .toolbar-chip {
    display: inline-flex;
    flex: 0 0 auto;
    width: auto; /* 不固定宽度 */
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
    padding: 6px 14px; /* 根据内容宽度自适应，左右内边距 */
    border: 1px solid rgba(62, 74, 104, 0.12);
    border-radius: 999px;
    background: transparent;
    color: #8f97ab;
    font-size: 0.84rem;
  }

  .select-chip {
    gap: 4px;
  }

  .select-wrap::after {
    font-size: 0.84rem;
  }

  .select-wrap select {
    display: block;
    flex: none;
    width: auto;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
    color: #8f97ab;
    font-size: 0.84rem;
    line-height: 1.2;
    text-align: center;
    text-align-last: center;
  }

  .select-chevron {
    width: 5px;
    height: 5px;
    border-right-width: 1.25px;
    border-bottom-width: 1.25px;
    transform: translateY(-2px) rotate(45deg);
  }

  .toggle-chip {
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
    width: auto; /* 不固定宽度 */
    border: 1px solid rgba(62, 74, 104, 0.12); /* 加上边框，与 select-chip 一致 */
    border-radius: 999px; /* 加上圆角，与 select-chip 一致 */
    padding: 6px 14px; /* 加上内边距，根据内容宽度自适应 */
    background: transparent;
    color: #64748b; /* 默认灰色 */
    font-size: 0.84rem;
    gap: 6px;
    transition: all 0.2s ease;
  }

  .toggle-chip.active {
    color: #4f70ff; /* 选中时显示蓝色 */
  }

  .toggle-chip.active {
    color: #4f70ff; /* 选中时显示蓝色 */
    border-color: #4f70ff; /* 选中时边框也显示蓝色 */
  }

  .toggle-chip:hover:not(.active),
  .toolbar-chip:hover:not(.active) {
    border-color: rgba(62, 74, 104, 0.12); /* 悬停时边框颜色保持一致 */
    background: rgba(0, 0, 0, 0.05); /* 浅灰色背景 */
    color: #2b3140; /* 悬停时稍微加深一点 */
  }

  .messages-wrap {
    padding-bottom: 16px;
    scroll-padding-bottom: 16px;
  }

  .message.user .message-bubble {
    max-width: 84%;
  }
}
