/* 全局性能优化 */
* {
    box-sizing: border-box;
    /* 使用 transform3d 开启硬件加速 */
    transform: translate3d(0, 0, 0);
}

/* 重置默认边距 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1500px;  /* 增加容器最大宽度 */
    margin: 0 auto;
    padding: 80px 30px 20px; /* 增加顶部padding，确保内容不被导航栏遮挡 */
    /* 添加will-change提示浏览器优化 */
    will-change: transform;
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px 30px;
    width: 100%;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding-left: 15px;  /* 只调整左右padding */
    padding-right: 15px; /* 只调整左右padding */
}

.paper-header {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;   /* 增加内部顶部间距 */
}

.section {
    margin-bottom: 40px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
}

.subsection {
    margin-bottom: 20px;
}

.content-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    line-height: 1.6;
}

.content {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 5px;
    white-space: pre-wrap;
    /* 开启独立层，优化滚动性能 */
    will-change: transform;
    /* 使用合成层优化滚动 */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.code-block {
    background: #2b2b2b;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    position: relative;
    /* 开启独立层，优化滚动性能 */
    will-change: transform;
    /* 使用合成层优化滚动 */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

h1 {
    color: #333;
}

h2 {
    margin-top: 20px; /* 调整标题间距 */
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

h3 {
    color: #34495e;
    margin-bottom: 10px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin: 10px 0;
    /* 只对真正需要动画的属性使用transition */
    transition: background-color 0.3s;
    /* 避免reflow，使用transform替代top/left动画 */
    transform: translateZ(0);
}

.btn:hover {
    background: #2980b9;
}

.back-btn {
    margin-bottom: 20px;
}

.file-list {
    margin-top: 20px;
    /* 开启独立层，优化滚动性能 */
    will-change: transform;
    /* 使用合成层优化滚动 */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    margin-top: 20px;
}

.file-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}

.file-item:hover {
    background-color: #f8f9fa;
}

.file-link {
    text-decoration: none;
    color: #2c3e50;
    display: block;
    font-size: 16px;
}

.file-link:hover {
    color: #3498db;
}

.pagination {
    margin-top: 30px;
    text-align: center;
    user-select: none;
    margin-top: 20px;
    display: flex;
    justify-content: center;
}

.page-link, .page-ellipsis {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
    /* 使用更高效的transform */
    transform: translateZ(0);
    will-change: background-color, border-color;
}

.page-ellipsis {
    border: none;
    padding: 8px 0;
}

.page-link:hover {
    background-color: #f8f9fa;
    border-color: #3498db;
}

.page-link.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.page-info {
    display: inline-block;
    margin-left: 15px;
    color: #666;
    font-size: 14px;
}

.file-number {
    color: #666;
    margin-right: 10px;
    min-width: 30px;
    display: inline-block;
}

/* 顶部导航栏 */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    height: 60px; /* 固定导航栏高度 */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 100%; /* 确保内容垂直居中 */
    max-width: 1500px;
    margin: 0 auto;
    padding: 10px 30px;
    width: 100%;
    max-width: none;
    padding-left: 15px;  /* 只调整左右padding */
    padding-right: 15px; /* 只调整左右padding */
}

.paper-title {
    margin-left: 20px;
    font-weight: 500;
    color: #2c3e50;
}

/* 侧边栏 */
.sidebar {
    position: fixed;
    width: 250px;
    top: 60px;
    bottom: 0;
    left: 0;
    padding: 20px;
    overflow-y: auto;
    background: white;
    border-right: 1px solid #eee;
    z-index: 100;  /* 确保侧边栏在内容上层 */
}

.toc {
    position: sticky;
    top: 20px;
}

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

.toc li {
    margin: 10px 0;
}

.toc a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s;
}

.toc a:hover {
    color: #3498db;
}

/* 主要内容区 */
.main-content {
    margin-left: 270px;
    margin-top: 60px;
    padding: 20px;
    margin-left: 0;
    padding-left: 15px;  /* 只调整左右padding */
    padding-right: 15px; /* 只调整左右padding */
    width: 100%;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.full-width {
    grid-column: 1 / -1;
}

/* 返回顶部按钮 */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    font-size: 20px;
    /* 只对真正需要动画的属性使用transition */
    transition: background-color 0.3s;
    /* 使用transform替代top/right定位 */
    transform: translate3d(0, 0, 0);
    will-change: transform, opacity;
    z-index: 1000;
}

/* 内容框样式优化 */
.model-box, .function-box {
    height: 100%;
}

.paper-function-box {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
}

@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
    }
    .analysis-grid {
        grid-template-columns: 1fr;
    }
}

/* ...existing code... */

.search-filter-area {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    margin-bottom: 20px;
}

.search-group {
    display: flex;
    flex: 1;
    gap: 10px;
}

.search-type {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 120px;
    background-color: white;
}

.search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    min-width: 200px;
}

/* 删除 .year-select 相关样式 */

/* ...existing code... */

.search-btn {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    /* 只对真正需要动画的属性使用transition */
    transition: background-color 0.3s;
    /* 避免reflow，使用transform替代top/left动画 */
    transform: translateZ(0);
}

.reset-btn {
    padding: 10px 20px;
    background: #95a5a6;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    /* 只对真正需要动画的属性使用transition */
    transition: background-color 0.3s;
    /* 避免reflow，使用transform替代top/left动画 */
    transform: translateZ(0);
}

.search-btn:hover, .reset-btn:hover {
    background: #2980b9;
}

.result-stats {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

.file-content {
    flex: 1;
}

.file-abstract {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
    line-height: 1.5;
}

.file-meta {
    margin-top: 8px;
    font-size: 12px;
    color: #95a5a6;
}

/* 删除 .file-year 相关样式 */

/* ...existing code... */

.file-item {
    display: flex;
    align-items: flex-start;
}

/* 认证页面样式 */
.auth-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f0f2f5;
}

.auth-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    /* 使用 transform 开启硬件加速 */
    transform: translateZ(0);
    /* 添加will-change提示 */
    will-change: transform, opacity;
}

.auth-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #2c3e50;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    /* 只对真正需要动画的属性使用transition */
    transition: background-color 0.3s;
    /* 避免reflow，使用transform替代top/left动画 */
    transform: translateZ(0);
}

.auth-btn:hover {
    background: #2980b9;
}

.auth-links {
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
}

.auth-links a {
    color: #3498db;
    text-decoration: none;
}

.alert {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 个人中心页面样式 */
.profile-box {
    background: white;
    padding: 30px;
    border-radius: 8px;
    /* 使用 transform 开启硬件加速 */
    transform: translateZ(0);
    /* 添加will-change提示 */
    will-change: transform, opacity;
}

.profile-info {
    margin-top: 20px;
}

.info-group {
    margin-bottom: 15px;
}

.info-group label {
    color: #666;
    margin-right: 10px;
}

.profile-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

/* ...existing code... */

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.form-text {
    color: #6c757d;
    font-size: 12px;
    margin-top: 4px;
}

.form-group input:invalid {
    border-color: #dc3545;
}

.form-group input:valid {
    border-color: #28a745;
}

/* ...existing code... */

.nav-links {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.welcome-text {
    color: #2c3e50;
    font-size: 14px;
}

.nav-btn {
    margin: 0;
    padding: 8px 15px;
    font-size: 14px;
}

.nav-title {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

.main-container {
    margin-top: 0; /* 移除之前的margin-top */
    padding-top: 60px; /* 添加与导航栏等高的padding */
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

/* ...existing code... */

/* 管理员面板样式 */
.admin-panel {
    background: white;
    padding: 30px;
    border-radius: 8px;
    /* 使用 transform 开启硬件加速 */
    transform: translateZ(0);
    /* 添加will-change提示 */
    will-change: transform, opacity;
}

.stats-box {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #3498db;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin: 10px 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 500;
    color: #2c3e50;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

/* ...existing code... */

.journal-tag {
    display: inline-block;
    padding: 2px 8px;
    margin-top: 8px;
    background-color: #e1f5fe;
    color: #0288d1;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* ...existing code... */

.file-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-header .journal-tag {
    margin-top: 0;
}

/* ...existing code... */

.vip-notice {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
}

.vip-actions {
    margin-top: 20px;
}

.vip-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.vip-days-input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 80px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    margin: 0;
}

/* ...existing code... */

.vip-status {
    display: inline-block;
    padding: 4px 8px;
    background-color: #e1f5fe;
    color: #0288d1;
    border-radius: 4px;
    font-size: 14px;
}

.profile-info .info-group {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.profile-info .info-group:last-child {
    border-bottom: none;
}

/* ...existing code... */

/* ...existing code... */

.admin-search {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.admin-search .search-form {
    max-width: 600px;
}

.admin-search .search-input {
    height: 36px;
}

.admin-search .search-type {
    height: 36px;
    min-width: 100px;
}

.admin-search .search-btn,
.admin-search .reset-btn {
    height: 36px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    margin: 0;
}

/* ...existing code... */

.log-list {
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.log-list .admin-table td {
    font-size: 14px;
}

.stat-item .btn {
    margin-top: 10px;
    width: 100%;
    text-align: center;
}

/* ...existing code... */

.action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.delete-form {
    margin: 0;
}

.delete-form .btn-danger {
    background: #dc3545;
    margin: 0;
}

.delete-form .btn-danger:hover {
    background: #c82333;
}

/* ...existing code... */

/* 添加表格操作列的样式 */
.table td form {
    display: inline-block;
    margin: 0;
    padding: 0;
}

.table td .btn {
    display: inline-block;
    float: none;
    vertical-align: middle;
}

/* ...existing code... */

/* 编辑论文页面样式优化 */
.section-item {
    background-color: #f8f9fa;
}

.section-item textarea {
    font-size: 16px;
    line-height: 1.6;
}

.form-control-lg {
    font-size: 16px;
    padding: 12px 15px;
}

.code-editor {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.5;
    background-color: #fff;
}

/* ...existing code... */

/* 编辑页面表单样式优化 */
.section-item {
    /* ...existing code... */
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    background-color: #fff;
    padding: 25px !important;
    margin-bottom: 30px !important;
    border: 1px solid #dee2e6 ;
}

.section-item .form-control {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font-size: 16px;
    padding: 12px 15px;
}

.section-item textarea.form-control {
    min-height: 120px;
}

.section-item .code-editor {
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
    min-height: 200px;
    background-color: #f8f9fa;
}

.section-item label.form-label {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 8px;
}

/* ...existing code... */

/* 编辑页面文本框样式优化 */
.section-item textarea.form-control {
    min-height: 200px;
    font-size: 15px;
    line-height: 1.8;
    padding: 15px 20px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.section-item textarea.form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.section-item .code-editor {
    min-height: 300px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
    background-color: #f8f9fa;
    padding: 20px;
}

.section-item input.form-control {
    height: 45px;
    padding: 10px 15px;
    font-size: 15px;
}

/* 摘要文本框样式 */
textarea[name="abstract"] {
    min-height: 180px;
    font-size: 15px;
    line-height: 1.8;
    padding: 15px 20px;
}

/* 响应式布局优化 */
@media (max-width: 1600px) {
    .container {
        max-width: 1200px;
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 20px;
    }
}

/* ...existing code... */

/* 论文基本信息区域样式 */
.paper-basic-info {
    width: 100%;
    max-width: 1300px;  /* 增加最大宽度 */
    margin-left: auto;
    margin-right: auto;
    padding: 0;         /* 移除内边距限制 */
}

.paper-basic-info input.form-control,
.paper-basic-info textarea.form-control {
    width: 100%;
    max-width: 100%;
    font-size: 16px;
    padding: 20px 25px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-sizing: border-box;   /* 确保padding不会影响总宽度 */
}

/* 摘要文本框特殊样式 */
.paper-basic-info textarea[name="abstract"] {
    min-height: 200px;
    width: 100%;        /* 确保宽度为100% */
    display: block;     /* 块级显示 */
}

/* 响应式调整 */
@media (max-width: 1500px) {
    .paper-basic-info {
        max-width: 90%;  /* 使用百分比而不是固定宽度 */
    }
}

@media (max-width: 768px) {
    .paper-basic-info {
        max-width: 100%;
        padding: 0 15px;
    }
}

/* ...existing code... */

/* 公告相关样式 */
.announcement-item {
    margin-bottom: 30px;
}

.announcement-meta {
    color: #666;
    font-size: 14px;
    margin: 10px 0;
}

.announcement-image {
    margin: 15px 0;
}

.announcement-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.announcement-content {
    line-height: 1.6;
    margin-top: 15px;
}

/* ...existing code... */

/* 懒加载图片占位样式 */
.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.lazy.loaded {
    opacity: 1;
}

/* 内容懒加载占位样式 */
.content-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    min-height: 100px;
    border-radius: 4px;
    margin-bottom: 15px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 优化滚动性能 */
.content-container {
    will-change: transform;
    transform: translateZ(0);
}

/* 无限滚动加载提示器 */
.loading-indicator {
    text-align: center;
    padding: 20px;
    display: none;
}

.loading-indicator.visible {
    display: block;
}

/* ...existing code... */

/* 论文分析页面的主内容区域调整 */
.analysis-content {
    margin-left: 270px;  /* 为侧边栏留出空间 */
    padding: 20px 15px;  /* 保持左右padding一致 */
    width: calc(100% - 270px);  /* 减去侧边栏宽度 */
    box-sizing: border-box;
    margin-top: 80px;    /* 增加顶部边距，避免被导航栏遮挡 */
}

/* 当屏幕宽度小于1024px时的响应式布局 */
@media (max-width: 1024px) {
    .sidebar {
        display: none;  /* 隐藏侧边栏 */
    }
    
    .analysis-content {
        margin-left: 0;  /* 移除左边距 */
        width: 100%;    /* 占满全宽 */
        padding: 20px 15px;
    }
}

