/* 公共样式表 - 夏驰毅的个人网站 */

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

html {
    scroll-behavior: auto;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
}

/* 背景图模糊层 - 使用预模糊图片，无 CSS 滤镜，性能最佳 */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a2e;
    background-image: url('bg-blurred.png');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: -1;
}

/* 导航栏 - 使用半透明背景替代 backdrop-filter */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(20, 20, 30, 0.75);
    display: flex;
    align-items: center;
    padding: 0 40px;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar .logo {
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    margin-right: auto;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.navbar .logo a {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar .logo img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.navbar .nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.navbar .nav-links li a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 15px;
    transition: background 0.2s ease, color 0.2s ease;
    letter-spacing: 1px;
}

.navbar .nav-links li a:hover,
.navbar .nav-links li a.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* 页面内容 */
.page-content {
    min-height: 100vh;
    text-align: center;
    padding: 100px 20px 40px;
}

.page-content h1 {
    font-size: 40px;
    color: #fff;
    font-weight: 700;
    letter-spacing: 4px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.6);
    margin-bottom: 40px;
}

/* 页脚 - 滚动到底部显示 */
.footer {
    text-align: center;
    padding: 20px 0;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    letter-spacing: 1px;
    position: relative;
    z-index: 10;
}

/* 加载动画 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.page-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loaderSpin 0.8s linear infinite;
}

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

.loader-text {
    color: rgba(255,255,255,0.6);
    margin-top: 16px;
    font-size: 14px;
    letter-spacing: 2px;
}

.loader-timer {
    color: rgba(255,255,255,0.35);
    margin-top: 8px;
    font-size: 12px;
    letter-spacing: 1px;
}

/* 页面淡入动画 - 使用 opacity -only 避免触发布局 */
.fade-in {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 卡片通用样式 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.card {
    background: rgba(30, 30, 45, 0.7);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 28px 20px;
    text-decoration: none;
    color: #fff;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.card:hover {
    background: rgba(40, 40, 60, 0.85);
    border-color: rgba(255,255,255,0.25);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.card .icon {
    font-size: 40px;
    margin-bottom: 4px;
}

.card .icon-img {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    margin-bottom: 4px;
}

.card .name {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
}

.card .desc {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
    text-align: center;
}

.card .tag {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

/* 搜索框 */
.search-box {
    max-width: 500px;
    margin: 0 auto 30px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 44px;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(30, 30, 45, 0.6);
    color: #fff;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.4);
}

.search-box input:focus {
    border-color: rgba(255,255,255,0.3);
    background: rgba(40, 40, 60, 0.8);
}

.search-box .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.4);
    font-size: 16px;
}

/* 分类筛选 */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(30, 30, 45, 0.5);
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    letter-spacing: 1px;
}

.filter-tab:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.filter-tab.active {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

/* 无结果提示 */
.no-results {
    color: rgba(255,255,255,0.5);
    font-size: 16px;
    padding: 40px 20px;
    text-align: center;
}

/* 分区标题 */
.section-title {
    font-size: 22px;
    color: rgba(255,255,255,0.8);
    margin: 30px 0 20px;
    letter-spacing: 3px;
}

/* 响应式 */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }
    .navbar .nav-links {
        gap: 4px;
    }
    .navbar .nav-links li a {
        padding: 6px 10px;
        font-size: 13px;
    }
    .page-content h1 {
        font-size: 28px;
    }
    .card-grid {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }
    .filter-tabs {
        gap: 6px;
    }
    .filter-tab {
        padding: 6px 14px;
        font-size: 13px;
    }
}
