.loading-indicator .message-bubble p {
  display: flex;
  align-items: center;
  gap: var(--padding-sm);
}

.loading-dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: currentColor;
  border-radius: var(--radius-full);
  animation: loadingBounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1.0); }
}


.icon-button svg, #send-button svg {
  pointer-events: none;
  transition: var(--transition-fast);
}

#send-button:hover svg { transform: scale(1.1) rotate(15deg); }
.icon-button:hover svg { transform: scale(1.1); }



/* --- Settings Panel --- */
.settings-panel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4); /* 半透明黑色背景 */
  /* backdrop-filter: blur(8px); */
  /* -webkit-backdrop-filter: blur(8px); */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-slow);
}

.settings-panel-overlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

/* Fix: Remove unnecessary scrollbars in settings overlay/panel without affecting layout */
.settings-panel-overlay {
  overflow: hidden; /* prevent overlay from creating page-level scrollbars */
}
.settings-panel-overlay:not(.hidden) body {
  overflow: hidden !important; /* 防止 body 滚动 */
}
.settings-panel,
.settings-panel * {
  /* Keep content scrollable when needed but hide scrollbar visuals */
  -ms-overflow-style: none !important;      /* IE 10+ */
  scrollbar-width: none !important;         /* Firefox */
  overflow-y: auto; /* Allow scrolling but hide visual scrollbar */
  -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
}
.settings-panel::-webkit-scrollbar,
.settings-panel *::-webkit-scrollbar {
  width: 0 !important;           /* WebKit */
  height: 0 !important;
  background: transparent !important;
  display: none !important;
}
.settings-panel:hover,
.settings-panel *:hover {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}
.settings-panel:hover::-webkit-scrollbar,
.settings-panel *:hover::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
  background: transparent !important;
}
.settings-panel .setting-group,
.settings-panel .setting-group * {
  overflow: hidden !important; /* 防止子元素溢出导致滚动条 */
  max-height: none;
}


.settings-panel {
  padding: 32px 36px;
  width: 680px;
  max-width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;

  /* 统一玻璃效果 */
  background: var(--unified-bg);
  backdrop-filter: blur(20px) saturate(2) brightness(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(2) brightness(1.3);
  border: 2px solid var(--unified-border);
  border-radius: var(--radius-xl);

  /* 3D Physicality - 与主界面一致 */
  transform: scale(0.95) translateY(20px) rotateX(0deg) rotateY(0deg);
  transform-style: preserve-3d;
  transition: all 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
  opacity: 0;
  margin: 0 auto;
  z-index: 11;

  /* Unified Glossy Glass Shadow - 与主界面一致 */
  box-shadow:
    inset 0px 3px 12px rgba(255, 255, 255, 0.4),
    inset -2px -3px 6px rgba(255, 255, 255, 0.25),
    0 20px 40px rgba(0,0,0,0.08),
    0 8px 16px rgba(0,0,0,0.05);
}

/* 统一内发光效果 */
.settings-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: var(--unified-glass);
    opacity: 0.8;
    pointer-events: none;
    z-index: 1; /* Above background, below content */
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}



.settings-panel-overlay:not(.hidden) .settings-panel {
  transform: scale(1) translateY(0) rotateX(0deg) rotateY(0deg);
  opacity: 1;
}

/* 移除设置面板的悬停效果，保持简洁 */

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  margin-bottom: 24px;

  /* 统一玻璃效果头部 */
  background: var(--unified-glass);
  backdrop-filter: blur(20px) saturate(200%) brightness(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(200%) brightness(1.2);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);

  position: relative;
  z-index: 2;
  transform: translateZ(40px);

  /* 玻璃阴影效果 - 与主界面一致 */
  box-shadow:
    inset 0px 2px 8px rgba(255, 255, 255, 0.25),
    inset -1px -2px 4px rgba(255, 255, 255, 0.15),
    0 12px 30px rgba(0,0,0,0.2);

  transition: all 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
  overflow: hidden;
}

/* 闪光动画效果 - 与主界面一致 */
.settings-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0) 100%);
  transition: left 0.8s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
  z-index: 3;
}

.settings-header:hover::before {
  left: 100%;
}

/* 亮面高光效果 - 与主界面一致 */
.settings-header::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
  opacity: 0.8;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* 保留头部的轻微悬停效果，但移除变白 */
.settings-header:hover {
  box-shadow:
    inset 0px 3px 10px rgba(255, 255, 255, 0.3),
    inset -1px -2px 5px rgba(255, 255, 255, 0.18),
    0 15px 35px rgba(0,0,0,0.22);
}

.settings-header h2 {
  margin: 0;
  color: #000000; /* 深色文字以在亮玻璃背景上提供对比度 */
  font-size: 1.8rem; /* 增加字体大小 */
  font-weight: 800; /* 增加字体重量，更显眼 */
  font-family: 'Inter', sans-serif; /* 与主界面字体一致 */
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.6); /* 增强阴影效果 */
  letter-spacing: -0.1px; /* 调整字间距 */
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5); /* 亮色阴影增强可读性 */
  letter-spacing: -0.02em; /* 现代字间距 */
  transform: translateZ(5px);
  position: relative;
  z-index: 4; /* 确保在所有效果之上 */
}

.settings-header .icon-button {
  background: rgba(255, 255, 255, 0.25); /* Match retry button */
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transform: scale(1.05);
  box-shadow:
    0 2px 15px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.settings-header .icon-button:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.08);
  box-shadow:
    0 4px 25px rgba(255, 255, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.settings-header .icon-button:active {
  transform: scale(1.02); /* Pressed effect */
  box-shadow:
    0 1px 8px rgba(255, 255, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

.settings-header .icon-button svg {
  stroke: white;
  width: 18px;
  height: 18px;
  opacity: 0.9;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.settings-header .icon-button:hover svg {
  stroke-width: 2.2;
  opacity: 1;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5));
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
  position: relative;

  /* Subtle glassmorphism for setting groups */
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(15px) saturate(1.5);
  -webkit-backdrop-filter: blur(15px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-md);

  /* Subtle shadow for depth */
  box-shadow:
    inset 0px 1px 3px rgba(255, 255, 255, 0.15),
    0 4px 12px rgba(0, 0, 0, 0.08);

  transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* 移除设置组的悬停效果，避免过度变化 */

.setting-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.setting-group label:not(.switch) {
  font-weight: 600;
  font-size: 0.95em;
  color: #1a1a1a; /* 深色文字确保在亮玻璃背景下可见 */
  margin-bottom: var(--padding-sm);
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5); /* 亮色阴影增强可读性 */
  position: relative;
  font-family: var(--font-family-main);
}

.setting-group label:not(.switch)::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 30%;
  height: 2px;
  background: linear-gradient(90deg, rgba(76, 123, 217, 0.6) 0%, rgba(76, 123, 217, 0.2) 100%);
  border-radius: 1px;
}

/* --- Form Controls --- */
.settings-panel input[type="text"],
.settings-panel input[type="password"],
.settings-panel select {
  background: var(--unified-glass); /* 统一玻璃背景 */
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1.5px solid var(--unified-border); /* 统一边框 */
  border-radius: var(--radius-lg); /* 与主界面一致的圆角 */
  color: #1a1a1a; /* 深色文字确保在白色背景下可见 - 与主界面一致 */
  padding: 16px 22px; /* 增加内边距 */
  width: 100%;
  font-size: 1.05em; /* 增加字体大小 */
  font-weight: 500; /* 增加字体重量，更显眼 */
  font-family: var(--font-family-main);
  min-height: 50px; /* 增加最小高度 */
  outline: none;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
  box-shadow:
    inset 0px 2px 4px rgba(255,255,255,0.25),
    0 12px 30px rgba(0,0,0,0.2); /* 与主界面一致的阴影 */
  letter-spacing: 0.3px; /* 增加字间距 */
  resize: none;
}

.settings-panel input[type="text"]:focus,
.settings-panel input[type="password"]:focus,
.settings-panel select:focus {
  background: var(--unified-glass); /* 统一聚焦背景 */
  opacity: 0.9;
  border-color: var(--accent); /* 统一聚焦边框 */
  color: var(--unified-text); /* 统一文字色 */
  box-shadow:
    0 0 0 2px rgba(0, 123, 255, 0.25), /* 统一发光效果 */
    inset 0px 1px 2px rgba(255,255,255,0.18),
    0 25px 45px -15px rgba(0,0,0,0.3);
}

.settings-panel input[type="text"]:hover,
.settings-panel input[type="password"]:hover,
.settings-panel select:hover {
  background: var(--unified-glass);
  opacity: 0.8;
  border-color: var(--unified-border);
  color: var(--unified-text);
  box-shadow:
    inset 0px 2px 4px rgba(255,255,255,0.3),
    0 14px 32px rgba(0,0,0,0.22);
}

/* Placeholder styles for glass inputs */
.settings-panel input[type="text"]::placeholder,
.settings-panel input[type="password"]::placeholder {
  color: rgba(26, 26, 26, 0.6); /* 深色占位符文字 - 与主界面一致 */
  opacity: 1; /* 确保占位符可见 */
  font-style: normal;
  font-weight: 400; /* 占位符较轻字重 */
}

/* --- Range Sliders --- */
.settings-panel input[type="range"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2); /* Brighter track */
  border: 1.5px solid rgba(255, 255, 255, 0.4); /* Thicker, brighter border */
  margin: 10px 0;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.05),
    0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 8px rgba(255, 255, 255, 0.1); /* Subtle glow */
  transform: translateZ(2px);
}

.settings-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.9); /* Thicker, brighter border */
  cursor: pointer;
  margin-top: -7px;
  box-shadow:
    0 2px 15px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  transform: scale(1.05);
}

.settings-panel input[type="range"]::-webkit-slider-thumb:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 1);
  box-shadow:
    0 4px 25px rgba(255, 255, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
  transform: scale(1.12);
}

.slider-value {
  font-size: 0.9em;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin-left: 12px;
  min-width: 40px;
  text-align: center;
  letter-spacing: 0.3px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  background-color: rgba(255, 255, 255, 0.25); /* Brighter background */
  border: 1.5px solid rgba(255, 255, 255, 0.4); /* Thicker, brighter border */
  box-shadow:
    0 2px 15px rgba(255, 255, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transform: translateZ(3px) scale(1.05);
  backdrop-filter: blur(10px) saturate(1.3);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
}

.slider-value:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

/* --- API Key Controls --- */
.api-key-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: var(--padding-sm);
}

.api-key-controls input {
  flex-grow: 1;
  width: 100%;
}

.api-key-buttons {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

#save-api-key, #clear-api-key {
  padding: 12px 20px;
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.95em;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3), 0 1px 2px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  position: relative;
  overflow: hidden;
  transform: scale(1.05);
  flex: 1;
}

#save-api-key {
  background: rgba(255, 255, 255, 0.25);
  box-shadow:
    0 2px 15px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

#clear-api-key {
  background: rgba(248, 113, 113, 0.25); /* 红色背景 */
  box-shadow:
    0 2px 15px rgba(248, 113, 113, 0.2),
    inset 0 1px 0 rgba(248, 113, 113, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  border-color: rgba(248, 113, 113, 0.4);
}

#save-api-key:hover {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.08);
  box-shadow:
    0 4px 25px rgba(255, 255, 255, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

#clear-api-key:hover {
  background: rgba(248, 113, 113, 0.35);
  border-color: rgba(248, 113, 113, 0.5);
  transform: scale(1.08);
  box-shadow:
    0 4px 25px rgba(248, 113, 113, 0.25),
    inset 0 1px 0 rgba(248, 113, 113, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

#save-api-key:active {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.02);
  box-shadow:
    0 1px 8px rgba(255, 255, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

#clear-api-key:active {
  background: rgba(248, 113, 113, 0.2);
  transform: scale(1.02);
  box-shadow:
    0 1px 8px rgba(248, 113, 113, 0.15),
    inset 0 1px 0 rgba(248, 113, 113, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  border-color: rgba(248, 113, 113, 0.4);
}

#api-key-status {
  font-size: 0.9em;
  font-weight: 600;
  margin-top: var(--padding-sm);
  padding: var(--padding-sm) 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  letter-spacing: 0.3px;
  /* backdrop-filter: blur(8px); */
  /* -webkit-backdrop-filter: blur(8px); */
  transition: var(--transition-normal);
  position: relative;
  line-height: 1.4;
}

#api-key-status::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: var(--radius-sm);
  padding: 1px;
  background: var(--gradient-hover);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
}

#api-key-status.status-ok {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15); /* 统一成功状态背景 */
  border: 1px solid rgba(74, 222, 128, 0.3);
  box-shadow: var(--shadow-light), inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

#api-key-status.status-error {
  color: #f87171;
  background: rgba(248, 113, 113, 0.15); /* 统一错误状态背景 */
  border: 1px solid rgba(248, 113, 113, 0.3);
  box-shadow: var(--shadow-light), inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

#api-key-status.status-warn {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.15); /* 统一警告状态背景 */
  border: 1px solid rgba(251, 191, 36, 0.3);
  box-shadow: var(--shadow-light), inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

#api-key-status.status-info {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.15); /* 统一信息状态背景 */
  border: 1px solid rgba(96, 165, 250, 0.3);
  box-shadow: var(--shadow-light), inset 0 1px 2px rgba(255, 255, 255, 0.1);
  font-style: italic;
}

/* --- Side by Side Images --- */
.side-by-side-images {
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: var(--padding-md);
}

.qrcode-section-title {
  font-weight: 500;
  font-size: 0.9em;
  color: var(--text-secondary);
  text-align: center;
  width: 100%;
  margin-bottom: var(--padding-sm);
}

.image-container {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  width: 100%;
  gap: var(--padding-md);
}

.image-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-basis: 45%;
  max-width: 150px;
}

.settings-inline-image {
  max-width: 100px;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: block;
}

.qrcode-text-small {
  font-size: 0.8em;
  color: var(--text-secondary);
  margin-top: var(--padding-sm);
  line-height: 1.3;
}

/* --- Advanced Settings --- */

/* --- Switch Controls --- */
.switch-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--padding-md);
  padding: var(--padding-sm) 0;
}

.setting-group.switch-group {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  margin: 0;
  transition: var(--transition-normal);
}

/* 移除开关的缩放效果 */

.switch input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(60, 60, 65, 0.9) 0%, rgba(45, 45, 50, 0.95) 50%, rgba(55, 55, 60, 0.9) 100%);
  transition: var(--transition-slow);
  border: 1.5px solid var(--border);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.slider::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
  transition: left 0.6s ease;
}

.slider:hover::before { left: 100%; }

.slider:after {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #e2e8f0 100%);
  transition: var(--transition-slow);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 2px 6px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.9), inset 0 -1px 2px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.slider:hover:after {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4), 0 3px 8px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.9), inset 0 -1px 2px rgba(0, 0, 0, 0.15);
}

input:checked + .slider {
  background: var(--gradient-button);
  border-color: rgba(0, 123, 255, 0.3);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 123, 255, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
}

input:focus + .slider {
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.2), var(--shadow-light);
}

input:checked + .slider:after {
  transform: translateY(-50%) translateX(24px);
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 50%, #e2e8f0 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.9), inset 0 -1px 2px rgba(0, 0, 0, 0.1);
}

.slider.round { border-radius: var(--radius-pill); }
.slider.round:after { border-radius: var(--radius-full); }

.concat-mode-label {
  font-weight: 600;
  font-size: 0.95em;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: var(--transition-normal);
  position: relative;
}

.concat-mode-label:hover { transform: translateX(2px); }

.concat-mode-label::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0%, transparent 100%);
  transition: var(--transition-normal);
}

.concat-mode-label:hover::after { width: 40%; }

/* --- Rotating Pages --- */
.rotating-pages-container {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1;
  perspective: 2500px;
  overflow: hidden;
  border-radius: var(--radius-md);
  /* Removed inner shadow and radial mask for flat background */
  box-shadow: none;
  /* isolation and mask-image removed */
}

.rotating-container {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform-origin: center center;
  background: transparent; /* Removed glass effect */
}

.rotating-page {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  transform-origin: center center;
  /* box-shadow: 0 0 30px rgba(0, 0, 0, 0.5); */ /* Removed shadow to avoid extra layer effect */
  border-radius: var(--radius-md); /* Keep original radius for page shape */
  overflow: hidden;
  background: transparent; /* Removed glass effect */
  transition: var(--transition-normal);
}

.rotating-page.current {
  transform: none !important;
  position: relative;
  z-index: 1;
}

.rotating-page > div {
  height: 100%; /* Make inner wrapper fill full height, so page-container spans entire area */
}

.page-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: auto;
  /* Removed background, border, and shadow to make it transparent */
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  /* Keep radius and box-sizing for structure */
  border-radius: var(--radius-md); /* Match parent .rotating-page */
  box-sizing: border-box; /* Include padding & border in width/height */
  /* Padding is handled by inner elements like .chat-area */
  padding: 0;
}

.page-navigation {
  display: flex;
  gap: var(--padding-sm);
  margin-right: auto;
  margin-left: var(--padding-sm);
}

.page-nav-tab {
  padding: var(--padding-sm) var(--padding-md);
  border-radius: var(--radius-lg);
  font-size: 1em;
  cursor: pointer;
  transition: all 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  user-select: none;
  font-weight: 500;
  background: rgba(30, 30, 30, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  z-index: 1;
  transform: rotateX(0deg) rotateY(0deg);
  transform-style: preserve-3d;
  box-shadow:
    inset 0px 2px 8px rgba(255, 255, 255, 0.07),
    inset -1px -2px 4px rgba(255, 255, 255, 0.04),
    0 8px 16px -4px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.page-nav-tab::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 65%);
  opacity: 0.8;
  pointer-events: none;
  z-index: 2;
  transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.page-nav-tab.active {
  background: rgba(30, 30, 30, 0.4);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  text-shadow: none;
  box-shadow:
    inset 0px 4px 15px rgba(255, 255, 255, 0.1),
    inset -2px -4px 8px rgba(255, 255, 255, 0.05),
    0 12px 24px -4px rgba(0, 0, 0, 0.35);
}

.page-nav-tab.active::before {
  opacity: 1;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 65%);
}

.page-nav-tab:hover:not(.active) {
  transform: scale(1.02) rotateX(2deg) rotateY(-2deg);
  background: rgba(30, 30, 30, 0.35);
  color: rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0px 3px 12px rgba(255, 255, 255, 0.08),
    inset -1px -3px 6px rgba(255, 255, 255, 0.04),
    0 10px 20px -4px rgba(0, 0, 0, 0.3);
}

.page-nav-tab:hover:not(.active)::before {
  opacity: 1;
  transform: scale(1.02) translate(-1px, -1px);
}

/* --- File Mode Pages --- */
.file-mode-page,
.super-file-page {
  display: flex;
  flex-direction: column;
  gap: var(--padding-md);
  padding: var(--padding-md);
  height: 100%;
}

.file-mode-description,
.super-file-description {
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-bottom: var(--padding-md);
}

.file-drop-zone,
.super-file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: calc(var(--padding-lg) * 1.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: var(--padding-lg);
  background-color: rgba(0,0,0,0.2);
  transition: var(--transition-normal);
  cursor: pointer;
  font-size: 1.2em;
}

.file-drop-zone:hover,
.super-file-drop-zone:hover,
.file-drop-zone.drag-over,
.super-file-drop-zone.drag-over {
  border-color: var(--accent);
  background-color: rgba(0, 123, 255, 0.1);
}

.file-input,
.super-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
  visibility: hidden;
}

.file-list-container,
.super-file-status {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: var(--padding-md);
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: var(--padding-sm);
  max-height: 200px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: var(--padding-sm);
  gap: var(--padding-sm);
}

.file-icon { color: var(--text-secondary); }

.file-info { flex-grow: 1; }

.file-name {
  font-weight: 500;
  font-size: 0.9em;
}

.file-size {
  font-size: 0.8em;
  color: var(--text-secondary);
}

.file-actions {
  display: flex;
  gap: var(--padding-sm);
}

.file-convert-btn,
.file-remove-btn,
.action-button {
  padding: 4px var(--padding-sm);
  font-size: 0.8em;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.file-convert-btn,
.action-button {
  background-color: var(--accent);
  color: var(--button-text);
}

.file-convert-btn:hover,
.action-button:hover {
  background-color: var(--accent-hover);
}

.file-remove-btn {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.file-remove-btn:hover { background-color: var(--error); }

.file-status {
  font-size: 0.8em;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background-color: rgba(0, 0, 0, 0.3);
}

.file-status.converting { color: var(--warning); }
.file-status.converted { color: var(--success); }

.conversion-results {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: var(--padding-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: var(--padding-md);
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--padding-md);
  overflow-y: auto;
  max-height: 300px;
  padding: var(--padding-sm);
}

.result-item {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--padding-sm);
  background-color: rgba(0, 0, 0, 0.2);
}

.result-header h4 {
  margin: 0;
  font-size: 0.9em;
}

.result-actions {
  display: flex;
  justify-content: flex-end;
  padding: var(--padding-sm);
  background-color: rgba(0, 0, 0, 0.1);
  gap: var(--padding-sm);
}

.copy-btn,
.download-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.copy-btn:hover,
.download-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.result-content {
  padding: var(--padding-sm);
  max-height: 200px;
  overflow-y: auto;
}

.result-content pre {
  margin: 0;
  white-space: pre-wrap;
  font-size: 0.85em;
  font-family: monospace;
}

/* --- Super File Mode --- */
.super-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--padding-md);
  margin-bottom: var(--padding-md);
}

.super-feature-card {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: var(--padding-md);
  text-align: center;
  transition: var(--transition-normal);
}

.super-feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.super-feature-icon {
  margin-bottom: var(--padding-sm);
  color: var(--accent);
}

.super-feature-card h3 {
  margin: 0 0 var(--padding-sm) 0;
  font-size: 1em;
}

.super-feature-card p {
  margin: 0;
  font-size: 0.85em;
  color: var(--text-secondary);
}

.super-button {
  padding: var(--padding-sm) var(--padding-md);
  border-radius: var(--radius-sm);
  border: none;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
  font-size: 0.9em;
}

.super-button:hover { background-color: rgba(255, 255, 255, 0.2); }

.super-button.primary {
  background-color: var(--accent);
  color: var(--button-text);
}

.super-button.primary:hover { background-color: var(--accent-hover); }

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--padding-md);
}

.option-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-basis: 45%;
  max-width: 150px;
}

.super-select {
  padding: var(--padding-sm);
  background-color: var(--input-bg);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.switch-option {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.progress-container {
  height: var(--padding-sm);
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  margin-top: var(--padding-sm);
}

.progress-bar {
  height: 100%;
  background-color: var(--accent);
  border-radius: var(--radius-sm);
  width: 0%;
  transition: var(--transition-normal);
}

.progress-text {
  position: absolute;
  right: var(--padding-sm);
  top: -18px;
  font-size: 0.75em;
  color: var(--text-secondary);
}

.status-display {
  padding: var(--padding-sm);
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.processing-options,
.super-action-panel,
.super-results {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  padding: var(--padding-md);
}

.super-action-panel {
  display: flex;
  justify-content: center;
  gap: var(--padding-md);
}

.results-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--padding-md);
}

.tab-btn {
  padding: var(--padding-sm) var(--padding-md);
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.super-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--padding-md);
  max-height: 300px;
  overflow-y: auto;
}

.super-result-card {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.result-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--padding-sm);
  background-color: rgba(0, 0, 0, 0.2);
}

.result-card-content {
  padding: var(--padding-sm);
  max-height: 150px;
  overflow-y: auto;
}

.result-card-actions {
  display: flex;
  justify-content: flex-end;
  padding: var(--padding-sm);
  background-color: rgba(0, 0, 0, 0.1);
  gap: var(--padding-sm);
}

.super-results-list {
  display: flex;
  flex-direction: column;
  gap: var(--padding-sm);
  max-height: 300px;
  overflow-y: auto;
}

.super-result-list-item {
  display: flex;
  align-items: center;
  padding: var(--padding-sm);
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  gap: var(--padding-md);
}

.list-item-info { flex-basis: 30%; }

.list-item-name {
  font-weight: 500;
  font-size: 0.9em;
}

.list-item-size {
  font-size: 0.8em;
  color: var(--text-secondary);
}

.list-item-preview {
  flex-grow: 1;
  font-size: 0.85em;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-actions {
  display: flex;
  gap: var(--padding-sm);
}

.action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
}

.action-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.super-results-actions {
  display: flex;
  justify-content: center;
  gap: var(--padding-md);
  margin-top: var(--padding-md);
}

/* --- 移除设置面板的选中状态边框 --- */
.settings-panel {
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
}

.settings-panel:focus {
  outline: none !important;
  box-shadow:
    inset 0px 2px 8px rgba(255, 255, 255, 0.07),
    inset -1px -2px 4px rgba(255, 255, 255, 0.04),
    0 40px 80px -20px rgba(0, 0, 0, 0.35); /* 保持原有阴影，不添加选中效果 */
}

.settings-panel *:focus {
  outline: none !important;
}

/* --- 移除所有可能的选中效果 --- */
.settings-panel-overlay *,
.settings-panel-overlay *:before,
.settings-panel-overlay *:after {
  -webkit-tap-highlight-color: transparent;
  outline: none !important;
}

/* --- Utility Classes --- */
.hidden { display: none !important; }

/* --- Scrollbar Styling --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* --- Toast Notification --- */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--accent); /* Use accent color for consistency */
  color: var(--button-text);
  padding: 12px 20px; /* 增加内边距 */
  border-radius: var(--radius-md); /* Slightly larger radius */
  box-shadow: var(--shadow-soft); /* Softer shadow */
  z-index: 2000;
  font-size: 1em; /* 增加字体大小 */
  font-weight: 600; /* 增加字体重量，更显眼 */
  opacity: 0;
  transition: var(--transition-normal);
  border: 1px solid var(--border);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); /* 增加阴影效果 */
}

.toast:not(.hidden) {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}



/* --- Enhanced Toggle Animations --- */
.mode-switch input:checked + .mode-slider::after {
  transform: translateX(96px);
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.mode-switch input:checked + .mode-slider::before {
  animation: toggle-ripple 0.4s ease-out;
}

.mode-switch input:active + .mode-slider::after {
  transform: translateX(96px) scale(1.1);
  transition: var(--transition-fast);
}

@keyframes toggle-ripple {
  0% { transform: scale(0.8); opacity: 0.5; }
  80% { transform: scale(1.2); opacity: 0; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* --- Responsive Design --- */
@media (max-width: 1200px) {
  .mode-switch { width: 130px; height: 42px; }
  .mode-slider:after { height: 34px; width: 34px; }
  input:checked + .mode-slider:after { transform: translateX(88px); }
  .mode-text-normal, .mode-text-seiko { font-size: 11px; letter-spacing: 0.6px; }
}

@media (max-width: 768px) {
  .chat-app-container {
      width: 100%;
      height: 100vh;
      max-height: none;
      border-radius: 0;
      border: none;
  }

  .app-header h1 { font-size: 1.2em; }

  .app-header, .input-area, .chat-area {
      padding-left: var(--padding-md);
      padding-right: var(--padding-md);
  }

  .header-controls { gap: var(--padding-sm); }
  .message-group { max-width: 95%; }

  .settings-panel {
      width: 95%;
      padding: 20px;
      border-radius: var(--padding-md);
      max-height: 90vh;
  }

  .settings-header {
      margin-bottom: 20px;
      padding-bottom: var(--padding-md);
  }

  .settings-header h2 { font-size: 1.2em; }

  .setting-group {
      padding: var(--padding-md) 0;
      margin-bottom: 12px;
      gap: 10px;
  }

  .setting-group label:not(.switch) {
      font-size: 0.9em;
      margin-bottom: 6px;
  }

  .settings-panel input[type="text"],
  .settings-panel input[type="password"],
  .settings-panel select {
      padding: 12px var(--padding-md);
      font-size: 0.95em;
      border-radius: var(--radius-sm);
  }

  .settings-panel input[type="range"] {
      height: var(--padding-sm);
      margin: 6px 0;
  }

  .settings-panel input[type="range"]::-webkit-slider-thumb {
      width: 20px;
      height: 20px;
      margin-top: -6px;
  }

  .settings-panel input[type="range"]::-moz-range-thumb {
      width: 20px;
      height: 20px;
  }

  .slider-value {
      font-size: 0.9em;
      min-width: 40px;
      padding: 3px 6px;
      margin-left: 10px;
  }

  .api-key-controls {
      flex-direction: column;
      gap: 10px;
      align-items: stretch;
  }

  #save-api-key {
      padding: 12px var(--padding-md);
      font-size: 0.9em;
      width: 100%;
  }

  #api-key-status {
      font-size: 0.85em;
      padding: 6px 10px;
      margin-top: 6px;
  }

  .image-container {
      display: flex;
      flex-wrap: wrap;
  }

  .image-item { flex-basis: 48%; }

  .input-mode-toggle {
      margin-bottom: var(--padding-md);
      padding: 12px 0;
  }

  .mode-label {
      font-size: 17px; /* 增加字体大小 */
      font-weight: 700; /* 增加字体重量，更显眼 */
      margin-right: var(--padding-md);
      letter-spacing: 1.2px; /* 增加字间距 */
  }

  .mode-switch {
      width: 120px;
      height: 40px;
      transition: var(--transition-normal);
  }

  .mode-slider { border-radius: 20px; }

  .mode-slider:after {
      height: 32px;
      width: 32px;
      left: 4px;
      top: 4px;
  }

  input:checked + .mode-slider:after { transform: translateX(80px); }

  .mode-text-normal, .mode-text-seiko {
      font-size: 10px;
      font-weight: 700;
      letter-spacing: 0.5px;
  }

  .mode-text-normal { left: 12px; }
  .mode-text-seiko { right: 12px; }

  .page-navigation { gap: 4px; }
  .page-nav-tab { padding: 4px var(--padding-sm); font-size: 0.8em; }

  .input-area {
      padding: 20px var(--padding-lg);
      gap: var(--padding-md);
  }

  #user-input {
      padding: 18px 22px;
      font-size: 1.08em;
      line-height: 1.6;
      min-height: 56px;
      max-height: 200px;
      border-radius: var(--radius-lg);
      letter-spacing: 0.3px;
      background: linear-gradient(135deg, rgba(35, 35, 40, 0.95) 0%, rgba(30, 30, 35, 0.9) 100%);
      border: 1px solid var(--border);
      box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  }

  #user-input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2), 0 4px var(--padding-md) rgba(0, 0, 0, 0.2);
      background: linear-gradient(135deg, rgba(40, 40, 45, 0.95) 0%, rgba(35, 35, 40, 0.9) 100%);
      transform: translateY(-0.5px);
  }

  #send-button, .icon-button {
      width: 42px;
      height: 42px;
      border-radius: var(--radius-lg);
      font-size: 0.9em;
  }

  .super-features-grid { grid-template-columns: 1fr; }
  .option-grid { grid-template-columns: 1fr; }
  .super-action-panel { flex-direction: column; gap: var(--padding-sm); }
  .super-results-actions { flex-direction: column; gap: var(--padding-sm); }

  .super-result-list-item { flex-direction: column; align-items: flex-start; }
  .list-item-info { flex-basis: auto; width: 100%; }
  .list-item-preview { width: 100%; }
  .list-item-actions {
      width: 100%;
      justify-content: flex-end;
      margin-top: var(--padding-sm);
  }

  .ai-content-wrapper {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: var(--padding-sm);
      position: relative;
  }

  .message-actions-container {
      width: 100%;
      flex-direction: row;
      justify-content: flex-start;
      flex-wrap: wrap;
      position: relative;
      z-index: 10;
  }
}

@media (max-width: 360px) {
  .mode-switch { width: 90px; height: 32px; }

  .mode-slider:after {
      height: var(--padding-lg);
      width: var(--padding-lg);
      left: 3px;
      top: 3px;
  }

  input:checked + .mode-slider:after { transform: translateX(58px); }

  .mode-text-normal, .mode-text-seiko {
      font-size: var(--padding-sm);
      letter-spacing: 0.3px;
  }

  .mode-text-normal { left: var(--padding-sm); }
  .mode-text-seiko { right: var(--padding-sm); }
  .mode-label { font-size: 15px; font-weight: 700; letter-spacing: 0.8px; } /* 增加字体大小和重量 */

  .input-area {
      padding: 14px var(--padding-md);
      gap: 10px;
      background: linear-gradient(135deg, rgba(20, 20, 25, 0.92) 0%, rgba(15, 15, 20, 0.88) 100%);
      box-shadow: 0 -1px 12px rgba(0, 0, 0, 0.2);
  }

  #user-input {
      padding: 14px 18px;
      font-size: 0.98em;
      line-height: 1.5;
      min-height: 44px;
      max-height: 140px;
      border-radius: var(--radius-lg);
      letter-spacing: 0.1px;
      background: linear-gradient(135deg, rgba(30, 30, 35, 0.95) 0%, rgba(25, 25, 30, 0.9) 100%);
      border: 1px solid rgba(255, 255, 255, 0.08);
      box-shadow: 0 2px var(--padding-sm) rgba(0, 0, 0, 0.15);
  }

  #user-input:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 1.5px rgba(0, 123, 255, 0.15), 0 3px 12px rgba(0, 0, 0, 0.25);
      background: linear-gradient(135deg, rgba(35, 35, 40, 0.95) 0%, rgba(30, 30, 35, 0.9) 100%);
      transform: none;
  }

  #send-button, .icon-button {
      width: 38px;
      height: 38px;
      border-radius: var(--radius-sm);
      font-size: 0.85em;
  }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .mode-slider { border-width: 0.5px; }

  .mode-text-normal, .mode-text-seiko {
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
  }

  .mode-label {
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
  }
}

/* --- Settings Panel Text Colors --- */
.settings-panel label,
.settings-panel .setting-group label,
.settings-panel .qrcode-section-title,
.settings-panel .qrcode-text-small,
.settings-panel p {
  color: #1a1a1a; /* 深色文字确保在亮玻璃背景下可见 */
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.6); /* 增强亮色阴影 */
  font-family: 'Inter', sans-serif; /* 与主界面字体一致 */
  font-weight: 600; /* 增加字体重量，更显眼 */
  font-size: 1.05em; /* 增加字体大小 */
}

.settings-panel #api-key-status {
  color: rgba(26, 26, 26, 0.7); /* 稍透明的深色用于状态文字 */
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.settings-panel .advanced-settings-toggle {
  color: var(--unified-text); /* 统一文字色 */
  background: var(--unified-button); /* 统一按钮背景 */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5); /* 亮色阴影增强可读性 */
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.settings-panel .advanced-settings-toggle:hover {
  /* 保持轻微的悬停反馈，但移除变白 */
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* --- Settings Panel Buttons --- */
.settings-panel button:not(.icon-button) {
  background: var(--unified-button); /* 统一按钮背景 */
  color: var(--unified-text); /* 统一文字色 */
  border: 1.5px solid var(--unified-border);
  border-radius: var(--radius-lg);
  padding: 14px 22px; /* 增加内边距 */
  font-family: 'Inter', sans-serif;
  font-weight: 700; /* 增加字体重量，更显眼 */
  font-size: 1.05em; /* 增加字体大小 */
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.6); /* 增强亮色阴影 */
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow:
    inset 0px 1px 0 rgba(255, 255, 255, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

/* --- 添加与主界面一致的闪光效果 --- */
.settings-panel button:not(.icon-button)::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.4) 50%,
      transparent 100%);
  transition: left 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
  z-index: 2;
}

.settings-panel button:not(.icon-button):hover {
  /* 保持轻微的悬停反馈，但移除变白和缩放 */
  box-shadow:
    inset 0px 1px 0 rgba(255, 255, 255, 0.5),
    0 8px 20px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}

/* --- 鼠标悬停时触发闪光效果 --- */
.settings-panel button:not(.icon-button):hover::before {
  left: 100%;
}

/* --- Glass Shimmer Animation --- */
@keyframes glass-shimmer {
  0% {
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  }
  50% {
    background: radial-gradient(circle at 60% 40%, rgba(255, 255, 255, 0.35) 0%, transparent 55%),
                radial-gradient(circle at 20% 60%, rgba(255, 255, 255, 0.25) 0%, transparent 55%);
  }
  100% {
    background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  }
}

/* --- 覆盖glass-ui-container的悬停效果，避免设置面板缩放变白 --- */
.settings-panel.glass-ui-container:hover {
  transform: none;
  background: inherit;
  backdrop-filter: inherit;
  -webkit-backdrop-filter: inherit;
  box-shadow: inherit;
  cursor: default;
}

/* --- Settings Panel Glassmorphism Complete --- */
