:root {
    --bg-color: #f0f4f8;
    --card-bg: rgba(255, 255, 255, 0.65);
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --glass-border: 1px solid rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --card-radius: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #60a5fa;
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    z-index: 0;
    overflow-x: hidden;
}

/* --- 动态背景系统 Start --- */
.dynamic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

/* 天空渐变 */
.sky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6 0%, #60a5fa 40%, #bfdbfe 80%, #e0f2fe 100%);
}

/* 云朵容器 */
.clouds {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60%;
    pointer-events: none;
}

.cloud {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    animation: cloudMove linear infinite;
}

/* 云朵形状细节 */
.cloud::after,
.cloud::before {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

.cloud-1 {
    width: 120px;
    height: 40px;
    top: 15%;
    left: -150px;
    animation-duration: 25s;
    opacity: 0.8;
}

.cloud-1::after {
    width: 50px;
    height: 50px;
    top: -25px;
    left: 15px;
}

.cloud-1::before {
    width: 40px;
    height: 40px;
    top: -15px;
    left: 50px;
}

.cloud-2 {
    width: 180px;
    height: 60px;
    top: 25%;
    left: -200px;
    animation-duration: 35s;
    animation-delay: 5s;
    opacity: 0.6;
}

.cloud-2::after {
    width: 70px;
    height: 70px;
    top: -35px;
    left: 25px;
}

.cloud-2::before {
    width: 60px;
    height: 60px;
    top: -25px;
    left: 80px;
}

.cloud-3 {
    width: 100px;
    height: 35px;
    top: 10%;
    left: -120px;
    animation-duration: 45s;
    animation-delay: 2s;
    opacity: 0.5;
}

.cloud-3::after {
    width: 40px;
    height: 40px;
    top: -20px;
    left: 15px;
}

@keyframes cloudMove {
    0% {
        left: -200px;
    }

    100% {
        left: 110%;
    }
}

/* --- 动态背景系统 End --- */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

/* Header & Logo */
header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0 30px;
    margin-bottom: 20px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 56px;
    font-weight: 900;
    font-style: italic;
    /* 黑金流光渐变 */
    background: linear-gradient(110deg,
            #1e293b 35%,
            #d97706 48%,
            #ffffff 50%,
            #d97706 52%,
            #1e293b 65%);
    background-size: 250% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: shine-text 4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    filter: drop-shadow(0 10px 20px rgba(217, 119, 6, 0.2));
    padding-right: 20px;
    line-height: 1.2;
}

@keyframes shine-text {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 250% center;
    }
}

/* Controls */
.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 16px 24px;
    background: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    color: var(--text-color);
    font-size: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 4px 25px rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.3);
}

.category-filter {
    padding: 16px 24px;
    background: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    color: var(--text-color);
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    min-width: 200px;
}

.category-filter:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Grid & Cards */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.card {
    height: 140px;
    position: relative;
    z-index: 1;
    border-radius: var(--card-radius);
}

.card-inner {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.6) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    border-left: 1px solid rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(203, 213, 225, 0.6);
    border-right: 1px solid rgba(203, 213, 225, 0.6);
    border-radius: var(--card-radius);
    padding: 25px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 140px;
    box-shadow:
        0 10px 20px -5px rgba(0, 0, 0, 0.05),
        0 20px 40px -10px rgba(50, 50, 93, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-layout {
    display: flex;
    gap: 20px;
    position: relative;
    z-index: 2;
    height: 100%;
}

.card-icon-wrapper {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.card-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-icon-default {
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.6) 0%,
            rgba(255, 255, 255, 0.1) 60%,
            rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    opacity: 0.6;
    transition: opacity 0.3s;
    z-index: 0;
}

.card:hover {
    z-index: 100;
}

.card:hover .card-inner {
    height: 260px;
    width: 110%;
    left: -5%;
    top: -60px;
    box-shadow:
        0 30px 60px -12px rgba(50, 50, 93, 0.25),
        0 18px 36px -18px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: linear-gradient(160deg, #ffffff 0%, #f1f5f9 100%);
    transform: scale(1.02) translateY(-5px);
    border-bottom-color: rgba(203, 213, 225, 0.8);
}

.card:hover .card-inner::before {
    opacity: 0.8;
}

.card-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    line-height: 1.3;
}

.file-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 8px;
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    color: #0369a1;
    font-size: 10px;
    font-weight: 800;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow:
        0 2px 4px rgba(3, 105, 161, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

.card-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: auto;
    height: 44px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.5;
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.1s;
}

.card:hover .card-meta {
    opacity: 1;
    transform: translateY(0);
}

.card-actions {
    display: flex;
    gap: 12px;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease 0.2s;
    padding-bottom: 5px;
}

.card:hover .card-actions {
    opacity: 1;
    transform: translateY(0);
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 0 24px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 6px 0 #1d4ed8,
        0 10px 15px rgba(37, 99, 235, 0.4);
    position: relative;
    overflow: hidden;
    top: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 0 #1d4ed8,
        0 15px 25px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}

.download-btn:active {
    transform: translateY(6px);
    box-shadow:
        0 0 0 #1d4ed8,
        0 2px 5px rgba(37, 99, 235, 0.4);
}

.download-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transition: 0.5s;
    transform: skewX(-15deg);
}

.card:hover .download-btn::after {
    animation: shine 1.5s infinite;
}

@keyframes shine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Icon Rotation */
@keyframes rotateIcon {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.card:hover .card-icon-wrapper svg {
    animation: rotateIcon 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-box {
    background: white;
    padding: 30px;
    border-radius: 24px;
    width: 320px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-color);
}

.modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 2px;
    transition: all 0.3s;
    outline: none;
}

.modal-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel {
    background: #f1f5f9;
    color: #64748b;
}

.btn-cancel:hover {
    background: #e2e8f0;
}

.btn-confirm {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-confirm:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.3);
}