/* --- Base & Color Scheme Variables --- */
:root {
    /* Light Mode */
    --body-bg-color: #f8f9fa;
    --content-bg-color: #ffffff;
    --text-color-primary: #212529;
    --text-color-secondary: #6c757d;
    --border-color-soft: #e9ecef;
    --border-color-medium: #ced4da;
    --shadow-color-soft: rgba(0,0,0,0.05);
    --shadow-color-medium: rgba(0,0,0,0.07);
    --button-bg: #f1f3f5;
    --button-text: var(--text-color-primary);
    --button-hover-bg: #e9ecef;
    --spotify-button-bg: #181818;
    --spotify-button-text: #ffffff;
    --spotify-button-hover-bg: #333333;
    --cover-placeholder-bg: var(--button-bg);
    --cover-placeholder-text-color: var(--text-color-secondary);
    
    --md-input-text-color: var(--text-color-primary);
    --md-input-placeholder-color: var(--text-color-secondary);
    --md-input-underline-color: #bdbdbd; 
    --md-input-underline-focus-color: var(--text-color-primary); 
    --md-input-bg-color: transparent; 

    --transition-speed: 0.2s;
    --transition-ease: ease-out;
    --base-font-size: 15.5px;
    --font-family-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --header-height: 60px; 
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Dark Mode */
        --body-bg-color: #121212; 
        --content-bg-color: #1c1c1c; 
        --text-color-primary: #e8eaed; 
        --text-color-secondary: #9aa0a6; 
        --border-color-soft: #303134; 
        --border-color-medium: #525357;
        --shadow-color-soft: rgba(255,255,255,0.04);
        --shadow-color-medium: rgba(255,255,255,0.06);
        --button-bg: #282a2d;
        --button-text: var(--text-color-primary);
        --button-hover-bg: #3c4043;
        --spotify-button-bg: #e8eaed; 
        --spotify-button-text: #202124;
        --spotify-button-hover-bg: #ffffff;
        --cover-placeholder-bg: #232323;
        --cover-placeholder-text-color: var(--text-color-secondary);

        --md-input-text-color: var(--text-color-primary);
        --md-input-placeholder-color: var(--text-color-secondary);
        --md-input-underline-color: #616161; 
        --md-input-underline-focus-color: var(--text-color-primary); 
        --md-input-bg-color: transparent;

    }
}

/* --- Fixed Header --- */
.fixed-header-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--content-bg-color);
    border-bottom: 1px solid var(--border-color-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 1px 3px var(--shadow-color-soft);
}

.fixed-header-container h1 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
}

/* --- 基础样式 --- */
body {
    font-family: var(--font-family-sans);
    line-height: 1.65;
    margin: 0;
    padding-top: var(--header-height); 
    background-color: var(--body-bg-color);
    color: var(--text-color-primary);
    transition: background-color var(--transition-speed) var(--transition-ease);
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box; 
}

.container { max-width: 860px; margin: 0 auto; background: var(--content-bg-color); padding: 25px 30px; }

/* --- 歌单头部 --- */
#playlist-header { display: flex; align-items: flex-start; margin-bottom: 30px; padding-bottom: 25px; border-bottom: 1px solid var(--border-color-soft); }
.cover-art-container { margin-right: 25px; border-radius: 8px; background-color: var(--cover-placeholder-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid var(--border-color-medium); }
.cover-art-container.playlist-main-cover { width: 160px; height: 160px; min-width: 160px; }
.cover-art-container img { width: 100%; height: 100%; object-fit: cover; }

/* --- 列表头部 & 搜索框 --- */
.track-list-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px; 
    border-bottom: 1px solid var(--border-color-soft); 
    padding-bottom: 10px; 
}

.track-list-header h2 {
    font-size: 1.1em;
    margin: 0;
}

.search-input-material-wrapper { 
    position: relative; 
    min-width: 140px; 
}

#search-input { 
    width: 100%; 
    padding: 4px 0; 
    border: none; 
    border-bottom: 1px solid var(--md-input-underline-color); 
    background: transparent; 
    color: var(--text-color-primary); 
    outline: none; 
    font-size: 13px;
}
.search-input-underline { position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--text-color-primary); transform: scaleX(0); transition: transform 0.3s; }
#search-input:focus + .search-input-underline { transform: scaleX(1); }

/* --- 歌曲条目 --- */
.track-item { display: flex; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border-color-soft); transition: background 0.2s; }
.track-item:hover { background-color: var(--shadow-color-soft); }
.track-item .cover-art-container { width: 45px; height: 45px; min-width: 45px; margin-right: 15px; border-radius: 4px; }

/* --- 歌曲信息 & 按钮 --- */
.track-content { flex-grow: 1; min-width: 0; }
.track-name { font-weight: 600; font-size: 0.95em; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-artist-album { font-size: 0.8em; color: var(--text-color-secondary); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.track-actions { margin-top: 6px; display: flex; gap: 8px; }
.action-button { padding: 4px 10px; font-size: 0.7em; font-weight: 700; border-radius: 12px; background: var(--button-bg); color: var(--button-text); border: 1px solid var(--border-color-medium); transition: 0.2s; text-transform: uppercase; cursor: pointer; }
.action-button:hover { background: var(--button-hover-bg); border-color: var(--text-color-secondary); }
.action-button.bing { background: #00809d; color: white; border-color: transparent; }
.action-button.bing:hover { background: #00a1c4; }
.action-button.qq { background: #07D159; color: white; border-color: transparent; }
.action-button.qq:hover { background: #06b84d; }
.action-button.netease { background: #C20C0C; color: white; border-color: transparent; }
.action-button.netease:hover { background: #a60a0a; }
.action-button.kuwo { background: #F58A07; color: white; border-color: transparent; }
.action-button.kuwo:hover { background: #d97706; }

.track-duration { font-size: 0.85em; color: var(--text-color-secondary); margin-left: 15px; }

@media (max-width: 480px) {
    .track-duration { display: none; }
    .container { padding: 15px; }
}