/* 卡号列强调第12-15位数字 */
.vue-grid .grid-cell .cell-content .card-emph {
  color: #d23c3c; /* 适度醒目的红色 */
  font-weight: 600;
  font-size: 1.12em; /* 略微放大，避免破坏行高 */
  letter-spacing: 0.5px;
}
/* 极简表格样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.4;
    color: #333;
    background: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border: 1px solid #ddd;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
    font-size: 24px;
}

h2 {
    margin: 20px 0 10px 0;
    font-size: 18px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

/* 表格容器样式 */
.table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* 表格样式 */
.grid-table {
    width: 1700px !important;
    min-width: 1700px !important;
    max-width: 1700px !important;
    margin: 0;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    border: 1px solid #ddd;
}

.grid-header {
    display: grid;
    grid-template-columns: 60px 120px 260px repeat(8, 140px) 140px;
    background: #f8f8f8;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    color: #555;
}

.grid-body {
    display: flex;
    flex-direction: column;
}

.grid-row {
    display: grid;
    grid-template-columns: 60px 120px 260px repeat(8, 140px) 140px; /* 若有空白列，请确保这里不包含额外的空列定义 */
    border-bottom: 1px solid #ddd;
    min-height: 28px;
    max-height: 28px;
    height: 28px;
    background: white;
}

.grid-row:nth-child(even) {
    background: #f9f9f9;
}

.grid-row:hover {
    background: #f0f0f0;
}

.grid-cell {
    position: relative;
    border-right: 1px solid #ddd;
    padding: 0;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
    height: 28px;
    min-height: 28px;
    max-height: 28px;
}

.grid-cell.editable {
    cursor: text;
}

.grid-cell .cell-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 4px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    cursor: text;
    background: transparent; /* 内容背景透明，避免像“遮罩在内容上” */
}

/* 记录单元格含“打进”标记的小绿点 */
.vue-grid .grid-cell .dot-dajin {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #2ecc71;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
  pointer-events: none;
}

/* Vue grid inline editor */
.vue-grid .cell-editor {
  width: 100%;
  height: calc(100% + 6px);
  border: 2px solid #409eff; /* 编辑态蓝色高亮 */
  outline: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  padding: 4px 8px;
  box-sizing: border-box;
}

/* 放大新表格内文本的基础字号 */
.vue-grid .grid-cell,
.vue-grid .cell-content {
  font-size: 14px;
}

/* 编辑态：让单元格内容区不裁切，并抬高层级避免被遮挡 */
.vue-grid .grid-cell.editing {
  z-index: 10;
}
.vue-grid .grid-cell.editing .cell-content {
  overflow: visible;
  display: block; /* 覆盖下方对 legacy 的隐藏规则 */
}

/* Vue 表格编辑态允许溢出显示输入框 */
.vue-grid .grid-cell.editing {
  overflow: visible;
  z-index: 20;
}

/* 列拖拽复制可视样式 */
.col-dragging {
    cursor: crosshair !important;
}

.grid-cell.col-selected {
    background: #e6f3ff !important;
    box-shadow: inset 0 0 0 2px #69a8ff !important;
}

/* 行选择高亮 */
.grid-row.row-selected {
    background: #fff6e5 !important;
}

.row-dragging {
    cursor: ns-resize !important;
}

/* 高级选择样式 */
.grid-cell.advanced-selected {
    background-color: #eaf4ff !important; /* 更轻的高亮背景 */
    outline: 1px solid #007acc !important; /* 改为细实线 */
    outline-offset: -1px;
    box-shadow: none !important; /* 去除额外描边厚度 */
}

.grid-cell.current-selection {
    background-color: #eaf4ff !important; /* 更浅的背景，不刺眼 */
    outline: 1px solid #69a8ff !important; /* 细实线轮廓，避免虚线与动画 */
    outline-offset: -1px;
}

/* 拖拽选择时，让“表格”整体浅蓝提示，而非内容被遮罩 */
/* 取消“全表变色”的拖拽提示，由每个 cell 的 current-selection 局部高亮代替 */

/* 拖拽时彻底禁用文本选择，避免系统整行蓝色高亮 */
.vue-grid.no-text-select, .vue-grid.no-text-select * {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

/* 仅允许内容层在非拖拽时可选，避免影响拖拽态 */
.vue-grid:not(.no-text-select) .grid-cell .cell-content {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* 允许单元格内容区域在非拖拽时正常选中文本，提升双击进入编辑的可靠性 */
/* 恢复到原有选择策略，避免双击行为异常 */
.vue-grid .grid-cell .cell-content { }

/* 右键菜单样式 */
.selection-context-menu {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    border-radius: 6px !important;
    overflow: hidden;
    user-select: none;
}

.selection-context-menu .menu-item {
    transition: background-color 0.15s ease;
    border-bottom: 1px solid #f0f0f0;
}

.selection-context-menu .menu-item:last-child {
    border-bottom: none;
}

.selection-context-menu .menu-item:hover {
    background-color: #f8f9fa !important;
}

/* 选择状态提示 */
.selection-info {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
}

/* 增强表格单元格的选择体验 */
.grid-cell {
    position: relative;
    transition: all 0.15s ease;
}

.grid-cell:hover:not(.advanced-selected):not(.current-selection) {
    background-color: #f5f5f5;
}
.vue-grid .grid-cell.remote-selected {
    outline: 2px solid #2ecc71 !important;
    outline-offset: -1px;
    background: rgba(46, 204, 113, 0.12) !important;
}

/* 多选模式下的光标提示 */
.grid-table.multi-select-mode {
    cursor: crosshair;
}

.grid-table.multi-select-mode .grid-cell {
    cursor: cell;
}

.grid-table.multi-select-mode .grid-cell:hover {
    outline: 1px solid #007acc;
    outline-offset: -1px;
}

.grid-cell.editing {
    z-index: 1;
    background: white;
    box-shadow: inset 0 0 0 2px #007cba;
    padding: 0;
}

/* 移除最后一列右边框，避免看起来像多出一列空白 */
.grid-header .grid-cell:last-child,
.grid-row .grid-cell:last-child {
    border-right: none;
}

/* 仅对旧表格生效：避免影响 Vue 网格 */
.grid-table:not(.vue-grid) .grid-cell.editing .cell-content {
    display: none;
}

.grid-cell.editing input {
    width: 100%;
    height: 100%;
    border: none;
    padding: 4px 12px;
    margin: 0;
    font-size: inherit;
    font-family: inherit;
    background: transparent;
    outline: none;
}

.empty-row {
    background: #fafafa !important;
}

.empty-row:hover {
    background: #f0f8ff !important;
}

.empty-row .grid-cell {
    color: #999;
    font-style: italic;
}

.filled-row {
    background: white !important;
}

.save-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: none;
    z-index: 2;
}

.saving .save-indicator {
    display: block;
    background: #ffc107;
}

.saved .save-indicator {
    display: block;
    background: #28a745;
}

.error .save-indicator {
    display: block;
    background: #dc3545;
}

/* 悬停提示样式 */
.record-cell {
    position: relative;
}

.record-cell .tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.9);
    color: white;
    text-align: center;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}

.record-cell .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -4px;
    border-width: 4px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
}

.record-cell:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.record-cell.editing .tooltip {
    visibility: hidden !important;
    opacity: 0 !important;
}

/* 卡号样式 */
.card-number .last-four {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #1e88e5;
    background: rgba(30, 136, 229, 0.08);
    padding: 1px 3px;
    border-radius: 3px;
}

/* 操作按钮 */
.action-btn {
    padding: 2px 8px;
    margin: 0 2px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 11px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
}

/* 排行榜特殊样式 */
#ranking-table .rank-1 { color: #d4af37; font-weight: bold; }
#ranking-table .rank-2 { color: #c0c0c0; font-weight: bold; }
#ranking-table .rank-3 { color: #cd7f32; font-weight: bold; }

/* 新排行榜样式 */
.name-cell {
    font-weight: bold;
    color: #2c3e50;
}

.card-count {
    text-align: center;
    color: #3498db;
    font-weight: bold;
}

.percentage {
    text-align: center;
    color: #e74c3c;
    font-weight: bold;
}

.card-details {
    font-size: 12px;
    line-height: 1.4;
    max-width: 300px;
    word-break: break-all;
}

#ranking-table .amount,
#name-ranking-table .amount,
#card-ranking-table .amount {
    color: #27ae60;
    font-weight: bold;
    text-align: right;
}

/* 排行榜左右布局 */
.ranking-container {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.ranking-left,
.ranking-right {
    flex: 1;
    min-width: 0; /* 防止表格溢出 */
}

.ranking-left h3,
.ranking-right h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: bold;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
}

.ranking-left h3 {
    border-bottom-color: #e74c3c;
}

.ranking-right h3 {
    border-bottom-color: #3498db;
}

/* 确保表格自适应容器宽度 */
#name-ranking-table,
#card-ranking-table {
    width: 100%;
    table-layout: fixed;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .ranking-container {
        flex-direction: column;
        gap: 30px;
    }
}

.clickable-row {
    cursor: pointer;
}

.amount {
    color: #e53e3e;
    font-weight: bold;
}

.card-number {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    letter-spacing: 0.3px;
}

/* 序号列样式 */
.simple-table th:nth-child(1),
.simple-table td:nth-child(1) {
    text-align: center;
    font-weight: 500;
    color: #666;
    background: #f8f9fa;
}

/* 卡号第13-16位数字突出显示 */
.card-number .last-four {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #1e88e5;
    background: rgba(30, 136, 229, 0.08);
    padding: 1px 3px;
    border-radius: 3px;
}

/* 表单样式 */
.simple-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 10px 0;
}

.simple-form input {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}

.simple-form input[type="text"],
.simple-form input[type="number"] {
    min-width: 120px;
}

.simple-form button {
    padding: 6px 15px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.simple-form button:hover {
    background: #005a8b;
}

/* 搜索输入框 */
.search-input {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
    margin-left: 10px;
    width: 150px;
}

.simple-btn {
    padding: 4px 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

.simple-btn:hover {
    background: #218838;
}

/* 操作按钮 */
.action-btn {
    padding: 2px 8px;
    margin: 0 2px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 11px;
}

.edit-btn {
    background: #007cba;
    color: white;
}

.edit-btn:hover {
    background: #005a8b;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    background: #c82333;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

/* 返回主页按钮样式 */
.back-home-btn {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 36px;
  height: 36px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1100;
  color: #34495e;
}
.back-home-btn:hover { background: #f5f7fa; border-color: #d0d7de; }
.back-home-btn svg { width: 18px; height: 18px; display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* 主页（项目）布局优化 */
.home-header { margin: 24px 0 18px; }
.home-title { font-size: 22px; margin: 0 0 6px; }
.home-subtitle { color: #666; font-size: 13px; margin: 0; }
.home-toolbar { display: flex; gap: 12px; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.home-toolbar input[type="text"] { padding: 10px 12px; border:1px solid #ddd; border-radius: 8px; width: 320px; max-width: 100%; }
.home-toolbar .simple-btn { padding: 8px 12px; border:1px solid #ddd; background:#fff; border-radius:6px; cursor:pointer; }
.home-toolbar .simple-btn.primary { background:#4a90e2; color:#fff; border-color:#4a90e2; }
.project-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project-card { border:1px solid #e5e5e5; border-radius:12px; padding:16px; background:#fff; box-shadow: 0 4px 10px rgba(0,0,0,0.05); display:flex; flex-direction:column; gap:10px; min-height: 120px; }
.project-card .project-name { font-weight: 600; font-size: 15px; display:flex; align-items:center; gap:8px; }
.project-card .project-name input { width: 100%; }
.project-card .top-row { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.project-meta { color:#666; font-size:12px; display:flex; gap: 10px; }
.project-actions { display:flex; gap: 8px; margin-top: 0; flex-shrink: 0; }
.project-actions .simple-btn { padding:6px 10px; border-radius: 6px; background:#fff; color:#333; border:1px solid #ddd; }
.project-actions .simple-btn:hover { background:#f6f8fa; border-color:#d0d7de; }
.project-actions .simple-btn.primary { background:#4a90e2; color:#fff; border-color:#4a90e2; }
.project-actions .simple-btn.primary:hover { background:#3b7bc5; }
.project-actions .simple-btn.danger { background:#e24a4a; color:#fff; border-color:#e24a4a; }
.project-actions .simple-btn.danger:hover { background:#c43f3f; }
.section-divider { height: 1px; background: #eee; margin: 16px 0; }

/* 项目卡 - 更多菜单 */
.more-wrapper { position: relative; }
.more-btn { 
  width: 30px; height: 30px; border-radius: 6px; 
  background:#fff; border:1px solid #ddd; cursor:pointer; 
  display:inline-flex; align-items:center; justify-content:center; 
  font-size:18px; line-height:18px; color:#333;
}
.more-btn:hover { background:#f6f8fa; border-color:#d0d7de; }
.more-dropdown {
  position: absolute; top: 34px; right: 0; 
  background:#fff; border:1px solid #e0e0e0; border-radius:8px; 
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  min-width: 140px; padding: 6px 0; display: none; z-index: 50;
}
.more-wrapper.open .more-dropdown { display: block; }
.more-item { padding:8px 12px; cursor:pointer; font-size: 13px; color:#333; }
.more-item:hover { background:#f6f8fa; }
.more-item.danger { color:#e24a4a; }
.pill { display:inline-block; padding:2px 8px; border-radius: 999px; font-size:11px; border:1px solid #ddd; color:#555; }
.muted { color:#777; }
.project-name-pill { display:inline-block; margin-left:8px; padding:2px 8px; border-radius:999px; font-size:12px; border:1px solid #4a90e2; color:#4a90e2; }

.modal.show { display: block !important; }

/* 兜底：确保批量导入弹窗不被表格或右键菜单遮挡 */
/* 批量导入功能已移除 */
#vue-grid-context-menu { z-index: 2000 !important; }

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 400px;
    max-width: 90%;
}

.modal h3 {
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.modal .simple-form {
    flex-direction: column;
    align-items: stretch;
}

.modal .simple-form input {
    margin-bottom: 10px;
}

/* 导入文本域样式 */
#import-cards {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace;
    margin-top: 6px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
}

.form-actions button {
    padding: 6px 15px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#cancel-edit {
    background: #6c757d;
    color: white;
}

#cancel-edit:hover {
    background: #5a6268;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 15px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    z-index: 1001;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.toast.success {
    background: #28a745;
}

.toast.error {
    background: #dc3545;
}

.toast.info {
    background: #007cba;
}

/* 批量导入模态框样式 */
.import-modal-content {
    width: 600px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.import-instructions {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #007cba;
}

.import-instructions p {
    margin: 5px 0;
    color: #555;
}

.import-instructions code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    color: #e83e8c;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    resize: vertical;
    min-height: 200px;
}

.form-group textarea:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.import-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.import-actions .simple-btn {
    padding: 8px 16px;
}

.import-results {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    background: #f8f9fa;
}

.import-results h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.import-results h4 {
    margin: 10px 0 5px 0;
    font-size: 14px;
}

.import-results ul {
    margin: 5px 0 15px 20px;
    padding: 0;
}

.import-results li {
    margin-bottom: 3px;
    font-size: 13px;
}

/* 浮动搜索框样式 */
.floating-search {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    display: none;
}

.floating-search.show {
    display: block;
}

.floating-search-content {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    width: 320px;
}

#floating-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

#floating-search-input:focus {
    border-color: #007cba;
}

.floating-search-close {
    background: #f5f5f5;
    color: #666;
    border: none;
    border-radius: 3px;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.floating-search-close:hover {
    background: #e0e0e0;
    color: #333;
}

/* 搜索高亮样式 */
.search-highlight {
    background-color: #fff3cd !important;
    border: 2px solid #ffeaa7 !important;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* 新 Vue 表格内的搜索高亮 */
.vue-grid .grid-row.search-hit .grid-cell {
  background-color: #fffaf0; /* 浅色底 */
}
.vue-grid .grid-row.search-hit .grid-cell .cell-content {
  text-shadow: 0 0 0 rgba(0,0,0,0); /* 保持清晰 */
}

/* 移除响应式设计，保持表格固定宽度 */

/* 排行榜区域样式 */
.ranking-container {
    display: flex;
    width: 100%;
    gap: 8px;
    margin: 10px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
    flex-direction: row;
    justify-content: space-between;
}

/* 排行榜容器基础样式 */
.ranking-left,
.ranking-right {
    background: white;
    border: 2px solid;
    border-radius: 6px;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
    height: 260px;  /* 增高排行榜可视区域 */
    display: flex;
    flex-direction: column;
}

.ranking-left {
    border-color: #4a90e2;
    width: 50%;
    margin-left: 0;
}

.ranking-right {
    border-color: #e24a4a;
    width: 50%;
    margin-right: 0;
}

/* 标题样式 */
.ranking-left h3,
.ranking-right h3 {
    margin: 0;
    height: 24px;
    line-height: 24px;
    font-size: 13px;
    text-align: center;
    font-weight: bold;
    border-bottom: none;
    color: white;
}

.ranking-left h3 {
    background: #4a90e2;
}

.ranking-right h3 {
    background: #e24a4a;
}

/* 让搜索行固定在顶部，便于滚动时保持在视口 */
.section > h2 {
    position: sticky;
    top: 0;
    z-index: 6;
    background: #fff;
    padding: 6px 0;
}

/* 列表包装器 */
.ranking-list-wrapper {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 列表基础样式 */
.ranking-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow-y: auto; /* 让 header 的 sticky 生效并不被内容遮挡 */
}

/* 列表头部 */
.ranking-header {
    display: flex;
    background: #f8f9fa;
    padding: 4px 0;
    font-size: 12px; /* 提升可读性 */
    font-weight: 600;
    color: #4a5568; /* 更柔和的灰色 */
    border-bottom: 1px solid #e0e0e0;
    height: 30px; /* 提高高度，避免文字被遮挡 */
    line-height: 30px;
    box-sizing: border-box;
    position: sticky; /* 防止被内容遮挡，同时保持可见 */
    top: 0;
    z-index: 3; /* 提升层级，确保不被首行遮挡 */
}

/* 列表内容区 */
.ranking-items {
    flex: 1;
    overflow: visible; /* 由父容器滚动，避免和 sticky header 产生层叠问题 */
    padding-top: 3px; /* 将首行整体下移一点，避免紧贴标题 */
}

/* 列表项 */
.ranking-item {
    display: flex;
    padding: 2px 0;
    font-size: 12px; /* 提升可读性 */
    border-bottom: 1px solid #f0f0f0;
    cursor: text;
    transition: background-color 0.2s;
    height: 24px;
    line-height: 24px;
    box-sizing: border-box;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.ranking-item:hover {
    background: #f0f8ff;
}

/* 姓名排行列宽 */
#name-ranking-list .col-rank { width: 40px; text-align: center; }
#name-ranking-list .col-name { width: 80px; text-align: left; }
#name-ranking-list .col-cards { width: 70px; text-align: center; }
#name-ranking-list .col-amount { width: 80px; text-align: right; }
#name-ranking-list .col-total-cost { width: 80px; text-align: right; }
#name-ranking-list .col-efficiency { width: 80px; text-align: right; }

/* 卡头排行列宽 */
#card-ranking-list .col-rank { width: 40px; text-align: center; }
#card-ranking-list .col-prefix { width: 80px; text-align: left; }
#card-ranking-list .col-total { width: 90px; text-align: right; }
#card-ranking-list .col-total-cost { width: 100px; text-align: right; }
#card-ranking-list .col-efficiency { width: 80px; text-align: right; }
#card-ranking-list .col-count { width: 40px; text-align: center; }

/* 通用列样式 */
.ranking-header span,
.ranking-item span {
    padding: 0;
    overflow: hidden;
    white-space: nowrap;
    display: inline-block !important;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    cursor: default;
    width: 100% !important;
    box-sizing: border-box !important;
    pointer-events: none !important;
    position: relative !important;
}

/* 数字列使用等宽数字，确保对齐更稳固 */
.ranking-header span[class*="col-amount"],
.ranking-item span[class*="col-amount"],
.ranking-header span[class*="col-total"],
.ranking-item span[class*="col-total"],
.ranking-header span[class*="col-efficiency"],
.ranking-item span[class*="col-efficiency"],
.ranking-header span[class*="col-cards"],
.ranking-item span[class*="col-cards"],
.ranking-header span[class*="col-count"],
.ranking-item span[class*="col-count"],
.ranking-header span[class*="col-rank"],
.ranking-item span[class*="col-rank"] {
    font-variant-numeric: tabular-nums; /* 等宽数字 */
}

/* 前三名突出显示 */
.ranking-items .ranking-item:nth-child(1) {
    background: linear-gradient(90deg, rgba(212,175,55,0.08), transparent);
}
.ranking-items .ranking-item:nth-child(2) {
    background: linear-gradient(90deg, rgba(192,192,192,0.08), transparent);
}
.ranking-items .ranking-item:nth-child(3) {
    background: linear-gradient(90deg, rgba(205,127,50,0.08), transparent);
}
.ranking-items .ranking-item:nth-child(-n+3) .col-rank > div {
    font-weight: 700;
}

.ranking-header span > div,
.ranking-item span > div {
    padding: 0 4px;
    height: 100%;
    width: 100%;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    cursor: text;
    box-sizing: border-box !important;
    pointer-events: auto !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}

.ranking-header span[class*="col-rank"],
.ranking-item span[class*="col-rank"],
.ranking-header span[class*="col-cards"],
.ranking-item span[class*="col-cards"],
.ranking-header span[class*="col-count"],
.ranking-item span[class*="col-count"] {
    justify-content: center;
}

.ranking-header span[class*="col-amount"],
.ranking-item span[class*="col-amount"],
.ranking-header span[class*="col-total"],
.ranking-item span[class*="col-total"],
.ranking-header span[class*="col-efficiency"],
.ranking-item span[class*="col-efficiency"] {
    justify-content: flex-end;
}

/* 加载中文本样式 */
.loading-text {
    text-align: center;
    padding: 10px;
    color: #666;
    font-style: italic;
}

/* 响应式设计：小屏幕 */
@media (max-width: 768px) {
    .ranking-container {
        gap: 6px;
    }
    
    .ranking-left,
    .ranking-right {
        height: 182px;  /* 保持一致的高度 */
    }
}