/* 右侧栏、聊天、预览区相关样式 */
.right-bar {
  flex: 0 0 25%;
  max-width: 30vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, flex-basis 0.3s ease, max-width 0.3s ease;
  height: 100vh;
  transform: translateX(0);
  opacity: 1;
}

/* 侧边栏隐藏状态 */
.right-bar.hidden {
  transform: translateX(100%);
  opacity: 0;
  flex-basis: 0;
  max-width: 0;
}

/* 侧边栏切换按钮 */
.sidebar-toggle-btn {
  opacity: 0.2;
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #0078d7, #005a9e);
  color: white;
  border: none;
  border-radius: 8px 0 0 8px;
  width: 18px;
  height: 100px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: -2px 0 8px rgba(0, 120, 215, 0.3);
  z-index: 1001;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 1px;
  line-height: 1.2;
  margin: 0;
}

.sidebar-toggle-btn:hover {
  opacity: 1;
  background: linear-gradient(135deg, #42a5f5, #0078d7);
  width: 24px;
  box-shadow: -3px 0 12px rgba(0, 120, 215, 0.4);
  transform: translateY(-50%) translateX(-2px);
}

.sidebar-toggle-btn:active {
  transform: translateY(-50%) translateX(-1px) scale(0.98);
}

/* 当侧边栏隐藏时，按钮位置调整 */
.sidebar-toggle-btn.sidebar-hidden {
  right: 0;
}

.fixed-preview {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px #b3cfff;
  padding: 12px;
}

.fixed-preview-img {
  max-width: 96%;
  border-radius: 13px;
  box-shadow: 0 4px 16px #b3cfff;
  margin: auto;
}

.fixed-preview-title {
  margin-top: 16px;
  font-size: 20px;
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
}

.fixed-preview-title-text {
  flex: 1;
  text-align: center;
  max-width: 100%;
}

.preview-nav-btn {
  background: linear-gradient(135deg, #0078d7, #005a9e);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 120, 215, 0.3);
  z-index: 10;
  position: absolute;
}

.preview-prev-btn {
  left: 0;
}

.preview-next-btn {
  right: 0;
}

.preview-nav-btn:hover {
  background: linear-gradient(135deg, #42a5f5, #0078d7);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 120, 215, 0.4);
}

.preview-nav-btn:active {
  transform: scale(0.95);
}

.preview-nav-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.preview-nav-btn:disabled:hover {
  background: #ccc;
  transform: none;
  box-shadow: none;
}

.fixed-preview-desc {
  margin-top: 12px;
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  text-align: justify;
  max-height: 120px;
  overflow-y: auto;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.chat-panel {
  margin-top: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px #e3eaff;
  padding: 18px 16px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  overflow: auto;
}

.chat-log {
  margin-top: auto;
  /* max-height: 30vh; */
  flex: 1;
  overflow-y: auto;
  /* min-height: 200px; */
  font-size: 16px;
  scrollbar-width: thin;
  scrollbar-color: #b3cfff #f0f4ff;
  padding: 8px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  background: #f8f9fa;
}

.chat-log::-webkit-scrollbar {
  width: 8px;
  background: #f0f4ff;
  border-radius: 6px;
}

.chat-log::-webkit-scrollbar-thumb {
  background: #b3cfff;
  border-radius: 6px;
}

.chat-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
}

.chat-nick-btn {
  min-width: fit-content;
  border-radius: 8px;
  background: #f0f4ff;
  color: #333;
  border: 1.5px solid #b3cfff;
  box-shadow: 0 2px 8px #e3eaff;
  width: 70%;
  transition: all 0.2s;
}

.chat-input[type="text"] {
  border-radius: 8px;
  border: 1.5px solid #b3cfff;
  padding: 10px 18px;
  width: 90%;
  box-shadow: 0 2px 8px #e3eaff;
  transition: all 0.2s;
}

/* 主内容区域样式 */
#main-content {
  flex: 1;
  position: relative;
  transition: margin 0.3s ease;
}

/* 当侧边栏隐藏时，主内容区域占满全屏 */
.right-bar.hidden~#main-content {
  margin: 10px;
  flex: 1;
  width: 100%;
}