/* ==================== 项目管理模块样式 ==================== */
/* 从 admin.css 拆分，包含：看板、Notion选择器、表格视图、详情弹窗、内联编辑、归档管理、图表统计 */
/* 依赖：admin.css 中的设计令牌（CSS 变量） */

/* ==================== 项目看板（纵向分区布局） ==================== */

.proj-board {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

/* 项目列表顶部栏（统计 + 搜索 + 新建） */
.proj-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.proj-top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.proj-quick-search {
    position: relative;
    width: 330px;
    max-width: 48vw;
}

.proj-quick-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    width: 15px;
    height: 15px;
    transform: translateY(-50%);
    color: #8a8f99;
    pointer-events: none;
}

.proj-quick-search-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.proj-quick-search-input {
    width: 100%;
    height: 36px;
    padding: 0 34px 0 32px;
    border-radius: 10px;
    border: 1px solid rgba(35, 131, 226, 0.16);
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 2px rgba(15,15,15,0.04);
    transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}

.proj-quick-search-input::placeholder {
    color: #9aa0a6;
}

.proj-quick-search-input:hover {
    border-color: rgba(35, 131, 226, 0.26);
}

.proj-quick-search-input:focus {
    border-color: rgba(35, 131, 226, 0.58);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(35, 131, 226, 0.12);
}

.proj-quick-search-clear {
    position: absolute;
    right: 9px;
    top: 50%;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(108, 117, 135, 0.14);
    color: #6f7888;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: background .12s ease, color .12s ease, transform .12s ease;
}

.proj-quick-search-clear.show {
    display: inline-flex;
}

.proj-quick-search-clear:hover {
    background: rgba(108, 117, 135, 0.24);
    color: #4f5a6f;
    transform: translateY(-50%) scale(1.04);
}

/* 单个分区 - Notion 风格无边框 */
.proj-section {
    background: transparent;
    border-radius: 0;
    border: none;
    border-left: none;
    overflow: visible;
    width: 100%;
    transition: var(--transition);
}

.proj-section:hover {
    box-shadow: none;
}

/* 分区头部 */
.proj-section-header {
    padding: 12px 0 6px;
    background: transparent;
    border-bottom: none;
}

.proj-section-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 分区计数 */
.proj-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 3px;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: 13px;
    font-weight: 500;
}

/* 分区内容区 */
.proj-section-body {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 8px;
    padding: 4px 0 16px;
    min-height: 50px;
    width: 100%;
    box-sizing: border-box;
}

/* 拖拽放置高亮 */
.proj-section-body.proj-drop-active {
    background: var(--primary-light);
    border-radius: var(--radius);
}

/* 空状态 */
.proj-empty {
    width: 100%;
    text-align: center;
    padding: 20px 16px;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* 项目卡片 - Notion 风格 */
.proj-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    width: 248px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    flex-shrink: 0;
}

.proj-card:hover {
    background: var(--bg-secondary);
    box-shadow: var(--shadow-sm);
}

.proj-card-dragging {
    opacity: 0.4;
}

.proj-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.proj-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.proj-card-meta {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.proj-card-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border-light);
}

/* ==================== 项目详情弹窗 ==================== */

/* 项目详情弹窗的遮罩层改为居中对齐（仅作用于项目模块） */
#projDetailModal {
    align-items: center;
    padding: 20px;
}

/* 屏幕高度较小时保留顶部可滚动空间，避免内容被裁切 */
@media (max-height: 820px) {
    #projDetailModal {
        align-items: flex-start;
        padding-top: 40px;
    }
}

/* 项目详情弹窗 - Google Calendar 风格：白底、清晰边框 */
#projDetailModal .modal {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid #dadce0;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.pd-fields {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pd-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* 最后一行不要底部边框 */
.pd-row:last-child {
    border-bottom: none;
}

.pd-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 36px;
}

.pd-input-flex { flex: 1; min-width: 0; }
.pd-input-sm { width: auto; min-width: 90px; flex: 1; }
.pd-input-date { width: auto; min-width: 130px; flex: 0 1 140px; }

@media (max-width: 640px) {
    .pd-row { flex-wrap: wrap; }
    .pd-label { width: 100%; margin-bottom: -4px; }
    .pd-input-flex, .pd-input-sm, .pd-input-date { flex: 1 1 100%; }
}

/* ==================== 看板响应式 ==================== */
@media (max-width: 640px) {
    .proj-card { width: 100%; }
    .proj-section-body { padding: 4px 0 12px; gap: 6px; }
    .proj-top-actions { width: 100%; }
    .proj-quick-search { width: 100%; max-width: none; }
}

/* ==================== Notion 风格下拉选择器 ==================== */

.ns-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.ns-wrap {
    position: relative;
    width: 100%;
}

.ns-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    cursor: pointer;
    transition: var(--transition);
    min-height: 34px;
    gap: 4px;
}

.ns-display:hover {
    background: var(--bg-secondary);
}

.ns-display-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.ns-placeholder {
    color: var(--text-tertiary);
    font-size: 13px;
}

.ns-clear {
    font-size: 14px;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 0 2px;
    border-radius: 2px;
    line-height: 1;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.ns-clear:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

.ns-arrow {
    font-size: 10px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* ns-panel 下拉面板 - 不透明白色背景，防止后面内容透过 */
.ns-panel {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: 0 0 0 1px rgba(15,15,15,0.05), 0 3px 6px rgba(15,15,15,0.1), 0 9px 24px rgba(15,15,15,0.2);
    z-index: 500;
    max-height: 320px;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-2px);
    transition: opacity 0.12s ease, visibility 0.12s ease, transform 0.12s ease;
}

/* 下拉面板内所有子元素强制不透明背景，彻底阻断半透明穿透 */
.ns-panel *,
.ptbl-float-panel * {
    --bg-primary: #ffffff;
    --bg-hover: #f7f6ff;
    --bg-active: #f0eeff;
}

.ns-panel.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.ns-search-box {
    padding: 6px;
    flex-shrink: 0;
}

.ns-search {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-primary);
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.ns-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(35, 131, 226, 0.12);
}

.ns-search::placeholder {
    color: var(--text-tertiary);
    font-size: 13px;
}

.ns-list {
    overflow-y: auto;
    max-height: 240px;
    padding: 4px;
}

/* 选项行 - Notion 风格：紧凑行高，标签只包裹文字 */
.ns-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: default;
    transition: background 0.08s ease;
    gap: 6px;
    min-height: 28px;
}

.ns-item:hover { background: var(--bg-hover); }

.ns-item-dragging { opacity: 0.4; background: rgba(55,53,47,0.04); }

/* 拖拽手柄 - Notion 6点样式（2列3行），始终可见 */
.ns-grip {
    width: 10px;
    height: 18px;
    display: block;
    /* 使用 SVG 实现清晰的 6 点图案 */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='18'%3E%3Ccircle cx='3' cy='4' r='1.2' fill='rgba(55,53,47,0.4)'/%3E%3Ccircle cx='7' cy='4' r='1.2' fill='rgba(55,53,47,0.4)'/%3E%3Ccircle cx='3' cy='9' r='1.2' fill='rgba(55,53,47,0.4)'/%3E%3Ccircle cx='7' cy='9' r='1.2' fill='rgba(55,53,47,0.4)'/%3E%3Ccircle cx='3' cy='14' r='1.2' fill='rgba(55,53,47,0.4)'/%3E%3Ccircle cx='7' cy='14' r='1.2' fill='rgba(55,53,47,0.4)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    cursor: grab;
    opacity: 1;
    flex-shrink: 0;
    user-select: none;
    border-radius: 2px;
    transition: background-color 0.1s ease;
}

.ns-grip:hover { background-color: rgba(55,53,47,0.08); }
.ns-grip:active { cursor: grabbing; }

/* 拖拽中的占位符样式 */
.ns-item-placeholder {
    background: rgba(35,131,226,0.08);
    border: 1px dashed rgba(35,131,226,0.3);
    border-radius: var(--radius-sm);
    min-height: 28px;
    margin: 0;
    transition: none;
}

/* 拖拽中的浮动元素 */
.ns-item-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    background: #ffffff;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 标签 - 只包裹文字，不铺满整行 */
.ns-item .ns-tag {
    cursor: pointer;
    flex: 0 1 auto;
    min-width: 0;
}

.ns-item .ns-tag:hover { opacity: 0.8; }

/* ··· 编辑按钮 - Notion 风格，使用 SVG 圆点与 grip 风格统一 */
.ns-more {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 3px;
    opacity: 0;
    transition: opacity 0.08s ease;
    flex-shrink: 0;
    user-select: none;
    margin-left: auto;
    /* 用 SVG 绘制 3 个水平圆点 */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='4'%3E%3Ccircle cx='2' cy='2' r='1.3' fill='rgba(55,53,47,0.45)'/%3E%3Ccircle cx='7' cy='2' r='1.3' fill='rgba(55,53,47,0.45)'/%3E%3Ccircle cx='12' cy='2' r='1.3' fill='rgba(55,53,47,0.45)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    font-size: 0;
    color: transparent;
}

.ns-item:hover .ns-more { opacity: 0.5; }
.ns-more:hover { opacity: 1 !important; background: var(--bg-hover); }

.ns-item-create {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
}

.ns-item-create:hover { background: var(--bg-hover); }

.ns-empty {
    text-align: center;
    padding: 20px 10px;
    color: var(--text-tertiary);
    font-size: 13px;
}

/* ==================== Notion 编辑面板 ==================== */

.ns-edit-panel {
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: 0 0 0 1px rgba(15,15,15,0.05), 0 3px 6px rgba(15,15,15,0.1), 0 9px 24px rgba(15,15,15,0.2);
    width: 220px;
    padding: 4px 0;
}

.ns-edit-rename { padding: 6px 8px; }

.ns-edit-input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    background: var(--bg-primary);
    outline: none;
    font-family: inherit;
    box-shadow: 0 0 0 2px rgba(35, 131, 226, 0.12);
}

.ns-edit-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.ns-edit-action:hover { background: var(--bg-hover); }

.ns-edit-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

.ns-edit-section-title {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    padding: 6px 12px 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.ns-color-list { padding: 2px 4px; }

.ns-color-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.ns-color-item:hover { background: var(--bg-hover); }
.ns-color-item.active { background: var(--bg-active); }

/* 颜色选择器圆点 - Notion风格：纯色圆角方块，无边框无文字 */
.ns-color-dot {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* ==================== 内联选项下拉 - Notion 风格增强 ==================== */

/* 搜索框容器 - Notion 风格，无边框，底部分隔线 */
.ns-inline-search-wrap {
    padding: 8px 10px 0;
}

/* "选择或创建一个选项" 小标题 */
.ns-section-label {
    font-size: 13px;
    color: rgba(55,53,47,0.5);
    padding: 8px 10px 4px;
    user-select: none;
}

/* 选项列表中的标签可点击 */
.ns-tag-click {
    cursor: pointer;
}

/* 选中状态的选项行 */
.ns-item-active {
    background: var(--bg-active);
}

.ns-color-name {
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
}

.ns-color-check {
    font-size: 13px;
    color: var(--primary);
    flex-shrink: 0;
}

/* ==================== Notion 风格表单视图 ==================== */

/* 表单容器 - 圆角毛玻璃风格 */
/* 表格外层容器 - 实色背景（避免 backdrop-filter 模糊内部 emoji 图标） */
.ptbl-container {
    background: rgb(255, 255, 255);
    border: 1px solid rgba(225, 225, 230, 0.6);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    width: 100%;
}

/* 表头 - 圆角顶部，实色背景（避免 backdrop-filter 模糊 emoji 图标） */
.ptbl-header {
    display: flex;
    align-items: center;
    padding: 0;
    height: 34px;
    background: rgb(245, 246, 250);
    border-bottom: 1px solid rgba(22, 29, 55, 0.06);
    position: sticky;
    top: 0;
    z-index: 10;
    width: max-content;
    min-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* 表头单元格 - 现代商务风：图标 + 标题，淡竖线分隔 */
.ptbl-th {
    position: relative;
    font-size: 13px;
    font-weight: 500;
    color: rgba(55, 53, 47, 0.65);
    padding: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
    text-transform: none;
    letter-spacing: 0;
    border-right: 1px solid #ebebea;
    text-align: left;
    flex-shrink: 0;
    cursor: default;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
}

/* 列标题图标 - Notion 风格（SVG 图标半透明柔和） */
.ptbl-th-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    opacity: 0.65;
}

/* 自定义 emoji 图标：不透明，避免彩色 emoji 被"蒙"一层 */
.ptbl-th-icon-emoji {
    opacity: 1;
}

.ptbl-th-icon svg {
    width: 14px;
    height: 14px;
}

/* 列标题文字 */
.ptbl-th-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 可编辑的列标题 hover 效果 */
.ptbl-th[data-editable="true"]:hover {
    color: rgba(55, 53, 47, 0.85);
    background: rgba(55, 53, 47, 0.04);
    cursor: text;
}

/* 列标题编辑中的输入框 */
.ptbl-th-edit-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    font-family: inherit;
    padding: 0;
    box-shadow: inset 0 0 0 1.5px var(--primary);
    border-radius: 2px;
    padding: 2px 4px;
}

/* 表头"+"添加属性按钮 */
.ptbl-th-add {
    width: 36px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-tertiary);
    border-right: none;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.ptbl-th-add:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* 列宽拖拽手柄 */
.ptbl-resize-handle {
    position: absolute;
    right: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.1s ease;
    z-index: 2;
    border-radius: 2px;
}

.ptbl-resize-handle:hover,
.ptbl-resize-handle:active {
    background: var(--primary);
}

/* 表体 - 宽度由列宽总和决定 */
.ptbl-body {
    width: max-content;
    min-width: 100%;
}

/* ==================== 分组样式 - 现代商务风 ==================== */

.ptbl-group {
    border: none;
    border-radius: var(--radius-lg);
    margin: 0;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-left: none;
}

/* 分组之间的分隔 */
.ptbl-group + .ptbl-group {
    margin-top: 8px;
}

/* 分组头部 - 现代商务风：简洁扁平，紧凑高度，圆角顶部 */
.ptbl-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    cursor: default;
    user-select: none;
    transition: background 0.08s ease;
    border-bottom: 1px solid rgba(22, 29, 55, 0.06);
    background: rgba(248, 249, 252, 0.6);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.ptbl-group-header:hover {
    background: #f1f3f5;
}

/* 折叠箭头 - 隐藏 */
.ptbl-group-arrow {
    display: none;
}

/* 分组标签 - 使用分组颜色，带 pill 背景 */
.ptbl-group-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--group-color, var(--text-primary));
    padding: 3px 10px;
    border-radius: 4px;
    background: var(--group-bg, transparent);
}

/* 分组计数 */
.ptbl-group-count {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 400;
    margin-left: 2px;
}

/* ==================== 数据行样式 ==================== */

.ptbl-row {
    display: flex;
    align-items: center;
    padding: 0;
    min-height: 38px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.08s ease;
    width: max-content;
    min-width: 100%;
}

.ptbl-row:hover {
    background: var(--bg-hover);
}

/* 行内复制按钮 - fixed浮动，显示在编号列左侧上方 */
#ptblCopyFloat {
    position: fixed;
    z-index: 999;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(106, 92, 255, 0.18);
    box-shadow: 0 2px 10px rgba(106, 92, 255, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s, transform 0.12s;
    transform: scale(0.85);
    user-select: none;
}

#ptblCopyFloat.show {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

#ptblCopyFloat:hover {
    background: rgba(106, 92, 255, 0.10);
    border-color: rgba(106, 92, 255, 0.35);
    box-shadow: 0 4px 14px rgba(106, 92, 255, 0.22);
}

.ptbl-row:last-child { border-bottom: none; }

/* 数据单元格 - 现代商务风：淡竖线分隔，左对齐，38px 行高 */
.ptbl-td {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 14px;
    color: var(--text-primary);
    padding: 4px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 38px;
    border-right: 1px solid #f0f0ee;
    flex-shrink: 0;
    position: relative;
}

/* 单元格/行内有下拉面板展开时，取消裁剪并提升层级 */
.ptbl-td.ns-open {
    overflow: visible;
    z-index: 100;
}
.ptbl-row.ns-open {
    z-index: 50;
    position: relative;
}

/* 列头右键菜单 - Notion 风格 */
#projColContextMenu .ns-edit-action svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ==================== 单元格内特殊样式 ==================== */

/* 项目编号 - Notion 风格：深黑色，520 字重 */
.ptbl-no {
    font-size: 14px;
    font-weight: 520;
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #37352f;
    white-space: nowrap;
}

/* 项目名称 - Notion 风格：深黑色，520 字重 */
.ptbl-name {
    font-weight: 520;
    color: #37352f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 项目名称列（第3列）- 所有列已统一左对齐 */

/* 外部编号 - Notion 风格：#2C2C2B，ui-sans-serif 字体 */
.ptbl-extno {
    font-size: 14px;
    font-weight: 400;
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #2C2C2B;
    white-space: nowrap;
}

/* 日期文字 - Notion 风格：sans-serif 字体 */
.ptbl-date {
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    color: var(--text-primary);
}

/* 状态标签 */
.ptbl-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

/* 结算标签 */
.ptbl-settle-tag {
    font-size: 13px;
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
    font-weight: 500;
}

/* ==================== 详情弹窗响应式 ==================== */

/* ==================== 内联编辑样式 ==================== */

/* 可编辑单元格悬停提示 */
.ptbl-td-editable {
    cursor: pointer;
    transition: background 0.08s ease;
}

.ptbl-td-editable:hover {
    background: var(--bg-hover);
}

/* 编辑中的单元格 */
.ptbl-td-editing {
    padding: 0 2px;
    background: var(--bg-primary);
}

/* 内联输入框 - 无边框，融入单元格 */
.ptbl-inline-input {
    width: 100%;
    height: 100%;
    min-height: 30px;
    padding: 4px 6px;
    border: 1.5px solid var(--primary);
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(35, 131, 226, 0.15);
    box-sizing: border-box;
}

.ptbl-inline-input:focus {
    border-color: var(--primary);
}

.ptbl-inline-input.ptbl-inline-date {
    cursor: pointer;
    user-select: none;
}

.ptbl-inline-input[type="number"] {
    font-family: inherit;
    font-size: 14px;
}

/* ==================== 项目内联日期弹层 ==================== */
.ptbl-date-pop {
    position: fixed;
    z-index: 2200;
    width: 264px;
    background: #fff;
    border: 1px solid rgba(15, 15, 15, 0.08);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 15, 15, 0.16);
    padding: 8px;
    box-sizing: border-box;
    animation: ptblFloatIn 0.12s ease;
}

.ptbl-date-pop-head {
    display: grid;
    grid-template-columns: 28px 1fr 28px;
    align-items: center;
    margin-bottom: 6px;
}

.ptbl-date-pop-title {
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #37352f;
}

.ptbl-date-pop-nav {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #6b6b6a;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

.ptbl-date-pop-nav:hover {
    background: #f2f1ef;
    color: #37352f;
}

.ptbl-date-pop-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.ptbl-date-pop-week span {
    text-align: center;
    font-size: 11px;
    color: #9b9a97;
    font-weight: 500;
    line-height: 22px;
}

.ptbl-date-pop-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.ptbl-date-pop-empty {
    width: 100%;
    height: 28px;
}

.ptbl-date-pop-day {
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #37352f;
    font-size: 13px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
}

.ptbl-date-pop-day:hover {
    background: #f2f1ef;
}

.ptbl-date-pop-day.is-selected {
    background: #e7f3ff;
    color: #0b6bcb;
    font-weight: 600;
}

.ptbl-date-pop-foot {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(15, 15, 15, 0.07);
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.ptbl-date-pop-act {
    flex: 1;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6b6b6a;
    font-size: 12px;
    cursor: pointer;
}

.ptbl-date-pop-act:hover {
    background: #f2f1ef;
    color: #37352f;
}

/* ==================== 浮动下拉面板（内联编辑用） ==================== */

/* 浮动面板 - Notion 精确阴影 */
.ptbl-float-panel {
    background: #ffffff;
    border-radius: var(--radius);
    box-shadow: 0 0 0 1px rgba(15,15,15,0.05), 0 3px 6px rgba(15,15,15,0.1), 0 9px 24px rgba(15,15,15,0.2);
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    animation: ptblFloatIn 0.12s ease;
}

@keyframes ptblFloatIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 浮动面板选项 */
.ptbl-float-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.06s ease;
}

.ptbl-float-option:hover {
    background: var(--bg-hover);
}

.ptbl-float-option.active {
    background: var(--bg-active);
}

/* 清除选项 */
.ptbl-float-clear {
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-light);
}

/* 创建选项 */
.ptbl-float-create {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
}

/* Notion 风格浮动面板 */
.ptbl-float-notion {
    padding: 0;
}

/* 浮动面板搜索框 - Notion 风格 */
.ptbl-float-search {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.ptbl-float-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(35, 131, 226, 0.14);
}

/* 浮动面板列表 - 唯一滚动区域 */
.ptbl-float-list {
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 0 6px;
}

/* ==================== 添加属性列面板样式 ==================== */

.ns-add-col-list {
    padding: 4px;
}

.ns-add-col-type {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.08s ease;
    font-size: 13px;
    color: var(--text-primary);
}

.ns-add-col-type:hover {
    background: var(--bg-hover);
}

.ns-add-col-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    border-radius: 3px;
    background: var(--bg-tertiary);
}

.ns-add-col-label {
    flex: 1;
}

/* ==================== 付款记录区域 ==================== */

.pd-section {
    margin-top: 20px;
    background: #fafbfc;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pd-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

/* 付款记录行 */
.pd-pay-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 13px;
}

.pd-pay-row:last-of-type {
    border-bottom: none;
}

.pd-pay-row .form-input {
    padding: 4px 6px;
    font-size: 13px;
    height: 30px;
}

.pd-pay-date { width: 130px; flex-shrink: 0; }
.pd-pay-method { width: 100px; flex-shrink: 0; }
.pd-pay-amount { width: 100px; flex-shrink: 0; }

/* 备注按钮 - 可点击查看详情 */
.pd-pay-remark-btn {
    flex: 1;
    min-width: 0;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    height: 30px;
    transition: var(--transition-fast);
}

.pd-pay-remark-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.pd-pay-remark-btn.has-content {
    color: var(--text-primary);
}

/* 删除按钮 */
.pd-pay-del {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 14px;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.pd-pay-del:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* 付款行右侧操作区（图片图标 + 竖线 + 编辑 + 删除） */
.pd-pay-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

/* 操作区竖线分隔符 */
.pd-pay-actions-divider {
    width: 1px;
    height: 14px;
    background: var(--border);
    margin: 0 2px;
    flex-shrink: 0;
}

/* 编辑按钮 */
.pd-pay-edit-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 14px;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.pd-pay-edit-btn:hover {
    color: var(--primary);
    background: var(--primary-light, rgba(35, 131, 226, 0.08));
}

/* 添加按钮 */
.pd-pay-add {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 13px;
    margin-top: 6px;
    transition: var(--transition-fast);
}

.pd-pay-add:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
}

/* ==================== 备注详情弹窗 ==================== */

.pd-remark-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 15, 0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.pd-remark-modal {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 0 1px rgba(15,15,15,0.05), 0 3px 6px rgba(15,15,15,0.1), 0 9px 24px rgba(15,15,15,0.2);
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.pd-remark-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.pd-remark-header span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.pd-remark-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

/* 弹窗内 Notion 下拉高度与 form-input-sm 对齐 */
.pd-remark-body .ns-display,
.qpay-form .ns-display {
    min-height: unset;
    height: 30px;
    padding: 4px 8px;
    font-size: 13px;
    box-sizing: border-box;
}

.pd-remark-body textarea {
    width: 100%;
    min-height: 80px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    resize: vertical;
    outline: none;
}

.pd-remark-body textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(35, 131, 226, 0.12);
}

/* 图片预览区 */
.pd-remark-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.pd-remark-img-wrap {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.pd-remark-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.pd-remark-img-del {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.pd-remark-paste-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

.pd-remark-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--border-light);
}

/* ==================== 关联任务区域 ==================== */

.pd-task-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 13px;
}

.pd-task-row:last-of-type {
    border-bottom: none;
}

.pd-task-check {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

.pd-task-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.pd-task-title.done {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.pd-task-time {
    font-size: 13px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    white-space: nowrap;
}

.pd-task-del {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 13px;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.pd-task-del:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

/* 快速创建任务输入框 */
.pd-task-quick {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.pd-task-quick input {
    flex: 1;
    padding: 5px 8px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: transparent;
    outline: none;
    transition: var(--transition-fast);
}

.pd-task-quick input:focus {
    border-style: solid;
    border-color: var(--primary);
    background: var(--bg-primary);
}

.pd-task-quick input::placeholder {
    color: var(--text-tertiary);
}

/* ==================== 项目进度条 ==================== */

.ptbl-progress-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.ptbl-progress-track {
    flex: 1;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.ptbl-progress-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.ptbl-progress-fill.complete {
    background: var(--success);
}

.ptbl-progress-text {
    font-size: 13px;
    color: var(--text-tertiary);
    white-space: nowrap;
    min-width: 32px;
    text-align: right;
}

/* ==================== 列头图标 - 可点击更换 ==================== */

/* 图标区域 hover 效果 */
.ptbl-th-icon {
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.15s;
}

.ptbl-th-icon:hover {
    background: rgba(55, 53, 47, 0.08);
}

/* 自定义 emoji 图标样式（无 SVG 时）— 不透明，避免彩色 emoji 被蒙层 */
.ptbl-th-icon-emoji {
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    opacity: 1;
}

/* ==================== 图标选择器面板 ==================== */
.proj-icon-picker {
    width: 340px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 0 1px rgba(15,15,15,0.05), 0 3px 6px rgba(15,15,15,0.1), 0 9px 24px rgba(15,15,15,0.2);
    padding: 8px;
    display: flex;
    flex-direction: column;
}

/* 选择器顶部搜索栏 */
.proj-icon-picker-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px 8px;
    border-bottom: 1px solid var(--gray-100);
}

.proj-icon-picker-search {
    flex: 1;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 13px;
    outline: none;
    background: var(--gray-50);
}

.proj-icon-picker-search:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(35, 131, 226, 0.12);
}

/* 恢复默认按钮 */
.proj-icon-picker-reset {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    border-radius: 4px;
    line-height: 1;
}

.proj-icon-picker-reset:hover {
    background: var(--gray-100);
}

/* 分类标签栏 */
.proj-icon-picker-tabs {
    display: flex;
    gap: 2px;
    padding: 6px 2px;
    border-bottom: 1px solid var(--gray-100);
    overflow-x: auto;
    flex-shrink: 0;
}

.proj-icon-picker-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 28px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.1s;
}

.proj-icon-picker-tab:hover {
    background: rgba(55, 53, 47, 0.08);
}

.proj-icon-picker-tab.active {
    background: rgba(35, 131, 226, 0.1);
}

/* emoji 滚动区域 */
.proj-icon-picker-body {
    max-height: 300px;
    overflow-y: auto;
    padding-top: 4px;
}

/* 分类标题 */
.proj-icon-picker-cat-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    padding: 6px 4px 4px;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

/* emoji 网格 */
.proj-icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 1px;
    padding-bottom: 4px;
}

/* 单个 emoji 项 */
.proj-icon-picker-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.1s;
    user-select: none;
}

.proj-icon-picker-item:hover {
    background: rgba(55, 53, 47, 0.08);
}

/* ==================== 列拖拽排序 ==================== */

/* 拖拽中的列头 */
.ptbl-th-dragging {
    opacity: 0.4;
    background: var(--gray-100);
}

/* 拖拽目标列头高亮 */
.ptbl-th-dragover {
    background: rgba(35, 131, 226, 0.08);
    box-shadow: inset 0 0 0 1px rgba(35, 131, 226, 0.3);
}

/* 拖拽时列头 cursor */
.ptbl-th[draggable="true"] {
    cursor: grab;
}

.ptbl-th[draggable="true"]:active {
    cursor: grabbing;
}

/* ==================== 项目管理 - 子页面快速导航 ==================== */
/* 导航容器：胶囊切换风格，暗色顶栏适配 */
.proj-subnav {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    padding: 3px;
}

/* 导航项：自适应宽度，紧凑排列 */
.proj-subnav-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    font-size: 13px;
    /* 非选中：亮白色文字，确保在暗色顶栏上清晰可读 */
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    user-select: none;
    letter-spacing: 0.2px;
    background: transparent;
    font-weight: 500;
    box-sizing: border-box;
}

/* 悬停效果：微亮背景 + 纯白文字 */
.proj-subnav-item:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

/* 当前页面高亮：渐变背景 + 白色文字 */
.proj-subnav-item.active {
    background: var(--gradient-primary);
    color: #fff;
    font-weight: 600;
    cursor: default;
    box-shadow: 0 2px 8px rgba(106, 92, 255, 0.35);
}

/* 当前页面不响应悬停 */
.proj-subnav-item.active:hover {
    background: var(--gradient-primary);
    color: #fff;
}

/* ==================== 归档管理 - 筛选栏 ==================== */

/* 归档页面整体布局：筛选栏固定 + 表格区滚动 */
.arch-layout {
    display: flex;
    flex-direction: column;
    /* 精确撑满 page-container 可用高度（减去 padding-top 20px + padding-bottom 20px） */
    height: calc(100vh - var(--topbar-height) - 40px);
    min-height: 0;
    /* 自身不产生滚动 */
    overflow: hidden;
}

.arch-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    padding: 14px 18px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    /* 不缩小，固定在顶部 */
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

/* 表格滚动区域：圆角 + 裁剪，防止滚动内容从圆角缺口露出 */
.arch-table-area {
    flex: 1;
    min-height: 0;
    overflow: auto;
    /* 复制 ptbl-container 的外观到滚动容器上 */
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--radius-lg);
}

/* 归档页面的表格容器：外观交给 arch-table-area，自身透明 */
.arch-table-area .ptbl-container {
    overflow: visible;
    border-radius: 0;
    border: none;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

/* 归档页面表头：实色背景匹配项目列表页视觉效果，完全遮挡滚动内容 */
.arch-table-area .ptbl-header {
    background: rgb(245, 246, 250);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
}

/* 筛选组 */
.arch-filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.arch-filter-spacer {
    flex: 1 1 auto;
    min-width: 12px;
}

.arch-filter-search-group {
    flex: 0 0 300px;
    min-width: 260px;
    max-width: 300px;
}

/* 筛选标签 */
.arch-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* 筛选栏内的输入框/下拉框缩小 */
.arch-filter-bar .form-input-sm {
    padding: 5px 8px;
    font-size: 13px;
    min-width: 120px;
}

.arch-search-input {
    width: 100%;
    min-width: 0 !important;
}

.arch-stats {
    font-size: 13px;
    color: var(--text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
}

.arch-stats-num {
    font-weight: 700;
    color: #4f46e5;
}

.arch-stats-num-active {
    color: #1d4ed8;
}

/* 响应式：移动端筛选栏换行 */
@media (max-width: 640px) {
    .arch-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        overflow: visible;
    }
    .arch-filter-group {
        flex-wrap: wrap;
    }
    .arch-filter-spacer {
        display: none;
    }
    .arch-filter-search-group {
        min-width: 0;
        max-width: none;
        flex: 1 1 100%;
    }
}

/* ==================== 统计图表页面 ==================== */

/* 年份切换栏 */
.chart-year-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    margin-bottom: 16px;
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
}

/* 年份标签容器 */
.chart-year-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* 年份按钮 - 胶囊样式 */
.chart-year-btn {
    padding: 6px 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}
.chart-year-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}
.chart-year-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* 年份下拉菜单容器 */
.chart-year-dropdown {
    position: relative;
    display: inline-block;
}

/* 下拉菜单面板 */
.chart-year-drop-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 100px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 4px;
    z-index: 100;
    animation: chartDropIn 0.15s ease;
}
.chart-year-drop-menu.show {
    display: block;
}
@keyframes chartDropIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 下拉菜单项 */
.chart-year-drop-item {
    padding: 6px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
    white-space: nowrap;
}
.chart-year-drop-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}
.chart-year-drop-item.active {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
    font-weight: 600;
}

/* 章节标题 */
.chart-section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    padding-left: 4px;
}

/* 图表网格布局 */
.chart-grid {
    display: grid;
    gap: 16px;
}
.chart-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
.chart-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* 图表卡片 - 毛玻璃风格 */
.chart-card {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    transition: box-shadow 0.2s ease;
    overflow: hidden;
    min-width: 0;
}
.chart-card:hover {
    box-shadow: var(--shadow-md);
}

/* 全宽卡片 */
.chart-card-full {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 18px;
}

/* 卡片标题 */
.chart-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

/* 卡片副标题 */
.chart-card-subtitle {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 12px;
}

/* Canvas 自适应宽度 */
.chart-card canvas,
.chart-card-full canvas {
    display: block;
    width: 100%;
}

/* 响应式：平板 */
@media (max-width: 1024px) {
    .chart-grid-3 {
        grid-template-columns: 1fr 1fr;
    }
    .chart-grid-3 .chart-card:last-child {
        grid-column: span 2;
    }
}

/* 响应式：移动端 */
@media (max-width: 640px) {
    .chart-grid-3,
    .chart-grid-2 {
        grid-template-columns: 1fr;
    }
    .chart-grid-3 .chart-card:last-child {
        grid-column: span 1;
    }
    .chart-year-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==================== 全屏图片预览组件 ==================== */

/* 遮罩层 */
.img-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    animation: imgPreviewFadeIn 0.2s ease;
    user-select: none;
}

@keyframes imgPreviewFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 图片容器 */
.img-preview-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* 预览图片 */
.img-preview-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    cursor: default;
    transition: transform 0.15s ease;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

/* 左右切换按钮 */
.img-preview-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.img-preview-nav:hover {
    background: rgba(255, 255, 255, 0.25);
}

.img-preview-prev { left: 20px; }
.img-preview-next { right: 20px; }

/* 底部计数器 */
.img-preview-counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 14px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 关闭按钮 */
.img-preview-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.img-preview-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 付款行图片指示器 */
.pd-pay-img-hint {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    cursor: default;
}

.pd-pay-img-hint svg {
    width: 15px;
    height: 15px;
}

/* 可点击的图片指示器 */
.pd-pay-img-clickable {
    cursor: pointer;
    border-radius: 3px;
    padding: 2px 4px;
    transition: background 0.12s, color 0.12s;
}

.pd-pay-img-clickable:hover {
    background: var(--primary-light, rgba(35, 131, 226, 0.08));
    color: var(--primary);
}

/* ==================== 付款快捷录入弹窗 ==================== */

.qpay-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 15, 0.6);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: imgPreviewFadeIn 0.15s ease;
}

.qpay-modal {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 0 1px rgba(15,15,15,0.05), 0 3px 6px rgba(15,15,15,0.1), 0 9px 24px rgba(15,15,15,0.2);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.qpay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-light);
}

.qpay-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.qpay-title-sub {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-tertiary);
}

.qpay-body {
    padding: 16px 18px;
    overflow-y: auto;
    flex: 1;
}

/* 付款汇总信息 */
.qpay-summary {
    display: flex;
    gap: 20px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 13px;
}

.qpay-summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.qpay-summary-label {
    font-size: 11px;
    color: var(--text-tertiary);
}

.qpay-summary-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.qpay-summary-value.paid {
    color: var(--success);
}

.qpay-summary-value.unpaid {
    color: var(--danger);
}

/* 快捷新增表单 */
.qpay-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
}

/* 表单第一行：日期、途径、金额 */
.qpay-form-row-top {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

/* 表单第二行：备注 textarea */
.qpay-form-row-bottom {
    display: flex;
    gap: 8px;
}

.qpay-form-row-bottom textarea {
    width: 100%;
    resize: vertical;
    min-height: 50px;
    font-size: 13px;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition-fast);
}

.qpay-form-row-bottom textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light, rgba(35, 131, 226, 0.15));
}

/* 粘贴提示 */
.qpay-paste-hint {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* 表单图片预览区 */
.qpay-form-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* 添加按钮行 */
.qpay-form-action {
    display: flex;
    justify-content: flex-end;
}

.qpay-form-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.qpay-form-label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* 已有记录列表 */
.qpay-list-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.qpay-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.qpay-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
}

.qpay-row:last-child {
    border-bottom: none;
}

.qpay-row-date {
    color: var(--text-tertiary);
    font-size: 13px;
    flex-shrink: 0;
    width: 90px;
}

.qpay-row-method {
    font-size: 13px;
    color: var(--text-secondary);
    flex-shrink: 0;
    width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qpay-row-amount {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    flex-shrink: 0;
    width: 90px;
}

.qpay-row-remark {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qpay-row-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.qpay-row-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: var(--transition-fast);
}

.qpay-row-btn:hover {
    color: var(--primary);
    background: var(--bg-hover);
}

.qpay-row-btn.danger:hover {
    color: var(--danger);
    background: var(--danger-bg);
}

.qpay-empty {
    text-align: center;
    padding: 24px 10px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.qpay-footer {
    display: flex;
    justify-content: flex-end;
    padding: 10px 18px;
    border-top: 1px solid var(--border-light);
}
