* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  background: #f0f2f5;
  color: #303133;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #c0c4cc;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #909399;
}

/* Login Page */
.login-page {
  height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: url('https://images.unsplash.com/photo-1579546929518-9e396f3cc809?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
  position: relative;
}
.login-page::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
}
.login-card {
  position: relative;
  width: 420px; padding: 40px;
  background: rgba(255, 255, 255, 0.95); 
  border-radius: 16px; 
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  backdrop-filter: blur(20px);
}
.login-title { text-align: center; font-size: 28px; font-weight: 700; margin-bottom: 8px; color: #111827; letter-spacing: -0.5px; }
.login-subtitle { text-align: center; color: #6b7280; font-size: 14px; margin-bottom: 30px; }

.layout { display: flex; height: 100vh; }
/* Sidebar */
.sidebar {
  width: 240px; background: #ffffff; color: #1f2937;
  display: flex; flex-direction: column;
  border-right: 1px solid #e5e7eb;
  box-shadow: 2px 0 8px 0 rgba(29,35,41,.05);
  z-index: 10;
}
.sidebar-brand {
  height: 64px; display: flex; align-items: center; padding: 0 24px; font-size: 18px; font-weight: 700;
  border-bottom: 1px solid #f3f4f6;
  color: #409EFF;
}
.sidebar-menu { flex: 1; padding: 16px 12px; }
.sidebar-item {
  padding: 12px 16px; cursor: pointer; display: flex; align-items: center; gap: 12px;
  color: #4b5563; font-size: 14px; font-weight: 500;
  border-radius: 8px; margin-bottom: 4px;
  transition: all 0.2s ease;
}
.sidebar-item:hover { background: #f3f4f6; color: #111827; }
.sidebar-item.active { background: #ecf5ff; color: #409EFF; font-weight: 600; }
.sidebar-footer { padding: 16px; border-top: 1px solid #f3f4f6; }
.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; background: #f9fafb; border-radius: 8px; margin-bottom: 12px;
}
.sidebar-user-avatar {
  width: 32px; height: 32px; background: #409EFF; color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 14px;
}
.sidebar-user-info { display: flex; flex-direction: column; overflow: hidden; }
.sidebar-user-info .name { color: #111827; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info .bot { color: #6b7280; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Main layout */
.main { flex: 1; overflow: auto; display: flex; flex-direction: column; background: #f3f4f6; }
.topbar {
  height: 64px; background: #fff; border-bottom: 1px solid #e5e7eb;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 10;
  flex-shrink: 0;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.topbar-title { font-size: 18px; font-weight: 600; color: #111827; }
.topbar-right { display: flex; align-items: center; gap: 16px; color: #4b5563; font-size: 14px; }
.content { padding: 24px; flex: 1; overflow-y: auto; }

/* Page wrappers */
.page-container {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  min-height: 100%;
}

.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.tag-id { font-family: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace; font-size: 13px; color: #606266; background: #f4f4f5; padding: 2px 6px; border-radius: 4px; }

/* Chat box */
.chat-wrapper { display: flex; gap: 20px; height: calc(100vh - 56px - 40px); }
.chat-box {
  flex: 1; background: #f9fafb; border-radius: 12px; padding: 20px;
  overflow-y: auto; border: 1px solid #e5e7eb; display: flex; flex-direction: column;
}
.chat-info {
  width: 320px; background: #fff; border-radius: 12px; padding: 24px;
  border: 1px solid #e5e7eb; overflow-y: auto;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.chat-info h3 { margin: 0 0 20px; font-size: 16px; color: #111827; border-bottom: 2px solid #409EFF; padding-bottom: 8px; display: inline-block; }
.chat-info .row { display: flex; justify-content: space-between; padding: 12px 0; font-size: 14px; border-bottom: 1px dashed #e5e7eb; }
.chat-info .row:last-child { border-bottom: none; }
.chat-info .row .label { color: #6b7280; }
.chat-info .row .value { color: #111827; font-weight: 500; word-break: break-all; text-align: right; max-width: 200px; }

.bubble-row { margin: 12px 0; display: flex; flex-direction: column; }
.bubble-row.right { align-items: flex-end; }
.bubble-row.left { align-items: flex-start; }
.bubble {
  max-width: 75%; padding: 12px 16px; border-radius: 16px;
  font-size: 14px; line-height: 1.5; word-break: break-word; white-space: pre-wrap;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.bubble-row.left .bubble { background: #fff; color: #1f2937; border-bottom-left-radius: 4px; border: 1px solid #e5e7eb; }
.bubble-row.right .bubble { background: #409EFF; color: #fff; border-bottom-right-radius: 4px; }
.bubble-meta { font-size: 12px; color: #9ca3af; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.bubble-row.right .bubble-meta { flex-direction: row-reverse; }

.empty-tip { text-align: center; color: #9ca3af; padding: 60px 0; font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* Element UI Overrides */
.el-table { border-radius: 8px; overflow: hidden; }
.el-table th.el-table__cell { background-color: #f9fafb !important; color: #374151; font-weight: 600; }
.el-button { border-radius: 6px; }
.el-input__wrapper { border-radius: 6px; }
.el-dialog { border-radius: 12px; }
.el-dialog__header { margin-right: 0; border-bottom: 1px solid #f3f4f6; padding-bottom: 16px; }
.el-dialog__footer { border-top: 1px solid #f3f4f6; padding-top: 16px; }

.pre-wrap-msg .el-message__content { white-space: pre-wrap; line-height: 1.6; }

.sidebar-actions { display: flex; gap: 8px; }
.sidebar-actions .el-button { margin-left: 0 !important; }

