/* 清华紫色主题配色 */
:root {
    --tsinghua-purple: #82318E;
    --tsinghua-purple-dark: #6D2077;
    --tsinghua-purple-light: #9D4EAA;
    --background-white: #FFFFFF;
    --background-gray: #F5F5F7;
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --border-color: #D2D2D7;
    --shadow-light: rgba(130, 49, 142, 0.1);
    --shadow-medium: rgba(130, 49, 142, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    background: linear-gradient(135deg, var(--background-gray) 0%, var(--background-white) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden; /* 防止横向滚动 */
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
    -webkit-touch-callout: none; /* 禁用iOS长按弹出菜单 */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    padding: 30px 0 25px;
    text-align: center;
    background: linear-gradient(135deg, var(--tsinghua-purple) 0%, var(--tsinghua-purple-dark) 100%);
    margin: 0 -20px 60px -20px;
    color: white;
    box-shadow: 0 4px 20px var(--shadow-medium);
    position: relative;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.title {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    font-weight: 300;
    margin-bottom: 0;
}

/* 视图切换开关 */
.view-toggle-container {
    position: absolute;
    top: 20px;
    right: 30px;
}

.view-toggle-btn {
    position: relative;
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.view-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

.view-toggle-btn:active {
    transform: scale(0.95);
}

.toggle-icon {
    font-size: 1.5em;
    position: absolute;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
}

.toggle-icon.active {
    opacity: 1;
    transform: scale(1);
}

.timeline-icon {
    /* 时间线图标 */
}

.calendar-icon {
    /* 月历图标 */
}

/* 主内容区域 */
.main-content {
    padding-bottom: 100px;
    position: relative;
}

/* 视图内容切换 */
.view-content {
    display: none;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.view-content.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    animation: fadeIn 0.5s ease;
}

/* 时间线样式 - 横向蛇形设计 */
.timeline-container {
    position: relative;
    padding: 60px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 确保隐藏的时间线视图不占空间 */
.timeline-container:not(.active) {
    height: 0;
    padding: 0;
    overflow: hidden;
}

.timeline-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    position: relative;
    justify-content: center; /* 居中对齐 */
}

.timeline-item {
    position: relative;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 日期节点包装器 */
.timeline-date-wrapper {
    position: relative;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 节点之间的连接线 */
.timeline-date-wrapper::before {
    content: '';
    position: absolute;
    height: 3px;
    background: var(--tsinghua-purple-light);
    top: 50%;
    transform: translateY(-50%);
    z-index: 0;
}

/* 横向连接线（从左到右） */
.timeline-item:not(:last-child) .timeline-date-wrapper::before {
    left: 50%;
    right: -20px;
}

/* 第一个节点没有左侧连接线 */
.timeline-item:first-child .timeline-date-wrapper::before {
    display: none;
}

/* 日期节点圆圈 */
.timeline-dot {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--tsinghua-purple), var(--tsinghua-purple-dark));
    border: 4px solid var(--background-white);
    border-radius: 50%;
    box-shadow: 0 4px 20px var(--shadow-medium);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    user-select: none; /* 防止文字被选中 */
}

/* 最新的节点（第一个）更大更醒目 */
.timeline-item:first-child .timeline-dot {
    width: 90px;
    height: 90px;
    border-width: 5px;
    box-shadow: 0 6px 30px var(--shadow-medium), 0 0 0 8px rgba(130, 49, 142, 0.1);
    animation: pulse 2s ease-in-out infinite;
}

.timeline-item:first-child .timeline-date-month {
    font-size: 0.8em;
}

.timeline-item:first-child .timeline-date-day {
    font-size: 1.6em;
}

/* 最新节点的脉动动画 */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 6px 30px var(--shadow-medium), 0 0 0 8px rgba(130, 49, 142, 0.1);
    }
    50% {
        box-shadow: 0 8px 35px var(--shadow-medium), 0 0 0 12px rgba(130, 49, 142, 0.2);
    }
}

.timeline-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 8px 30px var(--shadow-medium);
    background: linear-gradient(135deg, var(--tsinghua-purple-dark), var(--tsinghua-purple));
}

/* 最新节点悬停时的效果 */
.timeline-item:first-child .timeline-dot:hover {
    transform: scale(1.15);
    animation: none; /* 悬停时停止脉动 */
}

/* 点击时的反馈效果 */
.timeline-dot:active {
    transform: scale(1.1);
    box-shadow: 0 4px 20px var(--shadow-medium);
}

.timeline-item:first-child .timeline-dot:active {
    transform: scale(1.05);
}

.timeline-date-month {
    font-size: 0.7em;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 2px;
}

.timeline-date-day {
    font-size: 1.4em;
    color: white;
    font-weight: 700;
    line-height: 1;
}

/* 悬停卡片 */
.timeline-content {
    position: absolute;
    width: 300px;
    padding: 20px;
    background: var(--background-white);
    border-radius: 12px;
    box-shadow: 0 8px 30px var(--shadow-medium);
    border: 2px solid var(--tsinghua-purple);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 100;
    top: 100%;
    left: 50%;
    margin-left: -150px;
    margin-top: 10px;
}

/* 最新节点的卡片更大 */
.timeline-item:first-child .timeline-content {
    width: 350px;
    margin-left: -175px;
    padding: 25px;
    border-width: 3px;
}

.timeline-item:first-child .timeline-title {
    font-size: 1.3em;
}

.timeline-item:first-child .timeline-summary {
    font-size: 1em;
}

/* 悬停时显示卡片 */
.timeline-item:hover .timeline-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.timeline-content:hover {
    border-color: var(--tsinghua-purple-dark);
    box-shadow: 0 12px 40px var(--shadow-medium);
}

.timeline-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--tsinghua-purple);
    margin-bottom: 8px;
    line-height: 1.3;
}

.timeline-summary {
    color: var(--text-secondary);
    font-size: 0.9em;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.timeline-view-detail {
    display: inline-flex;
    align-items: center;
    font-size: 0.85em;
    color: var(--tsinghua-purple);
    font-weight: 600;
    margin-top: 8px;
}

.timeline-view-detail::after {
    content: '→';
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.timeline-content:hover .timeline-view-detail::after {
    transform: translateX(3px);
}

/* 卡片箭头指示器（向上指向节点） */
.timeline-content::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent var(--tsinghua-purple) transparent;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--background-white);
    border-radius: 16px;
    max-width: 1400px;
    width: 95%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
    z-index: 1001;
}

.modal-content-large {
    max-width: 1600px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--background-gray);
    color: var(--text-primary);
    font-size: 1.5em;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: var(--tsinghua-purple);
    color: white;
    transform: rotate(90deg);
}

.modal-header {
    padding: 35px 70px 18px 35px; /* 增加右侧padding，为关闭按钮留出空间 */
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    font-size: 2em;
    color: var(--tsinghua-purple);
    margin-bottom: 10px;
    padding-right: 10px; /* 额外的右侧padding确保不被遮挡 */
}

.modal-date {
    color: var(--text-secondary);
    font-size: 1.1em;
}

.modal-body {
    padding: 25px 35px 35px;
    font-size: 16px;
    line-height: 1.8;
}

/* ========== 内容排版优化 ========== */

/* 标题层级 */
.modal-body h1 {
    color: var(--tsinghua-purple);
    font-size: 2em;
    font-weight: 700;
    margin: 35px 0 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--tsinghua-purple);
    line-height: 1.3;
}

.modal-body h1:first-child {
    margin-top: 0;
}

.modal-body h2 {
    color: var(--tsinghua-purple);
    font-size: 1.6em;
    font-weight: 600;
    margin: 30px 0 18px;
    padding-left: 15px;
    border-left: 5px solid var(--tsinghua-purple);
    line-height: 1.4;
}

.modal-body h3 {
    color: var(--tsinghua-purple-dark);
    font-size: 1.3em;
    font-weight: 600;
    margin: 25px 0 15px;
    padding-left: 12px;
    border-left: 3px solid var(--tsinghua-purple-light);
    line-height: 1.4;
}

/* 段落 */
.modal-body p {
    margin: 18px 0;
    line-height: 1.9;
    color: var(--text-primary);
    text-align: justify;
}

.modal-body p:empty {
    margin: 10px 0;
}

/* 强调文本 */
.modal-body strong {
    color: var(--tsinghua-purple-dark);
    font-weight: 600;
}

.modal-body em {
    color: var(--text-secondary);
    font-style: italic;
}

/* 列表优化 */
.modal-body ul, .modal-body ol {
    margin: 20px 0;
    padding-left: 35px;
}

.modal-body ul {
    list-style-type: none;
}

.modal-body ul li {
    position: relative;
    margin: 12px 0;
    padding-left: 10px;
    line-height: 1.8;
}

.modal-body ul li::before {
    content: '▸';
    position: absolute;
    left: -20px;
    color: var(--tsinghua-purple);
    font-weight: bold;
}

.modal-body ol {
    counter-reset: list-counter;
}

.modal-body ol li {
    position: relative;
    margin: 12px 0;
    padding-left: 10px;
    line-height: 1.8;
    counter-increment: list-counter;
}

.modal-body ol li::marker {
    color: var(--tsinghua-purple);
    font-weight: 600;
}

/* 嵌套列表 */
.modal-body ul ul, .modal-body ol ol, .modal-body ul ol, .modal-body ol ul {
    margin: 8px 0;
}

/* 图片优化 - 缩略图模式 */
.modal-body img {
    max-width: 400px; /* 限制缩略图最大宽度 */
    max-height: 300px; /* 限制缩略图最大高度 */
    width: auto;
    height: auto;
    border-radius: 12px;
    margin: 25px auto;
    display: block;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer; /* 指针变为手型，提示可点击 */
    object-fit: contain; /* 保持图片比例 */
}

.modal-body img:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(130, 49, 142, 0.3);
    border-color: var(--tsinghua-purple-light);
}

/* 图片点击提示 */
.modal-body img::after {
    content: '🔍 点击放大';
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(130, 49, 142, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* 图片容器（用于显示提示） */
.modal-body .image-preview-wrapper {
    position: relative;
    display: inline-block;
    margin: 25px auto;
    text-align: center;
}

.modal-body .image-preview-wrapper img {
    margin: 0;
}

.modal-body .image-preview-wrapper:hover::after {
    content: '🔍 点击放大查看';
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(130, 49, 142, 0.95);
    color: white;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* 代码块基础样式 */
.modal-body pre {
    background: #2d2d2d;
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid #3d3d3d;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.modal-body code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

/* 行内代码 */
.modal-body p code, 
.modal-body li code {
    background: #f5f5f7;
    color: #c7254e;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.88em;
    border: 1px solid #e1e1e3;
}

/* 引用块 */
.modal-body blockquote {
    margin: 25px 0;
    padding: 20px 25px;
    background: linear-gradient(90deg, rgba(130, 49, 142, 0.05) 0%, rgba(130, 49, 142, 0.02) 100%);
    border-left: 4px solid var(--tsinghua-purple);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.modal-body blockquote p {
    margin: 8px 0;
}

/* 水平分割线 */
.modal-body hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 30px 0;
}

/* 表格样式 */
.modal-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px auto; /* 表格居中 */
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.modal-body th {
    background: var(--tsinghua-purple);
    color: white;
    padding: 12px;
    text-align: center; /* 表头文本居中 */
    font-weight: 600;
}

.modal-body td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    text-align: center; /* 单元格文本居中 */
}

.modal-body tr:last-child td {
    border-bottom: none;
}

.modal-body tr:hover {
    background: var(--background-gray);
}

/* ========== 附件样式优化 ========== */
.attachment-list {
    margin: 30px 0;
    padding: 25px;
    background: linear-gradient(135deg, #F0F4FF 0%, #F7F9FF 100%);
    border-radius: 16px;
    border: 2px solid #B8C9FF;
    box-shadow: 0 4px 16px rgba(184, 201, 255, 0.15);
}

.attachment-list h3 {
    color: var(--tsinghua-purple);
    margin: 0 0 20px 0;
    font-size: 1.4em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.attachment-item {
    display: inline-flex;
    align-items: center;
    padding: 14px 22px;
    background: white;
    border: 2px solid #E8EEFF;
    border-radius: 10px;
    margin: 0 10px 10px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.attachment-item:hover {
    background: linear-gradient(135deg, var(--tsinghua-purple), var(--tsinghua-purple-dark));
    color: white;
    border-color: var(--tsinghua-purple);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--shadow-medium);
}

.attachment-icon {
    margin-right: 10px;
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.attachment-item:hover .attachment-icon {
    transform: scale(1.2);
}

/* ========== 参考文献样式优化 ========== */
.reference-list-section {
    margin: 35px 0;
    padding: 25px;
    background: linear-gradient(135deg, #FFF9E6 0%, #FFFAEF 100%);
    border-radius: 16px;
    border: 2px solid #FFD700;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.15);
}

.reference-list-section h3 {
    color: var(--tsinghua-purple);
    margin: 0 0 20px 0;
    font-size: 1.4em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reference-list-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.reference-list-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: white;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.reference-list-item:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(130, 49, 142, 0.15);
    border-color: var(--tsinghua-purple-light);
}

.reference-list-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--tsinghua-purple), var(--tsinghua-purple-dark));
    color: white;
    font-weight: 700;
    border-radius: 50%;
    margin-right: 15px;
    font-size: 1em;
    box-shadow: 0 2px 8px rgba(130, 49, 142, 0.3);
    flex-shrink: 0;
}

.reference-list-link {
    flex: 1;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    font-size: 1.05em;
    font-weight: 500;
}

.reference-list-link:hover {
    color: var(--tsinghua-purple);
}

/* 内容中的参考文献标记优化 */
.reference-tag {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, var(--tsinghua-purple), var(--tsinghua-purple-dark));
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.92em;
    font-weight: 700;
    cursor: pointer;
    margin: 0 3px;
    text-decoration: none;
    transition: all 0.3s ease;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(130, 49, 142, 0.25);
    user-select: none;
}

.reference-tag:hover {
    background: linear-gradient(135deg, var(--tsinghua-purple-dark), var(--tsinghua-purple));
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 4px 12px rgba(130, 49, 142, 0.4);
}

.reference-tag:active {
    transform: translateY(0) scale(1.02);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.2em;
}

/* ========== 月历视图样式 ========== */
.calendar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 40px 20px;
}

/* 确保隐藏的月历视图不占空间 */
.calendar-container:not(.active) {
    height: 0;
    padding: 0;
    overflow: hidden;
}

/* 月历控制栏 */
.calendar-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 0 20px;
}

.calendar-month-title {
    font-size: 2em;
    font-weight: 700;
    color: var(--tsinghua-purple);
    text-align: center;
    flex: 1;
}

.calendar-nav-btn {
    width: 50px;
    height: 50px;
    border: none;
    background: linear-gradient(135deg, var(--tsinghua-purple), var(--tsinghua-purple-dark));
    color: white;
    font-size: 1.5em;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow-medium);
    background: linear-gradient(135deg, var(--tsinghua-purple-dark), var(--tsinghua-purple));
}

.calendar-nav-btn:active {
    transform: scale(0.95);
}

/* 月历网格 */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--shadow-light);
    width: 100%;
    max-width: 100%;
    overflow: hidden; /* 防止内容溢出 */
}

/* 星期标题行 */
.calendar-weekday {
    text-align: center;
    font-weight: 600;
    color: var(--tsinghua-purple);
    padding: 15px;
    font-size: 1.1em;
    border-bottom: 2px solid var(--border-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 日期单元格 */
.calendar-day {
    aspect-ratio: 1;
    min-height: 100px;
    max-height: 140px; /* 限制最大高度，防止内容撑开 */
    background: var(--background-gray);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
    cursor: default;
    border: 2px solid transparent;
    overflow: hidden; /* 防止文字溢出 */
    word-wrap: break-word;
}

.calendar-day-number {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* 其他月份的日期 */
.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.other-month .calendar-day-number {
    color: var(--text-secondary);
}

/* 今天的日期 */
.calendar-day.today {
    background: linear-gradient(135deg, rgba(130, 49, 142, 0.1), rgba(130, 49, 142, 0.05));
    border-color: var(--tsinghua-purple-light);
}

.calendar-day.today .calendar-day-number {
    color: var(--tsinghua-purple);
    font-weight: 700;
}

/* 有日志的日期 */
.calendar-day.has-log {
    background: linear-gradient(135deg, var(--tsinghua-purple), var(--tsinghua-purple-dark));
    cursor: pointer;
    border-color: var(--tsinghua-purple-dark);
}

.calendar-day.has-log .calendar-day-number {
    color: white;
    font-weight: 700;
}

.calendar-day.has-log:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-medium);
    border-color: var(--tsinghua-purple);
}

.calendar-day.has-log:active {
    transform: translateY(-2px);
}

/* 日志内容预览 */
.calendar-log-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow: hidden;
}

.calendar-log-title {
    font-size: 0.85em;
    font-weight: 600;
    color: white;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 日志指示徽章 */
.calendar-log-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: pulse-badge 2s ease-in-out infinite;
}

/* 当日的呼吸灯显示为荧光绿 */
.calendar-day.today.has-log .calendar-log-badge {
    background: #39FF14;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.9), 0 0 25px rgba(57, 255, 20, 0.6);
    animation: pulse-badge-green 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes pulse-badge-green {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 15px rgba(57, 255, 20, 0.9), 0 0 25px rgba(57, 255, 20, 0.6);
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
        box-shadow: 0 0 25px rgba(57, 255, 20, 1), 0 0 40px rgba(57, 255, 20, 0.8), 0 0 55px rgba(57, 255, 20, 0.5);
    }
}

/* 点击提示 */
.calendar-day.has-log::after {
    content: '点击查看';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.8);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.calendar-day.has-log:hover::after {
    opacity: 1;
}

/* 月历空状态 */
.calendar-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

/* 响应式设计 - 大屏幕优化 */
@media (min-width: 1920px) {
    /* 超大屏幕优化 */
    .modal-content {
        max-width: 1800px;
        width: 90%;
        max-height: 94vh;
    }
    
    .modal-content-large {
        max-width: 2000px;
    }
    
    .modal-body {
        padding: 40px 60px 50px;
        font-size: 18px;
    }
    
    .modal-header h2 {
        font-size: 2.5em;
    }
}

/* 中等屏幕优化（平板横屏） */
@media (min-width: 769px) and (max-width: 1200px) {
    .modal-content {
        max-width: 95%;
        width: 95%;
        max-height: 92vh;
    }
    
    .modal-body {
        padding: 30px 35px 35px;
    }
}

/* 响应式设计 - 小屏幕 */
@media (max-width: 768px) {
    /* 容器调整 */
    .container {
        padding: 0 10px;
    }

    /* 头部 */
    .header {
        margin: 0 -10px 40px -10px;
        padding: 25px 0 20px;
    }

    .title {
        font-size: 1.8em;
    }

    .subtitle {
        font-size: 0.95em;
        margin-bottom: 0;
    }

    /* 视图切换开关 */
    .view-toggle-container {
        top: 15px;
        right: 15px;
    }

    .view-toggle-btn {
        width: 44px;
        height: 44px;
    }

    .toggle-icon {
        font-size: 1.3em;
    }

    /* 时间线 */
    .timeline-container {
        padding: 40px 5px;
    }

    .timeline-wrapper {
        justify-content: center;
    }

    .timeline-date-wrapper {
        padding: 10px;
    }

    .timeline-dot {
        width: 60px;
        height: 60px;
    }

    .timeline-date-month {
        font-size: 0.6em;
    }

    .timeline-date-day {
        font-size: 1.2em;
    }

    .timeline-content {
        width: 260px;
        margin-left: -130px;
        padding: 15px;
    }
    
    .timeline-item:first-child .timeline-content {
        width: 280px;
        margin-left: -140px;
        padding: 18px;
    }

    /* 月历视图 */
    .calendar-container {
        padding: 20px 5px;
    }

    .calendar-controls {
        padding: 0 5px;
        margin-bottom: 20px;
        gap: 10px;
    }

    .calendar-month-title {
        font-size: 1.3em;
    }

    .calendar-nav-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2em;
        flex-shrink: 0;
        /* iOS推荐的最小触摸目标 */
    }

    .calendar-grid {
        gap: 4px;
        padding: 10px;
    }

    .calendar-weekday {
        padding: 8px 2px;
        font-size: 0.85em;
    }

    .calendar-day {
        min-height: 60px;
        max-height: 60px; /* 固定高度，防止内容撑开造成覆盖 */
        padding: 5px;
    }
    
    .calendar-day.has-log {
        min-height: 60px;
        max-height: 60px; /* 固定高度，防止内容撑开造成覆盖 */
    }

    .calendar-day-number {
        font-size: 0.9em;
        margin-bottom: 4px;
    }

    .calendar-log-title {
        font-size: 0.65em;
        -webkit-line-clamp: 1;
    }

    .calendar-day.has-log::after {
        display: none;
    }

    .calendar-log-badge {
        width: 6px;
        height: 6px;
        top: 4px;
        right: 4px;
    }

    /* 弹窗 */
    .modal-content {
        width: 98%;
        max-height: 94vh;
    }

    .modal-header {
        padding: 30px 60px 15px 20px;
    }

    .modal-header h2 {
        font-size: 1.5em;
        padding-right: 10px;
    }

    .modal-body {
        padding: 20px;
        font-size: 15px;
    }

    /* 移动端标题优化 */
    .modal-body h1 {
        font-size: 1.6em;
        margin: 25px 0 15px;
        padding-bottom: 12px;
    }

    .modal-body h2 {
        font-size: 1.4em;
        margin: 20px 0 15px;
        padding-left: 12px;
    }

    .modal-body h3 {
        font-size: 1.2em;
        margin: 18px 0 12px;
        padding-left: 10px;
    }

    /* 移动端列表优化 */
    .modal-body ul, .modal-body ol {
        padding-left: 25px;
    }

    .modal-body ul li::before {
        left: -18px;
    }

    /* 移动端附件和参考文献优化 */
    .attachment-list,
    .reference-list-section {
        margin: 25px 0;
        padding: 18px;
    }

    .attachment-list h3,
    .reference-list-section h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }

    .attachment-item {
        padding: 12px 18px;
        margin: 0 8px 8px 0;
        font-size: 0.95em;
    }

    .reference-list-item {
        padding: 14px;
    }

    .reference-list-number {
        min-width: 36px;
        height: 36px;
        margin-right: 12px;
        font-size: 0.95em;
    }

    .reference-list-link {
        font-size: 1em;
    }

    /* 移动端代码块优化 */
    .highlighted-code-block,
    .modal-body pre {
        margin: 20px -5px;
        border-radius: 8px;
    }

    .highlighted-code-block pre {
        padding: 18px 15px;
        padding-top: 45px;
    }

    .code-language-label {
        top: 10px;
        right: 10px;
        padding: 3px 10px;
        font-size: 10px;
    }

    /* 移动端表格优化 */
    .modal-body table {
        font-size: 0.9em;
    }

    .modal-body th,
    .modal-body td {
        padding: 10px 8px;
    }
    
    /* 确保弹窗内的图片和代码块不溢出 */
    .modal-body img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    .modal-body pre {
        overflow-x: auto;
        max-width: 100%;
    }
    
    .modal-body code {
        word-break: break-word;
    }
}

/* 更小屏幕的适配 (小于480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 5px;
    }

    .header {
        margin: 0 -5px 30px -5px;
        padding: 20px 0 15px;
    }

    .title {
        font-size: 1.5em;
    }

    .subtitle {
        font-size: 0.85em;
    }

    .view-toggle-container {
        top: 12px;
        right: 12px;
    }

    .view-toggle-btn {
        width: 40px;
        height: 40px;
    }

    .toggle-icon {
        font-size: 1.2em;
    }

    /* 月历视图 - 超小屏幕 */
    .calendar-container {
        padding: 15px 0;
    }

    .calendar-controls {
        margin-bottom: 15px;
    }

    .calendar-month-title {
        font-size: 1.1em;
    }

    .calendar-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 1em;
    }

    .calendar-grid {
        gap: 2px;
        padding: 8px;
        border-radius: 12px;
    }

    .calendar-weekday {
        padding: 6px 1px;
        font-size: 0.75em;
        border-bottom: 1px solid var(--border-color);
    }

    .calendar-day {
        min-height: 50px;
        max-height: 50px; /* 固定高度，防止内容撑开造成覆盖 */
        padding: 4px;
        border-radius: 8px;
    }
    
    .calendar-day.has-log {
        min-height: 50px;
        max-height: 50px; /* 固定高度，防止内容撑开造成覆盖 */
    }

    .calendar-day-number {
        font-size: 0.85em;
        margin-bottom: 2px;
    }

    .calendar-log-title {
        font-size: 0.6em;
        line-height: 1.2;
    }

    .calendar-log-badge {
        width: 5px;
        height: 5px;
        top: 3px;
        right: 3px;
    }

    /* 时间线 - 超小屏幕 */
    .timeline-container {
        padding: 30px 3px;
    }

    .timeline-dot {
        width: 55px;
        height: 55px;
    }

    .timeline-content {
        width: calc(100vw - 40px);
        max-width: 280px;
        left: 50%;
        margin-left: calc(-50vw + 20px);
        transform: translateX(calc(50vw - 50%));
        padding: 15px;
    }
    
    .timeline-item:first-child .timeline-content {
        width: calc(100vw - 40px);
        max-width: 300px;
    }
    
    /* 确保卡片箭头在小屏幕上居中 */
    .timeline-content::before {
        left: 50%;
        transform: translateX(-50%);
    }

    /* 弹窗 */
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 96vh;
        border-radius: 12px;
        margin: 0 8px;
    }

    .modal-header {
        padding: 25px 55px 10px 15px;
    }

    .modal-header h2 {
        font-size: 1.3em;
        padding-right: 5px;
    }

    .modal-body {
        padding: 15px;
        font-size: 14px;
    }

    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.3em;
        top: 15px;
        right: 15px;
    }

    /* 超小屏幕标题优化 */
    .modal-body h1 {
        font-size: 1.4em;
        margin: 20px 0 12px;
        padding-bottom: 10px;
        border-bottom-width: 2px;
    }

    .modal-body h2 {
        font-size: 1.25em;
        margin: 18px 0 12px;
        padding-left: 10px;
        border-left-width: 4px;
    }

    .modal-body h3 {
        font-size: 1.1em;
        margin: 15px 0 10px;
        padding-left: 8px;
        border-left-width: 2px;
    }

    /* 超小屏幕段落优化 */
    .modal-body p {
        margin: 15px 0;
        line-height: 1.7;
    }

    /* 超小屏幕列表优化 */
    .modal-body ul, .modal-body ol {
        padding-left: 20px;
        margin: 15px 0;
    }

    .modal-body ul li {
        margin: 10px 0;
        font-size: 0.95em;
    }

    .modal-body ul li::before {
        left: -16px;
        font-size: 0.9em;
    }

    /* 超小屏幕附件和参考文献优化 */
    .attachment-list,
    .reference-list-section {
        margin: 20px -5px;
        padding: 15px;
        border-radius: 12px;
    }

    .attachment-list h3,
    .reference-list-section h3 {
        font-size: 1.1em;
        margin-bottom: 12px;
    }

    .attachment-item {
        display: block;
        margin: 0 0 8px 0;
        padding: 12px 16px;
        text-align: center;
        font-size: 0.9em;
    }

    .reference-list-item {
        padding: 12px;
        flex-wrap: wrap;
    }

    .reference-list-number {
        min-width: 32px;
        height: 32px;
        margin-right: 10px;
        font-size: 0.9em;
    }

    .reference-list-link {
        font-size: 0.95em;
    }

    /* 超小屏幕代码块优化 */
    .highlighted-code-block,
    .modal-body pre {
        margin: 18px -8px;
        border-radius: 6px;
    }

    .highlighted-code-block pre {
        padding: 15px 12px;
        padding-top: 40px;
    }

    .modal-body pre code {
        font-size: 12px;
        line-height: 1.6;
    }

    .code-language-label {
        top: 8px;
        right: 8px;
        padding: 3px 8px;
        font-size: 9px;
    }

    /* 超小屏幕图片优化 */
    .modal-body img {
        margin: 20px auto;
        border-radius: 8px;
    }

    /* 超小屏幕表格优化 */
    .modal-body table {
        font-size: 0.85em;
        margin: 20px -5px;
    }

    .modal-body th,
    .modal-body td {
        padding: 8px 6px;
    }

    /* 超小屏幕引用块优化 */
    .modal-body blockquote {
        margin: 20px -5px;
        padding: 15px 18px;
        border-left-width: 3px;
    }

    /* 超小屏幕公式优化 */
    .modal-body .katex-inline-formula,
    .modal-body .katex-display-formula {
        font-size: 0.95em;
    }
    
    /* 禁用不必要的元素文本选择 */
    .view-toggle-btn,
    .calendar-nav-btn,
    .calendar-day,
    .timeline-dot {
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* 提升触摸滚动性能 */
    .modal-content,
    .modal-body {
        -webkit-overflow-scrolling: touch;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--tsinghua-purple-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tsinghua-purple);
}

/* 加载指示器样式 */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80vh;
    gap: 20px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--tsinghua-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-primary);
    animation: pulse 1.5s ease-in-out infinite;
}

.loading-tip {
    font-size: 0.95em;
    color: var(--text-secondary);
    margin-top: -10px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* PPT选项弹窗样式 */
.ppt-options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 0;
}

.ppt-option-btn {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--background-gray);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.ppt-option-btn:hover {
    background: var(--tsinghua-purple);
    border-color: var(--tsinghua-purple);
    transform: translateX(5px);
    box-shadow: 0 4px 20px var(--shadow-medium);
}

.ppt-option-btn:hover .option-text {
    color: white;
}

.ppt-option-btn:hover .option-text small {
    color: rgba(255, 255, 255, 0.9);
}

.option-icon {
    font-size: 2em;
    min-width: 50px;
    text-align: center;
}

.option-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--text-primary);
}

.option-text strong {
    font-size: 1.1em;
    font-weight: 600;
}

.option-text small {
    color: var(--text-secondary);
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .ppt-option-btn {
        padding: 15px;
        gap: 15px;
    }
    
    .option-icon {
        font-size: 1.5em;
        min-width: 40px;
    }
    
    .option-text strong {
        font-size: 1em;
    }
    
    .option-text small {
        font-size: 0.85em;
    }
}

/* ========== LaTeX公式样式 ========== */

/* 行内公式 */
.katex-inline-formula {
    display: inline-block !important;
    margin: 0 3px;
    vertical-align: middle;
}

/* 独立公式 */
.katex-display-formula {
    display: block !important;
    text-align: center;
    margin: 2px 0;  /* 最小间距 */
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

/* 公式容器样式 */
.katex-display-formula .katex {
    display: inline-block;
}

/* 在详情弹窗中的公式样式 */
.modal-body .katex-inline-formula,
.modal-body .katex-display-formula {
    font-size: 1.1em;
}

/* 移动端公式适配 */
@media (max-width: 768px) {
    .katex-display-formula {
        font-size: 0.9em;
    }
    
    .modal-body .katex-inline-formula,
    .modal-body .katex-display-formula {
        font-size: 1em;
    }
}

/* ========== 代码块样式优化 - IDE风格 ========== */

/* 自定义代码块容器 */
.highlighted-code-block {
    position: relative;
    background: #2d2d2d;
    border-radius: 12px;
    padding: 0;
    margin: 25px 0;
    overflow: hidden;
    border: 1px solid #3d3d3d;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* 代码块顶部标签 */
.code-language-label {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #999;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 1;
    backdrop-filter: blur(5px);
}

/* 代码块内的pre */
.highlighted-code-block pre {
    margin: 0;
    padding: 20px;
    padding-top: 50px; /* 为语言标签留空间 */
    background: transparent;
    border: none;
    box-shadow: none;
}

/* 普通代码块 */
pre {
    background-color: #2d2d2d;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    overflow-x: auto;
    border: 1px solid #3d3d3d;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

pre code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.7;
    color: #f8f8f2;
    display: block;
    white-space: pre;
}

/* 代码块滚动条美化 */
pre::-webkit-scrollbar {
    height: 8px;
}

pre::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

pre::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Prism语法高亮增强 */
pre code.language-python,
pre code.language-javascript,
pre code.language-java,
pre code.language-c,
pre code.language-cpp,
pre code.language-bash,
pre code.language-sql,
pre code.language-html,
pre code.language-css {
    background: transparent;
}

/* 确保Prism的token样式生效 */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #999;
}

.token.punctuation {
    color: #ccc;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #f92672;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #a6e22e;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #66d9ef;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #66d9ef;
}

.token.function,
.token.class-name {
    color: #e6db74;
}

.token.regex,
.token.important,
.token.variable {
    color: #fd971f;
}

/* 弹窗中的代码块样式 */
.modal-body pre {
    background-color: #2d2d2d;
    max-width: 100%;
}

/* 移动端代码块适配 */
@media (max-width: 768px) {
    pre {
        padding: 12px;
        margin: 12px 0;
        font-size: 12px;
    }
    
    pre code {
        font-size: 12px;
    }
}

/* ========== 内容分区辅助样式 ========== */

/* 内容区块 */
.content-section {
    margin: 30px 0;
    padding: 25px;
    background: #FAFAFA;
    border-radius: 12px;
    border-left: 4px solid var(--tsinghua-purple-light);
}

/* 高亮信息框 */
.info-box {
    margin: 25px 0;
    padding: 20px 25px;
    background: linear-gradient(135deg, #E3F2FD 0%, #F1F8FF 100%);
    border-left: 5px solid #2196F3;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.1);
}

.info-box.warning {
    background: linear-gradient(135deg, #FFF3E0 0%, #FFF8F0 100%);
    border-left-color: #FF9800;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.1);
}

.info-box.success {
    background: linear-gradient(135deg, #E8F5E9 0%, #F1F8F1 100%);
    border-left-color: #4CAF50;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.1);
}

.info-box.error {
    background: linear-gradient(135deg, #FFEBEE 0%, #FFF5F5 100%);
    border-left-color: #F44336;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.1);
}

/* 关键点标注 */
.key-point {
    display: inline-block;
    background: linear-gradient(135deg, #FFF9C4 0%, #FFFDE7 100%);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    border: 1px solid #FDD835;
}

/* 文本对齐工具类 */
.text-center {
    text-align: center;
}

.text-justify {
    text-align: justify;
}

/* 间距工具类 */
.mt-large {
    margin-top: 40px !important;
}

.mb-large {
    margin-bottom: 40px !important;
}

.mt-medium {
    margin-top: 25px !important;
}

.mb-medium {
    margin-bottom: 25px !important;
}

/* ========== 图片预览弹窗样式 ========== */

/* 图片预览弹窗 */
.image-preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000; /* 比其他弹窗更高 */
    background: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.image-preview-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 图片预览容器 */
.image-preview-container {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 预览的图片 */
.image-preview-container img {
    max-width: 100%;
    max-height: 95vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    animation: zoomIn 0.3s ease;
    cursor: default;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 关闭按钮 */
.image-preview-close {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 2em;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-close:hover {
    background: var(--tsinghua-purple);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 4px 20px rgba(130, 49, 142, 0.5);
}

.image-preview-close:active {
    transform: rotate(90deg) scale(0.95);
}

/* 下载按钮 */
.image-preview-download {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border: none;
    background: linear-gradient(135deg, var(--tsinghua-purple), var(--tsinghua-purple-dark));
    color: white;
    font-size: 1em;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
    box-shadow: 0 4px 20px rgba(130, 49, 142, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-preview-download:hover {
    background: linear-gradient(135deg, var(--tsinghua-purple-dark), var(--tsinghua-purple));
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(130, 49, 142, 0.6);
}

.image-preview-download:active {
    transform: translateY(-1px);
}

/* 图片信息提示 */
.image-preview-info {
    position: fixed;
    bottom: 30px;
    left: 30px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 8px;
    font-size: 0.9em;
    z-index: 2001;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.image-preview-info-title {
    font-weight: 600;
    color: var(--tsinghua-purple-light);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .image-preview-container img {
        max-width: 100vw;
        max-height: 90vh;
        border-radius: 0;
    }

    .image-preview-close {
        top: 15px;
        right: 15px;
        width: 44px;
        height: 44px;
        font-size: 1.5em;
    }

    .image-preview-download {
        bottom: 15px;
        right: 15px;
        padding: 12px 20px;
        font-size: 0.9em;
    }

    .image-preview-info {
        bottom: 15px;
        left: 15px;
        padding: 10px 15px;
        font-size: 0.8em;
        max-width: calc(100vw - 150px); /* 避免与下载按钮重叠 */
    }

    .modal-body img {
        max-width: 300px; /* 移动端缩略图更小 */
        max-height: 200px;
    }
}

/* 打印样式优化 */
@media print {
    .modal-overlay,
    .modal-close,
    .attachment-item,
    .reference-tag {
        display: none;
    }

    .modal-content {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-body h1,
    .modal-body h2,
    .modal-body h3 {
        page-break-after: avoid;
    }

    .modal-body pre,
    .modal-body img,
    .modal-body table {
        page-break-inside: avoid;
    }
}

/* 选中文本的样式 */
::selection {
    background: var(--tsinghua-purple-light);
    color: white;
}

::-moz-selection {
    background: var(--tsinghua-purple-light);
    color: white;
}

/* 焦点样式优化 */
*:focus {
    outline: 2px solid var(--tsinghua-purple-light);
    outline-offset: 2px;
}

button:focus,
a:focus {
    outline: 2px solid var(--tsinghua-purple);
    outline-offset: 2px;
}

/* 禁用状态 */
.disabled,
[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 加载状态 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--tsinghua-purple-light);
    border-top-color: var(--tsinghua-purple);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========================================
   富文本编辑器内容样式支持
   ======================================== */

/* 自定义字体样式 */
.modal-body .ql-font-sans-serif,
.content .ql-font-sans-serif {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.modal-body .ql-font-serif,
.content .ql-font-serif {
    font-family: Georgia, "Times New Roman", serif;
}

.modal-body .ql-font-monospace,
.content .ql-font-monospace {
    font-family: Monaco, Courier, monospace;
}

.modal-body .ql-font-microsoft-yahei,
.content .ql-font-microsoft-yahei {
    font-family: 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

.modal-body .ql-font-simsun,
.content .ql-font-simsun {
    font-family: SimSun, 'Songti SC', serif;
}

.modal-body .ql-font-simhei,
.content .ql-font-simhei {
    font-family: SimHei, 'Heiti SC', sans-serif;
}

.modal-body .ql-font-kaiti,
.content .ql-font-kaiti {
    font-family: KaiTi, 'Kaiti SC', serif;
}

.modal-body .ql-font-fangsong,
.content .ql-font-fangsong {
    font-family: FangSong, 'STFangsong', serif;
}

/* 自定义字号样式 */
.modal-body .ql-size-small,
.content .ql-size-small {
    font-size: 0.75em;
}

.modal-body .ql-size-large,
.content .ql-size-large {
    font-size: 1.5em;
}

.modal-body .ql-size-huge,
.content .ql-size-huge {
    font-size: 2.5em;
}

/* 引用块样式 */
.modal-body blockquote,
.content blockquote {
    border-left: 4px solid var(--tsinghua-purple);
    padding-left: 16px;
    margin: 16px 0;
    font-style: italic;
    color: var(--text-secondary);
    background: var(--background-gray);
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
}

/* 上标/下标样式 */
.modal-body sub,
.content sub {
    vertical-align: sub;
    font-size: 0.75em;
}

.modal-body sup,
.content sup {
    vertical-align: super;
    font-size: 0.75em;
}

/* 待办列表样式 */
.modal-body .ql-list-check,
.content .ql-list-check {
    list-style-type: none;
    padding-left: 0;
}

.modal-body .ql-list-check > li,
.content .ql-list-check > li {
    position: relative;
    padding-left: 30px;
    margin: 8px 0;
}

.modal-body .ql-list-check > li::before,
.content .ql-list-check > li::before {
    content: '☐';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--tsinghua-purple);
    font-size: 1.2em;
}

.modal-body .ql-list-check > li[data-checked="true"]::before,
.content .ql-list-check > li[data-checked="true"]::before {
    content: '☑';
    color: #4CAF50;
}

.modal-body .ql-list-check > li[data-checked="true"],
.content .ql-list-check > li[data-checked="true"] {
    text-decoration: line-through;
    color: var(--text-secondary);
}

/* 视频嵌入样式 */
.modal-body .ql-video,
.content .ql-video {
    width: 100%;
    max-width: 100%;
    height: 450px;
    border-radius: 8px;
    margin: 16px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* 移动端视频适配 */
@media (max-width: 768px) {
    .modal-body .ql-video,
    .content .ql-video {
        height: 250px;
    }
}

/* 缩进样式 */
.modal-body .ql-indent-1,
.content .ql-indent-1 {
    padding-left: 3em;
}

.modal-body .ql-indent-2,
.content .ql-indent-2 {
    padding-left: 6em;
}

.modal-body .ql-indent-3,
.content .ql-indent-3 {
    padding-left: 9em;
}

.modal-body .ql-indent-4,
.content .ql-indent-4 {
    padding-left: 12em;
}

.modal-body .ql-indent-5,
.content .ql-indent-5 {
    padding-left: 15em;
}

.modal-body .ql-indent-6,
.content .ql-indent-6 {
    padding-left: 18em;
}

.modal-body .ql-indent-7,
.content .ql-indent-7 {
    padding-left: 21em;
}

.modal-body .ql-indent-8,
.content .ql-indent-8 {
    padding-left: 24em;
}

/* 文本对齐样式 */
.modal-body .ql-align-center,
.content .ql-align-center {
    text-align: center;
}

.modal-body .ql-align-right,
.content .ql-align-right {
    text-align: right;
}

.modal-body .ql-align-justify,
.content .ql-align-justify {
    text-align: justify;
}

