/* ========== 练习统计页面样式 ========== */

/* 概览统计卡片 */
.ps-overview {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 8px;
}

.ps-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px;
  text-align: center;
  border-top: 3px solid var(--accent, var(--primary));
  transition: var(--transition);
}

.ps-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.ps-stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent, var(--primary));
  line-height: 1.2;
}

.ps-stat-lbl {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* 分区块 */
.ps-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 18px;
}

.ps-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-light);
}

/* 两列网格 */
.ps-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

/* 柱状条形图 */
.ps-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ps-bar-label {
  width: 48px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  text-align: right;
}

.ps-bar-track {
  flex: 1;
  height: 20px;
  background: var(--primary-light);
  border-radius: 10px;
  overflow: hidden;
}

.ps-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #4a9af5);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.ps-bar-value {
  width: 48px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* 难度分布 */
.ps-pie-segment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color) 10%, transparent);
  border-left: 4px solid var(--color);
}

.ps-pie-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.ps-pie-val {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* 练习历史表格 */
.ps-table-wrap {
  overflow-x: auto;
}

.ps-table {
  width: 100%;
  border-collapse: collapse;
}

.ps-table th {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
}

.ps-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.ps-table tr:hover td {
  background: var(--primary-light);
}

.ps-subjects-cell {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ps-score-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.ps-score-excellent { background: #e6f4ea; color: #1e7e34; }
.ps-score-good { background: #e8f0fe; color: #1a73e8; }
.ps-score-fair { background: #fef7e0; color: #b06000; }
.ps-score-poor { background: #fce8e6; color: #c5221f; }

/* 响应式 */
@media (max-width: 768px) {
  .ps-overview {
    grid-template-columns: repeat(3, 1fr);
  }

  .ps-grid-2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .ps-overview {
    grid-template-columns: 1fr 1fr;
  }

  .ps-stat-num {
    font-size: 1.5rem;
  }
}
/* ========== 暗色模式适配 ========== */
[data-theme="dark"] .modal-overlay {
  background: rgba(0,0,0,0.7);
}
[data-theme="dark"] .modal-content {
  background: var(--bg-card);
  color: var(--text);
}
[data-theme="dark"] .history-table {
  color: var(--text);
}
[data-theme="dark"] .history-table td {
  color: var(--text-secondary);
}
[data-theme="dark"] .history-table tr:hover {
  background: #2a2a40;
}
[data-theme="dark"] input, [data-theme="dark"] select {
  background: var(--bg-input);
  color: var(--text);
  border-color: var(--border);
}
[data-theme="dark"] ::placeholder {
  color: var(--text-muted);
}

