:root {
    --main-warm1: #DCC9A9; /*more colorful: choose*/
    --main-warm2: #C1AB85; 
    --main-warm-dark: #C94E44;
    --main-cold1: #4E6851; /*more colorful: choose*/
    --main-cold2: #3E6868;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    background: url('https://gallery.yitingli.xyz/smallmodelBG.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #333;
}
/* 禁用数字链接样式 */
a[href^="tel"] {
    text-decoration: none;
    color: inherit;
    pointer-events: none;
    cursor: default;
}

/* Header block : Yiting Li + three button */
.header-block {
    max-width: 1050px;
    text-align: center;
    margin: 60px auto 10px auto;
    padding: 5px auto;
    display: flex;
    flex-direction: row;
    align-items: flex-end; /* 底边对齐 */
    justify-content: flex-start; /* 内容靠左 */
    gap: 20px; /* Yiting Li 和按钮的间距 */
}
/* same width as header-block */
.projects-publications {
    display: flex;
    gap: 20px;
    padding: 5px;
    margin: 10px auto 35px auto;
    max-width: 1100px;
}

.header-block h1 {
    color: var(--main-cold1);
    margin: 0; /* 避免 margin 导致的对齐问题 */
    font-size: 56px;
    line-height: 1; /* 避免 line-height 影响底部位置 */
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.5), 0 0 5px var(--main-warm1); /* 多彩阴影 */
}
/* ---new ---/
/* 默认按钮样式 */
.contact-buttons {
    display: flex;
    align-items: flex-end; /* 内部按钮底边对齐 */
    justify-content: center;
    margin: 0 5px;
}

.contact-buttons a {
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 15px;
    background-color: var(--main-cold1);
    color: var(--main-warm1);
    font-size: 14px;
    font-weight: 400;
    transition: background 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
.contact-buttons a i {
    margin-right: 6px;
}
.contact-buttons a:hover {
    background-color: var(--main-warm1);
    color: var(--main-cold1);
    transform: scale(1.05);
}
/*------*/
/* Projects & Publications layout */
.projects {
    flex: 1.5; /* 占比2 */
    background: rgba(255,255,255,0.8);
    padding: 20px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.publications {
    flex: 1; /* 占比1 */
    background: rgba(255,255,255,0.8);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* project period */
h3 {
    color: var(--main-cold1);
    font-size: 18px;
    font-weight: 600;
    font-style: italic;
    margin: 15px 0 4px 0;
}

/* project name + details button */
h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 4px 0 5px 0;
    display: inline-block;
}

/* project details button */
h4 .details-button, .cata-button {
    display: inline-block;
    margin-left: 4px;
    vertical-align: baseline;
    position: relative;
    top: -2px;
    font-weight: 400;
    font-size: 0.45rem;
    padding: 2px 4px;
    border-radius: 5px;
    /* background-color: #496246; */
    /* border: none;*/
    background-color: transparent;  /* 无背景色 */
    border: 1.4px solid var(--main-cold1);      /* 添加边框 */
    /* color: white; */
    color: var(--main-cold1);
    box-shadow: none;          /* 去掉阴影 */
    text-decoration: none;
    transition: all 0.3s ease;       /* 平滑过渡 */
    -webkit-tap-highlight-color: transparent;
}

h4 .details-button:hover, .cata-button:hover {
    background-color: var(--main-cold1);
    color: var(--main-warm1); /* 更明显 */
    border: 1.4px solid var(--main-cold1); /* 保留边框 */
}

/* project bullet point */
p {
    font-size: 14px;
    margin: 4px 0;
    line-height: 1.3;
    text-indent: -2px;
    padding-left: 15px;
    position: relative;
}

p::before {
    content: "•";
    position: absolute;
    left: 0;
    color: inherit;
    font-weight: bold;
}

/* download cv and link buttons */
.download-cv,
.link-button {
    display: inline-block;
    margin: 5px 10px;
    padding: 8px 18px;
    border-radius: 30px;
    background: var(--main-cold1);
    color: white;
    font-size: 12px;
    font-weight: 550;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;       /* 平滑过渡 */
    -webkit-tap-highlight-color: transparent;
}

.download-cv:hover,
.link-button:hover {
    background: var(--main-warm1);
    color: var(--main-cold1);
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* doi link */
.doi-link {
    color: #1a0dab;
    text-decoration: underline;
}

.doi-link:hover {
    color: #0c0080;
}

/* open PDF from cloudflare R2 button */
.pdf-button {
    background-color: var(--main-cold1);
    vertical-align: baseline;
    position: relative;
    top: -1px;
    color: var(--main-warm1);
    border: none;
    padding: 2px 4px;
    border-radius: 5px;
    background-color: transparent;  /* 无背景色 */
    border: 1.4px solid var(--main-cold1);      /* 添加边框 */
    /* color: white; */
    color: var(--main-cold1);
    box-shadow: none;          /* 去掉阴影 */
    text-decoration: none;
    transition: all 0.3s ease;       /* 平滑过渡 */
    -webkit-tap-highlight-color: transparent;
}

.pdf-button:hover {
    background-color: var(--main-cold1);
    color: var(--main-warm1);
    /*border: 1.4px solid var(--main-cold1);      /* 添加边框 */
}

.publications .pdf-button {
    font-size: 0.50rem;
}
.pdf-button a i {
    margin-right: 0.5px;
}
/* publication, looks like citation */
/* auto count pulication number */
.publication-item {
    counter-increment: pub-counter;
    font-size: 15px;
    line-height: 1.3;
    margin-top: 20px;
}
.publication-item::before {
    content: counter(pub-counter) ". ";
    font-weight: bold;
}

/* Back button */
.back-container {
    width: 100%;
    text-align: center;
    margin: 20px 0 40px 0;
}
.back-button {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    gap: 10px;
    border-radius: 22px;
    text-decoration: none;
    background-color: var(--main-cold1);
    color:var(--main-warm1);
    font-weight: 500;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.3s, transform 0.3s;
    cursor: pointer;
}

.back-button:hover {
    background-color: var(--main-warm1);
    color: var(--main-cold1);
    gap: 12px;
    transform: scale(1.05);
}

/* Scroll to top button */
#scrollTopBtn {
    display: none;
    position: fixed;
    bottom: 60px;
    right: 20px;
    border: none;
    outline: none;
    background-color: var(--main-cold1);
    color: var(--main-warm1);
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 50%;
    font-size: 16px;
    transition: background 0.3s, transform 0.3s;
    z-index: 1000;
}

#scrollTopBtn:hover {
    background-color: var(--main-warm1);
    color: var(--main-cold1);
    transform: scale(1.1);
}

footer {
    position: static;  /* 让footer变为文档流的一部分 */
    bottom: 0;
    width: 100%;
    padding: 8px 0;
    font-size: 10px;
    color: #555;
    text-align: center;
    background: rgba(0, 0, 0, 0.05);
    margin-top: 20px;
    opacity: 0.75;
}

/* try something new: click button display figure */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 80%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: var(--main-warm1);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.close:hover {
    color: var(--main-cold1);
}

/* Responsive */
@media (max-width: 768px) {
    .header-block {
        flex-direction: column;
        align-items: center; 
        justify-content: center; 
        margin: 20px auto 10px auto;
        padding: 5px;
        gap: 8px; /* Yiting Li 和按钮的间距 */
        text-align: center;
    }
    .header-block h1 {
        color: var(--main-warm1);
        text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.5), 0 0 3px var(--main-cold1); /* 多彩阴影 */
        font-size: 26px;
        margin: 2px;
    }
    .contact-buttons .btn-text {
        display: none; /* 隐藏文字 */
    }
    .contact-buttons a i {
        margin-right: 0;
    }
    .contact-buttons {
        display: flex;
        justify-content: center;
        gap: 8px; /* 调整间距更均衡 */
        flex-wrap: nowrap;
    }
    .contact-buttons a {
        font-size: 14px; /* 稍微大一些便于点击 */
        padding: 6px 10px;
        margin: 0 2px;
    }
    .projects-publications {
        flex-direction: column;
        padding: 10px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        background: rgba(0,0,0,0.1);
        border-radius: 8px;
        margin-top: 5px;
        margin-bottom: 5px;
    }
    .projects, .publications {
        flex: 1 1 100%;
        margin-bottom: 20px;
        padding: 15px;
    }
    .projects-publications h2 {
        font-size: 20px;
    }
    /* project period */
    h3 {
        font-size: 16px;
        margin: 15px auto 3px auto; 
    }
    /* project name + details button */
    h4 {
        font-size: 14px;
        margin: 2px auto 5px auto; 
    }
    h4 .details-button, .cata-button {
        padding: 2px 5px; /* 手机端更小 */
        font-size: 0.6rem; /* 缩小字体 */
        margin: 4px; /* 增加间距防止拥挤 */
    }
    /* publication, looks like citation */
    .publication-item {
        font-size: 14px;
    }
    .pdf-button {
        padding: 2px 3px; /* 手机端更小 */
        font-size: 0.65rem; /* 更小按钮尺寸 */
        border-radius: 5px;
        background-color: var(--main-cold1);
        color:var(--main-warm1);
        margin: 4px; /* 增加间距防止拥挤 */
    }
    .pdf-button:hover {
        background-color: var(--main-warm1);
        color: var(--main-cold1);
    }
    .pdf-button .btn-text {
        display: none; /* 隐藏文字 */
    }
    .back-container {
        margin: 20px 0;
        text-align: center;
    }
    .back-button {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        bottom: 15px;
        padding: 5px 10px;
        font-size: 14px;
        opacity: 0.8;
        z-index: 1000;
    } 
    #scrollTopBtn {
        opacity: 0.8;
    }
    .footer {
        position: static;  /* 让footer变为文档流的一部分 */
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100%;
        margin-top: 10px;  /* 给footer和上面内容一些间距 */
        font-size: 8px;
    }
}
