/* frontend/css/abab.css - 二次元清新风格 */

/* ===== 1. 全局变量定义 ===== */
:root {
    /* 主色调 - 天空蓝系 */
    --primary-blue: #4A90E2;
    --primary-light: #6BA3E7;
    --primary-dark: #3876C5;
    
    /* 辅助色 - 清新绿 */
    --accent-green: #52C41A;
    --accent-mint: #87D068;
    
    /* 中性色 */
    --white: #FFFFFF;
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #E8E8E8;
    --gray-300: #D9D9D9;
    --gray-400: #BFBFBF;
    --gray-500: #8C8C8C;
    --gray-600: #595959;
    --gray-700: #262626;
    
    /* 功能色 */
    --success: #52C41A;
    --warning: #FAAD14;
    --error: #F5222D;
    --info: #1890FF;
    
    /* 字体 */
    --font-primary: 'Quicksand', 'Noto Sans SC', sans-serif;
    --font-secondary: 'Noto Sans SC', sans-serif;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-round: 9999px;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-card: 0 2px 12px rgba(74, 144, 226, 0.15);
    
    /* 动画 */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== 2. 基础重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    background: linear-gradient(135deg, #E3F2FD 0%, #FFFFFF 50%, #E8F5E9 100%);
    min-height: 100vh;
    color: var(--gray-700);
    position: relative;
    overflow-x: hidden;
}

/* ===== 3. 背景装饰 ===== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: var(--primary-blue);
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    background: var(--accent-green);
    top: 60%;
    right: 10%;
    animation-delay: 5s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: var(--primary-light);
    bottom: 10%;
    left: 30%;
    animation-delay: 10s;
}

.floating-cloud {
    position: absolute;
    width: 100px;
    height: 40px;
    background: white;
    border-radius: 100px;
    opacity: 0.3;
    animation: drift 30s infinite linear;
}

.cloud-1 {
    top: 20%;
    animation-delay: 0s;
}

.cloud-2 {
    top: 40%;
    animation-delay: 15s;
}

.floating-cloud::before,
.floating-cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 100px;
}

.floating-cloud::before {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 10px;
}

.floating-cloud::after {
    width: 60px;
    height: 40px;
    top: -15px;
    right: 10px;
}

/* ===== 4. 顶部导航栏 ===== */
.top-navbar {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition-base);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-light));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    animation: pulse 2s infinite;
}

.brand-text {
    font-family: var(--font-primary);
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-tabs {
    display: flex;
    gap: 8px;
    background: var(--gray-100);
    padding: 4px;
    border-radius: var(--radius-round);
}

.nav-tab {
    padding: 10px 24px;
    border: none;
    background: transparent;
    border-radius: var(--radius-round);
    color: var(--gray-600);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tab:hover {
    color: var(--primary-blue);
}

.nav-tab.active {
    background: white;
    color: var(--primary-blue);
    box-shadow: var(--shadow-sm);
}

.nav-tab i {
    font-size: 16px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
    background: var(--gray-100);
    border-radius: var(--radius-round);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-base);
}

.search-box:focus-within {
    background: white;
    box-shadow: var(--shadow-md);
}

.search-box i {
    color: var(--gray-400);
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 200px;
    font-size: 14px;
    color: var(--gray-700);
}

.search-box input::placeholder {
    color: var(--gray-400);
}

.nav-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition-base);
}

.nav-icon-btn:hover {
    background: var(--primary-blue);
    color: white;
    transform: scale(1.1);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--error);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: var(--radius-round);
}

.user-menu {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--primary-blue);
    transition: var(--transition-base);
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-base);
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    font-size: 14px;
}

.user-dropdown a:hover {
    background: var(--gray-100);
    color: var(--primary-blue);
}

.user-dropdown hr {
    margin: 4px 0;
    border: none;
    border-top: 1px solid var(--gray-200);
}

/* ===== 5. 筛选工具栏 ===== */
.filter-toolbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 70px;
    z-index: 999;
}

.filter-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.filter-group {
    display: flex;
    gap: 12px;
}

.filter-btn {
    padding: 8px 20px;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: var(--radius-round);
    color: var(--gray-600);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

.filter-tags {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-label {
    color: var(--gray-500);
    font-size: 14px;
}

.tag-btn {
    padding: 6px 16px;
    border: none;
    background: var(--gray-100);
    border-radius: var(--radius-round);
    color: var(--gray-600);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-base);
}

.tag-btn:hover {
    background: var(--accent-green);
    color: white;
    transform: scale(1.05);
}

.more-tags {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== 6. 主内容区 ===== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    display: flex;
    gap: 30px;
    position: relative;
    z-index: 1;
}

.works-container {
    flex: 1;
}

/* ===== 7. 瀑布流布局 ===== */
.waterfall-grid {
    column-count: 3;
    column-gap: 20px;
}

.work-card {
    break-inside: avoid;
    margin-bottom: 20px;
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition-base);
    cursor: pointer;
    position: relative;
}

.work-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(74, 144, 226, 0.25);
}

.work-card-image {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.work-card-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition-slow);
}

.work-card:hover .work-card-image img {
    transform: scale(1.05);
}

.work-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
}

.badge {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-round);
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge.installed {
    background: rgba(82, 196, 26, 0.9);
    color: white;
}

.badge.update {
    background: rgba(250, 173, 20, 0.9);
    color: white;
}

.badge.new {
    background: rgba(245, 34, 45, 0.9);
    color: white;
}

.work-card-body {
    padding: 16px;
}

.work-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.work-card-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-size: 13px;
    color: var(--gray-500);
}

.work-card-desc {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.work-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}

.work-stats {
    display: flex;
    gap: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--gray-400);
}

.stat-item i {
    font-size: 14px;
}

.work-action-btn {
    padding: 6px 12px;
    border: none;
    background: var(--primary-blue);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 4px;
}

.work-action-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.work-action-btn.play {
    background: var(--accent-green);
}

.work-action-btn.play:hover {
    background: #45a000;
}

/* ===== 8. 右侧边栏 ===== */
.right-sidebar {
    width: 320px;
    position: sticky;
    top: 150px;
    height: fit-content;
}

.sidebar-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-100);
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
}

.card-header i {
    color: var(--primary-blue);
}

.creator-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.creator-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-base);
    cursor: pointer;
}

.creator-item:hover {
    background: var(--gray-50);
}

.creator-rank {
    width: 24px;
    height: 24px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
}

.creator-rank.top {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: white;
}

.creator-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.creator-info {
    flex: 1;
}

.creator-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
}

.creator-works {
    font-size: 12px;
    color: var(--gray-500);
}

/* ===== 9. 加载更多 ===== */
.load-more-section {
    margin-top: 40px;
    text-align: center;
}

.loading-spinner {
    padding: 40px;
}

.spinner-circle {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

.load-more-btn {
    padding: 12px 32px;
    border: 2px solid var(--primary-blue);
    background: white;
    color: var(--primary-blue);
    border-radius: var(--radius-round);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.load-more-btn:hover {
    background: var(--primary-blue);
    color: white;
    transform: scale(1.05);
}

/* ===== 10. 弹窗样式 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn var(--transition-base);
}

.modal-container {
    background: white;
    border-radius: var(--radius-xl);
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: slideUp var(--transition-base);
}

.work-detail-modal {
    width: 800px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--gray-100);
    border-radius: 50%;
    color: var(--gray-600);
    cursor: pointer;
    transition: var(--transition-base);
    z-index: 1;
}

.modal-close:hover {
    background: var(--error);
    color: white;
    transform: rotate(90deg);
}

.modal-content {
    padding: 30px;
    overflow-y: auto;
    max-height: 90vh;
}

.detail-header {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.detail-cover {
    width: 200px;
    height: auto;
    border-radius: var(--radius-md);
    object-fit: cover;
}

.detail-info {
    flex: 1;
}

.detail-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.detail-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.follow-btn {
    margin-left: auto;
    padding: 6px 16px;
    border: 1px solid var(--primary-blue);
    background: white;
    color: var(--primary-blue);
    border-radius: var(--radius-round);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition-base);
}

.follow-btn:hover {
    background: var(--primary-blue);
    color: white;
}

.detail-stats {
    display: flex;
    gap: 20px;
}

.detail-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-500);
    font-size: 14px;
}

.detail-stats b {
    color: var(--gray-700);
}

.detail-body {
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.detail-description {
    color: var(--gray-600);
    line-height: 1.8;
    margin-bottom: 24px;
}

.detail-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn.primary {
    background: var(--primary-blue);
    color: white;
}

.action-btn.primary:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* 安装弹窗 */
.install-modal {
    width: 400px;
    padding: 40px;
    text-align: center;
}

.install-animation {
    position: relative;
    margin: 0 auto 24px;
    width: 120px;
    height: 120px;
}

.install-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    color: var(--primary-blue);
    z-index: 2;
    animation: bounce 1s infinite;
}

.progress-ring {
    position: relative;
    width: 120px;
    height: 120px;
}

.progress-ring svg {
    width: 120px;
    height: 120px;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--primary-blue);
    stroke-width: 8;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-700);
}

#installTitle {
    font-size: 18px;
    color: var(--gray-700);
    margin-bottom: 8px;
}

#installStatus {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 24px;
}

.complete-btn {
    padding: 10px 24px;
    border: none;
    background: var(--success);
    color: white;
    border-radius: var(--radius-round);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-base);
}

.complete-btn:hover {
    transform: scale(1.05);
}

/* ===== 11. 返回顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    border: none;
    background: var(--primary-blue);
    color: white;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-base);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* ===== 12. 动画定义 ===== */
@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(5deg);
    }
    75% {
        transform: translateY(20px) rotate(-5deg);
    }
}

@keyframes drift {
    from {
        transform: translateX(-100px);
    }
    to {
        transform: translateX(calc(100vw + 100px));
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translate(-50%, -50%) translateY(0);
    }
    50% {
        transform: translate(-50%, -50%) translateY(-10px);
    }
}

/* ===== 13. 响应式设计 ===== */
@media (max-width: 1200px) {
    .waterfall-grid {
        column-count: 2;
    }
    
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .waterfall-grid {
        column-count: 1;
    }
    
    .nav-center {
        display: none;
    }
    
    .search-box {
        display: none;
    }
    
    .filter-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-tags {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 12px;
    }
    
    .main-content {
        padding: 20px 12px;
    }
    
    .modal-container {
        max-width: 95%;
        margin: 10px;
    }
}

