/*
 * 统一风格 · PHP教材专用样式
 * 融合“网页设计与制作教材”的视觉语言，适配PHP教材内容结构
 * 特性：渐变导航胶囊 / 柔和卡片 / 精致动效 / 响应式优化
 */

/* ===== 全局基调 ===== */
*,
::before,
::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f9fe;       /* 柔和底色 */
    color: #1a344d;
    line-height: 1.5;
}

a {
    text-decoration: none;
}

/* ===== 头部标题 ===== */
header h1 {
    max-width: 960px;
    margin: 0.8rem auto 0.5rem;
    font-weight: 340;
    font-size: 2.5rem;
    color: #0a3852;
    letter-spacing: -0.02em;
    padding: 0 1rem;
}

/* ===== 导航栏：渐变胶囊 ===== */
header nav {
    display: block;
    background: linear-gradient(145deg, #006199, #004b7c);
    box-shadow: 0 6px 14px rgba(0, 60, 100, 0.2), inset 0 1px 0 rgba(255,255,255,0.1);
    position: relative;
}

.navul {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem 0.5rem;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.6rem;
    align-items: center;
    justify-content: flex-start;
}

.navul li {
    display: inline-block;
}

.navul a {
    color: white;
    font-weight: 500;
    font-size: 1.1rem;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    background-color: transparent;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
    border: none;
    display: inline-block;
    line-height: 1.2;
}

.navul a:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.navul a:active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* ===== 公用卡片样式 ===== */
.desc {
    max-width: 960px;
    margin: 2.2rem auto;
    border: 1px solid #dfe8f2;
    background-color: #ffffff;
    border-radius: 1.5rem;
    padding: 2rem 2.2rem;
    box-shadow: 0 15px 30px -12px rgba(0, 70, 120, 0.12);
    transition: box-shadow 0.2s, transform 0.2s;
}

.desc:hover {
    box-shadow: 0 22px 38px -14px rgba(0, 80, 130, 0.2);
}

/* 描述文字微调 (适应PHP教材的纯文本) */
.desc {
    font-size: 1.1rem;
    color: #1e3e5c;
}

/* ===== 授课计划双列卡片 (原.main区域) ===== */
.main {
    max-width: 960px;
    margin: 2.2rem auto;
    border: 1px solid #dfe8f2;
    background-color: #ffffff;
    border-radius: 1.5rem;
    padding: 2rem 2.2rem;
    box-shadow: 0 15px 30px -12px rgba(0, 70, 120, 0.12);
    transition: box-shadow 0.2s;
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;           /* 移动端自动堆叠 */
}

.main:hover {
    box-shadow: 0 22px 38px -14px rgba(0, 80, 130, 0.2);
}

.main div {
    flex: 1 1 250px;           /* 最小宽度250px，允许换行 */
}

/* 学期标题 (与.desc h2风格一致) */
.main h2 {
    font-size: 1.9rem;
    font-weight: 380;
    margin: 0 0 1.4rem 0;
    border-bottom: 3px solid rgba(0, 107, 164, 0.18);
    padding-bottom: 0.6rem;
    color: #0a4b70;
    letter-spacing: -0.3px;
}

/* 列表样式：继承自原拓展实例，干净现代 */
.main ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.main li {
    padding: 0.7rem 1rem;
    border-radius: 14px;
    transition: background 0.2s;
    border-bottom: 1px solid #eef3f8;
}

.main li:last-child {
    border-bottom: none;
}

.main li:hover {
    background-color: rgba(0, 107, 164, 0.04);
}

.main li a {
    color: #1e3a5f;
    font-weight: 460;
    padding: 0.25rem 0.5rem;
    margin-right: 1.2rem;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-bottom 0.15s;
    font-size: 1.02rem;
    text-decoration: none;
    display: inline-block;      /* 确保padding作用 */
}

.main li a:hover {
    color: rgb(0, 107, 164);
    border-bottom: 1px solid rgb(0, 107, 164);
}

/* ===== 页脚 ===== */
footer {
    max-width: 960px;
    margin: 3.2rem auto 1.8rem;
    padding-top: 1.3rem;
    text-align: center;
    border-top: 2px solid #d0ddee;
    color: #42658b;
    font-size: 1rem;
    font-weight: 380;
}

/* ===== 响应式优化 ===== */
@media (max-width: 700px) {
    header h1 { font-size: 2.1rem; margin-left: 1rem; }
    .navul a { padding: 0.5rem 1rem; font-size: 1rem; }
    .desc { padding: 1.5rem; }
    .main { padding: 1.5rem; gap: 1.5rem; }
    .main h2 { font-size: 1.7rem; }
}

@media (max-width: 500px) {
    .navul { gap: 0.5rem; }
    .navul a { padding: 0.5rem 0.9rem; font-size: 0.95rem; }
    .main div { flex-basis: 100%; }     /* 完全堆叠 */
}

/* ===== 保留实操手册按钮样式 (虽未在PHP教材使用，但无影响) ===== */
.subcontent {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    margin-top: 0.5rem;
}

.subcontent a {
    background: #f2f7fc;
    border: 1.8px solid rgb(0, 107, 164);
    color: rgb(0, 107, 164);
    padding: 1rem 2.4rem;
    border-radius: 60px;
    font-weight: 550;
    font-size: 1.15rem;
    transition: all 0.2s ease;
    flex: 1 1 auto;
    text-align: center;
    box-shadow: 0 6px 12px rgba(0,70,120,0.08);
}

.subcontent a:hover {
    background: rgb(0, 107, 164);
    color: white;
    border-color: rgb(0, 107, 164);
    box-shadow: 0 14px 22px -8px rgba(0,107,164,0.4);
    transform: translateY(-3px);
}