/* 组件样式 */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    /* 修复: 垂直居中, 避免长内容弹窗底部超出视口导致保存按钮不可见 */
    align-items: center;
    z-index: var(--z-30);
    padding: var(--space-4);
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-width: 400px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* 搜索选择框输入与普通输入框样式统一(覆盖 style.css 中更宽的 padding/圆角) */
.searchable-select input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    background-color: #fff;
    font-size: 14px;
    color: #333;
}

/* 按钮样式已在 style.css 中定义，此处删除避免冲突 */

.table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.table th,
.table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

/* 表格优化样式 */
.table-optimized th,
.table-optimized td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

/* 订单管理表格特殊样式 */
#orders-table th:nth-child(2),
#orders-table td:nth-child(2) {
    width: 100px; /* 明确设置客户列宽度 */
    max-width: 100px;
    word-break: break-word;
}

#orders-table th:nth-child(3),
#orders-table td:nth-child(3) {
    width: 80px; /* 明确设置联系人列宽度 */
    max-width: 80px;
    word-break: break-word;
}

#orders-table th:nth-child(5),
#orders-table td:nth-child(5) {
    width: 80px; /* 调整图片列宽度以适应32x32的缩略图 */
    text-align: center;
    word-break: keep-all;
}

#orders-table th:nth-child(6),
#orders-table td:nth-child(6) {
    width: 200px; /* 调整商品列宽度 */
    max-width: 250px;
    text-align: center;
    word-break: break-word;
    word-wrap: break-word;
}

/* 调整订单管理表格商品名称样式，使其更紧凑 */
#orders-table .product-item {
    display: block;
    margin-bottom: 4px;
    line-height: 1.3;
    font-size: 12px; /* 商品详细信息使用较小的字体 */
}

/* 财务管理表格特殊样式 */
#finance-table th:nth-child(1),
#finance-table td:nth-child(1) {
    width: 70px !important; /* 序号列 */
    min-width: 70px !important;
    max-width: 70px !important;
}

/* 客户管理表格特殊样式 */
#customers-table th:nth-child(1),
#customers-table td:nth-child(1) {
    width: 70px !important; /* 序号列 */
    min-width: 70px !important;
    max-width: 70px !important;
}

/* 供应商管理表格特殊样式 */
#suppliers-table th:nth-child(1),
#suppliers-table td:nth-child(1) {
    width: 70px !important; /* 序号列 */
    min-width: 70px !important;
    max-width: 70px !important;
}

/* 商品管理表格特殊样式 */
#products-table th:nth-child(1),
#products-table td:nth-child(1) {
    width: 70px !important; /* 序号列 */
    min-width: 70px !important;
    max-width: 70px !important;
}

/* 项目管理表格特殊样式 */
#construction-table th:nth-child(1),
#construction-table td:nth-child(1) {
    width: 70px !important; /* 序号列 */
    min-width: 70px !important;
    max-width: 70px !important;
}

#finance-table th:nth-child(2),
#finance-table td:nth-child(2) {
    width: 80px; /* 类型列 */
}

#finance-table th:nth-child(3),
#finance-table td:nth-child(3) {
    width: 120px; /* 金额列 */
}

#finance-table th:nth-child(4),
#finance-table td:nth-child(4) {
    width: 150px; /* 具体事由列 */
}

#finance-table th:nth-child(5),
#finance-table td:nth-child(5) {
    width: 150px; /* 客户/供应商列 */
}

#finance-table th:nth-child(6),
#finance-table td:nth-child(6) {
    width: 150px; /* 备注列 */
}

#finance-table th:nth-child(7),
#finance-table td:nth-child(7) {
    width: 100px; /* 日期列 */
}

#finance-table th:nth-child(8),
#finance-table td:nth-child(8) {
    width: 100px; /* 创建时间列 */
}

#finance-table th:nth-child(9),
#finance-table td:nth-child(9) {
    width: 120px; /* 操作列 */
}

.table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    list-style: none;
    padding: 0;
}

.pagination li {
    margin: 0 5px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pagination a:hover {
    background-color: #f8f9fa;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group > * {
    flex: 1;
}

.search-box {
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* 状态选择下拉菜单样式 */
.status-select {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: white;
    font-size: 12px;
    min-width: 70px;
    text-align: center;
    text-align-last: center; /* 使选择文本居中 */
    cursor: pointer;
}

.status-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 根据状态值设置下拉菜单样式 */
.status-select[data-status="已完成"] {
    background-color: rgba(76, 175, 80, 0.1) !important;
    color: #2e7d32;
    border-color: rgba(76, 175, 80, 0.3) !important;
}

.status-select[data-status="进行中"] {
    background-color: rgba(255, 152, 0, 0.1) !important;
    color: #ef6c00;
    border-color: rgba(255, 152, 0, 0.3) !important;
}

.status-select[data-status="计划中"] {
    background-color: rgba(158, 158, 158, 0.1) !important;
    color: #455a64;
    border-color: rgba(158, 158, 158, 0.3) !important;
}

.status-select[data-status="已取消"] {
    background-color: rgba(244, 67, 54, 0.1) !important;
    color: #c62828;
    border-color: rgba(244, 67, 54, 0.3) !important;
}

/* 下拉箭头样式保持一致 */
.status-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 12px;
    padding-right: 24px !important;
}

/* 订单模态框商品表格样式 */
.modal-content .data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.modal-content .data-table th,
.modal-content .data-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.modal-content .data-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #495057;
}

.modal-content .data-table tr:hover {
    background-color: #f8f9fa;
}

.modal-content .data-table td.text-center {
    text-align: center;
}

.modal-content .data-table img {
    max-width: 60px;
    max-height: 60px;
}

/* 商品名称列样式 */
.modal-content .data-table td:nth-child(2) {
    width: 260px;
    word-break: break-word;
}

/* 型号列样式 */
.modal-content .data-table td:nth-child(3) {
    width: 80px;
    word-break: break-word;
}

/* 操作列样式 */
.modal-content .data-table td:last-child {
    width: 100px;
    text-align: center;
}

/* 搜索选择框样式 */
.searchable-select {
    position: relative;
    display: inline-block;
    width: 100%;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: var(--z-20);
    display: none;
}

.suggestion-item {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.suggestion-name {
    font-weight: bold;
}

.suggestion-initials {
    color: #6c757d;
    font-size: 0.9em;
    margin-left: 8px;
}

.suggestion-sub {
    font-size: 0.85em;
    color: #6c757d;
}

.no-results {
    padding: 10px;
    color: #6c757d;
    text-align: center;
}

.selected-item-display {
    margin-top: 5px;
    padding: 5px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9em;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 通知组件样式 */
.notifications-container {
    position: fixed;
    z-index: var(--z-40); /* 使用CSS变量规范层级 */
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    pointer-events: none; /* 允许点击穿透 */
}

/* 错误通知置顶显示 */
.notifications-top-center {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 20px;
    width: 100%;
}

.notifications-top-right {
    top: 20px;
    right: 20px;
    width: 400px;
    max-width: 90vw;
}

.notifications-top-left {
    top: 20px;
    left: 20px;
    width: 400px;
    max-width: 90vw;
}

.notifications-bottom-right {
    bottom: 20px;
    right: 20px;
    width: 400px;
    max-width: 90vw;
}

.notifications-bottom-left {
    bottom: 20px;
    left: 20px;
    width: 400px;
    max-width: 90vw;
}

/* 错误通知特别样式 */
.notification-error {
    /* 移除脉冲动画，使用更优雅的视觉强调 */
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3);
    animation: subtleGlow 2s ease-in-out infinite alternate;
    transform-origin: center;
}

@keyframes subtleGlow {
    from { box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3); }
    to { box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.5); }
}

/* 通知基础样式 */
.notification {
    margin: 0 auto 10px auto;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: flex-start;
    animation: slideDown 0.3s ease;
    background: white;
    border-left: 5px solid;
    min-width: 320px;
    max-width: 600px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    pointer-events: auto; /* 恢复元素本身的点击事件 */
}

/* 滑入动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* 不同类型通知的颜色 */
.notification-success {
    border-left-color: #28a745;
}

.notification-error {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #fff5f5 0%, #ffecec 100%);
}

.notification-warning {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fffbeb 0%, #fefcbf 100%);
}

.notification-info {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* 错误通知的文字样式 */
.notification-error div:last-child {
    color: #721c24;
    font-weight: 500;
}

/* 关闭按钮样式 */
.notification-close {
    border: none;
    background: none;
    font-size: 1.4em;
    cursor: pointer;
    padding: 0;
    margin-left: 12px;
    color: #999;
    line-height: 1;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: #333;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .notifications-top-right,
    .notifications-top-left,
    .notifications-bottom-right,
    .notifications-bottom-left {
        width: calc(100vw - 40px);
        max-width: none;
    }
    
    .notification {
        min-width: auto;
        padding: 12px 16px;
    }
}


