/* ============================================================
   网盘搜索仿站 - 全局样式
   视觉风格复刻原站：蓝白配色 + 卡片 + 渐变
   ============================================================ */
:root {
    --primary-color: #4a90d9;
    --primary-hover: #357abd;
    --gradient-primary: linear-gradient(135deg, #4a90d9 0%, #6ab0f9 100%);
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-light: #999999;
    --border-color: #e8e8e8;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

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

body {
    background: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    line-height: 1.6;
    color: var(--text-primary);
}

a { text-decoration: none; }

/* ---------------- 导航栏 ---------------- */
.navbar-custom {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.navbar-brand-custom {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color) !important;
    text-decoration: none;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link-custom {
    color: var(--text-secondary) !important;
    font-weight: 600;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.nav-link-custom:hover,
.nav-link-custom.active {
    color: var(--primary-color) !important;
    background: rgba(74, 144, 217, 0.08);
}

/* ---------------- 主容器 ---------------- */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px 60px;
}

/* ---------------- 搜索区域 ---------------- */
.search-section {
    text-align: center;
    padding: 80px 0 60px;
}

.search-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.search-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 700px;
    margin: 0 auto;
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    background: var(--card-bg);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    overflow: hidden;
}

.search-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.1);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 14px 20px;
    font-size: 1.05rem;
    color: var(--text-primary);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-submit-btn {
    width: 56px;
    height: 54px;
    background: var(--gradient-primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

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

/* ---------------- 热门搜索 ---------------- */
.hot-search {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.hot-search-label {
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 6px 0;
}

.hot-search-tag {
    padding: 6px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.hot-search-tag:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ---------------- 内容区块 ---------------- */
.content-section {
    margin-bottom: 50px;
}

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

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

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

/* ---------------- 网盘类型网格 ---------------- */
.cloud-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

.cloud-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 24px 12px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid var(--border-color);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.cloud-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.cloud-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    background: linear-gradient(135deg, rgba(74, 144, 217, 0.1) 0%, rgba(74, 144, 217, 0.05) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.cloud-card:hover .cloud-icon {
    background: var(--gradient-primary);
    color: white;
}

.cloud-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ---------------- 搜索页：统计条 ---------------- */
.stats-bar {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stats-bar .stat strong {
    color: var(--primary-color);
    font-size: 1.1rem;
}

/* ---------------- 网盘类型筛选标签 ---------------- */
.cloud-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.cloud-tag {
    padding: 8px 18px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.cloud-tag .count {
    color: var(--text-light);
    margin-left: 4px;
    font-weight: 400;
}

.cloud-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.cloud-tag.active {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    color: white;
}

.cloud-tag.active .count {
    color: rgba(255, 255, 255, 0.85);
}

/* ---------------- 结果分组 ---------------- */
.cloud-type-section {
    margin-bottom: 36px;
}

.cloud-type-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.cloud-type-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
}

.cloud-type-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.cloud-type-count {
    font-size: 0.85rem;
    color: var(--text-light);
    background: var(--card-bg);
    padding: 3px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.cloud-type-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 14px;
}

/* ---------------- 结果卡片 ---------------- */
.result-item-card {
    background: var(--card-bg);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.result-item-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.animate-fadeInUp {
    animation: fadeInUp 0.4s ease forwards;
}

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

.result-image,
.result-image-placeholder {
    width: 100%;
    height: 160px;
    border-radius: 10px;
    object-fit: cover;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2eaf3 100%);
}

.result-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8c6d8;
    font-size: 2.2rem;
}

.result-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-title a {
    color: var(--text-primary);
    transition: color 0.2s;
}

.result-title a:hover {
    color: var(--primary-color);
}

.result-password {
    background: rgba(231, 76, 60, 0.08);
    color: #e74c3c;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    color: var(--text-light);
}

.result-source {
    background: rgba(74, 144, 217, 0.1);
    color: var(--primary-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.result-url a {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
}

.result-url a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ---------------- 筛选面板 ---------------- */
.filter-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
}

.filter-panel.show {
    max-height: 400px;
    margin-bottom: 20px;
}

.filter-panel-inner {
    padding: 20px;
}

.filter-panel label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.filter-panel .form-control {
    border-radius: 8px;
    border-color: var(--border-color);
    font-size: 0.9rem;
}

/* ---------------- 空状态 / 加载 ---------------- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    color: #c8d4e4;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 150px;
}

/* ---------------- 底部 ---------------- */
.site-footer {
    background: #ffffff;
    padding: 40px 0 24px;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    text-align: center;
}

.footer-copyright {
    color: var(--text-light);
    font-size: 0.85rem;
}

.footer-copyright p {
    margin: 4px 0 0;
    font-size: 0.8rem;
}

/* ---------------- 回到顶部 ---------------- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 4px 16px rgba(74, 144, 217, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top:hover {
    transform: translateY(-3px);
}

/* ---------------- 安装页 / 后台通用 ---------------- */
.install-card,
.auth-card {
    max-width: 560px;
    margin: 60px auto;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 36px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.btn-primary-custom {
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 10px 22px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.badge-cloud {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(74, 144, 217, 0.1);
    color: var(--primary-color);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 768px) {
    .main-container {
        padding: 70px 16px 40px;
    }

    .search-section {
        padding: 40px 0 30px;
    }

    .search-title {
        font-size: 2rem;
    }

    .search-bar {
        gap: 8px;
    }

    .cloud-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 10px;
    }

    .cloud-card {
        padding: 16px 8px;
    }

    .cloud-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .cloud-type-list {
        grid-template-columns: 1fr;
    }
}
