/* 导航栏优化 */
.masthead {
    background-color: var(--sidebar-bg);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}
.menu {
    display: none !important;
    visibility: hidden !important; /* 双重保险，防止JS动态显示 */
    opacity: 0 !important;
    pointer-events: none !important; /* 禁止点击交互 */
}

.form-option--checkbox:has(.hide-controls) {
    display: none !important;
}

.masthead__menu {
    display: flex;
    justify-content: center; /* 水平居中 */
}
.masthead__menu ul.visible-links {
    display: flex;
    justify-content: center; /* 水平居中列表项 */
    padding: 0;
    margin: 0;
    list-style: none;
}
.masthead__menu-item a {
    color: #cf6a51;
    transition: var(--transition);
    padding: 0.8rem 1rem;
    text-align: center;
    display: block;
}
.masthead__menu li {
    margin: 0 1rem;
}
.masthead__menu-item a:hover,
.masthead__menu-item a.active {
    color: var(--primary-color);
}
.masthead__inner-wrap {
    background-color: #fff;
}
html[data-theme="dark"] .masthead__inner-wrap,
html[data-theme="dark"] .masthead__menu,
html[data-theme="dark"] .visible-links {
    background-color: transparent !important;
}
body {
    margin-top: 12px !important;
    padding-top: 25px !important;
}

/* 视频容器样式 */
.fluid-width-video-wrapper {
    width: 100%;
    position: relative;
    padding: 0;
}

.fluid-width-video-wrapper iframe,
.fluid-width-video-wrapper object,
.fluid-width-video-wrapper embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 侧边栏样式 */
.sidebar {
    margin-bottom: 2rem;
    transition: var(--transition);
    padding-top: 2rem !important;
    margin-left: 60px; 
    overflow: hidden;
}

@media (min-width: 768px) {
    .sidebar {
        overflow: hidden;
        position: fixed;
        top: 63px;
        left: 20px;
        width: 280px;
        max-height: calc(100vh - 120px);
        /*overflow-y: auto;*/
        z-index: 1000;
    }
    .main-content {
        margin-left: 320px;
        padding-right: 20px;
    }
}

.sidebar-inner {
    background: var(--sidebar-bg, #ffffff);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: background-color;
    overflow: hidden;
}

.sidebar-inner:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px) scale(1.03);
}
[data-theme="dark"] .sidebar-inner {
    background: transparent !important;
    box-shadow: 0 4px 14px transparent !important;
}

.sidebar .section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--sidebar-border, #e2e8f0);
}

[data-theme="dark"] .sidebar .section {
    border-bottom: 1px solid transparent !important;
}

.sidebar .section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar-title {
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--sidebar-title, #2d3748);
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

[data-theme="dark"] .sidebar-title {
    color: #e2e8f0;
}

.sidebar-title:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 35px;
    height: 2px;
    background: #3182ce;
}

.sidebar-image {
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
}

.sidebar-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.sidebar-img:hover {
    transform: scale(1.04);
}

.sidebar-text {
    color: var(--sidebar-text, #4a5568);
    line-height: 1.65;
    font-size: 0.95rem;
}

[data-theme="dark"] .sidebar-text {
    color: #cbd5e0;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    color: var(--sidebar-link, #4a5568);
    text-decoration: none;
    transition: all 0.25s ease;
    display: block;
    padding: 0.35rem 0;
}

[data-theme="dark"] .sidebar-nav a {
    color: #cbd5e0;
}

.sidebar-nav a:hover {
    color: #3182ce;
    padding-left: 6px;
}

.author-profile {
    text-align: center;
}

.author-profile .author__avatar {
    border-radius: 50%;
    margin: 0 auto 1rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    width: 120px;
    height: 150px;
    object-fit: cover;
}

[data-theme="dark"] .author-profile .author__avatar {
    border-color: transparent;
}

.author-profile .author__avatar:hover {
    transform: scale(1.05);
}

.author-profile .author__name {
    font-size: 1.5rem;
    margin-bottom: 0.4rem;
    font-weight: normal;
    color: var(--sidebar-title, #225aa3);
    font-family: "KaiTi", "STKaiti", "SimKai", "楷体", serif;
}

[data-theme="dark"] .author-profile .author__name {
    color: #cf6a51;
}

.author-profile .author__bio {
    color: var(--sidebar-text, #4a5568);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

[data-theme="dark"] .author-profile .author__bio {
    color: #cf6a51;
}

/* 演讲内容样式 */
.talks-page-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

.cv-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 20px;
    border-bottom: 2px solid #cf6a51;
    position: relative;
}

.cv-header h1 {
    color: #cf6a51;
    margin-bottom: 10px;
    font-size: 2.2rem;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.talks-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: -40px;
}

.talk-item {
    display: flex;
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.talk-item:last-child {
    border-bottom: none;
}

.talk-number {
    font-weight: bold;
    color: #cf6a51;
    min-width: 24px;
    text-align: right;
    padding-top: 2px;
    font-size: 1.1rem;
}

.talk-content {
    flex: 1;
}

.talk-title {
    font-size: 1.25rem;
    margin: 0 0 15px 0;
    color: #222;
}

.talk-title a {
    color: #cf6a51;
    text-decoration: none;
    border-bottom: 1px dotted #cf6a51;
    transition: all 0.2s;
}

.talk-title a:hover {
    color: #cf583a;
    border-bottom: 1px solid #cf6a51;
}

.talk-meta {
    color: #000;
    font-size: 0.95rem;
    margin-bottom: 15px;
    padding-left: 5px;
    border-left: 2px solid #f0e6e3;
    line-height: 1.5;
}

.talk-type {
    font-weight: 600;
    color: #cf6a51;
}

.talk-organizer {
    font-style: italic;
}

.talk-excerpt {
    color: #000000;
    font-size: 0.98rem;
    line-height: 1.7;
}

.talk-excerpt img {
    border-radius: 6px;
    user-select: none;
}

.talk-content img:hover {
    transform: translateY(-3px);
    user-select: none;
}

.talk-excerpt p {
    margin: 10px 0;
    user-select: none;
}

.talk-excerpt strong {
    color: #cf6a51;
    user-select: none;
}

/* 响应式调整 */
@media (min-width: 768px) and (max-width: 1024px) {
    .talks-page-wrapper {
        margin-left: 30px !important;
        padding-right: 1.5rem;
    }
}

@media (min-width: 1025px) {
    .talks-page-wrapper {
        margin-left: 10px !important;
        margin-right: auto !important;
    }
}

@media (max-width: 768px) {
    .talks-page-wrapper {
        padding: 20px 5%;
    }

    .cv-header h1 {
        font-size: 1.8rem;
    }

    .talk-item {
        flex-direction: column;
        gap: 8px;
    }

    .talk-number {
        text-align: left;
        padding-bottom: 5px;
    }

    .talk-excerpt img {
        width: 100% !important;
        margin: 10px 0;
    }
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    .cv-header {
        border-bottom-color: transparent !important;
    }

    .cv-header h1 {
        color: #ffb08a;
    }

    .cv-header h1::after {
        background-color: #ffb08a !important;
    }

    .talk-number,
    .talk-type,
    .talk-excerpt strong {
        color: #ffb08a;
    }

    .talk-title a {
        color: #ffb08a;
    }

    .talk-title a:hover {
        color: #ff9466;
        border-bottom-color: #ffb08a;
    }

    .talk-meta {
        border-left-color: #3a2e2b;
    }

    .talk-excerpt img {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}

/* 加载指示器样式 */
.loading-indicator {
    text-align: center;
    padding: 40px 0;
    color: #666;
    font-style: italic;
}
/* 页脚优化 */
.page__footer {
    margin-top: 3rem;
    padding: 0 0;
    background-color: var(--sidebar-bg);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
}

[data-theme="dark"] .page__footer {
    background-color: transparent !important;
    color: var(--text-light);
}
html[data-theme="dark"] .page__footer-copyright {
    color: #cbd5e0 !important;
}
html[data-theme="dark"] .talk-meta {
    /*text-align: center;*/
    /*padding: 40px 0;*/
    color: #666;
    font-style: italic;
}

html[data-theme="dark"] .talk-excerpt {
    color: #ffff;
    font-size: 0.98rem;
    line-height: 1.7;
}

.page__footer-copyright {
    font-size: 0.95rem;
    color: #4a5568;
}


[data-theme="dark"] .author-profile .author__bio {
    color: #cf6a51;
}

html[data-theme="dark"] .masthead {
    background-color: transparent !important;
}

html[data-theme="dark"] .visible-links {
    background-color: transparent !important;
}
html[data-theme="dark"] .persist {
    background-color: transparent !important;
}
html[data-theme="dark"] .masthead__menu-item {
    background-color: transparent !important;
}

html[data-theme="dark"] .sidebar-inner {
    background-color: transparent !important;
}

:root[data-theme="dark"] {
    --bg-color: transparent !important;
    --text-color: #e0e0e0;
}

.author__urls.social-icons a:hover {
    background-color: transparent !important;
    color: #3182ce;
    padding-left: 0.8rem;
    transform: translateY(-2px);
}

[data-theme="dark"] .author__urls.social-icons a:hover {
    color: #ffb08a !important;
}

[data-theme="dark"] .author__urls.social-icons a {
    background-color: transparent !important;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

[data-theme="dark"] .cv-header h1 {
    color: var(--primary-light, #ffb08a);
}

[data-theme="dark"] .visible-links a {
    color: var(--secondary-color-light, #ffb08a);
}

[data-theme="dark"] .sidebar-nav a { /* 侧边栏链接文本 */
    color: #cbd5e0;
}
html[data-theme="dark"],
html[data-theme="dark"] body {
    background-color: transparent !important;
}


html[data-theme="dark"] .dark-mode-active {
    background-color: transparent !important;
}

html[data-theme="light"] .masthead {
    background-color: #fff !important;
}