/* 开发者镜像导航 - 精美版 */

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

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-nav: #ffffff;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== 顶部导航 ========== */
.header {
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-top {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    flex-shrink: 0;
}

.logo i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: transform 0.3s;
}

.logo:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* 广告条 */
.ad-banner {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 25px;
    font-size: 13px;
    color: #92400e;
    overflow: hidden;
    position: relative;
}

.ad-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.ad-banner i {
    color: #f59e0b;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.ad-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-link {
    color: #d97706;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.2s;
}

.ad-link:hover {
    color: #b45309;
}

.search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-main);
    border: 2px solid var(--border);
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.admin-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    flex-shrink: 0;
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* 分类导航 */
.nav-menu {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    color: var(--text-gray);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    transition: all 0.3s;
}

.nav-item::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
    border-radius: 3px 3px 0 0;
    transition: all 0.3s;
    transform: translateX(-50%);
}

.nav-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1), transparent);
    border-radius: 50%;
    transition: all 0.4s;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.nav-item:hover {
    color: var(--primary);
}

.nav-item:hover::before {
    width: 80%;
}

.nav-item:hover::after {
    width: 150%;
    height: 150%;
}

.nav-item:hover .nav-icon {
    transform: translateY(-3px) scale(1.1);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::before {
    width: 80%;
}

.nav-icon {
    font-size: 16px;
    transition: transform 0.3s;
}

.nav-text {
    position: relative;
}

/* ========== 主内容 ========== */
.main {
    padding: 32px 0 60px;
    min-height: calc(100vh - 300px);
}

.section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
}

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

.section-desc {
    font-size: 13px;
    color: var(--text-light);
}

/* ========== 常用镜像站网格 ========== */
.card-grid {
    display: grid;
    gap: 16px;
}

.card-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.quick-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    position: relative;
    overflow: hidden;
}

.quick-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.quick-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

.quick-card:hover::before {
    transform: scaleX(1);
}

.quick-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    transition: transform 0.3s;
}

.quick-card:hover .quick-icon {
    transform: scale(1.15) rotate(8deg);
}

.quick-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    text-align: center;
}

/* ========== 分类卡片行 ========== */
.card-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    transition: transform 0.3s;
}

.card:hover .card-icon {
    transform: scale(1.1);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}

.card-body {
    padding: 8px;
}

/* 链接项 */
.link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    cursor: pointer;
}

.link-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.05));
}

.link-item:hover .link-name {
    color: var(--primary);
    transform: translateX(4px);
}

.link-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dark);
    transition: all 0.2s;
}

.link-type {
    font-size: 11px;
    color: var(--text-light);
    background: var(--bg-main);
    padding: 3px 10px;
    border-radius: 12px;
}

.config-icon {
    color: var(--primary);
    font-size: 12px;
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.link-item:hover .config-icon {
    opacity: 1;
}

/* ========== 动画 ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 回到顶部按钮 ========== */
.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 99;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.back-to-top i {
    font-size: 16px;
}

/* ========== 页脚 ========== */
.footer {
    background: linear-gradient(180deg, #1e293b, #0f172a);
    color: #e2e8f0;
    padding: 50px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-brand {
    max-width: 350px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}

.footer-logo i {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.footer-desc {
    font-size: 14px;
    color: #94a3b8;
    line-height: 1.8;
}

.footer-links-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.footer-col h4 {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), #8b5cf6);
    border-radius: 2px;
}

.footer-col a {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.footer-col a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-col a i {
    width: 16px;
    text-align: center;
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 24px;
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.footer-bottom .icp,
.footer-bottom .police {
    color: #475569;
}

/* ========== 弹窗 ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-box {
    position: relative;
    width: 100%;
    max-width: 600px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.3s ease;
}

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

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-head h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 600;
}

.modal-head h3 i {
    color: var(--primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    background: var(--bg-main);
    border: none;
    border-radius: 10px;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #ef4444;
    color: white;
}

.modal-body {
    padding: 24px;
}

.modal-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius-sm);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 20px;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* ========== 响应式 ========== */
@media (max-width: 1200px) {
    .card-grid.cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 900px) {
    .card-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card-row {
        grid-template-columns: 1fr;
    }
    
    .footer-links-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-top {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .ad-banner {
        order: 4;
        max-width: 100%;
        width: 100%;
    }
    
    .search-box {
        order: 3;
        max-width: 100%;
        width: 100%;
    }
    
    .nav-menu {
        padding: 8px 16px;
    }
    
    .nav-item {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .card-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .quick-card {
        padding: 20px 12px;
    }
    
    .quick-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .footer-links-group {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .back-to-top {
        right: 20px;
        bottom: 80px;
        width: 44px;
        height: 44px;
    }
}

@media (max-width: 480px) {
    .card-grid.cols-4 {
        grid-template-columns: 1fr 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .logo span {
        display: none;
    }
}

/* ========== 顶部广告位 ========== */
.top-ad-banner {
    flex: 1;
    max-width: 728px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-ad-banner img {
    max-width: 100%;
    height: auto;
    max-height: 90px;
    border-radius: 8px;
}

.top-ad-banner a {
    display: block;
}

.ad-placeholder {
    width: 728px;
    max-width: 100%;
    height: 90px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 14px;
}

.ad-placeholder small {
    font-size: 12px;
    color: #cbd5e1;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .top-ad-banner {
        display: none;
    }
}
