/* ==========================================================================
   Synapse UI Design System - Premium Dark Glassmorphism Theme
   ========================================================================== */

:root {
  /* 基础调色板 - HSL 柔和调和 */
  --bg-darker: hsl(230, 25%, 7%);
  --bg-dark: hsl(230, 20%, 10%);
  --bg-card: hsla(230, 20%, 15%, 0.45);
  --border-color: hsla(230, 20%, 25%, 0.4);
  --border-color-focus: hsla(260, 80%, 60%, 0.6);
  
  /* 核心文字色 */
  --text-main: hsl(210, 15%, 85%);
  --text-muted: hsl(210, 10%, 60%);
  --text-dark: hsl(230, 15%, 15%);
  
  /* 品牌与功能色 */
  --accent-purple: hsl(263, 85%, 65%);
  --accent-purple-glow: hsla(263, 85%, 65%, 0.35);
  --accent-cyan: hsl(190, 90%, 50%);
  --accent-green: hsl(145, 75%, 45%);
  --accent-orange: hsl(25, 85%, 55%);
  --accent-red: hsl(355, 75%, 55%);
  
  /* 其他辅助 */
  --sidebar-width: 260px;
  --header-height: 70px;
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glass-blur: blur(12px);
}

/* ==========================================================================
   基础重置 & 字体
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-darker);
  color: var(--text-main);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: var(--transition-smooth);
}
a:hover {
  text-decoration: underline;
  opacity: 0.9;
}

/* ==========================================================================
   全局滚动条样式
   ========================================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: hsla(230, 20%, 30%, 0.5);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: hsla(263, 85%, 65%, 0.5);
}

/* ==========================================================================
   布局结构
   ========================================================================== */
.app-container {
  display: flex;
  width: 100%;
  height: 100vh;
  position: relative;
  background-image: 
    radial-gradient(at 0% 0%, hsla(263, 40%, 15%, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, hsla(190, 40%, 15%, 0.1) 0px, transparent 50%);
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(13, 15, 23, 0.7);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  z-index: 10;
}

.sidebar-brand {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
}

.logo-wrapper {
  position: relative;
  width: 32px;
  height: 32px;
}

.synapse-logo {
  width: 100%;
  height: 100%;
}

.logo-node {
  fill: var(--text-muted);
  transition: var(--transition-smooth);
}

.logo-center {
  fill: var(--accent-purple);
  animation: pulse-node 3s infinite alternate;
}

.logo-edge {
  stroke: var(--border-color);
  stroke-width: 1.5px;
}

.logo-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 16px var(--accent-purple-glow);
  opacity: 0.6;
  animation: pulse-glow 3s infinite alternate;
}

.brand-text {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #fff 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.nav-item i {
  width: 18px;
  height: 18px;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, var(--accent-purple-glow) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-left: 3px solid var(--accent-purple);
  padding-left: 13px; /* 补偿边框宽度保持对齐 */
}

.nav-item.active i {
  color: var(--accent-purple);
  filter: drop-shadow(0 0 4px var(--accent-purple));
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

.agent-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.online {
  background-color: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}
.status-dot.offline {
  background-color: var(--accent-red);
}

/* 主显示区 */
.main-content {
  flex-grow: 1;
  height: 100%;
  overflow-y: auto;
  position: relative;
  padding: 40px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease;
  height: 100%;
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

.tab-header {
  margin-bottom: 32px;
}

.tab-header h1 {
  font-size: 28px;
  color: #fff;
  margin-bottom: 6px;
}

.tab-header .subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

/* ==========================================================================
   按钮组件 (Buttons)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-smooth);
  outline: none;
}

.btn-primary {
  background: var(--accent-purple);
  color: #fff;
}
.btn-primary:hover {
  background: hsl(263, 85%, 70%);
  box-shadow: 0 0 12px var(--accent-purple-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover, .btn-outline.active {
  border-color: var(--accent-purple);
  background: var(--accent-purple-glow);
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition-smooth);
}
.btn-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   通用表单元素 (Inputs, Textarea, Selects)
   ========================================================================== */
input[type="text"],
input[type="password"],
textarea,
.select-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition-smooth);
  outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus,
.select-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 8px var(--accent-purple-glow);
}

/* ==========================================================================
   TAB 1: 闪念收集箱
   ========================================================================== */
.memo-input-container {
  margin-bottom: 40px;
}

.textarea-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
}

.textarea-wrapper textarea {
  border: none;
  background: transparent;
  padding: 0;
  resize: vertical;
  min-height: 100px;
  font-size: 15px;
}
.textarea-wrapper textarea:focus {
  box-shadow: none;
}

.textarea-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.tip-text {
  font-size: 12px;
  color: var(--text-muted);
}

.memo-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  font-size: 18px;
  color: #fff;
}

.filter-actions {
  display: flex;
  gap: 8px;
}

.memo-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 闪念卡片 */
.memo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.memo-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--text-muted);
  transition: var(--transition-smooth);
}

.memo-card.unprocessed::before {
  background: var(--accent-orange);
}

.memo-card.processed::before {
  background: var(--accent-purple);
}

.memo-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

.memo-card-content {
  font-size: 14px;
  white-space: pre-wrap;
  color: var(--text-main);
}

.memo-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* 研读态微光效果 (Shimmer) */
.memo-card.processing {
  opacity: 0.75;
}
.memo-card.processing::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 20%,
    rgba(255, 255, 255, 0.1) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: shimmer 1.5s infinite;
}

.ai-summary-box {
  background: rgba(263, 85, 65, 0.05);
  border: 1px dashed var(--accent-purple);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary-title {
  color: var(--accent-purple);
  font-weight: 600;
}

.summary-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-badge {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.tag-badge.ai-tag {
  background: var(--accent-purple-glow);
  color: hsl(263, 90%, 80%);
}

.btn-convert-project {
  color: var(--accent-green);
  border-color: rgba(145, 75, 45, 0.3);
}
.btn-convert-project:hover {
  background: rgba(145, 75, 45, 0.15);
  border-color: var(--accent-green);
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}
.empty-state i {
  width: 48px;
  height: 48px;
  stroke-width: 1px;
  opacity: 0.5;
}

/* ==========================================================================
   TAB 2: 项目数据库
   ========================================================================== */
.project-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.search-box {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}
.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}
.search-box input {
  padding-left: 40px;
}

.filter-group {
  display: flex;
  gap: 12px;
}
.filter-group select {
  width: auto;
  min-width: 130px;
}

.project-list-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  overflow: hidden;
}

.project-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.project-table th, .project-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.project-table th {
  background: rgba(0, 0, 0, 0.15);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-table tbody tr {
  cursor: pointer;
  transition: var(--transition-smooth);
}
.project-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.project-cell-title {
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}
.project-cell-desc {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

/* 状态标签 */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}
.status-badge.brainstorming {
  background: rgba(190, 90, 50, 0.1);
  color: var(--accent-cyan);
}
.status-badge.incubating {
  background: rgba(25, 85, 55, 0.1);
  color: var(--accent-orange);
}
.status-badge.developing {
  background: rgba(145, 75, 45, 0.1);
  color: var(--accent-green);
}
.status-badge.archived {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

/* 兴奋度 */
.excitement-flames {
  letter-spacing: 2px;
}

/* ==========================================================================
   TAB 3: 全局大管家对话 (Chat Interface)
   ========================================================================== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 220px);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  overflow: hidden;
}

.chat-messages {
  flex-grow: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 500px;
  margin: auto;
  text-align: center;
  gap: 16px;
}

.welcome-icon {
  width: 60px;
  height: 60px;
  background: var(--accent-purple-glow);
  color: var(--accent-purple);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--accent-purple-glow);
}
.welcome-icon i {
  width: 32px;
  height: 32px;
}

.chat-welcome h3 {
  font-size: 20px;
  color: #fff;
}
.chat-welcome p {
  color: var(--text-muted);
  font-size: 13px;
}

.welcome-suggestions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

.suggestion-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  transition: var(--transition-smooth);
}
.suggestion-btn i {
  width: 16px;
  height: 16px;
  color: var(--accent-purple);
}
.suggestion-btn:hover {
  background: var(--accent-purple-glow);
  border-color: var(--accent-purple);
  color: #fff;
}

/* 对话气泡 (Message Bubbles) */
.message-bubble {
  display: flex;
  gap: 16px;
  max-width: 80%;
  animation: slideUp 0.3s ease;
}

.message-bubble.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-bubble.agent {
  align-self: flex-start;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.user .avatar {
  background: var(--text-muted);
  color: var(--bg-darker);
}
.agent .avatar {
  background: var(--accent-purple);
  color: #fff;
  box-shadow: 0 0 8px var(--accent-purple-glow);
}

.message-body {
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: break-word;
}
.user .message-body {
  background: var(--accent-purple);
  color: #fff;
  border-top-right-radius: 0;
}
.agent .message-body {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-top-left-radius: 0;
}

/* Markdown 排版微调 */
.message-body p {
  margin-bottom: 8px;
}
.message-body p:last-child {
  margin-bottom: 0;
}
.message-body ul, .message-body ol {
  margin-left: 20px;
  margin-bottom: 8px;
}
.message-body code {
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.message-body pre {
  margin: 10px 0;
  padding: 12px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 6px;
  border: 1px solid var(--border-color);
  overflow-x: auto;
}
.message-body pre code {
  padding: 0;
  border: none;
  background: transparent;
}

/* 输入框区域 */
.chat-input-area {
  display: flex;
  padding: 16px;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.2);
  gap: 12px;
}
.chat-input-area input {
  flex-grow: 1;
}

/* ==========================================================================
   TAB 4: 系统设置 (Settings)
   ========================================================================== */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.settings-card.col-span-2 {
  grid-column: span 2;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}
.card-header h2 {
  font-size: 18px;
  color: #fff;
}
.card-icon {
  width: 22px;
  height: 22px;
}
.text-accent {
  color: var(--accent-purple);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card-body .desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.input-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-password-wrapper input {
  padding-right: 48px;
}
.input-password-wrapper .btn-icon {
  position: absolute;
  right: 12px;
}

.actions-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.test-result {
  font-size: 13px;
  padding: 10px;
  border-radius: 6px;
  display: none;
}
.test-result.success {
  background: rgba(145, 75, 45, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(145, 75, 45, 0.3);
}
.test-result.error {
  background: rgba(355, 75, 55, 0.1);
  color: var(--accent-red);
  border: 1px solid rgba(355, 75, 55, 0.3);
}

/* Switch 开关组件 */
.switch-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 12px;
}
.switch-container input {
  display: none;
}
.slider {
  position: relative;
  width: 44px;
  height: 22px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  transition: .4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  border-radius: 50%;
  transition: .4s;
}
input:checked + .slider {
  background-color: var(--accent-purple);
  border-color: var(--accent-purple);
}
input:checked + .slider:before {
  transform: translateX(22px);
  background-color: #fff;
}

.sql-code-block {
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 8px;
  max-height: 250px;
  overflow-y: auto;
  color: #c5c9db;
  line-height: 1.6;
}

/* ==========================================================================
   右侧滑出抽屉 (Drawer)
   ========================================================================== */
.drawer-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 650px;
  background: hsl(230, 20%, 8%);
  border-left: 1px solid var(--border-color);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.drawer-overlay.open .drawer {
  transform: translateX(0);
}

.drawer-header {
  height: var(--header-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.drawer-header h2 {
  font-size: 18px;
  color: #fff;
}

.drawer-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.project-desc-text {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.15);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}

.drawer-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tag-badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-list {
  padding-left: 20px;
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.action-list li {
  color: var(--text-main);
}

.relations-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.relation-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.relation-item:hover {
  border-color: var(--accent-purple);
  background: rgba(263, 85, 65, 0.05);
}
.relation-title {
  color: #fff;
  font-weight: 600;
  margin-bottom: 2px;
}
.relation-reason {
  color: var(--text-muted);
  font-size: 11.5px;
}

.drawer-divider {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 10px 0;
}

/* 抽屉内部脑暴 */
.chat-section {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}
.mini-chat {
  flex-grow: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  height: 380px;
  padding: 12px;
  gap: 12px;
}
.mini-chat .message-bubble {
  max-width: 90%;
}
.mini-chat-input {
  padding: 8px 0 0 0;
  background: transparent;
  border: none;
}

/* ==========================================================================
   全局 Toast 提示系统
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.toast {
  background: rgba(13, 15, 23, 0.9);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: var(--glass-shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: #fff;
  animation: toastFadeIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  transition: opacity 0.3s;
}

.toast.success i {
  color: var(--accent-green);
}
.toast.info i {
  color: var(--accent-cyan);
}
.toast.error i {
  color: var(--accent-red);
}

/* ==========================================================================
   关键帧动画定义 (Keyframes)
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes toastFadeIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes pulse-node {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px var(--accent-purple)); }
  100% { transform: scale(1.15); filter: drop-shadow(0 0 8px var(--accent-purple)); }
}

@keyframes pulse-glow {
  0% { opacity: 0.3; transform: scale(0.9); }
  100% { opacity: 0.7; transform: scale(1.1); }
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* ==========================================================================
   自适应响应式设计 (Responsive)
   ========================================================================== */
@media (max-width: 1024px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .settings-card.col-span-2 {
    grid-column: span 1;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .sidebar-brand {
    justify-content: center;
  }
  
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 10px;
    justify-content: space-around;
  }
  
  .nav-item {
    padding: 8px 12px;
    font-size: 12px;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border-left: none !important;
    border-top: 3px solid transparent;
  }
  .nav-item.active {
    background: transparent;
    border-top: 3px solid var(--accent-purple);
  }
  
  .sidebar-footer {
    display: none;
  }
  
  .main-content {
    padding: 20px;
    height: calc(100vh - 120px);
  }
  
  .drawer {
    width: 100vw;
  }
  
  .project-toolbar {
    flex-direction: column;
  }
}

/* ==========================================================================
   全屏双栏控制 (Fullscreen Immersive panel)
   ========================================================================== */
.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.drawer-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* 抽屉全屏状态覆盖 */
.drawer.fullscreen {
  width: 100% !important;
  max-width: 100% !important;
}

.drawer.fullscreen .drawer-body {
  flex-direction: row;
  height: calc(100vh - var(--header-height));
  overflow-y: hidden;
  gap: 32px;
  padding: 32px;
}

.drawer.fullscreen .drawer-left {
  width: 40%;
  height: 100%;
  overflow-y: auto;
  padding-right: 24px;
  border-right: 1px solid var(--border-color);
}

.drawer.fullscreen .drawer-right {
  width: 60%;
  height: 100%;
}

.drawer.fullscreen .drawer-divider {
  display: none;
}

.drawer.fullscreen .mini-chat {
  height: 100% !important;
  flex-grow: 1;
}
