:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 动态背景 */
.bg-animation {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

.bg-animation::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: bgMove 20s linear infinite;
}

@keyframes bgMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* 浮动元素 */
.floating-shapes {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 6s ease-in-out infinite;
}

.shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.shape:nth-child(3) {
    width: 60px;
    height: 60px;
    bottom: 20%;
    left: 30%;
    animation-delay: 4s;
}

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

/* 主容器 */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 头部 */
.header {
    text-align: center;
    margin-bottom: 40px;
    animation: slideDown 0.8s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header .subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.header .resource-type {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 8px 20px;
    border-radius: 25px;
    color: white;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 资源卡片 */
.resource-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
}

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

.resource-header {
    background: var(--success-gradient);
    padding: 25px;
    text-align: center;
}

.resource-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.resource-id {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    display: inline-block;
}

.resource-body {
    padding: 30px;
}

/* 网盘选项卡 */
.disk-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.disk-tab {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #495057;
    position: relative;
    overflow: hidden;
}

.disk-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    transition: left 0.3s ease;
    z-index: -1;
}

.disk-tab:hover::before,
.disk-tab.active::before {
    left: 0;
}

.disk-tab:hover,
.disk-tab.active {
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

.disk-tab i {
    margin-right: 8px;
}

/* 网盘内容 */
.disk-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.disk-content.active {
    display: block;
}

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

.link-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.link-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.link-label i {
    margin-right: 8px;
    color: #007bff;
}

.link-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.link-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.95rem;
    background: white;
    transition: all 0.3s ease;
}

.link-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.copy-btn {
    background: var(--success-gradient);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.password-section {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.password-label {
    font-weight: 600;
    color: #856404;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.password-label i {
    margin-right: 8px;
}

.password-input {
    background: white;
    border: 1px solid #ffeaa7;
    padding: 10px 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #856404;
}

/* 二维码部分 */
.qr-section {
    text-align: center;
    margin-top: 25px;
}

.qr-toggle-btn {
    background: var(--secondary-gradient);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.qr-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.3);
}

.qr-code-container {
    display: none;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 300px;
    margin: 0 auto;
}

.qr-code-container.show {
    display: block;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.qr-code-img {
    width: 200px;
    height: 200px;
    margin: 0 auto 15px;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 10px;
    background: white;
}

.qr-text {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* 返回按钮 */
.back-section {
    text-align: center;
    margin-top: 40px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* 错误页面 */
.error-container {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    max-width: 500px;
    margin: 50px auto;
}

.error-icon {
    font-size: 4rem;
    color: #dc3545;
    margin-bottom: 20px;
}

.error-title {
    color: #495057;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.error-message {
    color: #6c757d;
    margin-bottom: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .resource-title {
        font-size: 1.2rem;
    }

    .disk-tabs {
        flex-direction: column;
        align-items: center;
    }

    .disk-tab {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }

    .link-input-group {
        flex-direction: column;
    }

    .copy-btn {
        width: 100%;
        justify-content: center;
    }

    .qr-code-img {
        width: 180px;
        height: 180px;
    }

    .qr-code-container {
        max-width: 250px;
        padding: 15px;
    }

    .qr-code-container.show {
        display: block;
    }

    /* 确保二维码在手机端正确显示 */
    .qr-code-img canvas,
    .qr-code-img img {
        width: 100% !important;
        height: auto !important;
        max-width: 180px !important;
        border-radius: 8px;
    }

    /* 手机端优化 */
    .mobile-only-notice {
        font-size: 1rem;
        padding: 12px;
    }

    .qr-text {
        font-size: 0.85rem;
        margin-top: 10px;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 手机端扫码提示 */
.mobile-only-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.mobile-only-notice p {
    margin: 0;
    color: #856404;
    font-weight: 500;
    font-size: 1.1em;
}
