/* 河南省教育科研网镜像站全局样式 */

/* 主题变量定义 */
:root {
    /* 主题色 */
    --primary-color: #0A77FF;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-primary: #0A77FF;
    --footer-bg: #2c3e50;
    --nav-dropdown-bg: #2c3e50;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-light: #999999;
    --text-white: #ffffff;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;
    --border-radius: 4px;
    --border-radius-lg: 8px;
    --border-color: #e5e5e5;
    --border-color-light: #f0f0f0;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-xxl: 24px;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --breakpoint-xs: 576px;
    --breakpoint-sm: 768px;
    --breakpoint-md: 992px;
    --breakpoint-lg: 1200px;
    --breakpoint-xl: 1400px;
    --transition-base: all 0.3s ease;
    --transition-fast: all 0.15s ease;
    --transition-slow: all 0.5s ease;
}

/* 全局重置和基础样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

*:before,
*:after {
    box-sizing: border-box;
}

html {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: 1.6;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
    /* Always reserve the vertical scrollbar gutter so short pages like /news/
       don't shift a few pixels to the right compared to long pages like / . */
    overflow-y: scroll;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: #fff;
    margin: 0;
    padding: 0;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Shared sidebar card chrome — used on / (index), /status/, /news/, /news/<x>/ */
.index-card { border: 1px solid #dee2e6; }
.index-card-header,
.index-card-header h5,
.index-card-header i {
    background-color: #0A77FF;
    color: #ffffff !important;
}
.index-card-header { background-color: #0A77FF; }

/* Shared right-sidebar column — cap card column width + center in col-lg-4
   so /, /status/, /news/, /news/<article>/ all render the sidebar at the
   same width and horizontal position. */
.sidebar-content {
    max-width: 340px;
    margin: 0 auto;
}

/* Shared sidebar link colors so /news/ (layout: default) and
   /news/<article>/ (layout: news) render the 最新公告 list identically. */
.news-link      { color: #333; }
.news-title     { color: #0A77FF; }
.more-link      { color: #0A77FF; }
.contact-link,
.friendly-link  { color: #0A77FF; }

/* 链接样式 */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover,
a:focus {
    color: #0056b3;
    text-decoration: none;
}

/* 图片响应式 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 按钮基础样式 */
button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition-base);
}

/* 输入框基础样式 */
input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-sm) var(--spacing-md);
    transition: var(--transition-base);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(10, 119, 255, 0.2);
}

/* 列表样式重置 */
ul,
ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-semibold);
    line-height: 1.4;
    margin: 0 0 var(--spacing-md) 0;
    color: var(--text-primary);
}

h1 { font-size: var(--font-size-xxl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }
h4 { font-size: var(--font-size-base); }
h5 { font-size: var(--font-size-sm); }
h6 { font-size: var(--font-size-xs); }

/* 段落样式 */
p {
    margin: 0 0 var(--spacing-md) 0;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

@media (min-width: 768px)  { .container { padding: 0 var(--spacing-lg); } }
@media (min-width: 1200px) { .container { padding: 0 var(--spacing-xl); } }
@media (min-width: 1800px) { .container { max-width: 1720px; } }

/* 页面布局 */
.main-content {
    min-height: calc(100vh - 200px);
    padding: var(--spacing-lg) 0;
}

/* 渐变背景 */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0056b3 100%);
}

/* 头部导航样式 - 使用河南省教育科研网主站样式 */
.navbar {
    display: none !important; /* 隐藏Bootstrap导航栏 */
}

/* 河南省教育科研网主站导航栏样式 - 强制白色背景 */
.header {
    width: 100%;
    background-color: #ffffff !important;
    background: #ffffff !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-base);
}

.header-wrapper {
    width: 100%;
}

/* 滚动时页眉样式 - 确保白色背景 */
.header.scrolled {
    background-color: #ffffff !important;
    background: #ffffff !important;
    box-shadow: var(--shadow-lg);
    border-bottom: 1px solid #d0d0d0;
}

/* 新增：向下滚动时隐藏页眉 */
.header.header-hidden {
    transform: translateY(-100%);
}

/* Header now flows in-document; no body padding-top reserved.
   Use flex column + min-height so the footer sticks to the bottom
   when page content is shorter than the viewport. */
html { height: 100%; }
body {
    padding-top: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body > footer.footer { margin-top: auto; }

#navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    max-width: 1600px;
    margin: 0 auto;
    min-height: 60px;
    gap: var(--spacing-lg);
}

.header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.CompanyLogo {
    height: 40px;
    cursor: pointer;
    transition: var(--transition-base);
    filter: none;
}

.CompanyLogo:hover {
    transform: scale(1.05);
}

.navbarCenter {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: var(--spacing-md);
}

.nav-list li {
    margin: 0 var(--spacing-sm);
    position: relative;
    list-style: none;
}

.nav-list li a {
    color: var(--text-primary);
    text-decoration: none;
    padding: var(--spacing-md) var(--spacing-md);
    border-radius: var(--border-radius);
    transition: var(--transition-base);
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    position: relative;
    white-space: nowrap; /* 防止文字换行 */
}

.nav-list li a:hover {
    background-color: rgba(10, 119, 255, 0.1);
    color: var(--primary-color) !important;
}

/* 当前页样式 - 只有当前页显示蓝色 */
.nav-list li a.current-page {
    color: var(--primary-color) !important;
    background: rgba(10,119,255,0.1);
    border-bottom: 2px solid var(--primary-color);
}

/* 子菜单样式 - 使用与页脚一致的颜色 */
.nav-list .submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--nav-dropdown-bg) !important; /* 与页脚颜色一致，强制覆盖 */
    color: var(--text-white) !important;
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    border: 2px solid #34495e;
    border-radius: var(--border-radius-lg);
    display: none;
    z-index: 1001;
    padding: var(--spacing-sm) 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--transition-base);
    list-style: none;
}

.nav-list .submenu li {
    margin: 0;
    width: 100%;
    list-style: none;
}

.nav-list .submenu li a {
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--text-white) !important; /* 白色文字，强制覆盖 */
    background: transparent !important;
    font-weight: var(--font-weight-medium);
    border-bottom: 1px solid rgba(255,255,255,0.18);
    text-shadow: 0 1px 2px rgba(0,0,0,0.12);
    transition: var(--transition-fast);
    display: block;
}

.nav-list .submenu li:last-child a {
    border-bottom: none;
}

.nav-list .submenu li a:hover {
    background: #34495e !important;
    color: var(--text-white) !important;
}

/* 悬停显示子菜单 */
.nav-list .has-submenu:hover .submenu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 主导航链接悬停效果 */
.nav-list .has-submenu > a {
    position: relative;
    transition: var(--transition-fast);
}

.nav-list .has-submenu > a:hover {
    color: var(--primary-color) !important;
}

/* 移动端菜单样式 - 优化汉堡菜单按钮，与页脚颜色一致且更靠右占用空间小 */
.menu-icon {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: var(--spacing-xs) var(--spacing-sm); /* 减小内边距以占用更小空间 */
    background: var(--nav-dropdown-bg) !important; /* 与页脚颜色一致，强制覆盖 */
    color: var(--text-white);
    border: none;
    border-radius: var(--border-radius); /* 稍微减小圆角 */
    transition: var(--transition-base);
    z-index: 1003;
    width: 40px; /* 设置固定宽度，占用空间更小 */
    height: 32px; /* 设置固定高度 */
    align-self: center;
    margin-left: auto; /* 靠右对齐 */
    margin-right: var(--spacing-sm); /* 给右边留少量间距 */
    box-shadow: var(--shadow-sm);
    justify-content: center; /* 居中对齐横线 */
    align-items: center;
}

.menu-icon:hover {
    background-color: #34495e !important; /* 强制覆盖 */
    transform: scale(1.05);
    box-shadow: var(--shadow-md); /* 悬停时增强阴影 */
}

.menu-icon:focus {
    outline: 2px solid #ffffff; /* 增加焦点状态 */
    outline-offset: 2px;
}

.menu-icon .bar {
    width: 18px; /* 减小横线宽度 */
    height: 2px;
    background-color: #ffffff !important; /* 白色横线，强制覆盖 */
    margin: 2px 0; /* 减小间距 */
    transition: var(--transition-base);
    border-radius: 2px;
    display: block;
}

.menu-icon.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-icon.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-icon.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* 确保汉堡菜单按钮在小屏幕上显示 */
@media (max-width: 768px) {
    .menu-icon {
        display: flex !important;
        visibility: visible !important;
    }
    
    /* 确保导航列表在桌面端隐藏汉堡菜单按钮 */
    @media (min-width: 769px) {
        .menu-icon {
            display: none !important;
        }
    }
}

/* 响应式设计 - 防止文字换行 */
@media (max-width: 1400px) {
    .nav-list li a {
        padding: 10px 14px;
    }
}

@media (max-width: 1200px) {
    .nav-list li a {
        padding: 8px 12px;
    }
    .nav-list li {
        margin: 0 4px;
    }
}

@media (max-width: 992px) {
    .nav-list li a {
        padding: 6px 10px;
    }
    .nav-list li {
        margin: 0 2px;
    }
}

@media (max-width: 850px) {
    .nav-list li a {
        padding: 5px 8px;
    }
    .nav-list li {
        margin: 0 1px;
    }
}

@media (max-width: 768px) {
    /* 导航栏布局调整 */
    #navbar {
        flex-wrap: wrap;
        position: relative;
        padding: var(--spacing-sm) var(--spacing-md);
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 50px;
    }
    
    .header-left {
        order: 1;
        flex: 1;
    }
    
    .header-center {
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }
    
    /* 汉堡菜单按钮显示 */
    .menu-icon {
        display: flex !important;
        order: 2;
        z-index: 1003;
        position: relative;
        margin-left: auto;
        margin-right: var(--spacing-sm);
        flex-shrink: 0; /* 防止按钮被压缩 */
        background: var(--nav-dropdown-bg) !important; /* 与页脚颜色一致 */
        color: var(--text-white);
        border: none;
        border-radius: var(--border-radius);
        width: 40px;
        height: 32px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: var(--transition-base);
        box-shadow: var(--shadow-sm);
    }
    
    .menu-icon:hover {
        background-color: #34495e !important;
        transform: scale(1.05);
        box-shadow: var(--shadow-md);
    }
    
    .navbarCenter {
        width: 100%;
        position: relative;
        order: 3;
    }
    
    /* 移动端导航列表样式 */
    .nav-list {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #ffffff !important;
        flex-direction: column;
        display: none !important; /* 默认隐藏 */
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border-color);
        z-index: 1002;
        max-height: 80vh; /* 限制最大高度 */
        overflow-y: auto; /* 允许滚动 */
        margin: 0;
        padding: 0;
        list-style: none;
    }
    
    /* 激活状态显示菜单 */
    .nav-list.active {
        display: flex !important;
    }
    
    .nav-list li {
        margin: 0;
        width: 100%;
        list-style: none;
    }
    
    /* 移动端一级菜单样式 - 白色背景，深色文字，无下划线 */
    .nav-list li a {
        padding: var(--spacing-md) var(--spacing-lg);
        border-radius: 0;
        border-bottom: none !important; /* 移除下划线 */
        color: var(--text-primary) !important; /* 深色文字 */
        background-color: #ffffff !important; /* 白色背景 */
        font-size: var(--font-size-base);
        white-space: normal; /* 移动端允许换行 */
        text-decoration: none;
        display: block;
        transition: var(--transition-base);
    }
    
    .nav-list li a:hover {
        background-color: var(--light-color) !important; /* 浅灰色悬停背景 */
        color: var(--primary-color) !important; /* 蓝色悬停文字 */
    }
    
    /* 移动端隐藏二级菜单 - 只显示一级菜单 */
    .nav-list .submenu {
        display: none !important; /* 移动端完全隐藏二级菜单 */
    }
    
    /* 移动端子菜单显示控制 - 禁用 */
    .nav-list .has-submenu.active .submenu {
        display: none !important; /* 即使激活状态也不显示二级菜单 */
    }
    
    /* 移动端有子菜单的一级菜单项样式调整 */
    .nav-list .has-submenu > a {
        cursor: default; /* 移动端不可点击展开 */
    }
    
    .CompanyLogo {
        height: 35px;
    }
    
    /* 移除当前页高亮在移动端的下划线 */
    .nav-list li a.current-page {
        border-bottom: none !important;
        background-color: rgba(10, 119, 255, 0.1) !important;
        color: var(--primary-color) !important;
    }
}

/* ====== 导航与菜单优化 ====== */

/* 桌面端二级菜单底色与页脚一致，增强可读性 */
.nav-list .submenu {
    background-color: #2c3e50 !important;
    color: #fff !important;
    box-shadow: 0 6px 20px rgba(44,62,80,0.18);
    border: 2px solid #34495e;
    border-radius: 8px;
    padding: 8px 0;
}
.nav-list .submenu li a {
    color: #fff !important;
    background: transparent !important;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.18);
    text-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.nav-list .submenu li a:hover {
    background: #34495e !important;
    color: #fff !important;
}

/* 移动端二级菜单同色，增强分隔线和阴影 */
@media (max-width: 768px) {
    .nav-list .submenu {
        background-color: #2c3e50 !important;
        border-left: 3px solid #34495e;
        box-shadow: none;
        border-radius: 0;
    }
    .nav-list .submenu li a {
        background: #2c3e50 !important;
        color: #fff !important;
        border-bottom: 1px solid rgba(255,255,255,0.18);
        font-weight: 500;
        text-shadow: 0 1px 2px rgba(0,0,0,0.12);
    }
    .nav-list .submenu li a:hover {
        background: #34495e !important;
        color: #fff !important;
    }
}

/* 汉堡按钮底色与页脚一致，靠右且占用空间小 */
.menu-icon {
    background: #2c3e50 !important;
    color: #fff;
    width: 40px;
    height: 32px;
    margin-left: auto;
    margin-right: 8px;
    box-shadow: 0 2px 6px rgba(44,62,80,0.18);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: none;
    padding: 6px 8px;
    z-index: 1003;
}
.menu-icon .bar {
    background: #fff !important;
}
@media (max-width: 768px) {
    .menu-icon {
        display: flex !important;
        visibility: visible !important;
    }
}
@media (min-width: 769px) {
    .menu-icon {
        display: none !important;
    }
}

/* 移动端菜单展开样式优化 */
@media (max-width: 768px) {
    .nav-list {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff !important;
        flex-direction: column;
        display: none !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        border-top: 1.5px solid #e5e5e5;
        border-radius: 0 0 12px 12px;
        z-index: 1002;
        max-height: 90vh;
        overflow-y: visible;
        padding: 0.2rem 0 0.2rem 0;
        margin: 0;
        transition: box-shadow 0.2s, border-radius 0.2s;
        align-items: center;
        justify-content: flex-start;
    }
    .nav-list.open {
        display: flex !important;
        animation: navListFadeIn 0.25s;
    }
    @keyframes navListFadeIn {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
    .nav-list li {
        margin: 0;
        width: 100%;
        text-align: center;
    }
    .nav-list li a {
        padding: 0.85rem 0.5rem;
        font-size: 1rem; /* 与镜像列表表格一致 */
        border-radius: 6px;
        color: #222;
        background: none;
        border: none;
        box-shadow: none;
        transition: background 0.15s, color 0.15s;
        font-weight: 500;
        text-align: center;
        display: inline-block;
        width: auto;
        margin: 0 auto;
        line-height: 1.6;
    }
    .nav-list li a.current-page,
    .nav-list li a:active,
    .nav-list li a:focus {
        color: #0A77FF !important;
        background: rgba(10,119,255,0.08);
        border-bottom: none;
        box-shadow: none;
    }
    .nav-list li a:hover {
        background: rgba(10,119,255,0.12);
        color: #0A77FF !important;
    }
    .nav-list .submenu {
        position: static;
        background: #f8f9fa !important;
        color: #222 !important;
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 0.2rem 0 0.2rem 0;
        margin: 0.2rem 0 0.2rem 0;
        display: none;
        opacity: 1;
        transform: none;
        min-width: 0;
    }
    .nav-list li.has-submenu.open > .submenu {
        display: block;
    }
    .nav-list .submenu li a {
        padding: 0.7rem 0.5rem;
        color: #0A77FF !important;
        background: none !important;
        border-bottom: none;
        font-size: 0.98rem;
        border-radius: 4px;
        text-align: center;
        width: auto;
        margin: 0 auto;
    }
    .nav-list .submenu li a:hover {
        background: rgba(10,119,255,0.08);
        color: #0056b3 !important;
    }
}

/* 首页高亮修正：仅主页或镜像页高亮 */
.nav-list li a.current-page {
    color: var(--primary-color) !important;
    background: rgba(10,119,255,0.1);
    border-bottom: 2px solid var(--primary-color);
}

/* 确保所有列表项没有小圆点 */
.nav-list,
.nav-list *,
.submenu,
.submenu * {
    list-style: none !important;
    list-style-type: none !important;
}

.nav-list li::before,
.submenu li::before {
    content: none !important;
}

/* 动态文字大小 */
@media (max-width: 1400px) {
    .nav-list li a {
        padding: 10px 14px;
    }
}

@media (max-width: 1200px) {
    .nav-list li a {
        padding: 8px 12px;
    }
    
    .nav-list li {
        margin: 0 4px;
    }
}

@media (max-width: 992px) {
    .nav-list li a {
        padding: 6px 10px;
    }
    
    .nav-list li {
        margin: 0 2px;
    }
}

@media (max-width: 850px) {
    .nav-list li a {
        padding: 5px 8px;
    }
    
    .nav-list li {
        margin: 0 1px;
    }
}

/* 桌面端悬停时的细微动画 */
@media (min-width: 769px) {
    .nav-list li {
        transition: transform 0.2s ease;
    }
    
    .nav-list li:hover {
        transform: translateY(-1px);
    }
}

.mirror-header {
    border-bottom: 1px solid #dee2e6;
}

.mirror-header h1 {
    color: var(--primary-color);
    font-weight: 700;
}

/* 卡片样式 */
.card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.feature-card,
.mirror-card,
.help-card {
    cursor: pointer;
    height: 100%;
}

.feature-card:hover,
.mirror-card:hover,
.help-card:hover {
    border-color: var(--primary-color);
}

/* 统计卡片 */
.stats-card {
    backdrop-filter: blur(10px);
}

.stat-item {
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: scale(1.05);
}

/* 按钮样式 */
.btn {
    transition: all 0.3s ease;
    border-radius: 6px;
}

.btn:hover {
    transform: translateY(-2px);
}

/* 徽章样式 */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

/* 进度条样式 */
.progress {
    border-radius: 10px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* 表格样式 */
.table {
    border-radius: 8px;
    overflow: hidden;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
    background-color: var(--light-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

/* 模态框样式 */
.modal-content {
    border-radius: 10px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: var(--light-color);
}

/* 警告框样式 */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* 搜索框样式 */
.search-box .form-control {
    border-radius: 25px;
    padding-left: 1rem;
}

.search-box .btn {
    border-radius: 25px;
}

/* 导航样式 */
.nav-link {
    transition: all 0.3s ease;
    border-radius: 6px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* ISO modal tab bar (os / app / font) — keep Bootstrap's tab edges square */
#isoModal .nav-tabs .nav-link,
#isoModal .nav-tabs .nav-link.active {
    border-radius: 0;
}

/* 新增：动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* 新增：搜索框增强 */
.search-box .form-control {
    border-radius: 25px;
    border-right: none;
    padding-left: 20px;
}

.search-box .btn {
    border-radius: 25px;
    border-left: none;
    background: transparent;
}

/* 新增：状态指示器 */
.status-indicator {
    position: relative;
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-indicator.success {
    background-color: var(--success-color);
    box-shadow: 0 0 6px rgba(25, 135, 84, 0.4);
}

.status-indicator.warning {
    background-color: var(--warning-color);
    box-shadow: 0 0 6px rgba(255, 193, 7, 0.4);
}

.status-indicator.danger {
    background-color: var(--danger-color);
    box-shadow: 0 0 6px rgba(220, 53, 69, 0.4);
}

.status-indicator.syncing {
    background-color: var(--info-color);
    animation: pulse 1.5s infinite;
}

/* 新增：镜像表格增强 */
.mirror-table-container {
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0;
    margin: 0;
}
.mirror-table {
    border: none !important;
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin-bottom: 1rem;
    width: 100%;
    min-width: 0;
    table-layout: auto;
}
.mirror-table thead th {
    background: #f8f9fa !important;
    color: #222 !important;
    font-weight: 600;
    border: none;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
}
.mirror-table tbody tr {
    border-bottom: 1px solid #ececec;
    transition: background 0.2s;
    background: none !important;
}
.mirror-table tbody tr:last-child {
    border-bottom: none;
}
.mirror-table td {
    vertical-align: middle;
    border: none;
    background: none !important;
    font-size: 1rem;
    padding: 0.75rem 0.5rem;
    word-break: break-all;
}
.mirror-table a.mirror-help-link {
    margin-left: 0.5em;
    color: var(--primary-color);
    font-size: 1.1em;
    vertical-align: middle;
}
.mirror-table a.mirror-help-link:hover {
    color: #0056b3;
    text-decoration: none;
}
.mirror-table tr:hover {
    background: var(--light-color) !important;
}

/* 移动端适配 */
/* 已移除 .mirror-table 在 max-width: 768px 下的响应式样式，保持表格布局一致 */

/* 响应式布局优化 */
@media (max-width: 991.98px) {
    #mirror-list {
        margin-bottom: 2rem;
    }
    
    .sidebar-card {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 767.98px) {
    .sidebar-card .card-header h5 {
        font-size: 1rem;
    }
    
    .sidebar-card .card-body {
        padding: 0.75rem;
    }
}

/* 响应式优化 */
@media (max-width: 768px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .btn-group .btn {
        font-size: 0.875rem;
        padding: 0.375rem 0.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .mirror-icon {
        display: none;
    }
    
    .stat-item h4 {
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    .display-4 {
        font-size: 1.75rem;
    }
    
    .stats-section .display-4 {
        font-size: 2rem;
    }
}

/* 加载动画 */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 打印样式 */
@media print {
    .navbar,
    .footer,
    .btn,
    .modal {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .card {
        border: 1px solid #000;
        break-inside: avoid;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn {
        border: 2px solid;
    }
    
    .text-muted {
        color: #000 !important;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =========================================================
 * Dark mode — aligned with www.ha.edu.cn's palette:
 *   brand blue     #437EF7  (hover #5390F8)
 *   dark surface   #2C3444  (parent site footer bg)
 *   text primary   #F9F9F9  (neutral-200)
 *   text muted     #A5ACBA
 * Surface ramp: body #1a1d24 → card #2C3444 → elevated #374155
 * ========================================================= */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #437EF7;
        --primary-hover: #5390F8;
        --text-primary:   #F9F9F9;
        --text-secondary: #A5ACBA;
        --text-light:     #6b7280;
        --border-color:       #3a4154;
        --border-color-light: #2C3444;
        --light-color:    #2C3444;
        --shadow-sm: 0 2px 4px rgba(0,0,0,0.35);
        --shadow-md: 0 2px 8px rgba(0,0,0,0.45);
        --shadow-lg: 0 4px 16px rgba(0,0,0,0.55);
        --bs-body-bg:    #1a1d24;
        --bs-body-color: #F9F9F9;
    }

    body {
        background-color: #1a1d24;
        color: var(--text-primary);
    }

    /* Header matches parent site style even in dark: neutral bar, dark text
       kept legible against #1a1d24. */
    .header,
    .header.scrolled,
    .header:hover {
        background: #2C3444 !important;
        background-color: #2C3444 !important;
        border-bottom-color: #3a4154 !important;
    }

    .nav-list li a,
    .nav-list > li > a,
    .nav-list > li > a.current-page {
        color: var(--text-primary) !important;
    }

    .nav-list li a:hover {
        background-color: rgba(67, 126, 247, 0.14) !important;
        color: var(--primary-color) !important;
    }

    .nav-list .submenu {
        background: #374155 !important;
    }
    .nav-list .submenu li a { color: var(--text-primary) !important; }

    @media (max-width: 768px) {
        .nav-list {
            background: #2C3444 !important;
            border-top-color: #3a4154 !important;
        }
        .nav-list li a,
        .nav-list li a.current-page,
        .nav-list li a:active,
        .nav-list li a:focus {
            color: var(--text-primary) !important;
            background: transparent !important;
        }
    }

    a { color: var(--primary-color); }
    a:hover, a:focus { color: var(--primary-hover); }

    /* Any "white" surface becomes the dark card color. */
    .bg-white,
    .bg-light {
        background-color: #2C3444 !important;
        color: var(--text-primary) !important;
    }

    main { color: var(--text-primary); }

    .text-muted,
    .text-white-50,
    small.text-muted {
        color: var(--text-secondary) !important;
    }

    .card {
        background-color: #2C3444;
        border-color: #3a4154;
        color: var(--text-primary);
    }

    .card-body { color: var(--text-primary); }

    .card-header,
    .index-card-header,
    .status-card-header,
    .page-card-header,
    .news-card-header {
        background-color: #374155 !important;
        color: var(--text-primary) !important;
        border-bottom-color: #3a4154 !important;
    }

    /* Form controls */
    input, textarea, select,
    .form-control, .form-select {
        background-color: #1a1d24;
        color: var(--text-primary);
        border-color: #3a4154;
    }

    input:focus, textarea:focus, select:focus,
    .form-control:focus, .form-select:focus {
        background-color: #22262e;
        color: var(--text-primary);
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(67, 126, 247, 0.25);
    }

    .form-control::placeholder { color: var(--text-light); }

    .btn-outline-primary {
        color: var(--primary-color);
        border-color: var(--primary-color);
    }
    .btn-outline-primary:hover {
        background-color: var(--primary-color);
        color: #fff;
    }
    .btn-outline-secondary {
        color: var(--text-secondary);
        border-color: #3a4154;
    }
    .btn-outline-secondary:hover {
        background-color: #374155;
        color: var(--text-primary);
    }

    /* Tables */
    .table {
        --bs-table-bg: transparent;
        --bs-table-color: var(--text-primary);
        --bs-table-striped-bg: rgba(255,255,255,0.03);
        --bs-table-hover-bg: rgba(67,126,247,0.08);
        --bs-table-border-color: #3a4154;
        color: var(--text-primary);
    }

    .table th,
    .table-light thead th,
    .mirror-table thead th {
        background: #374155 !important;
        color: var(--text-primary) !important;
        border-color: #3a4154 !important;
    }

    .mirror-table tbody tr { border-bottom-color: #3a4154; }
    .mirror-table tr:hover,
    .table-hover > tbody > tr:hover > * {
        background: rgba(67,126,247,0.08) !important;
        color: var(--text-primary) !important;
    }

    /* Bootstrap tooltip (the floating popover visible on mirror rows). */
    .tooltip-inner {
        background-color: #374155;
        color: var(--text-primary);
        border: 1px solid #3a4154;
    }
    .tooltip .tooltip-arrow::before,
    .tooltip .arrow::before,
    .bs-tooltip-auto[data-popper-placement^="top"] .tooltip-arrow::before,
    .bs-tooltip-top .tooltip-arrow::before {
        border-top-color: #374155;
    }
    .bs-tooltip-auto[data-popper-placement^="bottom"] .tooltip-arrow::before,
    .bs-tooltip-bottom .tooltip-arrow::before {
        border-bottom-color: #374155;
    }
    .bs-tooltip-auto[data-popper-placement^="left"] .tooltip-arrow::before,
    .bs-tooltip-start .tooltip-arrow::before {
        border-left-color: #374155;
    }
    .bs-tooltip-auto[data-popper-placement^="right"] .tooltip-arrow::before,
    .bs-tooltip-end .tooltip-arrow::before {
        border-right-color: #374155;
    }

    /* Modals */
    .modal-content {
        background-color: #2C3444;
        color: var(--text-primary);
        border: 1px solid #3a4154;
    }
    .modal-header {
        background-color: #374155;
        border-bottom-color: #3a4154;
    }
    .modal-footer { border-top-color: #3a4154; }
    .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

    /* Alerts */
    .alert-info    { background-color: #0d3345; color: #9fdcf5; border-color: #164a65; }
    .alert-warning { background-color: #3a2e10; color: #ffd98a; border-color: #5a4410; }
    .alert-danger  { background-color: #3d1a1f; color: #f8b4bc; border-color: #5a2630; }
    .alert-success { background-color: #17361f; color: #6fd38a; border-color: #2a4a30; }

    .badge.bg-warning { color: #1a1d24 !important; }
    .badge.bg-secondary { background-color: #4a5568 !important; }

    /* Dividers */
    hr { border-color: #3a4154; opacity: 1; }

    /* Pagination */
    .pagination .page-link {
        background-color: #2C3444;
        border-color: #3a4154;
        color: var(--primary-color);
    }
    .pagination .page-link:hover { background-color: #374155; color: var(--primary-hover); }
    .pagination .page-item.active .page-link {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
        color: #fff;
    }
    .pagination .page-item.disabled .page-link {
        background-color: #2C3444;
        border-color: #3a4154;
        color: var(--text-light);
    }

    /* Scrollbars */
    ::-webkit-scrollbar-track { background: #1a1d24; }
    ::-webkit-scrollbar-thumb { background: #3a4154; }
    ::-webkit-scrollbar-thumb:hover { background: #4a5568; }

    .spinner-border.text-primary { color: var(--primary-color) !important; }
}

/* Right sidebar — flows in natural document order, no sticky/scroll. */
@media (min-width: 992px) {
    .sidebar-content .card {
        margin-bottom: 1rem;
        transition: box-shadow 0.2s ease, transform 0.2s ease;
    }
    .sidebar-content .card:last-child {
        margin-bottom: 0;
    }
    .sidebar-content .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(10, 119, 255, 0.1);
    }
}

