/**
 * 老仙配镜 - 交互组件样式
 */

/* ==================== Modal 弹窗 ==================== */
.lx-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lx-modal-overlay.visible {
    opacity: 1;
}

.lx-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.lx-modal-overlay.visible .lx-modal {
    transform: scale(1) translateY(0);
}

.lx-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lx-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.lx-modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    color: #999;
    transition: all 0.15s;
}

.lx-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.lx-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.lx-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ==================== Button 按钮 ==================== */
.lx-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lx-btn-primary {
    background: linear-gradient(135deg, #1142BE 0%, #2D5FD9 100%);
    color: #fff;
}

.lx-btn-primary:hover {
    box-shadow: 0 4px 15px rgba(17, 66, 190, 0.4);
    transform: translateY(-1px);
}

.lx-btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.lx-btn-secondary:hover {
    background: #eee;
}

.lx-btn-outline {
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
}

.lx-btn-outline:hover {
    border-color: #1142BE;
    color: #1142BE;
}

.lx-btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

/* ==================== Toast 提示 ==================== */
.lx-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lx-toast {
    padding: 14px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #333;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.lx-toast.visible {
    transform: translateX(0);
}

.lx-toast-success { border-left: 4px solid #10b981; }
.lx-toast-error { border-left: 4px solid #ef4444; }
.lx-toast-warning { border-left: 4px solid #f59e0b; }
.lx-toast-info { border-left: 4px solid #3b82f6; }

.lx-toast-success svg { color: #10b981; }
.lx-toast-error svg { color: #ef4444; }
.lx-toast-warning svg { color: #f59e0b; }
.lx-toast-info svg { color: #3b82f6; }

/* ==================== AI 助手 ==================== */
.lx-ai-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #1142BE 0%, #4F7EE8 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(17, 66, 190, 0.4);
    transition: all 0.2s;
    z-index: 1000;
}

.lx-ai-fab:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(17, 66, 190, 0.5);
}

.lx-ai-fab::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: ai-pulse 2s infinite;
    z-index: -1;
}

@keyframes ai-pulse {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.4); opacity: 0; }
}

.lx-ai-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #4ade80;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
}

.lx-ai-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.lx-ai-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.lx-ai-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    height: 100vh;
    background: #fff;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.lx-ai-drawer.open {
    right: 0;
}

.lx-ai-drawer-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lx-ai-drawer-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
}

.lx-ai-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #1142BE 0%, #4F7EE8 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.lx-ai-drawer-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    color: #999;
    background: none;
    border: none;
}

.lx-ai-drawer-close:hover {
    background: #f5f5f5;
    color: #333;
}

.lx-ai-context {
    padding: 12px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lx-ai-context-tag {
    background: rgba(17, 66, 190, 0.1);
    color: #1142BE;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.lx-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.lx-ai-message {
    margin-bottom: 16px;
}

.lx-ai-message-bot {
    display: flex;
    gap: 10px;
}

.lx-ai-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #1142BE 0%, #4F7EE8 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.lx-ai-message-content {
    flex: 1;
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 0 12px 12px 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.lx-ai-message-user {
    display: flex;
    justify-content: flex-end;
}

.lx-ai-message-user .lx-ai-message-content {
    background: linear-gradient(135deg, #1142BE 0%, #2D5FD9 100%);
    color: #fff;
    border-radius: 12px 0 12px 12px;
    max-width: 80%;
}

.lx-ai-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.lx-ai-quick-btn {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 16px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
}

.lx-ai-quick-btn:hover {
    border-color: #1142BE;
    color: #1142BE;
    background: rgba(17, 66, 190, 0.05);
}

.lx-ai-suggestions {
    padding: 12px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid #eee;
}

.lx-ai-suggestion-btn {
    padding: 8px 14px;
    background: #f8fafc;
    border: 1px solid #eee;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
}

.lx-ai-suggestion-btn:hover {
    background: #fff;
    border-color: #1142BE;
    color: #1142BE;
}

.lx-ai-input-area {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
}

.lx-ai-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

.lx-ai-input:focus {
    border-color: #1142BE;
}

.lx-ai-send {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #1142BE 0%, #2D5FD9 100%);
    border: none;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.15s;
}

.lx-ai-send:hover {
    box-shadow: 0 4px 12px rgba(17, 66, 190, 0.4);
}

/* ==================== 开单流程 ==================== */
.lx-order-flow {
    min-height: 500px;
}

.lx-order-steps {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.lx-step {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 14px;
    color: #999;
}

.lx-step.active {
    background: rgba(17, 66, 190, 0.1);
    color: #1142BE;
}

.lx-step.completed {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.lx-step-num {
    width: 24px;
    height: 24px;
    background: #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.lx-step.active .lx-step-num {
    background: #1142BE;
}

.lx-step.completed .lx-step-num {
    background: #10b981;
}

.lx-order-content {
    padding: 0;
}

.lx-order-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* 搜索框 */
.lx-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 16px;
}

.lx-search-box input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
}

/* 顾客列表 */
.lx-customer-list {
    max-height: 320px;
    overflow-y: auto;
}

.lx-customer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 8px;
}

.lx-customer-item:hover {
    background: #f0f4ff;
}

.lx-customer-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #1142BE;
}

.lx-customer-info {
    flex: 1;
}

.lx-customer-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.lx-customer-phone {
    font-size: 13px;
    color: #999;
}

.lx-customer-level {
    padding: 4px 10px;
    background: #f5f5f5;
    border-radius: 6px;
    font-size: 12px;
    color: #999;
}

.lx-customer-level.member {
    background: rgba(17, 66, 190, 0.1);
    color: #1142BE;
}

/* 验光表单 */
.lx-selected-customer {
    padding: 12px 16px;
    background: #f0f4ff;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lx-tag {
    padding: 4px 8px;
    background: #1142BE;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
}

.lx-optometry-form h4 {
    margin-bottom: 16px;
    color: #333;
}

.lx-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.lx-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lx-form-group label {
    font-size: 13px;
    color: #666;
}

.lx-form-group input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

.lx-form-group input:focus {
    border-color: #1142BE;
}

/* 商品选择 */
.lx-product-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.lx-tab {
    padding: 10px 20px;
    background: #f5f5f5;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
}

.lx-tab.active {
    background: #1142BE;
    color: #fff;
}

.lx-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.lx-product-card {
    padding: 16px;
    border: 2px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.lx-product-card:hover {
    border-color: #1142BE;
}

.lx-product-card.selected {
    border-color: #1142BE;
    background: rgba(17, 66, 190, 0.05);
}

.lx-product-img {
    font-size: 40px;
    margin-bottom: 12px;
}

.lx-product-name {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.4;
}

.lx-product-price {
    font-size: 16px;
    font-weight: 600;
    color: #1142BE;
    margin-bottom: 4px;
}

.lx-product-stock {
    font-size: 12px;
    color: #999;
}

.lx-cart-summary {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    margin-top: 20px;
}

/* 订单汇总 */
.lx-order-summary {
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
}

.lx-summary-section {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.lx-summary-section h4 {
    font-size: 14px;
    color: #999;
    margin-bottom: 8px;
}

.lx-summary-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lx-summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.lx-summary-total {
    padding: 16px 20px;
    background: #f8fafc;
}

.lx-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.lx-total-row.discount {
    color: #10b981;
}

.lx-total-row.final {
    font-size: 20px;
    font-weight: 600;
    color: #1142BE;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #ddd;
}

/* 支付方式 */
.lx-payment-methods {
    margin-top: 24px;
}

.lx-payment-methods h4 {
    margin-bottom: 16px;
}

.lx-payment-options {
    display: flex;
    gap: 16px;
}

.lx-payment-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border: 2px solid #eee;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.lx-payment-option:hover {
    border-color: #1142BE;
}

.lx-payment-option.selected {
    border-color: #1142BE;
    background: rgba(17, 66, 190, 0.05);
}

.lx-payment-option input {
    display: none;
}

.lx-payment-icon {
    font-size: 28px;
}

/* ==================== 通知中心 ==================== */
.lx-notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.lx-notification-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    border-radius: 10px;
    transition: all 0.15s;
    margin-bottom: 8px;
}

.lx-notification-item:hover {
    background: #f8fafc;
}

.lx-notification-item.unread {
    background: rgba(17, 66, 190, 0.05);
}

.lx-notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.lx-notification-icon.warning { background: rgba(245, 158, 11, 0.1); }
.lx-notification-icon.success { background: rgba(16, 185, 129, 0.1); }
.lx-notification-icon.info { background: rgba(59, 130, 246, 0.1); }

.lx-notification-content {
    flex: 1;
}

.lx-notification-title {
    font-weight: 500;
    margin-bottom: 4px;
}

.lx-notification-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.lx-notification-time {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
}





