:root {
  --primary-color: #4a90e2;
  /* 增加深色主色变量，用于渐变和交互状态 */
  --primary-dark: #357abd;
  --accent-color: #7b68ee;
  --accent-light: #9f88ff;
  --bg-color: #f5f7fa;
  /* 调整顶栏背景为渐变，增加视觉冲击力 */
  --topbar-bg: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(247, 250, 255, 0.92) 100%
  );
  --text-color: #333;
  --border-color: rgba(0, 0, 0, 0.08);
  --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* 顶栏样式 */
.top-bar {
  background: var(--topbar-bg);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  padding: 12px 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: auto;
  min-height: 72px;
  box-sizing: border-box;
  z-index: 1000;
  position: sticky;
  top: 0;
  backdrop-filter: blur(20px);
  position: relative;
  width: 100%;
  gap: 10px;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Logo区域 - 左侧对齐 */
.left-section {
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  justify-content: flex-start; /* 明确靠左对齐 */
  grid-column: 1; /* 放在第一列 */
  position: relative; /* 为下拉菜单定位 */
}

/* Logo区域样式 */
.logo-section {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  /* padding: 5px 10px; */
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

/* Logo shine effect - 默认不播放动画 */
.logo-section::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  opacity: 0; /* 默认隐藏 */
  transition: opacity 0.3s ease;
}

/* 只有在添加shine-active类时才播放闪光动画 */
.logo-section.shine-active::after {
  opacity: 1;
  animation: logoShine 1.5s ease-out forwards;
}

@keyframes logoShine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.logo {
  font-size: 1.3em;
  /* 增加更丰富的阴影和发光效果 */
  filter: drop-shadow(0 2px 4px rgba(74, 144, 226, 0.3));
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--accent-color) 100%
  );
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pulse 4s infinite alternate;
  position: relative;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
  }
}

.site-name {
  font-weight: 700;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  white-space: nowrap; /* 防止文字换行 */
}

/* 搜索区域 - 宽屏时居中浮动，窄屏时放在第二行 */
.center-section {
  display: flex;
  align-items: center;

  grid-column: 2; /* 放在第二列 */
  min-width: 320px; /* 允许flex子项缩小到小于内容宽度 */
}

/* 操作按钮区域 - 右栏最左 */
.right-section {
  display: flex;
  align-items: center;
  justify-content: flex-start; /* 靠左对齐 */
  grid-column: 3; /* 放在第三列 */
}

/* =================================
   主内容区域和面板样式
   ================================= */

/* 主内容区域 - 全屏展示mermaid */
.main-content {
  flex: 1;
  overflow: hidden; /* 改为hidden，避免双重滚动 */
  background: var(--bg-color);
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start; /* 改为flex-start，避免强制拉伸 */
  position: relative;
  height: calc(100dvh - 80px); /* 减去顶栏高度，确保有固定高度 */
}

/* =================================
   操作按钮样式 - 统一定义
   ================================= */

.action-btn {
  height: 44px;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--accent-color) 100%
  );
  color: white;
  border: none;
  border-radius: 12px; /* 恢复完整的圆角 */
  cursor: pointer;
  padding-bottom: 0.15em;
  font-size: 14px;
  font-weight: 600;
  min-width: 80px;
  max-width: 140px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
  position: relative;
  overflow: hidden;
  margin-left: 0; /* 移除左移效果 */
}

.action-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.action-btn:hover::before {
  left: 100%;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(74, 144, 226, 0.4);
  filter: brightness(1.1);
}

.action-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3);
}

/* 按钮禁用和加载状态样式 */
.action-btn:disabled,
.action-btn.loading {
  background: linear-gradient(135deg, #cbd5e0 0%, #a0aec0 100%);
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
  color: white;
  pointer-events: none;
}

.action-btn:disabled::before,
.action-btn.loading::before {
  display: none;
}

.action-btn.loading {
  position: relative;
  padding-left: 1em;
  padding-right: 3em; /* 为加载动画留出空间 */
  cursor: default; /* 覆盖not-allowed，因为loading状态不是禁用状态 */
}

.action-btn.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  right: 14px;
  margin-top: -9.5px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.action-btn.refresh-mode {
  background: linear-gradient(135deg, #28a745 0%, #218838 100%);
  box-shadow: 0 2px 6px rgba(40, 167, 69, 0.25);
}

.action-btn.refresh-mode:hover {
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.35);
}

/* 重新生成按钮样式 */
#regenerateBtn {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 7.3333333333px 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

#regenerateBtn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

#regenerateBtn:hover::before {
  left: 100%;
}

#regenerateBtn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

#regenerateBtn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* =================================
   错误消息样式 - 统一定义
   ================================= */

#errorMsg {
  color: #e74c3c;
  text-align: center;
  margin-top: 20px;
  padding: 12px;
  background: rgba(231, 76, 60, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(231, 76, 60, 0.2);
  font-size: 14px;
  display: none;
  animation: fadeIn 0.3s ease;
}

/* 单词详情卡片样式 */
#mermaidCard {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
  padding: 0;
  max-width: none;
  animation: fadeIn 0.5s ease;
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

#mermaidCard:last-child {
  margin-bottom: 0;
}

.meta-info {
  padding: 16px 24px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.95) 0%,
    rgba(139, 92, 246, 0.95) 100%
  );
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: white;
  margin: 0;
  font-weight: 500;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

/* 左侧信息区域 */
.info-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 右侧信息区域 */
.info-right {
  display: flex;
  align-items: center;
  gap: 10px;
  gap: 12px;
}

/* 主面板样式 */
.main-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

/* 备案号样式 */
.icp-info {
  display: flex;
  justify-content: center;
  padding: 3px;
  background-color: #f8f9fa;
  /* border-top: 1px solid #e1e5e9; */
  font-size: 11px;
  color: gray;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: auto; /* 确保备案栏始终在底部 */
}

.icp-text {
  white-space: nowrap;
}

/* 复制代码按钮样式 */
#mermaidSourceBadge {
  color: #eee7ee;
  text-align: right;
}

/* 编辑者信息样式 */
#mermaidEditorBadge {
  color: #eee7ee;
  text-align: right;
  font-size: 11px;
}

/* 来源信息容器样式 */
.source-info-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-right: 1em;
}

.copy-code-btn {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  height: 32px;
  box-sizing: border-box;
  line-height: 1;
  margin: 0;
  min-height: 32px;
  max-height: 32px;
}

.copy-code-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.copy-code-btn:hover::before {
  left: 100%;
}

.copy-code-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

.copy-code-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.copy-code-btn::after {
  content: "📋";
  margin-right: 2px;
  font-size: 12px;
}

/* Mermaid容器 - 水平布局 */
.mermaid-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 500px;
  overflow: hidden;
  background: white;
  flex: 1;
  position: relative;
}

/* 放大缩小控制按钮 */
.zoom-controls {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 10;
}

.zoom-control-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(4px);
}

.zoom-control-btn:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.zoom-control-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.zoom-control-btn svg {
  color: #4a5568;
  width: 18px;
  height: 18px;
}

.zoom-control-btn.exporting {
  background: #cbd5e0;
  cursor: wait;
  pointer-events: none;
}

.zoom-control-btn.exporting svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#mermaidContent {
  flex: 1;
  overflow: hidden;
  min-height: 0; /* 确保flex子元素可以正确收缩 */
}

/* Mermaid包装器 */
.mermaid-wrapper {
  flex: 1; /* 占据剩余空间 */
  min-height: 500px; /* 改为最小高度，允许内容扩展 */
  height: auto; /* 根据内容自适应高度 */
  overflow: hidden;
  position: relative;
  cursor: default;
}

.mermaid-wrapper:hover {
  cursor: default;
}

.mermaid-wrapper.grabbing {
  cursor: grabbing !important;
}

/* Mermaid图表样式 */
.mermaid {
  transform-origin: 0 0;
  transition: transform 0.1s ease;
  min-width: 100%;
  min-height: 100%;
  padding: 16px;
}

.node-selected.nodeLabel p {
  filter: drop-shadow(0 0 8px #4a90e2);
}

/* 连线选中样式 */
.edge-selected p {
  filter: drop-shadow(0 0 8px #ff9800);
}

/* 连线悬停效果 */
.edgeLabel .label:hover {
  cursor: pointer;
  opacity: 0.8;
}

/* 节点悬停效果 */
.node:hover,
.nodeLabel:hover {
  cursor: pointer;
  opacity: 0.9;
}

.node:hover rect,
.node:hover polygon {
  fill: #f0f8ff !important;
}

/* 防止节点文本被选择 */
.node,
.nodeLabel,
.node rect,
.node polygon,
.node text,
.edgeLabel,
.edgeLabel .label {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
.nodeLabel,
.node .label,
.node text,
.edgeLabel,
.edgeLabel .label,
.edgeLabel text,
.edgeLabel div {
  white-space: normal !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
}

.mermaid-interactive-wrapper {
  height: 100%;
  width: 100%;
}

/* 隐藏类 */
.hidden {
  display: none !important;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* 响应式设计 - 手机设备样式已合并到统一的媒体查询中 */

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 16px 14px 16px;
  background: linear-gradient(
    135deg,
    rgba(248, 250, 252, 0.9) 0%,
    rgba(241, 245, 249, 0.9) 100%
  );
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.sidebar-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: #1a202c;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.2px;
}

.sidebar-header h3::before {
  content: "💡";
  font-size: 1.3rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
  animation: glow 3s infinite alternate;
}

@keyframes glow {
  0% {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
  }
  100% {
    filter: drop-shadow(0 1px 3px rgba(255, 193, 7, 0.4));
  }
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #95a5a6;
  transition: color 0.2s ease;
  padding: 0;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: #e9ecef;
  color: #e74c3c;
}

.sidebar-content {
  padding: 28px 14px;
  flex: 1;
  overflow-y: auto;
  /* 添加滚动条美化 */
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.sidebar-content::-webkit-scrollbar {
  width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.3);
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
  background-color: rgba(148, 163, 184, 0.5);
}

.example-item {
  margin-bottom: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.6);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  font-size: 17px;
}
.example-item > .example-cn {
  margin-top: 0.3em;
  font-size: 1em;
}
.example-en + .example-cn {
  font-size: 0.9em;
  color: hsl(0, 0%, 30%);
}
.example-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(
    180deg,
    var(--primary-color) 0%,
    var(--accent-color) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.example-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  background: #ffffff;
  border-color: rgba(74, 144, 226, 0.3);
}

.example-item:hover::before {
  opacity: 1;
}

.example-item:last-child {
  margin-bottom: 0;
}

.sentence-en {
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 10px;
  line-height: 1.6;
  font-size: 1.05rem;
  letter-spacing: -0.1px;
  position: relative;
  padding-left: 16px;
}

.sentence-en::before {
  content: " ";
  position: absolute;
  left: 0;
  top: -2px;
  color: var(--primary-color);
  font-size: 1.2rem;
  font-weight: 700;
  opacity: 0.7;
}

.sentence-cn {
  color: #4a5568;
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 10px 16px;
  background: rgba(248, 250, 252, 0.7);
  border-radius: 8px;
  border-left: 3px solid var(--accent-color);
  position: relative;
  margin-top: 8px;
}

.sentence-cn::before {
  content: "" "";
  position: absolute;
  left: 8px;
  top: -2px;
  color: var(--accent-color);
  font-size: 1.2rem;
  font-weight: 700;
  opacity: 0.7;
}

/* 加载状态美化 */
#examplesLoading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: #64748b;
}

#examplesLoading p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.2px;
  opacity: 0.8;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 侧边栏动画效果 */
.sidebar.slide-in {
  transform: translateX(0);
  opacity: 1;
}

.sidebar.slide-out {
  transform: translateX(100%);
  opacity: 0;
}

/* 连线信息区域样式 */

.link-info h4 {
  margin: 0 0 10px 0;
  font-size: 16px;
  color: var(--primary-color);
  font-weight: 600;
}

.link-explanation {
  font-size: 16.5px;
  line-height: 1.5;
  color: var(--text-color);
  background-color: rgba(255, 255, 255, 0.5);
  padding: 6px 12px;
  border-left: 4px solid transparent;
}

.link-explanation.has-content {
  border-left: 4px solid var(--primary-color);
}

/* 审核通过弹窗样式 */
.approval-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: popupFadeIn 0.3s ease-out;
}

.approval-popup-content {
  background-color: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 80dvh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: popupFadeIn 0.3s ease-out;
}

.approval-popup-header {
  display: flex;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #eaeaea;
}

.approval-popup-icon {
  font-size: 24px;
  margin-right: 12px;
  color: #4caf50;
}

.approval-popup-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.approval-popup-message {
  padding: 16px 24px;
  color: #555;
  font-size: 16px;
  line-height: 1.5;
}

.approval-popup-close-btn {
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 24px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin: 0 24px 24px;
}

.approval-popup-close-btn:hover {
  background-color: #45a049;
}

/* 拒绝理由弹窗样式 */
.rejection-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.rejection-popup-content {
  background-color: white;
  border-radius: 12px;
  padding: 0;
  max-width: 600px;
  width: 90%;
  max-height: 80dvh;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  animation: popupFadeIn 0.3s ease-out;
}

.rejection-popup-header {
  display: flex;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #eaeaea;
}

.rejection-popup-icon {
  font-size: 24px;
  margin-right: 12px;
  color: #f44336;
}

.rejection-popup-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.rejection-popup-message {
  padding: 16px 24px;
  color: #555;
  font-size: 16px;
  line-height: 1.5;
}

.rejection-popup-reason {
  padding: 0 24px 16px;
}

.rejection-reason-content {
  background-color: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
  border-left: 4px solid #f44336;
}

/* 拒绝理由的Markdown样式 */
.rejection-reason-content h1,
.rejection-reason-content h2,
.rejection-reason-content h3,
.rejection-reason-content h4,
.rejection-reason-content h5,
.rejection-reason-content h6 {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  color: #f44336;
}

.rejection-reason-content h1 {
  font-size: 1.5em;
}
.rejection-reason-content h2 {
  font-size: 1.3em;
}
.rejection-reason-content h3 {
  font-size: 1.2em;
}
.rejection-reason-content h4 {
  font-size: 1.1em;
}

.rejection-reason-content p {
  margin: 0.5em 0;
  color: #555;
}

.rejection-reason-content ul,
.rejection-reason-content ol {
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.rejection-reason-content li {
  margin: 0.3em 0;
  color: #555;
}

.rejection-reason-content code {
  background-color: rgba(0, 0, 0, 0.1);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
}

.rejection-reason-content pre {
  background-color: rgba(0, 0, 0, 0.1);
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
  margin: 0.5em 0;
}

.rejection-reason-content pre code {
  background-color: transparent;
  padding: 0;
}

.rejection-reason-content blockquote {
  border-left: 3px solid #f44336;
  padding-left: 10px;
  margin: 0.5em 0;
  font-style: italic;
  color: #555;
}

.rejection-reason-content strong {
  font-weight: bold;
  color: #333;
}

.rejection-reason-content em {
  font-style: italic;
}

.rejection-reason-content a {
  color: #f44336;
  text-decoration: none;
}

.rejection-reason-content a:hover {
  text-decoration: underline;
}

.rejection-reason-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5em 0;
}

.rejection-reason-content th,
.rejection-reason-content td {
  border: 1px solid #ddd;
  padding: 5px 10px;
  text-align: left;
}

.rejection-reason-content th {
  background-color: rgba(0, 0, 0, 0.05);
  font-weight: bold;
}

.rejection-popup-close-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  background-color: #f44336;
  color: white;
  border: none;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.rejection-popup-close-btn:hover {
  background-color: #d32f2f;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Markdown 样式 */
.link-explanation h1,
.link-explanation h2,
.link-explanation h3,
.link-explanation h4,
.link-explanation h5,
.link-explanation h6 {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  color: var(--primary-color);
}

.link-explanation h1 {
  font-size: 1.5em;
}
.link-explanation h2 {
  font-size: 1.3em;
}
.link-explanation h3 {
  font-size: 1.2em;
}
.link-explanation h4 {
  font-size: 1.1em;
}

.link-explanation p {
  margin: 0.5em 0;
}

.link-explanation ul,
.link-explanation ol {
  padding-left: 1.5em;
  margin: 0.5em 0;
}

.link-explanation li {
  margin: 0.3em 0;
}

.link-explanation code {
  background-color: rgba(0, 0, 0, 0.1);
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
}

.link-explanation pre {
  background-color: rgba(0, 0, 0, 0.1);
  padding: 10px;
  border-radius: 5px;
  overflow-x: auto;
  margin: 0.5em 0;
}

.link-explanation pre code {
  background-color: transparent;
  padding: 0;
}

.link-explanation blockquote {
  border-left: 3px solid var(--primary-color);
  padding-left: 10px;
  margin: 0.5em 0;
  font-style: italic;
  color: #555;
}

.link-explanation strong {
  font-weight: bold;
}

.link-explanation em {
  font-style: italic;
}

.link-explanation a {
  color: var(--primary-color);
  text-decoration: none;
}

.link-explanation a:hover {
  text-decoration: underline;
}

.link-explanation table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.5em 0;
}

.link-explanation th,
.link-explanation td {
  border: 1px solid var(--border-color);
  padding: 5px 10px;
  text-align: left;
}

.link-explanation th {
  background-color: rgba(0, 0, 0, 0.05);
  font-weight: bold;
}

/* 响应式设计 - 手机设备上的侧边栏样式已合并到统一的媒体查询中 */

/* =================================
   反馈按钮样式 - 统一定义
   ================================= */

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-code-btn,
.feedback-btn {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 6.666666666px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease,
    border-color 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  will-change: auto; /* 防止GPU层问题 */
  overflow: hidden; /* 防止光影动效超出按钮范围 */
  height: 36px;
}
.edit-code-btn {
  font-size: 11px;
  padding: 6.666666666px 15px;
}
.edit-code-btn:hover,
.feedback-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

/* =================================
   反馈输入框样式
   ================================= */

.feedback-input-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: fadeIn 0.3s ease;
}

.feedback-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  padding: 8px 12px;
  color: white;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.feedback-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.feedback-input:focus {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}

.feedback-count {
  font-size: 12px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
}

/* 反馈按钮状态样式 */
.feedback-btn.active {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 5px rgba(255, 255, 255, 0.4),
    0 0 10px rgba(255, 255, 255, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.5s ease;
}

/* 搜索输入框样式 - 重写 */
.search-input-container {
  display: flex;
  position: relative;
  flex: 1;
  min-width: 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: visible;
}

/* 最近单词下拉菜单样式 */
.recent-words-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 0 0 12px 12px;
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid #e1e5e9;
  animation: fadeIn 0.2s ease-out;
}

.recent-words-dropdown.hidden {
  display: none;
}

.recent-words-header {
  padding: 6px 16px 0 16px;
  font-size: 12px;
  color: #aaa;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.recent-words-list {
  max-height: 300px;
  overflow-y: auto;
}

.recent-word-item {
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f1f3f4;
  font-size: 16px;
  color: #495057;
}

.recent-word-item:last-child {
  border-bottom: none;
}

.recent-word-item:hover {
  background-color: #f8f9fa;
}

.recent-words-loading,
.no-recent-words,
.recent-words-error {
  padding: 16px;
  text-align: center;
  color: #6c757d;
  font-size: 14px;
}

.recent-words-error {
  color: #dc3545;
}

.search-input-container::before {
  content: "";
  position: absolute;
  bottom: 0px;
  left: 0px;
  right: 0px;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--primary-color) 0%,
    var(--accent-color) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.search-input-container:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  border-radius: 12px 12px 0 0; /* 恢复完整的圆角 */
}

.search-input-container:hover::before {
  opacity: 1;
}

input[type="text"] {
  flex: 1;
  padding: 0 16px 0 16px;
  height: 44px; /* 统一高度 */
  border: none;
  font-size: 18px;
  transition: all 0.2s ease;
  background: transparent;
  color: #2c3e50;
  font-weight: 500;
  padding-right: 45px; /* 为发音按钮留出空间 */
}

input[type="text"]:focus {
  outline: none;
  box-shadow: none;
}

input[type="text"]::placeholder {
  color: #a0aec0;
  font-weight: 400;
  font-size: 14px;
}

/* 发音按钮样式 */
.pronunciation-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: hsla(216, 15%, 52%, 0.6);
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  overflow: hidden;
}

.pronunciation-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(74, 144, 226, 0.15);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease;
  display: none;
}

.pronunciation-btn:hover {
  color: var(--primary-color);
  background-color: transparent;
}

.pronunciation-btn:hover::before {
  display: none;
  width: 0;
  height: 0;
}

.pronunciation-btn:active {
  transform: translateY(-50%) scale(0.95);
  background-color: transparent;
}

.pronunciation-btn .pronunciation-icon {
  width: 18px;
  height: 18px;
  position: relative;
  z-index: 1;
  transition: transform 0.2s ease;
}

.pronunciation-btn:hover .pronunciation-icon {
  transform: scale(1.05);
}

/* 播放动画效果 */
.pronunciation-btn.playing .pronunciation-icon {
  animation: soundWave 1.2s ease-in-out infinite;
}

@keyframes soundWave {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.pronunciation-btn.playing::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  border: 0 solid var(--primary-color);
  transform: translate(-50%, -50%);
  animation: none;
}

@keyframes ripple {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0;
  }
}

@keyframes pulse {
  0% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.7;
  }
}

.action-btn.refresh-mode:active {
  box-shadow: 0 2px 4px rgba(40, 167, 69, 0.25);
}

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

/* Logo 闪烁动画 - 首次查词成功触发 */
@keyframes logo-blink {
  0% {
    position: relative;
  }
  50% {
    position: relative;
  }
  100% {
    position: relative;
  }
}

.logo-full.blink-active::before,
.logo-icon.blink-active::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: light-sweep 0.8s ease-in-out;
  z-index: 1;
}

@keyframes light-sweep {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* 例句侧边栏样式 */
.sidebar {
  width: 420px;
  background: #ffffff;
  border-left: 1px solid #e1e5e9;
  padding: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.05);
  z-index: 50; /* 降低z-index，确保不会遮住meta-info */
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 64px;
  height: calc(100% - 68px);
  border-radius: 12px 12px 0 0;
}

.sidebar.hidden {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

/* 侧边栏动画效果 */
.sidebar.slide-in {
  transform: translateX(0);
  opacity: 1;
}

.sidebar.slide-out {
  transform: translateX(100%);
  opacity: 0;
}

/* 响应式设计 - 移动设备上的侧边栏样式已合并到统一的媒体查询中 */

/* 确保侧边栏内容区域能够占满可用空间 */
.sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

/* Mermaid编辑器样式 */
.mermaid-editor {
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.editor-source-info {
  padding: 10px 20px 0;
  display: flex;
  justify-content: flex-end;
}

.editor-source-info .info-right {
  display: flex;
  align-items: center;
}

.editor-body {
  height: calc(100% - 40px);
}

.mermaid-editor h3 {
  margin: 20px 20px 10px;
  font-size: 16px;
  color: #2c3e50;
  font-weight: 600;
}

.mermaid-code-textarea {
  width: 100%;
  height: 100%;
  min-height: 200px;
  padding: 12px;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  background-color: #f8f9fa;
  color: #333;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box; /* 确保padding不会增加总高度 */
}

.mermaid-code-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
  background-color: #fff;
}

.editor-actions {
  display: flex;
  justify-content: space-around; /* 弹性分布，两端对齐 */
  padding: 10px 30px; /* 左右增加内边距，留出间距 */
  background: var(--topbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--glass-shadow);
}
.popup-close-btn {
  margin: auto;
}

.popup-close-btn,
.dialog-actions button,
.form-actions button,
.editor-actions button {
  min-width: 80px; /* 固定宽度，使按钮更短 */
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-color);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.popup-close-btn:hover,
.dialog-actions button:hover,
.form-actions button:hover,
.editor-actions button:hover {
  background-color: hsl(210, 16%, 97%);
}
.editor-actions button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* 隐藏SVG图标 */
.editor-actions button svg {
  display: none;
}

/* 为不同按钮添加特定样式和位置 */

.editor-actions .reset-code-btn {
  border-color: #6c757d;
}

.dialog-actions .submit-btn,
.form-actions .submit-btn,
.editor-actions .submit-code-btn {
  border-color: #17a2b8;
}

.editor-actions button:disabled {
  background: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  filter: none;
  opacity: 0.6;
}

.editor-actions button:disabled::before {
  display: none;
}

.editor-actions button:disabled svg {
  fill: rgba(0, 0, 0, 0.4);
  stroke: rgba(0, 0, 0, 0.4);
}

/* 反馈对话框样式 */
.feedback-dialog {
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
}

.dialog-description {
  margin-bottom: 20px;
}

.dialog-description p {
  margin: 0;
  font-size: 14px;
  color: #6c757d;
  line-height: 1.5;
}

.feedback-dialog .form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #495057;
  font-size: 14px;
}

.feedback-reason-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 14px;
  background-color: #fff;
  color: #495057;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.feedback-reason-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.feedback-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 6px;
  font-size: 16px;
  line-height: 1.5;
  color: #495057;
  background-color: #f8f9fa;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  resize: vertical;
  min-height: 100px;
  height: 100%;
  flex: 100;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.feedback-textarea::placeholder {
  color: #a0aec0;
}

.dialog-actions {
  display: flex;
  flex-basis: fit-content;
  flex-grow: 1;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.cancel-btn {
  width: 80px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid hsla(208, 7%, 46%, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #6c757d;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  padding: 0;
}

/* 模态框样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  width: 90%;
  max-width: 500px;
  max-height: 80dvh;
  overflow: hidden;
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 成功和错误弹窗通用样式 */
.success-popup,
.error-popup,
.confirm-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.popup-content {
  background-color: white;
  border-radius: 8px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s ease;
}

.popup-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.popup-message {
  font-size: 16px;
  color: #333;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* 成功弹窗特定样式 */
.success-popup .popup-icon {
  color: #4caf50;
}

.success-popup .popup-close-btn {
  border-color: #4caf50;
  color: #4caf50;
}

/* 错误弹窗特定样式 */
.error-popup .popup-icon {
  color: #f44336;
}

.error-popup .popup-close-btn {
  border-color: #f44336;
  color: #f44336;
}

/* 错误气泡样式 */
.error-bubble {
  position: fixed;
  right: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  color: #2c3e50;
  padding: 18px 24px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
  z-index: 10001;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 360px;
  animation: bubbleSlideInRight 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(255, 255, 255, 0.8);
  margin-bottom: 12px;
  backdrop-filter: blur(10px);
  transform-origin: right center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.error-bubble:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 6px 12px rgba(0, 0, 0, 0.1);
}
.error-bubble-message {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  flex-grow: 1;
  letter-spacing: 0.2px;
}

.error-bubble-icon {
  font-size: 20px;
  flex-shrink: 0;
  color: #6c757d;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: iconFadeIn 0.3s ease-out;
}

.error-bubble-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #6c757d;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  flex-shrink: 0;
  margin-left: 8px;
}

.error-bubble-close:hover {
  color: #333;
}

@keyframes iconFadeIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.error-bubble.fade-out {
  animation: bubbleFadeOut 0.4s ease-out forwards;
}

@keyframes bubbleSlideInRight {
  0% {
    opacity: 0;
    transform: translateX(100px) scale(0.8);
  }
  50% {
    opacity: 0.8;
    transform: translateX(-10px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes bubbleFadeOut {
  0% {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.8) translateX(50px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-3px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(3px);
  }
}

/* 确认弹窗特定样式 */
.confirm-popup .popup-icon {
  color: #ff9800;
}

.confirm-popup .popup-close-btn {
  border-color: #ff9800;
  color: #ff9800;
}

.popup-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.popup-cancel-btn {
  color: #6c757d;
  border: 1px solid #ced4da;
  background-color: #f8f9fa;
  border-radius: 4px;
  padding: 10px 24px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.popup-cancel-btn:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
}

.popup-confirm-btn {
  color: white;
  border: none;
  border-radius: 4px;
  padding: 10px 24px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.popup-confirm-btn:hover {
  opacity: 0.9;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6c757d;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.close-modal-btn:hover {
  background-color: #f1f3f5;
}

.modal-body {
  padding: 24px;
  max-height: calc(80dvh - 80px);
  overflow-y: auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #34495e;
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  background-color: #f8f9fa;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

.cancel-btn {
  padding: 10px 20px;
  border: 1px solid #e0e0e0;
  background-color: #fff;
  color: #666;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.cancel-btn:hover {
  background-color: hsl(210, 16%, 97%);
  color: #333;
  border-color: #d0d0d0;
}
/* Logo 闪烁动画 - 首次查词成功触发 */
@keyframes logo-blink {
  0% {
    position: relative;
  }
  50% {
    position: relative;
  }
  100% {
    position: relative;
  }
}

.logo-full.blink-active::before,
.logo-icon.blink-active::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: light-sweep 0.8s ease-in-out;
  z-index: 1;
}

@keyframes light-sweep {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}
/* 手机端特殊样式 */
@media (max-width: 768px) {
  /* 复制按钮只显示图标 */
  .copy-code-btn {
    width: 32px;
    padding: 0;
    justify-content: center;
  }
  .icp-info {
    display: none;
  }
  .copy-code-btn::after {
    margin-right: 0;
  }

  /* 隐藏复制按钮的文本 */
  .copy-code-btn .copy-text {
    display: none;
  }

  .mermaid-container {
    height: calc(100dvh - 180px); /* 减去meta-info的高度和其他元素的高度 */
    min-height: auto;
  }

  #mermaidCard {
    position: relative;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: calc(100% - 60px) !important;
  }

  .sidebar-header {
    padding: 13px 12px 8px 12px;
  }
  .editor-actions {
    padding: 10px 15px;
  }
  .sidebar-header h3 {
    font-size: 1.1em;
  }
  .example-item {
    font-size: 16px;
  }
  .link-explanation {
    font-size: 15.5px;
  }
  /* 顶部导航栏样式 */
  .top-bar {
    display: flex;
    flex-direction: row; /* 保持水平排列 */
    align-items: center; /* 垂直居中 */
    justify-content: space-between; /* 两端对齐 */
    height: auto;
    padding: 8px 12px; /* 减少内边距 */
    position: relative; /* 改为相对定位 */
  }

  .site-name {
    display: none; /* 在手机端隐藏站点名称 */
  }

  /* 搜索控件样式 */
  .search-controls {
    flex-direction: column;
    gap: 10px;
  }

  .search-controls-row {
    flex-direction: row;
    width: 100%;
    gap: 10px;
  }

  /* 单词信息样式 */
  .word-info h4 {
    font-size: 1rem;
  }
  .feedback-count {
    display: none;
  }
  .source-info-container {
    margin-right: 0;
  }
  .edit-code-btn,
  .feedback-btn {
    height: 30px;
  }
  .edit-code-btn {
    padding: 6.666666666px 12px;
  }
  #mermaidSourceBadge {
    font-size: 11px;
  }
  .meta-info {
    padding: 14px 10px;
  }
  input[type="text"] {
    font-size: 17px;
    height: 37px;
  }
  .left-section {
    grid-column: 1; /* 在小屏幕上占据第一行 */
    justify-content: center; /* 在小屏幕上居中 */
  }

  /* 在手机端使用没有网站标题的图标 */
  .logo-full {
    display: none !important;
  }
  .logo-icon {
    display: block !important;
    zoom: 0.75;
  }

  .center-section {
    grid-column: 1; /* 在小屏幕上占据第二行 */
    width: 100%;
    min-width: 0;
  }

  .search-input-container {
    width: 100%;
  }

  .action-btn {
    width: 100%;
    border-radius: 12px;
    min-width: 70px;
    margin-left: 0;
    height: 37px;
    padding-inline-start: 0px;
    padding-inline-end: 0px;
  }

  .main-content {
    height: calc(100dvh - 200px);
  }
  .pronunciation-btn {
    right: 4px;
  }
  /* 修复手机端标签显示问题，允许长文本换行 */
  .form-group label {
    white-space: normal !important;
    height: auto !important;
    line-height: 1.5 !important;
    display: block !important;
    overflow: visible !important;
  }

  .node::after,
  .nodeLabel::after,
  .edgeLabel::after,
  .edgeLabel .label::after {
    content: "";
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    z-index: 1;
  }

  /* 确保触摸事件正确传递 */
  .node,
  .nodeLabel,
  .edgeLabel,
  .edgeLabel .label {
    touch-action: manipulation;
  }

  .sidebar-content {
    padding: 18px 10px;
  }
}
