/* 可转债数据看板 - 优化版样式 */

/* ===== 全局样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 现代简约配色方案 */
  --primary-color: #007bff;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --text-color: #333;
  --text-light: #666;
  --border-color: #dee2e6;
  --bg-light: #f8f9fa;
  --bg-white: #fff;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.15);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg-light);
  color: var(--text-color);
  line-height: 1.4;
  font-size: 12px;
}

.container {
  max-width: 100%;
  margin: 0;
  padding: 10px;
}

/* ===== 页面头部 ===== */
.header {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  padding: 15px 20px;
  border-radius: 6px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-md);
}

.header h1 {
  font-size: 18px;
  margin-bottom: 12px;
  font-weight: 600;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.15);
  padding: 8px 12px;
  border-radius: 4px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.stat-label {
  display: block;
  font-size: 11px;
  opacity: 0.9;
  margin-bottom: 3px;
}

.stat-value {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

/* ===== 筛选区域 - 紧凑型 ===== */
.filter-section {
  background: var(--bg-white);
  padding: 12px 15px;
  border-radius: 6px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  max-width: 100%;
  overflow-x: auto;
}

.filter-section h2 {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-color);
  font-weight: 600;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  align-items: flex-start;
  grid-template-rows: auto auto auto;
  grid-auto-flow: row;
}

.filter-item label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-light);
}

.range-input {
  display: flex;
  align-items: center;
  gap: 5px;
}

.range-input input,
.filter-item select,
.filter-item input {
  flex: 1;
  padding: 4px 6px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-size: 10px;
  transition: border-color 0.2s;
  min-height: 22px;
  box-sizing: border-box;
  max-width: 70px;
}

.range-input input:focus,
.filter-item select:focus,
.filter-item input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.range-input span {
  color: #999;
  font-size: 11px;
}

/* ===== 按钮样式 - 紧凑型 ===== */
.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.btn {
  padding: 6px 14px;
  border: none;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: #3a7bc8;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-refresh {
  background-color: var(--success-color);
  color: white;
}

.btn-refresh:hover {
  background-color: #4cae4c;
}

.result-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-light);
}

.result-count strong {
  color: var(--primary-color);
  font-size: 14px;
}

/* ===== 数据表格 - 紧凑型 ===== */
.table-section {
  background: var(--bg-white);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.table-container {
  overflow-x: auto;
  max-height: calc(100vh - 350px);
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.data-table thead {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table th {
  padding: 8px 6px;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background-color 0.2s;
  font-size: 11px;
}

.data-table th:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.data-table th:last-child {
  cursor: default;
}

.sort-icon {
  margin-left: 3px;
  opacity: 0.6;
  font-size: 10px;
}

.sort-icon::after {
  content: "⇅";
}

.data-table th.sort-asc .sort-icon::after {
  content: "▲";
  opacity: 1;
}

.data-table th.sort-desc .sort-icon::after {
  content: "▼";
  opacity: 1;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s;
}

.data-table tbody tr:hover {
  background-color: #f8f9fa;
}

.data-table tbody tr.expanded {
  background-color: #e3f2fd;
}

.data-table td {
  padding: 6px 6px;
  white-space: nowrap;
  font-size: 11px;
}

.data-table td.loading {
  text-align: center;
  padding: 30px;
  color: #999;
  font-size: 12px;
}

/* 数值颜色 - 红涨绿跌 */
.rise {
  color: #d9534f;
  font-weight: 600;
}

.fall {
  color: #5cb85c;
  font-weight: 600;
}

.neutral {
  color: #999;
}

/* 行点击效果 */
.data-table tbody tr.clickable {
  cursor: pointer;
}

.data-table tbody tr.clickable:hover {
  background-color: #e8f4ff !important;
}

/* 操作按钮 */
.action-btn {
  padding: 4px 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  transition: all 0.2s;
}

.action-btn:hover {
  background-color: #0056b3;
  transform: scale(1.05);
}

/* ===== 详情展开区域 ===== */
.detail-row {
  background-color: #f8f9fa;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
}

.detail-container {
  padding: 2px 4px;
  font-size: 10px;
  line-height: 1.2;
  max-width: 100%;
  margin: 0;
}

.detail-content-simple {
  word-break: break-all;
  color: #333;
}

.detail-content-simple > div {
  margin-bottom: 6px;
}

.detail-content-simple strong {
  margin-right: 4px;
}

.detail-content-simple span {
  margin-right: 25px;
  display: inline-block;
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
  padding-bottom: 0;
  font-size: 8px;
}

.detail-title {
  font-weight: 600;
  color: #333;
  display: none; /* 隐藏标题 */
}

.close-detail {
  padding: 0 2px;
  background-color: #f0f0f0;
  color: #666;
  border: none;
  border-radius: 1px;
  cursor: pointer;
  font-size: 7px;
  line-height: 1;
  height: 10px;
  min-width: 20px;
}

.close-detail:hover {
  background-color: #e0e0e0;
}


/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
  .container {
    padding: 5px;
  }

  .header h1 {
    font-size: 16px;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .data-table {
    font-size: 10px;
  }

  .data-table th,
  .data-table td {
    padding: 4px 3px;
  }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

/* ===== 概念热力图样式 ===== */
.heatmap-section {
  background: var(--bg-white);
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.heatmap-section h2 {
  margin-bottom: 10px;
  color: var(--text-color);
  font-size: 14px;
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 5px;
}

.concept-heatmap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 4px;
  min-height: 150px;
  position: relative;
}

.concept-heatmap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent 25%, rgba(255,255,255,0.1) 50%, transparent 75%);
  background-size: 8px 8px;
  opacity: 0.3;
  pointer-events: none;
}

.concept-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  font-size: 11px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  min-height: 40px;
  padding: 8px 6px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.concept-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.2) 50%, transparent 100%);
  transition: left 0.5s;
}

.concept-item:hover::before {
  left: 100%;
}

.concept-item:hover {
  transform: scale(1.05) translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  z-index: 1;
  border-color: rgba(255,255,255,0.4);
}

.concept-name {
  color: white;
  font-weight: 600;
  font-size: 10px;
  text-align: center;
  margin: 4px 0 2px;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.concept-volume {
  color: rgba(255,255,255,0.95);
  font-size: 8px;
  background: rgba(255,255,255,0.15);
  padding: 2px 4px;
  border-radius: 10px;
  margin: 2px 0;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.2);
  font-weight: 500;
}

/* 基于成交额大小的动态尺寸 - 确保不重叠 */
.concept-item.size-xs {
  min-width: 80px;
  max-width: 80px;
  font-size: 9px;
  min-height: 35px;
  padding: 6px 4px;
}

.concept-item.size-sm {
  min-width: 120px;
  max-width: 120px;
  font-size: 10px;
  min-height: 40px;
  padding: 7px 5px;
}

.concept-item.size-md {
  min-width: 160px;
  max-width: 160px;
  font-size: 11px;
  min-height: 45px;
  padding: 8px 6px;
}

.concept-item.size-lg {
  min-width: 200px;
  max-width: 200px;
  font-size: 12px;
  min-height: 50px;
  padding: 9px 7px;
}

.concept-item.size-xl {
  min-width: 240px;
  max-width: 240px;
  font-size: 13px;
  min-height: 55px;
  padding: 10px 8px;
}

/* 基于热度的颜色渐变 */
.concept-item.hot {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.concept-item.warm {
  background: linear-gradient(135deg, #ffa726 0%, #ff9800 100%);
}

.concept-item.cool {
  background: linear-gradient(135deg, #42a5f5 0%, #1e88e5 100%);
}

.concept-item.cold {
  background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
}

/* 活跃概念的样式 */
.concept-item.active {
  border: 2px solid #007bff;
  transform: scale(1.05);
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.concept-item.active .concept-active-indicator {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #007bff;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: bold;
  animation: pulse 2s infinite;
}

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

.concept-heatmap .no-data {
  text-align: center;
  color: var(--text-light);
  font-style: italic;
  width: 100%;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

.concept-heatmap.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .concept-heatmap {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 3px;
    padding: 8px 0;
    min-height: 120px;
  }

  .concept-item {
    font-size: 10px;
    min-height: 35px;
    padding: 6px 4px;
  }

  .concept-name {
    font-size: 9px;
    margin: 3px 0 1px;
  }

  .concept-volume {
    font-size: 7px;
    padding: 1px 3px;
  }

  .concept-item.size-xs { min-width: 70px; max-width: 100px; font-size: 8px; min-height: 30px; }
  .concept-item.size-sm { min-width: 100px; max-width: 130px; font-size: 9px; min-height: 35px; }
  .concept-item.size-md { min-width: 130px; max-width: 160px; font-size: 10px; min-height: 40px; }
  .concept-item.size-lg { min-width: 160px; max-width: 190px; font-size: 11px; min-height: 45px; }
  .concept-item.size-xl { min-width: 190px; max-width: 220px; font-size: 12px; min-height: 50px; }
}

@media (max-width: 480px) {
  .concept-heatmap {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 2px;
    padding: 6px 0;
    min-height: 100px;
  }

  .concept-item {
    font-size: 9px;
    min-height: 30px;
    padding: 4px 3px;
  }

  .concept-name {
    font-size: 8px;
    margin: 2px 0 1px;
  }

  .concept-volume {
    font-size: 6px;
    padding: 1px 2px;
  }
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.concept-item {
  animation: fadeInUp 0.4s ease-out;
}

.concept-item:nth-child(1) { animation-delay: 0.05s; }
.concept-item:nth-child(2) { animation-delay: 0.1s; }
.concept-item:nth-child(3) { animation-delay: 0.15s; }
.concept-item:nth-child(4) { animation-delay: 0.2s; }
.concept-item:nth-child(5) { animation-delay: 0.25s; }
.concept-item:nth-child(6) { animation-delay: 0.3s; }
.concept-item:nth-child(7) { animation-delay: 0.35s; }
.concept-item:nth-child(8) { animation-delay: 0.4s; }
.concept-item:nth-child(9) { animation-delay: 0.45s; }
.concept-item:nth-child(10) { animation-delay: 0.5s; }

/* 工具提示样式 */
.concept-item:hover .concept-name {
  transform: scale(1.05);
}

.concept-item:hover .concept-volume {
  transform: scale(1.1);
}

/* ===== 辅助类 ===== */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.font-bold {
  font-weight: 600;
}
