/* 主题样式文件 - 支持明亮和暗黑主题切换 */

/* CSS 变量定义 */
:root {
  /* 明亮主题 - 企业级清晰配色方案，参考Element Plus企业版 */
  --bg-primary: linear-gradient(135deg, #ffffff 0%, #ebecf2 100%);
  --bg-secondary: rgba(255, 255, 255, 0.98);
  --bg-tertiary: #f4f5f9;
  --bg-panel: #ffffff;
  --bg-hover: rgba(0, 71, 234, 0.06);
  
  --text-primary: #262d39;
  --text-secondary: #778395;
  --text-muted: #9aa6b8;
  --text-inverse: #ffffff;
  
  --border-color: #dcdfe6;
  --border-focus: #0047ea;
  
  --shadow-primary: 0 2px 4px -2px rgba(38, 45, 57, 0.06), 0 4px 8px -3px rgba(38, 45, 57, 0.04);
  --shadow-secondary: 0 2px 4px -2px rgba(38, 45, 57, 0.12), 0 4px 12px -3px rgba(38, 45, 57, 0.08);
  --shadow-hover: 0 2px 4px -2px rgba(38, 45, 57, 0.18), 0 4px 16px -3px rgba(38, 45, 57, 0.1);
  
  --accent-blue: #0047ea;
  --accent-red: #db1218;
  --accent-green: #46bd22;
  --accent-orange: #ffb200;
  --accent-purple: #722ed1;
  
  --network-bg: #ebecf2;
  --table-border-color: #e0e0e0;
  --table-row-hover-bg: #f5f5f5;
  --table-header-bg: #f8f9fa;
  --header-text-color: #212529;
}

/* 暗黑主题 */
[data-theme="dark"] {
  --bg-primary: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  --bg-secondary: rgba(44, 62, 80, 0.95);
  --bg-tertiary: linear-gradient(145deg, #34495e, #2c3e50);
  --bg-panel: #3a4a5c;
  --bg-hover: rgba(255, 255, 255, 0.1);
  
  --text-primary: #ecf0f1;
  --text-secondary: #bdc3c7;
  --text-muted: #7f8c8d;
  --text-inverse: #2c3e50;
  
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: #5dade2;
  
  --shadow-primary: 0 20px 40px rgba(0, 0, 0, 0.3);
  --shadow-secondary: 0 8px 25px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 12px 35px rgba(0, 0, 0, 0.25);
  
  --accent-blue: #5dade2;
  --accent-red: #ec7063;
  --accent-green: #58d68d;
  --accent-orange: #f7dc6f;
  --accent-purple: #bb8fce;
  
  --network-bg: #2c3e50;
  --table-border-color: #444;
  --table-row-hover-bg: rgba(255, 255, 255, 0.08);
  --table-header-bg: #2c3e50;
  --header-text-color: #ecf0f1;
}

/* 暗黑模式特定样式 */
[data-theme="dark"] .table-view-modal {
  color: var(--text-primary);
}

[data-theme="dark"] .data-table {
  color: var(--text-primary);
}

[data-theme="dark"] .data-table th,
[data-theme="dark"] .data-table td {
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .table-view-title {
  color: var(--text-primary);
}

[data-theme="dark"] .table-stats {
  color: var(--text-primary);
}

[data-theme="dark"] .filter-row {
  color: var(--text-primary);
}

[data-theme="dark"] .filter-row input,
[data-theme="dark"] .filter-row select {
  color: var(--text-primary);
  background: var(--bg-panel);
}

[data-theme="dark"] .export-options {
  color: var(--text-primary);
}

[data-theme="dark"] .layer-badge {
  color: var(--text-inverse);
}

[data-theme="dark"] .table-view-content {
  color: var(--text-primary);
}

[data-theme="dark"] .table-view-header {
  color: var(--text-primary);
}

/* 整体界面样式 */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-primary);
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  color: var(--text-primary);
  transition: all 0.3s ease;
  overflow: hidden;
  
  /* 强制Flexbox布局，解决容器下推问题 */
  display: flex;
  flex-direction: column;
}

.container {
  position: absolute;
  backdrop-filter: blur(10px);
  background: var(--bg-secondary);
  border-radius: 0;
  margin: 0;
  padding: 0;
  box-shadow: var(--shadow-primary);
  overflow: hidden;
  transition: all 0.3s ease;
  min-height: 100vh;
  height: 100vh;
  width: 100vw;
  display: grid;
  grid-template-columns: 20% 80%;
  grid-template-rows: 1fr;
  gap: 0;
  top: 0;
  left: 0;
  
  /* 确保容器在Flexbox中可以伸缩 */
  flex: 1; 
}

.sidebar {
  background: var(--bg-tertiary);
  border-radius: 15px;
  margin: 5px;
  box-shadow: var(--shadow-secondary);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  height: calc(100vh - 10px);
  overflow-y: auto;
}

.panel {
  background: var(--bg-panel);
  border-radius: 12px;
  box-shadow: var(--shadow-secondary);
  margin: 15px;
  padding: 20px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.panel h3 {
  margin: 0 0 15px 0;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 16px;
  border-bottom: 2px solid var(--accent-blue);
  padding-bottom: 8px;
}

/* 悬浮控制面板样式 */
.floating-controls {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.floating-panel {
  background: var(--bg-panel);
  border-radius: 12px;
  box-shadow: var(--shadow-primary);
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 60px;
}

.floating-panel.expanded {
  max-width: 320px;
}

.floating-toggle {
  padding: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
  white-space: nowrap;
  min-width: 60px;
  justify-content: center;
}

.floating-panel:not(.expanded) .floating-toggle span {
  display: none;
}

.floating-panel.expanded .floating-toggle {
  justify-content: flex-start;
  padding-left: 20px;
}

.floating-toggle:hover {
  background: var(--bg-hover);
}

.floating-toggle i {
  font-size: 16px;
  color: var(--accent-blue);
  flex-shrink: 0;
}

.floating-toggle span {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.floating-content {
  display: none;
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
}

.floating-panel.expanded .floating-content {
  display: block;
}

/* 主题切换器样式 */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: var(--bg-panel);
  border-radius: 50px;
  padding: 6px;
  box-shadow: var(--shadow-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  flex-direction: row;
  flex-wrap: nowrap;
}

.theme-toggle-btn {
  background: none;
  border: none;
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  min-width: auto;
}

.theme-toggle-btn.active {
  background: var(--accent-blue);
  color: var(--text-inverse);
}

.theme-toggle-btn:hover:not(.active) {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* 按钮样式 */
button {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: linear-gradient(145deg, var(--accent-blue), #2980b9);
  color: var(--text-inverse);
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

button:active {
  transform: translateY(0);
}

.btn-api {
  background: linear-gradient(145deg, var(--accent-red), #c0392b);
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.btn-upload {
  background: linear-gradient(145deg, var(--accent-green), #229954);
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.btn-static {
  background: linear-gradient(145deg, var(--accent-purple), #7d3c98);
  box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn-static:hover {
  background: linear-gradient(145deg, #7d3c98, #633974);
  box-shadow: 0 6px 20px rgba(142, 68, 173, 0.4);
  transform: translateY(-2px);
}

.btn-static:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(142, 68, 173, 0.3);
}

.btn-table {
  background: linear-gradient(145deg, var(--accent-green), #27ae60);
  box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}

/* 输入框样式 */
input,
select {
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: var(--bg-panel);
  color: var(--text-primary);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 统计卡片样式 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 15px 0;
}

.stats-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 15px 0;
}

.stat-item {
  background: var(--bg-panel);
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-secondary);
}

.stat-item:hover {
  transform: scale(1.02);
  background: var(--bg-panel);
}

.stat-value {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.stat-item span:not(.stat-value) {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 14px;
}

/* 自定义弹框样式 */
.custom-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

.custom-dialog {
  background: var(--bg-panel);
  border-radius: 20px;
  box-shadow: var(--shadow-primary);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow: hidden;
  animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid var(--border-color);
}

.custom-dialog-header {
  display: flex;
  align-items: center;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  border-radius: 20px 20px 0 0;
}

.custom-dialog-icon {
  font-size: 24px;
  margin-right: 12px;
}

.custom-dialog-title {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.custom-dialog-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex:0 0 40px;
}

.custom-dialog-close:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.custom-dialog-content {
  padding: 24px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-line;
}

.custom-dialog-actions {
  padding: 20px 28px 28px;
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  border-radius: 0 0 20px 20px;
}

.custom-dialog-actions button {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 100px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
  background: linear-gradient(145deg, var(--accent-blue), #2980b9);
  color: var(--text-inverse);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(145deg, #2980b9, #1f618d);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  box-shadow: 0 6px 20px rgba(189, 195, 199, 0.3);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(189, 195, 199, 0.4);
}

.btn-success {
  background: var(--accent-green);
  color: var(--text-inverse);
}

.btn-success:hover {
  background: #229954;
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--accent-red);
  color: var(--text-inverse);
}

.btn-danger:hover {
  background: #c0392b;
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--accent-orange);
  color: var(--text-inverse);
}

.btn-warning:hover {
  background: #d68910;
  transform: translateY(-1px);
}

/* 主内容区域 */
.main-content {
  flex: 1;
  position: relative;
  background: var(--network-bg);
  border-radius: 15px;
  margin: 5px;
  box-shadow: var(--shadow-secondary);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 10px);
  border: 1px solid var(--border-color);
}

.toolbar {
  background: var(--bg-tertiary);
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 250px;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: 25px;
  font-size: 14px;
  background: var(--bg-panel);
  box-shadow: inset 0 2px 5px var(--border-color);
  color: var(--text-primary);
}

.search-box:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 工具栏按钮文字和图标颜色 */
.search-btn,
.reset-btn {
  color: white !important; /* 强制白色文字 */
}

.search-btn i,
.reset-btn i {
  color: white !important; /* 强制白色图标 */
}

#network {
  background: var(--network-bg);
  border-radius: 0 0 15px 15px;
  transition: all 0.3s ease;
  width: 100%;
  flex: 1;
  min-height: 400px;
  position: relative;
}

/* 详情面板 */
.node-info,
.transaction-details {
  background: var(--bg-panel);
  border-radius: 15px;
  box-shadow: var(--shadow-secondary);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: absolute;
  top: 120px;
  left: 20px;
  width: 300px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.loading {
  background: var(--bg-secondary);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  box-shadow: var(--shadow-secondary);
  color: var(--text-primary);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  z-index: 50;
  display: none;
}

/* 连接状态指示器 */
.connection-status {
  background: var(--bg-panel);
  border-radius: 10px;
  padding: 15px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px var(--border-color);
}

.status-row {
  padding: 8px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 数据源信息 */
.data-source-info {
  background: var(--bg-panel);
  border-radius: 10px;
  padding: 15px;
  border: 1px solid var(--border-color);
  margin-bottom: 15px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-secondary);
}

/* 图例样式 */
.legend-item {
  display: flex;
  align-items: center;
  margin: 8px 0;
  color: var(--text-primary);
}

.legend-item i {
  margin-right: 8px;
  width: 16px;
}

.legend-item i.red {
  color: var(--accent-red);
}

.legend-item i.orange {
  color: var(--accent-orange);
}

.legend-item i.green {
  color: var(--accent-green);
}

.legend-item i.diagonal {
  color: var(--accent-purple);
}

.legend-item i.gray {
  color: var(--text-muted);
}

.usage-tips {
  margin-top: 15px;
  padding: 12px;
  background: var(--bg-tertiary);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* 表格视图样式 - 优化版 */
.table-view-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  backdrop-filter: blur(8px);
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(8px);
  }
}

.table-view-content {
  background: var(--bg-secondary);
  border-radius: 24px;
  width: 96%;
  max-width: 1600px;
  height: 92%;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: visible;
  animation: contentSlideIn 0.4s ease-out;
}

/* 表格容器优化 */
.table-view-content > .table-container {
  flex: 1;
  min-height: 0;
}

.table-view-header {
  background: var(--bg-panel);
  color: var(--text-primary);
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  box-shadow: var(--shadow-secondary);
}

.table-view-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, 
    rgba(255, 255, 255, 0.1) 0%, 
    transparent 50%, 
    rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
}

.table-view-title {
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  position: relative;
  z-index: 1;
}

.table-view-title i {
  font-size: 20px;
  color: var(--accent-blue);
}

.table-view-controls {
  display: flex;
  gap: 15px;
  position: relative;
  z-index: 1;
}

.table-view-controls button {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.table-view-controls button:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.table-view-controls .close-icon {
  color: var(--accent-red);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-view-controls .close-icon:hover {
  color: #c0392b;
  background: rgba(231, 76, 60, 0.1);
  transform: scale(1.1);
}

.table-stats {
  background: var(--bg-panel);
  padding: 16px 30px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  position: relative;
}

.table-stats::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    var(--accent-color), 
    transparent);
}

.table-stats i {
  color: var(--accent-color);
  font-size: 15px;
  margin-right: 4px;
}

.table-stats strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* 筛选区二次优化 */
.filter-row {
  background: var(--bg-panel);
  padding: 18px 30px;
  border-bottom: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 2fr 2fr 1.2fr 1fr 1fr 0.8fr;
  gap: 12px;
  align-items: center;
}

.filter-row input,
.filter-row select {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 400;
  transition: all 0.3s ease;
  outline: none;
}

.filter-row input:focus,
.filter-row select:focus {
  border-color: var(--border-focus);
  box-shadow: 
    0 0 0 2px rgba(0, 71, 234, 0.08),
    var(--shadow-secondary);
}

.filter-row input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.filter-row button {
  background: var(--accent-blue);
  border: none;
  border-radius: 6px;
  color: white;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: var(--shadow-secondary);
  white-space: nowrap;
}

.filter-row button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
  background: #093bae;
}

/* 表格容器 - 支持双向滚动 */
.table-container {
  overflow: auto;
  max-height: 65vh;
  max-width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  position: relative;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-secondary);
  flex: 1;
  min-height: 0;
}

/* 表格容器滚动条样式 */
.table-container::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.table-container::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 6px;
}

.table-container::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: 6px;
  border: 2px solid var(--bg-tertiary);
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
}

.table-container::-webkit-scrollbar-corner {
  background: var(--bg-tertiary);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  font-size: 14px;
  font-weight: 500;
  table-layout: fixed; /* 改回 fixed 布局，这对处理宽表格和粘性表头更稳定 */
  min-width: 1400px; /* 增加最小宽度确保所有列都能显示 */
}

/* 列宽设置 - 支持横向滚动的固定宽度 */
.data-table th:nth-child(1) { min-width: 80px; }    /* 序号 */
.data-table th:nth-child(2) { min-width: 180px; }   /* 交易卡号 */
.data-table th:nth-child(3) { min-width: 100px; }   /* 交易户名 */
.data-table th:nth-child(4) { min-width: 160px; }   /* 交易时间 */
.data-table th:nth-child(5) { min-width: 120px; }   /* 交易金额 */
.data-table th:nth-child(6) { min-width: 100px; }   /* 对手户名 */
.data-table th:nth-child(7) { min-width: 180px; }   /* 对手卡号 */
.data-table th:nth-child(8) { min-width: 80px; }    /* 层级 */
.data-table th:nth-child(9) { min-width: 100px; }   /* 测试行为 */
.data-table th:nth-child(10) { min-width: 120px; }  /* 生活轨迹 */
.data-table th:nth-child(11) { min-width: 80px; }   /* 标签 */

.data-table td:nth-child(1) { min-width: 80px; }    /* 序号 */
.data-table td:nth-child(2) { min-width: 180px; }   /* 交易卡号 */
.data-table td:nth-child(3) { min-width: 100px; }   /* 交易户名 */
.data-table td:nth-child(4) { min-width: 160px; }   /* 交易时间 */
.data-table td:nth-child(5) { min-width: 120px; }   /* 交易金额 */
.data-table td:nth-child(6) { min-width: 100px; }   /* 对手户名 */
.data-table td:nth-child(7) { min-width: 180px; }   /* 对手卡号 */
.data-table td:nth-child(8) { min-width: 80px; }    /* 层级 */
.data-table td:nth-child(9) { min-width: 100px; }   /* 测试行为 */
.data-table td:nth-child(10) { min-width: 120px; }  /* 生活轨迹 */
.data-table td:nth-child(11) { min-width: 80px; }   /* 标签 */

.data-table th {
  background: var(--bg-panel);
  color: var(--text-primary);
  padding: 15px 8px;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-style: solid;
  border-color: var(--border-color);
  border-width: 0 0 2px 0; /* 精确控制边框：上 右 下 左，彻底移除垂直线 */
  cursor: pointer;
  user-select: none;
  position: sticky; /* 粘性定位，随表格滚动 */
  top: 0;
  z-index: 10; /* z-index 不需要太高 */
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.data-table th:last-child {
  border-right: none;
}

.data-table th:hover {
  background: linear-gradient(135deg, var(--bg-panel), var(--bg-tertiary));
  color: var(--accent-color);
}

.data-table th i {
  margin-left: 4px;
  opacity: 0.6;
  font-size: 10px;
  transition: all 0.3s ease;
}

.data-table th:hover i {
  opacity: 1;
  color: var(--accent-color);
}

.data-table td {
  padding: 12px 8px;
  border-style: solid;
  border-color: var(--border-color);
  border-width: 0 0 1px 0; /* 精确控制边框：上 右 下 左，彻底移除垂直线 */
  color: var(--text-primary);
  transition: all 0.3s ease;
  vertical-align: middle;
  word-wrap: break-word;
  white-space: nowrap;
  font-size: 13px;
}

.data-table td:last-child {
  border-right: none;
}

/* 特定列的优化显示 */
.data-table td:nth-child(1) { 
  text-align: center; 
  font-weight: 700;
  color: var(--accent-color);
  font-size: 14px;
}

.data-table td:nth-child(2), 
.data-table td:nth-child(7) { 
  text-align: center; 
  font-family: 'Monaco', 'Consolas', 'SF Mono', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 14px 4px;
}

.data-table td:nth-child(3), 
.data-table td:nth-child(6) { 
  text-align: center;
  font-weight: 600;
  font-size: 13px;
}

.data-table td:nth-child(4) { 
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.data-table td:nth-child(5) { 
  text-align: center;
  font-weight: 700;
  font-size: 14px;
  color: #1e8449; /* 在亮色模式下使用深绿色，确保可读性 */
}

[data-theme="dark"] .data-table td:nth-child(5) {
  color: var(--accent-green); /* 在深色模式下使用原来的亮绿色 */
}

.data-table td:nth-child(8) { 
  text-align: center;
  padding: 14px 4px;
}

.data-table td:nth-child(9), 
.data-table td:nth-child(10) { 
  text-align: center;
  font-size: 12px;
}

.data-table td:nth-child(11) { 
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

.data-table tr:nth-child(even) {
  background: var(--bg-tertiary);
}

.data-table tr:hover {
  background: var(--bg-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

.data-table .row-checkbox {
  margin-right: 8px;
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--accent-color);
  vertical-align: middle;
}

/* 层级徽章二次优化 */
.layer-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 16px;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  min-width: 45px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.layer-badge.layer-头号卡 {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

.layer-badge.layer-中间层 {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
  box-shadow: 0 2px 8px rgba(243, 156, 18, 0.4);
}

.layer-badge.layer-客户卡 {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: white;
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.4);
}

.export-options {
  background: var(--bg-tertiary);
  padding: 16px 30px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
  position: relative;
  box-shadow: 0 -1px 3px rgba(38, 45, 57, 0.06);
}

.export-options::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent, 
    var(--accent-color), 
    transparent);
}

.export-options strong {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

.export-options strong i {
  color: var(--accent-color);
  font-size: 18px;
}

.export-options button {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: white;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-secondary);
  white-space: nowrap;
}

/* 全选按钮 - 蓝色 */
.export-options button:nth-of-type(1) {
  background: var(--accent-blue);
}

.export-options button:nth-of-type(1):hover {
  background: #093bae;
}

/* 取消选择按钮 - 灰色 */
.export-options button:nth-of-type(2) {
  background: #909399;
}

.export-options button:nth-of-type(2):hover {
  background: #73767a;
}

/* CSV导出按钮 - 绿色 */
.export-options button:nth-of-type(3) {
  background: var(--accent-green);
}

.export-options button:nth-of-type(3):hover {
  background: #176b02;
}

/* 复制表格按钮 - 橙色 */
.export-options button:nth-of-type(4) {
  background: var(--accent-orange);
}

.export-options button:nth-of-type(4):hover {
  background: #a35a07;
}

.export-options button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
}

/* 滚动条样式优化 */
.table-view-content ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-view-content ::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

.table-view-content ::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
  border-radius: 4px;
}

.table-view-content ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

/* 响应式设计二次优化 */
@media (max-width: 1600px) {
  .data-table {
    min-width: 1000px;
  }
  
  .data-table th,
  .data-table td {
    padding: 12px 6px;
    font-size: 12px;
  }
  
  .data-table th {
    font-size: 11px;
  }
  
  .layer-badge {
    font-size: 9px;
    padding: 3px 6px;
    min-width: 40px;
  }
}

@media (max-width: 1200px) {
  .table-view-content {
    width: 98%;
  }
  
  .table-view-header {
    padding: 18px 25px;
  }
  
  .table-stats,
  .filter-row,
  .export-options {
    padding: 14px 25px;
  }
  
  .filter-row {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
  }
  
  .table-container {
    max-height: 55vh;
  }
  
  .data-table {
    min-width: 1200px;
  }
  
  .data-table th,
  .data-table td {
    padding: 10px 8px;
    font-size: 12px;
  }
  
  .data-table th {
    font-size: 11px;
  }
  
  .layer-badge {
    font-size: 10px;
    padding: 3px 6px;
    min-width: 40px;
  }
}

@media (max-width: 768px) {
  .table-view-content {
    width: 98%;
    height: 95%;
    border-radius: 16px;
  }
  
  .table-view-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: 16px;
    border-radius: 16px 16px 0 0;
  }
  
  .table-view-title {
    font-size: 18px;
  }
  
  .table-view-controls {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .table-view-controls button {
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .table-stats,
  .filter-row,
  .export-options {
    padding: 12px 16px;
  }
  
  .filter-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .export-options {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
  }
  
  .export-options strong {
    display: none;
  }
  
  .export-options button {
    justify-content: center;
    white-space: nowrap;
    min-width: auto;
    padding: 8px 12px;
    font-size: 12px;
  }
  
  .data-table {
    min-width: 600px;
  }
  
  .data-table th,
  .data-table td {
    padding: 8px 4px;
    font-size: 10px;
  }
  
  .data-table th {
    font-size: 9px;
  }
  
  .layer-badge {
    font-size: 7px;
    padding: 2px 4px;
    min-width: 30px;
  }
  
  /* 移动端隐藏部分列以节省空间 */
  .data-table th:nth-child(2),
  .data-table td:nth-child(2),
  .data-table th:nth-child(7),
  .data-table td:nth-child(7),
  .data-table th:nth-child(11),
  .data-table td:nth-child(11) {
    display: none;
  }
  
  /* 重新分配剩余列的宽度 */
  .data-table th:nth-child(1) { width: 8%; }
  .data-table th:nth-child(3) { width: 12%; }
  .data-table th:nth-child(4) { width: 18%; }
  .data-table th:nth-child(5) { width: 15%; }
  .data-table th:nth-child(6) { width: 12%; }
  .data-table th:nth-child(8) { width: 12%; }
  .data-table th:nth-child(9) { width: 11%; }
  .data-table th:nth-child(10) { width: 12%; }
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* 响应式设计 */
@media (max-width: 600px) {
  .custom-dialog {
    width: 95%;
    margin: 20px;
  }

  .custom-dialog-content {
    padding: 20px;
  }

  .custom-dialog-actions {
    padding: 12px 20px 20px;
    flex-direction: column;
  }

  .custom-dialog-actions button {
    width: 100%;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    min-width: auto;
    margin-bottom: 10px;
  }

  .theme-toggle {
    position: static;
    margin: 10px;
    justify-content: center;
    flex-direction: row;
    flex-wrap: nowrap;
    padding: 4px;
    gap: 2px;
  }

  .theme-toggle-btn {
    font-size: 11px;
    padding: 6px 10px;
  }

  .floating-controls {
    right: 10px;
    gap: 8px;
  }

  .floating-panel.expanded {
    max-width: 280px;
  }

  .floating-content {
    padding: 15px;
  }
}

/* 控制组样式 */
.controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.control-group label {
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 60px;
  font-size: 14px;
}

.control-group select,
.control-group input {
  flex: 1;
  min-width: 120px;
}

/* 数据源区域样式 */
.data-source-area {
  margin-bottom: 20px;
  padding: 15px;
  background: var(--bg-panel);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.data-source-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-source-area .controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.data-source-area .control-group {
  width: 100%;
}

.data-source-area .btn-upload,
.data-source-area .btn-static,
.data-source-area .btn-table {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white !important; /* 强制白色文字 */
}

.data-source-area .btn-upload i,
.data-source-area .btn-static i,
.data-source-area .btn-table i {
  color: white !important; /* 强制白色图标 */
}

.data-source-area .btn-upload {
  background: linear-gradient(135deg, var(--accent-color), #e67e22);
}

.data-source-area .btn-upload:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.data-source-area .btn-static {
  background: linear-gradient(135deg, var(--primary-color), #8e44ad);
}

.data-source-area .btn-static:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(155, 89, 182, 0.4);
}

.data-source-area .btn-table {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.data-source-area .btn-table:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

/* 状态指示器样式 */
.status-connected {
  color: var(--accent-green);
}

.status-disconnected {
  color: var(--accent-red);
}

.status-none {
  color: var(--text-muted);
}

/* 信息项样式 */
.info-item {
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 0px;
}

.info-label {
  font-weight: 500;
  color: var(--text-secondary);
  min-width: 80px;
}

.info-tip {
  margin-top: 15px;
  padding: 10px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent-blue);
}

/* 汇总项样式 */
.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

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

.text-visible-count {
  color: var(--accent-green);
  font-weight: 600;
}

.text-hidden-count {
  color: var(--text-muted);
  font-weight: 600;
}

.text-visible-amount {
  color: var(--accent-green);
  font-weight: 600;
}

/* 搜索框容器样式 */
.search-box-container {
  position: relative;
  flex: 1;
  min-width: 250px;
}

.search-box-container i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-box-container .search-box {
  padding-left: 36px;
}

/* =====================
   详细加载模态框样式
   ===================== */
.loading-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: none;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.loading-content {
  background: var(--bg-panel);
  padding: 40px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-primary);
  max-width: 500px;
  width: 90%;
  text-align: center;
  animation: fadeInScale 0.3s ease-out;
}

.loading-spinner {
  margin-bottom: 30px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--accent-blue);
  border-radius: 50%;
  margin: 0 auto;
  animation: spin 1s linear infinite;
}

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

@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.loading-steps {
  margin-bottom: 25px;
}

.loading-step {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 20px;
  margin: 8px 0;
  border-radius: 10px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  transition: all 0.3s ease;
  opacity: 0.5;
}

.loading-step.active {
  background: var(--accent-blue);
  color: white;
  opacity: 1;
  box-shadow: 0 2px 10px rgba(74, 144, 226, 0.3);
}

.loading-step.completed {
  background: var(--accent-green);
  color: white;
  opacity: 1;
}

.loading-step.error {
  background: var(--accent-red);
  color: white;
  opacity: 1;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.loading-step i {
  margin-right: 12px;
  width: 20px;
  text-align: center;
}

.loading-message {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 20px;
  font-weight: 500;
}

.loading-tips {
  background: var(--bg-tertiary);
  padding: 15px;
  border-radius: 10px;
  border-left: 4px solid var(--accent-blue);
  color: var(--text-secondary);
  font-size: 14px;
  text-align: left;
}

.loading-tips i {
  color: var(--accent-blue);
  margin-right: 8px;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  
  .sidebar {
    height: auto;
    max-height: 300px;
  }
  
  .main-content {
    height: calc(100vh - 320px);
  }
  
  .node-info,
  .transaction-details {
    width: calc(100% - 40px);
    left: 20px;
    right: 20px;
  }

  .loading-content {
    padding: 30px 20px;
    margin: 20px;
  }
  
  .loading-step {
    padding: 10px 15px;
    font-size: 14px;
  }
  
  .loading-message {
    font-size: 14px;
  }
}

/* 悬浮数据源选择区域样式 */
.floating-data-source {
  position: fixed;
  top: 80px;
  left: 20px;
  width: 280px;
  background: var(--bg-tertiary);
  border-radius: 15px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  z-index: 999;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.floating-data-source-header {
  background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
  border-radius: 15px 15px 0 0;
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  user-select: none;
}

.drag-handle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

.drag-handle i {
  font-size: 12px;
  opacity: 0.8;
}

.minimize-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
}

.minimize-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.floating-data-source-content {
  padding: 20px;
  transition: all 0.3s ease;
}

.floating-data-source.minimized .floating-data-source-content {
  display: none;
}

.floating-data-source.minimized {
  width: auto;
  min-width: 150px;
}

.floating-data-source.minimized .minimize-btn i:before {
  content: "\f067"; /* plus icon */
}

.floating-data-source .data-source-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.floating-data-source .controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.floating-data-source .control-group {
  width: 100%;
}

.floating-data-source .btn-upload,
.floating-data-source .btn-static,
.floating-data-source .btn-table {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.floating-data-source .btn-upload {
  background: linear-gradient(135deg, var(--accent-color), #e67e22);
  color: white;
}

.floating-data-source .btn-upload:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.floating-data-source .btn-static {
  background: linear-gradient(135deg, var(--primary-color), #8e44ad);
  color: white;
}

.floating-data-source .btn-static:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(155, 89, 182, 0.4);
}

/* 动画补充 */
@keyframes contentSlideIn {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
} 