@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --bg-color: #f2f2f7;
    --text-main: #1d1d1f;
    --text-gray: #86868b;
    --accent: #2997ff;
    --glass-panel: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.6);
    --card-bg: rgba(255, 255, 255, 0.85);
    --font-std: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
    --font-serif: 'Playfair Display', serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-std);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- 背景流光 --- */
.ambient-light {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; pointer-events: none; overflow: hidden;
    background: #f0f4f8;
}
.blob {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.7;
    animation: float 25s infinite ease-in-out alternate;
}
.blob-1 { top: -10%; left: -10%; width: 600px; height: 600px; background: #e0c3fc; animation-delay: 0s; }
.blob-2 { bottom: -10%; right: -5%; width: 500px; height: 500px; background: #8ec5fc; animation-delay: -5s; }
.blob-3 { top: 30%; left: 40%; width: 400px; height: 400px; background: #ffdee9; animation-delay: -10s; }
@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 60px) scale(1.1); }
}

/* --- 导航栏 --- */
.navbar {
    position: fixed; top: 0; width: 100%; height: 60px; z-index: 1000;
    transition: background 0.3s;
}
.navbar.glass { background: rgba(255,255,255,0.7); backdrop-filter: blur(20px); }
.nav-content { height: 100%; display: flex; justify-content: space-between; align-items: center; }

.logo {
    font-size: 22px; font-weight: 800; font-family: var(--font-serif);
    text-decoration: none !important;
    background: linear-gradient(135deg, #1a1a1a 0%, #4a4a4a 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-right { display: flex; align-items: center; gap: 10px; }

/* 搜索框优化 */
.search-form { display: flex; align-items: center; position: relative; flex-shrink: 0; }
.search-input {
    background: rgba(0, 0, 0, 0.05); border: 1px solid transparent; border-radius: 20px;
    padding: 6px 12px 6px 30px; font-size: 13px; width: 140px; transition: width 0.3s ease;
}
.search-input:focus { background: #fff; width: 200px; border-color: var(--accent); }
.search-icon-symbol { position: absolute; left: 10px; font-size: 12px; color: #999; pointer-events: none; }
.btn-login { font-size: 13px; font-weight: 500; color: #333; margin-left: 5px; text-decoration: none; }

/* --- 布局容器 --- */
.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.hero { padding: 140px 0 80px; text-align: center; }
.hero-title {
    font-family: var(--font-serif); font-size: 52px; font-weight: 700;
    line-height: 1.2; margin-bottom: 10px; color: #1d1d1f;
}
.hero-subtitle { font-family: var(--font-serif); font-size: 20px; color: var(--text-gray); font-style: italic; }

.glass-container-wrapper {
    background: var(--glass-panel); backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px); border: 1px solid var(--glass-border);
    border-radius: 30px; padding: 40px; box-shadow: 0 20px 60px rgba(0,0,0,0.05);
    margin-bottom: 80px;
}

/* --- 卡片与列表 --- */
.grid {
    display: grid;
    /* auto-fill 会尝试填满行，dense 模式有助于排版 */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-flow: dense; 
    gap: 30px;
}

a.card-link-wrapper { text-decoration: none; color: inherit; display: block; height: 100%; }
.card {
    background: var(--card-bg); border-radius: 16px; overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03); transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(255,255,255,0.6); display: flex; flex-direction: column; height: 100%;
}
a.card-link-wrapper:hover .card { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); }

.card-img-wrap { height: 180px; overflow: hidden; }
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: 0.6s; }
a.card-link-wrapper:hover .card-img-wrap img { transform: scale(1.08); }

.card-content { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-title { font-size: 18px; margin-bottom: 8px; color: #1d1d1f; line-height: 1.4; font-weight: 700; }
.card-excerpt { font-size: 13px; color: #666; line-height: 1.6; margin-bottom: 15px; flex: 1; }
.card-meta { display: flex; justify-content: space-between; font-size: 11px; color: #999; text-transform: uppercase; }

/* ====================================================
   布局更新：顶部大图 + 底部双列 (仿照你的图片要求)
   ==================================================== */

/* 默认移动端保持单列 (不用改)，下面是电脑端的特殊处理 */
@media screen and (min-width: 768px) {
    
    /* 1. 强制网格为严格的“两列”布局 */
    .grid.featured-layout {
        /* 强制分为两列，每列占50% */
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 30px;
    }

    /* 2. 让第一个文章 (Hero) 横跨两列 (span 2) */
    .grid.featured-layout > .card-link-wrapper:first-child {
        grid-column: 1 / -1; /* 从第一根网格线跨到最后一根，即占满整行 */
    }
    
    /* 3. 第一个文章的图片高度加大，制造视觉冲击力 */
    .grid.featured-layout > .card-link-wrapper:first-child .card-img-wrap {
        height: 400px; /* 大图高度 */
    }
    
    /* 4. 第一个文章的标题加大 */
    .grid.featured-layout > .card-link-wrapper:first-child .card-title {
        font-size: 32px;
        margin-bottom: 15px;
    }
    
    /* 5. 第一个文章的简介显示更多行数 */
    .grid.featured-layout > .card-link-wrapper:first-child .card-excerpt {
        font-size: 16px;
        -webkit-line-clamp: 5; /* 显示更多文字 */
    }
    
    /* 其他普通卡片的图片高度保持适中 */
    .grid.featured-layout > .card-link-wrapper:not(:first-child) .card-img-wrap {
        height: 220px;
    }
}

/* --- 后台样式 --- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.form-control { width: 100%; padding: 12px; border: 1px solid rgba(0,0,0,0.1); background: rgba(255,255,255,0.8); border-radius: 12px; font-size: 16px; }
.btn-submit { background: #1d1d1f; color: #fff; border: none; padding: 12px 30px; border-radius: 50px; font-size: 14px; cursor: pointer; }
.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.admin-table th, .admin-table td { padding: 15px; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.1); }
.admin-table th { background: rgba(0,0,0,0.02); font-size: 13px; }

/* --- 移动端适配 --- */
@media screen and (max-width: 768px) {
    .container { padding: 0 15px; }
    .hero { padding: 100px 0 50px; }
    .hero-title { font-size: 34px; }
    
    /* 搜索框固定宽度，防挤压 */
    .search-input, .search-input:focus { width: 100px !important; }
    
    /* 卡片单列 */
    .grid { grid-template-columns: 1fr; gap: 20px; }
    .card-img-wrap { height: 200px; }
    
    /* 玻璃容器变薄 */
    .glass-container-wrapper { padding: 20px !important; border-radius: 20px; }
    
    /* 后台适配 */
    .admin-table th, .admin-table td { font-size: 14px; padding: 10px; }
    .action-link { display: inline-block; padding: 6px 10px; background: rgba(0,0,0,0.05); margin-bottom: 5px; border-radius: 4px; }
    .btn-submit { width: 100%; text-align: center; margin-top: 10px; }
}