/* ===================================
   全局样式 - 中央社会主义学院学报
   统一采用 import-data.php 的设计风格
   =================================== */

/* ---- 基础设置 ---- */
body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    background: #f5f5f5;
}

a {
    color: #c00;
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: #a00;
    text-decoration: underline;
}

/* ---- Bootstrap 颜色覆盖 ---- */
.bg-primary {
    background-color: #c00 !important;
}
.text-primary {
    color: #c00 !important;
}
.border-primary {
    border-color: #c00 !important;
}
.bg-success {
    background-color: #2e7d32 !important;
}
.bg-secondary {
    background-color: #888 !important;
}

/* ---- 标题 ---- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #333;
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; color: #555; margin-top: 1.2em; }
h3 { font-size: 1.15rem; }

/* ---- 卡片 / 区块 ---- */
.card, .section {
    background: #fff;
    padding: 20px;
    margin-bottom: 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: none;
}
.section {
    border: 1px solid #e8e8e8;
}
.card-header {
    background: #fff;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}
.card-body { padding: 20px; }

/* ---- 表格 ---- */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 2px solid #eee;
    background: #fafafa;
    font-weight: 600;
    color: #555;
    font-size: 13px;
}
.table td {
    padding: 9px 14px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}
.table tbody tr:hover {
    background: #fef5f5;
}

/* ---- 状态标签 ---- */
.ok, .text-ok { color: #2e7d32; }
.err, .text-err { color: #c62828; }

/* ---- 辅助区块 ---- */
.summary {
    background: #e8f5e9;
    padding: 16px 20px;
    border-radius: 8px;
    margin: 16px 0;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}
.warn {
    background: #fff3cd;
    padding: 16px 20px;
    border-radius: 8px;
    margin: 16px 0;
    border: 1px solid #ffc107;
    color: #856404;
}
.info-box {
    background: #e3f2fd;
    padding: 16px 20px;
    border-radius: 8px;
    margin: 16px 0;
    border: 1px solid #90caf9;
    color: #1565c0;
}

/* ---- 按钮增强 ---- */
.btn {
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 16px;
    transition: all 0.2s;
}
.btn-primary {
    background: #c00;
    border-color: #c00;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: #a00 !important;
    border-color: #a00 !important;
}
.btn-outline-primary {
    color: #c00;
    border-color: #c00;
}
.btn-outline-primary:hover {
    background: #c00;
    border-color: #c00;
    color: #fff;
}
.btn-success {
    background: #2e7d32;
    border-color: #2e7d32;
}
.btn-danger {
    background: #c62828;
    border-color: #c62828;
}

/* ---- 表单 ---- */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 14px;
    padding: 8px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
    border-color: #c00;
    box-shadow: 0 0 0 0.2rem rgba(204, 0, 0, 0.15);
}
.form-label {
    font-weight: 500;
    color: #555;
    margin-bottom: 4px;
}

/* ---- Alert ---- */
.alert {
    border-radius: 8px;
    border: none;
    padding: 12px 16px;
}
.alert-danger {
    background: #ffebee;
    color: #c62828;
}
.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
}
.alert-info {
    background: #e3f2fd;
    color: #1565c0;
}

/* ---- 徽章 ---- */
.badge, .category-badge {
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 4px;
}
/* 确保各背景色搭配白色文字，清晰可读 */
.badge.bg-success  { background-color: #2e7d32 !important; color: #fff !important; }
.badge.bg-warning  { background-color: #e69a06 !important; color: #fff !important; }
.badge.bg-info     { background-color: #0277bd !important; color: #fff !important; }
.badge.bg-danger   { background-color: #c62828 !important; color: #fff !important; }
.badge.bg-secondary { background-color: #757575 !important; color: #fff !important; }
.badge.bg-primary  { background-color: #c00 !important; color: #fff !important; }
.badge.bg-light    { background-color: #e9ecef !important; color: #333 !important; }
.badge.bg-dark     { background-color: #424242 !important; color: #fff !important; }
/* 无 bg-* 的默认徽章 */
.badge:not([class*="bg-"]),
.category-badge:not([class*="bg-"]) {
    background: #fce4e4;
    color: #a00;
}

/* ---- 分页 ---- */
.pagination .page-link {
    color: #c00;
    border-radius: 4px;
    margin: 0 2px;
    border: 1px solid #ddd;
}
.pagination .page-item.active .page-link {
    background: #c00;
    border-color: #c00;
    color: #fff;
}
.pagination .page-link:hover {
    background: #fce4e4;
    color: #c00;
}

/* ---- 导航标签 ---- */
.nav-tabs .nav-link {
    color: #666;
    border: none;
    padding: 10px 20px;
    border-radius: 0;
}
.nav-tabs .nav-link.active {
    color: #c00;
    border-bottom: 2px solid #c00;
    font-weight: 600;
    background: transparent;
}
.nav-tabs .nav-link:hover:not(.active) {
    border-bottom: 2px solid #ddd;
}

/* ---- 面包屑 ---- */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 16px;
}
.breadcrumb-item a { color: #c00; }
.breadcrumb-item.active { color: #999; }

/* ---- Modal ---- */
.modal-content {
    border-radius: 10px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}
.modal-header {
    border-bottom: 1px solid #eee;
}

/* ===================================
   前端页面专用 - 头部导航
   =================================== */
.main-header {
    background: #fff;
    color: #333;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-bottom: 3px solid #c00;
}

.main-header .site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    text-decoration: none;
}
.main-header .site-title:hover {
    color: #c00;
    text-decoration: none;
}
.main-header .site-title span {
    border-bottom: 2px solid #c00;
    padding-bottom: 2px;
}

.main-nav {
    border-top: 1px solid #f0f0f0;
}
.main-nav a {
    color: #555;
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: inline-block;
    font-size: 0.95em;
    transition: all 0.2s;
}
.main-nav a:hover {
    color: #c00;
    background: #fef5f5;
    border-radius: 4px;
    text-decoration: none;
}

/* 搜索框 */
.search-box { max-width: 300px; }
.search-box .btn {
    background: #c00;
    border-color: #c00;
    color: #fff;
}
.search-box .btn:hover {
    background: #a00;
    border-color: #a00;
}

/* ---- 文章卡片 ---- */
.article-card {
    transition: all 0.3s;
    border: 1px solid #eee;
    border-radius: 8px;
}
.article-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transform: translateY(-2px);
    border-color: #fcc;
}
.article-card .card-title a {
    color: #333;
}
.article-card .card-title a:hover {
    color: #c00;
    text-decoration: none;
}

/* ---- 下拉菜单 ---- */
.dropdown-menu {
    border: 1px solid #e8e8e8;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    background: #fff;
    border-radius: 8px;
    min-width: 200px;
}
.dropdown-menu .dropdown-item {
    color: #333;
    padding: 0.5rem 1rem;
}
.dropdown-menu .dropdown-item:hover {
    background: #fef5f5;
    color: #c00;
}
.dropdown-toggle {
    cursor: pointer;
    color: #555;
    text-decoration: none;
}
.dropdown-toggle::after {
    margin-left: 0.25rem;
}

/* ---- 页脚 ---- */
.site-footer {
    background: #fff;
    border-top: 1px solid #eee;
    margin-top: 40px;
    padding: 24px 0;
}
.site-footer h5 { color: #c00; }
.site-footer p { color: #999; font-size: 0.9em; }

/* ---- 首页轮播图 ---- */
#homeCarousel {
    border-radius: 8px;
    overflow: hidden;
}
#homeCarousel .carousel-inner {
    border-radius: 8px;
}
#homeCarousel .carousel-item img {
    height: 360px;
    object-fit: cover;
}
#homeCarousel .carousel-caption {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 8px;
    padding: 12px 24px;
    bottom: 30px;
}
#homeCarousel .carousel-caption h5 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 4px;
}
#homeCarousel .carousel-caption p {
    color: #ddd;
    margin: 0;
}

/* ===================================
   文章详情页
   =================================== */
.article-detail h1 {
    font-size: 1.6rem;
    line-height: 1.6;
    color: #222;
    border-bottom: 2px solid #c00;
    padding-bottom: 12px;
    margin-bottom: 16px;
}
.article-meta {
    color: #999;
    font-size: 0.9em;
    margin-bottom: 20px;
}
.abstract-box {
    background: #fefaf5;
    border-left: 3px solid #c00;
    padding: 14px 18px;
    margin: 20px 0;
    border-radius: 0 6px 6px 0;
    font-size: 0.95em;
    color: #555;
}
.article-content {
    font-size: 15px;
    line-height: 2;
    color: #333;
}
.article-content p {
    text-indent: 2em;
    margin-bottom: 1em;
}
.keywords-box {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

/* ===================================
   参考文献 & 引用标记（出版物风格）
   =================================== */
.ref-divider {
    margin: 32px 0 20px;
    border: none;
    border-top: 1px solid #ddd;
}
.ref-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 16px;
    text-align: center;
}

/* 正文中的引用上标 */
sup.ref-marker {
    font-size: 0.78em;
    line-height: 1;
    vertical-align: super;
    margin: 0 1px;
}
sup.ref-marker a {
    color: #1565c0;
    text-decoration: none;
    font-weight: 600;
    padding: 0 1px;
    transition: color 0.15s;
}
sup.ref-marker a:hover {
    color: #c00;
    text-decoration: underline;
}

/* 参考文献列表 */
ol.references-list {
    list-style: none;
    counter-reset: ref-counter;
    padding: 0;
    margin: 0;
    font-size: 0.88em;
    line-height: 1.8;
    color: #555;
}
ol.references-list li {
    counter-increment: ref-counter;
    position: relative;
    padding: 4px 0 4px 42px;
    margin-bottom: 2px;
    border-bottom: 1px dotted #eee;
}
ol.references-list li::before {
    content: "[" counter(ref-counter) "]";
    position: absolute;
    left: 0;
    top: 4px;
    width: 36px;
    text-align: right;
    color: #1565c0;
    font-weight: 600;
    font-size: 0.92em;
}
ol.references-list li:target {
    background: #e3f2fd;
    border-radius: 4px;
    padding: 4px 8px 4px 42px;
}

/* 返回引用处的链接 */
.ref-backlink {
    display: inline-block;
    color: #999;
    text-decoration: none;
    font-size: 0.85em;
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.2s, color 0.15s;
}
ol.references-list li:hover .ref-backlink {
    opacity: 1;
}
.ref-backlink:hover {
    color: #c00;
    text-decoration: none;
}
.keyword-tag {
    display: inline-block;
    background: #fce4e4;
    color: #c00;
    padding: 3px 10px;
    border-radius: 4px;
    margin: 3px;
    font-size: 0.9em;
}

/* ===================================
   管理后台专用
   =================================== */
.admin-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 侧边栏 - 浅色主题 */
.admin-wrapper .sidebar {
    width: 200px;
    min-width: 200px;
    max-width: 400px;
    height: 100vh;
    background: #fff;
    border-right: 1px solid #e8e8e8;
    color: #333;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease, min-width 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 2px 0 8px rgba(0,0,0,0.03);
}

.admin-wrapper .sidebar.collapsed {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
}

.admin-wrapper .sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-wrapper .sidebar.collapsed .sidebar-header {
    padding: 16px 10px;
    border-bottom: none;
}

.admin-wrapper .sidebar-header h5 {
    margin: 0;
    font-size: 15px;
    flex: 1;
    text-align: left;
    white-space: nowrap;
    margin-right: 10px;
    color: #c00;
}

.admin-wrapper .sidebar.collapsed .sidebar-header h5 {
    display: none;
}

.admin-wrapper .toggle-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.admin-wrapper .toggle-btn:hover {
    background: #fce4e4;
    color: #c00;
    border-color: #c00;
}

.admin-wrapper .toggle-btn i { font-size: 12px; }

.admin-wrapper .sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
    transition: opacity 0.2s;
}

.admin-wrapper .sidebar.collapsed .sidebar-nav { display: none; }

.admin-wrapper .sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    color: #555;
    padding: 13px 20px;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.admin-wrapper .sidebar-nav .nav-link:hover {
    color: #c00;
    background: #fef5f5;
}

.admin-wrapper .sidebar-nav .nav-link.active {
    color: #c00;
    background: #fef5f5;
    border-left-color: #c00;
    font-weight: 600;
}

.admin-wrapper .sidebar-nav .nav-link i {
    font-size: 17px;
    width: 24px;
    text-align: center;
    color: #888;
}

.admin-wrapper .sidebar-nav .nav-link.active i,
.admin-wrapper .sidebar-nav .nav-link:hover i {
    color: #c00;
}

.admin-wrapper .sidebar-nav .nav-link span {
    margin-left: 12px;
    white-space: nowrap;
}

/* 侧边栏分隔线 */
.admin-wrapper .sidebar-nav .sidebar-divider {
    margin: 8px 20px;
    border-top: 1px solid #e8e8e8;
}

.admin-wrapper .sidebar-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.admin-wrapper .sidebar.collapsed .sidebar-footer { display: none; }

.admin-wrapper .sidebar-footer .user-info {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: #333;
}

.admin-wrapper .sidebar-footer .user-info i {
    font-size: 24px;
    margin-right: 10px;
    color: #c00;
}

.admin-wrapper .sidebar-footer .logout-link {
    display: flex;
    align-items: center;
    color: #999;
    text-decoration: none;
    padding: 8px 0;
    transition: color 0.2s;
}
.admin-wrapper .sidebar-footer .logout-link:hover {
    color: #c00;
}
.admin-wrapper .sidebar-footer .logout-link i { margin-right: 8px; }

/* 侧边栏拖拽手柄 */
.admin-wrapper .resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    transition: background 0.2s;
    z-index: 10;
}
.admin-wrapper .resize-handle:hover {
    background: rgba(204, 0, 0, 0.15);
}
.admin-wrapper .resize-handle.active {
    background: rgba(204, 0, 0, 0.3);
}

/* 主内容区 */
.admin-wrapper .main-content {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 24px;
    background: #f5f5f5;
}

.admin-wrapper .content-header {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #c00;
}
.admin-wrapper .content-header h1 {
    font-size: 1.4rem;
    color: #333;
    margin: 0;
}

/* 统计卡片 */
.card-stat {
    text-align: center;
    padding: 24px 16px;
}
.card-stat .icon {
    font-size: 36px;
    margin-bottom: 10px;
    color: #c00;
}

/* Admin 表格 */
.admin-wrapper .table th {
    background: #fafafa;
    border-bottom: 2px solid #eee;
    font-weight: 600;
}
.admin-wrapper .table td {
    border-bottom: 1px solid #f0f0f0;
}

/* ===================================
   登录页
   =================================== */
.login-page {
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 420px;
    border-top: 3px solid #c00;
}
.login-box h2 {
    text-align: center;
    margin-bottom: 8px;
    color: #333;
    font-size: 1.5rem;
}
.login-box h2 span {
    border-bottom: 2px solid #c00;
    padding-bottom: 4px;
}
.login-box .subtitle {
    text-align: center;
    color: #999;
    margin-bottom: 28px;
    font-size: 0.95em;
}

/* ===================================
   首页 - 期刊卡片（复用 .article-card 样式）
   =================================== */

/* 期刊主卡片 —— 继承 .article-card 的边框/阴影/悬停效果 */
.issue-card-main {}
.issue-card-main.card {
    padding: 0;
}
.issue-card-main .card-body {
    padding: 16px 20px 12px 20px !important;
}

/* 期刊卡片文章列表 */
.issue-item-articles {
    list-style: none;
    padding: 0;
    margin: 0;
}
.issue-item-articles li {
    padding: 6px 0;
    border-bottom: 1px dashed #f2f2f2;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.issue-item-articles li:last-child {
    border-bottom: none;
}
.issue-item-articles li .art-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    background: #f5f5f5;
    color: #999;
    border-radius: 50%;
    font-size: 0.78em;
}
.issue-item-articles li:first-child .art-num {
    background: #c00;
    color: #fff;
}
.issue-item-articles li .art-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.issue-item-articles li .art-title a {
    color: #212529 !important;
    text-decoration: none;
    font-weight: normal;
    font-size: 1rem;
}
.issue-item-articles li .art-title a:hover {
    color: #c00 !important;
    text-decoration: underline;
}
.issue-item-articles li .art-author {
    color: #bbb;
    font-size: 0.85em;
    flex-shrink: 0;
}

/* ===================================
   响应式
   =================================== */
@media (max-width: 768px) {
    .main-header .site-title {
        font-size: 1.2rem;
    }
    .issue-card-main .card-body {
        padding: 14px 16px;
    }
    .admin-wrapper {
        flex-direction: column;
    }
    .admin-wrapper .sidebar {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: auto;
        max-height: 200px;
    }
    .admin-wrapper .sidebar.collapsed {
        max-height: 60px;
    }
    .admin-wrapper .resize-handle,
    .admin-wrapper .toggle-btn {
        display: none;
    }
    .admin-wrapper .main-content {
        flex: 1;
        height: auto;
        overflow-y: visible;
    }
    .article-detail h1 {
        font-size: 1.3rem;
    }
    .article-content p {
        text-indent: 1.5em;
    }
}

/* ===================================
   期刊卡片 & 图片画廊
   =================================== */
.issue-card {
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.3s;
}
.issue-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}
.issue-cover-wrap {
    height: 300px;
    overflow: hidden;
    border-bottom: 1px solid #eee;
    background: #f5f5f5;
    padding: 16px 16px 0;
}
.issue-cover-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}
.issue-card:hover .issue-cover-img {
    transform: scale(1.03);
}

/* 期刊详细页图片 */
.gallery-img {
    border: 1px solid #eee;
    transition: opacity 0.2s, box-shadow 0.2s;
}
.gallery-img:hover {
    opacity: 0.85;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
