@charset "UTF-8";

/* tomwebapp.css - Core styles for TomApp Web Interface */

:root {
  --bg-app: #121212;
  --bg-panel: #1e1e1e;
  --text-primary: #e6e6e6;
  --text-secondary: #a0a0a0;
  --border-color: #333;
  --accent-color: #00e5ff;
  --accent-hover: #00b8cc;
  --danger-color: #ff4d4f;
  --success-color: #52c41a;
  --warning-color: #faad14;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  height: calc(var(--vh, 1vh) * 100);
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  -webkit-text-size-adjust: 100%;
}

/* 顶部导航栏 */
.navbar {
  height: 50px;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 20px;
  justify-content: center;
  position: relative;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.nav-tabs {
  display: flex;
  gap: 5px;
  height: 100%;
}

/* 移动端和平板响应式设计 */
@media (max-width: 1024px) {
  .navbar {
    padding: 0 10px;
    height: auto;
    min-height: 50px;
    flex-wrap: wrap;
  }
  
  .nav-tabs {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: 3px;
  }
  
  .nav-left-controls,
  .nav-right-controls {
    position: static;
    order: -1;
    width: 100%;
    justify-content: space-between;
    padding: 5px 0;
  }
}

.tab-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 15px;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  transition: all 0.3s ease;
  font-weight: 500;
  opacity: 0.8;
}

/* 移动端标签链接优化 */
@media (max-width: 1024px) {
  .tab-link {
    padding: 8px 12px;
    font-size: 14px;
    height: auto;
    min-height: 40px;
  }
}

@media (max-width: 768px) {
  .tab-link {
    padding: 6px 10px;
    font-size: 13px;
    gap: 6px;
  }
  
  .tab-link .icon-emoji {
    font-size: 16px;
  }
}

.tab-link:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
  opacity: 1;
}

/* 只对图标进行动画 */
.tab-link .icon-emoji {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(0.85);
  /* [修改] 未选中时图标较小 */
}

/* [修改] 选中状态：图标放大2倍，向左4px，向上5px */
.tab-link.active .icon-emoji {
  transform: scale(2) translateX(-4px) translateY(-5px) !important;
}

/* [修改] 悬停时：图标放大2倍，向左4px，向上5px */
.tab-link:hover:not(.active) .icon-emoji {
  transform: scale(2) translateX(-4px) translateY(-5px);
}

/* [这里是修改后的代码] */
.tab-link.active {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.8),
    0 0 20px rgba(0, 229, 255, 0.4);
  opacity: 1;
  background: transparent !important;
}

/* 底部光线：中间亮两边淡 (保持不变) */
.tab-link.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: radial-gradient(circle, #00e5ff 0%, transparent 100%);
  box-shadow: 0 -1px 5px #00e5ff;
}

/* [新增] 左侧登录按钮区域 */
.nav-left-controls {
  position: absolute;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
}

/* [新增] 右侧登录/注册按钮区域 */
.nav-right-controls {
  position: absolute;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
}

/* 移动端控制区域优化 */
@media (max-width: 1024px) {
  .nav-left-controls,
  .nav-right-controls {
    position: static;
    height: auto;
  }
}

@media (max-width: 768px) {
  .nav-left-controls,
  .nav-right-controls {
    gap: 8px;
  }
  
  .auth-button {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  
  .username-right {
    font-size: 14px;
  }
}

.username-clickable {
}

.auth-button {
  width: 40px;
  height: 40px;
  padding: 0;
  background-color: #409eff;
  color: white;
  border: none;
  border-radius: 50%;
  font-weight: bold;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s, transform 0.2s;
}

.auth-button:hover {
  background-color: #66b1ff;
  transform: scale(1.05);
}

.username-right {
  color: #e6e6e6;
  font-weight: bold;
  font-size: 15px;
}

.username-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #2c2c2c;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 180px;
  z-index: 1000;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.username-dropdown-menu:not(.hidden) {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.username-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 14px;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--border-color);
}

.username-dropdown-item:last-child {
  border-bottom: none;
}

.username-dropdown-item:hover {
  background: var(--bg-input);
}

.username-dropdown-item .dropdown-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* 账户信息弹窗 */
.profile-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.profile-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.profile-modal-content {
  background: var(--bg-panel);
  width: 400px;
  max-width: 90%;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-color);
  padding: 24px;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.profile-modal.visible .profile-modal-content {
  transform: translateY(0);
}

.profile-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.profile-modal-header h4 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}

.profile-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  padding: 0;
  line-height: 1;
}

.profile-modal-close:hover {
  color: var(--text-primary);
}

.profile-modal .modal-footer {
  justify-content: space-between;
  gap: 12px;
}

.profile-modal .modal-footer .btn {
  flex: 1 1 0;
  min-height: 44px;
}

.profile-modal #profile-save.btn-primary {
  background: var(--accent-color);
  color: #ffffff;
}

.profile-modal #profile-save.btn-primary:hover {
  background: var(--accent-hover, var(--accent-color));
  opacity: 1;
  transform: none;
}

.username-clickable:hover,
.username-clickable:hover * {
}

.profile-form-group {
  margin-bottom: 16px;
}

.profile-form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.profile-form-group input {
  width: 100%;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 14px;
  box-sizing: border-box;
}

.profile-form-group input:focus {
  outline: none;
  border-color: var(--accent-color);
}

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

.secondary-button {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secondary-button:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.secondary-button:disabled,
.secondary-button[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

.secondary-button:disabled:hover,
.secondary-button[disabled]:hover {
  border-color: var(--border-color);
  color: var(--text-secondary);
}

#btn-new-chat-global.new-chat-button,
.secondary-button#btn-new-chat-global {
  background-color: transparent !important;
  border: 3px solid var(--warning-color, #e6a23c) !important;
  color: var(--warning-color, #e6a23c) !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

#btn-new-chat-global.new-chat-button:hover,
.secondary-button#btn-new-chat-global:hover {
  background-color: rgba(230, 162, 60, 0.14) !important;
  border-color: #f0b45e !important;
  color: #f0b45e !important;
  box-shadow: none !important;
  filter: none !important;
  transform: none !important;
}

#btn-new-chat-global.new-chat-button:active,
.secondary-button#btn-new-chat-global:active {
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
}

.primary-button {
  background: var(--accent-color);
  border: none;
  color: #000;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.2s;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-button:hover {
  background: var(--accent-hover);
}

.api-config-panel .primary-button,
.api-config-panel .secondary-button,
.api-config-panel .warning-button,
.api-config-panel .danger-button {
  background: #3b82f6;
  border: 1px solid #3b82f6;
  color: #fff;
  height: 26px;
  padding: 0 14px;
  border-radius: 6px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.api-config-panel .primary-button:hover,
.api-config-panel .secondary-button:hover,
.api-config-panel .warning-button:hover,
.api-config-panel .danger-button:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.api-config-panel .api-models-header-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.api-config-panel .api-models-header-row>label {
  width: 100%;
  text-align: center;
}

.api-config-panel .api-models-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.api-config-panel .api-models-tools .api-input {
  flex: 1 1 100%;
  max-width: 520px;
}

.api-config-panel .api-models-tools .secondary-button {
  flex: 0 0 auto;
}

/* 通知条样式 */
.notification-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #f59e0b;
  color: #000;
  padding: 6px 20px;
  z-index: 2000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  font-weight: 500;
}

.notification-bar #notification-message {
  flex: 1;
  text-align: center;
  font-size: 16px;
}

.notification-close-btn {
  background: #c2410c;
  border: none;
  color: #fff;
  font-size: 14px;
  width: 26px;
  height: 26px;
  padding: 0;
  line-height: 1.1;
  opacity: 1;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-close-btn:hover {
  background: #ea580c;
}

.notification-bar.notice-type-promo {
  background-color: #3b82f6;
  color: #fff;
}

.notification-bar.notice-type-member {
  background-color: #065f46;
  color: #fff;
}

.notice-item.notice-type-festival {
  border-left: 3px solid #f59e0b;
}

.notice-item.notice-type-promo {
  border-left: 3px solid #3b82f6;
}

.notice-item.notice-type-member {
  border-left: 3px solid #065f46;
}

.notice-item.notice-type-festival .notice-dot {
  background-color: #f59e0b;
}

.notice-item.notice-type-promo .notice-dot {
  background-color: #3b82f6;
}

.notice-item.notice-type-member .notice-dot {
  background-color: #065f46;
}

.notice-item.read .notice-dot {
  opacity: 0.35;
}

.notice-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notice-latest {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
}

.notice-latest-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notice-latest-inner.notice-type-festival {
  border-left: 3px solid #f59e0b;
  padding-left: 10px;
}

.notice-latest-inner.notice-type-promo {
  border-left: 3px solid #3b82f6;
  padding-left: 10px;
}

.notice-latest-inner.notice-type-member {
  border-left: 3px solid #065f46;
  padding-left: 10px;
}

.notice-latest-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.notice-latest-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-latest-meta {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.notice-latest-content {
  font-size: 14px;
  color: var(--text-primary);
  opacity: 0.95;
  word-break: break-word;
  line-height: 1.5;
}

.notice-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.notice-filters,
.notice-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.notice-list {
  min-height: 1680px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
}

.notice-item {
  display: flex;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  align-items: flex-start;
}

.notice-select {
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
  flex: 0 0 auto;
}

.notice-select-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-color);
  cursor: pointer;
}

.notice-item.selected {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

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

.notice-item-body {
  flex: 1;
  min-width: 0;
}

.notice-item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.notice-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.notice-item-content {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-primary);
  word-break: break-word;
  opacity: 0.95;
}

.notice-item-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notice-item-status {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  padding-top: 2px;
}

.notice-item.unread .notice-item-title {
  color: #fff;
}

.notice-pagination {
  display: flex;
  justify-content: center;
}

.notice-pagination-inner {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.notice-page-numbers {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.notice-page-btn.active {
  border-color: var(--accent-color);
  color: var(--text-primary);
}

.notice-page-info {
  font-size: 12px;
  color: var(--text-secondary);
  padding-left: 4px;
}

/* 版本切换下拉菜单 */
.version-selector {
  position: relative;
  display: flex;
  align-items: center;
}

.version-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all 0.2s ease;
}

.version-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.version-arrow {
  font-size: 12px;
  opacity: 0.6;
  transition: transform 0.2s;
}

.version-selector.active .version-arrow {
  transform: rotate(180deg);
}

.version-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: #252525;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.version-selector.active .version-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.version-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background-color 0.2s, border-color 0.2s;
  border: 1px solid transparent;
}

.version-option:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: #4a4a4a;
}

.version-option.active {
  border-color: var(--accent-color);
  background: rgba(255, 255, 255, 0.06);
}

.version-option-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.version-title {
  font-weight: 700;
  color: var(--text-primary);
}

.version-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.version-upgrade {
  background: rgba(255, 208, 134, 0.18);
  color: #f8c364;
  border: 1px solid rgba(248, 195, 100, 0.5);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.version-check {
  width: 20px;
  text-align: right;
  color: var(--accent-color);
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.version-option.active .version-check {
  opacity: 1;
}

[data-theme="light"] .version-toggle-btn {
  background: #e8e8e8;
  border: 1px solid #d3d3d3;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
  color: #1f1f1f;
}

[data-theme="light"] .version-dropdown {
  background: #f7f7f7;
  border: 1px solid #dcdcdc;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .version-option:hover {
  background: rgba(0, 0, 0, 0.04);
}

.session-action {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1500;
}

.session-action-btn {
  min-width: 110px;
  padding: 8px 14px;
  background: #2f2f2f;
  border: 1px solid #3a3a3a;
  border-radius: 10px;
  color: #f5f5f5;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s,
    color 0.2s;
}

.session-action-btn:hover {
  border-color: var(--accent-color);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

/* User Menu Dropdown Styles */
.user-menu-container {
  position: relative;
  display: inline-block;
  height: 100%;
  display: flex;
  align-items: center;
}

.username-text,
.username-right {
  font-weight: bold;
}

.user-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: #2f2f2f;
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
  z-index: 2000;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 5px;
}

.user-dropdown-menu a {
  color: #f5f5f5;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
  transition: background-color 0.2s;
  font-size: 14px;
}

.user-dropdown-menu a:hover {
  background-color: #3a3a3a;
  color: var(--accent-color);
}

.user-menu-container:hover .user-dropdown-menu {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Drag and Drop Styles for Tool Cards */
.tool-card[draggable="true"] {
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.tool-card[draggable="true"]:active {
}

.tool-card.dragging {
  opacity: 0.5;
  transform: scale(0.95);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 100;
  outline: 2px dashed #e6a23c;
  outline-offset: 3px;
}

.tool-card.over {
  outline: 2px dashed #409eff;
  outline-offset: -2px;
  background-color: rgba(64, 158, 255, 0.08);
}

/* APIMart Configuration Panel Styles */
.api-config-content {
  max-width: 96%;
  margin: 0 auto;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: 0 5px;
}

.apimart-test-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.apimart-model-box {
  height: 160px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-input, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  box-sizing: border-box;
}

.apimart-model-title {
  font-weight: 700;
  text-align: center;
  margin: 0 0 10px 0;
  color: var(--text-primary);
}

.apimart-model-supported {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: normal;
  word-break: break-word;
}

.model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.model-tags-scrollbox {
  --model-tags-visible-rows: 10;
  --model-tags-row-height: 34px;
  --model-tags-min-height: 34px;
  min-height: var(--model-tags-min-height);
  max-height: calc(var(--model-tags-visible-rows) * var(--model-tags-row-height));
  overflow-y: auto;
  overflow-x: hidden;
  align-content: flex-start;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.02);
  transition: max-height 0.3s ease;
}

.model-tags-scrollbox.has-models {
  height: auto;
}

.model-tags-scrollbox.single-row {
  max-height: var(--model-tags-min-height);
}

.model-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  user-select: none;
  max-width: 100%;
}

.model-tag:active {
  transform: translateY(1px);
}

/* Specific link style for APIMart keys link */
.apimart-link {
  color: #ff7800 !important;
  text-decoration: underline;
  font-weight: 500;
}

.apimart-link:hover {
  color: #ff9933 !important;
  text-decoration: none;
}

.robot-animation-container {
  position: relative;
  width: min(520px, 100%);
  height: 420px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  --lang-radius: 180px;
  --badge-inner-radius: 215px;
  --badge-outer-radius: 265px;
}

.robot-icon {
  width: 220px;
  height: 220px;
  filter: none !important;
  animation: robotFloat 3s ease-in-out infinite;
  z-index: 2;
}

@keyframes robotFloat {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-12px);
  }
}

.floating-lang {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-color);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  animation: orbitLang 8s linear infinite;
}

.lang-1 {
  animation-delay: 0s;
  color: #409eff;
}

.lang-2 {
  animation-delay: -0.8s;
  color: #67c23a;
}

.lang-3 {
  animation-delay: -1.6s;
  color: #e6a23c;
}

.lang-4 {
  animation-delay: -2.4s;
  color: #f56c6c;
}

.lang-5 {
  animation-delay: -3.2s;
  color: #909399;
}

.lang-6 {
  animation-delay: -4s;
  color: #00e5ff;
}

.lang-7 {
  animation-delay: -4.8s;
  color: #b37feb;
}

.lang-8 {
  animation-delay: -5.6s;
  color: #ff85c0;
}

.lang-9 {
  animation-delay: -6.4s;
  color: #ffd666;
}

.lang-10 {
  animation-delay: -7.2s;
  color: #73d13d;
}

@keyframes orbitLang {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) translateX(var(--lang-radius)) rotate(0deg) scale(0.8);
    opacity: 0;
  }

  10% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(36deg) translateX(var(--lang-radius)) rotate(-36deg) scale(1);
  }

  90% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(324deg) translateX(var(--lang-radius)) rotate(-324deg) scale(1);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg) translateX(var(--lang-radius)) rotate(-360deg) scale(0.8);
    opacity: 0;
  }
}

.floating-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 12px;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  backdrop-filter: blur(6px);
  animation: orbitBadgeInner 10s linear infinite;
}

.floating-badge.badge-ring-outer {
  animation: orbitBadgeOuter 14s linear infinite;
}

.badge-1 {
  animation-delay: 0s;
}

.badge-2 {
  animation-delay: -1.666s;
}

.badge-3 {
  animation-delay: -3.333s;
}

.badge-4 {
  animation-delay: -5s;
}

.badge-5 {
  animation-delay: -6.666s;
}

.badge-6 {
  animation-delay: -8.333s;
}

.badge-7 {
  animation-delay: 0s;
}

.badge-8 {
  animation-delay: -2.333s;
}

.badge-9 {
  animation-delay: -4.666s;
}

.badge-10 {
  animation-delay: -7s;
}

.badge-11 {
  animation-delay: -9.333s;
}

.badge-12 {
  animation-delay: -11.666s;
}

@keyframes orbitBadgeInner {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) translateX(var(--badge-inner-radius)) rotate(0deg) scale(0.85);
    opacity: 0;
  }

  10% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(36deg) translateX(var(--badge-inner-radius)) rotate(-36deg) scale(1);
  }

  90% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(324deg) translateX(var(--badge-inner-radius)) rotate(-324deg) scale(1);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg) translateX(var(--badge-inner-radius)) rotate(-360deg) scale(0.85);
    opacity: 0;
  }
}

@keyframes orbitBadgeOuter {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) translateX(var(--badge-outer-radius)) rotate(0deg) scale(0.85);
    opacity: 0;
  }

  10% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-36deg) translateX(var(--badge-outer-radius)) rotate(36deg) scale(1);
  }

  90% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(-324deg) translateX(var(--badge-outer-radius)) rotate(324deg) scale(1);
  }

  100% {
    transform: translate(-50%, -50%) rotate(-360deg) translateX(var(--badge-outer-radius)) rotate(360deg) scale(0.85);
    opacity: 0;
  }
}

/* 内容库列表项的AI连接图标 - 缩小一倍 */
.tree-item-ai-icon {
  margin-left: auto;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  transition: all 0.3s ease;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tree-item-ai-icon:hover {
  transform: scale(1.2);
}

.tree-item-ai-icon.connected {
  color: #67c23a;
}

.tree-item-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 笔记标签样式 */
.editor-tags-section {
  background: var(--bg-surface);
}

/* 标签容器样式 - 添加可见边框 */
#note-editor-tags-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-height: 32px;
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  padding: 4px 8px;
  transition: all 0.2s;
}

#note-editor-tags-container:hover {
  border-color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.05);
}

.note-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--accent-color);
  color: white;
  border-radius: 12px;
  font-size: 13px;
  transition: all 0.2s;
}

.note-tag:hover {
  opacity: 0.8;
}

.note-tag-text {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-tag-remove {
  font-weight: bold;
  padding: 0 4px;
  border-radius: 50%;
  transition: background 0.2s;
}

.note-tag-remove:hover {
  background: rgba(255, 255, 255, 0.3);
}

.tag-add-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.1);
}

/* 按钮锁定图标样式 */
.button-lock-icon {
  margin-left: 6px;
  font-size: 14px;
  opacity: 0.8;
  vertical-align: middle;
  display: inline-block;
}

/* 按钮锁定图标叠加样式 - 显示在按钮上方 */
.button-lock-icon-overlay {
  position: absolute;
  top: 50%;
  left: calc(50% + 0px);
  transform: translate(-50%, -50%);
  font-size: 32px;
  opacity: 0.9;
  pointer-events: none;
  z-index: 10;
  text-shadow:
    0 0 8px rgba(0, 0, 0, 0.8),
    0 0 12px rgba(0, 0, 0, 0.6),
    2px 2px 4px rgba(0, 0, 0, 0.9);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

@keyframes lock-pulse {

  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes lock-pulse-overlay {

  0%,
  100% {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
  }
}

/* 禁用状态的按钮样式增强 */
button:disabled,
button[disabled] {
  pointer-events: none;
  user-select: none;
}
