/* public.css - 全局公共样式 (所有页面共用) */
/* 基础全局样式 */
body {
    font-family: 'Microsoft YaHei', sans-serif;
    width: 90%;
    /* 固定页面宽度 */
    margin: 0 auto;
    background: linear-gradient(to bottom, #02010a 0%, #0f172a 50%, #1e293b 100%);
   max-height: calc(100vh);
    color: #fff;
}

/* 通用容器样式 */
.container {
    margin: 20px auto;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    max-height: calc(100vh); /* ✅ 限制最大高度：视口高度 - 顶部导航和 margin */
    overflow-y: auto; /* ✅ 内容超出时显示垂直滚动条 */
}

.app-container {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    height: 100vh;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

/* 通用分区标题 (统一左侧边框+背景+内边距) */
.section-title {
    font-size: 16px;
    font-weight: bold;
    color: #303133;
    border-left: 4px solid #409EFF;
    padding: 8px 10px;
    border-radius: 4px;
    margin: 10px 0 20px;
}

/* 通用状态提示框 (成功/错误抽离公共布局) */
.status-box {
    text-align: center;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid transparent;
}

.result-box {
    text-align: center;
    padding: 10px;
    background: #f0f9eb;
    border: 1px solid #e1f3d8;
    border-radius: 6px;
    color: #67c23a;
}

.error-box {
    text-align: center;
    padding: 10px;
    background: #fef0f0;
    border: 1px solid #fde2e2;
    border-radius: 6px;
    color: #f56c6c;
}

/* 通用按钮组 */
.btn-group {
    text-align: center;
    margin-top: 10px;
}

/* 通用弹性布局 (复用率高) */
.flex-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

/* 通用圆角/阴影 (后台页面高频) */
.card-shadow {
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* 通用状态色变量 (统一维护) */
:root {
    --color-primary: #409EFF;
    --color-success: #67c23a;
    --color-error: #f56c6c;
    --color-warning: #e6a23c;
    --color-info: #909399;
    --bg-primary-light: #ecf5ff;
    --bg-success-light: #f0f9eb;
    --bg-error-light: #fef0f0;
    --border-success-light: #e1f3d8;
    --border-error-light: #fde2e2;
}

.module-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: #409EFF;
}

.module-card.active {
    border-color: #409EFF;
    background: rgba(64, 158, 255, 0.1);
}

/* --- 通用表单/表格补充样式 --- */
.form-container {
    max-width: 1200px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 5px;
}

.form-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.user-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* --- 通用按钮覆盖样式 --- */
.wide-back-btn {
    width: 100px !important;
    justify-content: center;
}

.table-edit-btn {
    width: 75px !important;
    border-radius: 8px !important;
    padding: 8px 0 !important;
    font-weight: 600 !important;
    justify-content: center;
}

/* --- 通用交互标签 --- */
.clickable-tag {
    cursor: pointer;
    transition: all 0.3s;
}

.clickable-tag:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* --- 星空背景通用样式 (星星+月亮动画) --- */
.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 100vw;
    min-height: 100vh;
    z-index: 0;
    pointer-events: none;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes twinkle {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    50% {
        opacity: var(--opacity);
        transform: scale(1.2);
        box-shadow: 0 0 4px #fff;
    }

    100% {
        opacity: 0;
        transform: scale(0.5);
    }
}

.moon {
    position: absolute;
    top: 60px;
    right: 80px;
    width: 100px;
    height: 100px;
    z-index: 1;
    background: radial-gradient(circle at 30% 30%, transparent 40%, #ffffff 41%);
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.6)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.4));
    border-radius: 50%;
    transform: rotate(-25deg);
    animation: moon-glow 4s ease-in-out infinite alternate;
}

@keyframes moon-glow {
    from {
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
    }

    to {
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.8));
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.avatar {
    width: 36px !important;
    height: 36px !important;
    background: #409EFF !important;
    /* 蓝色背景 */
    border-radius: 50% !important;
    /* 圆形 */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    color: #fff !important;
    /* 白色文字 */
    font-size: 16px !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

.top-nav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 30px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    backdrop-filter: blur(15px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    flex-shrink: 0 !important;
}

.back-btn {
    color: #fff !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 16px !important;
    transition: opacity 0.3s !important;
    text-decoration: none !important;
}

.back-btn:hover {
    opacity: 0.8 !important;
}

.page-title {
    font-weight: bold !important;
    font-size: 18px !important;
    letter-spacing: 1px !important;
    /* ✅ 移除 color: #fff !important; 让 Vue 动态控制颜色 */
}

/* --- 全局通用样式 --- */

/* 页面背景渐变样式 */
.page-background {
    background: linear-gradient(to bottom, #02010a 0%, #0f172a 50%, #1e293b 100%);
}

/* 顶部导航栏统一样式 */
/* 支持两种模式：.top-nav（简洁模式）和 .header（完整模式，带项目名称标签） */

/* 通用顶部导航容器 */
.top-nav,
.header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 15px 30px !important;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%) !important;
    color: white !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    flex-shrink: 0 !important;
}

/* 左侧区域 */
.header-left {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

/* 标题包装器 */
.title-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* 项目名称标签 */
.project-name-tag {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
    padding: 8px 20px !important;
    border-radius: 20px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
}

/* 返回按钮 */
.back-btn {
    color: #fff !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 16px !important;
    transition: opacity 0.3s !important;
    text-decoration: none !important;
}

.back-btn:hover {
    opacity: 0.8 !important;
}

/* 页面标题 */
.page-title {
    font-weight: bold !important;
    font-size: 18px !important;
    letter-spacing: 1px !important;
    /* ✅ 移除 color: #fff !important; 让 Vue 动态控制颜色 */
}

/* 初始化状态指示器 */
.init-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-right: 15px;
}

.init-status-indicator .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffd700;
    animation: pulse 1.5s infinite;
}

.init-status-indicator .status-dot.ready {
    background: #52c41a;
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* 顶部导航中间区域（用于发票列表等页面） */
.header-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.header-title {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

/* 右侧区域 */
.header-right {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
}

/* --- 用户信息栏 --- */
.top-user-info,
.user-info-wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    padding: 8px 15px !important;
    border-radius: 25px !important;
    -webkit-backdrop-filter: blur(10px) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.user-detail {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* 用户头像 - 支持 .avatar 和 .user-avatar 两种写法 */
.avatar,
.user-avatar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%) !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

.user-details {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}

.user-name {
    font-weight: 600 !important;
    font-size: 14px !important;
    color: white !important;
}

.user-role {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.text-info {
    display: flex !important;
    flex-direction: column !important;
    line-height: 1.2 !important;
}

.text-info .name {
    font-weight: bold !important;
    font-size: 14px !important;
}

.text-info .role {
    font-size: 11px !important;
    opacity: 0.7 !important;
}

/* 1. 修改主内容区，取消居中，保留少量左右内边距 */
.main-content {
    flex: 1;
    padding: 5px !important;
    /* 减少内边距 */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    max-width: 100% !important;
}

/* 2. 修改表格容器，让它撑满，不再限制最大宽度 */
.table-container {
    width: 100% !important;
    /* 改为 100%，不再使用 98% */
    max-width: none !important;
    /* 移除最大宽度限制 */
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 8px;
    /* 减少内边距 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    color: #333;
    flex: 1;
    overflow: auto;
    min-height: 400px;
    margin: 0 auto;
}

.action-bar {
    display: flex !important;
    justify-content: flex-start !important;
    /* 改为从左到右排列 */
    align-items: center !important;
    gap: 15px !important;
    /* 统一所有元素之间的间距 */
    flex-wrap: nowrap !important;
    /* 禁止换行，强制在一行 */
    width: 100% !important;
    max-width: none !important;
    /* 移除最大宽度限制 */
}

.filters {
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    /* 与整体间距保持一致 */
    flex: 1 !important;
    /* 让 filters 区域占据剩余空间，把按钮挤到右边 */
}

/* 给搜索框一个合适的最小宽度，避免在小屏上被压缩太狠 */
.search-box {
    min-width: 250px !important;
    flex: 1 !important;
    /* 让搜索框自动填充 filters 内的剩余空间 */
}

/* --- 通用表单样式 --- */

/* 表单容器：白色背景卡片 */
.form-card {
    max-width: 100% !important;
    margin: 10px auto 80px !important;
    padding: 10px 40px !important;
    background-color: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.1) !important;
}

/* 覆盖 Element Plus el-form 的默认 padding */
.form-card .el-form {
    padding: 0 !important;
}

/* 表单行：弹性布局，支持自动换行 */
.form-row-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0;
    flex-wrap: wrap;
    margin: 2px;
}

/* 表单项：默认占 32% 宽度（一行 3 个） */
.form-item-32 {
    flex: 0 0 32% !important;
}

/* 表单项：占 100% 宽度（独占一行） */
.form-item-full {
    flex: 0 0 100% !important;
}

/* 文件列表容器 */
.file-list-area {
    background-color: #f9fafb !important;
    border: 2px dashed #d1d5db !important;
    border-radius: 8px;
    padding: 10px;
}

/* 已保存文件卡片 */
.saved-file-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 5px;
    font-size: 13px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* 待处理文件卡片 */
.pending-file-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 5px;
    font-size: 13px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* 操作按钮组 */
.form-actions-center {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

/* PDF 文件链接 */
.pdf-file-link {
    color: #60a5fa;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

.pdf-file-link:hover {
    text-decoration: underline;
}

/* 只读字段样式 */
.readonly-input {
    background-color: #f3f4f6 !important;
    color: #6b7280 !important;
    cursor: not-allowed;
}

/* 文件选择按钮 */
.file-upload-btn {
    margin-bottom: 10px;
}

/* ========================================
   确认按钮统一样式（绿色系）
   适用于：确定、保存、下一步、提交等确认类按钮
   ======================================== */
.btn-confirm {
    background: linear-gradient(135deg, #67C23A 0%, #85CE61 100%) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    padding: 12px 30px !important;
    font-size: 16px !important;
    letter-spacing: 1px !important;
    box-shadow: 0 4px 12px rgba(103, 194, 58, 0.3) !important;
    transition: all 0.3s ease !important;
}

.btn-confirm:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(103, 194, 58, 0.4) !important;
    background: linear-gradient(135deg, #85CE61 0%, #67C23A 100%) !important;
}

.btn-confirm:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* 大号确认按钮（用于重要操作） */
.btn-confirm-large {
    padding: 15px 40px !important;
    font-size: 18px !important;
    letter-spacing: 2px !important;
}

/* 小号确认按钮（用于列表操作） */
.btn-confirm-small {
    padding: 8px 16px !important;
    font-size: 14px !important;
}

/* ========================================
   返回按钮统一样式（蓝色系）
   适用于：返回、返回主页、返回财务列表等导航类按钮
   ======================================== */
.btn-return {
    background: linear-gradient(135deg, #409EFF 0%, #66b1ff 100%) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    padding: 12px 30px !important;
    font-size: 16px !important;
    letter-spacing: 1px !important;
    box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3) !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.btn-return:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(64, 158, 255, 0.4) !important;
    background: linear-gradient(135deg, #66b1ff 0%, #409EFF 100%) !important;
}

/* 返回按钮中的箭头图标 */
.btn-return::before {
    content: '←' !important;
    font-size: 18px !important;
    font-weight: bold !important;
}

/* 大号返回按钮 */
.btn-return-large {
    padding: 15px 40px !important;
    font-size: 18px !important;
    letter-spacing: 2px !important;
}

/* 小号返回按钮（用于列表操作） */
.btn-return-small {
    padding: 8px 16px !important;
    font-size: 14px !important;
}

/* ========================================
   取消按钮统一样式（红色系）
   适用于：取消、回退、删除、关闭等否定类按钮
   ======================================== */
.btn-cancel {
    background: linear-gradient(135deg, #F56C6C 0%, #f78989 100%) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    padding: 12px 30px !important;
    font-size: 16px !important;
    letter-spacing: 1px !important;
    box-shadow: 0 4px 12px rgba(245, 108, 108, 0.3) !important;
    transition: all 0.3s ease !important;
}

.btn-cancel:hover:not(:disabled) {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(245, 108, 108, 0.4) !important;
    background: linear-gradient(135deg, #f78989 0%, #F56C6C 100%) !important;
}

.btn-cancel:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

/* 大号取消按钮（用于重要操作） */
.btn-cancel-large {
    padding: 15px 40px !important;
    font-size: 18px !important;
    letter-spacing: 2px !important;
}

/* 小号取消按钮（用于列表操作） */
.btn-cancel-small {
    padding: 8px 16px !important;
    font-size: 14px !important;
}

/* ========================================
   顶部返回按钮统一样式（透明背景白边）
   适用于：顶部导航栏的返回按钮
   ======================================== */
.btn-return-top {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: #fff !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    padding: 10px 20px !important;
    font-size: 15px !important;
    cursor: pointer !important;
    transition: all 0.3s !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.btn-return-top:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: #fff !important;
}

.btn-return-top::before {
    content: '←' !important;
    font-size: 18px !important;
    font-weight: bold !important;
}

/* 返回按钮占位符（保持布局稳定） */
.return-placeholder {
    display: inline-block;
    width: 100px;
    height: 42px;
    visibility: hidden;
}

/* ========================================
   测量要求布局样式（创建项目页使用）
   ======================================== */
.req-container {
    display: flex;
    gap: 20px;
    background: #f5f7fa;
    padding: 20px;
    border-radius: 8px;
    min-height: 400px;
}

.req-list {
    flex: 1;
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.req-form {
    flex: 2;
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.req-item {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid transparent;
    background-color: #fafafa;  /* 增加默认背景色，让所有项都可见 */
    border: 1px solid #e4e7ed;  /* 添加边框，让每项都清晰可见 */
    color: #303133;  /* 设置默认文字颜色为深色，确保清晰可读 */
    font-weight: 500;  /* 稍微加粗字体 */
}

.req-item:hover {
    background-color: #ecf5ff;
    border-left-color: #409EFF;
}

.req-item.active {
    background-color: #ecf5ff;
    border-left-color: #409EFF;
    font-weight: bold;
    color: #409EFF;
    border: 1px solid #409EFF;  /* 激活项添加完整边框 */
}

.empty-tip {
    text-align: center;
    color: #909399;
    margin-top: 50px;
}

/* ========================================
   编辑章节标题样式（创建/编辑项目页使用）
   ======================================== */
.edit-section-title {
    font-size: 15px;
    font-weight: bold;
    color: #303133;
    border-left: 4px solid #409EFF;
    padding-left: 10px;
    margin: 20px 0 15px;
    background: #ecf5ff;
    padding: 8px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-section-title.staff {
    border-color: #409EFF;
    background: #ecf5ff;
}

.edit-section-title.geo {
    border-color: #67C23A;
    background: #f0f9eb;
}



.table-container table {
    border-collapse: separate; /* ✅ 关键：使用 separate 而非 collapse */
    border-spacing: 0;
    width: 100%;
    position: relative;
}

.table-container th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f5f7fa !important; /* ✅ 强制覆盖 Element Plus 默认背景 */
    box-shadow: 0 1px 0 0 #e4e7ed; /* ✅ 底部边框，增强视觉分隔 */
}

/* 增强表头背景色优先级 */
.el-table th {
    background-color: #f5f7fa !important;
}

/* 表格单元格通用样式 */
.table-container td,
.table-container th {
    padding: 8px 12px;
    border: 1px solid #e4e7ed;
    text-align: left;
}