/* 高亮刚刚编辑过的行 */
.highlight-row {
    background-color: rgba(255, 255, 0, 0.2) !important;
    transition: background-color 1s ease;
}

@media (prefers-color-scheme: dark) {
    .highlight-row {
        background-color: rgba(255, 215, 0, 0.15) !important;
    }
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    opacity: 1;
    animation: pageLoad 0.5s ease-in-out forwards;
    overflow-y: scroll !important; /* 确保body也始终显示垂直滚动条 */
}

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

/* 高亮行样式 */
.highlight-row {
    animation: highlight-animation 3s ease-in-out;
}

@keyframes highlight-animation {
    0% { background-color: rgba(255, 107, 107, 0.1); }
    50% { background-color: rgba(255, 107, 107, 0.3); }
    100% { background-color: transparent; }
}

/* 暗色模式下的高亮行样式 */
@media (prefers-color-scheme: dark) {
    @keyframes highlight-animation {
        0% { background-color: rgba(255, 107, 107, 0.2); }
        50% { background-color: rgba(255, 107, 107, 0.4); }
        100% { background-color: transparent; }
    }
}

.container {
    width: 100%;
    margin: 0;
    padding: 0;
}

a {
    color: #2c82c9;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #1a5b8e;
    text-decoration: none;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #2c82c9;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(44, 130, 201, 0.2);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    background-color: #1a5b8e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(44, 130, 201, 0.3);
    text-decoration: none;
}

.btn:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:hover:after {
    animation: rippleBtn 1s ease-out;
}

@keyframes rippleBtn {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* 头部样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    padding: 15px 0;
    margin-bottom: 0; /* 移除底部间距 */
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    width: 92%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

.header-left {
    flex: 0 0 auto;
}

.header-search {
    flex: 1 1 auto;
    max-width: 700px;
}

.header-right {
    flex: 0 0 auto;
}

header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

header h1 a {
    color: #2c82c9;
    text-decoration: none;
    transition: all 0.3s ease;
}

header h1 a:hover {
    color: #1a5b8e;
}

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

nav li {
    margin-left: 20px;
}

nav li a {
    position: relative;
    padding: 5px 0;
    font-weight: 500;
}

nav li a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #2c82c9;
    transition: width 0.3s ease;
}

nav li a:hover:after {
    width: 100%;
}

/* 顶部搜索栏样式 */
.header-search .top-search-form {
    display: flex;
    width: 100%;
}

.header-search .search-inputs-top {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
}

.header-search input[type="text"] {
    flex: 1;
    min-width: 180px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.header-search input[type="date"] {
    width: 120px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s ease;
}

/* 搜索类型下拉框样式 */
.search-type-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.search-type-select:hover,
.search-type-select:focus {
    border-color: #2c82c9;
    outline: none;
}

/* 搜索结果数量样式 */
.search-result-count {
    margin-left: 10px;
    padding: 4px 12px;
    background-color: #f0f8ff;
    color: #2c82c9;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 500;
    white-space: nowrap;
    border: 1px solid #d0e3f7;
    min-width: auto;
    display: inline-block;
    max-width: 300px;
    text-align: center;
}

/* 暗色模式下的搜索结果数量样式 */
@media (prefers-color-scheme: dark) {
    .search-result-count {
        background-color: #1f305e;
        color: #4cc9f0;
        border-color: #2a3f6a;
    }
}

.header-search button {
    padding: 8px 16px;
    background-color: #2c82c9;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(44, 130, 201, 0.2);
}

.header-search button:hover {
    background-color: #1a5b8e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(44, 130, 201, 0.3);
}

/* 主内容区域样式 */
main {
    padding: 0; /* 移除内边距 */
    min-height: 70vh;
    margin-top: -1px; /* 去除导航栏和内容之间的空隙 */
}

main.container {
    padding: 0; /* 移除内边距 */
    margin-top: 0; /* 移除顶部外边距 */
}

/* 文档表格容器样式 */
.document-table-container {
    margin-top: 0; /* 移除顶部外边距 */
    border-top: none; /* 移除顶部边框 */
}

/* 文档表格样式 */
.document-table {
    margin-top: 0; /* 移除顶部外边距 */
    border-top: none; /* 移除顶部边框 */
}

/* 底部样式 */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 30px 0 15px;
    margin-top: 30px;
    text-align: left;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 20px;
}

.footer-section {
    flex: 1;
    min-width: 200px;
    margin-bottom: 20px;
    padding: 0 15px;
}

.footer-section h4 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: #3498db;
}

.footer-section p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #3498db;
}

.footer-section i {
    margin-right: 8px;
    color: #3498db;
}

.footer-bottom {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin: 0;
    font-size: 14px;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
    }
    
    .footer-section {
        margin-bottom: 30px;
    }
}

@media (prefers-color-scheme: dark) {
    footer {
        background-color: #1a1a1a;
    }
    
    .footer-section h4::after {
        background-color: #3498db;
    }
    
    .footer-bottom {
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }
}

/* 闪现消息样式 - 隐藏 */
.flash-messages {
    display: none;
}

.flash-message {
    padding: 12px 15px;
    background-color: #d4edda;
    border-left: 4px solid #28a745;
    border-radius: 4px;
    color: #155724;
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.5s ease-in-out;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 主内容样式 */
.main-content {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.main-content.full-width {
    width: 100%;
    margin: 0;
    padding: 0;
}

.documents-section {
    background-color: #fff;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* 文档表格样式 */
.document-table-container {
    overflow-x: auto;
    width: 100%;
    height: calc(100vh - 120px);
    margin: 0;
    padding: 0;
    overflow-y: scroll !important; /* 强制始终显示垂直滚动条 */
    -ms-overflow-style: scrollbar !important; /* IE和Edge */
    scrollbar-width: auto !important; /* Firefox - 改为auto确保始终显示 */
}

.document-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    padding: 0;
    table-layout: fixed;
}

.document-table th,
.document-table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #ddd;
    vertical-align: top;
}

.document-table th {
    background-color: #002FA7; /* 克莱因蓝 */
    color: #ffffff;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    text-align: center; /* 文字居中 */
    height: 40px; /* 行高缩短为40% */
    line-height: 40px;
    padding: 0 15px; /* 调整内边距以配合行高 */
}

.document-table tbody tr:hover {
    background-color: #f9fbfd;
}

/* 列宽比例设置 */
.document-table .col-content {
    width: 62%;
    position: sticky;
    left: 0;
    background-color: #002FA7 !important; /* 首行首列也使用克莱因蓝 */
    color: #ffffff; /* 文字颜色为白色 */
    z-index: 15; /* 提高层级，确保显示在最上层 */
}

.document-table tbody .col-content {
    background-color: #fff !important; /* 只有内容部分保持白色背景 */
    color: #333; /* 内容部分文字颜色恢复 */
}

.document-table tbody tr:hover .col-content {
    background-color: #f9fbfd !important;
}

.document-table .col-tags {
    width: 6%;
}

.document-table .col-learning {
    width: 17%;
}

.document-table .col-author {
    width: 5%;
}

.document-table .col-images {
    width: 7%;
}

.document-table .col-actions {
    width: 3%;
    white-space: nowrap; /* 防止操作文字换行 */
}

/* 文档内容样式优化 */
.doc-content {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.5;
    color: #333;
    font-size: 1em;
    max-height: none;
    overflow: visible;
    padding: 10px;
    position: relative;
    background-color: inherit !important;
    font-family: inherit;
}

/* 段落样式 */
.document-paragraph {
    margin: 0;
    padding: 0;
    line-height: 1.5; /* 与doc-content保持一致 */
    display: block; /* 恢复为块级元素 */
    margin-bottom: 0.2em; /* 统一的小间距 */
}

/* 特殊处理：连续段落之间的间距 */
.document-paragraph + .document-paragraph {
    margin-top: 0; /* 连续段落之间不添加额外的顶部间距 */
}

/* 为不同字体类设置.doc-content的字体 */
body.font-songti .doc-content, 
body.font-songti .document-content,
body.font-songti .document-preview,
body.font-songti .extra-study-content {
    font-family: 'Noto Serif SC', 'Source Han Serif CN', 'SimSun', serif;
}

body.font-heiti .doc-content,
body.font-heiti .document-content,
body.font-heiti .document-preview,
body.font-heiti .extra-study-content {
    font-family: 'Noto Sans SC', 'Source Han Sans CN', 'SimHei', sans-serif;
}

body.font-kaiti .doc-content,
body.font-kaiti .document-content,
body.font-kaiti .document-preview,
body.font-kaiti .extra-study-content {
    font-family: 'STKaiti', 'KaiTi', serif;
}

body.font-fangsong .doc-content,
body.font-fangsong .document-content,
body.font-fangsong .document-preview,
body.font-fangsong .extra-study-content {
    font-family: 'STFangsong', 'FangSong', serif;
}

body.font-wangxizhi .doc-content,
body.font-wangxizhi .document-content,
body.font-wangxizhi .document-preview,
body.font-wangxizhi .extra-study-content {
    font-family: 'FZXS', 'FZKai-Z03', 'KaiTi', 'STKaiti', serif;
}

body.font-shoujinti .doc-content,
body.font-shoujinti .document-content,
body.font-shoujinti .document-preview,
body.font-shoujinti .extra-study-content {
    font-family: 'FZSHENGSKSJW', 'STSong', serif;
}

.doc-date {
    font-weight: 600;
    color: #2c82c9;
    margin-bottom: 4px;
    font-size: 1.1em;
}

.doc-time {
    color: #777;
    font-size: 0.85em;
    margin-bottom: 10px;
}

.tag-pill {
    display: inline-block;
    padding: 4px 10px;
    background-color: #ecf0f1;
    color: #2c3e50;
    border-radius: 15px;
    font-size: 0.85em;
    margin: 3px;
    white-space: nowrap;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.tag-pill:hover {
    background-color: #2c82c9;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-color: #2c82c9;
}

.tag-pill:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 标签云样式 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    background-color: #ecf0f1;
    color: #2c3e50;
    border-radius: 20px;
    font-size: 0.9em;
    transition: all 0.3s ease;
    border: 1px solid #ddd;
    position: relative;
    overflow: hidden;
}

.tag:hover {
    background-color: #2c82c9;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
    border-color: #2c82c9;
}

/* 空状态提示 */
.no-documents {
    padding: 40px 20px;
    text-align: center;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    color: #777;
    font-style: italic;
}

.no-tags {
    padding: 20px;
    text-align: center;
    color: #777;
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    nav ul {
        justify-content: center;
        margin-top: 10px;
    }
    
    nav li {
        margin: 0 10px;
        margin-bottom: 5px;
    }
    
    .document-table .col-content {
        width: 100%;
    }
    
    .document-table .col-tags,
    .document-table .col-learning,
    .document-table .col-author,
    .document-table .col-images {
        width: auto;
    }
}

/* 适应暗色模式 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a2e;
        color: #e6e6e6;
    }
    
    header, .documents-section {
        background-color: #16213e;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    }
    
    header h1 a {
        color: #4cc9f0;
    }
    
    .document-table th {
        background-color: #002FA7; /* 保持克莱因蓝色 */
        color: #ffffff;
    }
    
    .document-table td {
        border-color: #2a3f6a;
    }
    
    .document-table tbody tr:hover {
        background-color: #1f305e;
    }
    
    .document-table .col-content {
        background-color: #002FA7 !important; /* 首行首列在暗色模式下也使用克莱因蓝 */
    }
    
    .document-table tbody .col-content {
        background-color: #16213e !important; /* 暗色模式下内容部分背景 */
    }
    
    .document-table tbody tr:hover .col-content {
        background-color: #1f305e !important;
    }
    
    .doc-content {
        color: #e6e6e6;
    }
    
    .doc-date {
        color: #4cc9f0;
    }
    
    .doc-time {
        color: #b8b8b8;
    }
    
    .tag-pill {
        background-color: #2a3f6a;
        color: #e6e6e6;
        border-color: #3a4f7a;
    }
    
    .tag-pill:hover {
        background-color: #4cc9f0;
        color: #16213e;
        border-color: #4cc9f0;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    }
    
    .no-documents {
        background-color: #16213e;
        color: #b8b8b8;
    }
}

/* 登录和注册页面样式 */
.login-page,
.register-page {
    max-width: 500px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.login-page h2,
.register-page h2 {
    margin-bottom: 25px;
    color: #2c3e50;
    font-weight: 600;
    text-align: center;
}

.login-form,
.register-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 500;
    color: #555;
}

.form-group input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    border-color: #2c82c9;
    box-shadow: 0 0 0 3px rgba(44, 130, 201, 0.15);
    outline: none;
}

.form-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.form-actions button {
    width: 100%;
    padding: 12px;
}

.form-actions p {
    font-size: 0.9em;
    color: #777;
}

/* 适应暗色模式 - 登录页面 */
@media (prefers-color-scheme: dark) {
    .login-page,
    .register-page {
        background-color: #16213e;
    }
    
    .login-page h2,
    .register-page h2 {
        color: #e6e6e6;
    }
    
    .form-group label {
        color: #b8b8b8;
    }
    
    .form-group input {
        background-color: #1f305e;
        border-color: #2a3f6a;
        color: #e6e6e6;
    }
    
    .form-group input:focus {
        border-color: #4cc9f0;
        box-shadow: 0 0 0 3px rgba(76, 201, 240, 0.15);
    }
    
    .form-actions p {
        color: #b8b8b8;
    }
}

/* 个人资料页面样式 */
.profile-page {
    max-width: 800px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.profile-page h2 {
    margin-bottom: 25px;
    color: #2c3e50;
    font-weight: 600;
    text-align: center;
}

.profile-info {
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.info-item .label {
    width: 120px;
    font-weight: 500;
    color: #555;
}

.info-item .value {
    flex: 1;
}

.profile-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* 字体设置部分 */
.font-settings {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.font-settings h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 500;
}

.font-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.font-option {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.font-option:hover {
    border-color: #2c82c9;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.font-option.active {
    border-color: #2c82c9;
    background-color: rgba(44, 130, 201, 0.1);
}

.font-option .font-name {
    font-weight: 500;
    margin-bottom: 10px;
}

.font-option .font-preview {
    font-size: 1.2em;
    line-height: 1.5;
}

.font-wangxizhi {
    font-family: 'FZXS', 'FZKai-Z03', 'KaiTi', 'STKaiti', serif;
}

.font-shoujinti {
    font-family: 'FZSHENGSKSJW', 'STSong', serif;
}

.font-songti {
    font-family: 'Noto Serif SC', 'Source Han Serif CN', 'SimSun', serif;
}

.font-heiti {
    font-family: 'Noto Sans SC', 'Source Han Sans CN', 'SimHei', sans-serif;
}

.font-kaiti {
    font-family: 'STKaiti', 'KaiTi', serif;
}

.font-fangsong {
    font-family: 'STFangsong', 'FangSong', serif;
}

/* 加载漂亮的中文字体 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap');

/* 文档内容样式 */
.document-content {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.8;
    color: #333;
    font-size: 1em;
    padding: 20px;
    position: relative;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    font-family: inherit;
}

/* 自定义滚动条样式 */
::-webkit-scrollbar {
    width: 14px; /* 加宽滚动条 */
    height: 14px; /* 加高水平滚动条 */
    background-color: #f0f0f0; /* 滚动条背景色 */
    display: block !important; /* 强制始终显示滚动条 */
}

::-webkit-scrollbar-thumb {
    background-color: #00c853; /* 滚动条游标颜色，使用翠绿色 */
    border-radius: 6px; /* 圆角 */
    border: 2px solid #f0f0f0; /* 边框 */
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); /* 添加阴影增强可见度 */
    visibility: visible !important; /* 确保游标始终可见 */
}

::-webkit-scrollbar-thumb:hover {
    background-color: #00a844; /* 悬停时颜色加深 */
}

::-webkit-scrollbar-track {
    background-color: #f0f0f0; /* 滚动条轨道颜色 */
    border-radius: 6px; /* 圆角 */
    display: block !important; /* 强制始终显示滚动轨道 */
}

/* 针对Firefox浏览器的滚动条样式 */
* {
    scrollbar-width: auto !important; /* 强制始终显示滚动条 */
    scrollbar-color: #00c853 #f0f0f0; /* 游标颜色 轨道颜色 */
}

/* 确保滚动条始终可见 */
html {
    overflow-y: scroll !important; /* 全局始终显示垂直滚动条 */
}

body {
    overflow-y: scroll !important; /* 确保body也始终显示垂直滚动条 */
}

/* 确保所有可滚动元素的滚动条始终可见 */
div, section, article, aside, nav, main, header, footer {
    overflow: auto !important;
    scrollbar-width: auto !important;
    -ms-overflow-style: scrollbar !important;
}

/* 适应暗色模式的滚动条样式 */
@media (prefers-color-scheme: dark) {
    ::-webkit-scrollbar {
        background-color: #1a1a2e; /* 暗色模式滚动条背景色 */
        display: block !important; /* 强制始终显示滚动条 */
    }
    
    ::-webkit-scrollbar-thumb {
        background-color: #00c853; /* 保持相同的游标颜色 */
        border: 2px solid #1a1a2e; /* 暗色模式边框 */
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.2); /* 暗色模式下的阴影 */
        visibility: visible !important; /* 确保游标始终可见 */
    }
    
    ::-webkit-scrollbar-track {
        background-color: #1a1a2e; /* 暗色模式滚动条轨道颜色 */
        display: block !important; /* 强制始终显示滚动轨道 */
    }
    
    * {
        scrollbar-color: #00c853 #1a1a2e !important; /* 暗色模式下的游标颜色和轨道颜色 */
        scrollbar-width: auto !important; /* 强制始终显示滚动条 */
    }
}

/* 字体大小设置样式 */
.font-size-settings {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.font-size-settings h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: 500;
}

.font-size-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.font-size-option {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.font-size-option:hover {
    border-color: #2c82c9;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.font-size-option.active {
    border-color: #2c82c9;
    background-color: rgba(44, 130, 201, 0.1);
}

.font-size-option .font-size-name {
    font-weight: 500;
    margin-bottom: 10px;
}

.font-size-option .font-size-preview {
    line-height: 1.5;
}

.font-size-small {
    font-size: 0.9em;
}

.font-size-medium {
    font-size: 1em;
}

.font-size-large {
    font-size: 1.2em;
}

.font-size-xlarge {
    font-size: 1.4em;
}

/* 字体大小只应用于正文内容区域 */
body.font-size-small .doc-content,
body.font-size-small .document-content,
body.font-size-small .document-preview,
body.font-size-small .extra-study-content {
    font-size: 0.9em;
}

body.font-size-medium .doc-content,
body.font-size-medium .document-content,
body.font-size-medium .document-preview,
body.font-size-medium .extra-study-content {
    font-size: 1em;
}

body.font-size-large .doc-content,
body.font-size-large .document-content,
body.font-size-large .document-preview,
body.font-size-large .extra-study-content {
    font-size: 1.2em;
}

body.font-size-xlarge .doc-content,
body.font-size-xlarge .document-content,
body.font-size-xlarge .document-preview,
body.font-size-xlarge .extra-study-content {
    font-size: 1.4em;
}

/* 适应暗色模式 - 字体大小设置 */
@media (prefers-color-scheme: dark) {
    .font-size-settings h3 {
        color: #e6e6e6;
    }
    
    .font-size-option {
        border-color: #2a3f6a;
        background-color: #16213e;
        color: #e6e6e6;
    }
    
    .font-size-option:hover {
        border-color: #4cc9f0;
        background-color: #1f305e;
    }
    
    .font-size-option.active {
        border-color: #4cc9f0;
        background-color: rgba(76, 201, 240, 0.1);
    }
}

/* 搜索结果页样式 */
.search-page .search-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.search-page .search-inputs input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.search-page .search-inputs .search-type-select {
    padding: 10px;
    min-width: 100px;
} 
/* 首页优化 - 2023年11月 */
/* 1. 优化标签显示 */
.tag-pill {
    white-space: normal !important; /* 允许换行 */
    word-break: break-word !important; /* 在必要时可以在单词内换行 */
}

.document-table .col-tags {
    text-align: left !important; /* 左对齐 */
    padding-left: 5px !important; /* 添加左边距 */
}

.doc-tags {
    text-align: left !important; /* 左对齐 */
}

/* 2. 优化拓展学习列，确保链接不会溢出 */
.document-table .col-learning {
    word-break: break-all !important; /* 允许在任何字符处换行 */
    overflow-wrap: break-word !important; /* 确保长单词/URL会换行 */
}

/* 3. 优化操作列按钮 */
.document-table .col-actions {
    text-align: left !important; /* 左对齐 */
    padding-left: 5px !important; /* 添加左边距 */
}

.document-table .col-actions .btn {
    width: 70% !important; /* 缩小按钮宽度30% */
}
