/* 账单关联浮窗样式
 * V1.0.133: 新增结算账单关联功能
 * V1.0.136: 优化移动端显示：最大宽度90%、最大高度50vh、隐藏滚动条
 * V1.0.142: 确保最大高度为屏幕一半，添加!important强制生效
 * 维护者：小达 🦐
 */

.bill-relation-modal {
    position: absolute;
    top: 150px;  /* V1.0.170: 从顶部向下150px固定位置 */
    left: 50%;
    transform: translate(-50%, 0);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    width: 90%;
    max-width: 400px;
    max-height: 40vh !important;  /* V1.0.146: 最大高度40% */
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;  /* 确保内容不超出 */
}

.bill-relation-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.bill-relation-modal .modal-body {
    padding: 12px 16px;
    flex: 1;
    overflow-y: auto;
    /* 隐藏滚动条 */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.bill-relation-modal .modal-body::-webkit-scrollbar {
    display: none;
}

.bill-relation-modal .bill-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 13px;
}

.bill-relation-modal .bill-item:last-child {
    border-bottom: none;
}

.bill-relation-modal .bill-item input {
    margin-right: 12px;
}

.bill-relation-modal .bill-time {
    width: 90px;
    color: #666;
}

.bill-relation-modal .bill-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bill-relation-modal .bill-amount {
    width: 70px;
    text-align: right;
    font-weight: 500;
}

.bill-relation-modal .amount-positive {
    color: #52c41a;
}

.bill-relation-modal .amount-negative {
    color: #ff4d4f;
}

.bill-relation-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

.bill-relation-modal .btn {
    padding: 6px 20px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.bill-relation-modal .btn-cancel {
    background: #f5f5f5;
    border: 1px solid #d9d9d9;
}

.bill-relation-modal .btn-save {
    background: #1890ff;
    color: #fff;
    border: none;
}

.bill-relation-modal .close-btn {
    cursor: pointer;
    font-size: 18px;
    color: #999;
}

.bill-relation-modal .close-btn:hover {
    color: #333;
}

/* 遮罩层 */
.bill-relation-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}

/* 空状态 */
.bill-relation-modal .empty-state {
    text-align: center;
    padding: 4px 20px;  /* V1.0.139: 减少padding，只占1行距离 */
    color: #999;
}

/* V1.0.177: 账单分区标题 */
.bill-relation-modal .bill-section-title {
    font-size: 12px;
    color: #666;
    padding: 8px 0 4px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 4px;
}

/* V1.0.141: 手工标记区域 - 紧凑两行布局 */
/* V1.0.179: 上下边界缩小到0px */
.manual-settle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
}

.manual-settle-title {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.manual-settle-hint {
    font-size: 11px;
    color: #999;
    margin-bottom: 0;  /* V1.0.179: 下边界缩小到0px */
}

.btn-manual-settle-sm {
    background: #28a745;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.btn-manual-settle-sm:hover {
    background: #218838;
}

/* V1.0.178: 手工标记为未结按钮样式 */
.btn-manual-unsettle-sm {
    background: #ff4d4f;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.btn-manual-unsettle-sm:hover {
    background: #ff7875;
}

.section-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 15px 0;
}

/* V1.0.167: 多店铺合并显示优化 */

/* 遮罩透明 */

/* V1.0.142: 浮窗可拖动样式已合并到文件开头的定义中 */

/* 确保浮窗不超出屏幕 */
.bill-relation-modal.dragging {
    transition: none;
}

/* 多店铺合并信息区域 */
.group-shops-section {
    padding: 4px 16px;           /* V1.0.168: 上下边界改为4px */
    background: #f8f9fa;
    border-radius: 8px;
    margin: -6px 0 10px 0;       /* V1.0.168: 上边距-6px（12-6=6px），下边距10px保持不变 */
    border-left: 3px solid #1890ff;
}

/* 当前店铺标题（显示当前店铺转账金额） */
.group-current-shop {
    font-size: 13px;
    font-weight: 600;
    color: #1890ff;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.group-current-shop-name {
    color: #333;
}

.group-current-shop-amount {
    color: #1890ff;
}

/* 其他店铺列表 */
.group-shop-item {
    font-size: 12px;
    color: #666;
    margin: 4px 0;
    display: flex;
    justify-content: space-between;
}

.group-shop-current {
    font-weight: 600;
    color: #333;
}

/* 合并总金额 */
.group-total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #d9d9d9;
    font-size: 13px;
    font-weight: 600;
    color: #1890ff;
    display: flex;
    justify-content: space-between;
}