/* ===== 颜色方案（浅/深） ===== */
:root{
  --bg:#f7f8fa; --paper:#ffffff; --line:#e9ecf1; --text:#111; --sub:#6b7280;
  --mine:#f3f4f6; --bot:#ffffff; --pill:#111; --pillText:#fff; --danger:#e5484d;
  --muted:#6b7280;
  /* 添加消息气泡框颜色变量 */
  --user-bubble:#3e3e3e; /* 用户消息气泡颜色 - 与pill颜色一致 */
  --bot-bubble:#f3f4f6;  /* 机器人消息气泡颜色 - 与mine颜色一致 */
  --bubble-bg:#f3f4f6;   /* 默认气泡背景色 */
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0f1114; --paper:#111318; --line:#23262b; --text:#e5e7eb; --sub:#9aa0aa;
    --mine:#1a1d22; --bot:#13161b; --pill:#e5e7eb; --pillText:#0f1114; --danger:#ff6b6f;
    --muted:#b3bac5;
    /* 深色模式气泡框颜色变量 */
    --user-bubble:#bebebe; /* 修改为深灰色，更适合深色模式 */
    --bot-bubble:#1a1d22;  /* 机器人消息气泡颜色 - 与mine颜色一致 */
    --bubble-bg:#1a1d22;   /* 深色模式默认气泡背景色 */
  }
  
  /* 深色模式聊天气泡文字颜色调整 - 使用 !important 确保优先级 */
  .message-wrapper.user .message-content .message-text {
    color: #000000 !important; /* 深色模式下用户消息文字设置为黑色 */
  }
  
  /* 深色模式特有样式 */
  .top{ background:#111318; border-bottom:1px solid #262A31; }
  .brand{ color:#E7EAEE; }
  .sub{ color:#9AA0AA; }
  .home-link.btn{
    color:#E7EAEE;
    opacity:0.7;
  }
  .home-link.btn:hover{
    background:rgba(255,255,255,0.1);
    opacity:1;
  }
  .btn{ 
    background: rgba(26, 29, 34, 0.8) !important; 
    color:#E7EAEE !important;
    border-color: rgba(46, 50, 58, 0.6) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25), 0 2px 8px rgba(0,0,0,.25) !important;
  }
  .btn:hover {
    background: rgba(33, 36, 43, 0.9) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.35) !important;
  }
  .pill {
    background: rgba(26, 29, 34, 0.8) !important;
    color:#E7EAEE !important;
    border-color: rgba(46, 50, 58, 0.6) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25), 0 2px 8px rgba(0,0,0,.25) !important;
  }
  .pill:hover {
    background: rgba(33, 36, 43, 0.9) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.35) !important;
  }
  .menu{ background:#111318; border-color:#2E323A; box-shadow:0 10px 30px rgba(0,0,0,.35); }
  .menu button{ background:#111318; color:#E7EAEE; border-bottom-color:#272B33; }
  .menu button:last-child{ color:#FF6B6F; }
  /* 品牌符号下拉菜单深色模式样式 */
  .dropdown-menu { 
    background: rgba(26, 29, 34, 0.95) !important; 
    border-color: rgba(46, 50, 58, 0.6) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25), 0 6px 20px rgba(0,0,0,.4) !important;
  }
  .dropdown-item { color: #E7EAEE !important; font-weight: 500 !important; }
  .dropdown-item:hover { 
    background-color: rgba(240, 46, 46, 0.15) !important;
    transform: scale(1.02) !important;
  }
  /* 深色模式输入框背景 - 灰透液态玻璃效果 */
  #prompt { 
    background: rgba(120, 120, 120, 0.12) !important; 
    backdrop-filter: saturate(180%) blur(20px) !important;
    border-color: rgba(120, 120, 120, 0.25) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
  }
  /* 深色模式下拉菜单按钮样式 - 灰透液态玻璃效果 */
  .dropdown-toggle { 
    background: rgba(120, 120, 120, 0.12) !important; 
    backdrop-filter: saturate(180%) blur(20px) !important;
    color: #E7EAEE !important; /* 深色模式用浅色文字 */
    border-color: rgba(120, 120, 120, 0.25) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
  }
  .dropdown-toggle:hover {
    background: rgba(120, 120, 120, 0.18) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.35) !important;
  }
  .quantity-btn {
    background: rgba(120, 120, 120, 0.12) !important;
    color: #E7EAEE !important; /* 深色模式用浅色文字 */
    border-color: rgba(120, 120, 120, 0.25) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
  }
  .quantity-btn:hover {
    background: rgba(120, 120, 120, 0.18) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.35) !important;
  }
  .action-btn {
    background: rgba(120, 120, 120, 0.12) !important;
    color: #E7EAEE !important; /* 深色模式用浅色文字 */
    border-color: rgba(120, 120, 120, 0.25) !important;
    backdrop-filter: saturate(180%) blur(20px) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
  }
  .action-btn:hover {
    background: rgba(120, 120, 120, 0.18) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.35) !important;
  }
}

/* 消息样式 - 保持与品牌符号和输入框一致 */
.message-wrapper {
  margin: 8px 0; display: flex; clear: both;
  align-items: flex-start; /* 让内容对齐到容器顶部，而不是底部 */
  max-width: 100%; /* 确保消息容器不超出屏幕 */
  box-sizing: border-box; /* 包含padding和border在宽度计算内 */
}

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

.message-wrapper.bot {
  justify-content: flex-start;
}

.message-content {
  max-width: 85%; 
  word-break: break-word;
  overflow-wrap: break-word; /* 确保长文本换行 */
  box-sizing: border-box; /* 包含padding和border在宽度计算内 */
}

/* 文本消息气泡框样式 - 调整为与输入框和品牌符号一致的圆角 */
.message-content .message-text {
  padding: 10px 15px;
  font-size: 15px;
  background-color: var(--bubble-bg);
  border-radius: 20px; /* 与品牌符号(.dropdown-toggle)圆角一致 */
  border: 1px solid var(--line); /* 添加边框，与输入框和品牌符号一致 */
  display: inline-block;
  box-shadow: 0 2px 8px rgba(0,0,0,.06); /* 添加阴影，与品牌符号一致 */
  word-break: break-word; /* 确保长文本换行 */
  overflow-wrap: break-word; /* 确保长文本换行 */
  max-width: 100%; /* 确保不超出容器 */
  box-sizing: border-box; /* 包含padding和border在宽度计算内 */
}

/* 用户消息气泡框特殊样式 */
.message-wrapper.user .message-content .message-text {
  background-color: var(--user-bubble);
  color: white;
  text-align: left; /* 将文本对齐方式从默认的右对齐改为左对齐 */
}

/* 机器人消息气泡框特殊样式 */
.message-wrapper.bot .message-content .message-text {
  background-color: var(--bot-bubble);
}

/* 图片样式 - 固定宽度，与整体设计风格保持一致 */
.resultImg {
  width: 320px; /* 稍微增大到320px */
  max-width: 100%; /* 确保图片不超出容器宽度 */
  height: auto;
  cursor: pointer;
  border-radius: 14px; /* 与其他元素圆角一致 */
  margin: 5px 0; /* 添加适当间距 */
  border: 1px solid var(--line); /* 添加边框 */
  box-shadow: 0 2px 8px rgba(0,0,0,.06); /* 添加阴影 */
  box-sizing: border-box; /* 包含border在宽度计算内 */
}

/* 移动端图片响应式样式 */
@media (max-width: 767px) {
  .resultImg {
    width: 100%;
    max-width: 220px;
    height: auto;
  }
  
  .message-content {
    max-width: 90%;
  }
  
  /* 防止聊天区域左右滚动 */
  #scroll {
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* 确保消息容器不会超出屏幕 */
  .message-wrapper {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .message-content {
    max-width: 85%;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  
  /* 移动端输入区域优化 */
  .input-wrapper {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  #prompt {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  /* 移动端按钮容器响应式 */
  .image-actions {
    width: 100%;
    max-width: 220px;
    justify-content: flex-start; /* 移动端也左对齐 */
  }
}

/* 图片操作按钮容器 - 跟随图片固定宽度，左对齐 */
.image-actions {
  display: flex;
  gap: 8px;
  margin-top: -8px;
  justify-content: flex-start; /* 左对齐，与图片对齐 */
  width: 320px; /* 固定宽度，与图片一致 */
  max-width: 320px; /* 确保不超过320px */
  position: relative; /* 为引用按钮定位做准备 */
}

/* 按钮布局：左侧两个按钮，右侧引用按钮 */
.image-actions {
  justify-content: flex-start;
  align-items: flex-start;
}

/* 左侧按钮组 */
.image-actions .action-btn:not(.quote-btn) {
  margin-right: 8px;
}

/* 引用按钮保持在右侧 */
.quote-btn {
  color: #111 !important;
}

/* 操作按钮样式 - 与IP形象延展按钮保持一致 */
.action-btn {
  padding: 6px 10px;
  border-radius: 14px; /* 与dropdown-toggle一致的圆角 */
  border: 0.5px solid rgba(120, 120, 120, 0.25);
  background: rgba(120, 120, 120, 0.12); /* 灰透液态玻璃效果 */
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  color: #1a1a1a; /* 浅色模式下使用深色文字 */
  font-size: 12px;
  cursor: pointer;
  outline: none; /* 移除点击时的默认轮廓 */
  white-space: nowrap; /* 防止文字换行 */
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(1);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.action-btn:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.action-btn:active {
  transform: scale(0.94);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* 移除再生一次按钮的特殊样式，使用统一样式 */

/* 移除再生一次按钮的特殊hover样式 */
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0f1114; --paper:#111318; --line:#23262b; --text:#e5e7eb; --sub:#9aa0aa;
    --mine:#1a1d22; --bot:#13161b; --pill:#e5e7eb; --pillText:#0f1114; --danger:#ff6b6f;
    --muted:#b3bac5;
  }
  /* 深色模式特有样式 */
  .top{ background:#111318; border-bottom:1px solid #262A31; }
  .brand{ color:#E7EAEE; }
  .sub{ color:#9AA0AA; }
  .btn.capsule.outline{ color:#E7EAEE; border-color:#2E323A; }
  .menu{ background:#111318; border-color:#2E323A; box-shadow:0 10px 30px rgba(0,0,0,.35); }
  .menu button{ background:#111318; color:#E7EAEE; border-bottom-color:#272B33; }
  .menu button:last-child{ color:#FF6B6F; }
  /* 品牌符号下拉菜单深色模式样式 */
  .dropdown-menu {
    background: rgba(26, 29, 34, 0.95) !important;
    border-color: #2E323A !important;
  }
  .dropdown-item {
    color: #E7EAEE !important;
    font-weight: 500 !important;
  }
  .dropdown-item:hover {
    background-color: rgba(33, 36, 43, 0.7) !important;
  }
  /* 深色模式输入框背景 - 灰透液态玻璃效果 */
  #prompt { 
    background: rgba(120, 120, 120, 0.12) !important; 
    backdrop-filter: saturate(180%) blur(20px) !important;
    border-color: rgba(120, 120, 120, 0.25) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
  }
  /* 深色模式下拉菜单按钮样式 - 灰透液态玻璃效果 */
  .dropdown-toggle { 
    background: rgba(120, 120, 120, 0.12) !important; 
    backdrop-filter: saturate(180%) blur(20px) !important;
    color: #E7EAEE !important; /* 深色模式用浅色文字 */
    border-color: rgba(120, 120, 120, 0.25) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
  }
  
  /* 深色模式操作按钮样式 - 灰透液态玻璃效果 */
  .action-btn {
    background: rgba(120, 120, 120, 0.12) !important;
    color: #E7EAEE !important; /* 深色模式用浅色文字 */
    border-color: rgba(120, 120, 120, 0.25) !important;
    backdrop-filter: saturate(180%) blur(20px) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
  }
  
  .action-btn:hover {
    background: rgba(120, 120, 120, 0.18) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.35) !important;
  }
  .quote-btn {
    color: #111 !important;
  }
}

/* ===== 布局与滚动控制 ===== */
html,body{height:100vh;margin:0;background:var(--bg);color:var(--text);overflow:hidden;overscroll-behavior:none;
  font-family:system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,"PingFang SC","Hiragino Sans GB","Microsoft Yahei",sans-serif;}
#app{height:100vh;display:flex;flex-direction:column}

/* ===== 顶栏 ===== */
.top{position:fixed;top:0;left:0;right:0;z-index:1000;background:var(--paper);border-bottom:1px solid var(--line);
  padding:12px 14px;display:flex;align-items:center;gap:10px;white-space:nowrap}
.brandBox{display:flex; flex-direction:column; line-height:1; align-items:flex-start;white-space:nowrap;flex-shrink:0}
.brand{font-size:16px; font-weight:400; letter-spacing:-0.5px;white-space:nowrap;flex-shrink:0;display:flex;align-items:center}
.brand-logo{height:36px;width:auto;display:block}
.sub{font-size:9.5px;color:var(--sub);margin-top:0.2px; letter-spacing:-0.1px;white-space:nowrap;flex-shrink:0}
a.home-link.btn{
  display:flex;align-items:center;justify-content:center;
  width:26px;height:26px;
  margin-left:8px;
  padding:0;
  border-radius:50%;
  flex-shrink:0;
  cursor:pointer;
  text-decoration:none;
  min-width:26px;
}
.home-link.btn svg{
  width:16px;height:16px;
  stroke:currentColor;
}
.right{margin-left:auto;display:flex;align-items:center;gap:8px;white-space:nowrap;flex-shrink:0}
.btn{
  height:30px;
  padding:0 12px;
  border-radius:10px;
  border:0.5px solid rgba(142, 142, 147, 0.2);
  background:rgba(142, 142, 147, 0.15);
  backdrop-filter: saturate(180%) blur(15px);
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
  font-size:13px;
  color:var(--text);
  cursor:pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(1);
  white-space:nowrap;
  flex-shrink:0;
}

.btn:hover {
  transform: scale(1.08);
  background: rgba(142, 142, 147, 0.25);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.btn:active {
  transform: scale(0.94);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.btn.capsule.outline{
  height:36px;
  padding:0 18px;
  border-radius:18px;
  font-size:16px;
  line-height:36px;
}

.btn.primary {
  background: linear-gradient(135deg, #f02e2e 0%, #ff4757 100%);
  color: white;
  border-color: rgba(240, 46, 46, 0.3);
  box-shadow: 0 2px 8px rgba(240, 46, 46, .2), 0 2px 8px rgba(240, 46, 46, .2);
}

.btn.primary:hover {
  box-shadow: 0 3px 12px rgba(240, 46, 46, .3), 0 3px 12px rgba(240, 46, 46, .3);
}
.account{position:relative}
.pill{
  height:30px;
  min-width:30px;
  border-radius:16px;
  border:0.5px solid rgba(142, 142, 147, 0.2);
  background:rgba(142, 142, 147, 0.15);
  backdrop-filter: saturate(180%) blur(15px);
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 10px;
  gap:6px;
  cursor:pointer;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(1);
}

.pill:hover {
  transform: scale(1.05);
  background: rgba(142, 142, 147, 0.25);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.pill:active {
  transform: scale(0.96);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.pill.solid{
  background:var(--pill);
  color:var(--pillText);
  border-color:transparent;
}

/* 折叠菜单 */
.menu{position:absolute;right:0;top:36px;background:var(--paper);border:1px solid var(--line);border-radius:10px;
  box-shadow:0 8px 24px rgba(0,0,0,.12);min-width:120px;display:none;z-index:1001}
.menu button{width:100% !important;background:var(--paper);color:var(--text);border:0;border-bottom:1px solid var(--line);height:36px;display:block !important;float:none !important;clear:both}
.menu button:last-child{border-bottom:0;color:var(--danger)}

/* ===== 聊天区 ===== */
#scroll{
  flex:1;
  min-height:0;
  overflow:auto;
  overflow-x: hidden; /* 禁止横向滚动 */
  padding: calc(72px + env(safe-area-inset-top, 0px)) 14px 400px; /* 顶部预留导航高度+安全区域，底部留白方便滚动 */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 加载动画 - Uiverse.io 风格 */
.loading-spinner {
  width: 24px;
  height: 24px;
  margin: auto;
  position: relative;
  display: inline-block;
}

.loading-spinner:before {
  content: '';
  width: 24px;
  height: 3px;
  background: #88888850;
  position: absolute;
  top: 30px;
  left: 0;
  border-radius: 50%;
  animation: shadow324 0.5s linear infinite;
}

.loading-spinner:after {
  content: '';
  width: 100%;
  height: 100%;
  background: #888888;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 2px;
  animation: jump7456 0.5s linear infinite;
}

@keyframes jump7456 {
  15% {
    border-bottom-right-radius: 2px;
  }

  25% {
    transform: translateY(4px) rotate(22.5deg);
  }

  50% {
    transform: translateY(8px) scale(1, .9) rotate(45deg);
    border-bottom-right-radius: 20px;
  }

  75% {
    transform: translateY(4px) rotate(67.5deg);
  }

  100% {
    transform: translateY(0) rotate(90deg);
  }
}

@keyframes shadow324 {
  0%,
  100% {
    transform: scale(1, 1);
  }

  50% {
    transform: scale(1.1, 1);
  }
}

/* 上传图片的转圈动画 */
.upload-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  z-index: 1000;
}

.upload-spinner .spinner-ring {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid rgba(128, 128, 128, 0.6);
  border-radius: 50%;
  animation: chat-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.upload-spinner .spinner-ring:nth-child(1) {
  animation-delay: -0.45s;
}

.upload-spinner .spinner-ring:nth-child(2) {
  animation-delay: -0.3s;
}

.upload-spinner .spinner-ring:nth-child(3) {
  animation-delay: -0.15s;
}

.upload-spinner .spinner-ring:nth-child(4) {
  animation-delay: 0s;
}

.spinner-ring {
  display: inline-block;
  position: relative;
  width: 32px;
  height: 32px;
}

.spinner-ring div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 24px;
  height: 24px;
  margin: 4px;
  border: 3px solid #888;
  border-radius: 50%;
  animation: spinner-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  border-color: #888 transparent transparent transparent;
}

.spinner-ring div:nth-child(1) { animation-delay: -0.45s; }
.spinner-ring div:nth-child(2) { animation-delay: -0.3s; }
.spinner-ring div:nth-child(3) { animation-delay: -0.15s; }

@keyframes spinner-ring {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 输入区（固定） */
#composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
  border-top: none;
  padding: 0 10px calc(10px + env(safe-area-inset-bottom,0)) !important; /* 顶部padding为0 */
  z-index: 1000;
  /* 移除固定高度限制，让composer能根据内容自动调整 */
  max-height: none;
  /* 添加过渡动画，让移动更平滑 */
  transition: transform 0.2s ease-out, background 0.3s ease, border 0.3s ease;
}

/* 电脑端适配 */
@media (min-width: 768px) {
  #app {
    width: 100%;
    margin: 0 auto;
  }
  
  #scroll {
    padding: calc(72px + env(safe-area-inset-top, 0px)) 14px 350px; /* 顶部预留导航高度+安全区域，底部留白让内容可滚动 */
  }
  
  #composer {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    max-width: calc(100% - 40px);
    bottom: 40px;
    background: transparent;
    border-radius: 14px;
    border: none;
    box-shadow: none;
    padding: 0 10px calc(10px + env(safe-area-inset-bottom,0)) !important; /* 顶部padding为0 */
  }
  
  .hints {
    background: transparent;
  }
  
  #prompt {
    background: rgba(255, 255, 255, 0.8);
  }
}

/* 手机端适配 */
@media (max-width: 767px) {
  #app {
    max-width: 100%;
    margin: 0;
    box-shadow: none;
  }
  
  #composer {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    bottom: 0;
    width: 100%;
    transform: none;
    left: 0;
    padding: 0 10px calc(10px + env(safe-area-inset-bottom,0)) !important; /* 顶部padding为0 */
    box-sizing: border-box;
  }
  
  .row {
    width: 100%;
    box-sizing: border-box;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  #prompt {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 42px;
    background: rgba(255, 255, 255, 0.7);
  }
}



/* 确保.row容器能够正确容纳绝对定位的元素 */
.row {
  position: relative;
  min-height: 42px;
  max-height: 120px;
  height: auto;
  width: 100%;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 0 !important;
  /* 添加过渡动画 */
  transition: height 0.2s ease-out;
}

/* 输入框容器 - 添加一个包装器 */
.input-container {
  position: relative;
  width: 100%;
  min-height: 42px;
  max-height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 0 !important;
  padding: 0 !important;
}
/* 按钮样式 - 固定在输入框左右两侧，垂直居中对齐 */
#addBtn {
  position: absolute !important;
  left: 8px !important;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--sub);
  z-index: 10;
  /* 确保按钮在输入框中心位置 */
  top: 50% !important;
  transform: translateY(-50%) !important;
  /* 添加过渡效果和点击反馈 */
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

/* +号按钮悬停效果 */
#addBtn:hover {
  color: var(--text);
  transform: translateY(-50%) scale(1.1);
}

/* +号按钮点击效果 */
#addBtn:active {
  transform: translateY(-50%) scale(0.95);
  transition: all 0.1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.image-enhance-btn{
  width: 30px;
  height: 30px;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 12px;
  color: #1a1a1a;
  background: rgba(120, 120, 120, 0.12);
  backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid rgba(120, 120, 120, 0.25);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  outline: none;
  white-space: nowrap;
  transition: all 0.3s ease;
  transform: scale(1);
}
.image-enhance-btn svg{
  width: 16px;
  height: 16px;
}
.image-enhance-btn:hover{
  transform: scale(1.05);
  background: rgba(120, 120, 120, 0.18);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.image-enhance-btn:active{
  transform: scale(0.95);
}
#sendBtn {
  position: absolute !important;
  right: 8px !important;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--text);
  border: none;
  color: var(--paper);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  /* 确保按钮在输入框中心位置 */
  top: 50% !important;
  transform: translateY(-50%) !important;
}
#sendBtn:disabled{opacity:.35}

/* 预览缩略图 */
#chips{display:flex;gap:6px;flex-wrap:wrap;max-width:100%}
.chip{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;background:var(--mine);border:1px solid var(--line);border-radius:10px}
.chip img{width:30px;height:30px;object-fit:cover;border-radius:6px;background:var(--paper)}
.chip button{border:0;background:transparent;color:var(--sub);font-size:16px;line-height:1}

/* 输入框基础样式 - 保持固定定位，只调整高度 */
#prompt {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: 42px;
  max-height: 120px;
  height: 42px;
  border-radius: 21px;
  border: 1px solid rgba(120, 120, 120, 0.25); /* 灰透边框 */
  background: rgba(120, 120, 120, 0.12); /* 灰透液态玻璃效果 */
  backdrop-filter: saturate(180%) blur(20px); /* 增强模糊效果 */
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  padding: 10px 42px;
  box-sizing: border-box;
  font-size: 15px;
  resize: none;
  overflow-y: auto;
  color: var(--text);
  -ms-overflow-style: none; /* IE和Edge */
  scrollbar-width: none; /* Firefox */
  width: 100%;
  /* 添加过渡动画 */
  transition: height 0.2s ease-out;
}

/* Chrome, Safari和Opera隐藏滚动条 */
#prompt::-webkit-scrollbar {
  display: none;
}
#prompt::placeholder{color:var(--muted)}

/* 添加CSS样式来确保input-wrapper能够正确工作 */
.input-wrapper {
  position: relative;
  width: 100%;
  min-height: 42px;
  max-height: 120px;
  margin: 0 !important;
  padding: 0 !important;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

/* 拖拽悬停效果 - 只改变加号按钮 */
.input-wrapper.drag-over #addBtn {
  transform: translateY(-50%) scale(1.15) !important;
  color: #f02e2e !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

@media (prefers-color-scheme: dark) {
  .input-wrapper.drag-over #addBtn {
    color: #ff4757 !important;
  }
}

/* 调整.hints容器样式 */
.hints {
  display:flex;
  gap:8px; /* 按钮之间的间距 */
  overflow:visible;
  padding:0 !important;
  margin:0 0 8px 0 !important; /* 底部间距8px */
  flex-wrap: nowrap !important; /* 不允许换行，始终保持一行 */
  align-items: center; /* 垂直居中对齐 */
  flex-direction: row; /* 水平排列，从左到右 */
  width: 100%; /* 确保容器有足够宽度 */
  background:transparent;
  border-top: none;
}

/* 调整chips区域，确保它们在输入框上方 */
#chips {
  display:flex;
  gap:8px; /* 保持图片预览之间的间距 */
  overflow:visible;
  padding:0 !important;
  margin:0 !important; /* 完全移除所有margin */
  margin-bottom:8px !important; /* 与输入框保持8像素间距 */
  background:transparent; /* 默认透明，由媒体查询覆盖 */
  border-top: none;
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease-out;
  will-change: transform;
}

/* ===== 登录弹窗 ===== */
.mask{position:fixed;inset:0;background:rgba(0,0,0,.45);display:none;align-items:center;justify-content:center;z-index:2000}
.modal{width:min(88vw,460px);max-width:94vw;background:var(--paper);border-radius:14px;padding:18px 16px;
  border:1px solid var(--line);box-shadow:0 10px 30px rgba(0,0,0,.2)}
.modal h3{margin:0 0 10px}
.modal p{margin:6px 0 12px;color:var(--sub)}
.modal input{width:93%;height:42px;border:1px solid var(--line);border-radius:10px;padding:0 12px;background:transparent;color:var(--text)}
.modal .actions{display:flex;gap:10px;margin-top:12px}
.modal .btn{flex:1;height:40px;border-radius:10px;border:1px solid var(--line);background:var(--mine);color:var(--text)}
.modal .btn.primary{background:var(--text);color:var(--pillText);border-color:transparent}

/* 图片查看器 */
.viewer{position:fixed;inset:0;background:rgba(0,0,0,.88);display:flex;align-items:center;justify-content:center;z-index:3000}
.loader{
  color: white;
  font-size: 18px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.loader:before {
  content: '';
  width: 48px;
  height: 48px;
  background: #888888;
  border-radius: 4px;
  animation: jump7456 0.5s linear infinite;
}

.loader:after {
  content: '';
  width: 48px;
  height: 5px;
  background: #88888850;
  position: absolute;
  top: calc(100% + 10px);
  border-radius: 50%;
  animation: shadow324 0.5s linear infinite;
}
.viewer img{max-width: 90vw;max-height: 90vh;border-radius: 12px;box-shadow: 0 0 30px rgba(0,0,0,0.3);transition: opacity 0.3s ease;}

/* 状态显示动画 - 使用原来的跳动方块 */
.status-loader {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 0;
  margin-left: 0;
}

.status-loader .jumping-box {
  width: 24px; /* 缩小动画尺寸 */
  height: 24px;
  position: relative;
  margin: 0;
}

.status-loader .jumping-box:before {
  content: '';
  width: 24px; /* 缩小动画尺寸 */
  height: 24px;
  background: #888888;
  border-radius: 2px; /* 调整圆角 */
  position: absolute;
  top: 0;
  left: 0;
  animation: jump7456 0.5s linear infinite;
}

.status-loader .jumping-box:after {
  content: '';
  width: 24px; /* 缩小阴影尺寸 */
  height: 3px; /* 缩小阴影高度 */
  background: #88888850;
  position: absolute;
  top: 30px; /* 调整阴影位置 */
  left: 0;
  border-radius: 50%;
  animation: shadow324 0.5s linear infinite;
}

/* 二级上拉菜单样式 */
.dropdown {
  position: relative;
  display: inline-flex;
  margin: 0 !important; /* 移除任何margin */
  padding: 0 !important; /* 移除任何padding */
  z-index: 1002; /* 增加z-index确保下拉菜单显示在最上层 */
}

/* IP形象文生图按钮样式 */
.ip-image-button {
  /* 正常位置，不需要特殊order */
  position: relative;
}
/* 一级按钮样式 - 移除上拉交互效果 */
.dropdown-toggle.sketch-to-3d,
.dropdown-toggle.nano-generate,
.dropdown-toggle.beauty-enhance,
.dropdown-toggle.to-be-developed {
  cursor: pointer;
  font-size: 12px;
  color: #1a1a1a; /* 浅色模式下使用深色文字 */
  padding: 6px 10px;
  margin: 0 !important; /* 移除任何margin */
  background: rgba(120, 120, 120, 0.12); /* 灰透液态玻璃效果 */
  backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid rgba(120, 120, 120, 0.25);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  outline: none; /* 移除点击时的默认轮廓 */
  white-space: nowrap;
  transition: all 0.3s ease; /* 简化过渡效果 */
  transform: scale(1); /* 不移除缩放效果 */
}

/* 一级按钮悬停效果 - 不移除上拉效果 */
.dropdown-toggle.sketch-to-3d:hover,
.dropdown-toggle.nano-generate:hover,
.dropdown-toggle.beauty-enhance:hover,
.dropdown-toggle.to-be-developed:hover {
  transform: scale(1.05); /* 只保留缩放，不向上移动 */
  background: rgba(120, 120, 120, 0.18);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

/* 一级按钮激活状态 - 移除上拉效果 */
.dropdown-toggle.sketch-to-3d.active,
.dropdown-toggle.nano-generate.active,
.dropdown-toggle.beauty-enhance.active,
.dropdown-toggle.to-be-developed.active {
  background: linear-gradient(135deg, #f02e2e 0%, #ff4757 100%);
  color: white;
  border-color: rgba(240, 46, 46, 0.3);
  box-shadow: 0 4px 16px rgba(240, 46, 46, .35);
  animation: subtlePulse 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  transform: scale(1); /* 激活状态不移除上拉效果 */
}

/* 一级按钮点击状态 */
.dropdown-toggle.sketch-to-3d:active,
.dropdown-toggle.nano-generate:active,
.dropdown-toggle.beauty-enhance:active,
.dropdown-toggle.to-be-developed:active {
  transform: scale(0.95); /* 轻微缩放反馈 */
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* 深色模式下的一级按钮样式 */
@media (prefers-color-scheme: dark) {
  .dropdown-toggle.sketch-to-3d,
  .dropdown-toggle.nano-generate,
  .dropdown-toggle.beauty-enhance,
  .dropdown-toggle.to-be-developed {
    background: rgba(120, 120, 120, 0.12) !important;
    color: #E7EAEE !important; /* 深色模式用浅色文字 */
    border-color: rgba(120, 120, 120, 0.25) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
  }
  
  .dropdown-toggle.sketch-to-3d:hover,
  .dropdown-toggle.nano-generate:hover,
  .dropdown-toggle.beauty-enhance:hover,
  .dropdown-toggle.to-be-developed:hover {
    background: rgba(120, 120, 120, 0.18) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.35) !important;
  }
  
  .dropdown-toggle.sketch-to-3d.active,
  .dropdown-toggle.nano-generate.active,
  .dropdown-toggle.beauty-enhance.active,
  .dropdown-toggle.to-be-developed.active {
    background: linear-gradient(135deg, #f02e2e 0%, #ff4757 100%) !important;
    color: white !important;
    border-color: rgba(240, 46, 46, 0.3) !important;
  }
}

/* IP形象文生图按钮和动物按钮的样式 - 与2D转换3D等按钮保持一致 */
.dropdown.ip-image-button .dropdown-toggle,
.dropdown.animal-button .dropdown-toggle {
  cursor: pointer;
  font-size: 12px;
  color: #1a1a1a; /* 浅色模式下使用深色文字 */
  padding: 6px 10px;
  margin: 0 !important; /* 移除任何margin */
  background: rgba(120, 120, 120, 0.12); /* 灰透液态玻璃效果 */
  backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid rgba(120, 120, 120, 0.25);
  border-radius: 14px; /* 与2D转换3D按钮相同的圆角 */
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  outline: none; /* 移除点击时的默认轮廓 */
  white-space: nowrap;
  transition: all 0.3s ease; /* 简化过渡效果 */
  transform: scale(1); /* 不移除缩放效果 */
}

.dropdown.ip-image-button .dropdown-toggle:hover,
.dropdown.animal-button .dropdown-toggle:hover {
  transform: scale(1.05); /* 只保留缩放，不向上移动 */
  background: rgba(120, 120, 120, 0.18);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

.dropdown.ip-image-button .dropdown-toggle:active,
.dropdown.animal-button .dropdown-toggle:active {
  transform: scale(0.95); /* 轻微缩放反馈 */
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* 浅色模式下动物按钮的激活状态样式 */
.dropdown.ip-image-button .dropdown-toggle.active,
.dropdown.animal-button .dropdown-toggle.active {
  background: rgba(142, 142, 147, 0.3) !important;
  color: var(--text) !important;
  border-color: rgba(142, 142, 147, 0.5) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.08) !important;
  animation: none !important; /* 移除动画效果 */
}

/* 深色模式下的IP形象文生图按钮和动物按钮样式 */
@media (prefers-color-scheme: dark) {
  .dropdown.ip-image-button .dropdown-toggle,
  .dropdown.animal-button .dropdown-toggle {
    background: rgba(120, 120, 120, 0.12) !important;
    color: #E7EAEE !important; /* 深色模式用浅色文字 */
    border-color: rgba(120, 120, 120, 0.25) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
  }
  
  .dropdown.ip-image-button .dropdown-toggle:hover,
  .dropdown.animal-button .dropdown-toggle:hover {
    background: rgba(120, 120, 120, 0.18) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.35) !important;
  }
  
  .dropdown.ip-image-button .dropdown-toggle.active,
  .dropdown.animal-button .dropdown-toggle.active {
    background: rgba(142, 142, 147, 0.3) !important;
    color: var(--text) !important;
    border-color: rgba(142, 142, 147, 0.5) !important;
  }
}

/* 其他按钮的通用样式（排除IP形象文生图、动物按钮和右侧三个按钮） */
.dropdown-toggle:hover:not(.sketch-to-3d):not(.nano-generate):not(.beauty-enhance):not(.to-be-developed) {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.dropdown-toggle:active:not(.sketch-to-3d):not(.nano-generate):not(.beauty-enhance):not(.to-be-developed) {
  transform: scale(0.94);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}


.dropdown-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.03), 0 6px 20px rgba(0,0,0,.15);
  min-width: 100%;
  display: none;
  z-index: 1001;
  white-space: nowrap;
  overflow: hidden;
}
.dropdown-item {
  padding: 8px 16px;
  cursor: pointer;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: scale(1);
}
.dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.9); /* 液态玻璃效果，不是红色 */
  transform: scale(1.02);
  padding-left: 18px;
}
.dropdown-toggle.active {
  background: linear-gradient(135deg, #f02e2e 0%, #ff4757 100%);
  color: white;
  border-color: rgba(240, 46, 46, 0.3);
  box-shadow: 0 4px 16px rgba(240, 46, 46, .35);
  animation: subtlePulse 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes subtlePulse {
  0%, 100% {
    box-shadow: 0 4px 16px rgba(240, 46, 46, .35);
  }
  50% {
    box-shadow: 0 6px 20px rgba(240, 46, 46, .45);
  }
}
.dropdown-menu.show {display: block;}

/* 数量选择按钮样式 */
.quantity-selector {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0 !important;
  padding: 0 !important;
}

/* 竖列数量选择器样式 */
.quantity-selector.vertical {
  flex-direction: column;
  gap: 8px;
  margin-left: 0;
  margin-top: 8px;
}

/* 动物按钮组容器样式 */
.animal-group-container {
  display: none !important;
  gap: 8px;
  margin-bottom: 8px;
  padding: 0;
}

.animal-group-container.show {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
}

/* 动物按钮样式 */
.animal-button {
  display: inline-flex !important;
}

/* 横向风格按钮组样式 */
.horizontal-style {
  display: none !important;
  gap: 8px;
}

.horizontal-style.show {
  display: inline-flex !important;
}

.horizontal-style .style-btn {
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  padding: 6px 10px;
  margin: 0;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: saturate(180%) blur(15px);
  border: 0.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.03);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.horizontal-style .style-btn:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.horizontal-style .style-btn:active {
  transform: scale(0.94);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.horizontal-style .style-btn.active {
  background: linear-gradient(135deg, #f02e2e 0%, #ff4757 100%);
  color: white;
  border-color: rgba(240, 46, 46, 0.3);
  box-shadow: 0 4px 16px rgba(240, 46, 46, .35);
  animation: subtlePulse 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* 横向数量选择器样式 */
.horizontal-quantity {
  display: none !important;
  gap: 8px;
}

.horizontal-quantity.show {
  display: inline-flex !important;
}

.horizontal-quantity .quantity-btn {
  cursor: pointer;
  font-size: 12px;
  color: #1a1a1a; /* 浅色模式下使用深色文字 */
  padding: 6px 10px;
  margin: 0;
  background: rgba(120, 120, 120, 0.12); /* 灰透液态玻璃效果 */
  backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid rgba(120, 120, 120, 0.25);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.horizontal-quantity .quantity-btn:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.horizontal-quantity .quantity-btn:active {
  transform: scale(0.94);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.horizontal-quantity .quantity-btn.active {
  background: linear-gradient(135deg, #f02e2e 0%, #ff4757 100%);
  color: white;
  border-color: rgba(240, 46, 46, 0.3);
  box-shadow: 0 4px 16px rgba(240, 46, 46, .35);
  animation: subtlePulse 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* 深色模式下的横向菜单样式 */
@media (prefers-color-scheme: dark) {
  .horizontal-style .style-btn {
    background: rgba(26, 29, 34, 0.8) !important;
    color: #E7EAEE !important;
    border-color: rgba(46, 50, 58, 0.6) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25), 0 2px 8px rgba(0,0,0,.25) !important;
  }
  
  .horizontal-style .style-btn:hover {
    background: rgba(33, 36, 43, 0.9) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.35) !important;
  }
  
  .horizontal-style .style-btn.active {
    background: linear-gradient(135deg, #f02e2e 0%, #ff4757 100%) !important;
    color: white !important;
    border-color: rgba(240, 46, 46, 0.3) !important;
  }
  
  .horizontal-quantity .quantity-btn {
    background: rgba(120, 120, 120, 0.12) !important;
    color: #E7EAEE !important; /* 深色模式用浅色文字 */
    border-color: rgba(120, 120, 120, 0.25) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
  }
  
  .horizontal-quantity .quantity-btn:hover {
    background: rgba(120, 120, 120, 0.18) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.35) !important;
  }
  
  .horizontal-quantity .quantity-btn.active {
    background: linear-gradient(135deg, #f02e2e 0%, #ff4757 100%) !important;
    color: white !important;
    border-color: rgba(240, 46, 46, 0.3) !important;
  }
}

.quantity-btn {
  cursor: pointer;
  font-size: 12px;
  color: #1a1a1a; /* 浅色模式下使用深色文字 */
  padding: 6px 12px;
  margin: 0 !important;
  background: rgba(120, 120, 120, 0.12); /* 灰透液态玻璃效果 */
  backdrop-filter: saturate(180%) blur(20px);
  border: 0.5px solid rgba(120, 120, 120, 0.25);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  outline: none; /* 移除点击时的默认轮廓 */
  white-space: nowrap;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(1);
}

.quantity-btn:hover {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

.quantity-btn:active {
  transform: scale(0.94);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 4px rgba(0,0,0,.08);
}

.quantity-btn.active {
  background-color: #f02e2e;
  color: white;
  border-color: #f02e2e;
  box-shadow: 0 4px 12px rgba(240, 46, 46, .25);
}

/* ========== 图库切换按钮样式 ========== */
.gallery-tabs {
  display: flex;
  gap: 8px;
  margin: 0 20px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ========== 选择按钮样式（液态玻璃效果） ========== */
.selection-toggle {
  background: rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: saturate(180%) blur(15px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: var(--text) !important;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  position: relative !important;
  overflow: hidden !important;
}

.selection-toggle:hover {
  background: rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-2px) !important;
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}

.selection-toggle:active {
  transform: translateY(0) !important;
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

.selection-toggle.active {
  background: rgba(142, 142, 147, 0.3) !important;
  border-color: rgba(142, 142, 147, 0.5) !important;
  color: #8e8e93 !important;
}

/* 深色模式下的选择按钮样式 */
@media (prefers-color-scheme: dark) {
  .selection-toggle {
    background: rgba(30, 30, 30, 0.8) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  }
  
  .selection-toggle:hover {
    background: rgba(40, 40, 40, 0.9) !important;
    box-shadow: 
      0 12px 40px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
  }
  
  .selection-toggle.active {
    background: rgba(142, 142, 147, 0.2) !important;
    border-color: rgba(142, 142, 147, 0.4) !important;
  }
}


.gallery-tab {
  padding: 8px 16px;
  background: rgba(120, 120, 120, 0.12); /* 灰透液态玻璃效果 */
  border: 1px solid rgba(120, 120, 120, 0.25);
  border-radius: 18px;
  color: #1a1a1a; /* 浅色模式下使用深色文字 */
  font-size: 14px;
  cursor: pointer;
  outline: none; /* 移除点击时的默认轮廓 */
  transition: all 0.3s ease;
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  white-space: nowrap;
  flex-shrink: 0;
}

.gallery-tab:hover {
  background: rgba(120, 120, 120, 0.18);
  transform: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

.gallery-tab.active {
  background: rgba(120, 120, 120, 0.25);
  color: #1a1a1a;
  border-color: rgba(120, 120, 120, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 聊天记录虚拟预览样式 */
.chat-virtual-preview {
  border-radius: 8px;
  position: relative;
}

.chat-virtual-preview::after {
  content: "点击查看高清";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 123, 255, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.chat-virtual-preview:hover::after {
  opacity: 1;
}

/* 聊天记录图片转圈加载动画 */
.chat-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  z-index: 10;
}

.spinner-ring {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid rgba(128, 128, 128, 0.6);
  border-radius: 50%;
  animation: chat-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
  animation-delay: -0.45s;
}

.spinner-ring:nth-child(2) {
  animation-delay: -0.3s;
}

.spinner-ring:nth-child(3) {
  animation-delay: -0.15s;
}

.spinner-ring:nth-child(4) {
  animation-delay: 0s;
}

@keyframes chat-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.chat-image-container {
  position: relative;
  display: inline-block;
}

/* 深色模式下图库标签按钮样式 */
@media (prefers-color-scheme: dark) {
  .gallery-tab {
    background: rgba(120, 120, 120, 0.12) !important;
    color: #E7EAEE !important; /* 深色模式用浅色文字 */
    border-color: rgba(120, 120, 120, 0.25) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.25) !important;
  }
  
  .gallery-tab:hover {
    background: rgba(120, 120, 120, 0.18) !important;
    box-shadow: 0 4px 16px rgba(0,0,0,.35) !important;
  }
  
  .gallery-tab.active {
    background: rgba(120, 120, 120, 0.25) !important;
    color: #E7EAEE !important;
    border-color: rgba(120, 120, 120, 0.4) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
  }
}

/* ========== 图库样式 ========== */
.gallery-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10001;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: saturate(180%) blur(15px);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  transform-origin: top left;
  transition: transform 0.2s ease-out;
  will-change: transform;
  white-space: nowrap;
}

.gallery-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.gallery-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.storage-stats {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
}

.storage-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--text);
}

.storage-bar {
  width: 100%;
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #2196F3);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.storage-bar-fill.warning {
  background: linear-gradient(90deg, #FF9800, #f02e2e);
}

.batch-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(142, 142, 147, 0.1);
  backdrop-filter: blur(10px);
  border-bottom: 0.5px solid rgba(142, 142, 147, 0.2);
}

.batch-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-buttons {
  display: flex;
  gap: 8px;
}

#selectedCount {
  font-size: 14px;
  font-weight: 600;
  color: #f02e2e;
}

.gallery-grid {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 160px));
  gap: 20px;
  align-content: start;
  align-items: start;
  justify-content: start;
}

@media (max-width: 767px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 12px;
    justify-content: center;
  }
  
  /* 手机端：适当缩小按钮（圆角不变） */
  .hints {
    gap: 7px; /* 手机端间距稍微缩小 */
  }
  
  /* 一级按钮在手机端适当缩小 */
  .dropdown-toggle.sketch-to-3d,
  .dropdown-toggle.nano-generate,
  .dropdown-toggle.beauty-enhance,
  .dropdown-toggle.to-be-developed {
    font-size: 11px; /* 从12px缩小到11px，约92% */
    padding: 5.5px 9px; /* 从6px 10px缩小到5.5px 9px，约92% */
    /* border-radius 保持不变，不缩小 */
  }
  
  /* 图片变清晰按钮在手机端适当缩小 */
  .image-enhance-btn {
    width: 28px; /* 从30px缩小到28px，约93% */
    height: 28px; /* 从30px缩小到28px，约93% */
    /* border-radius 保持50%，不改变 */
  }
  
  .image-enhance-btn svg {
    width: 15px; /* 从16px缩小到15px，约94% */
    height: 15px; /* 从16px缩小到15px，约94% */
  }
  
  /* IP形象文生图按钮在手机端适当缩小 */
  .dropdown.ip-image-button .dropdown-toggle,
  .dropdown.animal-button .dropdown-toggle {
    font-size: 11px; /* 适当缩小 */
    padding: 5.5px 9px; /* 适当缩小 */
    /* border-radius 保持不变，不缩小 */
  }
}

.gallery-item {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: block;
  contain: layout;
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.gallery-item:active {
  transform: scale(0.98);
}

.gallery-item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item.selected::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(33, 150, 243, 0.3);
  border: 3px solid #2196F3;
  border-radius: 12px;
  z-index: 1;
}

.gallery-item.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: #2196F3;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  z-index: 2;
}

.gallery-item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: white;
  font-size: 12px;
}

.expiring-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #f02e2e;
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  z-index: 1;
}

.loading {
  grid-column: 1 / -1;
  text-align: left;
  padding: 40px;
  color: var(--text);
  opacity: 0.6;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.loading:before {
  content: '';
  width: 48px;
  height: 48px;
  position: relative;
  background: #888888;
  border-radius: 4px;
  animation: jump7456 0.5s linear infinite;
}

.loading:after {
  content: '';
  width: 48px;
  height: 5px;
  background: #88888850;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  transform: none;
  border-radius: 50%;
  animation: shadow324 0.5s linear infinite;
}

.gallery-grid .loading:before,
.gallery-grid .loading:after {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .gallery-header {
    background: rgba(30, 30, 30, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
  }
  
  .storage-stats {
    background: rgba(40, 40, 40, 0.8);
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }
  
  .storage-bar {
    background: rgba(255, 255, 255, 0.05);
  }
  
  .batch-actions {
    background: rgba(142, 142, 147, 0.15);
    border-bottom-color: rgba(142, 142, 147, 0.3);
  }
  
  .gallery-item {
    background: rgba(255, 255, 255, 0.05);
  }
}

/* 深色模式按钮颜色修复 */
@media (prefers-color-scheme: dark) {
  .dropdown-toggle.active {
    background: linear-gradient(135deg, #f02e2e 0%, #ff4757 100%) !important;
    color: white !important;
    border-color: rgba(240, 46, 46, 0.3) !important;
  }

  .quantity-btn.active {
    background-color: #f02e2e !important;
    color: white !important;
    border-color: #f02e2e !important;
  }
}
