/* 按钮 */
.search-btn,
.search-btn-left,
.search-btn-center,
.search-btn-right {
    position: static;
    transform: none;
    padding: 0.8rem 1.5rem;
    background: #ff6b6b;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    border-radius: 25px;
    margin: 0 10px;
}
.search-btn:hover {
    color: #fff;
    background: #e65c5c;
    transform: translateY(-2px);
}
.cancel-btn {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.submit-btn {
    padding: 10px 20px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.submit-btn:hover {
    background: #e65c5c;
}
.login-btn,
.register-btn {
    background: transparent;
    border: 2px solid #ff6b6b;
    color: #ff6b6b;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s;
    font-weight: 600;
}
.login-btn:hover,
.register-btn:hover {
    background: #ff6b6b;
    color: white;
}
.action-btn {
    background: transparent;
    border: none;
    color: #ff6b6b;
    font-size: 0.9rem;
    cursor: pointer;
    margin-left: 8px;
}
.toggle-btn {
    background: transparent;
    border: none;
    color: #ff6b6b;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}
.collapse-btn {
    background: none;
    border: none;
    color: #ffb86b;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 8px;
    transition: color 0.2s;
    padding: 2px 6px;
    border-radius: 50%;
}
.collapse-btn:hover {
    color: #ff6b6b;
    background: rgba(255, 255, 255, 0.08);
}
.close-btn {
    background: transparent;
    border: none;
    color: #ff6b6b;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 模态框 */
.auth-controls {
    display: flex;
    gap: 1rem;
    margin-left: auto;
    position: relative;
}
.modal {
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}
.modal-content {
    background-color: #2c3e50;
    margin: 10% auto;
    padding: 30px;
    border: none;
    width: 35%;
    max-width: 500px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}
.user-info {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 25px;
}
.user-info #username {
    color: #ff6b6b;
    font-weight: 600;
}
#authModal h2 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-weight: 600;
    text-align: center;
}
.modal input {
    width: 100%;
    padding: 12px;
    margin: 8px 0;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}
.modal input:focus {
    border-color: #ff6b6b;
    box-shadow: 0 0 5px rgba(255, 107, 107, 0.8);
    outline: none;
}
.modal button {
    width: 100%;
    padding: 12px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}
.modal button:hover {
    background: #e65c5c;
    transform: translateY(-2px);
}
.switch-link {
    text-align: center;
    margin: 15px 0;
    color: #ff6b6b;
    font-size: 0.9rem;
}
.switch-link span {
    color: #ff6b6b;
    cursor: pointer;
    text-decoration: underline;
}
.active {
    background: #ff6b6b;
    color: white;
}

/* 评论组件 */
.comment-module {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}
.comment-module.collapsed .comments-list {
    max-height: 0;
    overflow: hidden;
}
.comment-module.collapsed .comment-form {
    display: none;
}
.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.comment-title {
    color: #ff6b6b;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}
.comments-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 0;
}
.comment-item {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
    position: relative;
}
.comment-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.comment-meta {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}
.comment-content {
    color: #fff;
    font-size: 0.95rem;
    margin: 5px 0;
}
.comment-actions {
    position: absolute;
    right: 15px;
    top: 10px;
    display: none;
}
.comment-item:hover .comment-actions {
    display: block;
}
.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}
.comment-form textarea {
    flex: 1;
    padding: 10px;
    border: 2px solid #ff6b6b;
    border-radius: 8px;
    font-size: 1rem;
    resize: vertical;
    min-height: 80px;
    background: #2c3e50;
    color: #fff;
}
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* 排行榜组件 */
.ranking-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid #ff6b6b33;
    padding-bottom: 6px;
}
.title {
    color: #ff6b6b;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}
.ranking-header .title {
    color: #ff6b6b;
    font-size: 1.18rem;
    font-weight: 700;
    letter-spacing: 1px;
    flex: 1;
    text-shadow: 0 1px 8px #ff6b6b22;
}
.collapsed .title {
    opacity: 0;
    visibility: hidden;
}
.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.ranking-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.2s;
    border-radius: 8px;
}
.ranking-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #ff6b6b 60%, #ffb86b 100%);
    color: #fff;
    font-weight: bold;
    font-size: 1rem;
    border-radius: 50%;
    margin-right: 2px;
    box-shadow: 0 2px 8px #ff6b6b33;
    border: 2px solid #fff2;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
}
.ranking-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 6px;
    border: 2px solid #ff6b6b44;
    background: #222;
    box-shadow: 0 1px 6px #ff6b6b22;
}
.ranking-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ranking-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
    display: inline-block;
    vertical-align: middle;
    transition: color 0.2s;
}
.ranking-title:hover {
    color: #ffb86b;
    text-decoration: underline;
}
.ranking-meta {
    color: #ffb86b;
    font-size: 0.85rem;
    opacity: 0.85;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ranking-item .ranking-meta:last-child {
    color: #aaa;
    font-size: 0.78rem;
    margin-top: 2px;
}

/* 排行榜收起状态 */
.ranking-module.collapsed {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    overflow: visible !important;
    background: rgba(34, 34, 34, 0.7);
    box-shadow: none;
    border-radius: 50%;
    margin: 0 0 16px 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 100px;
    left: auto;
    right: auto;
    z-index: 9999;
}
.side-rankings.left .ranking-module.collapsed {
    left: 8px;
}
.side-rankings.right .ranking-module.collapsed {
    right: 8px;
}
.ranking-module.collapsed .ranking-header .title,
.ranking-module.collapsed .ranking-content-wrapper,
.ranking-module.collapsed .scrollable-content,
.ranking-module.collapsed ul,
.ranking-module.collapsed .ranking-list {
    display: none !important;
}
.ranking-module.collapsed .collapse-btn {
    margin: 0;
    font-size: 1.5rem;
    color: #ffb86b;
    background: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px #ff6b6b33;
    border: none;
    transition: background 0.2s;
}
.ranking-module.collapsed .collapse-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}
.ranking-module .collapse-btn .collapse-icon {
    display: inline-block;
    transition: transform 0.3s;
}
.ranking-module.collapsed .collapse-btn .collapse-icon {
    transform: rotate(180deg);
}

/* 缩略图组件 */
.thumbnail-like {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.8rem;
    padding: 2px 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
}
.thumbnail-like .heart-icon {
    margin-right: 3px;
}
.thumbnail-scroll-container {
    width: 100%;
    margin-top: 30px;
    position: relative;
}
.thumbnail-scroll-wrapper {
    position: relative;
    overflow: hidden;
    padding: 5px 0;
}
.thumbnail-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 5px 10px;
    scrollbar-width: thin;
    scrollbar-color: #ff6b6b #2c3e50;
    -webkit-overflow-scrolling: touch;
}
.thumbnail-scroll::-webkit-scrollbar {
    height: 6px;
}
.thumbnail-scroll::-webkit-scrollbar-thumb {
    background-color: #ff6b6b;
    border-radius: 3px;
}
.thumbnail-scroll::-webkit-scrollbar-track {
    background-color: #2c3e50;
    border-radius: 3px;
}
.thumbnail-container {
    position: relative;
    flex: 0 0 auto;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1/1;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}
.thumbnail-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}
.thumbnail-container.active {
    border: 3px solid #ff6b6b;
    transform: scale(1.05);
}
.thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 图片相关组件 */
.gallery-item {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: auto;
    height: auto;
    max-width: 100%;
    overflow: hidden;
    padding: 15px;
    z-index: 1;
}
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}
.image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%;
    overflow: hidden;
    border-radius: 15px;
}
.image-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    transition: filter 0.5s ease;
}
.image-frame:hover {
    filter: brightness(80%);
}
.image-content {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100vh;
    object-fit: contain;
    display: block;
    border-radius: 10px;
    margin: 0 auto;
}
.image-actions {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 2;
    pointer-events: none;
}
.like-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    padding: 6px 10px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
}
.like-btn:hover {
    background: rgba(255, 107, 107, 0.9);
}
.like-btn.liked {
    background: #ff6b6b;
}
.like-count {
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    line-height: 1;
    transition: color 0.3s ease;
}

/* loading 组件 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    z-index: 1000;
}
.loading-overlay.active {
    opacity: 1;
}
.loader {
    border: 4px solid #ff6b6b;
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}

/* 滚动条美化 */
.scrollable-content {
    max-height: 340px;
    overflow-y: auto;
    padding: 6px 0;
    scrollbar-width: thin;
    scrollbar-color: #ff6b6b #232323;
}
.scrollable-content::-webkit-scrollbar {
    width: 6px;
}
.scrollable-content::-webkit-scrollbar-thumb {
    background: #ff6b6b;
    border-radius: 6px;
}
.scrollable-content::-webkit-scrollbar-track {
    background: #232323;
    border-radius: 6px;
}

/* Masonry图片和分页 */
.all-images-section {
    margin: 40px 0 20px 0;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.all-images-title {
    color: #ff6b6b;
    font-size: 1.3rem;
    margin-bottom: 18px;
}
.all-images-grid {
    column-count: 5;
    column-gap: 18px;
    margin-bottom: 18px;
    width: 100%;
}
.all-images-grid img {
    width: 100%;
    margin-bottom: 18px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    break-inside: avoid;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}
.all-images-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(255,107,107,0.18);
}
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 18px;
    margin-bottom: 10px;
}
.pagination button {
    background: #ff6b6b;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 18px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}
#pageInfo {
    color: #fff;
    font-size: 1rem;
}

.custom-select {
    position: relative;
    width: 200px;
    /* Adjusted width */
}

.custom-select select {
    appearance: none;
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 1rem;
    border: 2px solid #ff6b6b;
    border-radius: 25px;
    background: #2c3e50;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-select select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.3);
    border-color: #ff6b6b;
}

.search-btn-left {
    left: auto;
}
.search-btn-center {
    left: auto;
}
.search-btn-right {
    right: auto;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
}
.image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%;
    overflow: hidden;
    border-radius: 15px;
}
.image-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    transition: filter 0.5s ease;
}
.image-frame:hover {
    filter: brightness(80%);
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    z-index: 1000;
}
.loader {
    border: 4px solid #ff6b6b;
    border-top: 4px solid #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}
.loading-overlay.active {
    opacity: 1;
}