* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #f8fafc;
    --surface: rgba(0, 0, 0, 0.04);
    --surface-hover: rgba(0, 0, 0, 0.07);
    --border: rgba(0, 0, 0, 0.1);
    --text: #1e293b;
    --text-dim: rgba(30, 41, 59, 0.6);
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.3);
    --pink: #ec4899;
    --radius: 12px;
    --transition: all 0.2s ease;
}

html, body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    position: relative;
}

/* 背景模糊效果层 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(34, 197, 94, 0.04) 0%, transparent 50%);
    z-index: -1;
    animation: bgPulse 15s ease-in-out infinite;
}

@keyframes bgPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* 主容器 */
.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}

/* ==================== 顶部导航 ==================== */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: slideInDown 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-bar-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
}

.top-bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Logo */
.logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    flex-shrink: 0;
}

.logo-icon {
    font-size: 1.75rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 搜索框 */
.search-wrapper {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.search-toggle:hover {
    background: var(--surface-hover);
}

.search-box {
    width: 100%;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.search-inner {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
}

.search-inner:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon {
    color: var(--text-dim);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-dim);
}

.search-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-close:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.search-btn {
    padding: 0.4rem 1rem;
    background: var(--accent);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background: #4f46e5;
    transform: scale(1.05);
}

/* 搜索框展开覆盖层 */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(248, 250, 252, 0.85);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.show {
    opacity: 1;
    visibility: visible;
}

.search-overlay .search-inner {
    position: absolute;
    top: 50%;
    left: 1rem;
    right: 1rem;
    transform: translateY(-50%) scale(0.9);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.show .search-inner {
    transform: translateY(-50%) scale(1);
    opacity: 1;
}

.search-overlay .search-close {
    display: flex;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0.1s;
}

.search-overlay.show .search-close {
    opacity: 1;
    transform: scale(1);
}

@media (max-width: 768px) {
    .search-wrapper {
        flex: 0;
        max-width: none;
    }
    
    .search-wrapper .search-box {
        display: none;
    }
    
    .search-wrapper .search-toggle {
        display: flex;
    }
}

/* 顶部操作按钮 */
.top-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.action-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text);
    text-decoration: none;
    font-size: 1.1rem;
    transition: var(--transition);
}

.action-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.1);
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* 视图切换 */
.view-toggle {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 0.25rem;
    gap: 0.25rem;
}

.view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--text-dim);
    cursor: pointer;
    transition: var(--transition);
}

.view-btn:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.view-btn.active {
    background: var(--accent);
    color: white;
}

/* 更多按钮 */
.more-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.more-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.more-btn .more-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.more-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.more-icon {
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
}

/* 更多菜单 */
.more-menu {
    position: fixed;
    top: 80px;
    right: 2rem;
    left: auto;
    width: 400px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    display: none;
    z-index: 99999;
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.more-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@media (max-width: 768px) {
    .more-menu {
        right: 1rem;
        left: 1rem;
        width: auto;
        top: 70px;
    }
}

@media (max-width: 480px) {
    .more-menu {
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
    }
}

.more-menu-title {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    font-weight: 600;
}

.more-menu-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0.5rem 1.5rem 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

@media (max-width: 480px) {
    .more-menu-list {
        grid-template-columns: 1fr;
    }
}

.category-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    animation: fadeInUp 0.4s ease backwards;
}

.category-btn:nth-child(1) { animation-delay: 0.1s; }
.category-btn:nth-child(2) { animation-delay: 0.15s; }
.category-btn:nth-child(3) { animation-delay: 0.2s; }
.category-btn:nth-child(4) { animation-delay: 0.25s; }
.category-btn:nth-child(5) { animation-delay: 0.3s; }
.category-btn:nth-child(6) { animation-delay: 0.35s; }
.category-btn:nth-child(7) { animation-delay: 0.4s; }
.category-btn:nth-child(8) { animation-delay: 0.45s; }
.category-btn:nth-child(9) { animation-delay: 0.5s; }
.category-btn:nth-child(10) { animation-delay: 0.55s; }

.category-btn:hover {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    border-color: transparent;
    color: white;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

.more-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.more-menu-item:hover {
    background: var(--surface-hover);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
}

.more-menu-item.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

.more-menu-item-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ==================== 主内容区 ==================== */
.content {
    flex: 1;
    padding: 1rem;
    padding-top: 90px;
    padding-bottom: 2rem;
    min-height: calc(100vh - 70px);
}

/* 画廊 */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    max-width: 1600px;
    margin: 0 auto;
}

/* 单列大图视图 */
.gallery.single {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.gallery.single .wallpaper-card {
    display: flex;
    flex-direction: column;
    aspect-ratio: auto;
    height: auto;
    animation-delay: 0s !important;
    border-radius: 16px;
}

.gallery.single .wallpaper-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/10;
    min-height: 300px;
    object-fit: cover;
    animation-delay: 0s !important;
    transition: transform 0.4s ease;
}

.gallery.single .wallpaper-card:hover img {
    transform: scale(1.03);
}

.gallery.single .wallpaper-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery.single .wallpaper-card:hover .wallpaper-info {
    opacity: 1;
}

.gallery.single .wallpaper-title {
    font-size: 1rem;
    font-weight: 500;
    color: white;
    margin-bottom: 0.5rem;
}

.gallery.single .wallpaper-actions {
    display: flex;
    gap: 0.75rem;
}

.gallery.single .wallpaper-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    font-size: 1rem;
    transition: var(--transition);
}

.gallery.single .wallpaper-action:hover {
    background: var(--accent);
    transform: scale(1.1);
}

/* 壁纸卡片 */
.wallpaper-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    animation: fadeInUp 0.5s ease backwards;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.wallpaper-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(99, 102, 241, 0.2), 0 12px 24px rgba(0, 0, 0, 0.15);
}

.wallpaper-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.wallpaper-card:hover::before {
    left: 100%;
}

.wallpaper-card img {
    width: 100%;
    aspect-ratio: 4/3;
    min-height: 180px;
    object-fit: cover;
    display: block;
    background: var(--surface);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s ease;
}

.wallpaper-card:hover img {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.wallpaper-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wallpaper-card:hover .wallpaper-info {
    opacity: 1;
}

.wallpaper-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    margin-bottom: 0.25rem;
}

.wallpaper-actions {
    display: flex;
    gap: 0.5rem;
}

.wallpaper-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--transition);
}

.wallpaper-action:hover {
    background: var(--accent);
}

/* 加载动画 */
.loading {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: var(--text-secondary);
    font-size: 1rem;
    text-align: center;
}

.loading.show {
    display: flex;
    opacity: 1;
}

.loading-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 0.5rem;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.6), 0 0 30px rgba(99, 102, 241, 0.4);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 壁纸卡片动画 */
.wallpaper-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInScale 0.4s ease backwards;
}

.wallpaper-card:nth-child(1) { animation-delay: 0.05s; }
.wallpaper-card:nth-child(2) { animation-delay: 0.1s; }
.wallpaper-card:nth-child(3) { animation-delay: 0.15s; }
.wallpaper-card:nth-child(4) { animation-delay: 0.2s; }
.wallpaper-card:nth-child(5) { animation-delay: 0.25s; }
.wallpaper-card:nth-child(6) { animation-delay: 0.3s; }
.wallpaper-card:nth-child(7) { animation-delay: 0.35s; }
.wallpaper-card:nth-child(8) { animation-delay: 0.4s; }
.wallpaper-card:nth-child(9) { animation-delay: 0.45s; }
.wallpaper-card:nth-child(10) { animation-delay: 0.5s; }
.wallpaper-card:nth-child(11) { animation-delay: 0.55s; }
.wallpaper-card:nth-child(12) { animation-delay: 0.6s; }

.wallpaper-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.wallpaper-card img {
    width: 100%;
    aspect-ratio: 4/3;
    min-height: 180px;
    object-fit: cover;
    display: block;
    background: var(--surface);
    transition: transform 0.4s ease, opacity 0.3s ease;
    opacity: 0;
    animation: imgFadeIn 0.5s ease forwards;
    animation-delay: calc(0.1s + var(--i, 0) * 0.05s);
}

@keyframes imgFadeIn {
    to {
        opacity: 1;
    }
}

.wallpaper-card:hover img {
    transform: scale(1.05);
}

.wallpaper-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.wallpaper-card:hover .wallpaper-info {
    opacity: 1;
    transform: translateY(0);
}

.wallpaper-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    margin-bottom: 0.25rem;
}

.wallpaper-actions {
    display: flex;
    gap: 0.5rem;
}

.wallpaper-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--transition), background 0.2s ease, transform 0.2s ease;
}

.wallpaper-action:hover {
    background: var(--accent);
    transform: scale(1.1);
}
.preview {
    display: flex;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.6s ease, backdrop-filter 0.6s ease;
}

.preview.show {
    opacity: 1;
    pointer-events: auto;
}

.preview-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    font-size: 1.75rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.preview-close:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.preview-actions {
    position: absolute;
    top: 1.5rem;
    right: 5.5rem;
    display: flex;
    gap: 0.75rem;
}

.preview-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.preview-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.preview-img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.preview.show .preview-img {
    opacity: 1;
    transform: scale(1);
}

/* ==================== 回到顶部 ==================== */
.back-top {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    width: 50px;
    height: 50px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px) scale(0.7);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 24px;
    line-height: 1;
}

.back-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-top:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 8px 30px var(--accent-glow);
    background: #4f46e5;
}

.back-top:active {
    transform: translateY(-2px) scale(0.95);
}

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 0.875rem;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 0.5rem 1rem;
    }
    
    .logo-text {
        display: none;
    }
    
    .search-wrapper {
        max-width: none;
    }
    
    .top-actions {
        gap: 0.5rem;
    }
    
    .action-link {
        width: 36px;
        height: 36px;
    }
    
    .view-toggle {
        display: none;
    }
    
    .content {
        padding: 0.75rem;
        padding-top: 70px;
        padding-bottom: 90px;
    }
    
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .wallpaper-info {
        padding: 0.75rem;
    }
    
    .wallpaper-title {
        font-size: 0.8rem;
    }
    
    .preview-actions {
        right: 4rem;
    }
    
    .preview-close,
    .preview-btn {
        width: 40px;
        height: 40px;
    }
    
    .back-top {
        bottom: 1.5rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .nav-item {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .nav-icon {
        display: none;
    }
    
    .content {
        padding-top: 70px;
    }
    
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery.single .wallpaper-card img {
        min-height: 200px;
        aspect-ratio: 16/12;
    }
    
    .gallery.single .wallpaper-action {
        width: 36px;
        height: 36px;
    }
    
    .content {
        padding-top: 70px;
        padding-bottom: 80px;
    }
}

/* ==================== 响应式 ==================== */
@media (min-width: 768px) {
    .more-btn {
        display: flex;
    }
    
    .category-scroll {
        overflow-x: hidden;
    }
    
    .category-items {
        flex-wrap: nowrap;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 0.5rem 1rem;
    }
    
    .top-bar-inner {
        padding: 0.5rem 1rem;
    }
    
    .logo-text {
        display: none;
    }
    
    .search-wrapper {
        flex: 0;
        max-width: none;
    }
    
    .top-actions {
        gap: 0.5rem;
    }
    
    .action-link {
        width: 36px;
        height: 36px;
    }
    
    .view-toggle {
        display: none;
    }
    
    .content {
        padding: 0.75rem;
        padding-top: 120px;
        padding-bottom: 1rem;
    }
    
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .wallpaper-info {
        padding: 0.75rem;
    }
    
    .wallpaper-title {
        font-size: 0.8rem;
    }
    
    .preview-actions {
        right: 4rem;
    }
    
    .preview-close,
    .preview-btn {
        width: 40px;
        height: 40px;
    }
    
    .back-top {
        bottom: 1.25rem;
        right: 1rem;
        width: 42px;
        height: 42px;
        font-size: 18px;
    }
    
    .more-menu {
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
        top: 120px;
    }
    
    .more-menu-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .category-item {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .category-icon {
        display: none;
    }
    
    .gallery {
        grid-template-columns: 1fr;
    }
    
    .gallery.single .wallpaper-card img {
        min-height: 180px;
        aspect-ratio: 4/3;
    }
    
    .gallery.single .wallpaper-action {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
    
    .content {
        padding-top: 170px;
    }
    
    .more-menu-list {
        grid-template-columns: 1fr;
    }
}
