html, body {
    width: 100%;
    overflow-x: hidden;
}
body {
    font-family: Arial, sans-serif;
    background: url("background.jpg") no-repeat center center fixed;
    background-size: cover;
    color: #333;
    margin: 0;
}

.container {
    background-color: rgba(255, 255, 255, 0.85);
    padding: 20px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    margin: 0 auto;
    border-radius: 12px;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed;
    word-break: break-word; /* 防止长单词撑破 */
}

th, td {
    padding: 10px;
    border: 1px solid #ccc;
    text-align: left;
}

/* 按钮统一样式 */
button {
    padding: 6px 12px;
    margin: 5px;
    border: none;
    background-color: #007BFF;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

/* ------------------- 移动端优化 ------------------- */
@media (max-width: 768px) {
    form#search-form {
        display: flex;
        flex-wrap: wrap; /* ✅ 关键：允许换行 */
        gap: 8px;
    }

    form#search-form input[type="text"],
    form#search-form button {
        flex: 1 1 45%;  /* ✅ 输入框/按钮宽度自适应 */
        min-width: 100px;
    }

    form#search-form button[type="submit"] {
        flex: 1 1 100px;
    }


    /* 隐藏多余查询项和按钮 */
    #search-language,
    #search-paid,
    #search-payRule,
    #reset-btn,
    #upload-btn,
    td button,
    th:nth-child(3),
    td:nth-child(3),
    th:nth-child(4),
    td:nth-child(4),
    th:nth-child(7),
    td:nth-child(7) {
        display: none !important;
    }

    form#search-form input[type="text"] {
        flex: 1 1 auto;
        padding: 6px;
    }

    form#search-form button[type="submit"] {
        white-space: nowrap;
        padding: 6px 12px;
        background-color: #007bff;
        border-radius: 4px;
        color: white;
        border: none;
        cursor: pointer;
        flex-shrink: 0;
    }

    #song-table thead th {
        font-size: 14px;
        padding: 6px;
    }

    #song-table tbody td {
        font-size: 14px;
        padding: 6px;
    }

    #song-table {
        font-size: 14px;
        border-collapse: collapse;
    }

    #song-table tbody tr {
        background-color: rgba(255, 255, 255, 0.95);
        border: 1px solid #ccc;
        margin-bottom: 10px;
    }
}

/* ------------------- 随便听听 弹窗样式 ------------------- */
.modal {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5); /* 遮罩 */
    backdrop-filter: blur(3px);    /* 可选模糊 */
    display: flex;
    align-items: center;           /* 垂直居中 */
    justify-content: center;       /* 水平居中 */
}
.modal[style*="display: block"] {
    display: flex !important;
}

#random-box {
    background: white;
    border-radius: 12px;
    padding: 24px 30px;
    text-align: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease-in-out;
    max-width: 320px;
    width: 90%;
    position: relative;
    font-family: 'Arial', sans-serif;
}
.popup-box {
    background: white;
    border-radius: 12px;
    padding: 24px 30px;
    text-align: center;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease-in-out;
    max-width: 320px;
    width: 90%;
    position: relative;
    font-family: 'Arial', sans-serif;
}

#random-box .close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

#random-box .close:hover {
    color: #000;
}

.popup-box .close {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
}

.popup-box .close:hover {
    color: #000;
}

/* 弹窗中的歌曲名样式 */
.copyable-name {
    color: #007bff;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: inline-block;
    margin: 10px 0;
    -webkit-user-select: text;  /*兼容安卓/三星浏览器 */
    user-select: text;          /*标准浏览器支持 */
}

.copyable-name:hover {
    color: #0056b3;
    transform: scale(1.05);
}

#pagination-controls button {
    padding: 6px 10px;
    border-radius: 4px;
}

#pagination-controls button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#song-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px; /* 根据需要调整宽度 */
}

#song-table td:hover {
    background-color: rgba(0,0,0,0.04); /* 鼠标移入高亮可选 */
    cursor: default;
}

/* 弹窗动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
