html {
    -webkit-text-size-adjust: 100%; 
    -moz-text-size-adjust: 100%; 
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
}
body {
    background-color: #fdfdfd; 
    color: #234; 
    margin: 0; 
    font-size: 13px;
    overflow-x: hidden;
}
h1 {margin-bottom: 10px; font-size: 3.5em;}
h2 {margin-top: 48px;}
h1, h2 {color: #234;}
h3, h4, h5 {color: #345;}
h1, h2, h3, h4, h5, a, p, span, body, div {font-weight: normal; font-family: 'Lato', Verdana, Helvetica, sans-serif;}
/* Hero Section Styles */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    background: linear-gradient(to bottom, #fdfdfd 10%, #f4f4f8 90%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-content {
    position: relative;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateY(0);
    opacity: 1;
    transition: opacity 0.1s ease-out;
    will-change: transform, opacity;
    padding: 20px 0;
    min-height: auto;
}

.hero-section.scrolled .hero-content {
    transform: translateY(-50px);
}

.divider {
    position: relative;
}
.divider::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    height: 1px;
    background-color: rgba(0,0,0,0.1);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    color: #666;
    font-size: 24px;
    animation: bounce 2s infinite;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.scroll-indicator:hover {
    color: #f09228;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Hide scroll indicator when scrolled */
.hero-section.scrolled .scroll-indicator {
    opacity: 0;
    pointer-events: none;
}

.header {background: linear-gradient(to bottom, #fdfdfd 10%, #f4f4f8 90%); width: 100%; padding-top: 16px; padding-bottom: 32px;}
.header-text {width: 50%;}
.header-profile-picture, .header-text {display: inline-block;}
.header-name h1 {margin: 0;}
.header-subtitle {margin: 0;}
.header-profile-picture {width: 200px; height: 200px; margin-right: 12px; border-radius: 0%; background-image: url("/?originalUrl=https%3A%2F%2Fsrameo.github.io%2Fassets%2Fme.jpeg"); background-position: center; background-size: contain;}
.content {max-width: 748px; padding-left: 16px; padding-right: 16px; margin: auto; margin-top: 48px;}

/* Content sections after hero */
.hero-section + .content {
    margin-top: 0;
    padding-top: 64px;
}

/* Ensure proper spacing for main content areas */
#pinned, #news, #publications, #experiences {
    position: relative;
    z-index: 1;
}
.hr {width: 100%; height: 1px; margin: 48px 0; background-color: #d6dbdf;}
a {color: #2471a3; text-decoration: none;}
a:focus, a:hover {color: #f09228;}
p {line-height: 1.5em;}
.nobreak {white-space: nowrap;}
.noselect {-webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;}
.bold {font-weight: bold;}
.italic {font-style: italic;}
.bulletpoints {line-height: 1.5em;}
.row {box-sizing: border-box;}
.row-media {display: block; float: left; width: 160px; height: 90px; background-position: center; background-size: contain; background-repeat: no-repeat;}
.row-text {display: block; float: left; margin-left: 12px; line-height: 1.5em; max-width: 566px;}
.row-text span {line-height: inherit;}
.clearfix {content: ""; clear: both; display: table;}
.publication {margin-bottom: 32px; padding-left: 8px;}
.publication.highlight {background-color: #fff8df; width: 100%; padding-top: 8px; padding-bottom: 8px; border-radius: 4px;}
.press {width: 100px; height: 80px; border: 1px solid #def; margin-right: 12px; background-size: cover;}  
.img-contain {background-size: contain !important;}
.footer {background-color: #345; width: 100%}
.footer-content {color: #fff; font-size: 10px; padding: 6px 0; max-width: 748px; margin: auto;}
.footer-content a {color: #fff; text-decoration: underline;}
.footer-content a:hover {color: #f09228 !important;}
.stars {font-size: 10px; display: inline-block; margin-left: 6px; color: #666;}

@media only screen and (max-width: 1150px) {
    .header-profile-picture, .header-text {display: block; margin: auto; text-align: center;}
    .header-profile-picture {margin-bottom: 12px; width: 140px; height: 140px;}
    body {font-size: 18px;}
    a.btn {font-size: 14px; padding: 2px 6px;}
    
    /* Hero section mobile adjustments */
    .hero-section {
        height: 100vh;
        min-height: 600px;
    }
    
    .hero-content {
        padding: 20px;
    }
    
    .scroll-indicator {
        bottom: 20px;
        font-size: 20px;
    }
}

@media only screen and (max-width: 1000px) {
    .publication {margin-bottom: 46px;}
    .publication .row-media {width: 260px; height: 130px; margin: auto; margin-bottom: 12px; display: block;}
    .publication .row-text {display: block; width: 100%; margin-left: 0;}
    .press {display: block;}
}


/* time line */
.timeline {
    /* width: 60%; */
    /* background: white; */
    padding: 20px;
    /* border-radius: 10px; */
    /* box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); */
}
.timeline-item {
    margin-bottom: 20px;
    position: relative;
    padding-left: 50px;
}
.timeline-item:last-child {
    margin-bottom: 0;
}
.timeline-item:before {
    content: "";
    width: 20px;
    height: 20px;
    background: #4285f4;
    border: 3px solid white;
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 0;
}
.timeline-item:after {
    content: "";
    position: absolute;
    left: 9px;
    top: 30px;
    height: calc(100% - 20px);
    width: 2px;
    background: #4285f4;
}
.timeline-item:last-child:after {
    display: none;
}
table {
    width: 100%;
    border-spacing: 0;
    border-collapse: collapse;
}
td {
    vertical-align: top;
    /* padding: 10px; */
}
.icon {
    width: 200px;
    text-align: center;
}
.icon img {
    height: 50px;
    object-fit: contain;
}
.description {
    border-left: 2px solid #eee;
    padding-left: 20px;
}
.description h4 {
    margin-top: 0;
    margin-bottom: 10px;
}
.description p {
    margin: 0;
    color: #666;
}

/* news */
.news-container {
    /* width: 60%; */
    margin: auto;
    /* background: white; */
    /* padding: 20px; */
    /* border-radius: 10px; */
    /* box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); */
    max-height: 275px; /* 限制高度以实现折叠效果 */
    overflow: hidden; /* 使内容可垂直滚动 */
    position: relative;
    transition: max-height 0.5s ease-in-out;
}
.news-container.expanded {
    max-height: 750px;
    overflow-y: auto;
}
.news-container h2 {
    margin-top: 0;
}
.news-list {
    list-style-type: none;
    padding: 0;
}
.news-item {
    margin-bottom: 10px;
}
.news-item span {
    font-weight: bold;
}
.news-item a {
    color: #1a0dab;
    text-decoration: none;
}
.news-item a:hover {
    text-decoration: underline;
    margin-bottom: 10px;
}

.news-toggle-wrapper {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;
    text-align: right;
    padding-top: 40px; /* Gradient height */
    background: linear-gradient(to bottom, rgba(253, 253, 253, 0), #fdfdfd 40%);
}

.news-toggle-link {
    color: #aaa;
    text-decoration: none;
    font-size: 12px;
    padding: 5px 10px;
    display: inline-block;
}

.news-toggle-link:hover {
    color: #f09228;
}

.news-container.expanded .news-toggle-wrapper {
    position: relative;
    background: none;
    padding-top: 10px;
    padding-right: 0;
}

/* navbar */
.navbar {
    display: flex;
    justify-content: space-around;
    background-color: #333;
    padding: 5px;
    padding-left: 20%;
    padding-right: 20%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}
.navbar a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    text-align: center;
}
.navbar a:hover {
    background-color: #575757;
}

.btn.active {
    text-decoration: underline;
}

.publication.gray-overlay {
    position: relative;
    overflow: hidden;
}

.publication.gray-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.4); /* White overlay */
    pointer-events: none; /* Allow clicks to pass through */
    border-radius: 4px; /* Match the border radius */
}

.publication.gray-overlay:hover::after {
    background-color: rgba(255, 255, 255, 0.0); /* Fully transparent on hover */
}

.pinned-container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin: 20px 0;
}

.pinned-item {
    flex: 1;
    min-width: 180px;
    max-width: calc(33.33% - 16px);
    max-height: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
    transition: all 0.3s ease;
    overflow: hidden;
}

.pinned-item:hover {
    transform: translateY(-1px);
    box-shadow: rgba(0, 0, 0, 0.12) 0px 6px 18px;
}

.pinned-item a {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.pin-title {
    display: block;
    /* font-size: 16px; */
    font-weight: bold;
    /* color: #666; */
    margin: 12px 15px 8px;
}

.pin-desc {
    display: block;
    /* font-size: 14px; */
    /* color: #888; */
    margin: 0 15px 12px;
    line-height: 1.5;
}

.pinned-item img,
.pinned-item video {
    width: 100%;
    flex-grow: 1;
    min-height: 0;
    display: block;
    object-fit: cover;
    /* animation: scroll-y 7s linear 0s infinite alternate; */
}

@keyframes scroll-y {
  from {
    object-position: center top;
  }
  to {
    object-position: center bottom;
  }
}

@media (max-width: 768px) {
    .pinned-item {
        max-width: 100%;
    }
}

/* === Custom about section === */
.header-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
}

.header-container .header-text {
    flex: 1 1 320px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 200px;
}

.header-profile-picture {
    /* border-radius: 50% !important; */
    background-size: cover !important;
    flex-shrink: 0;
}

.header-subtitle {
    font-size: 1.15em;
    line-height: 1.4em;
    margin-top: 0px;
    margin-bottom: 60px;
}

.header-links {
    margin-top: 0;
}

.header-links .btn {
    margin-right: 6px;
}

/* === Tooltip for header links === */
.header-links .btn {
    position: relative;
    font-size: 20px; /* bigger icons */
}

.header-links .btn::after {
    content: attr(data-label);
    position: absolute;
    top: 50%;
    left: calc(100% + 6px);
    transform: translateY(-50%);
    background: #ffffff;
    color: #234;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.header-links .btn:hover::after {
    opacity: 1;
}

/* === Intro text styling === */
.intro-text {
    font-size: 1.1em;
    line-height: 1.6em;
    margin-top: 20px;
    display: block;
}

@media only screen and (max-width: 600px) {
    .header-container {
        flex-direction: column-reverse;
        text-align: center;
    }
    .header-profile-picture {
        margin-bottom: 16px;
    }
    .header-links .btn::after {
        left: 50%;
        top: calc(100% + 6px);
        transform: translateX(-50%);
    }
}

/* === Resume grid === */
.resume-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 24px;
    margin-top: 24px;
}

.resume-item {
    flex: 1 1 140px;
    max-width: 160px;
    text-align: center;
    color: #345;
}

.resume-logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff; /* 若图片非透明可忽略 */
    padding: 4px; /* 留出内边距，避免裁切文字 */
    box-shadow: 0 0 2px rgba(0,0,0,0.08);
    margin-bottom: 8px;
}

.resume-org {
    font-weight: bold;
    margin-bottom: 4px;
}

.resume-role, .resume-time {
    font-size: 0.9em;
    line-height: 1.2em;
}

/* Hide resume-time by default, show on hover */
.resume-time {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.resume-item:hover .resume-time,
a:hover .resume-time {
    opacity: 1;
    visibility: visible;
}

@media(max-width: 600px) {
    .resume-item {
        flex: 1 1 45%;
        max-width: 45%;
    }
}

/* === Horizontal carousel === */
.resume-carousel {
    display: flex;
    gap: 24px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    min-height: 100px; /* 确保有足够高度 */
    margin-top: 48px;
}

.resume-carousel::-webkit-scrollbar {
    display: none; /* hide scrollbar */
}

.resume-carousel .resume-item,
.resume-carousel a .resume-item {
    scroll-snap-align: start;
    flex: 0 0 160px; /* 固定宽度，避免因压缩导致文本换行 */
    min-width: 160px; /* 确保最小宽度 */
    display: block; /* 确保显示 */
}

/* Ensure anchor tags in carousel display correctly */
.resume-carousel > a {
    flex: 0 0 160px;
    min-width: 160px;
    display: block;
    text-decoration: none;
    color: inherit;
}

.resume-wrapper {
    overflow: hidden;
    margin-top: 10px;
    width: 100%;
}

/* Ensure resume wrapper displays correctly in hero section */
.hero-content .resume-wrapper {
    margin-top: 10px;
    display: block;
    width: 100%;
    overflow: visible;
}

.hero-content .content {
    margin-top: 0;
    width: 100%;
}

/* Ensure resume items are visible */
.hero-content .resume-item {
    opacity: 1;
    visibility: visible;
}

/* JS will control scroll; no CSS animation */

/* === Custom style for resume carousel navigation arrows === */
.resume-wrapper .slider-navigation-next,
.resume-wrapper .slider-navigation-previous {
    background: none !important;   /* 移除背景圆圈 */
    border: none !important;       /* 移除边框 */
    border-radius: 0 !important;   /* 取消圆角 */
    box-shadow: none !important;   /* 取消阴影 */
    opacity: 0.0;
    width: 12px;                   /* 调整尺寸 */
    height: 12px;
}

.resume-wrapper .slider-navigation-next svg,
.resume-wrapper .slider-navigation-previous svg {
    width: 60%;        /* 放大箭头 */
    fill: #345;        /* 颜色与文字协调 */
}

@media(max-width: 600px) {
    /* hide arrows on very small screens where swipe is available */
    .resume-wrapper .slider-navigation-next,
    .resume-wrapper .slider-navigation-previous {
        display: none;
    }
}

