/* ============================================================
   common.css
   KTV 點歌系統 — 四頁共用樣式
   內容：重置樣式 / 版面容器 / 歌曲卡片 GRID 佈局 / 愛心按鈕 /
         空狀態與載入中提示 / 底部導覽列（瀏覽歌曲＋關鍵字搜尋共用）
   使用頁面：myfavorites.html, browse.php, search.php, phonetic.php
   ============================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    /* 禁用文字選取，防止長按出現選擇框 */
    -webkit-user-select: none;
    user-select: none;
    /* 移除移動端點擊按鈕時出現的灰色高亮方塊 */
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, "Helvetica Neue", Arial, "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    background-color: #EFEFEF;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 80px;
}

/* ============================================================
   歌曲列表容器
   ============================================================ */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
}

/* ============================================================
   歌曲卡片 — 統一 GRID 佈局（四頁共用）
   欄位配置：
     第一列：歌號 | 歌名 | 愛心（跨兩列）
     第二列：機台 | 歌手 | 日期
   ============================================================ */
.song-item {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    grid-template-rows: auto auto;
    grid-template-areas:
        "code    name    heart"
        "machine singer  date";
    column-gap: 5px;
    row-gap: 2px;
    align-items: center;
    width: 100%;
    padding: 5px 8px;
    border-bottom: 1px solid #ddd;
    background: #B9CDDA;
    position: relative;
}

.song-code {
    grid-area: code;
    font-size: 26px;
    font-weight: 600;
    text-align: center;
}

.song-name {
    grid-area: name;
    font-size: 26px;
    font-weight: 500;
    color: #000000;
    /*overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;*/
}

.machine {
    grid-area: machine;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.singer {
    grid-area: singer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.date-display {
    grid-area: date;
    font-size: 14px;
    color: #666; 
    white-space: nowrap;
    justify-self: end;
}

/* 若該頁不需要顯示日期，於頁面自身 <style> 內加上
   .date-display { display: none; } 覆蓋即可 */

.heart-btn {
    grid-area: heart;
    grid-row: 1 / span 2;
    width: 40px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    color: #ff2c2c;
    transition: color 0.2s;
    background: transparent;
    border-radius: 10px;
    z-index: 10;
}

.heart-btn.faved {
    color: #e53935;
}

/* ============================================================
   空狀態 / 載入中提示
   ============================================================ */
.empty-message {
    text-align: center;
    padding: 40px 20px;
    color: black;
    font-size: 20px;
}

.loading-indicator {
    text-align: center;
    padding: 16px 0;
    color: #888;
    font-size: 16px;
}

/* ============================================================
   底部導覽列（瀏覽歌曲、關鍵字搜尋共用；收藏頁 / 注音頁有各自版本）
   ============================================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    background: #88aecd;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 6px 8px;
    z-index: 1000;
    border-top: 1px solid #ddd;
    gap: 8px;
    box-sizing: border-box;
    align-items: stretch;
}

.bottom-nav a,
.bottom-nav button {
    flex: 1;
    padding: 6px 0;
    font-size: 20px;
    border: 1px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: background 0.2s, transform 0.1s;
    display: inline-block;
    background: #2196F3;
}

.bottom-nav a:active,
.bottom-nav button:active {
    transform: scale(0.96);
}

.bottom-nav .btn-home {
    background: #5ecc62;
}

.bottom-nav .btn-home:active {
    background: #388E3C;
}

.bottom-nav .btn-fav {
    background: #FF9800;
}

.bottom-nav .btn-fav:active {
    background: #F57C00;
}

.bottom-nav .btn-top {
    background: #9E9E9E;
}

.bottom-nav .btn-top:active {
    background: #757575;
}

/* ============================================================
   RWD（手機窄螢幕）
   ============================================================ */
@media (max-width: 400px) {
    .song-code,
    .song-name {
        font-size: 24px;
    }

    .machine,
    .singer {
        font-size: 18px;
    }

    .heart-btn {
        width: 35px;
        font-size: 24px;
    }

    .song-item {
        grid-template-columns: 70px 1fr 35px;
    }

    .bottom-nav a,
    .bottom-nav button {
        font-size: 20px;
        padding: 6px 10px;
    }
}
