/* 磁力搜索导航 - 深空磁场主题 */

/*
 * 字体方案：100%使用系统原生字体
 * 优势：
 * 1. 无需加载外部字体文件，页面加载速度最快
 * 2. 中国大陆访问完全无障碍，不依赖Google Fonts
 * 3. 在各平台都使用最优渲染的系统字体
 * 4. iOS使用SF字体，Windows使用微软雅黑，Android使用思源黑体
 */

:root {
    /* 深空配色系统 */
    --color-space-dark: #0a0e27;
    --color-space-deep: #0f1729;
    --color-space-mid: #1a2332;

    /* 霓虹强调色 */
    --color-neon-cyan: #00f0ff;
    --color-neon-magenta: #ff0080;
    --color-neon-orange: #ff6b35;
    --color-neon-purple: #bd00ff;

    /* 文字颜色 */
    --color-text-primary: #e8edf4;
    --color-text-secondary: #a0aec0;
    --color-text-muted: #718096;

    /* 玻璃态效果 */
    --glass-bg: rgba(26, 35, 50, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);

    /* 间距 */
    --spacing-unit: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--color-text-primary);
    background: var(--color-space-dark);
    min-height: 100vh;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* 深空背景动画 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 10% 20%, rgba(0, 240, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 90% 70%, rgba(255, 0, 128, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(189, 0, 255, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, var(--color-space-dark) 0%, var(--color-space-deep) 50%, #0d1525 100%);
    z-index: -2;
    animation: deepSpaceShift 20s ease-in-out infinite;
}

/* 磁场线条动画背景 */
body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background-image:
        repeating-linear-gradient(90deg, transparent, transparent 2px, rgba(0, 240, 255, 0.03) 2px, rgba(0, 240, 255, 0.03) 4px),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 0, 128, 0.03) 2px, rgba(255, 0, 128, 0.03) 4px);
    z-index: -1;
    animation: magneticField 30s linear infinite;
    pointer-events: none;
}

@keyframes deepSpaceShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    33% { opacity: 0.9; transform: scale(1.02); }
    66% { opacity: 0.95; transform: scale(0.98); }
}

@keyframes magneticField {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 calc(var(--spacing-unit) * 3);
}

/* 头部样式 */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    box-shadow:
        0 4px 30px rgba(0, 240, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: calc(var(--spacing-unit) * 3) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    text-align: center;
}

.logo {
    font-family: -apple-system, system-ui, BlinkMacSystemFont, "SF Pro Display", "Microsoft YaHei UI", "Segoe UI", "Helvetica Neue", sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--color-text-primary);
    margin-bottom: calc(var(--spacing-unit) * 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 2);
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow:
        0 0 20px rgba(0, 240, 255, 0.5),
        0 0 40px rgba(0, 240, 255, 0.3);
}

.logo-icon {
    font-size: 2.5rem;
    animation: magneticPulse 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px var(--color-neon-cyan));
}

@keyframes magneticPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

.subtitle {
    font-size: 1rem;
    color: var(--color-text-secondary);
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.main {
    padding: calc(var(--spacing-unit) * 6) 0;
}

/* 搜索区域 */
.search-section {
    margin-bottom: calc(var(--spacing-unit) * 8);
}

.search-container {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.search-title {
    font-family: -apple-system, system-ui, BlinkMacSystemFont, "SF Pro Display", "Microsoft YaHei UI", "Segoe UI", "Helvetica Neue", sans-serif;
    font-size: 2.2rem;
    color: var(--color-text-primary);
    margin-bottom: calc(var(--spacing-unit) * 4);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 2);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.search-title .logo-icon {
    font-size: 2rem;
}

/* 玻璃态搜索框 */
.search-box {
    display: flex;
    gap: calc(var(--spacing-unit) * 2);
    margin-bottom: calc(var(--spacing-unit) * 3);
    background: var(--glass-bg);
    border-radius: 50px;
    padding: calc(var(--spacing-unit) * 1);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 8px 32px rgba(0, 240, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(0, 240, 255, 0.1);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--color-neon-cyan);
    box-shadow:
        0 8px 40px rgba(0, 240, 255, 0.3),
        0 0 0 2px rgba(0, 240, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#searchInput {
    flex: 1;
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
    border: none;
    background: transparent;
    color: var(--color-text-primary);
    font-size: 1rem;
    font-weight: 400;
    outline: none;
}

#searchInput::placeholder {
    color: var(--color-text-muted);
}

/* 霓虹按钮 */
#searchBtn {
    padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);
    background: linear-gradient(135deg, var(--color-neon-cyan) 0%, var(--color-neon-magenta) 100%);
    color: #ffffff;
    border: none;
    border-radius: 50px;
    font-family: "SF Mono", "Monaco", "Consolas", "Courier New", "Microsoft YaHei", monospace;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow:
        0 4px 20px rgba(0, 240, 255, 0.4),
        0 0 20px rgba(255, 0, 128, 0.3);
    position: relative;
    overflow: hidden;
}

#searchBtn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

#searchBtn:hover::before {
    left: 100%;
}

#searchBtn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 30px rgba(0, 240, 255, 0.6),
        0 0 40px rgba(255, 0, 128, 0.5);
}

#searchBtn:active {
    transform: translateY(0);
}

/* 热门标签 */
.hot-searches {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 1.5);
}

.hot-label {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hot-tag {
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2);
    background: rgba(0, 240, 255, 0.1);
    color: var(--color-neon-cyan);
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 240, 255, 0.2);
    font-weight: 500;
}

.hot-tag:hover {
    background: rgba(0, 240, 255, 0.2);
    border-color: var(--color-neon-cyan);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    transform: translateY(-2px);
}

/* 导航区域 */
.nav-section {
    margin-bottom: calc(var(--spacing-unit) * 8);
}

.section-title {
    font-family: -apple-system, system-ui, BlinkMacSystemFont, "SF Pro Display", "Microsoft YaHei UI", "Segoe UI", "Helvetica Neue", sans-serif;
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 5);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: linear-gradient(135deg, var(--color-neon-cyan) 0%, var(--color-neon-magenta) 50%, var(--color-neon-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 30px rgba(0, 240, 255, 0.3));
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-neon-cyan), transparent);
    box-shadow: 0 0 10px var(--color-neon-cyan);
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 5);
}

/* 玻璃态卡片 */
.nav-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 3);
    text-decoration: none;
    color: var(--color-text-primary);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px) saturate(180%);
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 霓虹发光效果 */
.nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.1), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.nav-item:hover::before {
    opacity: 1;
}

.nav-item:hover {
    border-color: var(--color-neon-cyan);
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 60px rgba(0, 240, 255, 0.3),
        0 0 40px rgba(0, 240, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.nav-icon {
    font-size: 3rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
    display: block;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.3));
}

.nav-item:hover .nav-icon {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 0 20px var(--color-neon-cyan));
}

.nav-title {
    font-family: "SF Mono", "Monaco", "Consolas", "Courier New", "Microsoft YaHei", monospace;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: calc(var(--spacing-unit) * 1);
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.nav-desc {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* 帮助区域 */
.help-section {
    margin-bottom: calc(var(--spacing-unit) * 8);
}

.help-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: calc(var(--spacing-unit) * 3);
    max-width: 1000px;
    margin: 0 auto;
}

.help-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: calc(var(--spacing-unit) * 4);
    backdrop-filter: blur(20px) saturate(180%);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.help-item:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 0, 128, 0.3);
    box-shadow:
        0 8px 30px rgba(255, 0, 128, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.help-item h3 {
    font-family: "SF Mono", "Monaco", "Consolas", "Courier New", "Microsoft YaHei", monospace;
    font-size: 1.1rem;
    color: var(--color-text-primary);
    margin-bottom: calc(var(--spacing-unit) * 2);
    font-weight: 700;
}

.help-item p {
    color: var(--color-text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* 页脚 */
.footer {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--glass-border);
    box-shadow:
        0 -4px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: calc(var(--spacing-unit) * 4) 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: calc(var(--spacing-unit) * 1);
}

.disclaimer {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-space-deep);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-neon-cyan), var(--color-neon-magenta));
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--color-neon-magenta), var(--color-neon-cyan));
}

/* 文本选择 */
::selection {
    background: rgba(0, 240, 255, 0.3);
    color: #ffffff;
}

/* 焦点样式 */
button:focus {
    outline: 2px solid var(--color-neon-cyan);
    outline-offset: 2px;
}

/* 加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-item, .help-item {
    animation: fadeInUp 0.6s ease-out backwards;
}

.nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-item:nth-child(2) { animation-delay: 0.1s; }
.nav-item:nth-child(3) { animation-delay: 0.15s; }
.nav-item:nth-child(4) { animation-delay: 0.2s; }
.nav-item:nth-child(5) { animation-delay: 0.25s; }
.nav-item:nth-child(6) { animation-delay: 0.3s; }
.nav-item:nth-child(7) { animation-delay: 0.35s; }
.nav-item:nth-child(8) { animation-delay: 0.4s; }
.nav-item:nth-child(9) { animation-delay: 0.45s; }
.nav-item:nth-child(10) { animation-delay: 0.5s; }
.nav-item:nth-child(11) { animation-delay: 0.55s; }
.nav-item:nth-child(12) { animation-delay: 0.6s; }
.nav-item:nth-child(13) { animation-delay: 0.65s; }
.nav-item:nth-child(14) { animation-delay: 0.7s; }
.nav-item:nth-child(15) { animation-delay: 0.75s; }

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 calc(var(--spacing-unit) * 2);
    }

    .logo {
        font-size: 2rem;
    }

    .search-title {
        font-size: 1.6rem;
    }

    .search-box {
        flex-direction: column;
        gap: calc(var(--spacing-unit) * 1);
        border-radius: 20px;
    }

    #searchInput {
        padding: calc(var(--spacing-unit) * 2);
    }

    #searchBtn {
        padding: calc(var(--spacing-unit) * 2);
        border-radius: 15px;
    }

    .nav-grid {
        grid-template-columns: 1fr;
        gap: calc(var(--spacing-unit) * 2);
    }

    .help-content {
        grid-template-columns: 1fr;
        gap: calc(var(--spacing-unit) * 2);
    }
}

@media (max-width: 480px) {
    .header {
        padding: calc(var(--spacing-unit) * 2) 0;
    }

    .main {
        padding: calc(var(--spacing-unit) * 4) 0;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .nav-icon {
        font-size: 2.5rem;
    }
}

/* iOS特定优化 */
@supports (-webkit-touch-callout: none) {
    /* iOS设备检测 */
    body {
        /* 改善iOS上的字体渲染 */
        -webkit-font-smoothing: subpixel-antialiased;
        -webkit-text-size-adjust: 100%;
    }

    /* 改善iOS触摸体验 */
    .nav-item,
    .hot-tag,
    .category-item,
    #searchBtn {
        -webkit-tap-highlight-color: rgba(0, 240, 255, 0.2);
        cursor: pointer;
    }

    /* 改善iOS输入框体验 */
    #searchInput {
        -webkit-appearance: none;
        border-radius: 0;
        font-size: 16px; /* 防止iOS自动缩放 */
    }
}

/* 性能优化 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
