/* AI构建交易网络图谱样式文件 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* body 样式已移至 theme-styles.css 统一管理 */
/*
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: #333;
  overflow: hidden;
}
*/

/* .container 样式已移至 theme-styles.css 统一管理 */

.sidebar {
  width: 320px;
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  overflow-y: auto;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

/* .main-content 样式已移至 theme-styles.css 统一管理 */

#network {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%);
}

.panel {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.panel h3 {
  margin-bottom: 15px;
  color: #2c3e50;
  font-size: 18px;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 15px;
}

.stat-item {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
}

.stat-value {
  font-size: 20px;
  font-weight: bold;
  display: block;
}

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

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

button {
  background: linear-gradient(45deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  flex: 1;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

select,
input {
  padding: 8px 12px;
  border-radius: 6px;
  border: 2px solid #e1e5e9;
  font-size: 14px;
  transition: border-color 0.3s ease;
  flex: 1;
}

select:focus,
input:focus {
  outline: none;
  border-color: #667eea;
}

.legend {
  display: grid;
  gap: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  padding: 8px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 6px;
}

.legend-circle,
.legend-square {
  width: 16px;
  height: 16px;
  margin-right: 12px;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.legend-square {
  border-radius: 3px;
}

.legend-line {
  width: 24px;
  height: 3px;
  margin-right: 12px;
  border-radius: 2px;
}

.node-info {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 350px;
  min-width: 280px;
  display: none;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1000;
}

.node-info h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 18px;
}

.info-item {
  margin: 10px 0;
  padding: 8px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 6px;
  font-size: 14px;
}

.info-label {
  font-weight: 600;
  color: #2c3e50;
}

.layer-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  color: white;
  margin-left: 5px;
}

.layer-头号卡 {
  background-color: #e74c3c;
  box-shadow: 0 1px 3px rgba(231, 76, 60, 0.3);
}

.layer-中间层 {
  background-color: #f39c12;
  box-shadow: 0 1px 3px rgba(243, 156, 18, 0.3);
}

.layer-客户卡 {
  background-color: #2ecc71;
  box-shadow: 0 1px 3px rgba(46, 204, 113, 0.3);
}

.layer-未知 {
  background-color: #95a5a6;
  box-shadow: 0 1px 3px rgba(149, 165, 166, 0.3);
}

.toolbar {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255, 255, 255, 0.95);
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  z-index: 1000;
}

.search-box {
  width: 250px;
  padding: 10px;
  border-radius: 8px;
  border: 2px solid #e1e5e9;
  font-size: 14px;
}

.highlight {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
  }
}

.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 18px;
  z-index: 1000;
}

.data-source-info {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 15px;
  font-size: 13px;
  color: #059669;
}

.data-source-info strong {
  color: #047857;
}

.transaction-details {
  position: absolute;
  top: 100px;
  left: 20px;
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 450px;
  min-width: 400px;
  max-height: 70vh;
  overflow-y: auto;
  display: none;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 1001;
}

.transaction-details h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  font-size: 18px;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
}

.transaction-summary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 14px;
}

.transaction-summary .summary-item {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
}

.transaction-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.transaction-item {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  position: relative;
  transition: all 0.3s ease;
}

.transaction-item.hidden {
  background: #f1f2f6;
  border-color: #ced6e0;
  opacity: 0.6;
}

.transaction-item.hidden .transaction-amount {
  text-decoration: line-through;
  color: #95a5a6;
}

.transaction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.transaction-amount {
  font-size: 16px;
  font-weight: bold;
  color: #2c3e50;
}

.transaction-toggle {
  background: #3498db;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  min-width: 60px;
  transition: all 0.3s ease;
  font-weight: 500;
  flex:0;
}

.transaction-toggle:hover {
  background: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.transaction-toggle.hidden {
  background: #95a5a6;
}

.transaction-toggle.hidden:hover {
  background: #7f8c8d;
}

.transaction-info {
  font-size: 13px;
  color: #7f8c8d;
  line-height: 1.4;
}

.transaction-controls {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e9ecef;
}

.transaction-controls button {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
}

/* 新增的样式类 - 用于替换内联样式 */
.data-source-area {
  margin: 15px 0;
  padding: 12px;
  background: rgba(52, 152, 219, 0.1);
  border-radius: 8px;
}

.data-source-title {
  margin-bottom: 10px;
  font-weight: 600;
  color: #2c3e50;
}

.btn-api {
  background: linear-gradient(45deg, #e74c3c, #c0392b) !important;
}

.btn-upload {
  background: linear-gradient(45deg, #27ae60, #229954) !important;
}

.btn-static {
  background: linear-gradient(45deg, #8e44ad, #7d3c98) !important;
}

.connection-status {
  margin-top: 10px;
  padding: 8px;
  background: rgba(149, 165, 166, 0.1);
  border-radius: 6px;
  font-size: 12px;
}

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

.status-row + .status-row {
  margin-top: 5px;
}

.status-label {
  font-weight: 600;
}

.status-checking {
  font-weight: 600;
}

.status-static {
  font-weight: 600;
  color: #8e44ad;
}

.legend-red {
  background: #e74c3c;
}

.legend-orange {
  background: #f39c12;
}

.legend-green {
  background: #2ecc71;
}

.legend-line-red {
  background: #e74c3c;
  height: 4px;
}

.legend-line-green {
  background: #2ecc71;
  height: 4px;
}

.legend-line-purple {
  background: #8e44ad;
  height: 4px;
}

.legend-line-gray {
  background: #95a5a6;
}

.error-message {
  color: #e74c3c;
  text-align: center;
  padding: 20px;
}

.reload-button {
  background: linear-gradient(45deg, #e74c3c, #c0392b);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 10px;
}

.error-tips {
  margin-top: 15px;
  font-size: 14px;
  color: #7f8c8d;
}

.info-tip {
  margin-top: 10px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 12px;
  color: #6c757d;
}

.text-success {
  color: #2ecc71;
}

.text-danger {
  color: #e74c3c;
}

.margin-top-8 {
  margin-top: 8px;
}

/* 更多新增的样式类 */
.api-instructions {
  margin-top: 10px;
  padding: 10px;
  background: rgba(230, 126, 34, 0.1);
  border-radius: 6px;
  font-size: 12px;
  color: #2c3e50;
}

.cors-warning {
  margin-top: 10px;
  padding: 10px;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 6px;
  font-size: 12px;
  color: #c0392b;
}

.cors-solutions-btn {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  margin-right: 8px;
}

.download-local-btn {
  background: #27ae60;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
}

.search-btn {
  margin-left: 10px;
  padding: 8px 16px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}

.reset-btn {
  margin-left: 5px;
  padding: 8px 16px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}

/* JavaScript 中使用的动态样式类 */
.font-weight-600 {
  font-weight: 600;
}

.legend-line-gray {
  background: #95a5a6;
}

/* 错误页面样式 */
.error-page {
  color: #e74c3c;
  text-align: center;
  padding: 20px;
}

.reload-page-btn {
  background: linear-gradient(45deg, #e74c3c, #c0392b);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  margin-top: 10px;
}

.error-page-tips {
  margin-top: 15px;
  font-size: 14px;
  color: #7f8c8d;
}

/* JavaScript 模板字符串中使用的样式类 */
.text-visible-count {
  color: #2ecc71;
}

.text-hidden-count {
  color: #e74c3c;
}

.text-visible-amount {
  color: #2ecc71;
}

/* 图例样式 */
.legend-line-diagonal {
  background: #8e44ad;
  height: 3px;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2px,
    #8e44ad 2px,
    #8e44ad 6px
  );
}

.usage-tips {
  margin-top: 15px;
  padding: 10px;
  background: rgba(52, 152, 219, 0.1);
  border-radius: 6px;
  font-size: 12px;
  color: #2c3e50;
}

/* 表格视图样式 */
.table-view-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-view-content {
  background: white;
  padding: 20px;
  border-radius: 8px;
  max-width: 95vw;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table-view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.table-view-title {
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
}

.table-view-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.table-view-controls button {
  background: #3498db;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

.table-view-controls button:hover {
  background: #2980b9;
}

.table-view-controls button.close-btn {
  background: #e74c3c;
}

.table-view-controls button.close-btn:hover {
  background: #c0392b;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 10px;
}

.data-table th,
.data-table td {
  padding: 14px 12px;
  text-align: left;
  border-bottom: 1px solid var(--table-border-color);
  white-space: nowrap;
}

.data-table th {
  background-color: var(--table-header-bg);
  color: var(--header-text-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table tr:nth-child(even) {
  background: #f8f9fa;
}

.data-table tr:hover {
  background-color: var(--table-row-hover-bg);
  color: var(--text-color);
}

/* 确保表头在行悬停时背景色不变 */
.data-table tr:hover th {
  background-color: var(--table-header-bg);
}

.table-stats {
  margin-bottom: 10px;
  padding: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  font-size: 12px;
  color: #666;
  display: flex;
  justify-content: space-between;
}

.filter-row {
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-row input,
.filter-row select {
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
}

.export-options {
  margin-top: 10px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 4px;
  border-top: 1px solid #ddd;
  width:200px;
}

.export-options button {
  background: #27ae60;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-right: 8px;
}

.export-options button:hover {
  background: #229954;
}