/*
 * 作品展示站点样式
 * 使用粉紫色调和磨砂质感的视觉风格
 */



/* 自定义鼠标样式 - 紫粉箭头主题 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path d="M2 2L18 10L10 12L8 18L2 2Z" fill="%23ff61d2" stroke="%23ffffff" stroke-width="1"/><path d="M2 2L10 12" stroke="%23a13df0" stroke-width="1.5" opacity="0.8"/></svg>') 2 2, auto;
}
/* 全局图片：防止内联基线空隙和布局抖动 */
img { max-width: 100%; height: auto; display: block; }

/* 悬停时的鼠标样式 */
a, button, .card, .clickable, select, input[type="submit"] {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path d="M2 2L22 12L12 14L10 22L2 2Z" fill="%23a13df0" stroke="%23ffffff" stroke-width="1.5"/><path d="M2 2L12 14" stroke="%23ff61d2" stroke-width="2" opacity="0.9"/><circle cx="16" cy="8" r="2" fill="%23fe9090" opacity="0.7"/></svg>') 2 2, pointer !important;
}

/* 文本选择时的鼠标样式 */
input, textarea, [contenteditable] {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><rect x="9" y="2" width="2" height="16" fill="%23ff61d2"/><rect x="6" y="2" width="8" height="2" fill="%23ff61d2"/><rect x="6" y="16" width="8" height="2" fill="%23ff61d2"/><circle cx="10" cy="2" r="1" fill="%23a13df0"/><circle cx="10" cy="18" r="1" fill="%23a13df0"/></svg>') 10 10, text !important;
}

/* 主题变量（便于快速微调） */
:root {
    --panel-bg: rgba(255, 255, 255, 0.06);
    --panel-border: rgba(255, 255, 255, 0.18);
    --panel-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --chip-bg: rgba(255, 255, 255, 0.08);
    --chip-border: rgba(255, 255, 255, 0.16);
    --chip-bg-active: linear-gradient(135deg, rgba(255,97,210,0.25), rgba(161,61,240,0.25));
    --chip-border-active: rgba(255,97,210,0.6);
    --input-bg: rgba(255,255,255,0.08);
    --input-bg-focus: rgba(255,255,255,0.12);
    --ring: rgba(255, 97, 210, 0.45);
    /* 固定区域高度与内容间距，用于定位与内容偏移 */
    --header-h: 60px;   /* 头部估算高度 */
    --toolbar-h: 96px;  /* 工具栏估算高度（含搜索/筛选/排序卡片） */
    --header-toolbar-gap: 20px; /* logo栏与搜索栏之间的间距（小） */
    --content-gap: 8px; /* 工具栏与内容之间的垂直间距（小） */
}

html, body {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    /* 暗色渐变背景，偏粉紫色调 */
    background: linear-gradient(180deg, #0e021d 0%, #3c185f 50%, #581c87 100%);
    color: #e5dbff;
    min-height: 100vh;
    /* 页面淡入效果，避免跳转时的闪烁 */
    animation: pageIn 0.15s ease-out;
    /* 平滑的背景过渡 */
    transition: background-color 0.1s ease;
    /* 只允许Y轴滚动，避免任何X轴滚动 */
    overflow-x: hidden;
    /* 阻止移动端下拉触发浏览器刷新（Chrome Android 等） */
    overscroll-behavior-y: none;
}

/* 交互统一按压动画与涟漪效果 */
.pressable { 
    position: relative; 
    transition: transform 0.08s ease, filter 0.12s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease; 
}
.pressable:active { transform: scale(0.98); filter: brightness(0.98); }
.pressable:hover { filter: brightness(1.05); }
.pressable:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(255,255,255,0.2); }
.ripple { overflow: hidden; }
.ripple::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0; height: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.35) 0%, rgba(255,255,255,0) 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
}
.ripple:active::after {
    width: 220%; height: 220%;
    opacity: 1;
    transition: width 0.35s ease, height 0.35s ease, opacity 0.5s ease;
}

/* 可视性隐藏但保留可访问性 */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 页面切换时的过渡状态 */
body.transitioning {
    background: linear-gradient(180deg, #0e021d 0%, #3c185f 50%, #581c87 100%);
    animation: pageOut 0.18s ease forwards;
}

/* 页面淡入动画 - 优化避免闪烁 */
@keyframes pageIn {
    from {
        opacity: 0.3;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageOut {
    to {
        opacity: 0;
        transform: translateY(6px);
        filter: blur(2px);
    }
}

/* 头部样式 */
.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 140;
    backdrop-filter: blur(20px);
    background: rgba(28, 0, 50, 0.6);
    padding: 8px 16px; /* 顶部与左右留白更紧凑 */
    /* 使用两列网格：左侧固定 logo，右侧占据剩余空间 */
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 12px;     /* 收紧左右间距，让logo更靠近右侧区域 */
    row-gap: 8px;         /* 小屏换行时的行间距 */
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* 居中容器（顶部与工具栏使用） */
.container {
    width: min(1200px, 100%);
    margin-inline: auto;
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    box-sizing: border-box;
}

/* 工具栏区块（正常文档流，位于头部下方） */
.toolbar {
    position: relative;
    margin: var(--header-toolbar-gap) auto 0;
    z-index: 130; /* 低于模态(200)，高于内容 */
}

/* 可折叠搜索栏：固定在顶部的小条 */
.search-toggle-bar {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 125;
    background: rgba(28, 0, 50, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-toggle-bar.visible {
    opacity: 1;
    pointer-events: auto;
}

.search-toggle-bar:hover {
    background: rgba(28, 0, 50, 0.95);
    transform: translateX(-50%) scale(1.05);
}

.search-toggle-text {
    color: #e5dbff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-toggle-icon {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

/* 展开状态的搜索栏 */
.toolbar.expanded {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    z-index: 135;
    background: rgba(28, 0, 50, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: expandToolbar 0.3s ease;
}

@keyframes expandToolbar {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

/* 让正文从头部下方开始，工具栏现在在正常文档流中 */
main {
    padding-top: calc(var(--header-h) + var(--content-gap));
    width: 100%;
    box-sizing: border-box;
}

/* LOGO容器：横向排列图标和文字 */
.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto; /* 避免过度收缩，和右侧区块自然分配 */
    cursor: pointer; /* 作为返回主页的可点击区域 */
    transition: transform 0.15s ease, filter 0.15s ease;
}

/* Logo 区域交互反馈：更明显一些 */
.logo-container:hover {
    transform: translateY(-1px) scale(1.02);
    filter: brightness(1.06);
}
.logo-container:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
    border-radius: 10px;
}
/* 提升文字发光感（不影响布局） */
.logo-container:hover .logo-text-dynamic {
    text-shadow: 0 0 10px rgba(255, 97, 210, 0.65), 0 0 18px rgba(161, 61, 240, 0.45);
}

/* 用户提供的图标样式 */
.user-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
}

/* 动态渐变文字样式 - AI SHOWCASE logo效果 */
.logo-text-dynamic {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Courier New', monospace; /* 马赛克字体效果 */
    background: linear-gradient(90deg, #ff61d2, #a13df0, #fe9090);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 6s linear infinite;
    filter: blur(0.3px); /* 虚化特效 */
    text-shadow: 0 0 8px rgba(255, 97, 210, 0.5), 0 0 16px rgba(161, 61, 240, 0.3);
    letter-spacing: 1px;
    position: relative;
}

.logo-text-dynamic::before {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    filter: blur(1px);
    opacity: 0.3;
    z-index: -1;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* 搜索 + 筛选 + 排序：右侧区块，使用响应式网格布局 */
.search-filter {
    /* 在右侧网格列中，限制宽度并在剩余空间内水平居中 */
    width: min(100%, 1000px);
    justify-self: center;
    margin-left: 0;
    display: grid;
    grid-template-columns: 1fr auto; /* 左：搜索；右：排序 */
    grid-template-areas:
        "search sort"
        "filters display"
        "results results";
    column-gap: 12px;
    row-gap: 10px;
    align-items: center;
    min-width: 280px;
    /* 现代玻璃卡片视觉 */
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    padding: 12px;
    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(14px);
}

@media (max-width: 1200px) {
    .site-header { grid-template-columns: 1fr; }
    :root { --header-h: 64px; --toolbar-h: 116px; --header-toolbar-gap: 20px; --content-gap: 8px; }
    .search-filter {
        grid-template-columns: 1fr; /* 垂直堆叠 */
        grid-template-areas:
            "search"
            "filters"
            "sort"
            "display"
            "results";
        justify-self: stretch; /* 小屏占满右侧列（此时仅一列） */
        width: 100%;
        row-gap: 12px;
    }
    
    .display-mode-controls {
        justify-self: start; /* 小屏幕上左对齐 */
    }
    
    .results-count {
        justify-self: start; /* 小屏幕上左对齐 */
        text-align: left;
    }
    
    .card {
        max-width: 350px;
        border-radius: 12px; /* 确保移动端也有圆角 */
        overflow: hidden; /* 确保内容不会超出圆角 */
    }
    .card img {
        max-height: 350px; /* 设置最大高度而不是固定高度 */
    }
    
    /* 移动端图片优化 - 使用最大高度而不是固定高度 */
    .card.portrait img,
    .card.landscape img,
    .card.square img {
        width: 100%;
        height: 100%; /* 填充整个容器 */
        object-fit: cover; /* 裁切以适应容器 */
    }
    
    /* 竖图依然保持顶部优先 */
    .card.portrait img {
        object-position: center top;
    }
}

@media (max-width: 768px) {
    :root { --header-h: 64px; --toolbar-h: 160px; --header-toolbar-gap: 20px; --content-gap: 8px; }
    .sort-controls { 
        justify-self: start; 
        width: 100%;
        margin-top: 4px;
    }
    .sort-controls select { width: 100%; }
    
    .display-mode-controls {
        justify-self: start;
        margin-top: 2px;
    }
    
    .card {
        max-width: 300px;
        border-radius: 16px;
        overflow: hidden;
    }
    
    .card img {
        max-height: 300px; /* 设置最大高度 */
    }
    
    /* 小屏幕所有图片统一处理 */
    .card.portrait img,
    .card.landscape img,
    .card.square img {
        width: 100%;
        height: 100%; /* 填充整个容器 */
        object-fit: cover; /* 裁切以适应容器 */
    }
    
    /* 小屏幕竖图保持顶部优先 */
    .card.portrait img {
        object-position: center top;
    }
    
    .card:hover {
        transform: translateY(-0.2px) scale(1.001);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.05);
        transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
    }
    
    /* 移动设备上简化3D效果 */
    .card::before,
    .card::after {
        display: none; /* 移动设备上隐藏复杂光影 */
    }
    
    .card .overlay {
        padding: 20px;
        gap: 6px;
    }
    
    .card .overlay span:first-child {
        font-size: 15px;
    }
    
    .card .overlay span:nth-child(2) {
        font-size: 12px;
    }
    
    .card .overlay span:last-child {
        font-size: 13px;
        margin-top: 4px;
    }
}
#searchInput {
    grid-area: search;
    height: 44px;
    padding: 0 44px 0 40px; /* 预留左侧图标与右侧空间 */
    border-radius: 24px;
    border: 1px solid var(--panel-border);
    width: 100%;
    max-width: none;
    background: var(--input-bg);
    color: #e5dbff;
    outline: none;
    transition: box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23d9c6f3" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>');
    background-repeat: no-repeat;
    background-position: 12px center;
}
#searchInput::placeholder {
    color: #cdb5e6;
}
#searchInput:focus {
    background: var(--input-bg-focus);
    border-color: var(--chip-border-active);
    box-shadow: 0 0 0 3px rgba(255,97,210,0.18), 0 8px 18px rgba(0,0,0,0.35);
}
.filters {
    grid-area: filters;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 8px;
    font-size: 14px;
    max-width: 100%;
    justify-self: start; /* 左对齐 */
}
.filters label {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    color: #e5dbff;
    padding: 8px 12px;
    border-radius: 9999px;
    background: var(--chip-bg);
    border: 1px solid var(--chip-border);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.08s ease;
    text-align: center;
}
.filters label:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.28);
    box-shadow: 0 6px 16px rgba(161,61,240,0.25), 0 0 0 2px rgba(255,255,255,0.06) inset;
}
.filters input[type="radio"] {
    /* 隐藏原生单选按钮，保留可访问性 */
    position: absolute;
    width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.filters label:has(input:checked) {
    background: var(--chip-bg-active);
    border-color: var(--chip-border-active);
    box-shadow: 0 4px 14px rgba(255,97,210,0.28), inset 0 0 0 1px rgba(255,255,255,0.08);
}
.filters label:active { transform: scale(0.98); }

/* 小屏下：筛选改为栅格布局，允许换行，避免文字被截断 */
@media (max-width: 768px) {
    .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow: visible; padding-bottom: 0; }
    .filters label {
        display: flex;
        width: 100%;
        align-items: center;
    justify-content: center;
    text-align: center;
        white-space: normal;      /* 允许多行显示 */
        word-break: break-word;   /* 长单词也能断行 */
        line-height: 1.2;
    padding: 8px 10px;       /* 更紧凑的可点区域 */
        font-size: 13px;          /* 略微减小字体适配小屏 */
    }
}
/* 极窄屏下（如 320px），降为单列，避免拥挤 */
@media (max-width: 360px) {
    .filters { grid-template-columns: 1fr; }
    
    .card {
        max-width: 280px;
    }
    
    /* 极小屏幕图片高度优化 - 使用最大高度而非固定高度 */
    .card img {
        max-height: 250px;
    }
    
    /* 极小屏幕所有图片统一处理 */
    .card.portrait img,
    .card.landscape img,
    .card.square img {
        width: 100%;
        height: 100%; /* 填充整个容器 */
        object-fit: cover; /* 裁切以适应容器 */
    }
    
    /* 极小屏幕竖图保持顶部优先 */
    .card.portrait img {
        object-position: center top;
    }
    
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

.sort-controls {
    grid-area: sort;              /* 网格区域 */
    font-size: 14px;
    color: #e5dbff;
    justify-self: end;            /* 右对齐 */
    display: flex;
    align-items: center;
}
.sort-controls label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.sort-controls select {
    padding: 8px 12px;
    border-radius: 10px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #e5dbff;
    outline: none;
    cursor: pointer;
    backdrop-filter: blur(8px);
}
.sort-controls #sortOpenBtn {
    position: relative;
    height: 44px;
    padding: 0 40px 0 38px; /* 左图标 + 文字 + 右箭头空间 */
    border-radius: 24px;
    border: 1px solid var(--panel-border);
    background: var(--input-bg);
    color: #e5dbff;
    cursor: pointer;
    transition: background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, transform 0.08s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.sort-controls #sortOpenBtn:hover {
    background: var(--input-bg-focus);
    border-color: var(--chip-border-active);
    box-shadow: 0 8px 18px rgba(0,0,0,0.35), 0 0 0 2px rgba(255,255,255,0.06) inset;
    transform: translateY(-1px);
}
.sort-controls #sortOpenBtn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,97,210,0.18), 0 8px 20px rgba(161,61,240,0.3);
}
.results-count {
    grid-area: results;           /* 分配到专门的网格区域 */
    opacity: 0.85;
    font-size: 13px;
    text-align: right;
    justify-self: end;
    margin-top: 4px;
    margin-right: 4px;
}
.sort-controls #sortOpenBtn::before {
    content: '';
    position: absolute;
    left: 12px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="%23d9c6f3" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M7 12h14"/><path d="M11 18h10"/></svg>');
    background-size: 18px 18px;
    background-repeat: no-repeat;
}
.sort-controls #sortOpenBtn::after {
    content: '';
    position: absolute;
    right: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23d9c6f3" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"/></svg>');
    background-size: 16px 16px;
    background-repeat: no-repeat;
}

/* 重新随机排序按钮 */
.reshuffle-btn {
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid rgba(255, 97, 210, 0.4);
    background: linear-gradient(135deg, rgba(255, 97, 210, 0.2), rgba(161, 61, 240, 0.2));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: white;
    margin-left: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.15) inset,
        0 3px 10px rgba(255, 97, 210, 0.25),
        0 1px 3px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

/* 仅在随机排序模式下显示重排按钮 */
body.random-sort-active .reshuffle-btn {
    display: inline-flex !important;
}

.reshuffle-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 97, 210, 0.1) 50%, 
        rgba(161, 61, 240, 0.05) 100%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.reshuffle-btn:hover {
    background: linear-gradient(135deg, rgba(255, 97, 210, 0.35), rgba(161, 61, 240, 0.35));
    border-color: rgba(255, 97, 210, 0.6);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.2) inset,
        0 6px 20px rgba(255, 97, 210, 0.4),
        0 0 25px rgba(161, 61, 240, 0.3);
    transform: translateY(-2px) scale(1.05);
}

.reshuffle-btn:hover::before {
    opacity: 1;
}

.reshuffle-btn:active {
    transform: translateY(0) scale(1.02);
    transition: transform 0.1s ease;
}

.reshuffle-btn.rotating {
    animation: rotate360 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rotate360 {
    0% { 
        transform: rotate(0deg) scale(1); 
    }
    50% { 
        transform: rotate(180deg) scale(1.1); 
        box-shadow: 
            0 0 0 1px rgba(255, 255, 255, 0.3) inset,
            0 8px 25px rgba(255, 97, 210, 0.6),
            0 0 30px rgba(161, 61, 240, 0.5);
    }
    100% { 
        transform: rotate(360deg) scale(1); 
    }
}

.reshuffle-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.5px;
    fill: none;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
}

/* 显示模式控制按钮 */
.display-mode-controls {
    grid-area: display;           /* 分配到专门的网格区域 */
    display: flex;
    gap: 6px;
    justify-self: end;            /* 右对齐 */
    align-items: center;
}

.display-mode-label {
    font-size: 14px;
    color: #e5dbff;
    margin-right: 2px;
}

.display-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(255, 97, 210, 0.3);
    background: linear-gradient(135deg, rgba(255, 97, 210, 0.15), rgba(161, 61, 240, 0.15));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        0 2px 8px rgba(255, 97, 210, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.display-mode-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.05) 0%, 
        rgba(255, 97, 210, 0.08) 50%, 
        rgba(161, 61, 240, 0.05) 100%);
    z-index: 0;
    transition: opacity 0.3s ease;
}

.display-mode-btn:hover {
    background: linear-gradient(135deg, rgba(255, 97, 210, 0.25), rgba(161, 61, 240, 0.25));
    border-color: rgba(255, 97, 210, 0.5);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 15px rgba(255, 97, 210, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: white;
}

.display-mode-btn:hover::before {
    opacity: 1.5;
}

.display-mode-btn.active {
    background: linear-gradient(135deg, rgba(255, 97, 210, 0.4), rgba(161, 61, 240, 0.4));
    border-color: rgba(255, 97, 210, 0.7);
    color: white;
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.2) inset, 
        0 4px 15px rgba(255, 97, 210, 0.4),
        0 0 20px rgba(161, 61, 240, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.display-mode-btn.active::before {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 97, 210, 0.15) 50%, 
        rgba(161, 61, 240, 0.1) 100%);
}

.display-mode-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.2px;
    fill: none;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* 移动端显示模式按钮优化 */
@media (max-width: 768px) {
    .display-mode-controls {
        gap: 3px;
        margin-left: 6px;
    }
    
    .display-mode-btn {
        width: 28px;
        height: 28px;
        border-radius: 5px;
        border-width: 1px;
    }
    
    .display-mode-btn svg {
        width: 12px;
        height: 12px;
        stroke-width: 2.4px;
    }
}

@media (max-width: 480px) {
    .sort-controls {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
    
    .display-mode-controls {
        order: 2;
        margin-left: 0;
        margin-top: 8px;
        gap: 4px;
    }
    
    .display-mode-btn {
        width: 26px;
        height: 26px;
        border-radius: 4px;
    }
    
    .display-mode-btn svg {
        width: 11px;
        height: 11px;
        stroke-width: 2.6px;
    }
}

/* 给分页按钮与页脚链接统一交互反馈 */
.pagination button,
.pagination .pagination-btn,
.site-footer a {
    position: relative;
}
.pagination button.pressable,
.pagination .pagination-btn.pressable,
.site-footer a.pressable { transition: transform 0.08s ease, filter 0.12s ease; }
.pagination button.pressable:active,
.pagination .pagination-btn.pressable:active,
.site-footer a.pressable:active { transform: scale(0.98); filter: brightness(0.98); }
.sort-controls select option {
    background: #2a1a4a;
    color: #e5dbff;
}

/* ========================================
   画廊布局系统 - 统一管理
   ======================================== */

/* 基础画廊样式 */
.gallery {
    display: grid;
    gap: 14px;
    padding: 10px 6px;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overscroll-behavior: contain;
    transition: opacity 0.3s ease, transform 0.3s ease; /* 添加切换动画 */
}

/* 筛选和模式切换时的淡入动画 */
.gallery.updating {
    opacity: 0.7;
    transform: translateY(10px);
}

.gallery.fade-in {
    animation: galleryFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* 默认模式（无特殊类或display-mode-default类） */
.gallery,
.display-mode-default .gallery {
    grid-template-columns: repeat(5, 1fr);
}

/* 小图模式 */
.display-mode-small .gallery {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 14px;
    width: 98%;
    justify-items: center;
}

/* 大图模式 */
.display-mode-large .gallery {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    max-width: 1200px;
}

/* ========================================
   响应式布局 - 按屏幕尺寸调整
   ======================================== */

/* 超大屏幕 (1920px+) */
@media (min-width: 1920px) {
    .gallery,
    .display-mode-default .gallery {
        grid-template-columns: repeat(5, 1fr);
        gap: 16px;
        padding: 12px 20px;
    }
    
    .display-mode-small .gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 14px;
    }
}

/* 大屏幕 (1440px - 1919px) */
@media (min-width: 1440px) and (max-width: 1919px) {
    .gallery,
    .display-mode-default .gallery {
        grid-template-columns: repeat(5, 1fr);
        gap: 14px;
        padding: 10px 15px;
    }
    
    .display-mode-small .gallery {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    }
}

/* 中等屏幕 (1200px - 1439px) */
@media (min-width: 1200px) and (max-width: 1439px) {
    .gallery,
    .display-mode-default .gallery {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .display-mode-small .gallery {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* 小屏幕平板 (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .gallery,
    .display-mode-default .gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 8px 10px;
    }
    
    .display-mode-small .gallery {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }
}

/* 手机 (480px - 767px) */
@media (min-width: 480px) and (max-width: 767px) {
    .gallery,
    .display-mode-default .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 8px;
    }
    
    .display-mode-small .gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
        padding: 12px;
    }
}

/* 小手机 (< 480px) */
@media (max-width: 479px) {
    .gallery,
    .display-mode-default .gallery {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 6px;
    }
    
    .display-mode-small .gallery {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 6px;
        padding: 10px;
    }
}

/* 大图显示模式 - 专门为横图和方图优化 */
.display-mode-large .gallery {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.display-mode-large .card {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: auto;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 
        0 12px 40px rgba(0,0,0,0.2),
        0 4px 12px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.1);
}

/* 大图模式下的图片容器 - 统一处理所有比例 */
.display-mode-large .card {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.05); /* 轻微背景色，区分容器 */
}

/* 横图容器 */
.display-mode-large .card.landscape {
    width: 100%;
    margin: 0 auto;
}

.display-mode-large .card.landscape img {
    width: 100%;
    object-fit: contain;
    max-height: 80vh; /* 使用视口高度作为限制 */
    background: rgba(0, 0, 0, 0.05);
}

/* 方图容器 */
.display-mode-large .card.square {
    max-width: 80%;
    margin: 0 auto;
}

.display-mode-large .card.square img {
    width: 100%;
    object-fit: contain;
    max-height: 80vh;
    background: rgba(0, 0, 0, 0.05);
}

/* 竖图容器 */
.display-mode-large .card.portrait {
    max-width: 60%;
    margin: 0 auto;
}

.display-mode-large .card.portrait img {
    width: 100%;
    object-fit: contain;
    max-height: 90vh; /* 竖图可以稍高一些 */
    background: rgba(0, 0, 0, 0.05);
}

/* 通用图片样式 */
.display-mode-large .card img {
    display: block;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* 大图模式卡片悬停 - 极其微妙的效果，避免抖动 */
.display-mode-large .card:hover {
    transform: translateY(-0.2px) scale(1.001);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

/* 大图模式覆盖层 - 参考默认模式的优秀效果 */
.display-mode-large .card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
        transparent 0%, 
        rgba(20, 0, 40, 0.7) 30%,
        rgba(20, 0, 40, 0.95) 100%
    );
    color: #e5dbff;
    padding: 32px 24px 24px;
    font-size: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.display-mode-large .card:hover .overlay {
    opacity: 1;
    backdrop-filter: blur(20px);
}

.display-mode-large .card .overlay span:first-child {
    font-weight: 700;
    font-size: 20px;
    background: linear-gradient(135deg, #ff61d2, #fe9090, #a13df0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(255,97,210,0.3);
    letter-spacing: 0.5px;
}

.display-mode-large .card .overlay span:nth-child(2) {
    font-size: 16px;
    opacity: 0.9;
    color: #c9b6e8;
    font-weight: 500;
}

.display-mode-large .card .overlay span:last-child {
    font-size: 16px;
    color: #ff9ad5;
    font-weight: 600;
    margin-top: 8px;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(255,97,210,0.1);
    text-align: center;
    border: 1px solid rgba(255,97,210,0.2);
}

.display-mode-large .card:hover .overlay span:last-child {
    color: #fff;
    background: rgba(255,97,210,0.3);
    border-color: rgba(255,97,210,0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255,97,210,0.3);
}

/* 小图模式的卡片样式 */

.display-mode-small .card {
    position: relative;
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1/1; /* 保持1:1正方形 */
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 
        0 8px 25px rgba(0,0,0,0.15),
        0 3px 8px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
}

/* 小图模式卡片悬停 - 极其微妙的效果，避免抖动 */
.display-mode-small .card:hover {
    transform: translateY(-0.2px) scale(1.001);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

.display-mode-small .card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 裁切以适应正方形 */
    object-position: center;
    display: block;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    aspect-ratio: auto; /* 让比例自适应 */
}

/* 小图模式覆盖层 - 使用与默认模式相同的高对比度效果 */
.display-mode-small .card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
        transparent 0%, 
        rgba(20, 0, 40, 0.7) 30%,
        rgba(20, 0, 40, 0.95) 100%
    );
    color: #e5dbff;
    padding: 16px 12px 12px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.display-mode-small .card:hover .overlay {
    opacity: 1;
    backdrop-filter: blur(20px);
}

.display-mode-small .card .overlay span:first-child {
    font-weight: 700;
    font-size: 14px;
    background: linear-gradient(135deg, #ff61d2, #fe9090, #a13df0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(255,97,210,0.3);
    letter-spacing: 0.3px;
    line-height: 1.2;
}

.display-mode-small .card .overlay span:nth-child(2) {
    font-size: 11px;
    opacity: 0.9;
    color: #c9b6e8;
    font-weight: 500;
    line-height: 1.2;
}

.display-mode-small .card .overlay span:last-child {
    font-size: 11px;
    color: #ff9ad5;
    font-weight: 600;
    margin-top: 4px;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255,97,210,0.1);
    text-align: center;
    border: 1px solid rgba(255,97,210,0.2);
}

.display-mode-small .card:hover .overlay span:last-child {
    color: #fff;
    background: rgba(255,97,210,0.3);
    border-color: rgba(255,97,210,0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(255,97,210,0.3);
}

/* 页脚 */
.site-footer {
    text-align: center;
    padding: 24px;
    font-size: 14px;
    color: #bda6d6;
}
@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(60px) scale(0.95) rotateX(15deg);
        filter: blur(4px);
    }
    60% {
        opacity: 0.8;
        transform: translateY(-5px) scale(1.02) rotateX(2deg);
        filter: blur(1px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
        filter: blur(0px);
    }
}
/* 这个定义已被下方的更完整定义替代，删除以避免冲突 */
.card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(20, 0, 40, 0.8);
    color: #e5dbff;
    padding: 10px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}
.card:hover .overlay {
    opacity: 1;
}

/* 空状态提示 */
.empty-state {
    text-align: center;
    font-size: 18px;
    padding: 40px 20px;
    color: #bda6d6;
}

/* 分页控件样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 40px auto;
    padding: 20px;
    max-width: 600px;
    background: rgba(255,255,255,0.05);
    border-radius: 25px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.pagination button,
.pagination .pagination-btn {
    padding: 12px 24px;
    border-radius: 25px;
    border: none;
    background: linear-gradient(135deg, #ff61d2, #a13df0, #fe9090);
    background-size: 200% 200%;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    font-size: 15px;
    box-shadow: 
        0 4px 15px rgba(255,97,210,0.4),
        0 2px 8px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.2);
    position: relative;
    overflow: hidden;
    min-width: 100px;
    z-index: 1;
}

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

.pagination button:hover:not(:disabled),
.pagination .pagination-btn:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 8px 25px rgba(255,97,210,0.6),
        0 4px 15px rgba(161,61,240,0.4),
        inset 0 1px 0 rgba(255,255,255,0.3);
    background-position: 100% 0;
}

.pagination button:hover:not(:disabled)::before,
.pagination .pagination-btn:hover:not(:disabled)::before {
    left: 100%;
}

.pagination button:active:not(:disabled),
.pagination .pagination-btn:active:not(:disabled) {
    transform: translateY(-1px) scale(1.02);
    transition: all 0.1s ease;
}

.pagination button:disabled,
.pagination .pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    background: rgba(255,255,255,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    color: rgba(255,255,255,0.5);
}

.pagination button:disabled::before,
.pagination .pagination-btn:disabled::before {
    display: none;
}

.pagination .page-info {
    color: #e5dbff;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(255,255,255,0.08));
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 
        0 4px 15px rgba(0,0,0,0.1),
        inset 0 1px 0 rgba(255,255,255,0.2);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.pagination .page-info:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.12));
    border-color: rgba(255,97,210,0.4);
    transform: translateY(-1px);
    box-shadow: 
        0 6px 20px rgba(0,0,0,0.15),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.pagination .page-input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,97,210,0.5);
    border-radius: 8px;
    padding: 4px 8px;
    color: #e5dbff;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    width: 60px;
    outline: none;
}

.pagination .page-input:focus {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,97,210,0.8);
    box-shadow: 0 0 0 2px rgba(255,97,210,0.3);
}

/* 移动端分页按钮优化 */
@media (max-width: 768px) {
    .pagination {
        gap: 12px;
        margin: 30px auto;
        padding: 15px;
        border-radius: 20px;
    }
    
    .pagination button,
    .pagination .pagination-btn {
        padding: 10px 16px;
        font-size: 14px;
        min-width: 80px;
        border-radius: 18px;
    }
    
    .pagination .page-info {
        font-size: 14px;
        padding: 10px 16px;
        border-radius: 16px;
    }
    
    .pagination .page-input {
        width: 50px;
        font-size: 14px;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .pagination {
        gap: 8px;
        margin: 20px auto;
        padding: 12px;
        flex-wrap: wrap;
    }
    
    .pagination button,
    .pagination .pagination-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 70px;
        border-radius: 15px;
    }
    
    .pagination .page-info {
        font-size: 13px;
        padding: 8px 12px;
        border-radius: 14px;
        order: 3;
        width: 100%;
        text-align: center;
        margin-top: 8px;
    }
}

/* 页脚 */
.site-footer {
    text-align: center;
    padding: 24px;
    font-size: 14px;
    color: #bda6d6;
}

/* ===== 自定义模态弹窗（排序） ===== */
.modal-overlay[hidden] { display: none; }
.modal-overlay {
    position: fixed; inset: 0;
    display: grid; place-items: center;
    background: rgba(0,0,0,0.35);
    z-index: 200;
    animation: fadeIn 160ms ease-out;
    overscroll-behavior: contain; /* 弹窗出现时阻止链式回弹 */
}
.modal {
    width: min(520px, calc(100% - 32px));
    background: rgba(28, 0, 50, 0.86);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    backdrop-filter: blur(20px);
    transform: translateY(10px);
    opacity: 0;
    animation: slideUp 200ms ease-out forwards;
}
.modal-overlay.closing { animation: fadeOut 160ms ease-in forwards; }
.modal-overlay.closing .modal { animation: slideDown 180ms ease-in forwards; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: transparent; border: none; color: #e5dbff; font-size: 20px; line-height: 1; cursor: pointer; }
.modal-content { padding: 12px 12px 16px; }
.sort-options { list-style: none; display: grid; gap: 8px; }
.sort-options li label { width: 100%; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12); display: flex; align-items: center; gap: 10px; cursor: pointer; }
.sort-options li:first-child label { background: linear-gradient(135deg, rgba(255,97,210,0.15), rgba(161,61,240,0.15)); border-color: rgba(255,97,210,0.3); }
.sort-options input[type="radio"] { accent-color: #ff61d2; }

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: translateY(0) } }
@keyframes fadeOut { to { opacity: 0 } }
@keyframes slideDown { to { opacity: 0; transform: translateY(12px) } }

/* 流光效果 - 参考哲风壁纸的动效 */
.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255,255,255,0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg) translateX(-100%);
    transition: transform 0.6s ease;
    pointer-events: none;
    z-index: 1;
}

.card:hover::before {
    transform: rotate(45deg) translateX(100%);
}

/* 卡片边框光效 */
.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(45deg, 
        rgba(255,97,210,0.3),
        rgba(161,61,240,0.3),
        rgba(254,144,144,0.3),
        rgba(255,97,210,0.3)
    );
    background-size: 200% 200%;
    animation: borderGlow 3s ease-in-out infinite;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::after {
    /* 禁用边框光效避免视觉干扰 */
    opacity: 0;
}

@keyframes borderGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 卡牌hover时的基础样式 - 极其微妙的悬停效果，避免抖动 */
.card:hover {
    transform: translateY(-0.2px) scale(1.001);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.05);
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
}

.card {
    aspect-ratio: 4/3; /* 默认模式下使用4:3的比例 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%; /* 确保卡片占满分配的空间 */
    max-width: 100%; /* 确保不超出容器 */
    margin: 0 auto; /* 确保居中对齐 */
    box-sizing: border-box; /* 确保padding包含在宽度内 */
    border-radius: 12px; /* 添加圆角 */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1); /* 平滑过渡效果 */
}

/* 确保默认模式下的卡片和图片能适当缩放 */
.display-mode-default .card {
    min-width: 0; /* 允许卡片缩小 */
    width: 100%;
}

.card img {
    width: 100%;
    height: 100%; /* 填充整个容器 */
    object-fit: cover; /* 裁切以适应容器 */
    object-position: center center; /* 图片在卡片中居中显示 */
    display: block;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* 确保默认模式下图片始终填充卡片并居中 */
.display-mode-default .card img,
body:not([class*="display-mode"]) .card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center; /* 强制居中显示 */
}

/* 默认模式下针对不同比例图片的优化 */
.card.portrait img {
    object-position: center top; /* 优先显示顶部，避免裁切角色头部 */
}

/* 横图和方图居中显示 */
.card.landscape img,
.card.square img {
    object-position: center; /* 居中显示 */
}

/* 大图模式特定样式 */
.display-mode-large .card {
    aspect-ratio: auto; /* 大图模式下自适应图片比例 */
}

.display-mode-large .card.portrait img,
.display-mode-large .card.landscape img,
.display-mode-large .card.square img {
    height: auto;
    object-fit: contain; /* 保持完整显示图片，不裁切 */
    object-position: center;
    max-height: none; /* 让大图模式不受最大高度限制 */
}

/* 小图模式特定样式 */
.display-mode-small .card {
    aspect-ratio: 1/1; /* 小图模式使用1:1正方形 */
}

.display-mode-small .card.portrait img,
.display-mode-small .card.landscape img,
.display-mode-small .card.square img {
    height: 100%;
    width: 100%;
    object-fit: cover; /* 裁切以适应正方形 */
    object-position: center; /* 居中显示主体 */
}

/* 卡片覆盖层 - 专注动效体验 */
.card .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(
        transparent 0%, 
        rgba(20, 0, 40, 0.7) 30%,
        rgba(20, 0, 40, 0.95) 100%
    );
    color: #e5dbff;
    padding: 25px;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.card:hover .overlay {
    opacity: 1;
    backdrop-filter: blur(20px);
}

.card .overlay span:first-child {
    font-weight: 700;
    font-size: 16px;
    background: linear-gradient(135deg, #ff61d2, #fe9090, #a13df0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(255,97,210,0.3);
    letter-spacing: 0.5px;
}

.card .overlay span:nth-child(2) {
    font-size: 13px;
    opacity: 0.9;
    color: #c9b6e8;
    font-weight: 500;
}

.card .overlay span:last-child {
    font-size: 14px;
    color: #ff9ad5;
    font-weight: 600;
    margin-top: 6px;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255,97,210,0.1);
    text-align: center;
    border: 1px solid rgba(255,97,210,0.2);
}

.card:hover .overlay span:last-child {
    color: #fff;
    background: rgba(255,97,210,0.3);
    border-color: rgba(255,97,210,0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255,97,210,0.3);
}



/* ==== 交互与光效增强（追加覆盖，避免破坏原样式） ==== */
/* 画廊添加透视，提升3D倾斜的空间感 */
.gallery {
    perspective: 1000px;
    perspective-origin: center;
    transform-style: preserve-3d;
}

/* 卡片：合并will-change并定义高光角度变量 */
.card {
    will-change: transform, box-shadow;
    --glare-angle: 135deg;
}



/* 高光线性渐变角度由JS动态设置 */
.card::before {
    background: linear-gradient(
        var(--glare-angle, 135deg),
        rgba(255,255,255,0.12) 0%,
        transparent 55%,
        rgba(0,0,0,0.08) 100%
    );
}

/* 覆盖层参与轻微视差时补充transition */
.card .overlay {
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s ease;
}

/* 鼠标跟随的径向高光层 */
.card .glare {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.card:hover .glare {
    /* 禁用手指光晕效果避免视觉干扰 */
    opacity: 0;
}

/* 降级策略：触摸设备与减少动态 */
@media (hover: none), (pointer: coarse) {
    .card::before,
    .card .glare {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .card {
        transition: none;
        animation: none;
    }
    .card .overlay {
        transition: opacity 0.2s ease;
    }
}

/* ===== 社交媒体图标样式 ===== */

/* 头部布局：确保logo和社交图标正确分布 */
.header-inner {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
}

/* 社交媒体图标容器 */
.social-links-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.social-links-container:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 97, 210, 0.4);
    box-shadow: 0 6px 20px rgba(255, 97, 210, 0.15);
}

/* 社交媒体链接 */
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.social-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 97, 210, 0.2), rgba(161, 61, 240, 0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.social-link:hover {
    transform: translateY(-2px) scale(1.1);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 97, 210, 0.6);
    box-shadow: 0 4px 15px rgba(255, 97, 210, 0.3);
}

.social-link:hover::before {
    opacity: 1;
}

.social-link:active {
    transform: translateY(0) scale(1.05);
}

/* 社交媒体图标 */
.social-icon {
    width: 20px;
    height: 20px;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.social-link:hover .social-icon {
    filter: brightness(1.2) drop-shadow(0 0 8px rgba(255, 97, 210, 0.6));
}

/* Neta Art 链接样式 */
.neta-art-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.neta-art-link:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 97, 210, 0.4);
    color: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 97, 210, 0.15);
}

.neta-art-icon {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.neta-art-link:hover .neta-art-icon {
    filter: brightness(1.2) drop-shadow(0 0 8px rgba(255, 97, 210, 0.6));
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .social-links-container {
        gap: 10px;
        padding: 6px 12px;
    }
    
    .social-link {
        width: 32px;
        height: 32px;
    }
    
    .social-icon {
        width: 18px;
        height: 18px;
    }
    
    .header-inner {
        padding: 0 15px !important;
    }
    
    .neta-art-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 768px) {
    .social-links-container {
        gap: 8px;
        padding: 4px 8px;
        border-radius: 16px;
    }
    
    .social-link {
        width: 28px;
        height: 28px;
    }
    
    .social-icon {
        width: 16px;
        height: 16px;
    }
    
    .header-inner {
        padding: 0 10px !important;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .neta-art-link {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .neta-art-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .social-links-container {
        gap: 6px;
        padding: 4px 6px;
    }
    
    .social-link {
        width: 24px;
        height: 24px;
    }
    
    .social-icon {
        width: 14px;
        height: 14px;
    }
    
    .header-inner {
        padding: 0 8px !important;
    }
    
    .neta-art-link {
        font-size: 11px;
        padding: 4px 8px;
        gap: 6px;
    }
    
    .neta-art-icon {
        width: 16px;
        height: 16px;
    }
}

/* ===== 社交媒体图标样式结束 ===== */
