/* style.css - 微型网络信息管理系统主题样式 (无侧边栏版本，内容区域铺满) */

/* ==========================================================================
   1. 全局重置与基础样式
   ========================================================================== */
* {
    box-sizing: border-box; /* 统一盒模型 */
    margin: 0;              /* 移除默认外边距 */
    padding: 0;             /* 移除默认内边距 */
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif; /* 现代字体栈 */
    line-height: 1.6;        /* 基础行高 */
    color: var(--text-color); /* 基础文字颜色 */
    background-color: var(--light-bg); /* 页面背景色 */
    display: flex;           /* Flex 布局，使页脚始终在底部 */
    flex-direction: column;  /* Flex 方向为列 */
    min-height: 100vh;       /* 最小高度为视口高度 */
}

a {
    text-decoration: none; /* 移除链接下划线 */
    color: inherit;        /* 链接颜色继承父元素 */
}

ul {
    list-style: none; /* 移除列表默认标记 */
}
.text-center {
    text-align: center;
}
/* ==========================================================================
   2. 主题色变量 (方便管理和修改)
   ========================================================================== */
:root {
    --primary-color: #007bff;          /* 主科技蓝 */
    --primary-dark: #0056b3;           /* 深科技蓝 */
    --secondary-color: #6c757d;        /* 次要灰色 */
    --text-color: #333;                /* 主要文字色 */
    --light-bg: #f4f7fa;               /* 页面背景色 */
    --card-bg: #ffffff;                /* 卡片背景色（用于内容区、下拉菜单） */
    --border-color: #e0e6ed;           /* 边框颜色 */
    --header-bg: #343a40;              /* 导航栏背景 (深灰/黑) */
    --header-text: #ffffff;            /* 导航栏文字色 */
    --hover-bg-light: #f1f1f1;         /* 浅色悬停背景 */
}

/* ==========================================================================
   3. 登录页面特定样式
   ========================================================================== */
.login-body {
    background-color: var(--primary-color); /* 整个登录页背景是科技蓝 */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0; /* 确保无外边距 */
}

.login-container {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* 柔和阴影 */
    width: 100%;
    max-width: 400px; /* 最大宽度 */
    text-align: center;
}

.login-header h1 {
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-size: 28px;
}

.login-header p {
    color: var(--secondary-color);
    margin-bottom: 30px;
    font-size: 15px;
}

.login-footer {
    margin-top: 30px;
    color: var(--secondary-color);
    font-size: 12px;
}

/* ==========================================================================
   4. 按钮样式
   ========================================================================== */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease, transform 0.1s ease; /* 添加动画 */
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px); /* 轻微上浮效果 */
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}
.btn-secondary:active {
    transform: translateY(0);
}

.btn-action { /* 用于编辑、查看等操作 */
    background-color: #28a745; /* 绿色 */
    color: white;
    padding: 6px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-right: 5px; /* 按钮间距 */
    transition: background-color 0.3s ease;
}

.btn-action:hover {
    background-color: #218838;
}

.btn-danger { /* 用于删除、禁用等操作 */
    background-color: #dc3545; /* 红色 */
    color: white;
    padding: 6px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

.btn-danger:hover {
    background-color: #c82333;
}

/* ==========================================================================
   5. 表单元素样式
   ========================================================================== */
.form-group {
    margin-bottom: 15px;
    text-align: left; /* 表单项左对齐 */
}

.form-group label {
    display: block; /* 标签独立一行 */
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--text-color);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group select,
.form-group textarea,
.search-input {
    width: 100%; /* 输入框宽度100% */
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-color);
    background-color: var(--card-bg);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus,
.form-group textarea:focus,
.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); /* 聚焦蓝色阴影 */
    outline: none; /* 移除默认外边框 */
}

.search-input {
    width: auto; /* 搜索框宽度自适应 */
    min-width: 150px; /* 最小宽度 */
    margin-right: 10px;
}

/* ==========================================================================
   6. 顶部导航栏 (Navbar)
   ========================================================================== */
.navbar {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000; /* 确保导航栏在最上层 */
    position: relative; /* 为下拉菜单定位提供上下文 */
}

.navbar-brand a {
    color: var(--header-text);
    font-size: 24px;
    font-weight: bold;
    transition: color 0.3s ease;
}

.navbar-brand a:hover {
    color: var(--primary-color); /* 悬停变科技蓝 */
}

.main-nav ul {
    display: flex; /* 使主导航项横向排列 */
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative; /* 为下拉菜单定位提供上下文 */
    margin-left: 30px;
}

.nav-item > a {
    color: var(--header-text);
    padding: 10px 0;
    display: block;
    font-size: 16px;
    transition: color 0.3s ease;
}

.nav-item > a:hover {
    color: var(--primary-color);
}

.nav-item.active > a { /* 当前活动主菜单项 */
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color); /* 底部高亮线 */
    padding-bottom: 8px; /* 调整间距 */
}

.nav-item.has-submenu > a {
    display: flex;
    align-items: center;
}

.arrow-down {
    margin-left: 5px;
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--header-text); /* 箭头颜色 */
    transition: transform 0.3s ease;
}

/* Ensure submenu hides by default */
.submenu {
    display: none;
    position: absolute;
    background-color: var(--card-bg);
    min-width: 180px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 4px;
    padding: 10px 0;
    top: 100%;
    left: 0;
    list-style: none;
    transition: opacity 0.2s ease; /* Smooth transition */
    opacity: 0;
}

/* Show submenu on hover with fade effect */
.nav-item.has-submenu:hover .submenu {
    display: block;
    opacity: 1;
}

/* Ensure submenu stays visible while hovering over it */
.submenu:hover {
    display: block;
    opacity: 1;
}

/* Optional: Add a small delay or adjust positioning if needed */
.nav-item.has-submenu {
    position: relative;
}

.submenu li {
    /* 确保列表项自身没有特殊的flex或grid布局，保持默认块级流 */
}

.submenu li a {
    color: var(--text-color);
    padding: 10px 20px;
    display: block; /* 确保链接占据整个列表项宽度 */
    font-size: 14px;
    transition: background-color 0.3s ease, color 0.3s ease;
    /* 解决文字垂直排列问题的关键CSS */
    writing-mode: horizontal-tb; /* 强制文本横向排列 */
    text-orientation: mixed;     /* 确保文本方向正常 */
    white-space: nowrap;         /* 防止文字意外换行到新行，保持单行显示 */
}

.submenu li a:hover {
    background-color: var(--hover-bg-light);
    color: var(--primary-color);
}

/* 导航右侧的用户信息 */
.nav-item.nav-right {
    margin-left: auto; /* 将此项推到最右侧 */
}

/* ==========================================================================
   7. 主内容区域布局 (无侧边栏调整)
   ========================================================================== */
.main-content {
    display: flex; /* Flex 布局 */
    flex: 1;       /* 占据剩余空间，使页脚保持在底部 */
    padding: 20px 30px; /* 页面内容左右的内边距 */
    background-color: var(--light-bg);
    /* 移除 justify-content: center; 让内容区域自然铺满 */
    /* justify-content: center; */
}

/* ==========================================================================
   8. 侧边栏 (Sidebar) - 已移除，相关样式已注释
   ========================================================================== */
/* .sidebar {
    ...
} */

/* ==========================================================================
   9. 内容区域 (Content Area)
   ========================================================================== */
.content-area {
    flex-grow: 1; /* 占据剩余宽度 */
    background-color: var(--card-bg);
    padding: ·0px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    /* >>> 关键修改：移除 max-width，让其铺满可用空间 <<< */
    /* max-width: 1200px; */ /* 限制内容区域的最大宽度，使其在宽屏上不会太宽 */
    width: 100%; /* 确保它在没有侧边栏时占据可用宽度 */
}

.content-area h2 {
    color: var(--primary-dark);
    margin-bottom: 15px;
    font-size: 28px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

/* 工具栏 - 搜索与按钮 */
.toolbar {
    display: flex;
    align-items: center;
    gap: 10px; /* 元素间间距 */
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap; /* 允许元素在空间不足时换行 */
}

/* ==========================================================================
   10. 数据表格样式
   ========================================================================== */
.data-table-container {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow-x: auto; /* 保证表格在小屏幕下可滚动 */
    margin-top: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse; /* 单元格边框合并 */
    font-size: 14px;
}

.data-table th, .data-table td {
    padding: 10px 6px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.data-table thead th {
    background-color: #e9ecef; /* 表头背景色 */
    font-weight: bold;
    color: #495057;
}

.data-table tbody tr:nth-child(even) { /* 隔行变色 */
    background-color: #f8f9fa;
}

.data-table tbody tr:hover {
    background-color: #e2e6ea; /* 行悬停效果 */
}

/* assets/css/style.css 中追加 */
.data-table th,
.data-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table td.platform-url,
.data-table td.verified-info,
.data-table td.content-summary {
    max-width: 220px;
}

/* ==========================================================================
   11. 分页样式
   ========================================================================== */
.pagination {
    display: flex;
    justify-content: center; /* 居中显示 */
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.pagination a {
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 36px;
    padding: 0 12px;
    text-decoration: none;
    border: 1px solid #ddd;
    margin: 0;
    border-radius: 4px;
    line-height: 1;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.pagination a.active {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.pagination a:hover:not(.active) {
    background-color: #ddd;
}

.pagination a.disabled {
    color: #9ca3af;
    background: #f5f6f8;
    border-color: #e5e7eb;
    pointer-events: none;
    cursor: not-allowed;
}

.pagination .page-nav {
    min-width: 86px;
}

.pagination .pagination-info,
.pagination .pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    color: #6b7280;
    font-size: 13px;
    white-space: nowrap;
}

.pagination .pagination-info {
    margin-right: 4px;
}

.pagination .pagination-ellipsis {
    padding: 0 2px;
}

/* ==========================================================================
   12. 仪表盘 (Dashboard) 小部件样式
   ========================================================================== */
.dashboard-widgets {
    display: grid; /* 网格布局 */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 响应式列 */
    gap: 20px;
    margin-top: 20px;
}

.widget {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 20px;
}

.widget h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 18px;
}

.widget ul {
    list-style: none;
    padding: 0;
}

.widget ul li {
    padding: 5px 0;
    border-bottom: 1px dashed #eee; /* 虚线分隔 */
    font-size: 14px;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget p {
    font-size: 14px;
    line-height: 1.8;
}

/* ==========================================================================
   13. 密码修改页面特定样式
   ========================================================================== */
.password-form-container {
    max-width: 500px;
    margin: 30px auto; /* 居中显示 */
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.password-form .btn-primary {
    width: auto;
    display: block;
    margin-top: 20px;
    padding: 12px 25px;
}


/* ==========================================================================
   14. 页脚 (Footer)
   ========================================================================== */
.footer {
    background-color: var(--header-bg);
    color: var(--header-text);
    text-align: center;
    padding: 20px;
    font-size: 14px;
    margin-top: auto; /* 将页脚推到页面底部 */
}

/* ==========================================================================
   15. 响应式考虑 (基础 - 无侧边栏调整)
   ========================================================================== */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column; /* 小屏幕下导航栏垂直排列 */
        padding: 15px 20px;
    }

    .navbar-brand {
        margin-bottom: 15px;
    }

    .main-nav ul {
        flex-direction: column; /* 小屏幕下主导航项垂直排列 */
        width: 100%;
        align-items: flex-start;
    }

    .nav-item {
        margin-left: 0;
        width: 100%;
        text-align: center; /* 导航项文字居中 */
    }

    .nav-item > a {
        padding: 10px 0;
        width: 100%;
    }

    .nav-item.nav-right {
        margin-left: 0; /* 移除自动外边距 */
    }

    .submenu {
        position: static; /* 小屏幕下子菜单不再绝对定位，而是随流显示 */
        width: 100%;
        box-shadow: none; /* 移除阴影 */
        border-top: 1px solid var(--border-color); /* 添加分隔线 */
        padding: 0;
        border-radius: 0;
    }

    .submenu li a {
        padding: 10px 30px; /* 增加内边距区分 */
        background-color: rgba(0, 0, 0, 0.05); /* 浅背景色 */
    }

    .nav-item.has-submenu:hover .submenu {
        display: block; /* 仍然通过JS控制显示 */
    }

    .main-content {
        flex-direction: column; /* 内容区域垂直排列 (虽然现在只有一列了) */
        padding: 15px;
        /* 移除 gap */
    }

    /* .sidebar 样式已移除或注释掉 */

    .content-area {
        padding: 20px;
        max-width: 100%; /* 小屏幕下内容区域占满宽度 */
    }

    .dashboard-widgets {
        grid-template-columns: 1fr; /* 小屏幕下单个小部件一行 */
    }

    .toolbar {
        flex-direction: column; /* 工具栏按钮垂直排列 */
        align-items: flex-start;
    }

    .toolbar .btn-primary,
    .toolbar .btn-secondary,
    .toolbar .search-input {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* ==========================================================================
   16. 模态框 (Modal) 样式
   ========================================================================== */

/* 模态框整体容器，背景遮罩 */
.modal-overlay {
    display: none; /* 默认隐藏 */
    position: fixed; /* 固定定位，覆盖整个视口 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* 半透明黑色背景 */
    display: flex; /* 使用 flexbox 居中内容 */
    justify-content: center;
    align-items: center;
    z-index: 2000; /* 确保在所有内容之上 */
    opacity: 0; /* 用于过渡动画 */
    visibility: hidden; /* 用于过渡动画 */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 模态框显示时的状态 */
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
    display: flex; /* 当有.show类时，覆盖display:none，使其可见 */
}

/* 模态框内容区域 */
.modal-content {
    background-color: var(--card-bg);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); /* 更明显的阴影 */
    position: relative; /* 用于关闭按钮定位 */
    max-width: 600px; /* 模态框最大宽度 */
    width: 90%; /* 响应式宽度 */
    transform: translateY(-20px); /* 用于过渡动画 */
    opacity: 0; /* 用于过渡动画 */
    transition: transform 0.3s ease, opacity 0.3s ease;
    max-height: 90vh; /* 设置最大高度为视口高度的90% */
    overflow-y: auto; /* 当内容超出最大高度时，允许垂直滚动 */
}

/* 模态框显示时内容区域的状态 */
.modal-overlay.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}


/* 模态框标题 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.modal-header h3 {
    color: var(--primary-dark);
    font-size: 22px;
    margin: 0;
}

/* 关闭按钮 */
.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--secondary-color);
    cursor: pointer;
    line-height: 1; /* 确保 X 垂直居中 */
    transition: color 0.3s ease;
    padding: 0; /* 移除默认内边距 */
}

.modal-close:hover {
    color: var(--text-color);
}

/* 模态框表单内部样式，复用 .form-group */
.modal-body .form-group {
    margin-bottom: 15px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end; /* 按钮靠右对齐 */
    gap: 10px; /* 按钮间距 */
    margin-top: 30px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

/* 模态框内的按钮样式，复用已有的 .btn-primary 和 .btn-secondary */
.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    padding: 10px 20px;
    font-size: 15px;
}

/* 弹窗可用性增强：扩大安全区域、锁定背景滚动并提供误触反馈。 */
.modal-overlay {
    padding: 24px;
}

body.modal-open {
    overflow: hidden;
}

.modal-close {
    width: 38px;
    height: 38px;
    padding: 4px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #eef2f6;
}

.modal-content.modal-attention {
    animation: modal-attention 0.28s ease;
}

@keyframes modal-attention {
    0%, 100% { transform: translateY(0); }
    35% { transform: translateY(0) scale(1.012); }
    70% { transform: translateY(0) scale(0.997); }
}

/* 模态框内容区域的小尺寸变体 */
.modal-content.modal-sm {
    max-width: 400px; /* 较小的最大宽度 */
    width: 90%;
}

/* 响应式调整 */
@media (max-width: 600px) {
    .modal-content {
        width: 95%; /* 小屏幕下宽度更窄 */
        padding: 20px;
    }
}
/* === 新增样式：人物组的背景色交替和分隔线 === */
.data-table tbody tr.person-group-even {
    background-color: #f8f9fa; /* 浅灰色背景 */
}

.data-table tbody tr.person-group-odd {
    background-color: #ffffff; /* 白色背景 */
}

/* 鼠标悬停效果：应用于整个人物组的行 */
.data-table tbody tr.person-group-even:hover,
.data-table tbody tr.person-group-odd:hover {
    background-color: #e2e6ea; /* 统一的悬停背景色 */
}

/* 每个人物组的最后一行添加更粗的底部边框，用于视觉分隔 */
.data-table tbody tr.person-group-end td {
    border-bottom: 2px solid var(--border-color) !important; /* 使用 !important 确保覆盖默认的 1px 边框 */
}
/* === 样式结束 === */
.current-file-display {
    margin-top: 8px;
    padding: 8px;
    background-color: #f4f7fa;
    border: 1px solid #e0e6ed;
    border-radius: 4px;
    font-size: 13px;
    color: #6c757d;
}
.current-file-display a {
    color: #007bff;
    text-decoration: underline;
    font-weight: bold;
}

.person-taxonomy-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px 12px;
    margin-top: 8px;
}

.person-taxonomy-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: normal;
}

.person-taxonomy-summary {
    padding: 8px 12px !important;
    color: #52606d;
    background: #f7f9fb;
    font-size: 13px;
    border-bottom: 2px solid var(--border-color) !important;
}

.person-taxonomy-help {
    margin: 4px 0 10px;
    font-size: 13px;
}

.person-focus-issue-groups {
    display: grid;
    gap: 10px;
}

.person-focus-issue-group {
    margin: 0;
    padding: 10px 12px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
}

.person-focus-issue-group legend {
    padding: 0 6px;
    color: #305680;
    font-weight: bold;
    font-size: 14px;
}
