.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 8px;
  padding-top: max(12px, env(safe-area-inset-top, 12px));
}

.home-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-logo {
  width: 32px;
  height: 32px;
  background: var(--wq-primary);
  border-radius: var(--wq-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--wq-text-primary);
}

.home-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mode-label {
  font-size: var(--text-xs);
  color: var(--wq-text-tertiary);
}

.mode-switch {
  position: relative;
  width: 52px;
  height: 28px;
  background: var(--wq-neutral-200);
  border-radius: var(--wq-radius-full);
  cursor: pointer;
  transition: background 0.25s ease;
  flex-shrink: 0;
}

.mode-switch.active {
  background: var(--wq-child-accent);
}

.mode-switch .toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: var(--wq-text-inverse);
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.mode-switch.active .toggle-knob {
  transform: translateX(24px);
}

.home-main {
  flex: 1;
  padding: 0 16px 80px;
  overflow-y: auto;
}

.hero-card {
  background: linear-gradient(135deg, var(--wq-primary) 0%, var(--wq-primary-dark) 100%);
  border-radius: var(--wq-radius-xl);
  padding: 24px 20px;
  color: var(--wq-text-inverse);
  position: relative;
  overflow: hidden;
  margin-top: 12px;
  margin-bottom: 16px;
}

.hero-card::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -20px;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.hero-card::after {
  content: "";
  position: absolute;
  bottom: -20px;
  right: 40px;
  width: 80px;
  height: 80px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-size: var(--text-sm);
  opacity: 0.85;
  font-weight: var(--weight-normal);
  margin-bottom: 6px;
}

.hero-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  margin-bottom: 20px;
}

.hero-title-sub {
  font-size: var(--text-lg);
  font-weight: var(--weight-normal);
  opacity: 0.85;
  margin-left: 6px;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--wq-text-inverse);
  color: var(--wq-primary);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  padding: 14px 32px;
  border-radius: var(--wq-radius-lg);
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  box-shadow: var(--shadow-md);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-btn:active {
  transform: scale(0.97);
}

.home-section {
  margin-bottom: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-header h2 {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--wq-text-primary);
}

.section-link {
  font-size: var(--text-xs);
  color: var(--wq-primary);
  text-decoration: none;
  font-weight: var(--weight-medium);
}

.weak-kp-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weak-kp-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--wq-primary-lightest);
  color: var(--wq-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  border-radius: var(--wq-radius-full);
  border: 1px solid var(--wq-primary-lighter);
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  overflow-x: auto;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: var(--wq-radius-full);
  border: none;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  background: var(--wq-neutral-100);
  color: var(--wq-text-secondary);
  white-space: nowrap;
}

.filter-pill.active {
  background: var(--wq-primary);
  color: var(--wq-text-inverse);
}

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

.question-item {
  background: var(--wq-bg-card);
  border: 1px solid var(--wq-border);
  border-radius: var(--wq-radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.question-item:active {
  background: var(--wq-neutral-50);
}

.qi-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.qi-subject-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  border-radius: var(--wq-radius-sm);
}

.qi-date {
  font-size: var(--text-xs);
  color: var(--wq-text-tertiary);
}

.qi-text {
  font-size: var(--text-sm);
  color: var(--wq-text-primary);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.qi-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qi-kp-tag {
  padding: 2px 10px;
  background: var(--wq-neutral-100);
  color: var(--wq-text-secondary);
  font-size: 11px;
  border-radius: var(--wq-radius-full);
}

.qi-mastery {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: auto;
}

[data-mode="child"] .hero-card {
  background: linear-gradient(135deg, var(--wq-child-accent) 0%, var(--wq-child-accent) 100%);
  border-radius: 20px;
}
