/* ========================================
   标签栏样式 - Cursor/编辑器风格（紧凑、克制）
   ======================================== */

/* 标签栏容器 */
.tab-bar-container {
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  display: block !important;
  z-index: var(--z-tabstrip) !important;
  height: 36px;
  min-height: 36px;
  box-sizing: border-box;
  backdrop-filter: saturate(180%) blur(18px);
}

/* 标签列表 */
.tab-bar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 4px 8px 0 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.tab-bar::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* 滚动箭头 - 绝对定位 */
.scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: none;
  transition: all 0.2s;
}

.scroll-arrow:hover {
  background: var(--bg-hover);
}

.scroll-arrow.left {
  left: 8px;
}

.scroll-arrow.right {
  right: 8px;
}

.scroll-arrow.hidden {
  display: none;
}





/* 单个标签 */
.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  min-width: 120px;
  max-width: 240px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  user-select: none;
}

/* 激活状态 */
.tab.active {
  background: var(--bg-panel);
  border-color: rgba(28, 25, 23, 0.12);
  border-bottom-color: var(--bg-base);
  box-shadow: inset 0 -2px 0 0 rgba(75, 85, 99, 0.55), 0 1px 0 rgba(28, 25, 23, 0.04);
  z-index: 1;
}

/* 悬停效果 */
.tab:hover {
  background: var(--bg-hover);
}



.tab.active:hover {
  background: var(--bg-base);
}



/* 标签图标 */
.tab-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Word 图标：中性色（避免整栏「产品蓝」） */
.tab-icon.word-icon {
  stroke: #6b7280;
}

/* Excel图标 - 品牌绿色 */
.tab-icon.excel-icon {
  stroke: #006400;
}

/* 标签标题 */
.tab-title {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 关闭按钮 - 默认隐藏 */
.tab-close {
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.tab-close:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}





/* 悬停时显示关闭按钮 */
.tab:hover .tab-close {
  opacity: 1;
}

/* 激活标签始终显示关闭按钮 */
.tab.active .tab-close {
  opacity: 1;
}

/* Dirty标记 */
.tab.dirty::after {
  content: '●';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: #dc2626;
  border-radius: 50%;
}

/* 新建按钮 - 在标签列表内部 */
.tab-new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 20px;
  color: #6b7280;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin-left: 4px;
}

.tab-new-btn:hover {
  background: rgba(75, 85, 99, 0.1);
  color: #4b5563;
}





/* 刷新按钮 - 与工具栏一致的中性灰（避免高饱和黄） */
.tab-reload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: #6b7280;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin-left: 4px;
}

.tab-reload-btn:hover {
  background: rgba(75, 85, 99, 0.1);
  color: #4b5563;
}





/* 全部关闭按钮 - 紧挨新建按钮 */
.tab-close-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  color: #dc2626;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  margin-left: 2px;
}

.tab-close-all-btn:hover {
  background: rgba(255, 59, 48, 0.18);
  color: #dc2626;
}





/* 拖拽时的样式 */
.tab.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.tab.drag-over {
  border-left: 3px solid rgba(75, 85, 99, 0.45);
}
