:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-bg: #f8f9fa;
    --dark-bg: #415b76;
    --border-color: #dee2e6;
    --text-dark: #343a40;
    --text-light: #f8f9fa;
    --success-color: #28a745;
    --warning-color: #ffc107;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    position: relative;
    color: var(--text-dark);
    line-height: 1.6;
    background: #000;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url(img/aqua-rooftop-day.png) scroll;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: -1;
    opacity: 0.6;
    transition: background 0.5s ease;
    filter: blur(4px);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: #1f466aaa;
    color: white;
    padding: 15px 0 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: background 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

h1 .type-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    margin-left: 12px;
    font-size: 1.2rem;
}

.last-updated {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    opacity: 0.9;
}

.last-updated i {
    margin-right: 8px;
}

.header-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.view-notice-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.view-notice-btn i {
    margin-right: 5px;
}

.view-notice-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

#backToTop {
    display: none;
    position: fixed;
    width: 48px;
    height: 48px;
    bottom: 108px;
    right: 16px;
    border-radius: 6px;
    background: var(--primary-color);
    border: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.2);
}

#backToTop svg {
    position: absolute;
    width: 40px;
    height: 40px;
    top: 4px;
    left: 4px;
    transition: all 0.3s ease;
}

#theme-change {
    position: fixed;
    display: block;
    bottom: 48px;
    right: 16px;
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: var(--primary-color);
    overflow: hidden;
    z-index: 1000;
    transition: background 0.3s ease;
    box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.2);
}

#theme-change svg {
    position: absolute;
    width: 40px;
    height: 40px;
    top: 4px;
    left: 4px;
    transition: all 0.3s ease;
}

svg#light {
    opacity: 1;
    transform: rotate(0deg);
}

svg#dark {
    opacity: 0;
    transform: rotate(15deg);
}

body>.container {
    min-height: 90vh;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.controls>div {
    background: #f2f2f2dd;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.08);
    flex: 1;
    min-width: 300px;
    transition: background 0.5s ease;
}

.section-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    transition: all 0.5s ease;
}

.section-title i {
    margin-right: 8px;
    color: var(--primary-color);
}

.sort-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#song-selection {
    display: none;  /* 默认隐藏 */
    margin-top: 10px;
    gap: 10px;
    flex-wrap: wrap;
    transition: all 0.3s ease;  /* 添加过渡效果 */
    width: 100%;
}

#song-select, #difficulty-select {
    flex: 1;
    min-width: 100px;
    max-width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--light-bg);
    transition: all 0.3s ease;
    width: 100%;
}

#song-select:focus, #difficulty-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

.sort-btn {
    flex: 1;
    padding: 12px 15px;
    background: var(--light-bg);
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.5s ease;
    text-align: center;
}

.sort-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.sort-btn:hover:not(.active) {
    background: #e3f2fd;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-type {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    flex: 1;
}

.search-type-btn {
    flex: 1;
    padding: 12px;
    background: var(--light-bg);
    border: none;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    transition: all 0.5s ease;
}

.search-type-btn.active {
    background: var(--primary-color);
    color: white;
    transition: all 0.5s ease;
}

.search-input {
    flex: 2;
    position: relative;
}

.search-input input,
.search-input select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.search-input input:focus,
.search-input select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.search-btn {
    padding: 12px 25px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.5s ease;
}

.search-btn:hover {
    background: #2980b9;
}

.set_leaderborad_size {
    margin-bottom: 20px;
}

.set_size {
    padding: 12px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.5s ease, color 0.5s ease;
    outline: none;
    color: #fff;
}

/* 部分视图状态样式 */
.set_size.partial-view {
    background-color: var(--primary-color);
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* 完整视图状态样式 */
.set_size.full-view {
    background-color: var(--light-bg);
    color: var(--secondary-color);
    transition: background-color 0.5s ease, color 0.5s ease;
}

.leaderboard_container {
    overflow-x: auto;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px #4444;
    transition: all 0.5s ease;
    background: #fffd;
}

#loading_leaderborad {
    text-align: center;
    padding: 30px;
}

.leaderboard_container .simplebar-track.simplebar-vertical {
    top: 60px;
    bottom: 5px;
    width: 12px;
    background: none;
    border-radius: 6px;
}

.leaderboard_container .simplebar-track.simplebar-horizontal {
    left: 5px;
    right: 10px;
    height: 12px;
    background: none;
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th {
    background: #2a5983;
    color: white;
    padding: 16px 15px;
    text-align: left;
    font-weight: 500;
    position: sticky;
    top: 0;
    white-space: nowrap;
    transition: background 0.5s ease;
}

th#center {
    text-align: center;
}

tbody tr:nth-child(odd) {
    background-color: #33333310;
    transition: background-color 0.5s ease;
}

tr {
    position: relative;
    z-index: 1;
}

#leaderboard-header tr {
    position: relative;
    z-index: 10;
}

td {
    padding: 16px 15px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    transition: border-bottom 0.5s ease;
}

td#center {
    text-align: center;
}

.highlight {
    background: #fff9e6 !important;
    box-shadow: inset 3px 0 0 var(--warning-color);
    position: relative;
}

.player-name {
    font-weight: 500;
}

.highlight-cell {
    color: #1a9bf1;
    font-weight: 600;
}

#pagination {
    display: block;
    margin: 20px 0;
}

.pagination-container {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination-numbers,
.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-numbers {
    font-weight: 500;
}

.page-link {
    padding: 0.4rem 1rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.5s;
    background: #ffffff;
}

.page-link.current {
    background: #4599da;
    color: white;
    border-color: #4599da;
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.page-link:hover:not(.disabled):not(.current):not(.ellipsis) {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.footer-info {
    margin-top: 30px;
    width: 100%;
    padding: 20px;
    background: #333a;
    text-align: center;
    color: #dfdfdf;
    font-size: 0.8rem;
}

.related-link svg {
    position: relative;
}

#bilibili-link svg {
    top: 3px;
}

#qq-group-link svg {
    top: 3px;
}

.related-link a:link,
.related-link a:visited,
.related-link a:hover,
.related-link a:active {
    color: #dfdfdf;
    text-decoration: none;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ddd8;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, background 0.5s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(52, 152, 219, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 935px) {
    .pagination-container {
        flex-direction: column;
        gap: 15px;
    }

    .pagination-controls {
        justify-content: center;
    }

    .pagination-numbers {
        justify-content: center;
    }
    
    .sort-options {
        flex-direction: column;
    }

    .sort-btn {
        width: 100%;
    }

    #song-selection {
        flex-direction: column;
    }

    #song-select, #difficulty-select {
        min-width: 100%;
    }

    .leaderboard_container .simplebar-track.simplebar-vertical {
        top: 60px;
        bottom: 10px;
    }

    .leaderboard_container {
        overflow-x: auto;
        padding-bottom: 13px;
    }
}

@media (max-width: 916px) {
    .pagination-container {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-numbers,
    .pagination-controls {
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h1 .type-display {
        padding: 3px 10px;
        border-radius: 16px;
        margin-left: 10px;
        font-size: 1rem;
    }

    #backToTop {
        width: 44px;
        height: 44px;
        bottom: 90px;
        right: 12px;
    }

    #backToTop svg {
        width: 36px;
        height: 36px;
    }

    #theme-change {
        width: 44px;
        height: 44px;
        bottom: 40px;
        right: 12px;
    }

    #theme-change svg {
        width: 36px;
        height: 36px;
    }

    .search-type-btn {
        padding: 4px;
    }

    .leaderboard_container {
        overflow-x: auto;
        padding-bottom: 13px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .sort-options {
        flex-direction: column;
    }

    .search-form {
        flex-direction: column;
    }

    .pagination-numbers {
        margin-bottom: 0.5rem;
        flex-wrap: wrap;
    }

    th,
    td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }

    .leaderboard_container .simplebar-track.simplebar-vertical {
        top: 45px;
        bottom: 10px;
    }

    .footer-info {
        font-size: 0.75rem;
    }
}

/* 声明样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url(img/aqua-rooftop-night.png) center/cover no-repeat fixed;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-container {
    background: var(--dark-bg);
    border-radius: 15px;
    padding: 25px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    border: 1px solid var(--primary-color);
    background: linear-gradient(to bottom, rgba(31, 70, 106, 0.95), rgba(31, 70, 106, 0.85));
}

.modal-container::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    pointer-events: none;
    z-index: -1;
    opacity: 0.3;
}

.modal-title {
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
    color: #fff;
}

.modal-content {
    color: #fff;
    font-size: 16px;
    line-height: 1.6;
}

.modal-content ol {
    padding-left: 20px;
    margin: 15px 0;
}

.modal-content li {
    margin: 10px 0;
}

.modal-content .section-title {
    color: var(--primary-color);
    margin-top: 20px;
    font-weight: bold;
    font-size: 18px;
}

.modal-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    padding: 0 20px;
}

.modal-button {
    padding: 10px 35px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    font-weight: bold;
    color: white;
    position: relative;
    overflow: hidden;
}

.modal-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0.1), rgba(255,255,255,0));
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.modal-button:hover::before {
    transform: translateX(100%);
}

.modal-button.agree {
    background: var(--primary-color);
    min-width: 180px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.modal-button.agree:disabled {
    background: var(--dark-bg);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.7;
    color: var(--border-color);
}

.modal-button.disagree {
    background: var(--dark-bg);
    min-width: 120px;
    text-align: center;
    border: 1px solid var(--border-color);
    color: var(--border-color);
}

.modal-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.modal-button.agree:hover:not(:disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.modal-button.disagree:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.modal-button.return {
    background: var(--dark-bg);
    min-width: 160px;
    text-align: center;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    margin: 0 auto;
}

.modal-button.return:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

@media (max-width: 480px) {
    .modal-container {
        width: 95%;
        padding: 20px;
    }

    .modal-title {
        font-size: 20px;
    }

    .modal-content {
        font-size: 14px;
    }

    .modal-button {
        padding: 8px 20px;
        font-size: 14px;
    }

    h1 {
        font-size: 1.5rem;
    }

    h1 .type-display {
        padding: 3px 8px;
        border-radius: 12px;
        margin-left: 10px;
        font-size: 0.85rem;
    }

    #backToTop {
        width: 40px;
        height: 40px;
        bottom: 80px;
        right: 8px;
    }

    #backToTop svg {
        width: 32px;
        height: 32px;
    }

    #theme-change {
        width: 40px;
        height: 40px;
        bottom: 32px;
        right: 8px;
    }

    #theme-change svg {
        width: 32px;
        height: 32px;
    }

    .controls {
        flex-direction: column;
    }

    .sort-controls,
    .search-container {
        min-width: 100%;
    }

    .pagination {
        flex-wrap: wrap;
    }

    .page-link {
        padding: 6px 10px;
        font-size: 0.8rem;
        border-radius: 4px;
    }

    .pagination {
        gap: 5px;
    }

    th,
    td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }

    .leaderboard_container .simplebar-track.simplebar-vertical {
        top: 40px;
        bottom: 10px;
    }

    .footer-info {
        font-size: 0.7rem;
    }
}