/* 优化后的样式表 */

/* 基础样式 */
body {
    margin: 0;
    padding: 0.5rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: url('../../image/beijing.webp') no-repeat center/cover fixed;
    min-height: 100vh;
    overflow-x: hidden;
    color: #333;
}

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

/* 加载动画 */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.35s linear, visibility 0.35s linear;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(45, 140, 240, 0.2);
    border-radius: 50%;
    border-top-color: #2d8cf0;
    animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.loading-text {
    margin-top: 20px;
    font-size: 16px;
    color: #2d8cf0;
    text-align: center;
    animation: fadeInOut 1.5s ease-in-out infinite;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@keyframes fadeInOut {
    0% { opacity: 0.4; transform: scale(0.98); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.4; transform: scale(0.98); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 主容器样式 */
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    opacity: 1;
    transform: translateY(0);
}



/* 头部样式 */
.nav-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1.5rem;
}

.logo {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    flex-shrink: 0;
}

.site-title {
    font-size: 2rem;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.site-description {
    color: #666;
    font-size: 0.9rem;
}

/* 搜索框样式 */
.search-container {
    margin-bottom: 2rem;
    position: relative;
}

.search-box {
    display: flex;
    gap: 0.5rem;
    max-width: 100%;
    transition: box-shadow 0.3s ease;
}

.search-box:focus-within {
    box-shadow: 0 0 15px rgba(24, 144, 255, 0.25);
}

.search-input {
    flex: 1;
    padding: 0.8rem 1.2rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
    width: 100%;
}

.search-input:focus {
    outline: none;
    border-color: #2d8cf0;
    box-shadow: 0 0 0 3px rgba(45, 140, 240, 0.1);
}

.search-button {
    background: #2d8cf0;
    border: none;
    padding: 0 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-button:hover {
    background: #1a7ad9;
}

.search-icon {
    width: 20px;
    height: 20px;
    fill: white;
}



/* 分类标题样式 */
.category-title {
    grid-column: 1 / -1;
    margin: 0.5rem 0 0.35rem 0;
    padding: 0.3rem 0;
    color: #333;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: left;
    border-bottom: 2px solid #eee;
}

/* 第一个分类标题上边距为0 */
.category-title:first-of-type {
    margin-top: 0;
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.2rem;
}

/* 卡片样式 */
.nav-card {
    display: flex;
    align-items: center;
    padding: 1.2rem;
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eee;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.3s ease forwards;
    opacity: 0;
    text-decoration: none;
    color: inherit;
}

.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-icon {
    width: 32px;
    height: 32px;
    margin-right: 1rem;
    flex-shrink: 0;
    border-radius: 8px;
}

.card-text h3 {
    margin-bottom: 0.4rem;
    color: #1a1a1a;
    font-size: 1rem;
}

.card-text p {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

.b_adSlug {
    font-size: 0.7rem;
    color: #999;
    margin-left: 0.5rem;
}

/* 页脚样式 */
.footer {
    margin-top: 1rem;
    padding: 0.55rem 0 0;
    border-top: 1px solid #eee;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.footer a {
    color: #666;
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer a:hover {
    opacity: 0.8;
}

/* 页脚行样式 */
.footer-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 2px 0;
    flex-wrap: wrap;
    line-height: 1.3;
}

/* 分隔符样式 */
.separator {
    margin: 0 6px;
    color: #ccc;
}

/* 非移动端 - 两行布局 */
@media (min-width: 768px) {
    /* 显示非移动端行 */
    .footer-row-1,
    .footer-row-2 {
        display: flex;
        margin: 2px 0;
    }
    
    /* 隐藏移动端行 */
    .footer-row-mobile {
        display: none;
    }
}

/* 移动端 - 垂直布局 */
@media (max-width: 767px) {
    /* 隐藏非移动端行 */
    .footer-row-1,
    .footer-row-2 {
        display: none;
    }
    
    /* 显示移动端行 */
    .footer-row-mobile {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin: 2px 0;
        padding: 2px 0;
    }
    
    /* 隐藏分隔符 */
    .separator {
        display: none;
    }
    
    /* 调整字体大小 */
    .copyright,
    .feedback,
    .beian-link {
        font-size: 0.8rem;
    }
}

.police-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
    display: inline-block;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}



/* 响应式设计 */
@media (max-width: 768px) {
    .nav-card {
        animation-delay: calc(var(--card-index) * 0.05s);
    }
    .card-grid {
        grid-template-columns: 1fr;
    }
    .nav-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .search-button {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .nav-header {
        text-align: left;
    }
    .search-input {
        font-size: 0.9rem;
    }
}

@media (max-width: 355px) {
    input[type="text"] {
        width: 50%
    }
    .card-text h3 {
        font-size: 0.9rem;
    }
    .card-text p {
        font-size: 0.8rem;
    }
}
