/* ==========================================================================
   云辰美育 · 评画记录数据统计 records-stats.css
   --------------------------------------------------------------------------
   统计区直接内联在记录页顶部，两列展示；只作用于 #rsStatsPanel 内部，
   不碰记录列表、瀑布流与全局筛选栏样式。
   ========================================================================== */

#rsStatsPanel {
  margin: 0 0 26px;
  padding: 28px 30px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(26, 34, 51, .1);
}
.rs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.rs-head h3 {
  margin: 0;
  font-size: 32px;
  color: var(--ink, #1a1a1a);
}
.rs-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted, #888);
}

.rs-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 60px;
  margin-bottom: 16px;
}
.rs-kpi {
  padding: 10px 14px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  background: #f8fafc;
}
.rs-kpi-label { font-size: 12px; color: var(--muted, #888); }
.rs-kpi-value {
  margin-top: 3px;
  font-size: 30px;
  font-weight: 800;
  color: var(--accent, #1080ff);
  line-height: 1.2;
}
.rs-kpi-value small { font-size: 18px; color: var(--muted, #888); }

.rs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 60px;
  align-items: start;
}
.rs-section {
  min-width: 0;
  margin: 0;
  padding-top: 14px;
}
.rs-section h4 {
  margin: 0 0 10px;
  font-size: 26px;
  color: var(--ink, #1a1a1a);
}
.rs-extreme-title { margin-top: 18px !important; }
.rs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted, #888);
}
.rs-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rs-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rs-dot-high { background: var(--ok); }
.rs-dot-avg { background: #1080ff; }
.rs-dot-low { background: #a7b0bd; }

.rs-canvas {
  display: block;
  width: 100%;
  height: 260px;
}
.rs-canvas-trend { height: 220px; }
.rs-subject-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.rs-subject-item {
  padding: 10px 12px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 10px;
  background: #fff;
}
.rs-subject-name { font-size: 13px; font-weight: 700; color: var(--ink, #1a1a1a); }
.rs-subject-nums {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted, #888);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.rs-subject-nums b { color: var(--ink-body, #475467); }

.rs-extremes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.rs-extreme {
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line, #e5e7eb);
  background: #fff;
}
.rs-extreme.is-best { border-color: #bfe6cc; background: #f3fbf6; }
.rs-extreme.is-low { border-color: #f3dca6; background: #fff9f0; }
.rs-extreme-label { font-size: 12px; color: var(--muted, #888); }
.rs-extreme-score { margin-top: 2px; font-size: 24px; font-weight: 800; color: var(--ink, #1a1a1a); }
.rs-extreme-meta { margin-top: 4px; font-size: 12px; color: var(--ink-body, #475467); line-height: 1.5; }
.rs-note { margin: 14px 0 0; font-size: 11px; color: var(--muted, #888); line-height: 1.7; }
.rs-empty-note {
  padding: 22px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--muted, #888);
}

@media (max-width: 900px) {
  #rsStatsPanel { padding: 0; border: 0; box-shadow: none; background: none; }
  .rs-grid { grid-template-columns: 1fr; gap: 16px; }
  .rs-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rs-canvas { height: 230px; }
  .rs-canvas-trend { height: 210px; }
}
@media (max-width: 560px) {
  .rs-subject-list, .rs-extremes { grid-template-columns: 1fr; }
}

/* ========== 【新增】统计分享按钮 + 分享弹层 ========== */
.rs-head-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 22px; padding: 10px 0; 
}
.rs-head-row h3 { margin: 0; }
.rs-share-btn {
  flex: none; padding: 7px 16px; margin: 4px 0 0 0;
  border: 1px solid var(--accent, #1080ff); border-radius: 999px;
  background: transparent; color: var(--accent, #1080ff);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background .16s, color .16s;
}
.rs-share-btn:hover { background: var(--accent, #1080ff); color: #fff; }
.rs-share-mask {
  position: fixed; inset: 0; z-index: 10050;
  display: none; align-items: center; justify-content: center;
  padding: 16px; background: rgba(16, 24, 40, .55);
}
.rs-share-sheet {
  width: min(420px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: #fff; border-radius: 18px; padding: 20px;
  box-shadow: 0 20px 60px rgba(16, 24, 40, .3);
}
.rs-share-head { display: flex; align-items: center; justify-content: space-between; }
.rs-share-head b { font-size: 24px; color: #1d2939; }
.rs-share-head button {
  border: 0; background: #f2f4f7; color: #475467; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%; font-size: 20px; line-height: 1;
}
.rs-share-tip { margin: 8px 0 12px; font-size: 12px; line-height: 1.6; color: #667085; }
.rs-share-msg { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; font-size: 12px; background: #fff4e5; color: #b26200; }
.rs-share-msg.is-ok { background: #e8f7ee; color: #16803c; }
.rs-share-preview { text-align: center; background: #f5f7fa; border-radius: 12px; padding: 10px; }
.rs-share-preview img { max-width: 100%; max-height: 56vh; display: inline-block; border-radius: 8px; }
.rs-share-actions { display: flex; gap: 10px; margin-top: 14px; }
.rs-share-actions .btn { flex: 1; }
