/* === 首頁樣式 START === */

.home {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-8);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Header --- */
.home__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-6);
  border-bottom: var(--border-subtle);
  margin-bottom: var(--space-8);
}

.home__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.home__logo {
  font-size: var(--fs-2xl);
  filter: drop-shadow(0 0 8px var(--brand-glow));
}

.home__title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  background: linear-gradient(135deg, var(--brand-primary-light), var(--panel-right-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Hero --- */
.home__hero {
  text-align: center;
  padding: var(--space-8) 0 var(--space-12);
}

.home__tagline {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  color: var(--brand-primary-light);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: var(--space-4);
}

.home__headline {
  font-size: clamp(1.8rem, 4vw, var(--fs-3xl));
  font-weight: var(--fw-bold);
  line-height: 1.3;
  margin-bottom: var(--space-5);
  color: var(--text-primary);
}

.home__headline-accent {
  background: linear-gradient(135deg, var(--brand-primary-light), var(--panel-right-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home__subtitle {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --- 場景區域 --- */
.home__scenarios {
  flex: 1;
}

.home__section-header {
  margin-bottom: var(--space-6);
}

.home__section-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-2);
}

.home__section-desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}

/* --- 篩選按鈕 --- */
.home__filters {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.filter-btn {
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: var(--border-subtle);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.filter-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--brand-primary);
  color: white;
  border-color: var(--brand-primary);
}

/* --- 場景卡片網格 --- */
.home__grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

/* 分類標題 */
.home__category-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding-top: var(--space-4);
}

.home__category-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
}

.home__category-desc {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* 分類行 */
.home__category-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-5);
}

/* 「更多」卡片 */
.scenario-card--more {
  background: transparent !important;
  border: 2px dashed rgba(124, 106, 239, 0.2) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

.scenario-card--more:hover {
  border-color: rgba(124, 106, 239, 0.5) !important;
  background: rgba(124, 106, 239, 0.04) !important;
}

.scenario-card--more__inner {
  text-align: center;
}

.scenario-card--more__icon {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-3);
  opacity: 0.6;
}

.scenario-card--more__text {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--brand-primary-light);
  margin-bottom: var(--space-2);
}

.scenario-card--more__hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* --- 場景卡片 --- */
.scenario-card {
  background: var(--bg-secondary);
  border: var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.scenario-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(124, 106, 239, 0.05));
  opacity: 0;
  transition: opacity var(--duration-normal);
}

.scenario-card:hover {
  border-color: rgba(124, 106, 239, 0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), 0 0 30px var(--brand-glow);
}

.scenario-card:hover::before {
  opacity: 1;
}

.scenario-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.scenario-card__emoji {
  font-size: var(--fs-2xl);
  line-height: 1;
  flex-shrink: 0;
}

.scenario-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-1);
}

.scenario-card__name {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
  line-height: 1.3;
}

.scenario-card__role {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.scenario-card__desc {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}

.scenario-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-3);
  border-top: var(--border-subtle);
  margin-top: auto;
}

.scenario-card__challenge {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* --- 歷史紀錄 --- */
.home__history {
  margin-top: var(--space-8);
  padding-top: var(--space-8);
  border-top: var(--border-subtle);
}

.home__history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.history-card {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-secondary);
  border: var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all var(--duration-fast) var(--ease-out);
}

.history-card:hover {
  border-color: rgba(124, 106, 239, 0.3);
  background: var(--bg-elevated);
}

.history-card__grade {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  min-width: 48px;
  text-align: center;
  background: linear-gradient(135deg, var(--brand-primary-light), var(--panel-right-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.history-card__info {
  flex: 1;
}

.history-card__name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
}

.history-card__meta {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.history-card__score {
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.history-card__score-max {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* --- Footer --- */
.home__footer {
  text-align: center;
  padding: var(--space-8) 0 var(--space-4);
  border-top: var(--border-subtle);
  margin-top: auto;
}

.home__footer p {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

/* --- 響應式 --- */
@media (max-width: 768px) {
  .home {
    padding: var(--space-4);
  }

  .home__grid {
    grid-template-columns: 1fr;
  }

  .home__headline {
    font-size: 1.6rem;
  }
}
/* === 首頁樣式 END === */
