/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    line-height: 1.6;
    font-size: 14px;
    min-height: 100vh;
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* 添加页面过渡动画 */
body {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 首页样式 */
h1 {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    font-size: 2.2em;
    padding: 15px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    letter-spacing: 1px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.categories-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    justify-items: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.category-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100%);
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 1);
}

.category-card:hover::before {
    opacity: 1;
    animation: shimmer 1.5s;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) rotate(45deg); }
    100% { transform: translateX(100%) rotate(45deg); }
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    border-radius: 50%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background-color: rgba(255, 255, 255, 0.2);
}

.category-card:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.emoji-icon {
    /* background: #f8f9fa; */
    background-image: url('static/image/+_14.jpg');
}

.avatar-icon {
    /* background: #f8f9fa; */
    background-image: url('static/image/05.png');
}

.wallpaper-icon {
    /* background: #f8f9fa; */
    background-image: url('static/image/9f91a2b1_2fbe_4074_94bb_aa1709f2b1f8_9f91a2b1-2fbe-4074-94bb-aa1709f2b1f8.jpg');
}

.category-card h2 {
    font-size: 1.4em;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.category-card p {
    color: #7f8c8d;
    font-size: 1em;
    line-height: 1.4;
}

/* 图片浏览页面样式 */
.image-viewer {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.image-viewer:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 1);
}

.image-container {
    text-align: center;
    margin-bottom: 20px;
    min-height: 350px;
    max-height: 450px;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 15px;
    padding: 15px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    cursor: pointer;
    position: relative;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.image-container:hover {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
    transform: scale(1.01);
}

#current-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 10px;
}

.image-container:hover #current-image {
    transform: scale(1.03);
}

.image-container:hover #current-image {
    transform: scale(1.02);
}

/* 预览模态框样式 */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.8) 100%);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(5px);
}

.preview-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.preview-content {
    max-width: 95vw;
    max-height: 90vh;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.preview-modal.active .preview-content {
    transform: scale(1);
}

.preview-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease;
}

.close-preview {
    position: fixed;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 24px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 2010;
}

.close-preview:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.image-info {
    margin-top: 15px;
    color: #2c3e50;
    font-size: 0.95em;
    text-align: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* 控制按钮样式 */
.controls {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: nowrap;
}

.control-btn {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    letter-spacing: 0.5px;
}

/* 去除按钮点击时的蓝色背景 */
button, .back-btn, .control-btn, .tag, .undo-btn {
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

button:active, .back-btn:active, .control-btn:active, .tag:active, .undo-btn:active {
    transform: scale(0.98);
}

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

.control-btn:hover::before {
    left: 100%;
}

.control-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
}

.control-btn:active {
    transform: translateY(-1px) scale(0.98);
}

.control-btn.danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.control-btn.danger:hover {
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
}

.skip-btn {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    box-shadow: 0 4px 15px rgba(149, 165, 166, 0.3);
}

.skip-btn:hover {
    box-shadow: 0 8px 25px rgba(149, 165, 166, 0.4);
}

/* 分类标签样式 */
.tags-section {
    margin-top: 15px;
    flex: 1;
    min-height: 0; /* 防止flex子元素溢出 */
}

.tags-section h3 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.1em;
    text-align: center;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 30vh;
    overflow-y: auto;
}

.tag {
    padding: 10px 20px;
    background: linear-gradient(135deg, #ecf0f1, #bdc3c7);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-size: 0.95em;
    font-weight: 600;
    flex-shrink: 0;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: #2c3e50;
}

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

.tag:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

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

.tag.selected {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.4);
    transform: scale(1.05);
}

.tag:active {
    transform: translateY(-1px) scale(0.98);
}

/* 撤回通知样式 */
.undo-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    transform: translateX(150%);
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    font-size: 1em;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.undo-notification.show {
    transform: translateX(0);
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(150%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.undo-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

.undo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.undo-btn:active {
    transform: translateY(0) scale(0.95);
}

/* 进度指示器 */
.progress-info {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 1em;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.8);
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* 返回按钮 */
.back-btn {
    display: inline-block;
    margin-bottom: 20px;
    color: white;
    text-decoration: none;
    font-size: 1em;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    border: none;
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

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

.back-btn:hover {
    transform: translateX(-3px) translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.back-btn:hover::before {
    left: 100%;
}

.back-btn:active {
    transform: translateX(-1px) translateY(0) scale(0.98);
}

/* 添加平滑滚动效果 */
html {
    scroll-behavior: smooth;
}

/* 增强标签容器样式 */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 30vh;
    overflow-y: auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 滚动条美化 */
.tags-container::-webkit-scrollbar {
    width: 8px;
}

.tags-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.tags-container::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.tags-container::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }
    
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8em;
        margin-bottom: 20px;
        padding: 12px 0;
    }
    
    .image-viewer {
        padding: 20px;
        border-radius: 15px;
    }
    
    .image-container {
        min-height: 280px;
        max-height: 350px;
        height: 350px;
        padding: 12px;
    }
    
    #current-image {
        width: 100%;
        height: 100%;
    }
    
    .controls {
        flex-direction: row;
        gap: 10px;
    }
    
    .control-btn {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    
    .tags-container {
        max-height: 28vh;
        padding: 12px;
        gap: 8px;
    }
    
    .tag {
        padding: 8px 16px;
        font-size: 0.9em;
    }
    
    .undo-notification {
        font-size: 0.9em;
        padding: 12px 16px;
        top: 15px;
        right: 15px;
        gap: 10px;
    }
    
    .back-btn {
        padding: 8px 16px;
        font-size: 0.95em;
    }
    
    .progress-info {
        font-size: 0.95em;
        padding: 6px 12px;
    }
}

/* 响应式预览模态框 */
@media (max-width: 768px) {
    .close-preview {
        top: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
    
    .preview-content {
        max-width: 98vw;
        max-height: 85vh;
    }
    
    .preview-image {
        border-radius: 8px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .image-container {
        min-height: 220px;
        max-height: 300px;
        height: 300px;
        padding: 8px;
    }
    
    #current-image {
        width: 100%;
        height: 100%;
        border-radius: 6px;
    }
    
    .control-btn {
        font-size: 0.9em;
        padding: 8px 10px;
    }
    
    .tags-container {
        gap: 6px;
        padding: 10px;
    }
    
    .tag {
        padding: 6px 12px;
        font-size: 0.85em;
    }
    
    .undo-notification {
        font-size: 0.85em;
        padding: 10px 12px;
        top: 10px;
        right: 10px;
    }
    
    .undo-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }
    
    h1 {
        font-size: 1.6em;
        padding: 10px 0;
    }
}

/* 添加显示动画支持 */
.undo-notification.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}