/* ====================================
   Apple风格导航页 - 主样式文件
   现代化设计 + 流畅动画 + 响应式布局
==================================== */

/* CSS变量定义 */
:root {
    /* 颜色主题 */
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --danger-color: #FF3B30;
    
    /* 背景颜色 */
    --bg-primary: rgba(255, 255, 255, 0.85);
    --bg-secondary: rgba(248, 249, 250, 0.9);
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-blur: rgba(255, 255, 255, 0.15);
    
    /* 文本颜色 */
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --text-tertiary: #8E8E93;
    --text-white: #FFFFFF;
    
    /* 阴影 */
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-medium: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-heavy: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.06);
    
    /* 边距和尺寸 */
    --border-radius: 16px;
    --border-radius-small: 8px;
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    
    /* 字体 */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* 动画 */
    --transition-fast: 0.2s ease-out;
    --transition-medium: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
}

/* 深色主题变量 */
[data-theme="dark"] {
    --bg-primary: rgba(28, 28, 30, 0.9);
    --bg-secondary: rgba(44, 44, 46, 0.9);
    --bg-card: rgba(58, 58, 60, 0.7);
    --bg-blur: rgba(0, 0, 0, 0.3);
    --text-primary: #F2F2F7;
    --text-secondary: #AEAEB2;
    --text-tertiary: #8E8E93;
}

/* 全局重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, 
        #667eea 0%, 
        #764ba2 25%, 
        #f093fb 50%, 
        #f5576c 75%, 
        #4facfe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景渐变动画 */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 页面加载器 */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    display: none;
}

.loader-circle {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--text-white);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-sm);
}

.loader-text {
    color: var(--text-white);
    font-size: 18px;
    font-weight: var(--font-weight-medium);
    letter-spacing: 1px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 主容器 */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: clamp(16px, 3vw, 32px);
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp var(--transition-slow) ease-out forwards;
    animation-delay: 0s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 页面头部 */
.header {
    margin-bottom: clamp(24px, 5vh, 40px);
    position: relative;
}

.header-content {
    backdrop-filter: blur(20px);
    background: var(--bg-blur);
    border-radius: 18px;
    padding: clamp(24px, 4vw, 32px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: var(--shadow-medium);
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 100px;
}

.header-left {
    flex: 1;
    text-align: left;
}

.main-title {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: var(--font-weight-bold);
    color: var(--text-white);
    margin-bottom: clamp(6px, 1vh, 8px);
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 12px);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.title-icon {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.subtitle {
    font-size: clamp(0.8rem, 1.8vw, 0.95rem);
    color: rgba(255, 255, 255, 0.8);
    font-weight: var(--font-weight-medium);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
    line-height: 1.3;
    max-width: 350px;
}

/* 时间显示 */
.time-display {
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: clamp(12px, 2vw, 16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    min-width: 140px;
    flex-shrink: 0;
}

.current-time {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    font-weight: var(--font-weight-bold);
    color: var(--text-white);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
    line-height: 1.2;
}

.current-date {
    font-size: clamp(0.7rem, 1.5vw, 0.8rem);
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 搜索部分 */
.search-section {
    margin-bottom: clamp(20px, 4vh, 32px);
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 clamp(12px, 2vw, 16px);
}

.search-box {
    backdrop-filter: blur(20px);
    background: var(--bg-blur);
    border-radius: 25px;
    padding: clamp(10px, 1.5vw, 14px) clamp(16px, 2.5vw, 20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-medium);
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 12px);
    margin-bottom: clamp(12px, 2vh, 16px);
    transition: all var(--transition-medium);
    min-height: 44px;
}

.search-box:focus-within {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
    border-color: var(--primary-color);
}

.search-icon {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-white);
    font-size: clamp(14px, 2.5vw, 16px);
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-btn {
    background: var(--primary-color);
    color: var(--text-white);
    border: none;
    border-radius: 25px;
    padding: 8px 20px;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-btn:hover {
    background: #0056b3;
    transform: scale(1.05);
}

/* 搜索引擎选择 */
.search-engines {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
}

.engine-btn {
    background: var(--bg-blur);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 6px 16px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.engine-btn:hover,
.engine-btn.active {
    background: var(--primary-color);
    color: var(--text-white);
    transform: translateY(-1px);
}

/* 导航网格 */
.navigation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: clamp(16px, 3vw, 24px);
    margin-bottom: clamp(24px, 5vh, 40px);
    padding: 0 clamp(8px, 1.5vw, 12px);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* 导航卡片 */
.nav-card {
    backdrop-filter: blur(20px);
    background: var(--bg-card);
    border-radius: 18px;
    padding: clamp(20px, 3.5vw, 28px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-medium);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 240px;
    display: flex;
    flex-direction: column;
    aspect-ratio: 1.1;
}

.nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-card:hover::before {
    left: 100%;
}

.nav-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-heavy);
    border-color: var(--primary-color);
}

.card-header {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.5vw, 14px);
    margin-bottom: clamp(12px, 2vh, 16px);
}

.card-icon {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    line-height: 1;
    flex-shrink: 0;
}

.card-title {
    font-size: clamp(1rem, 2vw, 1.2rem);
    font-weight: var(--font-weight-semibold);
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    line-height: 1.3;
}

.card-description {
    color: rgba(255, 255, 255, 0.85);
    font-size: clamp(0.8rem, 1.8vw, 0.9rem);
    margin-bottom: clamp(12px, 2vh, 16px);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    line-height: 1.4;
    flex-grow: 1;
}

.card-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(6px, 1.2vw, 8px);
    margin-top: auto;
}

.card-link {
    display: flex;
    align-items: center;
    gap: clamp(4px, 1vw, 6px);
    padding: clamp(8px, 1.5vw, 10px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-decoration: none;
    color: white;
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    min-height: 36px;
    text-align: center;
    justify-content: center;
}

.card-link:hover {
    background: var(--primary-color);
    color: var(--text-white);
    transform: translateY(-1px);
    border-color: var(--primary-color);
}

.link-icon {
    font-size: 1rem;
}

/* 快捷工具栏 */
.quick-tools {
    margin-bottom: clamp(24px, 5vh, 40px);
    padding: 0 clamp(12px, 2vw, 16px);
}

.tools-container {
    display: flex;
    justify-content: center;
    gap: clamp(10px, 2vw, 16px);
    flex-wrap: wrap;
    max-width: 400px;
    margin: 0 auto;
}

.tool-btn {
    backdrop-filter: blur(20px);
    background: var(--bg-blur);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: clamp(12px, 2vw, 16px);
    cursor: pointer;
    transition: all var(--transition-medium);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(4px, 0.8vw, 6px);
    min-width: clamp(60px, 12vw, 80px);
    min-height: 60px;
    justify-content: center;
}

.tool-btn:hover {
    transform: translateY(-4px);
    background: var(--primary-color);
    box-shadow: var(--shadow-medium);
}

.tool-icon {
    font-size: clamp(1.2rem, 2.5vw, 1.4rem);
}

.tool-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(0.7rem, 1.5vw, 0.75rem);
    font-weight: var(--font-weight-medium);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.tool-btn:hover .tool-label {
    color: var(--text-white);
}

/* 页面底部 */
.footer {
    text-align: center;
    margin-top: clamp(24px, 5vh, 40px);
    padding: 0 clamp(12px, 2vw, 16px);
}

.footer-content {
    backdrop-filter: blur(20px);
    background: var(--bg-blur);
    border-radius: 12px;
    padding: clamp(16px, 3vw, 20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    margin: 0 auto;
}

.footer-text {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: clamp(12px, 2vh, 16px);
    font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    line-height: 1.3;
}

.heart {
    color: var(--danger-color);
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: clamp(16px, 3vw, 24px);
    flex-wrap: wrap;
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: clamp(0.7rem, 1.5vw, 0.8rem);
    transition: color var(--transition-fast);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    padding: 3px 6px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.footer-link:hover {
    color: var(--primary-color);
}

/* 背景装饰元素 */
.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.floating-circle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

.circle-1 {
    width: 200px;
    height: 200px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.circle-2 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.circle-3 {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.floating-gradient {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: drift 8s ease-in-out infinite;
}

.gradient-1 {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    top: 20%;
    right: 10%;
    animation-delay: 1s;
}

.gradient-2 {
    background: linear-gradient(45deg, var(--warning-color), var(--success-color));
    bottom: 10%;
    left: 10%;
    animation-delay: 3s;
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* 模态窗口 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-medium);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    max-width: 90vw;
    max-height: 90vh;
    width: 500px;
    box-shadow: var(--shadow-heavy);
    transform: scale(0.9);
    transition: transform var(--transition-medium);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: between;
    padding: var(--spacing-md);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-title {
    flex: 1;
    font-size: 1.2rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-content {
    padding: var(--spacing-md);
    max-height: 60vh;
    overflow-y: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .navigation-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 8px;
    }
    
    .nav-card {
        min-height: 200px;
    }
    
    .card-links {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .search-engines {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .tools-container {
        gap: 12px;
    }
    
    .tool-btn {
        min-width: 70px;
        min-height: 70px;
        padding: 12px 8px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
    
    .header-content {
        margin-bottom: 16px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2rem;
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .header-content {
        padding: var(--spacing-md);
    }
    
    .card-links {
        grid-template-columns: 1fr;
    }
}

/* 性能优化 */
.nav-card,
.tool-btn,
.search-box {
    will-change: transform;
}

/* 可访问性增强 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 打印样式 */
@media print {
    .background-decoration,
    .floating-circle,
    .floating-gradient {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
} 