/* ===== 登录/注册/档案页面通用 ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.auth-bg-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.auth-bg-circle.c1 {
  width: 400px;
  height: 400px;
  top: -100px;
  right: -100px;
}

.auth-bg-circle.c2 {
  width: 300px;
  height: 300px;
  bottom: -80px;
  left: -80px;
}

.auth-bg-circle.c3 {
  width: 200px;
  height: 200px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.auth-container {
  width: 100%;
  max-width: 420px;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo-img {
  width: 240px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.logo-text {
  color: white;
  font-size: 1.8rem;
  font-weight: bold;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.auth-card {
  position: relative;
  background: white;
  border-radius: 20px;
  padding: 35px 30px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: slideUp 0.4s ease;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.auth-card h2 {
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--text-light);
  margin-bottom: 25px;
  font-size: 0.9rem;
}

.highlight-scan {
  font-weight: 700;
  color: #5a4a6a;
  background: linear-gradient(135deg, #E8F0FE, #E0E7FF);
  padding: 10px 16px;
  border-radius: 10px;
  display: inline-block;
  position: relative;
  overflow: hidden;
}

.highlight-scan::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.7), transparent);
  animation: scanLight 2.5s ease-in-out infinite;
}

@keyframes scanLight {
  0% { left: -100%; }
  100% { left: 150%; }
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.input-with-icon {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
}

.form-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  border: 2px solid #E0E5EB;
  border-radius: 12px;
  font-size: 1rem;
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
}

/* 替换日期选择器图标 */
input[type="date"]::-webkit-calendar-picker-indicator {
  background: url('../assets/calendar-icon.png') center/contain no-repeat;
  width: 22px;
  height: 22px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.input-with-btn {
  display: flex;
  gap: 10px;
}

.sms-btn {
  white-space: nowrap;
  padding: 12px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.sms-btn:hover {
  background: var(--primary-dark);
}

.sms-btn:disabled {
  background: #BDC3C7;
  cursor: not-allowed;
}

.auth-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
}

.auth-btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.auth-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.auth-btn-secondary {
  background: var(--bg);
  color: var(--text);
}

.auth-btn-secondary:hover {
  background: #E0E5EB;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  color: var(--text-light);
  font-size: 0.85rem;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.remember-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: #666;
  cursor: pointer;
}
.remember-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.auth-demo {
  margin-top: 12px;
  padding: 8px 12px;
  background: #FFF9E6;
  border-radius: 8px;
  font-size: 0.8rem !important;
}

/* ===== 性别选择 ===== */
.gender-options {
  display: flex;
  gap: 15px;
}

.gender-option {
  cursor: pointer;
  flex: 1;
}

.gender-option input {
  display: none;
}

.gender-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px;
  border: 2px solid #D0D5DC;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
  filter: grayscale(1);
  opacity: 0.7;
}

.gender-option input:checked + .gender-btn {
  border-color: var(--primary);
  background: #E3F2FD;
  color: var(--primary);
  filter: none;
  opacity: 1;
}

/* ===== 年龄提示 ===== */
.age-hint {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 600;
  padding: 6px 12px;
  background: #E3F2FD;
  border-radius: 8px;
  display: inline-block;
}

.level-preview {
  margin-top: 15px;
  padding: 0;
  background: none;
  border-radius: 0;
  text-align: center;
  width: 100%;
  min-height: 48px;
}

.level-badge {
  display: block;
  width: 100%;
  padding: 12px;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  border: 1.5px solid rgba(102, 126, 234, 0.25);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.level-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0;
}

/* ===== 多孩子列表 ===== */
.child-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 16px;
  background: #E8E8EA;
  border-radius: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.25s;
  border: 2px solid transparent;
  box-shadow: 0 4px 15px rgba(0,0,0,0.06);
  position: relative;
}

.child-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
  border-color: #d0d5f0;
}

.child-card.selected {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.35);
  border: 2px solid #667eea;
  background: #F0F3FF;
}

.child-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  flex-shrink: 0;
}

.child-info {
  flex: 1;
}

.child-info h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text);
}

.child-info p {
  margin: 3px 0 0;
  font-size: 0.85rem;
  color: var(--text-light);
}

.child-level-badge {
  padding: 4px 10px;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
}

.child-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 1;
  transition: opacity 0.2s;
  padding: 4px;
  margin-left: 4px;
  flex-shrink: 0;
}

.child-delete-btn:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* 删除确认弹窗 */
.confirm-popup {
  position: absolute;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 20px 24px;
  z-index: 2000;
  min-width: 260px;
  animation: popIn 0.2s ease;
  text-align: center;
}

.confirm-msg {
  font-size: 0.95rem;
  color: #333;
  margin: 0 0 6px 0;
  line-height: 1.5;
}

.confirm-hint {
  font-size: 0.8rem;
  color: #999;
  margin: 0 0 16px 0;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-btn {
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 600;
}

.confirm-btn-cancel {
  background: #F0F0F0;
  color: #666;
}

.confirm-btn-cancel:hover {
  background: #E0E0E0;
}

.confirm-btn-danger {
  background: #e74c3c;
  color: #fff;
}

.confirm-btn-danger:hover {
  background: #c0392b;
}

/* ===== Dashboard 特有 ===== */
.dashboard-hero {
  padding: 40px 30px;
}

.dashboard-hero h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

#age-label {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: 25px;
}

.hero-stats {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.hero-stat {
  text-align: center;
  background: rgba(255,255,255,0.2);
  padding: 12px 20px;
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.hero-stat-num {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 3px;
}

.hero-stat-label {
  font-size: 0.75rem;
  opacity: 0.8;
}

/* 训练任务卡片 */
.task-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.task-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.task-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.task-card.completed {
  opacity: 0.7;
}

.task-card.completed::before {
  background: var(--success);
}

.task-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.task-title {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 5px;
}

.task-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 12px;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-stars {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: bold;
}

.task-difficulty {
  padding: 3px 10px;
  background: var(--bg);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--text-light);
}

.task-checkmark {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--success);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* 能力雷达图 */
.radar-container {
  background: white;
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
}

#radar-chart {
  max-width: 300px;
}

.radar-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-score {
  margin-left: auto;
  font-weight: bold;
  color: var(--primary);
  min-width: 30px;
  text-align: right;
}

/* 训练记录 */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  background: white;
  border-radius: 12px;
  padding: 15px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.history-info {
  flex: 1;
}

.history-info h4 {
  margin: 0;
  font-size: 0.95rem;
}

.history-info p {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: var(--text-light);
}

.history-score {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--primary);
  flex-shrink: 0;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(44, 62, 80, 0.9);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .auth-card {
    padding: 25px 20px;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 10px;
  }
  
  .hero-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
  }
  
  .radar-container {
    flex-direction: column;
  }
}
