#view-records {
  background: var(--bg-primary);
}

.records-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.records-header h2 {
  font-size: 1.3rem;
}

.records-tabs {
  display: flex;
  background: var(--bg-card);
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

/* === 历史记录 === */
.history-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.history-item-level {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent-blue);
  min-width: 80px;
}

.history-item-stats {
  display: flex;
  gap: 16px;
  margin-left: auto;
}

.history-item-stat {
  text-align: center;
}

.history-item-stat span {
  display: block;
}

.history-item-stat .label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.history-item-stat .value {
  font-weight: 700;
  font-size: 0.95rem;
}

.history-item-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* === 统计 === */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.summary-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.summary-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.summary-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-blue);
}

.chart-section {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.chart-section h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.chart-canvas {
  width: 100%;
  height: 200px;
}

/* === 成就 === */
.streak-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  background: linear-gradient(135deg, #fff5e6, #fff);
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.streak-icon { font-size: 2rem; }

.streak-count {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-orange);
}

.streak-label {
  font-size: 1rem;
  color: var(--text-secondary);
}

.streak-best {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rank-display {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.rank-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rank-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-purple);
}

.xp-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.achievement-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.achievement-card.earned {
  border: 2px solid var(--accent-yellow);
}

.achievement-card.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.achievement-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.achievement-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.achievement-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.achievement-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

@media (max-width: 600px) {
  .stats-summary { grid-template-columns: 1fr 1fr; }
  .achievements-grid { grid-template-columns: 1fr 1fr; }
  .history-item { flex-direction: column; align-items: flex-start; }
  .history-item-stats { margin-left: 0; }
}
