/* style.css */

/* --- 全局重置与基础样式 --- */
:root {
    --primary-color: #007aff;       /* 苹果蓝 */
    --secondary-color: #5856d6;     /* 紫色 */
    --success-color: #34c759;       /* 绿色 */
    --danger-color: #ff3b30;        /* 红色 */
    --text-dark: #1d1d1f;           /* 深黑 */
    --text-gray: #86868b;           /* 灰色 */
    --bg-light: #f5f5f7;            /* 浅灰背景 */
    --white: #ffffff;
    --border-color: #d2d2d7;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.2s;
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 头部与导航 --- */
header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

nav ul {
    display: flex;
    gap: 25px;
}

nav a {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 15px;
}

nav a:hover {
    color: var(--primary-color);
}

/* --- 英雄区域 (Hero Section) --- */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-light);
    border-radius: 0 0 20px 20px;
    margin-bottom: 40px;
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.hero p {
    font-size: 18px;
    color: var(--text-gray);
    max-width: 600px;
    margin: 0 auto;
}

/* --- 网格布局 (文章列表) --- */
.section-title {
    font-size: 24px;
    margin-bottom: 25px;
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #eee;
}

.card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.card-excerpt {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 20px;
    flex: 1;
}

.card-link {
    font-weight: 600;
    font-size: 14px;
}

/* --- 友情链接 --- */
.links-section {
    background: var(--bg-light);
    padding: 40px 0;
    border-radius: var(--radius);
    margin-bottom: 40px;
    text-align: center;
}

.links-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.link-item {
    background: var(--white);
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    font-size: 14px;
    transition: all 0.2s;
}

.link-item:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* --- 页脚 --- */
footer {
    background: #1d1d1f;
    color: #f5f5f7;
    padding: 40px 0;
    text-align: center;
    margin-top: 60px;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    color: #86868b;
    margin: 0 10px;
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--white);
}

.copyright {
    font-size: 13px;
    color: #6e6e73;
}

/* --- 响应式适配 --- */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 15px;
    }
    
    nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .hero h2 {
        font-size: 28px;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}

/* --- 后台管理专用简单样式 (如果不想单独写后台CSS，可共用部分) --- */
.admin-sidebar {
    width: 250px;
    background: #2c3e50;
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding-top: 20px;
}

.admin-main {
    margin-left: 250px;
    padding: 40px;
    background: #ecf0f1;
    min-height: 100vh;
}

.admin-nav-link {
    display: block;
    padding: 15px 25px;
    color: #bdc3c7;
    border-bottom: 1px solid #34495e;
}

.admin-nav-link:hover, .admin-nav-link.active {
    background: #34495e;
    color: white;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-danger { background: var(--danger-color); color: white; }
.btn-success { background: var(--success-color); color: white; }