/* 首頁英雄區塊設計 */
.hero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 231, 185, 0.8), rgba(255, 167, 167, 0.8));
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 16px 48px rgba(255, 111, 97, 0.18);
}

.hero-text h1 {
    font-size: clamp(1.8rem, 2.4vw + 1rem, 2.8rem);
    margin-bottom: 16px;
}

.hero-text p {
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 28px;
    color: #4b5563;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero-illustration {
    display: flex;
    justify-content: center;
}

.preview-img {
    width: min(100%, 320px);
    height: auto;
    border-radius: 24px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

/* 導覽區段 */
.nav-section {
    margin-top: 48px;
}

.nav-section[hidden] {
    display: none !important;
}

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

.section-header h2 {
    font-size: 1.8rem;
    margin: 0;
}

.section-header p {
    color: #6b7280;
}

.section-header .btn-secondary {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.btn-sm {
    padding: 6px 14px !important;
    font-size: 0.88rem;
}

/* 第一層：學年度 */
.year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.year-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px 20px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #fff;
    border: none;
    border-radius: 18px;
    box-shadow: 0 10px 28px rgba(245, 158, 11, 0.3);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 1rem;
}

.year-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(245, 158, 11, 0.4);
}

.year-name {
    font-size: 1.3rem;
    font-weight: 700;
}

.year-detail {
    font-size: 0.9rem;
    opacity: 0.88;
}

/* 第二層：學期 Tab + 年級 */
.semester-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.semester-tab {
    padding: 10px 24px;
    border: 2px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.semester-tab.active {
    border-color: #f97316;
    background: #fff7ed;
    color: #ea580c;
}

.grade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.grade-card {
    padding: 22px 16px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.grade-card:hover {
    border-color: #f97316;
    background: #fff7ed;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(249, 115, 22, 0.18);
}

/* 第三層：遊戲列表 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.game-card {
    background-color: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
}

.game-cover {
    background: linear-gradient(135deg, #ff9f43, #ff6f61);
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    max-height: 220px;
    overflow: hidden;
}

.game-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-cover {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
    text-align: center;
    padding: 40px 20px;
}

.game-body {
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.game-body h3 {
    margin: 0;
    font-size: 1.3rem;
}

.game-body .description {
    color: #4b5563;
    flex: 1;
    line-height: 1.6;
}

.game-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #6b7280;
}

.game-body .btn {
    align-self: flex-start;
    margin-top: 8px;
}

/* 共用 */
.loading-state {
    padding: 24px;
    text-align: center;
    color: #6b7280;
    font-size: 1.05rem;
}

.empty-state {
    padding: 32px;
    border-radius: 16px;
    background-color: #fff8eb;
    border: 1px dashed #f59f0b;
    color: #b45309;
    text-align: center;
}

@media (max-width: 768px) {
    .hero {
        padding: 32px;
    }
    .grade-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
