
/* ==========================================================================
   1. 全局修正 (Global Fixes)
   ========================================================================== */
/* 修正主容器顶部间距 */
main.container {
    padding-top: 2rem; 
}

/* ==========================================================================
   2. 顶部快速切换琴区 (Model Grid)
   特点：电脑一行6个全排开，手机一行2个，底部带Play按钮
   ========================================================================== */
.home-model-grid {
    display: grid;
    /* 手机端：强制一行 2 个 */
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; /* 间距适中 */
    margin-bottom: 3rem;
}

/* 平板端：一行 3 个 */
@media (min-width: 600px) {
    .home-model-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* 电脑端：一行 6 个 (强制不换行，全显示) */
@media (min-width: 1024px) {
    .home-model-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 15px;
    }
}

.home-model-card {
    background-color: #f9fafb; /* 浅灰背景 */
    border: 1px solid #e5e7eb; /* 统一边框 */
    border-radius: 12px;       
    padding: 1.5rem 0.5rem;    
    text-decoration: none;
    color: var(--color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%; /* 等高 */
    position: relative;
}

/* 鼠标悬停效果 */
.home-model-card:hover {
    transform: translateY(-5px);
    background-color: #ffffff;
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: var(--primary);
    text-decoration: none;
    z-index: 2;
}

/* 图标区域 */
.model-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    transition: transform 0.3s;
}
.home-model-card:hover .model-icon {
    transform: scale(1.15); 
}

/* 标题 */
.home-model-card h3 {
    margin: 0 0 0.8rem 0;
    font-size: 1rem; 
    font-weight: 800;
    color: var(--h1-color);
}

/* 底部按钮样式 (Play) */
.model-btn {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: transparent;
    border: 1px solid var(--primary); /* 线框按钮 */
    padding: 4px 14px;
    border-radius: 50px;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
/* 悬停时按钮变实心 */
.home-model-card:hover .model-btn {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 8px rgba(var(--primary-rgb), 0.3);
}

/* 推荐红点 (Featured Dot) */
.featured-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background-color: #e74c3c; /* 红色 */
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff; /* 白边 */
}

/* --- 琴区深色模式适配 --- */
[data-theme="dark"] .home-model-card {
    background-color: var(--card-background-color);
    border-color: var(--muted-border-color);
}
[data-theme="dark"] .home-model-card:hover {
    background-color: rgba(255,255,255,0.05);
    border-color: var(--primary);
}
[data-theme="dark"] .featured-dot {
    box-shadow: 0 0 0 2px #333; /* 深色边 */
}


/* ==========================================================================
   3. 热门乐谱区域 (Hot Scores)
   特点：完美居中标题，移动端双列紧凑布局
   ========================================================================== */
.home-scores-section {
    padding-top: 2rem;
    margin-top: 1rem;
    border-top: 1px dashed var(--muted-border-color);
}

/* 标题栏 (完美居中) */
.home-scores-header {
    position: relative; 
    display: flex;
    justify-content: center; /* 内容居中 */
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 0 5px;
    min-height: 40px;
}

.home-scores-header h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--h1-color); 
    text-align: center;
    z-index: 1;
}

/* View All 按钮 (绝对定位到右侧) */
.home-scores-header a {
    position: absolute;
    right: 0;
    bottom: 5px; 
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 2;
}

/* 标题栏移动端适配 */
@media (max-width: 600px) {
    .home-scores-header {
        flex-direction: column;
        margin-bottom: 1.5rem;
    }
    .home-scores-header h2 {
        font-size: 1.4rem;
    }
    .home-scores-header a {
        position: static; /* 移动端取消绝对定位，换行显示 */
        margin-top: 8px;
        font-size: 0.85rem;
    }
}

/* --- 乐谱网格布局 (核心优化) --- */
.score-grid {
    display: grid;
    /* 【手机端优化】强制一行 2 个，间距缩小 */
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px; 
    width: 100%;
}

/* 电脑端适配 */
@media (min-width: 768px) {
    .score-grid {
        /* 电脑端自适应，最小宽240px */
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); 
        gap: 20px;
    }
}


/* ==========================================================================
   4. 乐谱卡片样式 (Score Card)
   特点：紧凑型，移动端省空间，背景带音符装饰
   ========================================================================== */
.score-card {
    background-color: #f9fafb; 
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    
    /* 【手机端优化】减少内边距和高度 */
    padding: 1rem 0.5rem; 
    min-height: 125px; 
    
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: center; 
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* 电脑端卡片变大 */
@media (min-width: 768px) {
    .score-card {
        padding: 1.5rem;
        min-height: 180px;
        border-radius: 16px;
    }
}

/* 背景音符装饰 */
.score-card::after {
    content: "♪";
    position: absolute;
    bottom: -10px;
    right: 5px;
    font-family: serif;
    font-size: 4rem; /* 手机端小音符 */
    color: var(--primary);
    opacity: 0.06;
    transform: rotate(-10deg);
    pointer-events: none;
    transition: all 0.3s;
}
@media (min-width: 768px) {
    .score-card::after {
        font-size: 6rem; /* 电脑端大音符 */
        right: 10px;
    }
}

/* 悬停效果 */
.score-card:hover {
    transform: translateY(-5px);
    background-color: #ffffff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: var(--primary);
}
.score-card:hover::after {
    opacity: 0.12;
    transform: rotate(0deg) scale(1.1);
    bottom: -5px;
}

/* 标签组 */
.score-badges {
    display: flex;
    gap: 5px;
    margin-bottom: 0.6rem;
    width: 100%;
    justify-content: center;
    position: relative;
    z-index: 2;
}
.s-tag {
    font-size: 0.7rem; /* 手机端小字 */
    padding: 3px 6px;
    border-radius: 5px;
    font-weight: 700;
    text-transform: uppercase;
}
.tag-blue { background-color: rgba(52, 152, 219, 0.1); color: #3498db; }
.tag-gray { background-color: rgba(0,0,0,0.06); color: #666; }

/* 卡片标题 */
.score-card-title {
    text-align: center;
    font-size: 0.95rem; /* 手机端小标题，防换行 */
    font-weight: 700;
    color: var(--h1-color);
    margin: 0;
    line-height: 1.3;
    position: relative;
    z-index: 2;
    padding: 0 2px;
    /* 限制2行 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (min-width: 768px) {
    .score-card-title {
        font-size: 1.2rem;
        line-height: 1.4;
    }
}
.score-card:hover .score-card-title {
    color: var(--primary);
}

/* 悬停提示 (➜ Learn Song) - 仅电脑端显示 */
.score-play-hint {
    display: none; /* 手机端隐藏，省空间 */
    margin-top: 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}
@media (min-width: 768px) {
    .score-play-hint {
        display: flex;
    }
}
.score-card:hover .score-play-hint {
    opacity: 1;
    transform: translateY(0);
}

/* --- 乐谱区深色模式适配 --- */
[data-theme="dark"] .score-card { background-color: var(--card-background-color); border-color: var(--muted-border-color); }
[data-theme="dark"] .score-card:hover { background-color: rgba(255,255,255,0.05); }
[data-theme="dark"] .tag-gray { background-color: rgba(255,255,255,0.15); color: #ccc; }
[data-theme="dark"] .score-card::after { color: #fff; opacity: 0.05; }
