/* ============================================
   common.css – 全局通用样式（所有页面共享）
   包含：重置、变量、排版、容器、按钮、卡片、
         通用博客网格、工具类、响应式辅助、
         公共头部/底部轻量占位
   ============================================ */

/* ---------- 重置 & 基础 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'Roboto', system-ui, -apple-system, sans-serif;
    background-color: #ffffff;
    background-image: radial-gradient(#ecd9d4 1px, transparent 1px);
    background-size: 32px 32px;
    color: #3d2c2a;
    line-height: 1.6;
    padding: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #b36b7b;
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: #8c4e5e;
}

ul {
    list-style: none;
}

/* ---------- 设计变量 ---------- */
:root {
    --color-primary: #b36b7b;
    --color-primary-dark: #8c4e5e;
    --color-secondary: #d9b4b0;
    --color-accent: #e8c9c5;
    --color-bg: #fdf8f5;
    --color-text: #3d2c2a;
    --color-text-light: #7a6360;
    --color-white: #ffffff;
    --color-border: #ecd9d4;

    --font-family: 'Segoe UI', 'Roboto', system-ui, sans-serif;
    --font-heading: 'Georgia', 'Times New Roman', serif;

    --container-width: 1280px;
    --container-padding: 2rem;

    --transition: 0.3s ease;

    --shadow-card: 0 4px 12px rgba(179, 107, 123, 0.10);
    --shadow-hover: 0 8px 24px rgba(179, 107, 123, 0.18);

    --border-radius: 16px;
    --border-radius-sm: 8px;
}

/* ---------- 公共头部 / 底部（轻量容器，不干扰动态内容） ---------- */
#header-placeholder {
    height: 72px;                     /* 根据实际导航栏高度调整 */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 100;
    /* 去掉 min-height，改用固定 height */
}

#footer-placeholder {
    background: #2d1e1c;
    color: #d9b4b0;
    min-height: 60px;
}

/* ---------- 排版 ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    color: #2d1e1c;
    line-height: 1.2;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.2rem; }

p {
    margin-bottom: 1rem;
}

/* ---------- 容器 ---------- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

.section-padding {
    padding: 4rem 0;
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-block;
    padding: 0.7rem 1.8rem;
    border-radius: 50px;
    font-weight: 500;
    background: var(--color-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background var(--transition), transform 0.2s;
}
.btn:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}
.btn-outline:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ---------- 卡片（基础） ---------- */
.card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: box-shadow var(--transition), transform 0.3s;
}
.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}
.card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-content {
    padding: 1.5rem;
}
.card-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}
.card-meta {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 0.8rem;
}
.card-excerpt {
    font-size: 0.95rem;
    color: var(--color-text);
}

/* ---------- 博客列表网格（默认 fallback） ---------- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.blog-grid .card:first-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.blog-grid .card:first-child .card-image {
    aspect-ratio: 4 / 3;
}
.blog-grid .card:first-child .card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
@media (max-width: 992px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .blog-grid .card:first-child {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
    }
}
@media (max-width: 576px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- 工具类 ---------- */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }
.p-2 { padding: 2rem; }
.hidden { display: none !important; }

/* ---------- 响应式辅助 ---------- */
@media (max-width: 768px) {
    .hide-mobile { display: none; }
    .section-padding { padding: 2rem 0; }
}