/* ========== Co-expression 页面整体 ========== */
main.container {
  max-width: 1800px;
  margin: 24px auto;
  padding: 26px 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.96));
  border-radius: 14px;
  box-shadow:
    0 14px 34px rgba(23, 54, 77, 0.09),
    0 1px 4px rgba(60, 80, 160, 0.04);
  border: 1px solid rgba(32, 112, 142, 0.12);
}

/* ========== 选择器区域 ========== */
main.container .selector {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 22px;
  padding: 18px 22px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 50%, #f5f0ff 100%);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(79, 109, 212, 0.08);
}

main.container .selector label {
  color: #3a4f8a;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-right: 6px;
  font-size: 20px;
}

/* 下拉框 */
main.container .selector select,
main.container .selector input[type="text"],
main.container .selector input[type="number"] {
  padding: 8px 14px;
  font-size: 20px;
  border: 2px solid #d0d7f0;
  border-radius: 10px;
  background: #fff;
  transition: all 0.25s ease;
  color: #333;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

main.container .selector select {
  padding: 8px 36px 8px 12px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6fc4' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  min-width: 170px;
}

main.container #species-select,
main.container #bioproject-select,
main.container #gene-input,
main.container #threshold-input,
main.container #topn-input {
  padding: 8px 14px;
  font-size: 20px;
  border: 2px solid #d0d7f0;
  border-radius: 10px;
  background-color: #fff;
  transition: all 0.25s ease;
  color: #333;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}

main.container #species-select,
main.container #bioproject-select {
  padding: 8px 36px 8px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6fc4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

main.container .selector input[type="text"] {
  min-width: 220px;
}

main.container .selector input[type="number"] {
  min-width: 90px;
  width: 100px;
}

main.container .selector select:hover,
main.container .selector input[type="text"]:hover,
main.container .selector input[type="number"]:hover {
  border-color: #8fa4e8;
  box-shadow: 0 2px 10px rgba(79, 109, 212, 0.12);
}

main.container .selector select:focus,
main.container .selector input[type="text"]:focus,
main.container .selector input[type="number"]:focus {
  outline: none;
  border-color: #5b6fd4;
  box-shadow: 0 0 0 3px rgba(91, 111, 212, 0.12);
}

main.container .selector input::placeholder {
  color: #aab2c5;
  font-size: 20px;
}

.gene-tip {
  color: #7a8ba3;
  font-size: 13px;
  margin-top: 4px;
  display: block;
  width: 100%;
  font-style: italic;
}

/* 阈值 / Top N 行 */
.threshold-topn {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 4px;
}

/* 搜索按钮 */
main.container #search-btn {
  padding: 9px 24px;
  background: linear-gradient(135deg, #5b8def, #4a7de0);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.25s ease;
  box-shadow: 0 3px 10px rgba(79, 109, 212, 0.25);
}

main.container #search-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(79, 109, 212, 0.32);
  background: linear-gradient(135deg, #4a7de0, #3e6dd4);
}

main.container #search-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(79, 109, 212, 0.2);
}

/* ========== 图表区域 ========== */
.plot-container {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(235, 247, 255, 0.95));
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 26px;
  box-shadow:
    0 16px 36px rgba(23, 54, 77, 0.1),
    0 1px 3px rgba(60, 80, 160, 0.03);
  border: 1px solid rgba(32, 112, 142, 0.14);
}

.plot-container::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #23a6b7, #4f8fe8, #7bbf8a);
}

.plot-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding-bottom: 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(32, 112, 142, 0.12);
}

.section-kicker {
  display: inline-flex;
  margin-bottom: 6px;
  color: #067485;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plot-container h3 {
  margin: 0 0 8px 0;
  color: #12374d;
  font-size: 26px;
  font-weight: 850;
  letter-spacing: 0;
}

.plot-container p {
  font-size: 16px;
  color: #496d84;
  margin: 0;
}

.network-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.network-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #496d84;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(32, 112, 142, 0.12);
  font-size: 14px;
  font-weight: 700;
}

.network-stats strong {
  color: #075f6e;
  font-size: 22px;
  line-height: 1;
}

.network-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  color: #496d84;
  font-size: 14px;
  font-weight: 700;
}

.network-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(32, 112, 142, 0.1);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.hub {
  background: #ff7a45;
  box-shadow: 0 0 0 4px rgba(255, 122, 69, 0.16);
}

.legend-dot.related {
  background: #4f8fe8;
  box-shadow: 0 0 0 4px rgba(79, 143, 232, 0.14);
}

.legend-line {
  width: 24px;
  height: 3px;
  border-radius: 999px;
  display: inline-block;
}

.legend-line.positive {
  background: #e85858;
}

.legend-line.negative {
  background: #3f7fe8;
}

#network {
  margin-top: 10px;
  border-radius: 12px;
  overflow: hidden;
  min-height: 560px;
  background:
    radial-gradient(circle at 18% 18%, rgba(35, 166, 183, 0.11), transparent 26%),
    radial-gradient(circle at 82% 20%, rgba(79, 143, 232, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(250, 253, 255, 0.96), rgba(243, 249, 255, 0.98));
  border: 1px solid rgba(32, 112, 142, 0.12);
  box-shadow: inset 0 1px 8px rgba(23, 54, 77, 0.04);
}

/* ========== 表格区域 ========== */
main.container > h3 {
  margin: 24px 0 12px 8px;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, #2c3e80, #5b6fd4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.3px;
}

.table-container {
  max-height: 420px;
  overflow-y: auto;
  overflow-x: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow:
    0 3px 16px rgba(60, 80, 160, 0.07),
    0 1px 3px rgba(60, 80, 160, 0.03);
  border: 1px solid rgba(150, 175, 220, 0.12);
}

.table-container::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-container::-webkit-scrollbar-track {
  background: #f4f6fb;
  border-radius: 0 14px 14px 0;
}

.table-container::-webkit-scrollbar-thumb {
  background: #c9d4ee;
  border-radius: 5px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: #aab9de;
}

/* 表格 */
#expression-table {
  width: 100%;
  border-collapse: collapse;
}

#expression-table thead tr {
  position: sticky;
  top: 0;
  z-index: 2;
}

#expression-table thead th {
  background: linear-gradient(135deg, #3b6fd4, #5b8def);
  color: #fff;
  padding: 13px 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-bottom: none;
}

#expression-table td {
  padding: 11px 14px;
  text-align: center;
  font-size: 15px;
  border-bottom: 1px solid #e8edf6;
  color: #333;
  transition: background 0.2s ease;
}

#expression-table tbody tr:nth-child(even) td {
  background: #f8faff;
}

#expression-table tbody tr:hover td {
  background: #eef3ff !important;
}

#expression-table .empty {
  text-align: center;
  color: #7a8ba3;
  padding: 40px 20px;
  font-size: 15px;
  font-style: italic;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  main.container {
    padding: 16px 14px;
    margin: 12px;
  }

  main.container .selector {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 16px;
  }

  main.container .selector select,
  main.container .selector input[type="text"],
  main.container .selector input[type="number"] {
    width: 100%;
  }

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

  main.container #search-btn {
    width: 100%;
  }

  #network {
    min-height: 420px;
  }

  .plot-header {
    display: grid;
  }

  .network-stats {
    justify-content: flex-start;
  }
}
