/* ===============================================
   浅色主题：全站页头 / 导航 / 页脚 + 首页（轮播与课题组介绍）
   在 main.css、responsive.css、enhanced.css 之后加载
   =============================================== */
:root {
    --paper: #FAF8F4;
    --paper-deep: #F2EEE6;
    --ink: #1C2433;
    --ink-soft: #2E3544;
    --muted: #5E6573;
    --faint: #8A8F99;
    --rule: #E3DDD2;
    --accent: #B3282D;
    --accent-dark: #8E1F24;
    --navy: #1F4E8C;
    --serif: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
    --latin-serif: 'Cormorant Garamond', Georgia, serif;
    --page-pad: clamp(20px, 5vw, 96px);
}

body {
    background: var(--paper);
    color: var(--ink);
}
body::before { display: none; }

/* ---------- 页头 ---------- */
/* 页头、导航、页脚和首页铺满整屏，只保留随屏宽变化的左右边距 */
.header .container,
.navbar .container,
.footer .container,
.home-main .container {
    max-width: none;
    padding-left: var(--page-pad);
    padding-right: var(--page-pad);
}

.header {
    padding: 0;
    background: #fff;
    box-shadow: none;
}

.header-topbar {
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    font-size: 14px;
}

.header-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 42px;
}

.header-topbar-links { display: flex; gap: 24px; }
.header-topbar-links a { color: var(--muted); }
.header-topbar-links a:hover { color: var(--accent); }

.lang-switch { gap: 16px; }
.lang-btn {
    font-size: 14px;
    padding: 8px 0;
    color: var(--muted);
}
.lang-btn::after { background-color: var(--accent); bottom: 4px; }
.lang-btn:hover, .lang-btn.active { color: var(--ink); }
.lang-btn.active { font-weight: 700; }
.lang-btn:not(:last-child)::before { display: none; }

.header > .container {
    position: relative;
    padding-top: 22px;
    padding-bottom: 22px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--ink);
}
.header-brand:hover { color: var(--ink); }

.header-logo { width: 64px; height: 64px; }

.header h1 {
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 0.12em;
    line-height: 1.3;
    margin-bottom: 4px;
    color: var(--ink);
    background: none;
    -webkit-text-fill-color: currentColor;
}

.header .subtitle {
    font-family: var(--latin-serif);
    font-size: 16px;
    letter-spacing: 0.08em;
    color: var(--muted);
}

html.lang-en .header h1 {
    font-family: var(--latin-serif);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0.01em;
}
html.lang-en .header .subtitle { font-family: var(--latin-serif); letter-spacing: 0.06em; }
html .header .subtitle:lang(zh-CN) { font-family: var(--serif); font-weight: 600; letter-spacing: 0.2em; }

/* ---------- 导航 ---------- */
.navbar {
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    box-shadow: none;
}

.nav-menu { justify-content: flex-start; gap: 40px; }

.nav-menu a {
    position: relative;
    padding: 15px 0;
    color: var(--ink);
    font-weight: 500;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 9px;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s var(--timing);
}

.nav-menu a:hover,
.nav-menu a.active {
    background: none;
    color: var(--ink);
}
.nav-menu a:hover::after,
.nav-menu a.active::after { transform: scaleX(1); }

html.lang-en .nav-menu { gap: 32px; }

/* 宽屏：导航与 Logo、组名同一行（导航组件保持独立，只做定位） */
@media (min-width: 1280px) {
    .header { border-bottom: 1px solid var(--rule); }
    .header > .container {
        display: flex;
        align-items: center;
        min-height: 100px;
        padding-top: 0;
        padding-bottom: 0;
    }
    .navbar {
        position: absolute;
        top: 43px;
        left: 0;
        right: 0;
        height: 100px;
        background: transparent;
        border: 0;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        pointer-events: none;
    }
    .navbar .container {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        height: 100%;
    }
    .nav-menu { pointer-events: auto; }
    .nav-menu a { padding: 12px 0; font-size: 17px; }
    .nav-menu a::after { bottom: 4px; }
}
/* 1280–1439：字号放大后收紧导航间距，避免与组名重叠 */
@media (min-width: 1280px) and (max-width: 1439px) {
    .nav-menu { gap: 32px; }
    html.lang-en .nav-menu { gap: 26px; }
    .nav-menu a { font-size: 16px; }
}

/* ---------- 其它页面的公共部分 ---------- */
.page-header h1 {
    font-family: var(--serif);
    color: var(--ink);
    border-left-color: var(--accent);
}

.go-top {
    background: var(--ink);
    box-shadow: none;
}
.go-top:hover {
    background: var(--accent);
    box-shadow: none;
}

a:focus-visible, button:focus-visible { outline-color: var(--accent); }

/* ---------- 页脚 ---------- */
/* 返回顶部按钮收进页面右侧留白里，滚到底时不压住页脚文字 */
.go-top { right: 20px; bottom: 20px; }
.footer {
    background: var(--paper-deep);
    color: var(--muted);
    border-top: 1px solid var(--rule);
    padding: 32px 0 30px;
    font-size: 14px;
    line-height: 1.8;
    /* 校园建筑线稿铺在页脚底部 */
    background-image: url('../assets/images/patterns/campus.svg');
    background-repeat: repeat-x;
    background-position: center bottom;
    background-size: auto 150px;
}

.footer-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 48px;
}

.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 52px; height: 52px; flex-shrink: 0; }
.footer-brand p { margin: 0; }

.footer-name {
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: var(--ink);
}
html.lang-en .footer-name {
    font-family: var(--latin-serif);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.footer-contact { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.footer-contact div { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.footer-contact dd { margin: 0; color: var(--ink-soft); }
.footer-contact a { color: var(--accent); }

.footer-links {
    display: flex;
    flex-shrink: 0;
    gap: 28px;
    white-space: nowrap;
    padding: 0;
    text-align: left;
    font-size: 14px;
}
.footer-links a {
    margin: 0;
    color: var(--ink-soft);
    opacity: 1;
}
.footer-links a:hover {
    color: var(--accent);
    text-decoration: none;
}

.footer-side { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 22px; align-self: stretch; justify-content: space-between; }
.footer-copyright {
    margin: 0;
    padding: 0;
    border: 0;
    text-align: right;
    white-space: nowrap;
    font-size: 13px;
    opacity: 1;
}
.footer-center { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; align-self: stretch; }
.footer-icp { margin: 0; font-size: 13px; white-space: nowrap; text-align: center; color: var(--ink-soft); }
.footer-icp a { color: inherit; }
.footer-icp a:hover { color: var(--accent); text-decoration: none; }

/* ===============================================
   首页 · 轮播
   =============================================== */
@keyframes heroReveal { from { opacity: 0; } to { opacity: 1; } }
@keyframes heroRise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes heroKenBurns { from { transform: scale(1.02); } to { transform: scale(1.1); } }
@keyframes heroProgress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.home-hero {
    height: clamp(340px, 50vh, 500px);
    background: #fff;
    border-bottom: 1px solid var(--rule);
    opacity: 0;
}

body.content-loaded .home-hero { animation: heroReveal 0.8s var(--timing) 0.1s forwards; }

.home-hero-media {
    position: relative;
    height: 100%;
    overflow: hidden;
    background: #fff;
}

/* 每张图完整显示并居中：照片下衬一层自身的模糊放大版，论文配图衬白底 */
.home-hero .banner-slide {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.home-hero .banner-slide.active { opacity: 1; }

.home-hero .banner-image {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}
.home-hero .banner-backdrop {
    position: absolute;
    inset: -40px;
    width: calc(100% + 80px);
    height: calc(100% + 80px);
    object-fit: cover;
    filter: blur(28px) saturate(0.9) brightness(0.92);
}
.home-hero .banner-slide.is-photo.active .banner-image { animation: heroRise 1.1s var(--timing) both; }

.home-hero .banner-slide.is-figure { padding: 40px 56px 72px; }

.home-hero-dots {
    position: absolute;
    left: 50%;
    bottom: 12px;
    z-index: 2;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 56px;
    gap: 8px;
    transform: translateX(-50%);
}

.hero-dot {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
}
.hero-dot span {
    position: relative;
    display: block;
    width: 100%;
    height: 3px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 0 1px rgba(28, 36, 51, 0.12);
}
.hero-dot span::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
}
.hero-dot.active span::after { animation: heroProgress 6s linear forwards; }
.hero-dot:hover span { background: #fff; }

.home-hero-arrows {
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
}

.hero-prev,
.hero-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: #fff;
    border: 0;
    border-top: 1px solid var(--rule);
    color: var(--ink);
    cursor: pointer;
    transition: color 0.3s ease;
}
.hero-prev { border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.hero-prev:hover, .hero-next:hover { color: var(--accent); }

/* ===============================================
   首页 · 课题组介绍
   =============================================== */
.home-main {
    padding: 0;
    background-image: url('../assets/images/patterns/amino-acids.svg');
    background-size: 600px 600px;
}

.home-main .home-about.content-page {
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 88px 0 0;
}

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 1s var(--timing), transform 1s var(--timing);
}
.reveal-on-scroll.revealed { opacity: 1; transform: none; }

.section-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin: 0 0 26px;
}
.section-kicker span { width: 40px; height: 2px; background: var(--accent); }
.section-kicker strong {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--accent);
}
html.lang-en .section-kicker strong { letter-spacing: 0.08em; text-transform: uppercase; font-size: 14px; }
.section-kicker em {
    font-family: var(--latin-serif);
    font-size: 20px;
    color: var(--faint);
}

.about-intro {
    max-width: 960px;
    margin: 0 auto;
}
.about-heading .section-kicker { justify-content: center; }

.about-body { padding-top: 12px; }
.about-body p {
    margin: 0 0 20px;
    font-size: 17px;
    line-height: 2;
    color: var(--ink-soft);
    text-align: justify;
}
html.lang-en .about-body p { line-height: 1.85; text-align: left; }

.about-body > div > p:first-child::first-letter {
    float: left;
    padding: 6px 12px 0 0;
    font-family: var(--serif);
    font-size: 46px;
    font-weight: 900;
    line-height: 0.9;
    color: var(--accent);
}
html.lang-en .about-body > div > p:first-child::first-letter { font-family: var(--latin-serif); font-size: 52px; font-weight: 600; }

/* 研究脉络：一条曲线串起三步。圆点画在同一张等比缩放的 SVG 里，任何宽度都落在线上 */
.about-flow { margin: 88px 0 112px; }

.flow-line {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}
.flow-line path {
    fill: none;
    stroke: #C9C1B2;
    stroke-width: 1.4;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    transition: stroke-dashoffset 2s var(--timing) 0.3s;
}
.flow-line circle {
    fill: var(--accent);
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(0);
    transition: transform 0.5s var(--timing);
}
.about-flow.revealed .flow-line path { stroke-dashoffset: 0; }
.about-flow.revealed .flow-line circle { transform: scale(1); }
.about-flow.revealed .flow-line circle:nth-of-type(1) { transition-delay: 0.6s; }
.about-flow.revealed .flow-line circle:nth-of-type(2) { transition-delay: 1.3s; }
.about-flow.revealed .flow-line circle:nth-of-type(3) { transition-delay: 2s; }

.flow-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.flow-steps li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0 28px;
    text-align: center;
}

/* 手机上改为竖线，圆点由 HTML 画出 */
.flow-dot {
    display: none;
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    transform: translateX(-50%) scale(0);
    transition: transform 0.5s var(--timing);
}
.about-flow.revealed .flow-dot { transform: translateX(-50%) scale(1); }
.about-flow.revealed li:nth-child(2) .flow-dot { transition-delay: 0.6s; }
.about-flow.revealed li:nth-child(3) .flow-dot { transition-delay: 1.2s; }

.flow-index {
    margin: 0;
    font-family: var(--latin-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--ink);
}
.flow-index em { margin-right: 6px; font-size: 18px; font-weight: 500; color: var(--faint); }
.flow-index:lang(zh-CN) { font-family: var(--serif); font-size: 17px; letter-spacing: 0.1em; color: var(--muted); }

.flow-steps h3 {
    margin: 0;
    font-family: var(--serif);
    font-size: 21px;
    font-weight: 900;
    letter-spacing: 0.08em;
    color: var(--ink);
}
html.lang-en .flow-steps h3 { font-family: var(--latin-serif); font-size: 24px; font-weight: 600; letter-spacing: 0.01em; }

.flow-text {
    max-width: 320px;
    margin: 0;
    font-size: 15px;
    line-height: 1.85;
    color: #4A5160;
}

/* ===============================================
   手机
   =============================================== */
@media (max-width: 768px) {
    .header { padding: 0; }
    .header > .container { padding-top: 14px; padding-bottom: 14px; padding-right: 64px; }
    .mobile-menu-toggle { right: 8px; }
    .header-content { flex-wrap: nowrap; }
    .header-logo { width: 48px; height: 48px; }
    .header-topbar { font-size: 13px; }
    .header-topbar-inner { min-height: 40px; }
    .header-brand { gap: 12px; }
    .header h1 { font-size: 22px; margin-bottom: 2px; }
    html.lang-en .header h1 { font-size: 24px; }
    .header .subtitle { font-size: 13px; letter-spacing: 0.04em; }

    .lang-switch {
        order: initial;
        width: auto;
        margin: 0;
        padding: 0;
        border: 0;
        justify-content: flex-end;
    }
    .lang-btn { font-size: 13px; padding: 8px 0; }

    .mobile-menu-toggle {
        right: 10px;
        top: 50%;
        bottom: auto;
        transform: translateY(-50%);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        color: var(--ink);
        background: transparent;
        border: 0;
        box-shadow: none;
    }
    .mobile-menu-toggle:hover,
    .mobile-menu-toggle.active {
        color: var(--accent);
        background: transparent;
        box-shadow: none;
    }

    .navbar { border-top: 0; }
    .nav-menu,
    html.lang-en .nav-menu { flex-wrap: nowrap; gap: 0; box-shadow: none; background: #fff; }
    .nav-menu li { border-bottom: 1px solid var(--rule); }
    .nav-menu a { padding: 13px 20px; }
    .nav-menu a::after { display: none; }
    .nav-menu a.active { color: var(--accent); }

    .footer { padding: 28px 0 80px; font-size: 13px; background-size: auto 110px; }
    .footer-main { flex-direction: column; gap: 18px; }
    .footer-side { align-items: flex-start; gap: 12px; }
    .footer-copyright { text-align: left; white-space: normal; }
    .footer-icp { text-align: left; }
    .footer-links { flex-direction: row; flex-wrap: wrap; gap: 8px 24px; }

    .home-hero { height: 56vw; min-height: 220px; max-height: 360px; }
    .home-hero .banner-slide.is-figure { padding: 16px 16px 48px; }
    .home-hero-dots { bottom: 4px; grid-auto-columns: 32px; gap: 6px; }
    .hero-prev, .hero-next { width: 44px; height: 44px; }

    .home-main .home-about.content-page { padding-top: 64px; }
    .section-kicker { margin-bottom: 18px; }
    .about-body { padding-top: 24px; }
    .about-body p { font-size: 16px; line-height: 1.95; }
    .about-body > div > p:first-child::first-letter { font-size: 50px; }

    .about-flow { margin: 72px 0 80px; }
    .flow-line { display: none; }
    .flow-steps { grid-template-columns: minmax(0, 1fr); gap: 40px; margin-top: 0; }
    .flow-steps::before {
        content: '';
        position: absolute;
        left: 8px;
        top: 12px;
        bottom: 12px;
        width: 2px;
        margin-left: -1px;
        background: #C9C1B2;
        transform: scaleY(0);
        transform-origin: top;
        transition: transform 1.8s var(--timing) 0.2s;
    }
    .about-flow.revealed .flow-steps::before { transform: scaleY(1); }
    .flow-steps li { align-items: flex-start; gap: 8px; padding: 0 0 0 36px; text-align: left; }
    .flow-dot { display: block; top: 6px; left: 8px; }
    .flow-steps h3 { font-size: 22px; }
    .flow-text { max-width: none; font-size: 14px; }



}

@media (max-width: 480px) {
    .header-topbar-links a + a { display: none; }
}

/* 打印与无脚本时内容保持可见 */
@media print {
    .home-hero, .reveal-on-scroll { opacity: 1 !important; transform: none !important; animation: none !important; }
    .flow-line path { stroke-dashoffset: 0 !important; }
    .flow-line circle { transform: none !important; }
    .flow-dot { transform: translateX(-50%) !important; }
    .header-topbar, .home-hero-dots, .home-hero-arrows { display: none !important; }
}
