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

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

a {
    text-decoration: none;
    color: #007bff;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo a {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    gap: 8px;
}

.nav-link {
    color: #2c3e50;
    padding: 12px 20px;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transition: left 0.3s ease;
    z-index: -1;
    border-radius: 25px;
}

.nav-link:hover::before,
.nav-link.active::before {
    left: 0;
}

.nav-link:hover,
.nav-link.active {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* 主要内容 */
.main-content {
    min-height: calc(100vh - 120px);
    padding: 20px 0;
    position: relative;
}

/* 欢迎区域 */
.hero {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    color: white;
    padding: 100px 40px;
    text-align: center;
    margin: 40px auto;
    max-width: 1200px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

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

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 25px;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
    letter-spacing: -1px;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 40px;
    opacity: 0.95;
    font-weight: 400;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.search-box {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.search-box form {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 60px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.search-box form:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
}

.search-box input {
    flex: 1;
    padding: 20px 30px;
    border: none;
    font-size: 1.1rem;
    outline: none;
    background: transparent;
    color: #2c3e50;
    font-weight: 500;
}

.search-box input::placeholder {
    color: #7f8c8d;
    font-weight: 400;
}

.search-box button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 20px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.search-box button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #764ba2, #667eea);
    transition: left 0.3s ease;
}

.search-box button:hover::before {
    left: 0;
}

.search-box button:hover {
    transform: scale(1.05);
}

.search-box button i {
    position: relative;
    z-index: 1;
}

/* 分类网格 */
.categories {
    margin: 80px 0;
    padding: 0 20px;
}

.categories h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.categories h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.category-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.category-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

.category-card a {
    color: inherit;
    display: block;
    position: relative;
    z-index: 2;
}

.category-card i {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.category-card:hover i {
    transform: scale(1.1) rotate(5deg);
}

.category-card h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 600;
}

.category-card p {
    color: #7f8c8d;
    font-size: 0.95rem;
    font-weight: 500;
}

/* 资源网格 - 瀑布流布局 */
.latest-resources {
    margin: 80px 0;
    padding: 0 20px;
}

.latest-resources h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.latest-resources h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 2px;
}

.resource-grid {
    column-count: 3;
    column-gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .resource-grid {
        column-count: 2;
        column-gap: 25px;
    }
}

@media (max-width: 768px) {
    .resource-grid {
        column-count: 1;
        column-gap: 0;
    }
}

.resource-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    break-inside: avoid;
    position: relative;
    overflow: hidden;
}

.resource-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.resource-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
}

.resource-info {
    position: relative;
    z-index: 2;
}

.resource-info h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.4;
}

.resource-info h3 a {
    color: #2c3e50;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #2c3e50, #2c3e50);
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: 0% 100%;
    transition: background-size 0.3s ease;
}

.resource-info h3 a:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    background-size: 100% 2px;
    background-repeat: no-repeat;
    background-position: 0% 100%;
    color: #667eea;
}

.resource-desc {
    color: #7f8c8d;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 0.95rem;
}

.resource-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.resource-meta span {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    padding: 6px 12px;
    border-radius: 20px;
    color: #667eea;
    font-weight: 500;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.resource-meta span:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-1px);
}

.resource-actions {
    text-align: right;
    margin-top: 20px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    color: white;
}

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

.btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(149, 165, 166, 0.4);
    color: white;
}

.btn-full {
    width: 100%;
    text-align: center;
}

/* 认证页面 */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.auth-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.auth-header p {
    color: #666;
    font-size: 0.9rem;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    outline: none;
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
    border-color: #007bff;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.auth-links {
    text-align: center;
    margin-top: 20px;
}

.auth-links p {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
}

/* 上传页面 */
.upload-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.upload-header {
    text-align: center;
    margin-bottom: 30px;
}

.upload-header h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2rem;
}

.upload-form .form-group {
    margin-bottom: 25px;
}

.upload-form label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 1rem;
}

.file-upload {
    border: 2px dashed #007bff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    background: #f8f9ff;
    transition: all 0.3s ease;
}

.file-upload:hover {
    border-color: #0056b3;
    background: #f0f4ff;
}

.file-upload input[type="file"] {
    margin-bottom: 15px;
}

.file-upload-info {
    font-size: 0.9rem;
    color: #666;
    text-align: left;
}

.file-upload-info p {
    margin-bottom: 5px;
}

.file-size-limit {
    color: #dc3545;
    font-weight: 500;
}

.file-selected-info {
    margin-top: 15px;
    padding: 15px;
    background: #d4edda;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
}

.file-selected-info .error {
    color: #dc3545;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* 提示消息 */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 页脚 */
.footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
    }
    
    .nav-menu {
        margin-top: 15px;
        gap: 15px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .category-grid,
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-box {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .upload-container {
        margin: 20px;
        padding: 30px 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .resource-meta {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 60px 20px;
        margin: 20px;
        border-radius: 20px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .search-box form {
        flex-direction: column;
        border-radius: 20px;
    }
    
    .search-box input {
        border-radius: 20px 20px 0 0;
    }
    
    .search-box button {
        border-radius: 0 0 20px 20px;
    }
    
    .category-card,
    .resource-card {
        padding: 25px 20px;
    }
    
    .categories h2,
    .latest-resources h2 {
        font-size: 2rem;
    }
}

/* 瀑布流动画效果 */
.resource-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.resource-card:nth-child(1) { animation-delay: 0.1s; }
.resource-card:nth-child(2) { animation-delay: 0.2s; }
.resource-card:nth-child(3) { animation-delay: 0.3s; }
.resource-card:nth-child(4) { animation-delay: 0.4s; }
.resource-card:nth-child(5) { animation-delay: 0.5s; }
.resource-card:nth-child(6) { animation-delay: 0.6s; }
.resource-card:nth-child(7) { animation-delay: 0.7s; }
.resource-card:nth-child(8) { animation-delay: 0.8s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 分类卡片动画 */
.category-card {
    animation: fadeInScale 0.6s ease forwards;
    opacity: 0;
    transform: scale(0.8);
}

.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }
.category-card:nth-child(4) { animation-delay: 0.4s; }
.category-card:nth-child(5) { animation-delay: 0.5s; }
.category-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInScale {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 加载动画 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* 选择文本样式 */
::selection {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

::-moz-selection {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}