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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    padding: 0;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-white);
    min-height: 100vh;
    box-shadow: 0 0 0 1px var(--border-color);
}

/* Header Styles */
.header {
    position: relative;
    background: var(--primary-gradient);
    color: white;
    padding: 30px 40px;
    overflow: hidden;
}

.header-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.wave {
    position: absolute;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: wave 20s infinite linear;
}

.wave1 {
    top: -50%;
    left: -50%;
    animation-duration: 20s;
}

.wave2 {
    top: -30%;
    left: -30%;
    animation-duration: 25s;
    animation-direction: reverse;
}

.wave3 {
    top: -40%;
    left: -40%;
    animation-duration: 30s;
}

@keyframes wave {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.header-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.header-text h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 400;
}

.header-stats {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 70px;
    transition: all 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.stat-item.active {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.9;
    font-weight: 500;
}

/* Filters Bar */
.filters-bar {
    padding: 24px 50px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* 紧凑型筛选器 */
.compact-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 12px;
    border: 1px solid #e6edff;
    align-items: center;
}

.filter-group-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
}

/* 让语种筛选器独占一行 */
.filter-group-inline:first-child {
    flex: 1 1 100%;
}

.filter-group-wide {
    flex: 1 1 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-label-inline {
    font-size: 14px;
    font-weight: 700;
    color: #2d3748;
    min-width: 48px;
    white-space: nowrap;
    position: relative;
    padding-left: 18px;
}

.filter-label-inline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.filter-label-secondary {
    margin-left: 24px;
}

/* 内联搜索框 */
.search-wrapper-inline {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon-inline {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.search-input-inline {
    width: 220px;
    padding: 8px 12px 8px 36px;
    border: 1.5px solid #d1d9e6;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-input-inline:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}

.search-input-inline::placeholder {
    color: #a0aec0;
    font-size: 13px;
}

.filter-buttons-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn-inline {
    padding: 8px 18px;
    font-size: 13px;
    border: 1.5px solid #d1d9e6;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #4a5568;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filter-btn-inline:hover {
    border-color: #667eea;
    background: white;
    color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.filter-btn-inline.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

/* 旧的搜索框样式（已废弃，保留以防需要） */

.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    white-space: nowrap;
}

.filter-toggle-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.filter-toggle-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.filter-toggle-btn svg {
    transition: transform 0.3s ease;
}

.filter-toggle-btn.active svg {
    transform: rotate(180deg);
}

/* 侧边抽屉式筛选面板 */
.filter-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100vh;
    background: var(--bg-white);
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 30px;
}

.filter-panel.active {
    right: 0;
}

/* 筛选面板遮罩层 */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 筛选面板头部 */
.filter-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.filter-panel-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-light);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
}

.filter-close-btn:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

.filter-row {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 24px;
}

.filter-group {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.filter-group label svg {
    color: #667eea;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-option {
    padding: 10px 18px;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.filter-option:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

.filter-option.active {
    background: var(--primary-gradient);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-md);
}

/* Active Filters */
.active-filters {
    padding: 16px 50px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    min-height: 60px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4338ca;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.remove-filter {
    background: rgba(67, 56, 202, 0.1);
    border: none;
    color: #4338ca;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.remove-filter:hover {
    background: rgba(67, 56, 202, 0.2);
    transform: rotate(90deg);
}

.clear-all-filters {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.clear-all-filters:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Voice List */
.voice-list {
    padding: 40px 50px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 24px;
}

.voice-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.voice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.voice-card:hover {
    border-color: #667eea;
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.voice-card:hover::before {
    transform: scaleX(1);
}

.voice-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.voice-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%; /* 改为完全圆形 */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    background: #f0f0f0; /* 默认背景 */
    border: 2px solid #fff; /* 添加白边增加层次感 */
}

/* 真实头像图片样式 */
.real-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* 移除之前的CSS类定义 */
.avatar-female-child, .avatar-female-teen, .avatar-female-young, .avatar-female-middle, .avatar-female-old,
.avatar-male-child, .avatar-male-teen, .avatar-male-young, .avatar-male-middle, .avatar-male-old,
.avatar-default {
    background: transparent;
}

/* 头像悬停效果 */
.voice-card:hover .voice-avatar {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
    border-color: #667eea;
}

.voice-card:hover .real-avatar-img {
    transform: scale(1.1);
}

.voice-info {
    flex: 1;
    min-width: 0;
}

.voice-id {
    font-size: 12px;
    font-weight: 700;
    color: #667eea;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    padding: 4px 10px;
    background: #f0f4ff;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 6px;
}

.voice-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.voice-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.voice-meta-item {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 4px 10px;
    background: var(--bg-light);
    border-radius: 6px;
}

.voice-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
}

.voice-description strong {
    color: var(--text-primary);
    font-weight: 600;
}

.voice-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding-right: 80px; /* 为右下角的播放按钮预留空间 */
}

.voice-tag {
    font-size: 12px;
    padding: 6px 12px;
    background: var(--bg-light);
    color: var(--text-secondary);
    border-radius: 12px;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

/* 固定在右下角的播放按钮 */
.play-btn-fixed {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--primary-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    font-size: 20px;
    z-index: 10;
    overflow: hidden;
}

.play-btn-fixed::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;
}

.play-btn-fixed:hover::before {
    width: 100%;
    height: 100%;
}

.play-btn-fixed:hover {
    transform: scale(1.15);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.5);
}

.play-btn-fixed.playing {
    background: var(--secondary-gradient);
    animation: pulse 2s infinite;
}

.play-btn-fixed .play-icon {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 保留旧样式以防其他地方使用 */
.voice-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--primary-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    font-size: 18px;
    position: relative;
    overflow: hidden;
}

.play-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;
}

.play-btn:hover::before {
    width: 100%;
    height: 100%;
}

.play-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.play-btn.playing {
    background: var(--secondary-gradient);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(245, 87, 108, 0.6);
    }
}

.audio-element {
    display: none;
}

.empty-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 100px 20px;
    color: var(--text-muted);
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .voice-list {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    }
    
    .filter-panel {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 40px 30px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-text h1 {
        font-size: 32px;
    }

    .header-stats {
        width: 100%;
        justify-content: space-between;
    }

    .filters-bar {
        padding: 20px;
    }
    
    .compact-filters {
        gap: 16px;
        padding: 16px;
    }
    
    .filter-group-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
        padding: 12px 0;
        border-bottom: 1px solid #e6edff;
    }
    
    .filter-group-wide {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-group-inline:last-child {
        border-bottom: none;
    }
    
    .filter-label-inline {
        font-size: 13px;
        padding-left: 14px;
    }
    
    .filter-label-inline::before {
        width: 2px;
        height: 14px;
    }
    
    .filter-label-secondary {
        margin-left: 0;
        margin-top: 8px;
    }
    
    .search-wrapper-inline {
        width: 100%;
    }
    
    .search-input-inline {
        width: 100%;
    }
    
    .filter-buttons-inline {
        width: 100%;
        gap: 6px;
    }
    
    .filter-btn-inline {
        flex: 1;
        min-width: 60px;
        padding: 8px 12px;
        font-size: 12px;
    }

    .voice-list {
        padding: 20px;
        grid-template-columns: 1fr;
    }
    
    .active-filters {
        padding: 12px 20px;
        min-height: 50px;
    }
}