/* ===== CSS Variables ===== */
:root {
    --bg-primary: #0a0a14;
    --bg-secondary: #12121f;
    --bg-card: rgba(30, 30, 50, 0.6);
    --bg-card-hover: rgba(40, 40, 70, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --text-muted: #6b6b8a;
    
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #a78bfa;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
    --accent-gradient-soft: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    
    --border-color: rgba(99, 102, 241, 0.2);
    --border-hover: rgba(99, 102, 241, 0.5);
    --border-glow: rgba(99, 102, 241, 0.3);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(99, 102, 241, 0.15);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    /* 统一圆角规范：所有按钮、输入框、卡片等主要交互元素使用 --radius-md (12px) */
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Background Decoration ===== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.glow-orb {
    display: none;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -200px;
    right: -100px;
    animation: float1 20s ease-in-out infinite;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-secondary);
    bottom: 20%;
    left: -150px;
    animation: float2 25s ease-in-out infinite;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: var(--accent-tertiary);
    top: 50%;
    right: 20%;
    animation: float3 18s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-50px, 50px); }
}

@keyframes float2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(80px, -40px); }
}

@keyframes float3 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(40px, 60px); }
}

/* ===== Navbar ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 20, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-normal);
}

.navbar.scrolled {
    background: rgba(10, 10, 20, 0.95);
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 24px;
}

.nav-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-search-row {
    display: none;
    margin-top: 10px;
}

.search-box-mobile {
    width: 100%;
}

.nav-left {
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.logo-full {
    height: 36px;
    width: auto;
    display: block;
}

.logo-text-img {
    height: 28px;
    width: auto;
    display: block;
}

.logo-text {
    font-size: 22px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: italic;
    letter-spacing: 0.5px;
}

.nav-center {
    flex: 1;
    max-width: 500px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

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

.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.btn-login,
.btn-register {
    padding: 8px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.btn-login {
    color: var(--text-secondary);
}

.btn-login:hover {
    color: var(--text-primary);
}

.btn-register {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.btn-register:hover {
    background: var(--accent-tertiary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.mobile-menu-btn span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition-fast);
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    background: rgba(10, 10, 20, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    z-index: 99;
}

.mobile-menu.active {
    display: block;
}

.mobile-search {
    margin-bottom: 16px;
}

.mobile-auth {
    display: flex;
    gap: 12px;
}

.mobile-auth .btn-login,
.mobile-auth .btn-register {
    flex: 1;
    text-align: center;
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    z-index: 1;
    padding: 120px 24px 40px;
    text-align: center;
}

.hero-container {
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.hero-cta {
    margin-bottom: 60px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.2);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-fast);
}

.btn-primary:hover svg {
    transform: translateX(3px);
}

.btn-large {
    padding: 18px 40px;
    font-size: 18px;
}

.hero-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-number {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Categories ===== */
.categories {
    position: relative;
    z-index: 1;
    padding: 20px 0;
}

.category-tags {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-tags::-webkit-scrollbar {
    display: none;
}

.category-tag {
    flex-shrink: 0;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.category-tag::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.5s ease;
}

.category-tag:hover {
    border-color: rgba(139, 92, 246, 0.5);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.category-tag:hover::before {
    left: 100%;
}

.category-tag.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
}

/* ===== Characters Section ===== */
.characters {
    position: relative;
    z-index: 1;
    padding: 40px 0 80px;
}

.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.filter-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.filter-tabs,
.sort-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-glass);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.filter-tab,
.sort-tab {
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.filter-tab:hover,
.sort-tab:hover {
    color: var(--text-primary);
}

.filter-tab.active,
.sort-tab.active {
    background: var(--accent-primary);
    color: white;
}

.filter-divider {
    width: 1px;
    height: 28px;
    background: var(--border-color);
}

.filter-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 14px;
    color: var(--text-muted);
}

.sort-option {
    padding: 6px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.sort-option:hover {
    color: var(--text-primary);
}

.sort-option.active {
    color: var(--accent-primary);
    font-weight: 600;
}

/* ===== Character Grid ===== */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px;
}

.character-card {
    position: relative;
    background: linear-gradient(180deg, rgba(40, 40, 70, 0.5) 0%, rgba(20, 20, 35, 0.8) 100%);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.character-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.5), transparent);
    z-index: 2;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.character-card:hover {
    transform: translateY(-6px);
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.25), 0 0 60px rgba(99, 102, 241, 0.1);
    background: linear-gradient(180deg, rgba(50, 50, 85, 0.6) 0%, rgba(25, 25, 45, 0.9) 100%);
}

.character-card:hover::before {
    opacity: 1;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 130%;
    overflow: hidden;
}

.card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.character-card:hover .card-image {
    transform: scale(1.05);
}

.card-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(10, 10, 20, 0.95) 0%, rgba(10, 10, 20, 0.5) 50%, transparent 100%);
    pointer-events: none;
}

.card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 2;
}

.badge-views {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.badge-views svg {
    width: 14px;
    height: 14px;
}

.badge-chats {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.8);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.badge-chats svg {
    width: 14px;
    height: 14px;
}

.card-content {
    padding: 12px;
}

.card-creator {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.card-creator-name {
    font-weight: 500;
}

.verified-badge {
    color: var(--accent-primary);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #ffffff;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.card-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.card-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    color: #c4b5fd;
    transition: all var(--transition-fast);
}

.card-tag:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
    border-color: rgba(139, 92, 246, 0.5);
    color: #ddd6fe;
}

.card-tag svg {
    width: 12px;
    height: 12px;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.card-tokens {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.card-tokens svg {
    width: 14px;
    height: 14px;
    color: var(--accent-primary);
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #fbbf24;
}

.card-rating svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ===== Load More ===== */
.load-more {
    text-align: center;
    margin-top: 48px;
}

.btn-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.btn-load-more:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

.btn-load-more svg {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
}

.btn-load-more:hover svg {
    transform: translateY(3px);
}

/* ===== Features Section ===== */
.features {
    position: relative;
    z-index: 1;
    padding: 80px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    text-align: center;
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 700;
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 48px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.feature-card {
    padding: 32px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: var(--transition-normal);
    backdrop-filter: blur(10px);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient-soft);
    border-radius: var(--radius-lg);
    color: var(--accent-primary);
}

.feature-icon svg {
    width: 28px;
    height: 28px;
}

.feature-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ===== CTA Section ===== */
.cta-section {
    position: relative;
    z-index: 1;
    padding: 80px 0;
}

.cta-card {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.cta-title {
    position: relative;
    font-size: clamp(24px, 3.5vw, 36px);
    font-weight: 700;
    margin-bottom: 12px;
    color: white;
}

.cta-desc {
    position: relative;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 32px;
}

.cta-card .btn-primary {
    position: relative;
    background: white;
    color: var(--accent-primary);
}

.cta-card .btn-primary:hover {
    background: #f0f0f0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* ===== Light Theme ===== */
body.light-theme {
    background-color: #f5f6fb !important;
    color: #1a1a2e;
}

body.light-theme .bg-decoration {
    opacity: 0.3;
}

body.light-theme .navbar {
    background: rgba(255, 255, 255, 0.9) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    backdrop-filter: blur(20px);
}

body.light-theme .hero-title {
    color: #1a1a2e;
}

body.light-theme .hero-subtitle {
    color: #4a4a6a;
}

body.light-theme .stat-number {
    color: #1a1a2e;
}

body.light-theme .stat-label {
    color: #6b6b8a;
}

body.light-theme .section-title-sm {
    color: #1a1a2e;
}

body.light-theme .view-all-link {
    color: #6366f1;
}

body.light-theme .category-tag {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #4a4a6a;
}

body.light-theme .category-tag:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #1a1a2e;
}

body.light-theme .category-tag.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

body.light-theme .filter-tabs,
body.light-theme .sort-tabs {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

body.light-theme .filter-tab,
body.light-theme .sort-tab {
    color: #6b6b8a;
}

body.light-theme .filter-tab.active,
body.light-theme .sort-tab.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

body.light-theme .sort-label {
    color: #6b6b8a;
}

body.light-theme .sort-option {
    color: #6b6b8a;
}

body.light-theme .sort-option.active {
    color: #6366f1;
}

body.light-theme .character-card {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .character-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
    background: #ffffff !important;
}

body.light-theme .character-card::before {
    display: none;
}

body.light-theme .card-title {
    color: #1a1a2e !important;
    text-shadow: none !important;
}

body.light-theme .card-creator {
    color: #8b8ba8;
}

body.light-theme .card-creator-name {
    color: #4a4a6a;
}

body.light-theme .card-description {
    color: #6b6b8a;
}

body.light-theme .card-tag {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

body.light-theme .footer {
    background: #ffffff !important;
    border-top: 1px solid rgba(0, 0, 0, 0.06) !important;
}

body.light-theme .footer-slogan {
    color: #4a4a6a;
}

body.light-theme .footer-copyright {
    color: #8b8ba8;
}

body.light-theme .footer-links a {
    color: #6b6b8a;
}

body.light-theme .footer-links a:hover {
    color: #4a4a6a;
}

body.light-theme .user-dropdown {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12) !important;
}

body.light-theme .user-dropdown-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.light-theme .user-dropdown-name {
    color: #1a1a2e !important;
}

body.light-theme .user-dropdown-phone {
    color: #8b8ba8;
}

body.light-theme .user-dropdown-divider {
    background: rgba(0, 0, 0, 0.06);
}

body.light-theme .user-dropdown-item {
    color: #4a4a6a !important;
}

body.light-theme .user-dropdown-item:hover {
    background: rgba(99, 102, 241, 0.08) !important;
    color: #1a1a2e !important;
}

body.light-theme .logout-item {
    color: #ef4444 !important;
}

body.light-theme .logout-item:hover {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #ef4444 !important;
}

body.light-theme .search-box {
    background: rgba(0, 0, 0, 0.04) !important;
}

body.light-theme .search-input {
    color: #1a1a2e !important;
}

body.light-theme .search-input::placeholder {
    color: rgba(0, 0, 0, 0.3) !important;
}

body.light-theme .search-icon {
    color: rgba(0, 0, 0, 0.3);
}

body.light-theme .back-to-top {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #4a4a6a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.light-theme .page-btn {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #4a4a6a;
}

body.light-theme .page-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-color: transparent;
}

body.light-theme .btn-register {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

body.light-theme .btn-create {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid #6366f1;
    color: #6366f1;
}

body.light-theme .btn-create:hover {
    background: #6366f1;
    color: white;
}

body.light-theme .login-modal-content {
    background: #ffffff;
}

body.light-theme .modal-title {
    color: #1a1a2e;
}

body.light-theme .modal-desc {
    color: #6b6b8a;
}

body.light-theme .modal-footer {
    color: #6b6b8a;
}

body.light-theme .switch .slider {
    background: rgba(0, 0, 0, 0.15);
}

body.light-theme .switch input:checked + .slider {
    background: #6366f1;
}

body.light-theme .filter-btn-mobile {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #4a4a6a;
}

/* ===== Footer ===== */
.footer {
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 40px 0;
}

.footer-inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-logo .logo-icon {
    width: 28px;
    height: 28px;
}

.footer-logo .logo-text-img {
    height: 20px;
    width: auto;
}

.footer-slogan {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0 8px;
    font-weight: 500;
}

.footer-copyright {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.footer-right .footer-links {
    display: flex;
    gap: 24px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-right .footer-links a {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-right .footer-links a:hover {
    color: var(--text-secondary);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .nav-center {
        display: none;
    }
    
    .nav-right .theme-toggle,
    .nav-right .btn-login {
        display: none;
    }
    
    .nav-right .btn-register {
        display: inline-block;
    }
    
    .nav-search-row {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 12px;
    }
    
    .search-box-mobile {
        flex: 1;
    }
    
    .filter-btn-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        color: rgba(255, 255, 255, 0.7);
        flex-shrink: 0;
        transition: all 0.2s ease;
    }
    
    .filter-btn-mobile:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(99, 102, 241, 0.4);
    }
    
    .filter-btn-mobile svg {
        width: 20px;
        height: 20px;
    }
    
    .hero {
        padding: 140px 24px 60px;
    }
    
    .hero-stats {
        gap: 24px;
    }
    
    .stat-divider {
        display: none;
    }
    
    .category-section {
        margin-bottom: 16px;
    }
    
    .category-tags {
        gap: 8px;
        padding: 4px 0;
    }
    
    .category-tag {
        padding: 6px 14px;
        font-size: 13px;
        background: transparent;
        border: 1.5px solid rgba(167, 139, 250, 0.4);
        color: #c4b5fd;
        font-weight: 500;
        position: relative;
        overflow: visible;
    }
    
    .category-tag::before {
        display: none;
    }
    
    .category-tag:hover {
        background: rgba(167, 139, 250, 0.1);
        border-color: rgba(167, 139, 250, 0.6);
        color: #ddd6fe;
    }
    
    .category-tag.active {
        background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.25) 100%);
        border: 1.5px solid #a78bfa;
        color: #ffffff;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 24px;
    }
    
    .filter-left {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
    }
    
    .filter-tabs {
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(99, 102, 241, 0.25);
        padding: 3px;
        border-radius: 9999px;
        gap: 2px;
    }
    
    .filter-tab {
        padding: 8px 20px;
        font-size: 14px;
        font-weight: 500;
        border-radius: 9999px;
        color: rgba(255, 255, 255, 0.5);
    }
    
    .filter-tab.active {
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        color: #ffffff;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    }
    
    .sort-tabs {
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid rgba(99, 102, 241, 0.25);
        padding: 3px;
        border-radius: 9999px;
        gap: 2px;
    }
    
    .sort-tab {
        padding: 8px 16px;
        font-size: 13px;
        font-weight: 500;
        border-radius: 9999px;
        color: rgba(255, 255, 255, 0.5);
    }
    
    .sort-tab.active {
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        color: #ffffff;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    }
    
    .filter-right {
        width: 100%;
        justify-content: flex-end;
        align-items: center;
    }
    
    .sort-label {
        display: none;
    }
    
    .sort-option {
        display: inline-block;
    }
    
    .character-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .card-description {
        -webkit-line-clamp: 2;
    }
    
    .card-tags {
        display: none;
    }
    
    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .cta-card {
        padding: 40px 24px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 10px 16px;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .hero {
        padding: 140px 16px 40px;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 20px;
    }
    
    .character-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .card-content {
        padding: 12px;
    }
    
    .card-title {
        font-size: 14px;
    }
    
    .card-description {
        display: none;
    }
    
    .filter-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .footer-inner {
        gap: 12px;
    }
    
    .footer-right .footer-links {
        gap: 16px;
    }
    
    .features,
    .cta-section {
        padding: 48px 0;
    }
}

/* ===== Scroll Animations ===== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Main Content ===== */
.main-content {
    position: relative;
    z-index: 1;
    padding-top: 100px;
    padding-bottom: 60px;
    min-height: 100vh;
}

.category-section {
    margin-bottom: 24px;
}

/* ===== Infinite Scroll Indicator ===== */
.infinite-scroll-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.infinite-scroll-indicator.hidden {
    display: none;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== End of List ===== */
.end-of-list {
    text-align: center;
    padding: 32px 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 48px;
    margin-bottom: 20px;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-btn svg {
    width: 18px;
    height: 18px;
}

.page-numbers {
    display: flex;
    align-items: center;
    gap: 6px;
}

.page-number {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.page-number:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.page-number.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.page-ellipsis {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    user-select: none;
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    z-index: 90;
    box-shadow: var(--shadow-md);
}

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

.back-to-top:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.back-to-top svg {
    width: 22px;
    height: 22px;
}

/* ===== Responsive: Navbar - Login button always visible on mobile ===== */
@media (max-width: 768px) {
    .main-content {
        padding-top: 130px;
    }
    
    .back-to-top {
        right: 16px;
        bottom: 16px;
        width: 42px;
        height: 42px;
    }
    
    .back-to-top svg {
        width: 18px;
        height: 18px;
    }
}

/* ===== Featured Characters (Guest View) ===== */
.featured-characters {
    position: relative;
    z-index: 1;
    padding: 20px 0 60px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title-sm {
    font-size: 22px;
    font-weight: 700;
}

.view-all-link {
    font-size: 14px;
    color: var(--accent-primary);
    font-weight: 500;
    transition: var(--transition-fast);
}

.view-all-link:hover {
    color: var(--accent-tertiary);
}

.guest-cta-bottom {
    text-align: center;
    margin-top: 48px;
}

/* ===== User Menu (Logged In) ===== */
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.btn-create {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-gradient-soft);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-fast);
}

.btn-create:hover {
    background: var(--accent-primary);
    color: white;
}

.btn-create svg {
    width: 16px;
    height: 16px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: white;
    transition: var(--transition-fast);
    user-select: none;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

/* ===== User Dropdown ===== */
.user-dropdown {
    position: fixed;
    top: 60px;
    right: 24px;
    width: 280px;
    background: linear-gradient(180deg, #2a2a3e 0%, #1e1e2e 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 60px rgba(99, 102, 241, 0.1);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.98);
    transition: all 0.2s ease;
    overflow: hidden;
    padding: 8px;
}

.user-dropdown.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.user-dropdown-header {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 4px;
}

.user-dropdown-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #a78bfa 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

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

.user-dropdown-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-phone {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}

.user-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 4px 8px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-radius: 10px;
    font-weight: 500;
}

.user-dropdown-item:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #ffffff;
}

.user-dropdown-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    stroke-width: 1.8;
}

.user-dropdown-item span:not(.item-badge) {
    flex: 1;
}

.item-badge {
    padding: 2px 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    flex: 0 !important;
}

.dark-mode-item {
    cursor: default;
}

.dark-mode-item:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #ffffff;
}

.dark-mode-toggle-item {
    cursor: default;
}

.dark-mode-toggle-item:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #ffffff;
}

.switch {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.2);
    transition: 0.2s;
    border-radius: 22px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background: var(--accent-primary);
}

.switch input:checked + .slider:before {
    transform: translateX(18px);
}

.logout-item {
    color: #ef4444;
}

.logout-item:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* 移动端遮罩 */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.drawer-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* ===== Login Modal ===== */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.login-modal.visible {
    opacity: 1;
    visibility: visible;
}

.login-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.login-modal-content {
    position: relative;
    width: 90%;
    max-width: 360px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px 28px 28px;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.login-modal.visible .login-modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient-soft);
    border-radius: 50%;
    color: var(--accent-primary);
}

.modal-icon svg {
    width: 32px;
    height: 32px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 24px;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.modal-footer {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
}

/* ===== Responsive: User Menu ===== */
@media (max-width: 768px) {
    .user-menu .btn-create {
        display: flex;
        padding: 8px 12px;
        font-size: 13px;
        gap: 4px;
    }
    
    .user-menu .btn-create svg {
        width: 16px;
        height: 16px;
    }
    
    .user-dropdown {
        position: fixed;
        top: 0;
        right: 0;
        width: 75%;
        max-width: 300px;
        height: 100vh;
        border-radius: 0;
        border: none;
        border-left: 1px solid var(--border-color);
        transform: translateX(100%);
        opacity: 1;
        visibility: visible;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .user-dropdown.visible {
        transform: translateX(0);
    }
    
    .user-dropdown-header {
        padding: 20px 16px;
        padding-top: calc(20px + env(safe-area-inset-top));
    }
    
    .user-dropdown-avatar {
        width: 52px;
        height: 52px;
        font-size: 18px;
    }
    
    .user-dropdown-name {
        font-size: 16px;
    }
    
    .user-dropdown-item {
        padding: 14px 16px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .section-header {
        margin-bottom: 16px;
    }
    
    .section-title-sm {
        font-size: 18px;
    }
    
    .featured-characters {
        padding: 20px 0 40px;
    }
}
