/* ============================================
   llm-test.css - 大模型体验页样式
   1比1复刻火山引擎方舟体验页布局
   ============================================ */

/* 锁定页面，禁止滚动 */
html, body {
  overflow: hidden !important;
  height: 100vh !important;
}

/* ========== 体验页整体 ========== */
.llm-test-page {
  margin-top: 60px;
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  background: #f0f2f5;
  padding: 12px;
  overflow: hidden;
}

.llm-test-container {
  flex: 1;
  display: flex;
  width: 100%;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  position: relative;
}

/* ========== 左侧：模型竖向列表 ========== */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #f0f0f0;
}

.sidebar-header {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.btn-new-chat {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: #4f6ef7;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-new-chat:hover {
  background: #3d5bd9;
}

.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
}

.sidebar-list::-webkit-scrollbar {
  width: 4px;
}
.sidebar-list::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 2px;
}

/* 历史对话项 */
.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 4px;
}

.history-item:hover {
  background: #f0f2f5;
}

.history-item.active {
  background: #eef1fe;
}

.history-item-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.history-item-info {
  flex: 1;
  min-width: 0;
}

.history-item-title {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-item.active .history-item-title {
  color: #4f6ef7;
}

.history-item-time {
  font-size: 11px;
  color: #bbb;
  margin-top: 2px;
}

.history-empty {
  padding: 40px 20px;
  text-align: center;
  font-size: 13px;
  color: #ccc;
}

/* ========== 右侧：主区域 ========== */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* ========== 顶部：模型选择栏 ========== */
.test-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo {
  display: flex;
  align-items: center;
}

.header-logo .model-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

/* 模型下拉框 */
.model-dropdown {
  position: relative;
}

.model-current {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #f5f6f8;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.model-current:hover {
  background: #eef0f4;
}

.model-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.model-arrow {
  font-size: 10px;
  color: #999;
  transition: transform 0.2s;
}

.model-dropdown.open .model-arrow {
  transform: rotate(180deg);
}

/* 模型下拉列表 */
.model-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 320px;
  max-height: 360px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  z-index: 100;
  padding: 6px;
}

/* 模型分类标签 */
.model-category-label {
  font-size: 12px;
  font-weight: 600;
  color: #888;
  padding: 10px 12px 4px;
  border-top: 1px solid #f0f0f0;
  margin-top: 4px;
}
.model-category-label:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 6px;
}

.model-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 8px;
}

.model-option:hover {
  background: #f5f6f8;
}

.model-option.active {
  background: #eef1fe;
}

.model-option-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.model-option-info {
  flex: 1;
  min-width: 0;
}

.model-option-name {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-option-desc {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.model-option-check {
  color: #4f6ef7;
  font-size: 14px;
  flex-shrink: 0;
}

/* 顶部右侧 */
.test-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-clear {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #999;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear:hover {
  background: #f5f6f8;
  color: #333;
}

/* ========== 对话区域 ========== */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 滚动条样式 */
.chat-area::-webkit-scrollbar {
  width: 6px;
}
.chat-area::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 3px;
}
.chat-area::-webkit-scrollbar-track {
  background: transparent;
}

/* 空状态：欢迎信息 */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 40px;
}

.welcome-icon {
  font-size: 56px;
  margin-bottom: 20px;
}

.welcome-title {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin-bottom: 10px;
}

.welcome-desc {
  font-size: 14px;
  color: #999;
  margin-bottom: 32px;
}

.welcome-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 600px;
}

.suggestion-item {
  padding: 12px 20px;
  background: #f8f9fb;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  font-size: 13px;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  max-width: 280px;
}

.suggestion-item:hover {
  border-color: #4f6ef7;
  background: #f0f4ff;
  color: #4f6ef7;
}

/* ========== 消息气泡 ========== */
.message {
  display: flex;
  margin-bottom: 20px;
  animation: msgIn 0.3s ease;
  width: 100%;
  max-width: 860px;
}

/* AI消息：左侧 */
.message.assistant {
  align-self: center;
}

/* 用户消息：右侧 */
.message.user {
  align-self: center;
  flex-direction: row-reverse;
}

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

.message-content {
  min-width: 0;
  max-width: 100%;
}

.message-role {
  font-size: 12px;
  color: #999;
  margin-bottom: 4px;
}

.message.user .message-role {
  text-align: right;
}

.message-text {
  font-size: 14px;
  line-height: 1.8;
  word-break: break-word;
  padding: 12px 16px;
  border-radius: 16px;
}

/* AI消息气泡：左侧灰色 */
.message.assistant .message-text {
  color: #333;
  background: #f4f5f7;
  border-top-left-radius: 4px;
}

/* 用户消息气泡：右侧蓝色 */
.message.user .message-text {
  color: #fff;
  background: #4f6ef7;
  border-top-right-radius: 4px;
}

/* 代码块 */
.message-text pre {
  background: #1e1e2e;
  color: #e0e0e0;
  padding: 14px 16px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 10px 0;
  font-size: 13px;
  line-height: 1.6;
}

.message.user .message-text pre {
  background: rgba(0,0,0,0.15);
}

.message-text code {
  font-family: "Consolas", "Monaco", "Courier New", monospace;
}

.message-text p code {
  background: #f0f0f0;
  color: #c7254e;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
}

/* 加载动画 */
.typing-indicator {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4f6ef7;
  animation: typing 1.4s infinite;
}

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

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ========== 底部：输入区域 ========== */
.input-area {
  padding: 0 24px 16px;
  background: #fff;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.input-area .input-wrapper {
  width: 100%;
  max-width: 860px;
}

.input-wrapper {
  background: #f7f8fa;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  padding: 14px 18px;
  transition: all 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.input-wrapper:focus-within {
  border-color: #4f6ef7;
  background: #fff;
  box-shadow: 0 2px 8px rgba(79,110,247,0.12);
}

.input-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.tool-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #999;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.tool-btn:hover {
  background: #eef0f4;
  color: #555;
}

.input-textarea {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  min-height: 24px;
  max-height: 160px;
  font-family: inherit;
}

.input-textarea::placeholder {
  color: #bbb;
}

.input-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.input-params {
  display: flex;
  align-items: center;
  gap: 12px;
}

.param-item {
  font-size: 12px;
  color: #999;
  padding: 5px 12px;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.param-item:hover {
  color: #4f6ef7;
}

.btn-send {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: #4f6ef7;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-send:hover:not(:disabled) {
  background: #3d5bd9;
}

.btn-send:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.btn-send.loading {
  background: #ccc;
  cursor: not-allowed;
}

/* 额度提示 */
.quota-tip {
  text-align: center;
  font-size: 12px;
  color: #bbb;
  margin-top: 8px;
  max-width: 860px;
  width: 100%;
}

.quota-tip a {
  color: #4f6ef7;
  text-decoration: none;
}

.quota-tip a:hover {
  text-decoration: underline;
}

/* 移动端菜单按钮 - PC端隐藏 */
.btn-mobile-menu {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #555;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-mobile-menu:hover { background: #f5f6f8; }
.sidebar-overlay { display: none; }

@media (max-width: 768px) {
  html, body { overflow-x: hidden !important; overflow-y: auto !important; height: auto !important; }
  .llm-test-page { margin-top: 50px; height: auto; min-height: calc(100vh - 50px); padding: 0; overflow: visible; }
  .llm-test-container { border-radius: 0; box-shadow: none; min-height: calc(100vh - 50px); flex-direction: column; }
  .sidebar { position: fixed; top: 0; left: -280px; width: 280px; height: 100vh; z-index: 999; background: #fafbfc; border-right: 1px solid #e0e0e0; transition: left 0.3s ease; box-shadow: none; }
  .sidebar.open { left: 0; box-shadow: 4px 0 20px rgba(0,0,0,0.15); }
  .sidebar-overlay { display: block; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.4); z-index: 998; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
  .sidebar-overlay.show { opacity: 1; pointer-events: auto; }
  .sidebar-header { padding: 14px 16px; }
  .btn-new-chat { padding: 12px; font-size: 15px; border-radius: 12px; }
  .history-item { padding: 12px 14px; }
  .main-area { flex: 1; min-height: calc(100vh - 50px); }
  .test-header { padding: 10px 14px; border-bottom: 1px solid #f0f0f0; }
  .btn-mobile-menu { display: flex; }
  .header-left { gap: 10px; }
  .header-logo .model-logo { width: 28px; height: 28px; }
  .model-current { padding: 7px 12px; border-radius: 8px; max-width: 180px; }
  .model-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
  .model-list { min-width: 260px; max-width: calc(100vw - 28px); left: -60px; max-height: 50vh; border-radius: 10px; }
  .chat-area { flex: 1; padding: 14px; min-height: 200px; overflow-y: auto; }
  .chat-welcome { padding: 30px 16px; }
  .welcome-icon { font-size: 40px; margin-bottom: 14px; }
  .welcome-title { font-size: 18px; margin-bottom: 8px; }
  .welcome-desc { font-size: 13px; margin-bottom: 20px; }
  .welcome-suggestions { gap: 8px; }
  .suggestion-item { padding: 10px 14px; font-size: 12px; border-radius: 10px; max-width: 100%; flex: 1; min-width: 0; }
  .message { max-width: 100%; margin-bottom: 14px; }
  .message-text { font-size: 14px; line-height: 1.7; padding: 10px 14px; }
  .message-text pre { font-size: 12px; padding: 10px 12px; border-radius: 8px; }
  .input-area { padding: 0 10px 12px; position: sticky; bottom: 0; background: #fff; z-index: 10; box-shadow: 0 -1px 6px rgba(0,0,0,0.04); }
  .input-area .input-wrapper { max-width: 100%; }
  .input-wrapper { border-radius: 16px; padding: 10px 14px; }
  .input-toolbar { margin-bottom: 6px; flex-wrap: wrap; }
  .tool-btn { width: 30px; height: 30px; }
  .input-textarea { font-size: 15px; min-height: 22px; max-height: 120px; }
  .input-bottom { margin-top: 6px; }
  .param-item { font-size: 11px; padding: 4px 10px; }
  .btn-send { padding: 7px 16px; font-size: 13px; border-radius: 10px; }
  .quota-tip { font-size: 11px; margin-top: 6px; }
}
@media (max-width: 374px) {
  .model-current { max-width: 140px; }
  .model-name { max-width: 90px; }
  .welcome-suggestions { flex-direction: column; }
  .suggestion-item { max-width: 100%; }
}
