/* 导入科技感字体，增加 display=swap 防止阻塞 */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0b10;
    color: #c0c8d8;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-image: radial-gradient(ellipse at top, #1a1f35 0%, #0a0b10 70%);
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== 头部 ========== */
.site-header {
    background: rgba(10, 15, 30, 0.95);
    border-bottom: 2px solid #d4af37;
    padding: 15px 0;
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: #d4af37;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 0.8rem;
    color: #7a8aa8;
    display: block;
    margin-top: -5px;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 25px;
}

.main-nav a {
    color: #a0b0d0;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
    color: #d4af37;
    border-bottom-color: #d4af37;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

/* ========== Hero ========== */
.hero {
    text-align: center;
    padding: 60px 20px 40px;
    border-bottom: 1px solid #2a3048;
    margin-bottom: 40px;
}

.hero h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    color: #d4af37;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.6);
}

.hero p {
    font-size: 1.2rem;
    color: #8a9ab8;
    max-width: 700px;
    margin: 0 auto;
}

/* ========== 区块标题 ========== */
.section-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    color: #d4af37;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3a4a6a;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

/* ========== 搜索表单 ========== */
.search-form {
    display: flex;
    gap: 10px;
    margin: -5px 0 25px;
}

.search-form input {
    flex: 1;
    padding: 11px 13px;
    background: rgba(20, 25, 45, 0.9);
    color: #c0c8d8;
    border: 1px solid #2a3555;
    border-radius: 4px;
    font-size: 0.95rem;
}

.search-form input::placeholder {
    color: #687692;
}

.search-form input:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.25);
}

.search-form button,
.search-reset {
    padding: 10px 16px;
    background: #d4af37;
    color: #10131d;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    line-height: 1.2;
    white-space: nowrap;
}

.search-reset {
    background: #2f3b52;
    color: #e6e6e6;
}

.search-form button:hover,
.search-reset:hover {
    opacity: 0.9;
    text-decoration: none;
}

/* ========== 分页样式（新增） ========== */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 6px 12px;
    background: rgba(20, 25, 45, 0.8);
    border: 1px solid #2a3555;
    border-radius: 4px;
    color: #e6e6e6;
    text-decoration: none;
    transition: border-color 0.3s;
}

.pagination a:hover {
    border-color: #d4af37;
}

.pagination .current {
    background: #d4af37;
    color: #10131d;
    border-color: #d4af37;
}

/* ========== 卡片网格（首页） ========== */
.article-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.card {
    background: rgba(20, 25, 45, 0.8);
    border: 1px solid #2a3555;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
    border-color: #d4af37;
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
}

.card-cover {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #1a1c2a;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.card:hover .card-cover img {
    transform: scale(1.05);
}

.card-cover a {
    display: block;
    width: 100%;
    height: 100%;
}

.card-body {
    padding: 20px;
}

.card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.card-body h3 a {
    color: #d4af37;
    text-decoration: none;
}

.card-body time {
    font-size: 0.85rem;
    color: #6a7a9a;
    display: block;
    margin-bottom: 10px;
}

.excerpt {
    color: #a0b0c8;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.read-more {
    color: #4a90e2;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.read-more:hover {
    color: #d4af37;
}

/* ========== 文章列表（articles.php） ========== */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.list-item {
    display: flex;
    background: rgba(20, 25, 45, 0.8);
    border: 1px solid #2a3555;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.3s;
    gap: 0;
}

.list-item:hover {
    border-color: #d4af37;
}

.list-item-cover {
    flex: 0 0 220px;
    min-height: 160px;
    overflow: hidden;
    background: #1a1c2a;
}

.list-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;       /* 改为 contain，保持完整比例显示 */
    background-color: #1a1c2a; /* 与背景色一致，防止透明或白边 */
    transition: transform 0.4s;
}

.list-item:hover .list-item-cover img {
    transform: scale(1.05);
}

.list-item-cover a {
    display: block;
    width: 100%;
    height: 100%;
}

.list-item-body {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.list-item-body h3 {
    font-size: 1.3rem;
    margin-bottom: 6px;
}

.list-item-body h3 a {
    color: #d4af37;
    text-decoration: none;
}

.list-item-body time {
    font-size: 0.85rem;
    color: #6a7a9a;
    display: block;
    margin-bottom: 8px;
}

/* ========== 文章详情 ========== */
.full-article {
    background: rgba(20, 25, 45, 0.8);
    border: 1px solid #2a3555;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.article-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #3a4a6a;
}

.article-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    color: #d4af37;
    margin-bottom: 10px;
}

.article-header time {
    color: #6a7a9a;
}

.article-cover {
    margin-bottom: 25px;
    text-align: center;
}

.article-cover img {
    max-width: 100%;
    height: auto;
    border: 1px solid #3a4a6a;
    border-radius: 3px;
}

.article-content {
    color: #c0c8d8;
    line-height: 1.8;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border: 1px solid #3a4a6a;
    margin: 15px 0;
}

.article-content p {
    margin-bottom: 15px;
}

.article-content h2,
.article-content h3 {
    color: #d4af37;
    margin: 20px 0 10px;
}

.back-link {
    display: inline-block;
    color: #4a90e2;
    text-decoration: none;
    margin-bottom: 40px;
    font-weight: bold;
}

.back-link:hover {
    color: #d4af37;
}

/* ========== 无数据 ========== */
.no-data {
    text-align: center;
    color: #6a7a9a;
    font-style: italic;
    padding: 40px;
}

/* ========== 页脚 ========== */
.site-footer {
    background: #0a0b10;
    border-top: 1px solid #2a3048;
    padding: 15px 0;
    text-align: center;
    color: #5a6a8a;
    font-size: 0.9rem;
    margin-top: 40px;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        text-align: center;
    }

    .main-nav ul {
        margin-top: 10px;
        gap: 15px;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .article-cards {
        grid-template-columns: 1fr;
    }

    .search-form {
        flex-direction: column;
    }

    .search-form button,
    .search-reset {
        width: 100%;
        text-align: center;
    }

    .list-item {
        flex-direction: column;
    }

    .list-item-cover {
        flex: 0 0 auto;
        height: 200px;
        width: 100%;
    }

    .card-cover {
        height: 180px;
    }
}
/* ========== 图片预览模态框 ========== */
.preview-modal-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
}
.preview-modal-mask img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.7);
}
.preview-modal-mask .close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.preview-modal-mask .close-btn:hover {
    opacity: 1;
}
/* ========== 首页近期文章列表（深空玻璃质感卡片） ========== */
.recent-articles-list {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid rgba(42, 48, 72, 0.8);
}

.article-list-mini {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-list-mini li {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 20px;
    margin-bottom: 10px;
    background: rgba(20, 25, 45, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-left: 3px solid rgba(212, 175, 55, 0.2);
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* 桌面端：左右排列，标题左对齐，日期右对齐 */
@media (min-width: 600px) {
    .article-list-mini li {
        flex-direction: row;
        align-items: center;
        padding: 14px 22px;
    }
}

/* 悬停效果：边框变亮，阴影扩散，微微向左移动 */
.article-list-mini li:hover {
    background: rgba(30, 40, 70, 0.7);
    border-left-color: #d4af37;
    transform: translateX(4px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(212, 175, 55, 0.1);
}

.article-list-mini li .title {
    color: #c0c8d8;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: color 0.3s;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.article-list-mini li:hover .title {
    color: #d4af37;
}

.article-list-mini li .date {
    color: #6a7a9a;
    font-size: 0.85rem;
    white-space: nowrap;
    margin-top: 6px;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.article-list-mini li:hover .date {
    opacity: 1;
    color: #8893a8;
}

/* 桌面端日期样式调整 */
@media (min-width: 600px) {
    .article-list-mini li .date {
        margin-top: 0;
        margin-left: 15px;
        padding-left: 15px;
        border-left: 1px solid rgba(255, 255, 255, 0.08);
    }
}