﻿/* ================================================
   陆丰市星都学校官网 - 全局样式
   风格：简洁清爽 · 教育行业 · 蓝色系
   ================================================ */

/* ---------- 基础重置 ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1565c0;          /* 主色 - 深蓝 */
    --primary-light: #1e88e5;    /* 亮蓝 */
    --primary-dark: #0d47a1;     /* 深蓝 */
    --accent: #ffc107;           /* 点缀色 - 金黄 */
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --bg: #ffffff;
    --bg-light: #f5f7fa;
    --border: #e0e0e0;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --radius: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
    --max-width: 1200px;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    overflow-x: hidden;
}

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

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

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

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 顶部导航 ---------- */
.site-header {
    background: #ffffff;
    color: var(--text);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary-dark);
}

.brand:hover {
    color: var(--primary-dark);
    opacity: 0.9;
}

.brand-logo {
    height: 60px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-logo img {
    height: 60px;
    width: auto;
    display: block;
    
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 1px;
    line-height: 1.2;
}

.brand-motto {
    font-size: 0.75rem;
    opacity: 0.85;
    letter-spacing: 2px;
}

.main-nav {
    display: flex;
    gap: 8px;
}

.main-nav a {
    color: var(--text);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
    background: #e3f2fd;
}

/* 手机端菜单按钮 */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}

/* ---------- 轮播图 ---------- */
.hero-slider {
    position: relative;
    width: 100%;
    height: 480px;
    overflow: hidden;
    background: var(--primary-dark);
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
}

.slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slide-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13, 71, 161, 0.3) 0%, rgba(13, 71, 161, 0.6) 100%);
}

.slide-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 0 20px;
    max-width: 800px;
}

.slide-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease;
}

.slide-subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease 0.2s both;
}

.slider-dots {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    padding: 0;
}

.slider-dot.active {
    background: #fff;
    width: 28px;
    border-radius: 5px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- 入口按钮区 ---------- */
.entries-section {
    padding: 60px 0;
    background: var(--bg-light);
}

.entries-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
}

.entry-card {
    position: relative;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 48px 32px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
}

.entry-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.entry-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.entry-icon {
    font-size: 64px;
    margin-bottom: 20px;
    line-height: 1;
}

.entry-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.entry-desc {
    font-size: 0.95rem;
    color: var(--text-light);
}

.entry-arrow {
    display: inline-block;
    margin-top: 16px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ---------- 校园动态 ---------- */
.news-section {
    padding: 60px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    position: relative;
    display: inline-block;
    padding-bottom: 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

.section-subtitle {
    margin-top: 12px;
    color: var(--text-light);
    font-size: 0.95rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.news-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.news-cover {
    width: 100%;
    height: 180px;
    background: var(--bg-light);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.news-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: var(--primary);
    font-size: 48px;
}

.news-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: rgba(21, 101, 192, 0.9);
    color: #fff;
    font-size: 0.75rem;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.news-tag.external {
    background: rgba(67, 160, 71, 0.9);
}

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

.news-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.news-more {
    text-align: center;
    margin-top: 40px;
}

.btn-more {
    display: inline-block;
    padding: 12px 40px;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 30px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-more:hover {
    background: var(--primary);
    color: #fff;
}

/* ---------- 学校简介 ---------- */
.about-section {
    padding: 60px 0;
    background: var(--bg-light);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.about-image {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 64px;
}

.about-text h3 {
    font-size: 1.5rem;
    color: var(--text);
    margin-bottom: 16px;
}

.about-text p {
    color: var(--text-light);
    line-height: 1.9;
    font-size: 1rem;
}

/* ---------- 页脚 ---------- */
.site-footer {
    background: #1a237e;
    color: rgba(255, 255, 255, 0.8);
    padding: 48px 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-col h4 {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 16px;
    font-weight: 600;
}

.footer-col p,
.footer-col a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-col a:hover {
    color: #fff;
}

.footer-qrcode {
    width: 120px;
    height: 120px;
    background: #fff;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.5);
}

/* ---------- 系统导航页（教师/学生入口） ---------- */
.page-banner {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    padding: 60px 0;
    text-align: center;
}

.page-banner h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-banner p {
    opacity: 0.85;
    font-size: 1rem;
}

.systems-section {
    padding: 60px 0;
    background: var(--bg-light);
    min-height: 400px;
}

.systems-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.system-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 32px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: block;
    color: var(--text);
}

.system-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

.system-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.system-card.disabled:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.system-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: var(--bg-light);
}

.system-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.system-desc {
    font-size: 0.85rem;
    color: var(--text-light);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--primary);
}

/* ---------- 文章列表页 ---------- */
.news-list-section {
    padding: 40px 0 60px;
    background: var(--bg-light);
    min-height: 500px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-list-item {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 24px;
    transition: var(--transition);
    color: var(--text);
}

.news-list-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
    color: var(--text);
}

.news-list-cover {
    width: 200px;
    height: 130px;
    border-radius: var(--radius);
    background: var(--bg-light);
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--primary);
}

.news-list-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-list-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}

.news-list-excerpt {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-list-meta {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---------- 文章详情页 ---------- */
.article-section {
    padding: 40px 0 60px;
    background: var(--bg-light);
    min-height: 500px;
}

.article-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 48px;
    max-width: 800px;
    margin: 0 auto;
}

.article-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text);
}

.article-content img {
    border-radius: var(--radius);
    margin: 20px 0;
}

.article-content p {
    margin-bottom: 16px;
}

.article-back {
    text-align: center;
    margin-top: 40px;
}

/* ---------- 响应式：平板 ---------- */
@media (max-width: 992px) {
    .hero-slider {
        height: 380px;
    }

    .slide-title {
        font-size: 2rem;
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .systems-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .about-grid {
        gap: 32px;
    }
}

/* ---------- 响应式：手机 ---------- */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .site-header .container {
        height: 56px;
    }

    .brand-name {
        font-size: 1rem;
    }

    .brand-motto {
        display: none;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: #fff;
        flex-direction: column;
        padding: 16px;
        gap: 4px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .main-nav.open {
        display: flex;
    }

    .main-nav a {
        padding: 12px 16px;
    }

    .nav-toggle {
        display: block;
    }

    .hero-slider {
        height: 280px;
    }

    .slide-title {
        font-size: 1.5rem;
    }

    .slide-subtitle {
        font-size: 0.95rem;
    }

    .entries-section {
        padding: 40px 0;
    }

    .entries-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 16px;
    }

    .entry-card {
        padding: 36px 24px;
    }

    .entry-icon {
        font-size: 52px;
    }

    .entry-title {
        font-size: 1.3rem;
    }

    .news-section,
    .about-section {
        padding: 40px 0;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .about-image {
        height: 220px;
    }

    .systems-section {
        padding: 32px 0;
    }

    .systems-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .system-card {
        padding: 24px 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        padding-bottom: 24px;
    }

    .article-card {
        padding: 24px;
        margin: 0 16px;
    }

    .article-title {
        font-size: 1.3rem;
    }

    .news-list-item {
        flex-direction: column;
        gap: 12px;
    }

    .news-list-cover {
        width: 100%;
        height: 180px;
    }

    .page-banner {
        padding: 40px 0;
    }

    .page-banner h1 {
        font-size: 1.5rem;
    }
}

/* ---------- 动画 ---------- */
.fade-in {
    animation: fadeIn 0.6s ease both;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* ==================== v3 优化追加（2026-09-23） ==================== */

/* 文章正文排版（配合后台富文本编辑器） */
.article-content { line-height: 1.9; font-size: 1.02rem; color: #333; }
.article-content p { margin: 0 0 1.1em; }
.article-content img { max-width: 100%; border-radius: 8px; display: block; margin: 14px auto; }
.article-content h2, .article-content h3 { margin: 1.4em 0 0.6em; color: #0d47a1; }
.article-content ul, .article-content ol { margin: 0 0 1.1em 1.6em; }
.article-content blockquote {
    border-left: 4px solid #1565c0;
    background: #f0f6ff;
    margin: 1em 0;
    padding: 10px 16px;
    color: #555;
    border-radius: 0 8px 8px 0;
}

/* 返回顶部按钮（main.js 自动注入） */
.back-top {
    position: fixed;
    right: 18px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #1565c0;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(13, 71, 161, .4);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .3s;
    transform: translateY(8px);
    z-index: 99;
}
.back-top.show { opacity: .92; pointer-events: auto; transform: none; }

/* 页脚公众号二维码（后台上传后显示图片） */
.footer-qrcode img {
    width: 110px;
    height: 110px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 6px;
    display: block;
    margin: 0 auto 6px;
}

/* 页脚管理入口 */
.admin-entry { color: rgba(255, 255, 255, .55); text-decoration: none; font-size: .85rem; }
.admin-entry:hover { color: #fff; }

/* 学校简介配图（后台上传后） */
.about-image.has-img { font-size: 0; overflow: hidden; }
.about-image.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 学校简介：保留输入的换行与空格（分段/缩进直接生效） */
.about-text p#aboutText { white-space: pre-wrap; line-height: 2; }
