/* ==========================================================================
   现代化导航系统样式 - 2025
   灵感来源：Uiverse.io + Glassmorphism + 现代化设计
   ========================================================================== */

/* CSS自定义属性 */
:root {
    /* 色彩系统 */
    --primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --warning: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    
    /* 文字颜色 */
    --text-primary: #1a1a1a;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-white: #ffffff;
    
    /* 背景色 */
    --bg-glass: rgba(255, 255, 255, 0.25);
    --bg-glass-hover: rgba(255, 255, 255, 0.35);
    --bg-dark-glass: rgba(0, 0, 0, 0.1);
    --bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* 渐变背景 */
    --gradient-bg: linear-gradient(135deg, 
        rgba(142, 45, 226, 0.1) 0%, 
        rgba(74, 0, 224, 0.1) 25%,
        rgba(67, 56, 202, 0.1) 50%,
        rgba(192, 132, 252, 0.1) 75%,
        rgba(219, 39, 119, 0.1) 100%);
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-glass: 0 8px 32px rgba(31, 38, 135, 0.37);
    
    /* 边框半径 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* 间距系统 */
    --space-xs: 0.5rem;   /* 8px */
    --space-sm: 0.75rem;  /* 12px */
    --space-md: 1rem;     /* 16px */
    --space-lg: 1.5rem;   /* 24px */
    --space-xl: 2rem;     /* 32px */
    --space-2xl: 3rem;    /* 48px */
    
    /* 动画 */
    --transition-fast: all 0.15s ease;
    --transition-normal: all 0.25s ease;
    --transition-slow: all 0.4s ease;
    --transition-smooth: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
    --transition-elastic: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-bg);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* 主容器 */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ==========================================================================
   顶部区域 - 时钟
   ========================================================================== */

.header {
    padding: var(--space-md) var(--space-xl);
    display: flex;
    justify-content: center;
    align-items: center;
}

.clock-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.digital-clock {
    text-align: center;
    padding: var(--space-sm) var(--space-lg);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    backdrop-filter: blur(15px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.digital-clock::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.digital-clock:hover::before {
    left: 100%;
}

.digital-clock:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 6px 25px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.time-display {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.08em;
    margin-bottom: 2px;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
}

.time-display .separator {
    opacity: 0.8;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 50% { opacity: 0.8; }
    51%, 100% { opacity: 0.3; }
}

.date-display {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    gap: var(--space-xs);
    justify-content: center;
    font-weight: 500;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   主要内容区域
   ========================================================================== */

.main-content {
    flex: 1;
    padding: 0 var(--space-xl);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* 搜索区域 */
.search-section {
    position: relative;
    padding: var(--space-xl) 0;
    text-align: center;
    z-index: 10;
}

.search-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 var(--space-md);
    position: relative;
}

/* 搜索框 */
.search-wrapper {
    position: relative;
    margin-bottom: var(--space-md);
}

.search-form {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    align-items: center;
    position: relative;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
    backdrop-filter: blur(20px);
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: var(--space-xs);
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-glass);
    overflow: visible;
    width: 100%;
    max-width: 600px;
    min-height: 56px;
    z-index: 100;
}

/* 搜索引擎选择器样式 */
.search-engine-selector {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    margin-right: 0;
    padding-right: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10000;
    height: 100%; /* 占满搜索框的高度 */
}

.current-engine {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--transition-normal);
    background: transparent;
    color: var(--text-primary);
    height: 100%;
    min-height: 36px; /* 确保有足够高度垂直居中 */
}

.current-engine:hover {
    background: rgba(255, 255, 255, 0.1);
}

.current-engine svg {
    transition: var(--transition-normal);
}

/* 移除箭头相关样式 */
.search-engine-selector.open .dropdown-arrow {
    /* 移除箭头旋转效果 */
}

.engine-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-normal);
    z-index: 9999;
    margin-top: 4px;
    min-width: 120px;
}

.search-engine-selector.open .engine-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.engine-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition-normal);
    color: var(--text-primary);
    border-radius: 6px;
    margin: 4px;
}

.engine-option:hover {
    background: rgba(255, 255, 255, 0.2);
}

.engine-option.active {
    background: rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

.engine-option svg {
    flex-shrink: 0;
}

.engine-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* 引擎选择器在焦点状态下的样式 */
.search-box:focus-within .search-engine-selector {
    transform: scale(1.02);
}

.search-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%,
        rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: inherit;
}

.search-box:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 16px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.search-box:hover::before {
    opacity: 1;
}

.search-box:focus-within {
    border-color: rgba(102, 126, 234, 0.6);
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.15),
        0 20px 45px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transform: translateY(-3px);
}

.search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--space-md) 0 0;
    color: var(--text-secondary);
    transition: var(--transition-normal);
    position: relative;
    z-index: 2;
}

.search-box:focus-within .search-icon {
    color: rgba(102, 126, 234, 0.8);
    transform: scale(1.1);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: calc(var(--radius-full) - 4px);
    font-size: 1.1rem;
    padding: var(--space-md) var(--space-md);
    color: var(--text-primary);
    font-weight: 500;
    transition: 
        background 0.3s ease,
        box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
    margin: 0 6px 0 2px;
    backdrop-filter: blur(5px);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
    opacity: 0.8;
    transition: var(--transition-normal);
}

.search-input:focus::placeholder {
    opacity: 0.6;
    transform: translateX(5px);
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 
        0 4px 15px rgba(102, 126, 234, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 2;
    margin-right: 2px;
}

.search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-btn:hover {
    transform: translateX(3px) scale(1.08);
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.search-btn:hover::before {
    opacity: 1;
}

.search-btn:active {
    transform: translateX(1px) scale(1.03);
}

/* 搜索建议样式 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 56px; /* 搜索引擎选择器宽度(40px) + 搜索图标宽度(16px) */
    right: 60px; /* 搜索按钮宽度(60px) */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 
                0 4px 16px rgba(0, 0, 0, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition-normal);
    z-index: 10001;
    max-height: 320px;
    overflow-y: auto;
    overflow-x: hidden;
}

.search-suggestions.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-suggestions::-webkit-scrollbar {
    width: 4px;
}

.search-suggestions::-webkit-scrollbar-track {
    background: transparent;
}

.search-suggestions::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.search-suggestions::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 建议项样式 */
.suggestion-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition-normal);
    color: var(--text-primary);
    border-radius: 12px;
    margin: 4px 8px;
    position: relative;
    gap: 12px;
}

.suggestion-item:hover,
.suggestion-item.highlighted {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateX(2px);
}

.suggestion-item:active {
    transform: translateX(2px) scale(0.98);
}

/* 建议图标 */
.suggestion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.suggestion-icon svg {
    opacity: 0.8;
}

/* 建议文本 */
.suggestion-text {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-highlight {
    color: #38f;
    font-weight: 600;
    background: rgba(56, 136, 255, 0.1);
    border-radius: 3px;
    padding: 1px 2px;
}

/* 建议操作图标 */
.suggestion-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    opacity: 0;
    transition: var(--transition-normal);
    color: var(--text-secondary);
}

.suggestion-item:hover .suggestion-action,
.suggestion-item.highlighted .suggestion-action {
    opacity: 0.6;
}

.suggestion-action:hover {
    opacity: 1;
    color: #38f;
}

/* 加载状态样式 */
.suggestion-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    gap: 8px;
}

.loading-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #38f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .search-suggestions {
        left: 50px; /* 移动端调整左边距 */
        right: 50px; /* 移动端调整右边距 */
        border-radius: 12px;
        margin-top: 6px;
        max-height: 280px;
    }
    
    .suggestion-item {
        padding: 10px 12px;
        margin: 3px 6px;
        gap: 10px;
    }
    
    .suggestion-icon {
        width: 20px;
        height: 20px;
    }
    
    .suggestion-text {
        font-size: 0.85rem;
    }
    
    .suggestion-action {
        width: 18px;
        height: 18px;
    }
}

/* ==========================================================================
   导航区域
   ========================================================================== */

.navigation-section {
    margin-bottom: var(--space-2xl);
}

/* 所有分类和导航展示 */
.nav-all-container {
    max-width: 1200px;
    margin: 0 auto;
}

.category-section {
    margin-bottom: var(--space-2xl);
}

.category-section:last-child {
    margin-bottom: 0;
}

/* 分类标题 */
.category-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-lg);
    padding: 0 var(--space-md);
    position: relative;
}

.category-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.category-title:hover {
    background: var(--bg-glass-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, rgba(102, 126, 234, 0.8) 100%);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    box-shadow: 
        0 2px 8px rgba(102, 126, 234, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: var(--transition-normal);
}

.category-title:hover .category-icon {
    transform: scale(1.05);
    box-shadow: 
        0 4px 12px rgba(102, 126, 234, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.category-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
    line-height: 1;
}

.category-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(
        90deg, 
        rgba(102, 126, 234, 0.2) 0%, 
        rgba(102, 126, 234, 0.1) 50%, 
        transparent 100%
    );
    margin-left: var(--space-md);
    border-radius: var(--radius-full);
    position: relative;
}

.category-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 30%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        var(--primary) 0%, 
        rgba(102, 126, 234, 0.6) 100%
    );
    border-radius: var(--radius-full);
    opacity: 0.8;
    animation: lineFlow 3s ease-in-out infinite;
}

@keyframes lineFlow {
    0%, 100% {
        opacity: 0.8;
        transform: scaleX(1);
    }
    50% {
        opacity: 1;
        transform: scaleX(1.1);
    }
}

/* 导航网格 */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-xs);
    padding: 0 var(--space-sm);
    animation: fadeInUp 0.6s ease;
}

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

/* 导航卡片 */
.nav-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-normal);
}

.nav-card:hover {
    transform: translateY(-2px) scale(1.005);
}

.nav-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.nav-card-inner {
    padding: var(--space-md);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    height: 100%;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.nav-card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transition: var(--transition-normal);
}

.nav-card:hover .nav-card-inner {
    background: var(--bg-glass-hover);
    box-shadow: var(--shadow-lg);
    border-color: rgba(102, 126, 234, 0.3);
}

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

.nav-icon-wrapper {
    flex-shrink: 0;
    position: relative;
    margin-bottom: var(--space-sm);
}

.nav-icon {
    font-size: 1.6rem;
    color: var(--text-primary);
    transition: var(--transition-normal);
}

.nav-icon-img {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

/* 主导航区域的图片和图标显示逻辑 */
.nav-icon-wrapper img.nav-icon-img {
    position: relative;
    z-index: 2;
}

.nav-icon-wrapper .fallback-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    display: none;
}

/* 当图片加载失败时，通过JavaScript显示备用图标 */

.nav-card:hover .nav-icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-content {
    flex: 1;
}

.nav-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-description {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
    opacity: 0.9;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 空状态 */
.empty-state,
.empty-state-global {
    text-align: center;
    padding: var(--space-2xl);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-md);
}

.empty-state-global {
    max-width: 500px;
    margin: var(--space-2xl) auto;
}

.empty-icon {
    margin-bottom: var(--space-lg);
    color: var(--text-muted);
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.empty-description {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ==========================================================================
   底部区域
   ========================================================================== */

.footer {
    padding: var(--space-lg) var(--space-xl) var(--space-sm);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: var(--space-lg);
}

.footer-main {
    flex: 1;
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
    text-align: left;
}

.footer-stats {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

.stat-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-xs);
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
}

.stat-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   加载状态
   ========================================================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    text-align: center;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    padding: var(--space-2xl);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
}

.spinner-ring {
    display: inline-block;
    position: relative;
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-lg);
}

.spinner-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 51px;
    height: 51px;
    margin: 6px;
    border: 6px solid transparent;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spinnerRing 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring div:nth-child(1) { animation-delay: -0.45s; }
.spinner-ring div:nth-child(2) { animation-delay: -0.3s; }
.spinner-ring div:nth-child(3) { animation-delay: -0.15s; }

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

.loading-text {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

/* ==========================================================================
   响应式设计
   ========================================================================== */

@media (max-width: 1024px) {
    .nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--space-sm);
    }
}

@media (max-width: 768px) {
    .header {
        padding: var(--space-md);
    }
    
    .main-content {
        padding: 0 var(--space-md);
    }
    
    .time-display {
        font-size: 1.2rem;
    }
    
    .digital-clock {
        padding: var(--space-xs) var(--space-md);
    }
    
    .nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--space-xs);
    }
    
    .category-header {
        padding: 0 var(--space-sm);
        margin-bottom: var(--space-md);
    }
    
    .category-title {
        padding: var(--space-xs) var(--space-sm);
        gap: var(--space-xs);
    }
    
    .category-name {
        font-size: 1rem;
    }
    
    .category-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: var(--space-md);
    }
    
    .footer-stats {
        flex-wrap: wrap;
        justify-content: center;
        flex-direction: row;
        gap: var(--space-sm);
        padding: var(--space-xs) var(--space-sm);
    }
}

@media (max-width: 480px) {
    .search-section {
        padding: var(--space-md) 0;
    }
    
    .search-box {
        padding: 3px;
    }
    
    .search-input {
        font-size: 1rem;
        padding: var(--space-sm) var(--space-sm);
        margin: 0 4px 0 2px;
    }
    
    .search-btn {
        width: 40px;
        height: 40px;
        margin-right: 2px;
    }
    
    .search-icon {
        padding: 0 var(--space-sm) 0 0;
    }
    
    .search-suggestions {
        left: 42px; /* 超小屏幕更紧凑的布局 */
        right: 42px;
    }
    
    .nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--space-xs);
    }
    
    .nav-card-inner {
        padding: var(--space-sm);
        min-height: 85px;
    }
    
    .nav-icon {
        font-size: 1.4rem;
    }
    
    .nav-icon-img {
        width: 24px;
        height: 24px;
    }
    
    .nav-title {
        font-size: 0.9rem;
    }
    
    .nav-description {
        font-size: 0.7rem;
        -webkit-line-clamp: 1;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
        margin-bottom: var(--space-sm);
    }
    
    .category-title {
        padding: var(--space-xs) var(--space-sm);
        gap: var(--space-xs);
    }
    
    .category-name {
        font-size: 0.9rem;
    }
    
    .category-icon {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .category-line {
        margin-left: 0;
        margin-top: var(--space-xs);
        width: 100%;
    }
    
    .footer-stats {
        gap: var(--space-xs);
        padding: 6px 12px;
    }
    
    .stat-item {
        min-width: 60px;
    }
    
    .stat-label {
        font-size: 0.6rem;
    }
    
    .stat-value {
        font-size: 0.8rem;
    }
    
    .stat-divider {
        height: 16px;
    }
    
    .search-engine-selector {
        margin-left: var(--space-xs);
        margin-right: 0;
        padding-right: 0;
    }
    
    .current-engine {
        padding: 4px 6px;
    }
    
    .current-engine svg {
        width: 18px;
        height: 18px;
    }
    
    .dropdown-arrow {
        width: 10px;
        height: 10px;
    }
    
    .engine-dropdown {
        min-width: 100px;
    }
    
    .engine-option {
        padding: 8px 10px;
        gap: 6px;
    }
    
    .engine-option svg {
        width: 18px;
        height: 18px;
    }
    
    .engine-name {
        font-size: 0.85rem;
    }
}

/* ==========================================================================
   特殊效果
   ========================================================================== */

/* 鼠标跟随效果 */
@media (hover: hover) {
    .nav-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(
            600px circle at var(--mouse-x) var(--mouse-y),
            rgba(102, 126, 234, 0.1),
            transparent 40%
        );
        border-radius: var(--radius-lg);
        opacity: 0;
        transition: opacity 0.3s;
        pointer-events: none;
    }
    
    .nav-card:hover::before {
        opacity: 1;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* 选中文本样式 */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}

/* 焦点可见样式 */
*:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* 打印样式 */
@media print {
    .header,
    .footer,
    .loading-overlay {
        display: none !important;
    }
    
    .main-container {
        background: white !important;
    }
    
    .nav-card-inner {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}

/* ==========================================================================
   常用导航区域
   ========================================================================== */

.favorite-navigation {
    margin-top: var(--space-xl);
    padding: 0 var(--space-md);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.favorite-nav-grid {
    display: grid;
    grid-template-columns: repeat(6, 130px); /* 每行最多6个，固定宽度 */
    justify-content: center; /* 居中显示 */
    gap: var(--space-md);
    max-width: 900px;
    margin: 0 auto;
}

.favorite-nav-item {
    opacity: 0;
    animation: favoriteSlideIn 0.6s ease forwards;
    animation-delay: calc(var(--item-index, 0) * 0.1s);
}

@keyframes favoriteSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.favorite-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.favorite-nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.favorite-nav-link:hover::before {
    left: 100%;
}

.favorite-nav-link:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-md);
    border-color: rgba(255, 255, 255, 0.3);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
}

.favorite-nav-link:active {
    transform: translateY(-1px) scale(0.98);
}

.favorite-nav-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius-sm);
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.favorite-nav-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    transform: translateX(-100%) translateY(-100%) rotate(45deg);
    transition: transform 0.6s ease;
}

.favorite-nav-link:hover .favorite-nav-icon::before {
    transform: translateX(100%) translateY(100%) rotate(45deg);
}

/* 常用导航区域的图片和图标显示逻辑 */
.favorite-nav-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 2;
}

.favorite-nav-icon .fallback-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    display: none;
}

/* 当图片加载失败时，通过JavaScript显示备用图标 */

.favorite-nav-link:hover .favorite-nav-icon {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* 当图标是图片时，移除背景和阴影 */
.favorite-nav-icon.has-image {
    background: transparent;
    box-shadow: none;
}

.favorite-nav-name {
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
    opacity: 0.9;
    transition: var(--transition-normal);
}

.favorite-nav-link:hover .favorite-nav-name {
    opacity: 1;
    color: var(--text-primary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .favorite-navigation {
        margin-top: var(--space-lg);
        padding: 0 var(--space-sm);
    }
    .favorite-nav-grid {
        grid-template-columns: repeat(3, 1fr); /* 手机端3列，自动等宽 */
    }
}
@media (max-width: 350px) {
    .favorite-nav-grid {
        grid-template-columns: repeat(2, 1fr); /* 极小屏2列 */
    }
}

/* ==========================================================================
   导航分类标签样式
   ========================================================================== */

/* 分类标签容器 */
.nav-categories {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
    padding-top: var(--space-xs);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 单个分类标签 */
.nav-category-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    backdrop-filter: blur(8px);
    transition: var(--transition-fast);
    position: relative;
    overflow: hidden;
}

/* 分类标签光泽效果 */
.nav-category-tag::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 ease;
}

/* 分类标签悬停效果 */
.nav-card:hover .nav-category-tag {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.15));
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.nav-card:hover .nav-category-tag::before {
    left: 100%;
}

/* 分类标签图标 */
.nav-category-tag i {
    font-size: 0.6rem;
    opacity: 0.8;
    transition: var(--transition-fast);
}

.nav-card:hover .nav-category-tag i {
    opacity: 1;
    transform: scale(1.1);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .nav-categories {
        gap: 4px;
        margin-top: 8px;
        padding-top: 6px;
    }
    
    .nav-category-tag {
        padding: 1px 6px;
        font-size: 0.65rem;
        gap: 3px;
    }
    
    .nav-category-tag i {
        font-size: 0.55rem;
    }
}

@media (max-width: 480px) {
    .nav-categories {
        gap: 3px;
        margin-top: 6px;
        padding-top: 4px;
    }
    
    .nav-category-tag {
        padding: 1px 5px;
        font-size: 0.6rem;
        gap: 2px;
        border-radius: 4px;
    }
    
    .nav-category-tag i {
        font-size: 0.5rem;
    }
}

/* 文件结束 */ 