/* ==================== 通用表单与表格组件 ==================== */

/* 表格内输入框 */
.table-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    box-sizing: border-box;
    background: var(--color-surface);
    color: var(--color-text-primary);
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

.table-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.15);
}

.asin-textarea {
    min-height: 110px;
    resize: vertical;
    font-family: var(--font-mono);
    line-height: 1.5;
}

.number-input {
    text-align: right;
}

.table-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background-color: var(--color-surface);
    color: var(--color-text-primary);
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

.table-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.15);
}

/* 表格容器 */
.table-container {
    overflow-x: auto;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    padding: 0;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border-light);
    max-height: calc(100vh - 380px);
    overflow-y: auto;
    transition: background-color var(--duration-normal) var(--ease-out),
                border-color var(--duration-normal) var(--ease-out);
}

/* 表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 2000px;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--gradient-primary);
}

.data-table th {
    padding: 14px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    font-family: var(--font-display);
    color: var(--color-text-inverse);
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th:last-child {
    border-right: none;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color var(--duration-fast) var(--ease-out);
}

.data-table tbody tr:hover {
    background: var(--color-surface-hover);
}

.data-table td {
    padding: 14px 12px;
    font-size: 13px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    border-right: 1px solid var(--color-border-light);
}

.data-table td:last-child {
    border-right: none;
}

/* 复选框样式 */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

/* 操作按钮 */
.action-btns {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.btn-edit {
    background: var(--color-info-light);
    color: var(--color-info);
}

.btn-edit:hover {
    background: var(--color-info);
    color: var(--color-text-inverse);
    transform: translateY(-1px);
}

.btn-delete {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.btn-delete:hover {
    background: #ff9f40;
    color: white;
}

/* 清空按钮样式（橙黄色） */
.btn-danger {
    background: linear-gradient(135deg, #ff9f40 0%, #ffc107 100%);
    color: white;
    border: none;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 159, 64, 0.4);
}

/* 表格操作列样式 */
.data-table td:last-child {
    text-align: center;
    vertical-align: middle;
    padding: 10px;
}

.data-table .btn-sm {
    white-space: nowrap;
}

/* 分页样式 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 0 0 0;
}

.page-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background: #ff9f40;
    color: white;
    border-color: #ff9f40;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: #6c757d;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    width: 520px;
    max-width: 90vw;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.4);
    padding: 24px 24px 20px;
}

.modal h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #1f2933;
}

.modal-desc {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
}

.modal textarea {
    width: 100%;
    min-height: 160px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    resize: vertical;
    font-family: Consolas, Menlo, Monaco, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.modal textarea:focus {
    outline: none;
    border-color: #ff9f40;
    box-shadow: 0 0 0 2px rgba(255, 159, 64, 0.15);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.neg-container {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.neg-block {
    flex: 1;
}

.neg-block h4 {
    font-size: 14px;
    margin-bottom: 6px;
    color: #374151;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.tag-success {
    background: #d4edda;
    color: #155724;
}

.tag-warning {
    background: #fff3cd;
    color: #856404;
}

.tag-danger {
    background: #f8d7da;
    color: #721c24;
}

.tag-info {
    background: #d1ecf1;
    color: #0c5460;
}

/* 响应式设计 */


/* 滚动条样式 */
.table-container::-webkit-scrollbar {
    height: 10px;
    width: 10px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* SKU 输入框样式 */
.sku-input {
    cursor: text !important;
}

.sku-cell {
    cursor: pointer;
}

.sku-cell small {
    display: block;
    font-size: 10px;
    margin-top: 2px;
}

/* 无否词提示 */
.no-neg-word {
    color: #999;
    font-size: 12px;
    font-style: italic;
}

/* 进度提示弹窗 */
.progress-toast {
    position: fixed;
    top: 80px;
    right: 30px;
    width: 400px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(450px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.progress-content {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 15px;
}

.progress-icon {
    font-size: 32px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.progress-text {
    flex: 1;
}

.progress-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.progress-desc {
    font-size: 13px;
    color: #718096;
}

.progress-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #cbd5e0;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.progress-close:hover {
    background: #f7fafc;
    color: #4a5568;
}

.progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #ff9f40 0%, #ffc107 100%);
    width: 0%;
    transition: width 0.5s ease;
}

/* ==================== 通用 Toast 与确认弹窗 ==================== */

/* 非阻塞提示Toast */
.toast-notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastSlideDown 0.3s ease;
    min-width: 320px;
    max-width: 90vw;
}

@keyframes toastSlideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast-notification.toast-error {
    border-left: 4px solid #c62828;
}

.toast-notification.toast-success {
    border-left: 4px solid #2e7d32;
}

.toast-notification.toast-warning {
    border-left: 4px solid #ff9f40;
}

.toast-notification.toast-info {
    border-left: 4px solid #ff9f40;
}

.toast-icon {
    font-size: 20px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast-error .toast-icon {
    background: #fef2f2;
    color: #c62828;
}

.toast-success .toast-icon {
    background: #f0fdf4;
    color: #2e7d32;
}

.toast-warning .toast-icon {
    background: #fffbeb;
    color: #d97706;
}

.toast-info .toast-icon {
    background: #fff7ed;
    color: #ff9f40;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: #2d3748;
    line-height: 1.5;
    word-break: break-word;
}

/* 确认弹窗样式 */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.confirm-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 500px;
    animation: slideDown 0.3s ease-out;
    overflow: hidden;
}

.confirm-header {
    padding: 25px 30px 20px;
    background: linear-gradient(135deg, #ff9f40 0%, #ffc107 100%);
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.confirm-icon {
    font-size: 32px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.confirm-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.confirm-body {
    padding: 30px;
}

.confirm-message {
    font-size: 16px;
    line-height: 1.6;
    color: #2d3748;
    margin: 0;
    white-space: pre-line;
}

.confirm-actions {
    padding: 20px 30px;
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #e2e8f0;
}

.confirm-actions .btn {
    min-width: 100px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 修改密码弹窗样式 ==================== */
.modal .form-group {
    margin-bottom: 20px;
}

.modal .form-group label {
    display: block;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 14px;
}

.modal .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

.modal .form-group input:focus {
    outline: none;
    border-color: #ff9f40;
    box-shadow: 0 0 0 3px rgba(255, 159, 64, 0.1);
}
