/* AI 投研页面样式 */

.rs-page-wrap,
.rs-detail-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.rs-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.rs-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand, #7C3AED);
  margin-bottom: 6px;
}

.rs-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--text-1);
}

.rs-sub {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  max-width: 560px;
}

.rs-hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.rs-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background: var(--brand, #7C3AED);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--brand, #7C3AED) 35%, transparent);
}

.rs-fab-upgrade {
  opacity: .85;
}

.rs-quota {
  font-size: 12px;
  color: var(--text-3);
}

.rs-quota.muted { color: var(--text-3); }

.rs-table-section { margin-top: 8px; }

.rs-table-head {
  margin-bottom: 12px;
}

.rs-table-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
}

.rs-table-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
}

.rs-table-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-1, #fff);
}

.rs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.rs-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--bg-2, #f9fafb);
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.rs-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  vertical-align: top;
}

.rs-table tr:last-child td { border-bottom: none; }

.rs-col-time { width: 130px; white-space: nowrap; color: var(--text-3); font-size: 13px; vertical-align: top; padding-top: 16px; }

.rs-excerpt-error { color: #dc2626; }

.rs-title-link {
  color: var(--text-1);
  font-weight: 600;
  text-decoration: none;
}

.rs-title-link:hover { color: var(--brand, #7C3AED); }

.rs-excerpt {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.5;
}

.rs-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.rs-badge-done { background: #ecfdf5; color: #059669; }
.rs-badge-pending { background: #fffbeb; color: #d97706; }
.rs-badge-running { background: #eff6ff; color: #2563eb; }
.rs-badge-failed { background: #fef2f2; color: #dc2626; }

.rs-row-pending,
.rs-row-running { background: color-mix(in srgb, var(--brand, #7C3AED) 4%, transparent); }

.rs-progress {
  margin-top: 8px;
  height: 6px;
  background: var(--bg-2, #f3f4f6);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.rs-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand, #7C3AED), #a78bfa);
  border-radius: 999px;
  transition: width .3s ease;
}

.rs-progress-text {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
}

.rs-empty-inner {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-3);
}

.rs-empty-title { font-weight: 600; color: var(--text-2); margin-bottom: 6px; }

.rs-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  font-size: 13px;
}

.rs-page-btn {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-1);
}

.rs-page-info { color: var(--text-3); }

/* Modal */
.rs-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.rs-modal-backdrop[hidden] { display: none; }

.rs-modal {
  width: 100%;
  max-width: 520px;
  background: var(--bg-1, #fff);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.rs-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.rs-modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.rs-modal-lead {
  margin: -8px 0 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-2);
}

.rs-modal-close {
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-3);
}

.rs-field { display: flex; flex-direction: column; gap: 6px; }

.rs-label {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rs-required { color: #e74c3c; }
.rs-counter { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--text-3); }

.rs-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.55;
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
  min-height: 140px;
  font-family: inherit;
}

.rs-form-hint {
  font-size: 12.5px;
  color: #e74c3c;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fef2f2;
}

.rs-form-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.rs-form-tip { font-size: 12px; color: var(--text-3); }

.rs-btn-primary {
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  background: var(--brand, #7C3AED);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
}

.rs-btn-ghost {
  display: inline-block;
  margin-left: 10px;
  padding: 9px 18px;
  color: var(--text-2);
  text-decoration: none;
}

.rs-upgrade-box {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-2);
}

/* Detail page */
.rs-detail-actions { margin-bottom: 16px; }

.rs-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
}

.rs-article {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 24px;
  background: var(--bg-1, #fff);
}

.rs-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 12px;
}

.rs-article-head {
  margin-bottom: 28px;
}

.rs-article-title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  color: var(--text-1);
}

.rs-article-body {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-1);
}

/* markdown-body 表格：正文内对齐，窄屏/宽表横向滚动 */
.markdown-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  box-sizing: border-box;
  border-collapse: collapse;
  font-size: 13.5px;
}

.markdown-body th,
.markdown-body td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border, #e5e7eb);
  vertical-align: top;
}

.markdown-body th {
  font-weight: 600;
  background: var(--bg-2, #f9fafb);
  white-space: nowrap;
  color: var(--text-2);
  font-size: 12.5px;
}

.markdown-body tr:last-child td { border-bottom: none; }
.markdown-body tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg-2, #f9fafb) 50%, transparent); }

.rs-article-body h2 {
  font-size: 18px;
  margin: 28px 0 12px;
}

.rs-article-body h3 {
  font-size: 16px;
  margin: 20px 0 10px;
}

.rs-article-body p { margin: 0 0 14px; }
.rs-article-body ul, .rs-article-body ol { margin: 0 0 14px; padding-left: 1.4em; }
.rs-article-body li { margin-bottom: 6px; }

/* 每日早报：在 Markdown 语义之上提供专用信息层级 */
.morning-report-article {
  max-width: 840px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.morning-report-article .rs-article-head,
.morning-report-article .rs-article-foot {
  max-width: 800px;
  margin-right: auto;
  margin-left: auto;
}

.morning-report-article .rs-article-head {
  margin-bottom: 20px;
  padding: 0 4px;
}

.morning-report-article .rs-article-title {
  font-size: 30px;
  line-height: 1.3;
  text-wrap: balance;
}

.morning-report-body {
  max-width: 800px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.morning-report-body > hr { display: none; }

.mr-summary,
.mr-event-card,
.mr-closing-card {
  margin-bottom: 18px;
  border: 1px solid #DDE4DF;
  border-radius: 14px;
  background: #FFFFFF;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.045);
}

.mr-summary {
  padding: 24px;
  border-top: 4px solid #2457C5;
  background: linear-gradient(145deg, #F3F7FF 0%, #F5FBF7 100%);
}

.mr-summary-meta {
  margin: 0 0 18px;
  padding: 0 0 0 12px;
  border-left: 3px solid #A9B9D8;
  color: #52606D;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.mr-summary-lead {
  margin-bottom: 14px !important;
  color: #102A43;
  font-size: 17px;
  line-height: 1.7;
}

.mr-summary-signals {
  margin-bottom: 22px !important;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.76);
  color: #334E68;
  font-size: 14px;
}

.morning-report-body .mr-summary-title {
  margin: 22px 0 10px;
  color: #102A43;
  font-size: 18px;
  scroll-margin-top: 80px;
}

.mr-summary-list {
  margin: 0 !important;
  padding-left: 1.35em !important;
}

.mr-summary-list li {
  margin-bottom: 8px;
  padding-left: 4px;
}

.mr-event-card {
  padding: 22px 24px;
  border-left-width: 4px;
}

.mr-event-card--positive { border-left-color: #2E8B64; }
.mr-event-card--watch { border-left-color: #D99A22; }
.mr-event-card--risk { border-left-color: #C94B4B; }

.morning-report-body .mr-event-card > h2 {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 16px;
  color: #172B4D;
  font-size: 20px;
  line-height: 1.45;
  scroll-margin-top: 80px;
}

.mr-event-number {
  display: inline-flex;
  flex: 0 0 38px;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  border-radius: 8px;
  background: #172B4D;
  color: #FFFFFF;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.mr-event-title {
  min-width: 0;
  padding-top: 1px;
  text-wrap: pretty;
}

.mr-event-title-link {
  color: inherit;
  text-decoration: none;
}

.mr-event-title-link:hover { color: #2457C5; }

.mr-event-title-link:focus-visible {
  border-radius: 4px;
  outline: 3px solid rgba(36, 87, 197, 0.28);
  outline-offset: 3px;
}

.mr-event-card p { margin-bottom: 12px; }

.mr-event-time {
  margin-bottom: 8px !important;
  color: #667085;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.mr-event-signal {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px !important;
  padding: 6px 10px;
  border: 1px solid #DCE6E0;
  border-radius: 999px;
  background: #F5F9F6;
  color: #365B4B;
  font-size: 13px;
  line-height: 1.5;
}

.mr-event-fact,
.mr-event-gap,
.mr-event-mapping {
  color: #344054;
}

.mr-event-card p > strong:first-child,
.mr-closing-card h2 {
  color: #172B4D;
}

.mr-event-mapping {
  margin-bottom: 8px !important;
}

.mr-stock-list {
  display: grid;
  gap: 8px;
  margin: 0 0 14px !important;
  padding: 0 !important;
  list-style: none;
}

.mr-stock-list li {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #E6EAE7;
  border-radius: 9px;
  background: #F8FAF9;
}

.mr-event-observe,
.mr-event-invalid {
  margin-bottom: 8px !important;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.mr-event-observe {
  border-left: 3px solid #D99A22;
  background: #FFF9EB;
}

.mr-event-invalid {
  border-left: 3px solid #C94B4B;
  background: #FFF4F3;
}

.mr-detail-action { margin: 16px 0 0 !important; }

.mr-detail-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #B9C9EB;
  border-radius: 8px;
  background: #F3F7FF;
  color: #1F4EAD;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  touch-action: manipulation;
}

.mr-detail-link::after {
  content: '→';
  margin-left: 7px;
}

.mr-detail-link:hover {
  border-color: #7898D8;
  background: #E8F0FF;
  color: #153D91;
}

.mr-detail-link:focus-visible {
  outline: 3px solid rgba(36, 87, 197, 0.28);
  outline-offset: 2px;
}

.mr-closing-card {
  padding: 18px 20px;
}

.morning-report-body .mr-closing-card > h2 {
  margin: 0 0 12px;
  font-size: 18px;
  scroll-margin-top: 80px;
}

.mr-closing-card--watch { border-left: 4px solid #2457C5; }
.mr-closing-card--risk { border-left: 4px solid #C94B4B; }

.mr-closing-card ul {
  margin-bottom: 0;
}

.rs-article-foot {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.rs-question-source summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-3);
}

.rs-question-source p {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

.rs-disclaimer {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.6;
}

@media (max-width: 640px) {
  .rs-hero { flex-direction: column; }
  .rs-hero-actions { align-items: flex-start; }
  .rs-col-time { width: 88px; font-size: 12px; padding-top: 14px; }
  .rs-article { padding: 20px 16px; }
  .rs-article-title { font-size: 22px; }

  .morning-report-article {
    margin-right: -4px;
    margin-left: -4px;
  }

  .morning-report-article .rs-article-head {
    padding: 0 4px;
  }

  .morning-report-article .rs-article-title {
    font-size: 24px;
  }

  .morning-report-body {
    font-size: 15px;
  }

  .mr-summary,
  .mr-event-card,
  .mr-closing-card {
    margin-bottom: 14px;
    border-radius: 12px;
  }

  .mr-summary,
  .mr-event-card {
    padding: 16px;
  }

  .morning-report-body .mr-event-card > h2 {
    gap: 10px;
    font-size: 18px;
  }

  .mr-event-number {
    flex-basis: 34px;
    min-height: 30px;
  }

  .mr-event-signal {
    border-radius: 9px;
  }

  .mr-detail-link {
    min-height: 44px;
  }

  /* markdown 正文表格仍用横向滚动 */
  .markdown-body table {
    font-size: 12.5px;
  }
  .markdown-body th,
  .markdown-body td {
    padding: 7px 9px;
  }
}
