/* ============================================================
   教学成果奖申报材料展示网站 - 样式表
   仿照 https://jwzy.whcp.edu.cn/gjjjxcg/main.psp
   ============================================================ */

/* --- CSS 变量 --- */
:root {
    --color-navy:       #0d6b5a;
    --color-blue:       #19a085;
    --color-blue-light: #1fbf9f;
    --color-blue-title: #158a73;
    --color-blue-dark:  #0e705e;
    --color-bg-warm:    #f9f8f6;
    --color-white:      #ffffff;
    --color-text:       #333333;
    --color-text-light: #666666;
    --color-border:     #e4e4e4;
    --color-nav-text:   #393939;
    --max-width:        1400px;
    --header-height:    160px;
    --nav-height:       60px;
    --font-family:      "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
}

/* --- CSS Reset & 基础 --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.75;
    color: var(--color-text);
    background: var(--color-bg-warm);
    min-width: 320px;
}

/* --- 顶部阴影线 --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(0,0,0,0.15);
    z-index: 110;
    pointer-events: none;
}

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

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

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

/* ============================================================
   1. 顶部工具栏
   ============================================================ */
#topbar {
    background: var(--color-navy);
    color: #c8f0e8;
    font-size: 13px;
    line-height: 36px;
    height: 36px;
}

#topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

#topbar .welcome {
    letter-spacing: 0.5px;
}

#topbar .site-tag {
    opacity: 0.8;
}

/* ============================================================
   2. 头部
   ============================================================ */
#header {
    background: var(--color-blue);
    height: var(--header-height);
    position: relative;
    overflow: hidden;
}

#header::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 400px;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.05));
    pointer-events: none;
}

#header .container {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
}

.header-logo {
    height: 65px;
    width: auto;
    flex-shrink: 0;
}

.header-titles {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-titles h1 {
    font-size: 30px;
    font-weight: bold;
    color: #ffffff;
    letter-spacing: 2px;
    line-height: 1.3;
}

.header-titles .subtitle {
    font-size: 16px;
    color: rgba(255,255,255,0.85);
    margin-top: 2px;
    letter-spacing: 1px;
}

/* ============================================================
   3. 导航栏
   ============================================================ */
#navbar {
    background: var(--color-white);
    height: var(--nav-height);
    border-bottom: 2px solid var(--color-blue);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

#navbar .container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.nav-list {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0 28px;
    font-size: 18px;
    font-weight: 500;
    color: var(--color-nav-text);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    letter-spacing: 1px;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--color-blue-light);
    transition: width 0.3s ease;
}

.nav-item:hover {
    color: var(--color-blue-light);
}

.nav-item:hover::after {
    width: 100%;
}

.nav-item.active {
    color: #ffffff;
    background: var(--color-blue-light);
}

.nav-item.active::after {
    display: none;
}

/* 汉堡菜单按钮 */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: var(--color-nav-text);
    padding: 8px;
    line-height: 1;
}

/* ============================================================
   4. 内容区域
   ============================================================ */
#content {
    min-height: 600px;
    padding: 30px 0 50px;
}

/* 页面面板 */
.page-panel {
    display: none;
}

.page-panel.active {
    display: block;
}

/* --- 首页 --- */
.home-banner {
    background: linear-gradient(135deg, #19a085 0%, #0d6b5a 100%);
    color: #fff;
    padding: 50px 40px;
    border-radius: 6px;
    margin-bottom: 30px;
    text-align: center;
}

.home-banner h2 {
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.home-banner p {
    font-size: 16px;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* 首页卡片网格 */
.home-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.home-card {
    background: var(--color-white);
    border-radius: 6px;
    padding: 30px 24px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.35s ease;
    border: 1px solid transparent;
}

.home-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.12);
    border-color: var(--color-blue-light);
}

.home-card-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #e0f5f0 0%, #c0ede0 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--color-blue);
}

.home-card h3 {
    font-size: 18px;
    color: var(--color-blue-title);
    margin-bottom: 8px;
    font-weight: bold;
}

.home-card p {
    font-size: 13px;
    color: var(--color-text-light);
    line-height: 1.6;
}

.home-card .card-badge {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 14px;
    background: var(--color-blue-light);
    color: #fff;
    border-radius: 20px;
    font-size: 12px;
}

/* --- PDF 页面 --- */
.page-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--color-border);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.page-header h2 {
    font-size: 22px;
    color: var(--color-blue-title);
    font-weight: bold;
    letter-spacing: 1px;
}

.page-header .file-info {
    font-size: 13px;
    color: var(--color-text-light);
}

.file-size-warning {
    display: inline-block;
    background: #fff3cd;
    color: #856404;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 12px;
}

.download-link {
    display: inline-block;
    color: var(--color-blue-light);
    font-size: 13px;
    padding: 4px 12px;
    border: 1px solid var(--color-blue-light);
    border-radius: 4px;
    transition: all 0.3s;
    white-space: nowrap;
}

.download-link:hover {
    background: var(--color-blue-light);
    color: #fff;
}

/* PDF 查看器 */
.pdf-viewer {
    width: 100%;
    min-height: 800px;
    background: #e8e8e8;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.pdf-viewer embed {
    width: 100%;
    height: 800px;
    border: none;
    display: block;
}

.pdf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #888;
    font-size: 15px;
}

.pdf-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #d0d0d0;
    border-top-color: var(--color-blue-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- 轮播图 --- */
.carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 650px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 30px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 左右按钮 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.3s;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: rgba(0,0,0,0.6);
}

.carousel-prev { left: 16px; }
.carousel-next { right: 16px; }

/* 圆点指示器 */
.carousel-dots {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}

.carousel-dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* ============================================================
   5. 响应式
   ============================================================ */

@media (max-width: 1200px) {
    .home-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    .nav-item {
        padding: 0 18px;
        font-size: 16px;
    }
    .header-titles h1 {
        font-size: 26px;
    }
}

@media (max-width: 992px) {
    .home-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .nav-item {
        padding: 0 14px;
        font-size: 15px;
    }
    .header-logo {
        height: 50px;
    }
    .header-titles h1 {
        font-size: 22px;
    }
    .header-titles .subtitle {
        font-size: 14px;
    }
    #header {
        --header-height: 130px;
    }
    .pdf-viewer,
    .pdf-viewer embed {
        min-height: 600px;
        height: 600px;
    }
}

@media (max-width: 768px) {
    .carousel {
        max-height: 400px;
        border-radius: 4px;
    }
    .carousel-btn {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    #topbar {
        font-size: 12px;
    }
    #topbar .site-tag {
        display: none;
    }

    #header {
        --header-height: 110px;
    }
    .header-logo {
        height: 40px;
    }
    .header-titles h1 {
        font-size: 18px;
    }
    .header-titles .subtitle {
        font-size: 12px;
    }

    /* 汉堡菜单 */
    .nav-toggle {
        display: block;
    }

    #navbar .container {
        justify-content: flex-end;
        position: relative;
    }

    .nav-list {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        box-shadow: 0 8px 20px rgba(0,0,0,0.15);
        z-index: 99;
        border-top: 2px solid var(--color-blue-light);
    }

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

    .nav-item {
        width: 100%;
        height: 48px;
        justify-content: center;
        border-bottom: 1px solid #eee;
        font-size: 16px;
    }

    .nav-item::after {
        display: none;
    }

    .nav-item.active {
        background: var(--color-blue-light);
        color: #fff;
    }

    /* 首页卡片 */
    .home-cards {
        grid-template-columns: 1fr;
    }

    .home-banner {
        padding: 30px 20px;
    }
    .home-banner h2 {
        font-size: 20px;
    }
    .home-banner p {
        font-size: 14px;
    }

    .pdf-viewer,
    .pdf-viewer embed {
        min-height: 500px;
        height: 500px;
    }

    .page-header {
        flex-direction: column;
    }

    #content {
        padding: 20px 0 30px;
    }
}

@media (max-width: 480px) {
    .carousel {
        max-height: 280px;
        margin-bottom: 20px;
    }
    .carousel-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    .carousel-dot {
        width: 8px;
        height: 8px;
    }

    #header {
        --header-height: 90px;
    }
    .header-inner {
        gap: 12px;
    }
    .header-logo {
        height: 32px;
    }
    .header-titles h1 {
        font-size: 15px;
        letter-spacing: 1px;
    }
    .header-titles .subtitle {
        font-size: 11px;
    }
    .nav-item {
        font-size: 14px;
        height: 42px;
    }
    .pdf-viewer,
    .pdf-viewer embed {
        min-height: 400px;
        height: 400px;
    }
}
