/* 主题切换器 */
.theme-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
  }
  
  .theme-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color); /* 边框改细 */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-light); /* 减弱阴影 */
    position: relative;
    overflow: hidden;
  }
  
  .theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-heavy);
  }
  
  .theme-icon {
    width: 24px;
    height: 24px;
    stroke: var(--text-primary);
    fill: none;
    stroke-width: 2;
    transition: all var(--transition-medium);
    position: absolute;
  }
  
  .sun-icon {
    opacity: 1;
    transform: rotate(0deg);
  }
  
  .moon-icon {
    opacity: 0;
    transform: rotate(180deg);
  }
  
  body.theme-dark .sun-icon {
    opacity: 0;
    transform: rotate(180deg);
  }
  
  body.theme-dark .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
  }
  
  .theme-dropdown {
    position: absolute;
    top: 60px;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color); /* 边框改细 */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    padding: var(--spacing-sm);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-medium);
  }
  
  .theme-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  .theme-option {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
  }
  
  .theme-option:hover {
    background: var(--bg-tertiary);
  }
  
  .theme-option.active {
    background: var(--accent-primary);
    color: white;
  }
  
  .theme-preview {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
  }
  
  .light-preview {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* 您可以更新这个预览色以匹配新的浅色主题 */
  }
  
  .dark-preview {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); /* 您可以更新这个预览色以匹配新的深色主题 */
  }
  
  .blue-preview {
    background: linear-gradient(135deg, #0f4c75 0%, #3282b8 100%); /* 您可以更新这个预览色以匹配新的蓝色主题 */
  }
  
  /* 移除了 .green-preview 和 .purple-preview 的定义 */
  /* .green-preview {
    background: linear-gradient(135deg, #2d5016 0%, #68b030 100%);
  } */
  
  /* .purple-preview {
    background: linear-gradient(135deg, #4a148c 0%, #7b1fa2 100%);
  } */
  
  /* 移动端菜单 */
  .mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    width: 50px;
    height: 50px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color); /* 边框改细 */
    border-radius: 50%;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all var(--transition-medium);
    box-shadow: var(--shadow-light); /* 减弱阴影 */
    /* 确保触摸区域足够大 */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }
  
  .mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    transition: all var(--transition-medium);
    border-radius: 1px;
  }
  
  .mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  /* 侧边栏 */
  .sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color); /* 边框改细 */
    z-index: 1000;
    transition: all var(--transition-medium);
    overflow-y: auto;
    box-shadow: var(--shadow-medium); /* 减弱阴影 */
  }
  
  .sidebar.active {
    left: 0;
  }
  
  .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 2px solid var(--border-color);
  }
  
  .sidebar-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 0;
  }
  
  .sidebar-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-small);
    transition: all var(--transition-fast);
  }
  
  .sidebar-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
  }
  
  .sidebar-content {
    padding: var(--spacing-lg);
  }
  
  .tool-category {
    margin-bottom: var(--spacing-xl);
  }
  
  .tool-category h3 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
  }
  
  .tool-category .nav-btn {
    width: 100%;
    justify-content: flex-start;
    margin-bottom: var(--spacing-sm);
    text-align: left;
  }
  
  /* 主内容区域 */
  .main-content {
    width: 100%;
    padding: var(--spacing-lg);
    transition: all var(--transition-medium);
  }
  
  /* 桌面端导航 */
  .desktop-nav {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    padding: 0 var(--spacing-lg);
  }
  
  /* JSON 可视化特定样式 */
  .json-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow: auto;
    max-height: 600px;
    white-space: pre-wrap;
    word-break: break-all;
  }
  
  .json-key {
    color: var(--accent-primary);
    font-weight: 600;
  }
  
  .json-string {
    color: var(--accent-secondary);
  }
  
  .json-number {
    color: var(--accent-warning);
  }
  
  .json-boolean {
    color: var(--accent-purple);
    font-weight: 600;
  }
  
  .json-null {
    color: var(--text-muted);
    font-style: italic;
  }
  
  .json-bracket {
    color: var(--text-primary);
    font-weight: 700;
  }
  
  .json-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    margin-right: var(--spacing-xs);
    padding: 4px 8px;
    border-radius: var(--border-radius-small);
    transition: all var(--transition-medium);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
  }
  
  .json-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: scale(1.1);
    box-shadow: none; /* 移除阴影，或使用非常轻微的 */
  }
  
  /* 优化的折叠/展开图标 */
  .json-toggle.expanded::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid var(--accent-primary);
    transition: all var(--transition-medium);
    transform: rotate(0deg);
  }
  
  .json-toggle.collapsed::before {
    content: '';
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 6px solid var(--accent-primary);
    transition: all var(--transition-medium);
    transform: rotate(0deg);
  }
  
  .json-toggle:hover.expanded::before {
    border-top-color: var(--accent-secondary);
    transform: rotate(180deg);
  }
  
  .json-toggle:hover.collapsed::before {
    border-left-color: var(--accent-secondary);
    transform: rotate(90deg);
  }
  
  /* 添加属性数量高亮样式 */
  .json-object-length,
  .json-array-length {
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
    padding: 2px 6px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px solid var(--border-color);
  }
  
  .json-children {
    margin-left: 20px;
    padding-left: 10px;
    border-left: 2px solid var(--border-color);
  }
  
  .json-children.collapsed {
    display: none;
  }
  
  /* 折叠状态下的节点样式 */
  .json-node.collapsed .json-children {
    display: none;
  }
  
  .json-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-small);
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
  }
  
  .json-stats {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
  }
  
  .json-stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
  }
  
  .json-stat-icon {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
  }
  
  /* 二维码生成器特定样式 */
  #qr-text-input {
    min-height: 120px;
    max-height: 200px;
    font-family: inherit;
  }
  
  #qr-output {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-color); /* 边框改细 */
    border-radius: var(--border-radius);
    transition: all var(--transition-medium);
  }
  
  #qr-output.has-qr {
    border-style: solid;
    border-color: var(--accent-primary);
  }
  
  #qr-output canvas {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-small);
  }
  
  .qr-placeholder {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
  }
  
  /* 链接提取器特定样式 */
  .link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color); /* 边框改细 */
    border-radius: var(--border-radius-small); /* 较小圆角 */
    margin-bottom: var(--spacing-sm);
    transition: all var(--transition-medium);
    gap: var(--spacing-md);
  }
  
  .link-item:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-light); /* 减弱悬停阴影 */
  }
  
  .link-text {
    flex: 1;
    word-break: break-all;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
  }
  
  .link-text:hover {
    color: var(--accent-primary);
  }
  
  .link-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-shrink: 0;
  }
  
  .link-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: 0.75rem;
    min-width: 60px;
    border-radius: var(--border-radius-small);
  }
  
  .links-summary {
    text-align: center;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-weight: 500;
}

.json-copy-path {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  margin-left: 8px;
  padding: 2px 4px;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.json-header:hover .json-copy-path {
  opacity: 1;
}

.json-copy-path:hover {
  background-color: var(--hover-bg);
}

.json-copy-path:active {
  transform: scale(0.95);
}

/* 固定工具栏容器 */
.json-toolbar-container {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 10px;
  border-radius: 8px 8px 0 0;
}

/* 优化JSON输出标题栏样式 */
.json-output-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin: 0;
  flex-wrap: wrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  min-height: 60px;
}

.json-output-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  min-width: 80px;
}

/* 路径格式组优化 */
.path-format-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 160px;
}

.path-format-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  margin: 0;
}

.path-format-select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  min-width: 120px;
  transition: border-color 0.2s ease;
}

.path-format-select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.1);
}

/* 搜索组优化 */
.search-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.json-search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.json-search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), 0.1);
}

.json-search-input:disabled {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.json-search-btn {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  min-width: 40px;
}

.json-search-btn:hover:not(:disabled) {
  background: var(--hover-bg);
  border-color: var(--primary-color);
}

.json-search-btn:disabled {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: not-allowed;
}

/* 导航组优化 */
.search-nav-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 100px;
}

.search-nav-btn {
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-nav-btn:hover:not(:disabled) {
  background: var(--hover-bg);
  border-color: var(--primary-color);
}

.search-nav-btn:disabled {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.search-counter {
  font-size: 12px;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: center;
  font-weight: 500;
}

/* 更新搜索高亮样式 - 更明显的效果 */
.search-highlight {
  background-color: #ffeb3b !important;
  border: 1px solid #ffc107 !important;
  border-radius: 3px !important;
  padding: 1px 3px !important;
  font-weight: 600 !important;
  color: #333 !important;
  transition: all 0.2s ease !important;
  box-shadow: 0 1px 3px rgba(255, 193, 7, 0.3) !important;
}

.search-current {
  background-color: #f44336 !important;
  color: white !important;
  border-color: #d32f2f !important;
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.7) !important;
  font-weight: 700 !important;
  animation: pulse-highlight 1.5s ease-in-out infinite !important;
  transform: scale(1.05) !important;
}

/* 深色主题下的搜索高亮 */
body.theme-dark .search-highlight {
  background-color: #ffc107 !important;
  border-color: #ff9800 !important;
  color: #1a1a1a !important;
  box-shadow: 0 1px 3px rgba(255, 193, 7, 0.5) !important;
}

body.theme-dark .search-current {
  background-color: #f44336 !important;
  border-color: #d32f2f !important;
  color: white !important;
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.8) !important;
}

/* 蓝色主题下的搜索高亮 */
body.theme-blue .search-highlight {
  background-color: #ffeb3b !important;
  border-color: #ffc107 !important;
  color: #1a1a1a !important;
  box-shadow: 0 1px 3px rgba(255, 235, 59, 0.5) !important;
}

body.theme-blue .search-current {
  background-color: #f44336 !important;
  border-color: #d32f2f !important;
  color: white !important;
  box-shadow: 0 0 10px rgba(244, 67, 54, 0.8) !important;
}

/* 改进的脉冲动画 */
@keyframes pulse-highlight {
  0% {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.7);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.9);
  }
  100% {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.7);
  }
}

/* 搜索框提示优化 */
.json-search-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}

.json-search-input:focus::placeholder {
  opacity: 0.5;
}

/* 搜索结果计数器 - 更明显 */
.search-counter {
  font-size: 0.8rem;
  color: var(--text-primary);
  padding: 4px 8px;
  background: var(--accent-primary);
  color: white;
  border-radius: 12px;
  min-width: 45px;
  text-align: center;
  font-weight: 600;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 搜索导航按钮优化 */
.search-nav-btn {
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-nav-btn:hover:not(:disabled) {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.search-nav-btn:disabled {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .json-output-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
  }
  
  .path-format-group,
  .search-group,
  .search-nav-group {
    min-width: auto;
    max-width: none;
  }
  
  .json-output-title {
    text-align: center;
    min-width: auto;
  }
}

@media (max-width: 480px) {
  .json-output-header {
    padding: 10px;
  }
  
  .path-format-group {
    flex-direction: column;
    gap: 5px;
  }
  
  .path-format-select {
    width: 100%;
    min-width: auto;
  }
}

/* 移除原有的路径格式选择器样式 */
.path-format-selector {
  display: none;
}

/* 深色主题适配 */
.theme-dark .path-format-selector select {
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0IDUiPjxwYXRoIGZpbGw9IiM2NjYiIGQ9Ik0yIDBMMCAyaDR6bTAgNUwwIDNoNHoiLz48L3N2Zz4=');
}

@media (max-width: 768px) {
  /* 修复移动端工具切换 */
  .tool-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .tool-tabs::-webkit-scrollbar {
    display: none;
  }
  
  .tool-tabs .tab-button {
    display: inline-block;
    min-width: 80px;
    flex-shrink: 0;
  }
  
  /* 修复移动端滚动问题 */
  .container {
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .main-content {
    height: calc(100vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* 移动端侧边栏优化 */
  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .sidebar.active {
    left: 0;
  }
  
  /* 移动端遮罩层 */
  .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
  
  .overlay.active {
    opacity: 1;
    visibility: visible;
  }
  
  /* 移动端输入框优化 */
  .json-input,
  .rich-text-input {
    min-height: 200px;
    font-size: 14px;
  }
  
  /* 移动端按钮优化 */
  .tool-buttons {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .tool-buttons button {
    min-width: 80px;
    padding: 8px 12px;
    font-size: 14px;
  }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
  .tool-tabs .tab-button {
    min-width: 70px;
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .tool-buttons button {
    min-width: 70px;
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .json-input,
  .rich-text-input {
    min-height: 150px;
    font-size: 13px;
  }
}

@media (min-width: 768px) {
  body {
    padding: 0;
  }
  
  .container {
    padding: 0;
    border-radius: 0;
    box-shadow: none;
  }
  
  .tool-layout {
    flex-direction: row;
    height: calc(100vh - 100px);
    gap: 10px;
  }
  
  .input-section,
  .output-section {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }
  .output-section #json-output {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    background: var(--bg-secondary);
    overflow: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    margin-top: 0;
  }
  #rich-text-input,
  #plain-text-output,
  #json-input,
  #json-output,
  #qr-text-input,
  #qr-output {
    flex: 1;
    min-height: auto;
    max-height: none;
    height: 100%;
    width: 100%;
  }
  
  #qr-output {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (min-width: 1200px) {
  .main-content {
    padding: var(--spacing-xl);
  }
  
  .container {
    padding: 0;
  }
  
  #rich-text-input,
  #plain-text-output,
  #json-input,
  #json-output {
    min-height: 550px;
  }
}

/* 自适应字体大小 */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  html {
    font-size: 15px;
  }
}

@media (min-width: 769px) {
  html {
    font-size: 16px;
  }
}

/* 系统偏好设置适配 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --bg-secondary: #2d3748;
    --bg-tertiary: #4a5568;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --border-color: #4a5568;
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.4);
    --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.5);
  }
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 高对比度支持 */
@media (prefers-contrast: high) {
  :root {
    --border-color: #000000;
    --text-primary: #000000;
    --text-secondary: #333333;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f0f0f0;
  }
  
  body.theme-dark {
    --border-color: #ffffff;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --bg-secondary: #000000;
    --bg-tertiary: #333333;
  }
}

/* 打印样式 */
@media print {
  .theme-switcher,
  .mobile-menu-toggle,
  .sidebar,
  .button-group {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .container {
    box-shadow: none !important;
    border: none !important;
  }
}

/* 额外优化路径格式选择器的可读性

如果上述修改还不够清晰，可以在 <mcfile name="components.css" path="/Users/weiguangxieyu/Trae/wangzhantest/newgame/css/components.css"></mcfile> 中为蓝色主题专门设置路径选择器样式：
```
/* 蓝色主题下路径格式选择器特殊优化 */
body.theme-blue .path-format-selector {
  background: #ffffff;
  border: 2px solid #e2e8f0;
}

body.theme-blue .path-format-selector label {
  color: #0f172a;
  font-weight: 700;
}

body.theme-blue .path-format-selector select {
  background: #ffffff;
  color: #0f172a;
  border: 2px solid #cbd5e1;
  font-weight: 600;
}

body.theme-blue .path-format-selector select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

  /* 在文件末尾添加以下内容 */

/* ===== JSON 可视化组件样式优化 ===== */

/* 路径复制按钮优化 */
.copy-path-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  margin-left: 6px;
  background: transparent;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0;
  transition: all var(--transition-fast);
  position: relative;
  vertical-align: middle;
}

/* 悬停时显示复制按钮 */
.json-node:hover .copy-path-btn,
.json-primitive:hover .copy-path-btn,
.json-array-header:hover .copy-path-btn,
.json-object-header:hover .copy-path-btn {
  opacity: 1;
}

/* 复制按钮悬停效果 */
.copy-path-btn:hover {
  background: var(--bg-hover);
  color: var(--accent-primary);
  transform: scale(1.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 复制按钮激活效果 */
.copy-path-btn:active {
  transform: scale(0.95);
}

/* 成功状态 */
.copy-path-btn.success {
  background: var(--accent-secondary);
  color: white;
  opacity: 1;
}

/* 失败状态 */
.copy-path-btn.error {
  background: var(--accent-error);
  color: white;
  opacity: 1;
}

/* JSON 节点样式优化 */
.json-node {
  position: relative;
  margin: 2px 0;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.json-node:hover {
  background: rgba(var(--accent-primary-rgb), 0.02);
}

/* JSON 头部样式 */
.json-array-header,
.json-object-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.json-array-header:hover,
.json-object-header:hover {
  background: rgba(var(--accent-primary-rgb), 0.04);
}

/* JSON 原始值样式 */
.json-primitive {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.json-primitive:hover {
  background: rgba(var(--accent-primary-rgb), 0.02);
}

/* 覆盖现有的 JSON 键名样式 */
.json-key {
  font-weight: 500;
  margin-right: 4px;
}

/* 覆盖现有的 JSON 值类型样式 */
.json-string {
  color: #059669;
  font-style: italic;
}

.json-number {
  color: #dc2626;
  font-weight: 500;
}

.json-boolean {
  color: #7c3aed;
  font-weight: 500;
}

.json-null {
  color: var(--text-muted);
  font-style: italic;
}

/* JSON 括号样式 */
.json-bracket {
  color: var(--text-secondary);
  font-weight: 600;
}

/* JSON 计数样式 */
.json-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
}

/* 覆盖现有的 JSON 展开/折叠按钮样式 */
.json-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  cursor: pointer;
  font-size: 10px;
  transition: all var(--transition-fast);
  border-radius: 2px;
}

.json-toggle:hover {
  background: var(--bg-hover);
  transform: scale(1.1);
}

/* JSON 内容容器 */
.json-content {
  margin-left: 16px;
  border-left: 1px solid var(--border-color);
  padding-left: 8px;
  margin-top: 4px;
}

/* JSON 结束括号 */
.json-close-bracket {
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 2px;
}

/* 响应式优化 */
@media (max-width: 768px) {
  .copy-path-btn {
    width: 18px;
    height: 18px;
    font-size: 11px;
    opacity: 0.7; /* 移动端默认显示，但透明度较低 */
  }
  
  .json-count {
    font-size: 0.7rem;
    padding: 1px 4px;
  }
}

/* 深色主题下的特殊调整 */
body.theme-dark .json-string {
  color: #10b981;
}

body.theme-dark .json-number {
  color: #f87171;
}

body.theme-dark .json-boolean {
  color: #a78bfa;
}

/* 蓝色主题下的特殊调整 */
body.theme-blue .json-string {
  color: #059669;
}

body.theme-blue .json-number {
  color: #dc2626;
}

body.theme-blue .json-boolean {
  color: #7c3aed;
}

/* 在文件末尾添加以下样式，修复横向滚动和层级显示问题 */

/* ===== JSON 输出区域横向滚动优化 ===== */

/* 修复 JSON 输出容器的滚动问题 */
#json-output {
  overflow-x: auto !important;
  overflow-y: auto !important;
  white-space: nowrap; /* 防止自动换行 */
  min-width: 0; /* 确保可以缩小 */
  max-width: 100%;
}

/* 确保 JSON 内容可以横向滚动 */
.json-container {
  display: inline-block;
  min-width: 100%;
  white-space: nowrap;
  vertical-align: top;
}

/* JSON 节点样式优化 - 支持横向布局 */
.json-node {
  position: relative;
  margin: 2px 0;
  border-radius: 4px;
  transition: all var(--transition-fast);
  white-space: nowrap; /* 防止节点内容换行 */
  display: block;
}

/* JSON 内容缩进优化 */
.json-content {
  margin-left: 20px; /* 增加缩进 */
  border-left: 1px solid var(--border-color);
  padding-left: 12px;
  margin-top: 4px;
  display: block;
  position: relative;
}

/* 复制按钮在横向滚动时的固定定位优化 */
.copy-path-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  margin-left: 8px; /* 增加一点间距 */
  background: transparent;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0;
  transition: all var(--transition-fast);
  position: relative;
  vertical-align: middle;
  flex-shrink: 0; /* 防止按钮被压缩 */
}

/* 确保在深层级时复制按钮仍然可见和可点击 */
.json-node:hover .copy-path-btn,
.json-primitive:hover .copy-path-btn,
.json-array-header:hover .copy-path-btn,
.json-object-header:hover .copy-path-btn {
  opacity: 1;
  z-index: 10; /* 确保按钮在最上层 */
}

/* 优化 JSON 头部布局，确保内容不会被截断 */
.json-array-header,
.json-object-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  min-width: 0;
}

/* JSON 原始值样式优化 */
.json-primitive {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all var(--transition-fast);
  white-space: nowrap;
  min-width: 0;
}

/* 自定义滚动条样式，让横向滚动更明显 */
#json-output::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#json-output::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

#json-output::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
  opacity: 0.6;
}

#json-output::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
  opacity: 0.8;
}

#json-output::-webkit-scrollbar-corner {
  background: var(--bg-tertiary);
}

/* 确保在移动端也有良好的滚动体验 */
@media (max-width: 768px) {
  #json-output {
    -webkit-overflow-scrolling: touch;
  }
  
  .json-content {
    margin-left: 16px; /* 移动端减少缩进 */
    padding-left: 8px;
  }
  
  .copy-path-btn {
    width: 18px; /* 移动端稍微增大按钮 */
    height: 18px;
    font-size: 11px;
  }
}

/* 深色主题下的滚动条优化 */
body.theme-dark #json-output::-webkit-scrollbar-track {
  background: #2d3748;
}

body.theme-dark #json-output::-webkit-scrollbar-thumb {
  background: #a0aec0;
}

body.theme-dark #json-output::-webkit-scrollbar-thumb:hover {
  background: #60a5fa;
}

/* 蓝色主题下的滚动条优化 */
body.theme-blue #json-output::-webkit-scrollbar-track {
  background: #e2e8f0;
}

body.theme-blue #json-output::-webkit-scrollbar-thumb {
  background: #64748b;
}

body.theme-blue #json-output::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}

/* 复制按钮组样式 */
.copy-button-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  position: relative;
}

/* 复制路径按钮样式 */
.copy-path-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0;
  transition: all var(--transition-fast);
  position: relative;
  vertical-align: middle;
}

/* 复制内容按钮样式 */
.copy-content-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 9px;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0;
  transition: all var(--transition-fast);
  position: relative;
  vertical-align: middle;
}

/* 悬停时显示复制按钮 */
.json-node:hover .copy-path-btn,
.json-node:hover .copy-content-btn,
.json-primitive:hover .copy-path-btn,
.json-primitive:hover .copy-content-btn,
.json-array-header:hover .copy-path-btn,
.json-array-header:hover .copy-content-btn,
.json-object-header:hover .copy-path-btn,
.json-object-header:hover .copy-content-btn {
  opacity: 1;
}

/* 复制按钮悬停效果 */
.copy-path-btn:hover,
.copy-content-btn:hover {
  background: var(--bg-hover);
  color: var(--accent-primary);
  transform: scale(1.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 复制按钮激活效果 */
.copy-path-btn:active,
.copy-content-btn:active {
  transform: scale(0.95);
}

/* 成功状态 */
.copy-path-btn.success,
.copy-content-btn.success {
  background: var(--accent-secondary);
  color: white;
  opacity: 1;
}

/* 失败状态 */
.copy-path-btn.error,
.copy-content-btn.error {
  background: var(--accent-error);
  color: white;
  opacity: 1;
}

/* 格式选择下拉菜单 */
.format-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-small);
  box-shadow: var(--shadow-heavy);
  padding: var(--spacing-xs);
  min-width: 160px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-medium);
}

.format-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* 格式选项样式 */
.format-option {
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-small);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--spacing-xs);
}

.format-option:last-child {
  margin-bottom: 0;
}

.format-option:hover {
  background: var(--bg-hover);
}

.format-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.format-description {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* 复制反馈样式 */
.copy-feedback {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  box-shadow: var(--shadow-medium);
  opacity: 0;
  transition: all var(--transition-fast);
  pointer-events: none;
}

.copy-feedback.success {
  background: var(--accent-secondary);
  color: white;
}

.copy-feedback.error {
  background: var(--accent-error);
  color: white;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .copy-path-btn,
  .copy-content-btn {
    width: 18px;
    height: 18px;
    font-size: 10px;
    opacity: 0.7; /* 移动端默认显示，但透明度较低 */
  }
  
  .format-dropdown {
    min-width: 140px;
    right: -20px; /* 调整位置避免超出屏幕 */
  }
  
  .format-label {
    font-size: 0.8rem;
  }
  
  .format-description {
    font-size: 0.7rem;
  }
}

/* 深色主题适配 */
body.theme-dark .format-dropdown {
  background: #1f2937;
  border-color: #4b5563;
}

body.theme-dark .copy-feedback {
  background: #374151;
  color: #f3f4f6;
}

/* 蓝色主题适配 */
body.theme-blue .format-dropdown {
  background: #ffffff;
  border-color: #cbd5e1;
}

body.theme-blue .copy-feedback {
  background: #f8fafc;
  color: #0f172a;
}

/* 临时调试：让下拉菜单更明显 */
.format-dropdown.show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  background: #ff0000 !important; /* 临时用红色背景 */
  border: 2px solid #000 !important; /* 临时用黑色边框 */
}