/* style.css - 新中式电子杂志样式表 */

/* --- 1. 配色与变量 --- */
:root {
    --bg-color: #DCEBE9; 
    --text-primary: #2F3640;
    --text-secondary: #5D7066;
    --accent-color: #A85C5C;
    --border-color: rgba(47, 54, 64, 0.15);
    
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --font-sans: 'Helvetica Neue', Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    line-height: 1.8;
    background-color: var(--bg-color);
    
    /* ⚠️ 重要：这里填写你的本地图片文件名 */
    background-image: url('bg-pattern.PNG'); 
    
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 80vh;
}

/* 白色遮罩层 */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.85); /* 调整这里的透明度 */
    z-index: -1;
    pointer-events: none;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- 导航栏 (修复版) --- */
header {
    background: rgba(248, 252, 250, 0.9);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%; /* 强制占满宽度 */
    overflow: hidden; /* 强制包含内部所有浮动元素，防止塌陷 */
    display: block;   /* 确保它是块级元素 */
}

nav {
    max-width: 1100px;
    margin: 0 auto;
    display: flex; /* 启用弹性布局 */
    justify-content: space-between;
    align-items: center; /* 垂直居中 */
    padding: 1.5rem 2rem;
    min-height: 80px; /* 【关键】设置最小高度，防止内容塌陷 */
    box-sizing: border-box;

nav {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    min-height: 80px;
    box-sizing: border-box;
    
    /* --- 新增这两行，修复 Edge 渲染消失问题 --- */
    transform: translateZ(0); 
    will-change: transform;
    /* ---------------------------------------- */
}
}

/* 👇 新增：专门控制 Logo 图片的样式 👇 */
.logo img {
    height: 40px;       /* 核心：固定高度，防止图片太大撑破导航栏 */
    width: auto;        /* 核心：宽度自动缩放，保持图片比例不变形 */
    display: block;     /* 消除图片底部默认的微小空隙 */
}

/* 如果你还需要控制 .logo 这个容器本身（比如防止它乱跑），可以加这个： */
.logo {
    display: flex;
    align-items: center;
}

.nav-links { 
    display: flex; 
    gap: 2.5rem; 
    margin: 0; /* 重置默认边距 */
    padding: 0; /* 重置默认内边距 */
    list-style: none; /* 确保没有列表符号 */
    align-items: center; /* 确保内部项目垂直对齐 */
}

/* 确保每个列表项都正常显示 */
.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
    
    /* 加上这一行，防止元素被挤出去 */
    flex-wrap: wrap; 
}
.nav-links a {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    position: relative;
    white-space: nowrap; /* 【关键】防止文字换行导致布局错乱 */
    display: inline-block; /* 确保链接表现为块级以便计算 */
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s;
}
.nav-links a:hover::after { width: 100%; }

/* --- 通用布局 --- */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

section { padding: 5rem 0; }

.section-title {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 4rem;
    color: var(--text-primary);
    font-weight: normal;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: var(--accent-color);
    margin: 1rem auto 0;
    opacity: 0.6;
}

/* --- Home Hero --- */
.hero {
    text-align: center;
    padding: 8rem 0;
}
.hero h1 {
    font-family: var(--font-serif);
    font-size: 4rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: normal;
}
.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem;
}
.btn {
    display: inline-block;
    border: 1px solid var(--text-primary);
    color: var(--text-primary);
    padding: 0.8rem 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    transition: all 0.3s;
    cursor: pointer;
    background: transparent;
}
.btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

/* --- Partners --- */
.partners-section {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 3rem 0;
    background: rgba(255,255,255,0.5);
}
.partners-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    opacity: 0.6;
    filter: grayscale(100%);
}
.partner-logo { height: 40px; width: auto; transition: 0.3s; }
.partner-logo:hover { opacity: 1; filter: grayscale(0%); transform: scale(1.05); }

/* --- Issues Grid --- */
.issues-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}
.issue-card {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    transition: transform 0.3s;
}
.issue-card:hover { transform: translateY(-5px); }
.issue-cover {
    height: 350px;
    background-color: #eee;
    overflow: hidden;
    position: relative;
}
.issue-cover img {
    width: 100%; height: 100%; object-fit: cover;
    filter: sepia(20%) contrast(90%); 
}
.issue-info { padding: 1.5rem; text-align: center; }
.issue-date { 
    font-family: var(--font-serif); 
    color: var(--accent-color); 
    font-style: italic; 
    margin-bottom: 0.5rem; 
    display: block;
}
.issue-title { 
    font-family: var(--font-serif); 
    font-size: 1.4rem; 
    margin-bottom: 0.8rem; 
    color: var(--text-primary);
}
.issue-desc { 
    font-size: 0.95rem; 
    color: var(--text-secondary); 
    margin-bottom: 1.5rem; 
    line-height: 1.6;
}
.read-link { 
    font-size: 0.85rem; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 2px;
}

/* --- Events List --- */
.event-item {
    display: flex;
    border-bottom: 1px dashed var(--border-color);
    padding: 2rem 0;
    align-items: flex-start;
}
.event-date-box {
    min-width: 80px;
    text-align: center;
    border-right: 1px solid var(--border-color);
    padding-right: 1.5rem;
    margin-right: 1.5rem;
}
.date-day { font-size: 2rem; font-family: var(--font-serif); color: var(--text-primary); display: block; }
.date-month { text-transform: uppercase; color: var(--text-secondary); font-size: 0.8rem; letter-spacing: 1px; }
.event-details h3 { font-family: var(--font-serif); font-size: 1.3rem; margin-bottom: 0.5rem; }
.event-location { color: var(--text-secondary); font-style: italic; margin-bottom: 0.5rem; }

/* --- Contribute Form --- */
.contribute-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}
.guidelines {
    background: rgba(255,255,255,0.5);
    padding: 2rem;
    border: 1px solid var(--border-color);
}
.guidelines ul li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}
.guidelines ul li::before {
    content: '•';
    color: var(--accent-color);
    position: absolute;
    left: 0;
    font-size: 1.2rem;
    line-height: 1.2rem;
}
.submit-form input, .submit-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.8);
    font-family: var(--font-sans);
    color: var(--text-primary);
}
.submit-form input:focus, .submit-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: #fff;
}

/* --- Footer --- */
footer {
    background: var(--text-primary);
    color: #fff;
    text-align: center;
    padding: 3rem 1rem;
    margin-top: 4rem;
}
.footer-links a { margin: 0 15px; opacity: 0.7; font-size: 0.9rem; }
.footer-links a:hover { opacity: 1; color: var(--accent-color); }
.copyright { margin-top: 1.5rem; font-size: 0.8rem; opacity: 0.5; }

/* Responsive */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero h1 { font-size: 2.5rem; }
    .contribute-layout { grid-template-columns: 1fr; }
    .event-item { flex-direction: column; }
    .event-date-box { border-right: none; border-bottom: 1px solid var(--border-color); padding-right: 0; padding-bottom: 1rem; margin-right: 0; margin-bottom: 1rem; width: 100%; text-align: left; }
}