/* 可转债研究台 MVP 样式 */
:root {
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #1f2937;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

header h1 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--primary);
}

header nav a {
  margin-left: 1.25rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
}

header nav a:hover,
header nav a.active {
  color: var(--primary);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.section-title {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.summary-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.summary-card .label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.summary-card .value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.summary-card .unit {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.summary-card .fin-date {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
  opacity: 0.75;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  color: var(--text);
}

.chart {
  width: 100%;
  height: 320px;
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 900px) {
  .chart-row {
    grid-template-columns: 1fr 1fr;
  }
}

.loading {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
}

.error {
  background: #fee2e2;
  color: #991b1b;
  padding: 1rem;
  border-radius: 0.5rem;
  margin: 1rem 0;
}

/* 表格 */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 0.75rem;
  overflow: hidden;
  font-size: 0.9rem;
}

th, td {
  padding: 0.6rem 0.75rem;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f9fafb;
  font-weight: 600;
  color: var(--text-secondary);
  position: sticky;
  top: 0;
  cursor: pointer;
  user-select: none;
}

tr:hover {
  background: #f9fafb;
}

td:first-child, th:first-child {
  text-align: left;
}

a.code-link {
  color: var(--primary);
  text-decoration: none;
}

a.code-link:hover {
  text-decoration: underline;
}

.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.filters input,
.filters select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 0.9rem;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.pagination button {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 0.375rem;
  cursor: pointer;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 个券详情页 */
.bond-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.bond-header h2 {
  margin: 0 0 0.5rem 0;
  display: inline-block;
}

.style-tag, .rating-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

.style-bond {
  background: #dbeafe;
  color: #1e40af;
}

.style-balance {
  background: #fef3c7;
  color: #92400e;
}

.style-equity {
  background: #d1fae5;
  color: #065f46;
}

.rating-tag {
  background: #f3f4f6;
  color: #4b5563;
}

.industry-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: 0.5rem;
  background: #ede9fe;
  color: #5b21b6;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.member-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.member-chip {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  color: var(--text-primary, #111827);
  text-decoration: none;
  font-size: 0.8rem;
  font-family: monospace;
  background: var(--card-bg);
}

.member-chip:hover {
  border-color: var(--mint, #34d399);
}

.btn-back {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
}

.btn-back:hover {
  color: var(--primary);
  border-color: var(--primary);
}

/* 筛选器 */
.filter-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-row label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  min-width: 4.5rem;
  white-space: nowrap;
}

.filter-row input,
.filter-row select {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-size: 0.9rem;
}

.filter-row span {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  grid-column: 1 / -1;
}

.filter-actions button {
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.9rem;
}

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

/* 异动页小表格 */
.small-table {
  font-size: 0.85rem;
}

.small-table th,
.small-table td {
  padding: 0.4rem 0.5rem;
}

.muted {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.notice code {
  background: #dbeafe;
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
  font-family: monospace;
}

/* 个券页概况卡（2026-10-09）：标签列弱化、全部左对齐，不用全局 th 样式 */
.profile-table td {
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.profile-table td.p-label {
  color: var(--text-secondary);
  white-space: nowrap;
  width: 10%;
}
.profile-table tr:hover {
  background: transparent;
}
