/* 全局样式 */
:root {
    /* 原神风格配色 */
    --primary-color: #5C7AEA;
    --primary-dark: #4A62B0;
    --secondary-color: #f5f6fa;
    --accent-gold: #FFD700;
    --accent-warm: #E07A5F;
    --text-color: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: rgba(255, 255, 255, 0.2);
    --background-gradient-start: #667eea;
    --background-gradient-end: #764ba2;
    --background-color: #ffffff;
    --card-background: rgba(255, 255, 255, 0.1);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.2);
    --success-color: #27ae60;
    --info-color: #3498db;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-blur: 10px;
}

/* 暗色主题 */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #5dade2;
        --secondary-color: #2c3e50;
        --text-color: #ecf0f1;
        --text-secondary: #bdc3c7;
        --border-color: #34495e;
        --background-color: #1a1a2e;
        --card-background: #16213e;
        --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--background-gradient-start), var(--background-gradient-end));
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 背景图容器 */
#background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

#background-container .bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    filter: brightness(0.6) saturate(0.8);
}

#background-container .bg-image.loaded {
    opacity: 1;
}

/* 背景粒子效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 215, 0, 0.05) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* 星星粒子 */
.star-particle {
    position: fixed;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    opacity: 0.6;
    animation: twinkle 3s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.2);
    }
}

/* 页面淡入动画 */
.container {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    position: relative;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
    50% {
        text-shadow: 0 2px 20px rgba(255, 215, 0, 0.5);
    }
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1em;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

/* 标题装饰星星 */
.header::before {
    content: '✦';
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    font-size: 2em;
    color: var(--accent-gold);
    animation: starFloat 4s ease-in-out infinite;
}

@keyframes starFloat {
    0%, 100% {
        transform: translateX(-50%) translateY(0) rotate(0deg);
    }
    50% {
        transform: translateX(-50%) translateY(-10px) rotate(180deg);
    }
}

/* 搜索面板 - 玻璃拟态 */
.search-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.search-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.03),
        transparent
    );
    animation: shimmer 6s linear infinite;
    pointer-events: none;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.search-box {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

#searchInput {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--glass-border);
    border-radius: 10px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    color: var(--text-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#searchInput::placeholder {
    color: rgba(92, 122, 234, 0.5);
}

#searchInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(92, 122, 234, 0.15);
    background: rgba(255, 255, 255, 0.3);
}

/* 按钮样式 - 优化 */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(92, 122, 234, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(92, 122, 234, 0.4);
}

.btn-secondary {
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-sm {
    padding: 10px 18px;
    font-size: 14px;
}

/* 过滤器样式 */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    color: var(--text-secondary);
}

select {
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: var(--background-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
}

#roleTypeFilter {
    min-width: 200px;
}

/* 提示框样式 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    border: 2px solid var(--info-color);
    color: var(--info-color);
}

/* 统计栏 - 玻璃拟态 */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 25px;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.stats-bar span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-bar span::before {
    content: '📊';
    font-size: 16px;
}

/* 结果容器 */
.results-container {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    min-height: 500px;
    max-height: 600px;
    overflow: hidden;
    margin-bottom: 20px;
    position: relative;
}

.virtual-scroll {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    padding: 15px;
    perspective: 1000px; /* 为3D效果提供透视 */
}

/* 对话卡片样式 - 3D悬停效果 */
.dialogue-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 18px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    position: relative;
}

.dialogue-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        transparent 50%,
        rgba(92, 122, 234, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.dialogue-card:hover::before {
    opacity: 1;
}

.dialogue-card:hover {
    border-color: var(--primary-color);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        0 0 20px rgba(92, 122, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-8px) rotateX(5deg) rotateY(0deg);
}

.dialogue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.dialogue-id {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 18px;
}

.dialogue-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-secondary);
}

.meta-badge {
    background: var(--secondary-color);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
}

.role-type-npc {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.role-type-player {
    background: rgba(52, 152, 219, 0.1);
    color: var(--info-color);
}

.dialogue-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    position: relative;
}

/* 中英文分栏分割线 */
.dialogue-content::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(255, 215, 0, 0.3),
        transparent
    );
    transform: translateX(-50%);
}

.content-section {
    padding: 15px 20px;
    border-radius: 8px;
    position: relative;
}

/* 左侧中文区 - 浅蓝背景 */
.content-section:first-child {
    background: rgba(92, 122, 234, 0.08);
    border-radius: 8px 0 0 8px;
}

/* 右侧英文区 - 浅金背景 */
.content-section:last-child {
    background: rgba(255, 215, 0, 0.08);
    border-radius: 0 8px 8px 0;
}

/* 内容标签 */
.content-label {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.content-section:first-child .content-label {
    color: var(--primary-color);
}

.content-section:last-child .content-label {
    color: var(--accent-gold);
}

.content-text {
    font-size: 15px;
    line-height: 1.8;
    word-wrap: break-word;
}

/* 默认高亮样式 */
.highlight,
mark {
    background: transparent !important;
    color: #ffcc33 !important; /* 原神对话中常用的金黄色 */
    font-weight: bold !important;
    text-shadow: 0 0 5px rgba(255, 204, 51, 0.4);
    padding: 0 !important;
}

/* 为内容区域的高亮添加更明显的视觉效果 */
.content-section mark,
.results-container mark {
    background: rgba(255, 255, 255, 0.1) !important;
    border-bottom: 1px dashed #ffcc33 !important;
    padding: 2px 4px !important;
}

/* 暗色主题下的高亮样式 */
@media (prefers-color-scheme: dark) {
    .highlight,
    mark {
        color: #ffcc33 !important;
        text-shadow: 0 0 5px rgba(255, 204, 51, 0.6) !important;
    }
    
    .content-section mark,
    .results-container mark {
        background: rgba(255, 204, 51, 0.15) !important;
        border-bottom-color: #ffcc33 !important;
    }
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

#pageInfo {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 16px;
}

/* 加载动画 - 原神派蒙光环风格 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
}

/* 外层光环 */
.spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

/* 内层光环 */
.spinner::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 3px solid transparent;
    border-top-color: var(--accent-gold);
    border-right-color: var(--accent-gold);
    border-radius: 50%;
    animation: spinInner 1.2s linear infinite;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* 外层光环 */
.spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    border: 3px solid transparent;
    border-bottom-color: var(--primary-color);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spinOuter 1.5s linear infinite reverse;
    box-shadow: 0 0 20px rgba(92, 122, 234, 0.4);
}

/* 中心元素符号 */
.spinner-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--accent-gold), var(--primary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    animation: pulse 1s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

@keyframes spinInner {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes spinOuter {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    }
}

.loading span {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    animation: textPulse 1.5s ease-in-out infinite;
}

@keyframes textPulse {
    0%, 100% {
        opacity: 0.7;
    }
    50% {
        opacity: 1;
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 18px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header {
        margin-bottom: 20px;
        padding: 15px 0;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    .search-panel {
        padding: 20px;
        border-radius: 12px;
    }
    
    .search-box {
        flex-direction: column;
        gap: 12px;
    }
    
    #searchInput {
        width: 100%;
    }
    
    .btn {
        width: 100%;
        padding: 12px 20px;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    #roleTypeFilter,
    #sortBy,
    #sortOrder,
    #pageSize {
        width: 100%;
    }
    
    .stats-bar {
        padding: 10px 15px;
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .results-container {
        min-height: 400px;
        max-height: 500px;
        border-radius: 12px;
    }
    
    .dialogue-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dialogue-content::after {
        display: none; /* 移动端隐藏分割线 */
    }
    
    .content-section {
        padding: 12px 15px;
        border-radius: 8px;
    }
    
    .content-section:first-child,
    .content-section:last-child {
        border-radius: 8px;
    }
    
    .dialogue-card {
        padding: 18px;
        margin-bottom: 15px;
    }
    
    .dialogue-card:hover {
        transform: translateY(-4px) rotateX(0deg); /* 移动端简化3D效果 */
    }
    
    .pagination {
        gap: 15px;
    }
    
    .pagination button {
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.6em;
    }
    
    .subtitle {
        font-size: 0.9em;
    }
    
    .dialogue-card {
        padding: 15px;
    }
    
    .dialogue-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .dialogue-id {
        font-size: 16px;
    }
    
    .content-section {
        padding: 10px 12px;
    }
    
    .content-text {
        font-size: 14px;
        line-height: 1.6;
    }
}

/* 滚动条样式 - 玻璃拟态 */
.virtual-scroll::-webkit-scrollbar {
    width: 10px;
}

.virtual-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 5px;
}

.virtual-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.virtual-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    box-shadow: 0 4px 12px rgba(92, 122, 234, 0.4);
    transform: translateY(-2px);
}

/* 选择框样式优化 */
select {
    padding: 10px 14px;
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

select:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--primary-color);
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(92, 122, 234, 0.15);
    background: rgba(255, 255, 255, 0.3);
}

/* ========== 移动端优化样式 ========== */

/* 惯性滚动优化 - iOS */
.virtual-scroll {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* 移动端筛选按钮 */
.mobile-filter-btn {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(92, 122, 234, 0.5);
    cursor: pointer;
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s ease;
    min-width: 56px;
    min-height: 56px;
}

.mobile-filter-btn:active {
    transform: scale(0.95);
}

.mobile-filter-btn span {
    font-size: 12px;
    font-weight: 500;
}

/* 搜索框包装器 */
.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

/* 清除搜索按钮 */
.clear-search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.clear-search-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    color: var(--text-color);
}

.clear-search-btn:active {
    transform: translateY(-50%) scale(0.9);
}

/* Bottom Sheet 样式 */
.bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.bottom-sheet.active {
    visibility: visible;
    opacity: 1;
}

.bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--background-color);
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bottom-sheet.active .bottom-sheet-content {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 2px;
    margin: 12px auto;
    opacity: 0.3;
}

.bottom-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color);
}

.bottom-sheet-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.bottom-sheet-header .close-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.bottom-sheet-header .close-btn:active {
    background: rgba(0, 0, 0, 0.05);
}

.bottom-sheet-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
}

.filter-item {
    margin-bottom: 20px;
}

.filter-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.filter-item select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    min-height: 48px;
}

.sort-options {
    display: flex;
    gap: 12px;
}

.sort-options select {
    flex: 1;
}

.bottom-sheet-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    background: var(--background-color);
}

.bottom-sheet-footer .btn {
    flex: 1;
    min-height: 48px;
}

/* 回到顶部按钮 */
.scroll-top-btn {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 20px;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    box-shadow: 0 4px 16px rgba(92, 122, 234, 0.4);
    cursor: pointer;
    z-index: 998;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.scroll-top-btn.show {
    display: flex;
}

.scroll-top-btn:active {
    transform: scale(0.9);
}

/* 移动端特定优化 */
@media (max-width: 768px) {
    /* Sticky 搜索框 */
    .search-panel {
        position: sticky;
        top: 0;
        z-index: 100;
        transition: all 0.3s ease;
    }
    
    .search-panel.scrolled {
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    
    /* 显示移动端筛选按钮 */
    .mobile-filter-btn {
        display: flex;
    }
    
    /* 隐藏桌面端过滤器 */
    .filters {
        display: none;
    }
    
    /* 增大触摸区域 */
    .btn {
        min-height: 48px;
    }
    
    #searchInput {
        font-size: 16px; /* 防止iOS自动缩放 */
        min-height: 48px;
    }
    
    /* 优化分页按钮 */
    .pagination button {
        min-width: 100px;
        min-height: 48px;
        font-size: 16px;
    }
    
    /* 减少移动端粒子数量 */
    .star-particle {
        display: none;
    }
    
    /* 禁用复杂的3D效果提升性能 */
    .dialogue-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    }
    
    .dialogue-card::before {
        display: none;
    }
    
    /* 优化卡片间距 */
    .dialogue-card {
        margin-bottom: 20px;
    }
}
