/* 每日复盘 · AI 学习档案 */

.dr-page {
  --dr-good: #0d9f6e;
  --dr-warn: #c77b08;
  --dr-bad: #d7443e;
  --dr-blue: #2f6bff;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.dr-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 26px;
  border-radius: var(--r-xl);
  color: #fff;
  background:
    radial-gradient(580px 220px at 92% 8%, rgba(255, 170, 100, 0.3), transparent 62%),
    linear-gradient(135deg, #101827 0%, #18253a 55%, #23395d 100%);
  box-shadow: 0 24px 44px -30px rgba(16, 24, 39, 0.9);
}
.dr-hero-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}
.dr-hero h2 {
  margin-top: 13px;
  max-width: 900px;
  font-size: clamp(20px, 2.3vw, 30px);
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.dr-hero p {
  margin-top: 9px;
  max-width: 880px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  line-height: 1.7;
}
.dr-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.dr-hero-actions .btn-ghost {
  color: rgba(255, 255, 255, 0.86);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
}
.dr-hero-actions .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.13);
}
.dr-hero-actions .btn[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
}

.dr-score {
  --tone: var(--dr-good);
  position: relative;
  width: 126px;
  height: 126px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--tone) calc(var(--score) * 1%), rgba(255, 255, 255, 0.12) 0);
  flex: 0 0 auto;
}
.dr-score::after {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: #182338;
}
.dr-score > div,
.dr-score em {
  position: relative;
  z-index: 1;
}
.dr-score > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-7px);
}
.dr-score b {
  font-size: 39px;
  line-height: 1;
  letter-spacing: -0.04em;
}
.dr-score span {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
}
.dr-score em {
  position: absolute;
  bottom: 20px;
  color: var(--tone);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}
.dr-score.good { --tone: #54d6a4; }
.dr-score.blue { --tone: #7fa5ff; }
.dr-score.warn { --tone: #f5b94d; }
.dr-score.bad { --tone: #ff7a76; }

.dr-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.dr-kpi {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.dr-kpi > span {
  color: var(--ink-3);
  font-size: 10px;
}
.dr-kpi > b {
  overflow: hidden;
  font-size: 22px;
  line-height: 1.18;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dr-kpi > small {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dr-kpi.good > b { color: var(--dr-good); }
.dr-kpi.warn > b { color: var(--dr-warn); }
.dr-kpi.bad > b { color: var(--dr-bad); }

.dr-compare {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.dr-compare span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink-2);
  font-size: 10px;
}
.dr-compare b { color: var(--ink); }

.dr-card {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-width: 0;
  padding: 20px;
}
.dr-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.dr-section-head h3 {
  margin-top: 3px;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.dr-eyebrow {
  color: var(--brand-deep);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.dr-muted {
  color: var(--ink-3);
  font-size: 10px;
  line-height: 1.5;
  text-align: right;
}
.dr-subhead {
  margin-top: 4px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.dr-subhead:first-child { margin-top: 0; }

.dr-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}
.dr-badge .i { width: 12px; height: 12px; }
.dr-badge.ai { background: rgba(112, 138, 255, 0.26); }
.dr-card .dr-badge { background: var(--bg); color: var(--ink-2); }
.dr-card .dr-badge.good { background: var(--green-soft); color: var(--dr-good); }
.dr-card .dr-badge.warn { background: var(--amber-soft); color: var(--dr-warn); }
.dr-card .dr-badge.bad { background: var(--red-soft); color: var(--dr-bad); }
.dr-card .dr-badge.ai { background: var(--blue-soft); color: var(--dr-blue); }

.dr-settings {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}
.dr-settings > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 11px 12px;
  background: #fbfbfc;
}
.dr-settings span { color: var(--ink-3); font-size: 9px; }
.dr-settings b { font-size: 15px; }

.dr-decisions {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.dr-decisions article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.dr-decisions article b { font-size: 12px; }
.dr-decisions article p {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 10px;
  line-height: 1.6;
}
.dr-decisions article em {
  color: var(--ink-3);
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}
.dr-priority {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 20px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--bg);
  color: var(--ink-2);
  font-size: 9px;
  font-weight: 800;
}
.dr-priority.p0 { background: var(--red-soft); color: var(--dr-bad); }
.dr-priority.p1 { background: var(--amber-soft); color: var(--dr-warn); }
.dr-priority.p2 { background: var(--blue-soft); color: var(--dr-blue); }

.dr-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 14px;
}

.dr-structure {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--line);
}
.dr-structure > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  background: #fbfbfc;
}
.dr-structure span { color: var(--ink-3); font-size: 9px; }
.dr-structure b { font-size: 17px; }
.dr-structure b.good, .dr-table .good, .dr-lead-grid .good { color: var(--dr-good); }
.dr-structure b.bad, .dr-table .bad, .dr-lead-grid .bad { color: var(--dr-bad); }
.dr-lead-grid .warn { color: var(--dr-warn); }

.dr-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.dr-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
.dr-table th {
  padding: 9px 10px;
  background: #f8f9fb;
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 600;
  text-align: right;
}
.dr-table th:first-child, .dr-table td:first-child { text-align: left; }
.dr-table td {
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  text-align: right;
}
.dr-table td b { font-size: 11px; }

.dr-plan-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--line);
}
.dr-plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) repeat(4, minmax(58px, 0.5fr));
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: #fff;
  text-align: left;
}
.dr-plan-row:hover { background: #fbfbfd; }
.dr-plan-row span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dr-plan-row span > small { color: var(--ink-3); font-size: 8px; }
.dr-plan-row span > b { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-plan-name b { font-size: 11px; }
.dr-plan-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dr-progress {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfbfc;
}
.dr-progress-head, .dr-progress-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-2);
  font-size: 10px;
}
.dr-progress-head b { color: var(--ink); font-size: 12px; }
.dr-progress-track {
  height: 7px;
  margin: 10px 0 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #e9ecf1;
}
.dr-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8a3d, #ff4d1f);
}
.dr-progress-foot { color: var(--ink-3); font-size: 9px; }

.dr-lead-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.dr-lead-grid > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.dr-lead-grid span { color: var(--ink-3); font-size: 9px; }
.dr-lead-grid b { font-size: 17px; }

.dr-funnel {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dr-funnel > div {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f8f9fb, #fff);
  border: 1px solid var(--line);
}
.dr-funnel span { color: var(--ink-3); font-size: 9px; }
.dr-funnel b { font-size: 17px; }
.dr-funnel small { color: var(--ink-3); font-size: 8px; }
.dr-funnel > i { color: var(--ink-3); font-size: 11px; font-style: normal; }

.dr-msg-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.dr-msg-grid > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfbfc;
}
.dr-msg-grid span { color: var(--ink-3); font-size: 9px; }
.dr-msg-grid b { font-size: 17px; }
.dr-msg-grid small { color: var(--ink-3); font-size: 8px; }

.dr-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: #3b5ccc;
  font-size: 10px;
  line-height: 1.6;
}
.dr-note .i { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 1px; }
.dr-note.warn { background: var(--amber-soft); color: #8d6008; }
.dr-empty-inline {
  padding: 14px;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  color: var(--ink-3);
  font-size: 10px;
  text-align: center;
}
.dr-empty-inline.good { border-color: #bfe9d8; background: var(--green-soft); color: var(--dr-good); }

.dr-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: 18px;
}
.dr-timeline { display: flex; flex-direction: column; gap: 0; }
.dr-timeline-row {
  display: grid;
  grid-template-columns: 38px 10px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
}
.dr-timeline-row time { color: var(--ink-3); font-size: 9px; padding-top: 2px; }
.dr-dot {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--dr-good);
  box-shadow: 0 0 0 3px rgba(13, 159, 110, 0.11);
}
.dr-timeline-row.bad .dr-dot { background: var(--dr-bad); box-shadow: 0 0 0 3px rgba(215, 68, 62, 0.11); }
.dr-timeline-row div { min-width: 0; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.dr-timeline-row b { font-size: 11px; }
.dr-timeline-row p { margin-top: 2px; color: var(--ink-2); font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.dr-timeline-row small { color: var(--ink-3); font-size: 8px; }

.dr-failures { display: flex; flex-direction: column; gap: 8px; }
.dr-failure {
  padding: 10px 11px;
  border: 1px solid #f7d4d2;
  border-radius: 10px;
  background: #fffafa;
}
.dr-failure > div { display: flex; align-items: center; gap: 7px; }
.dr-failure time { color: var(--ink-3); font-size: 8px; }
.dr-failure > b { display: block; margin-top: 5px; font-size: 11px; }
.dr-failure p { margin-top: 3px; color: var(--ink-2); font-size: 9px; line-height: 1.55; overflow-wrap: anywhere; }
.dr-failure small { color: var(--ink-3); font-size: 8px; }

.dr-learning { background: linear-gradient(180deg, #fff, #fcfcff); }
.dr-learning-summary {
  padding: 13px 14px;
  border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0;
  background: var(--brand-soft);
  color: #7a2b16;
  font-size: 11px;
  line-height: 1.75;
}
.dr-learning-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}
.dr-lesson {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.dr-lesson + .dr-lesson { margin-top: 7px; }
.dr-lesson > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dr-lesson b { font-size: 11px; }
.dr-lesson span { color: var(--dr-good); font-size: 9px; font-weight: 700; }
.dr-lesson p { margin-top: 4px; color: var(--ink-2); font-size: 9px; line-height: 1.55; }
.dr-lesson em { display: block; margin-top: 5px; color: var(--ink-3); font-size: 9px; font-style: normal; line-height: 1.55; }

.dr-actions { display: flex; flex-direction: column; gap: 7px; }
.dr-action-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.dr-action-row b { font-size: 11px; }
.dr-action-row p { margin-top: 3px; color: var(--ink-3); font-size: 9px; line-height: 1.55; }

.dr-risks { display: flex; flex-direction: column; gap: 6px; }
.dr-risks div {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--amber-soft);
  color: #865a09;
  font-size: 9px;
  line-height: 1.55;
}
.dr-risks .i { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 1px; }

.dr-rules {
  padding: 12px 14px;
  border: 1px solid #dde6ff;
  border-radius: 11px;
  background: #f8faff;
}
.dr-rules li {
  position: relative;
  padding: 6px 0 6px 15px;
  border-top: 1px solid rgba(47, 107, 255, 0.09);
  color: #33415c;
  font-size: 10px;
  line-height: 1.55;
}
.dr-rules li:first-child { border-top: 0; }
.dr-rules li::before {
  content: '';
  position: absolute;
  left: 1px;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--dr-blue);
}

.dr-prompt {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}
.dr-prompt summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
}
.dr-prompt summary span { color: var(--ink-3); font-size: 8px; font-weight: 400; }
.dr-prompt pre {
  margin: 0 13px 10px;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  border-radius: 9px;
  background: #111827;
  color: #c9d4e5;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.dr-prompt .btn { margin: 0 13px 13px; }

.dr-quality-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.dr-quality-grid span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-3);
  font-size: 9px;
}
.dr-quality-grid span.good { border-color: #bfe9d8; background: var(--green-soft); color: var(--dr-good); }
.dr-quality-grid span.warn { border-color: #f3dfb7; background: var(--amber-soft); color: var(--dr-warn); }
.dr-notes { display: flex; flex-direction: column; gap: 4px; }
.dr-notes li { color: var(--ink-3); font-size: 9px; line-height: 1.55; }

.dr-history { display: flex; flex-direction: column; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.dr-history-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(5, minmax(62px, 0.48fr));
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-left: 3px solid transparent;
  background: #fff;
  text-align: left;
}
.dr-history-row:hover { background: #fbfbfd; }
.dr-history-row.active { border-left-color: var(--brand); background: var(--brand-soft); }
.dr-history-row > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dr-history-row small { overflow: hidden; color: var(--ink-3); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.dr-history-row b { font-size: 11px; }
.dr-history-row > span:first-child small { max-width: 420px; }
.dr-history-score { align-items: flex-end; }
.dr-history-score b { font-size: 16px; }
.dr-history-score.good b { color: var(--dr-good); }
.dr-history-score.blue b { color: var(--dr-blue); }
.dr-history-score.warn b { color: var(--dr-warn); }
.dr-history-score.bad b { color: var(--dr-bad); }

.dr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 50px 20px;
  text-align: center;
}
.dr-empty .i { width: 36px; height: 36px; color: var(--ink-3); }
.dr-empty h3 { font-size: 15px; }
.dr-empty p { max-width: 560px; color: var(--ink-3); font-size: 10px; line-height: 1.7; }
.dr-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 300px;
  color: var(--ink-3);
  font-size: 11px;
}

@media (max-width: 1280px) {
  .dr-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dr-settings { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dr-msg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  .dr-grid, .dr-ops-grid, .dr-learning-grid { grid-template-columns: minmax(0, 1fr); }
  .dr-hero { padding: 20px; }
  .dr-score { width: 104px; height: 104px; }
  .dr-score b { font-size: 32px; }
}

@media (max-width: 720px) {
  .dr-hero { grid-template-columns: minmax(0, 1fr); }
  .dr-score { display: none; }
  .dr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dr-settings, .dr-structure, .dr-msg-grid, .dr-lead-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dr-funnel { flex-wrap: wrap; }
  .dr-funnel > div { flex: 1 1 40%; }
  .dr-funnel > i { display: none; }
  .dr-plan-row { grid-template-columns: minmax(0, 1fr) repeat(2, minmax(54px, 0.4fr)); }
  .dr-plan-row > span:nth-child(4), .dr-plan-row > span:nth-child(5) { display: none; }
  .dr-history-row { grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(54px, 0.5fr)); }
  .dr-history-row > span:nth-child(3), .dr-history-row > span:nth-child(4), .dr-history-row > span:nth-child(5) { display: none; }
  .dr-decisions article { grid-template-columns: auto minmax(0, 1fr); }
  .dr-decisions article em { grid-column: 2; }
  .dr-section-head { flex-direction: column; gap: 5px; }
  .dr-muted { text-align: left; }
  .dr-prompt summary { flex-direction: column; align-items: flex-start; gap: 3px; }
}
