/* 企微侧边栏样式 - 轻量化设计 */

:root {
    --primary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #16a085;
    --border-color: #ecf0f1;
    --text-muted: #95a5a6;
    --bg-light: #f8f9fa;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #2c3e50;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

.sidebar-container {
    max-width: 100%;
    padding: 0;
    background-color: #f5f5f5;
}

/* 客户信息卡片 - 紧凑布局 */
.customer-card {
    background-color: white;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* 新的紧凑头部 - 左右布局 */
.card-header-compact {
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.customer-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.customer-avatar-sm img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder-sm {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
}

.customer-info-compact {
    flex: 1;
    min-width: 0;
}

.customer-name-sm {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.2;
}

.customer-remark-sm {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin: 2px 0;
}

.customer-info-compact small {
    font-size: 11px;
}

.customer-right {
    text-align: right;
    flex-shrink: 0;
}

.lead-info-compact,
.ad-info-compact {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    line-height: 1.5;
}

.xhs-link {
    color: #ff2442;
    text-decoration: none;
}

.xhs-link:hover {
    text-decoration: underline;
}

/* 旧版样式保留兼容 */
.customer-card .card-header {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.customer-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.customer-avatar .avatar-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-muted);
}

.customer-info {
    flex: 1;
    min-width: 0;
}

.customer-name {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
}

.customer-remark {
    margin: 0 0 4px 0;
    font-size: 12px;
    color: var(--text-muted);
}

.customer-card .card-body {
    padding: 12px 15px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row i {
    width: 16px;
    text-align: center;
}

/* Tab导航 */
.nav-tabs-container {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-tabs {
    border-bottom: none;
    padding: 0 10px;
    display: flex;
    gap: 5px;
}

.nav-tabs .nav-item {
    flex: 1;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-muted);
    padding: 12px 8px;
    font-size: 13px;
    text-align: center;
    background-color: transparent;
    transition: all 0.3s;
    white-space: nowrap;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: transparent;
}

.nav-tabs .nav-link .badge {
    font-size: 10px;
    padding: 2px 5px;
    margin-left: 4px;
}

/* Tab内容 */
.tab-content {
    padding: 10px;
}

/* 订单卡片 */
.order-card {
    background-color: white;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.order-date {
    font-size: 12px;
    color: var(--text-muted);
}

.order-body {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 收款信息 - 简洁文本形式 */
.payment-text {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.payment-item-text {
    font-size: 13px;
    white-space: nowrap;
}

.payment-item-text strong {
    font-weight: 700;
}

.payment-total-text {
    font-size: 13px;
    margin-left: 4px;
    padding-left: 8px;
    border-left: 2px solid var(--border-color);
}

.payment-total-text strong {
    font-weight: 700;
    font-size: 14px;
}

/* 设计偏好紧凑布局 */
.preference-row-compact {
    align-items: flex-start;
}

.preference-info-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    flex: 1;
    align-items: center;
}

.preference-item-compact {
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    line-height: 1.5;
}

/* 助旺和五行标签行（无label，紧凑排列） */
.boost-tags-row {
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.boost-tags-row .badge {
    margin: 0;
    white-space: nowrap;
}

.preference-remark-compact {
    width: 100%;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed #e0e0e0;
}

/* 设计备注行 */
.design-remark-row {
    align-items: flex-start;
    transition: background-color 0.2s;
    padding: 6px 0;
}

.design-remark-row:hover {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 6px 8px;
    margin: 0 -8px;
}

.design-remark-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.design-remark-text {
    font-weight: 600;
    color: #e67e22;
    font-size: 13px;
    line-height: 1.5;
    flex: 1;
    word-break: break-word;
}

.design-remark-edit-icon {
    color: var(--text-muted);
    font-size: 12px;
    opacity: 0.6;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.design-remark-row:hover .design-remark-edit-icon {
    opacity: 1;
}

.order-row {
    display: flex;
    font-size: 13px;
    align-items: flex-start;
    line-height: 1.6;
}

.order-row label {
    min-width: 75px;
    color: var(--text-muted);
    margin-bottom: 0;
    font-weight: 500;
    flex-shrink: 0;
    padding-top: 2px;
}

.order-row label i {
    width: 16px;
}

/* 紧凑行布局（生辰+助旺合并） */
.order-row-compact {
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.order-row-compact .separator {
    color: var(--border-color);
    margin: 0 4px;
    font-weight: 300;
}

/* 设计偏好行 */
.preference-row {
    align-items: flex-start;
}

/* 收货信息行 */
.shipping-row {
    align-items: flex-start;
}

/* 收款信息行 */
.payment-row {
    align-items: center;
}

/* 设计偏好信息 */
.preference-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.preference-item {
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    line-height: 1.5;
}

.preference-item strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* 预算高亮显示 */
.budget-highlight {
    font-size: 13px;
    font-weight: 600;
}

.budget-amount {
    color: #e74c3c;
    font-weight: 700;
    font-size: 14px;
}

/* 偏好备注 */
.preference-remark {
    font-size: 12px;
    color: #555;
    background-color: #f8f9fa;
    padding: 6px 10px;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
    margin-top: 4px;
    line-height: 1.5;
    word-wrap: break-word;
}

.preference-remark i {
    color: var(--primary-color);
    margin-right: 4px;
}

/* 收货地址信息 */
.shipping-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.shipping-item {
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    line-height: 1.5;
}

.shipping-address {
    font-size: 12px;
    color: #555;
    word-break: break-all;
    line-height: 1.5;
    margin-top: 2px;
}

/* 快递信息（内联显示） */
.tracking-info-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed var(--border-color);
}

.tracking-info-inline i {
    color: var(--info-color);
    font-size: 11px;
}

/* 快递单号信息 */
.tracking-info {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    flex: 1;
}

.tracking-company {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 600;
    padding: 2px 6px;
    background-color: rgba(52, 152, 219, 0.1);
    border-radius: 4px;
}

.tracking-number {
    font-size: 12px;
    color: #333;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.mingpai-row {
    flex-direction: column;
    margin-top: 4px;
}

.mingpai-text {
    margin: 6px 0 0 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid var(--info-color);
    font-size: 12px;
    line-height: 1.7;
    max-height: 120px;
    overflow-y: auto;
    word-wrap: break-word;
    color: #444;
}

.payments {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.order-actions {
    display: flex;
    gap: 8px;
}

.order-actions .btn {
    flex: 1;
    font-size: 12px;
    padding: 6px 8px;
}

/* 紧凑的四按钮操作栏 */
.order-actions-compact {
    display: flex;
    gap: 6px;
}

.btn-action {
    flex: 1;
    padding: 6px 4px;
    font-size: 11px;
    border: 1px solid var(--primary-color);
    background-color: white;
    color: var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-action:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-action.btn-warning {
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.btn-action.btn-warning:hover {
    background-color: var(--warning-color);
    color: white;
}

.btn-action.btn-success {
    border-color: var(--success-color);
    color: var(--success-color);
}

.btn-action.btn-success:hover {
    background-color: var(--success-color);
    color: white;
}

.btn-action.btn-info {
    border-color: var(--info-color);
    color: var(--info-color);
}

.btn-action.btn-info:hover {
    background-color: var(--info-color);
    color: white;
}

.btn-action i {
    margin-right: 2px;
}

/* 快捷操作 */
.quick-actions {
    margin-top: 10px;
}

/* 内联跟进记录区域 */
.followup-inline-section {
    background-color: white;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.followup-inline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.followup-inline-header h6 {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

.followup-inline-list {
    max-height: 200px;
    overflow-y: auto;
}

.followup-item-compact {
    padding: 8px 10px;
    background-color: var(--bg-light);
    border-radius: 6px;
    margin-bottom: 6px;
}

.followup-item-compact:last-child {
    margin-bottom: 0;
}

.followup-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.followup-meta .followup-user {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 11px;
}

.followup-meta .followup-time {
    font-size: 10px;
    color: var(--text-muted);
}

.followup-text {
    font-size: 12px;
    line-height: 1.5;
    color: #333;
    word-wrap: break-word;
}

/* 新增订单区域 */
.new-order-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
}

/* 弹框样式优化 */
.modal-content {
    border-radius: 8px;
}

.modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 14px;
    font-weight: 600;
}

.modal-body {
    padding: 16px;
}

.modal-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    color: var(--border-color);
}

/* 跟进区域 */
.followup-section {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
}

.followup-form {
    margin-bottom: 20px;
}

.followup-history h6 {
    margin-bottom: 15px;
    font-size: 14px;
    color: var(--text-muted);
}

.followup-item {
    padding: 12px;
    background-color: var(--bg-light);
    border-radius: 6px;
    margin-bottom: 10px;
}

.followup-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.followup-user {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 12px;
}

.followup-time {
    font-size: 11px;
    color: var(--text-muted);
}

.followup-content {
    font-size: 13px;
    line-height: 1.6;
    word-wrap: break-word;
}

/* 话术区域 */
.scripts-section {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
}

.category-group {
    margin-bottom: 20px;
}

.category-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--border-color);
}

.script-item {
    background-color: var(--bg-light);
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}

.script-header {
    padding: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.script-header:hover {
    background-color: #e9ecef;
}

.script-name {
    font-weight: 500;
    font-size: 13px;
}

.script-content {
    padding: 12px;
    border-top: 1px solid var(--border-color);
}

.script-content p {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 素材区域 */
.materials-section {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
}

.material-category {
    margin-bottom: 20px;
}

.material-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.material-item {
    position: relative;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    background-color: var(--bg-light);
    transition: transform 0.2s;
}

.material-item:hover {
    transform: scale(1.05);
}

.material-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.video-thumb,
.voice-thumb,
.doc-thumb {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.video-thumb i {
    position: absolute;
    font-size: 32px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.voice-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
}

.voice-thumb i {
    font-size: 32px;
    color: white;
}

.doc-thumb i {
    font-size: 32px;
    color: var(--primary-color);
}

.material-name {
    display: block;
    padding: 6px 8px;
    font-size: 11px;
    text-align: center;
    background-color: white;
    border-top: 1px solid var(--border-color);
}

/* 响应式 */
@media (max-width: 576px) {
    .material-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .order-actions {
        flex-wrap: wrap;
    }
    
    .order-actions .btn {
        flex: 0 0 calc(50% - 4px);
    }
}

/* 按钮样式优化 */
.btn {
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s;
}

.btn-sm {
    font-size: 12px;
    padding: 6px 12px;
}

.btn i {
    margin-right: 4px;
}

/* 表单控件 */
.form-control {
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* 加载动画 */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* 徽章 */
.badge {
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
}


/* ==================== ��ʽTab��ʽ ==================== */

/* ��ʽɸѡ���� */
.style-filters {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.filter-row label {
    min-width: 50px;
    margin: 0;
    font-weight: 500;
    font-size: 13px;
}

.filter-row .form-control {
    flex: 1;
}

/* 嵌套Tab样式 */
.nav-tabs-sm {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 12px;
}

.nav-tabs-sm .nav-link {
    padding: 6px 12px;
    font-size: 13px;
    color: #666;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
}

.nav-tabs-sm .nav-link:hover {
    border-color: transparent;
    color: var(--primary-color);
}

.nav-tabs-sm .nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

/* ��ʽ�б� */
.styles-list {
    background: white;
    border-radius: 8px;
    padding: 12px;
    height: calc(100vh - 280px);
    overflow-y: auto;
}

.styles-section {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ��ʽ��Ƭ */
.style-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.style-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.style-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-light);
}

.style-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.style-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.style-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.style-price {
    font-size: 16px;
    font-weight: bold;
    color: var(--danger-color);
}

.style-desc {
    font-size: 13px;
    color: #666;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.style-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.style-tags .tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: var(--bg-light);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.style-tags .tag i {
    font-size: 10px;
}

/* ��Ӧʽ���� */
@media (max-width: 768px) {
    .styles-grid {
        grid-template-columns: 1fr;
    }
    
    .style-card {
        flex-direction: column;
    }
    
    .style-image {
        width: 100%;
        height: 200px;
    }
}

/* 款式网格（两列布局） */
.styles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* 紧凑的款式卡片 */
.style-card-compact {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
}

.style-card-compact:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.style-image-compact {
    width: 100%;
    height: 100px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--bg-light);
}

.style-image-compact img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.style-info-compact {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.style-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 6px;
}

.badge-sm {
    font-size: 11px;
    padding: 2px 6px;
}

.style-price-compact {
    font-size: 12px;
    font-weight: bold;
    color: var(--danger-color);
    white-space: nowrap;
}

.style-desc-compact {
    font-size: 11px;
    color: #666;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.style-tags-compact {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.tag-compact {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 1px 6px;
    background: var(--bg-light);
    border-radius: 3px;
    font-size: 10px;
    color: var(--text-muted);
}

.tag-compact i {
    font-size: 9px;
}

/* 款式操作按钮组 */
.style-actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color);
}

.style-action-btn {
    flex: 1;
    padding: 6px;
    font-size: 11px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.style-action-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.style-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.style-action-btn i {
    font-size: 14px;
}
