@import "./styles.css";

:root {
    --h-title-color: #1c64c9;
    --background-color: #ffffff;
    --text-color: #000000;
    --top-section-bg: linear-gradient(45deg, #fcfcfc, #ffffff);
    --icon-color: #1c64c9;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
}

body.dark-mode {
    --h-title-color: #f0a500;
    --background-color: #3a3535;
    --text-color: #ffffff;
    --top-section-bg: linear-gradient(45deg, #2b2b2b, #1e1e1e);
    --icon-color: #f0a500;
}

/* 统一页面各 section 底色，不再区分浅灰块 */
.bg-gradient-primary-to-secondary-light,
.bg-gradient-primary-to-secondary-gray {
    background: var(--background-color) !important;
}

/* section 本体统一底色 + 压缩上下间距 */
section {
    background-color: var(--background-color);
    padding: 18px 0;
    margin: 0;
}

/* section 标题区域收紧 */
section header {
    margin-bottom: 8px;
}

section header h2 {
    font-family: "Kanit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
    color: var(--h-title-color);
    font-size: 2.3rem;
    line-height: 1.8;
    margin-top: 0;
    margin-bottom: 0;
}

/* 正文 */
section .main-body {
    font-size: 1.15rem;
    font-weight: 300;
    line-height: 2rem;
    margin-top: 0;
    padding-top: 0;
}

section .main-body > *:first-child {
    margin-top: 0;
}

section .main-body > *:last-child {
    margin-bottom: 0;
}

/* 首页里图标和 About me 的距离 */
.social-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin: 0 0 22px 0;
    line-height: 1;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    font-size: 0.95rem;
    font-weight: 500;
    color: #444;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.social-link span {
    line-height: 1;
}

.social-link:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.social-icons .icon-github {
    color: #000000;
}

.dark-mode .social-icons .icon-github {
    color: #ffffff;
}

.dark-mode .social-link {
    color: #eaeaea;
}

/* home 里标题别再贴上去 */
#home-md h1,
#home-md h2,
#home-md h3,
#home-md h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

/* Publications 再额外收紧一点 */
#publications {
    padding-top: 8px;
    padding-bottom: 12px;
}

#publications header {
    margin-bottom: 4px;
}

#publications .main-body {
    margin-top: 0;
    padding-top: 0;
}

.pub-card:first-child {
    margin-top: 0;
}

/* 导航栏 */
.navbar .nav-link {
    color: #333;
}

.dark-mode .navbar {
    background-color: #1e1e1e !important;
    --text-color: #f0a500;
}

.navbar .nav-link:hover {
    color: #1c64c9 !important;
}

.navbar .navbar-brand {
    color: #333;
}

.navbar .navbar-brand:hover {
    color: #1c64c9 !important;
}

.dark-mode .navbar .nav-link {
    color: #ffffff !important;
}

.dark-mode .navbar .nav-link:hover {
    color: #f0a500 !important;
}

.dark-mode .navbar .navbar-brand {
    color: #ffffff !important;
}

.dark-mode .navbar .navbar-brand:hover {
    color: #f0a500 !important;
}

/* 正文链接 */
.container a {
    color: #1c64c9;
    text-decoration: none;
}

.container a:hover {
    color: #1553a4;
    text-decoration: underline;
}

.dark-mode .container a {
    color: #bb86fc;
}

.dark-mode .container a:hover {
    color: #d2a8ff;
    text-decoration: underline;
}

/* footer 链接 */
.footer a,
footer a {
    color: #ffffff !important;
}

/* 页头 */
.header {
    border-bottom: solid 2px var(--h-title-color);
    z-index: 10000;
}

.bg-bottom {
    background-color: var(--h-title-color);
}

/* 顶部大图 */
.top-section {
    position: relative;
    padding: 10rem 0;
    background-position: center;
    background-size: cover;
    height: 35rem;
}

.top-section h2 {
    font-weight: 400;
}

.top-section .top-section-content {
    position: relative;
    z-index: 1;
}

.top-section:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

/* 深色模式下也统一 section 底色 */
.dark-mode .bg-gradient-primary-to-secondary-light,
.dark-mode .bg-gradient-primary-to-secondary-gray {
    background: var(--background-color) !important;
}

.on-top {
    position: relative;
    z-index: 10000;
}

.top-bg {
    background-position: center;
    background-size: fill;
    width: 100%;
    height: 100%;
}

.top-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

/* 头像 */
#avatar {
    position: relative;
    height: 0;
    top: min(-65px, max(-100px, calc(-1 * 100vw / 12)));
    max-width: 55em;
    margin: 0 1.5rem 0 0;
    float: right;
    z-index: 9000;
}

#avatar img {
    height: max(150px, min(230px, calc(100vw / 6)));
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.2);
}

@media screen and (max-width: 991px) {
    #avatar {
        margin: 0;
    }
}

/* publication 卡片 */
.pub-card {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin: 0 0 22px 0;
    padding: 18px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    background: var(--background-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.pub-image-wrap {
    width: 420px;
    max-width: 48%;
    overflow: hidden;
    border-radius: 12px;
    flex-shrink: 0;
}

.pub-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    transition: transform 0.35s ease;
}

.pub-image:hover {
    transform: scale(1.08);
}

.pub-content {
    flex: 1;
}

.pub-authors,
.pub-title,
.pub-venue,
.pub-links {
    margin: 0 0 10px 0;
    line-height: 1.6;
}

.pub-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.pub-venue {
    font-style: italic;
    color: #555;
}

.dark-mode .pub-venue {
    color: #d0d0d0;
}

.pub-links a {
    text-decoration: none;
}

.pub-links a:hover {
    text-decoration: underline;
}

@media screen and (max-width: 768px) {
    .pub-card {
        flex-direction: column;
    }

    .pub-image-wrap {
        width: 100%;
        max-width: 100%;
    }
}
.visitor-map {
    width: 300px;
    height: 300px;
    margin: 1.5rem auto 0 auto;
    overflow: hidden;
}

.visitor-map canvas,
.visitor-map iframe {
    width: 300px !important;
    height: 300px !important;
}
/* 主题切换按钮 */
#theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    padding: 0;
    vertical-align: middle;
    border-radius: 5px;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out;
}

#theme-toggle:hover {
    transform: scale(1.1);
}
/* =========================
   Life page
   ========================= */

.life-page {
    background-color: #faf8f4;
    color: #2f2f2f;
}

.dark-mode.life-page {
    background-color: #2d2926;
    color: #f3efe8;
}

.life-main {
    padding-top: 120px;
    padding-bottom: 60px;
}

.life-hero {
    max-width: 900px;
    margin-bottom: 56px;
}

.life-kicker {
    margin-bottom: 10px;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a7f73;
}

.dark-mode .life-kicker {
    color: #c9bfb3;
}

.life-title {
    margin: 0 0 18px 0;
    font-family: "Newsreader", Georgia, serif;
    font-size: clamp(3rem, 6vw, 5.2rem);
    line-height: 1.02;
    font-weight: 600;
    color: #1f1f1f;
}

.dark-mode .life-title {
    color: #fffaf2;
}

.life-intro {
    margin: 0 0 14px 0;
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.5;
    color: #2c2c2c;
}

.dark-mode .life-intro {
    color: #f5f1ea;
}

.life-description {
    max-width: 980px;
    margin: 0;
    font-size: 1.18rem;
    line-height: 1.95;
    color: #5b534b;
}

.dark-mode .life-description {
    color: #ddd5ca;
}

.life-section {
    margin-top: 18px;
}

.life-section-title {
    margin: 0 0 22px 0;
    font-family: "Newsreader", Georgia, serif;
    font-size: 2.2rem;
    font-weight: 600;
    color: #2a2a2a;
}

.dark-mode .life-section-title {
    color: #fffaf2;
}

.life-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}

.life-gallery img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 18px;
    display: block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.life-gallery img:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.14);
}

@media screen and (max-width: 768px) {
    .life-main {
        padding-top: 100px;
        padding-bottom: 40px;
    }

    .life-intro {
        font-size: 1.2rem;
    }

    .life-description {
        font-size: 1.05rem;
        line-height: 1.8;
    }

    .life-section-title {
        font-size: 1.8rem;
    }
}

/* =========================
   Life page
   ========================= */

.life-page {
    position: relative;
    min-height: 100vh;
    color: #2f2f2f;
    background:
        linear-gradient(rgba(248, 245, 239, 0.72), rgba(248, 245, 239, 0.72)),
        url("../assets/img/life-bg.jpg") center center / cover no-repeat fixed;
}

.life-page.dark-mode {
    color: #f3efe8;
    background:
        linear-gradient(rgba(24, 27, 32, 0.70), rgba(24, 27, 32, 0.70)),
        url("../assets/img/life-bg.jpg") center center / cover no-repeat fixed;
}

/* 导航栏在 life 页更通透一点 */
.life-page .navbar {
    background: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.life-page.dark-mode .navbar {
    background: rgba(20, 22, 28, 0.68) !important;
}

/* 导航文字 */
.life-page .navbar .nav-link,
.life-page .navbar .navbar-brand {
    color: #2f2f2f !important;
}

.life-page.dark-mode .navbar .nav-link,
.life-page.dark-mode .navbar .navbar-brand {
    color: #f7f2ea !important;
}

.life-page .navbar .nav-link:hover,
.life-page .navbar .navbar-brand:hover {
    color: #1c64c9 !important;
}

.life-page.dark-mode .navbar .nav-link:hover,
.life-page.dark-mode .navbar .navbar-brand:hover {
    color: #f0a500 !important;
}

/* main 区域 */
.life-main {
    padding-top: 130px;
    padding-bottom: 70px;
}

/* 不要白块黄块，统一做成柔和玻璃卡片 */
.life-hero,
.life-section {
    background: rgba(255, 255, 255, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 24px;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.life-page.dark-mode .life-hero,
.life-page.dark-mode .life-section {
    background: rgba(28, 31, 38, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22);
}

.life-hero {
    max-width: 980px;
    padding: 42px 36px;
    margin-bottom: 34px;
}

.life-section {
    padding: 30px 28px;
}

.life-kicker {
    margin-bottom: 10px;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #867c71;
}

.life-page.dark-mode .life-kicker {
    color: #d0c5b7;
}

.life-title {
    margin: 0 0 18px 0;
    font-family: "Newsreader", Georgia, serif;
    font-size: clamp(3.2rem, 6vw, 5.4rem);
    line-height: 0.98;
    font-weight: 600;
    color: #1f1f1f;
}

.life-page.dark-mode .life-title {
    color: #fffaf2;
}

.life-intro {
    margin: 0 0 14px 0;
    font-size: 1.55rem;
    font-weight: 600;
    line-height: 1.5;
    color: #2f2f2f;
}

.life-page.dark-mode .life-intro {
    color: #f4efe8;
}

.life-description {
    max-width: 980px;
    margin: 0;
    font-size: 1.18rem;
    line-height: 1.95;
    color: #564f47;
}

.life-page.dark-mode .life-description {
    color: #ddd4c8;
}

.life-section-title {
    margin: 0 0 20px 0;
    font-family: "Newsreader", Georgia, serif;
    font-size: 2.2rem;
    font-weight: 600;
    color: #242424;
}

.life-page.dark-mode .life-section-title {
    color: #fffaf2;
}

.life-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}

.life-gallery img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 18px;
    display: block;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.life-gallery img:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.16);
}

/* theme 按钮真的可点，而且更像按钮 */
.life-page #theme-toggle {
    background: rgba(255, 255, 255, 0.38);
    border: 1px solid rgba(0, 0, 0, 0.06);
    width: 48px;
    height: 48px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.life-page #theme-toggle:hover {
    transform: scale(1.08);
    background: rgba(255, 255, 255, 0.58);
}

.life-page.dark-mode #theme-toggle {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.life-page.dark-mode #theme-toggle:hover {
    background: rgba(255, 255, 255, 0.16);
}

@media screen and (max-width: 768px) {
    .life-main {
        padding-top: 105px;
        padding-bottom: 40px;
    }

    .life-hero {
        padding: 28px 22px;
    }

    .life-section {
        padding: 22px 18px;
    }

    .life-intro {
        font-size: 1.2rem;
    }

    .life-description {
        font-size: 1.04rem;
        line-height: 1.8;
    }

    .life-section-title {
        font-size: 1.8rem;
    }
}
