/* 基础样式 */
:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #ff9e00;
    --dark: #212529;
    --light: #f8f9fa;
    --gray: #6c757d;
    --border-radius: 12px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--dark);
}

/* 容器样式 */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    min-height: 90vh;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.page-info {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
}

#pageName {
    font-weight: bold;
    color: #ffd166;
}

/* 主要内容区域 */
.main-content {
    padding: 40px;
}

.instructions {
    background: var(--light);
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.instructions i {
    color: var(--primary);
    margin-right: 10px;
}

/* 网盘选择器 */
.disk-selector {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.disk-btn {
    flex: 1;
    min-width: 200px;
    padding: 20px 30px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: var(--light);
    color: var(--dark);
}

.disk-btn i {
    font-size: 1.3rem;
}

.disk-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.disk-btn.active {
    color: white;
}

.baidu-btn.active {
    background: linear-gradient(135deg, #2932e1 0%, #1a22b8 100%);
}

.quark-btn.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

/* 内容区域 */
.content-area {
    position: relative;
    min-height: 300px;
}

.disk-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

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

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

.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
    font-size: 1.2rem;
}

.loading i {
    margin-right: 10px;
    font-size: 1.5rem;
}

/* 链接卡片样式 */
.links-container {
    display: grid;
    gap: 20px;
}

.link-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    border: 2px solid #e9ecef;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.link-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.1);
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: var(--primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.resource-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.resource-title i {
    color: var(--primary);
}

.file-size {
    background: var(--light);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--gray);
}

.link-section {
    margin-bottom: 20px;
}

.link-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--gray);
    font-weight: 500;
}

.link-box {
    display: flex;
    gap: 10px;
}

.link-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: 'Consolas', monospace;
    font-size: 0.95rem;
    background: var(--light);
    transition: var(--transition);
    overflow-x: auto;
    white-space: nowrap;
}

.link-input:focus {
    outline: none;
    border-color: var(--primary);
}

.copy-btn {
    padding: 12px 25px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 110px;
    justify-content: center;
}

.copy-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.copy-btn.success {
    background: var(--success);
}

.password-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--light);
    padding: 15px;
    border-radius: 8px;
}

.password-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.password-info i {
    color: var(--warning);
}

.password-value {
    font-family: 'Consolas', monospace;
    font-weight: 600;
    letter-spacing: 1px;
    background: white;
    padding: 5px 15px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.show-password-btn {
    padding: 8px 20px;
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.show-password-btn:hover {
    background: var(--primary);
    color: white;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #adb5bd;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* 安全通知 */
.security-notice {
    background: linear-gradient(135deg, #ffd166 0%, #ffc043 100%);
    color: #5d4037;
    padding: 15px 25px;
    border-radius: var(--border-radius);
    margin-top: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 500;
}

.security-notice i {
    font-size: 1.3rem;
}

/* 页脚 */
.footer {
    background: var(--dark);
    color: white;
    padding: 25px 40px;
    text-align: center;
}

.footer p {
    margin: 5px 0;
}

.timestamp {
    font-size: 0.85rem;
    color: #adb5bd;
}

/* Toast提示 */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--success);
    color: white;
    padding: 15px 25px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 5px 20px rgba(76, 201, 240, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1000;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    max-width: 400px;
    width: 90%;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--dark);
}

.modal-body {
    margin: 20px 0;
}

.modal-body code {
    background: var(--light);
    padding: 10px 15px;
    border-radius: 6px;
    font-family: 'Consolas', monospace;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.btn {
    padding: 10px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    flex: 1;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
    border: 2px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
}

/* 错误页面样式 */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 40px 20px;
}

.error-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
}

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

.error-message {
    color: var(--gray);
    margin: 20px 0;
    line-height: 1.6;
}

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

/* 长密码样式 */
.long-password {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e9ecef;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        border-radius: 10px;
    }

    .header {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
    }

    .main-content {
        padding: 20px;
    }

    .disk-selector {
        flex-direction: column;
    }

    .disk-btn {
        min-width: auto;
    }

    .link-box {
        flex-direction: column;
    }

    .copy-btn {
        width: 100%;
    }

    .password-section {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
    }

    .error-actions {
        flex-direction: column;
    }
}