* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #fff;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部 */
header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 20px;
}

.header-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #00d9ff, #00ff88);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #8892b0;
    font-size: 1rem;
}

/* 搜索框 */
.search-container {
    margin-top: 30px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* 搜索引擎切换标签 */
.search-engine-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.engine-tab {
    width: 44px;
    height: 44px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: #8892b0;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.engine-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 217, 255, 0.3);
}

.engine-tab.active {
    background: linear-gradient(135deg, #00d9ff, #00ff88);
    border-color: transparent;
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.4);
}

/* 搜索输入框 */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    padding: 16px 60px 16px 24px;
    font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
}

.search-box input::placeholder {
    color: #8892b0;
}

.search-box input:focus {
    border-color: #00d9ff;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.2);
}

.search-btn {
    position: absolute;
    right: 8px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d9ff, #00ff88);
    color: #1a1a2e;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.4);
}

.search-btn.local {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
}

.search-btn.local:hover {
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

/* 书签搜索按钮样式 */
.engine-tab[data-engine="bookmarks"] span {
    font-size: 1.2rem;
}

/* 分类标题 */
section {
    margin-bottom: 50px;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    position: relative;
}

h2::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, #00d9ff, #00ff88);
    border-radius: 2px;
}

/* 网络切换按钮 */
.network-toggle {
    display: flex;
    gap: 6px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.network-btn {
    padding: 6px 14px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: #8892b0;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.network-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 217, 255, 0.3);
}

.network-btn.active {
    background: linear-gradient(135deg, #00d9ff, #00ff88);
    border-color: transparent;
    color: #1a1a2e;
    box-shadow: 0 2px 10px rgba(0, 217, 255, 0.3);
}

/* 网格布局 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

/* 链接卡片 */
.link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    text-decoration: none;
    color: #ccd6f6;
    transition: all 0.3s ease;
}

.nas-link {
    padding-bottom: 15px; /* 减少3px，给底部指示条留空间 */
    position: relative;
}

/* NAS网络状态指示器 - 卡片底部三段条 */
.nas-link::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 20px;
    right: 20px;
    height: 3px;
    /* 三段分开的指示器，使用硬停止点 */
    background:
        linear-gradient(to right,
            var(--lan-color, rgba(255,255,255,0.15)) 0,
            var(--lan-color, rgba(255,255,255,0.15)) 30%,
            transparent 30%,
            transparent 35%,
            var(--ipv4-color, rgba(255,255,255,0.15)) 35%,
            var(--ipv4-color, rgba(255,255,255,0.15)) 65%,
            transparent 65%,
            transparent 70%,
            var(--ipv6-color, rgba(255,255,255,0.15)) 70%,
            var(--ipv6-color, rgba(255,255,255,0.15)) 100%
        );
}

.link-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 217, 255, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.link-card .icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    filter: drop-shadow(0 0 10px rgba(0, 217, 255, 0.3));
}

.link-card .title {
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 40px 20px;
    color: #8892b0;
    font-size: 0.9rem;
}

footer .footer-link {
    color: #8892b0;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer .footer-link:hover {
    color: #00d9ff;
}

/* 响应式 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .link-card {
        padding: 14px 16px;
    }

    .link-card .icon {
        font-size: 1.4rem;
    }

    .link-card .title {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .link-card {
        flex-direction: column;
        text-align: center;
        padding: 16px 12px;
        gap: 8px;
    }
}

/* 折叠按钮样式 */
.toggle-btn {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 30px;
}

.toggle-btn .toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.toggle-btn .toggle-text {
    margin-left: 8px;
}

.toggle-btn .arrow {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: #8892b0;
}

.toggle-btn:hover {
    opacity: 0.8;
}

.toggle-btn:hover .arrow {
    color: #00d9ff;
}

.toggle-btn.active .arrow {
    color: #00d9ff;
}

/* 隐藏内容板块 */
.hidden-content {
    display: none;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.4s ease;
}

.hidden-content.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
