:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --accent: #ff6b6b;
    --accent-secondary: #4ecdc4;
    --accent-tertiary: #ffe66d;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    --shadow-colored: 0 25px 50px -12px rgba(255, 107, 107, 0.3);
    --gradient-main: linear-gradient(135deg, #ff6b6b 0%, #4ecdc4 50%, #ffe66d 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    --blur: blur(20px);
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border: rgba(0, 0, 0, 0.1);
    --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
    --shadow-colored: 0 25px 50px -12px rgba(255, 107, 107, 0.2);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.6) 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

/* 动态背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-main);
    opacity: 0.03;
    z-index: -2;
    animation: gradientShift 10s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { transform: translateX(0) translateY(0) scale(1); }
    33% { transform: translateX(-20px) translateY(20px) scale(1.05); }
    66% { transform: translateX(20px) translateY(-20px) scale(0.95); }
}

/* 粒子背景 */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
    50% { transform: translateY(-20px) rotate(180deg); opacity: 0.8; }
}

/* 顶部导航 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: var(--bg-card);
    backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    transition: all 0.3s ease;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle-btn {
    width: 50px;
    height: 26px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.theme-toggle-btn::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--gradient-main);
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .theme-toggle-btn::after {
    transform: translateX(24px);
}

/* 主容器 */
.container {
    padding: 120px 40px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* 标题区域 */
.hero-section {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    line-height: 1.1;
    letter-spacing: -2px;
    animation: slideInUp 1s ease-out;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 400;
    animation: slideInUp 1s ease-out 0.2s both;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 主内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 40px;
    align-items: start;
}

/* 图片卡片 */
.image-card {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 30px;
    backdrop-filter: var(--blur);
    box-shadow: var(--shadow);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.image-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-main);
    opacity: 0.6;
}

.image-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-colored);
}

.image-container {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: var(--bg-secondary);
    min-height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-container:hover {
    transform: scale(1.02);
}

#randomImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
    transition: all 0.5s ease;
}

.image-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    opacity: 0;
    transition: all 0.3s ease;
}

.image-container:hover .image-overlay {
    opacity: 1;
}

.overlay-btn {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: var(--blur);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.overlay-btn:hover {
    background: var(--accent);
    transform: scale(1.1);
}

/* 控制按钮 */
.controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.btn {
    background: var(--gradient-main);
    color: white;
    border: none;
    padding: 18px 28px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(255, 107, 107, 0.4);
}

.btn:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-card {
    background: var(--gradient-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    backdrop-filter: var(--blur);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.sidebar-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-colored);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-title i {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 统计数据 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-item {
    text-align: center;
    padding: 20px 16px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    background: var(--bg-card);
}

.stat-number {
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* 收藏和历史 */
.content-list {
    max-height: 200px;
    overflow-y: auto;
}

.content-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: var(--bg-secondary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.content-item:hover {
    background: var(--bg-card);
    transform: translateX(4px);
}

.content-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
}

.content-info {
    flex: 1;
    font-size: 13px;
    color: var(--text-secondary);
}

.remove-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* 质量选择器 */
.quality-selector {
    display: flex;
    gap: 8px;
}

.quality-btn {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 500;
}

.quality-btn.active,
.quality-btn:hover {
    background: var(--gradient-main);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

/* 加载状态 */
.loading {
    display: none;
    text-align: center;
    font-size: 18px;
    color: var(--text-secondary);
    animation: loadingPulse 2s infinite;
}

@keyframes loadingPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* 错误信息 */
.error-msg {
    display: none;
    margin-top: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 全屏模式 */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: var(--blur);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fullscreen-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.fullscreen-close {
    position: absolute;
    top: 40px;
    right: 40px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: var(--blur);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s ease;
}

.fullscreen-close:hover {
    background: var(--accent);
    transform: scale(1.1);
}

/* 分享面板 */
.share-panel {
    position: fixed;
    bottom: -300px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 480px;
    background: var(--gradient-card);
    backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    border-radius: 24px 24px 0 0;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1500;
}

.share-panel.active {
    bottom: 0;
}

.share-title {
    text-align: center;
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.share-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.share-btn {
    padding: 20px 16px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.share-btn i {
    font-size: 24px;
}

.share-btn.weibo { background: linear-gradient(135deg, #ff6b6b, #ee5a52); }
.share-btn.weixin { background: linear-gradient(135deg, #4ecdc4, #44b3ab); }
.share-btn.qq { background: linear-gradient(135deg, #3498db, #2980b9); }
.share-btn.link { background: linear-gradient(135deg, #9b59b6, #8e44ad); }

.share-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.cancel-btn {
    width: 100%;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.cancel-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* 通知 */
.notification {
    position: fixed;
    top: 100px;
    right: 40px;
    background: var(--gradient-card);
    backdrop-filter: var(--blur);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 16px 24px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    z-index: 1000;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.notification.show {
    transform: translateX(0);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .sidebar {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        display: grid;
    }
}

@media (max-width: 768px) {
    .navbar {
        padding: 0 20px;
    }
    
    .container {
        padding: 100px 20px 20px;
    }
    
    .sidebar {
        grid-template-columns: 1fr;
        display: flex;
    }
    
    .controls {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .image-card {
        padding: 20px;
    }
    
    .sidebar-card {
        padding: 16px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-main);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}