/* TDesign风格打印模板页面样式 */
:root {
    --td-brand-color: #0052d9;
    --td-success-color: #00a870;
    --td-warning-color: #ed7b2f;
    --td-error-color: #e34d59;
    --td-info-color: #86909c;
    --td-bg-color: #f5f7fa;
    --td-border-color: #e5e6eb;
    --td-text-primary: #1d2129;
    --td-text-secondary: #4e5969;
    --td-text-placeholder: #86909c;
    --td-shadow-light: 0 1px 3px rgba(0, 0, 0, 0.05);
    --td-shadow-medium: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.print-template-page {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.print-template-container {
    width: 100%;
    max-width: none;
    margin: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 页面头部 */
.print-template-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.print-template-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--td-text-primary);
    line-height: 1.4;
}

.print-template-actions-header {
    display: flex;
    gap: 12px;
}

/* 筛选栏样式 */
.print-template-filter {
    background: white;
    padding: 20px 24px;
    border-radius: 8px;
    box-shadow: var(--td-shadow-light);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e5e6eb;
}

.print-template-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.print-template-filter-label {
    font-size: 14px;
    color: var(--td-text-secondary);
    white-space: nowrap;
}

.print-template-filter-select {
    padding: 8px 12px;
    border: 1px solid var(--td-border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    outline: none;
    min-width: 120px;
}

.print-template-filter-select:focus {
    border-color: var(--td-brand-color);
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.print-template-search-box {
    position: relative;
    flex-grow: 1;
}

.print-template-search-input {
    width: 100%;
    padding: 8px 12px 8px;
    border: 1px solid var(--td-border-color);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.print-template-search-input:focus {
    border-color: var(--td-brand-color);
}

.print-template-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--td-text-placeholder);
}

/* 操作栏样式 */
.print-template-action-bar {
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: var(--td-shadow-light);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    gap: 12px;
    border: 1px solid #e5e6eb;
}

.print-template-batch-actions {
    display: flex;
    gap: 12px;
}

.print-template-total-count {
    font-size: 14px;
    color: var(--td-text-placeholder);
}

/* 模板列表容器样式 */
.print-template-list-container {
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 32px;
    min-height: 400px; /* 设置最小高度保证内容区域有足够空间 */
}

/* 模板卡片列表样式 */
.print-template-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

.print-template-card {
    background: white;
    border-radius: 8px;
    box-shadow: var(--td-shadow-light);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.print-template-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--td-shadow-medium);
}

.print-template-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--td-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.print-template-card-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--td-text-primary);
}

.print-template-card-actions {
    display: flex;
    gap: 8px;
}

.print-template-action-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--td-text-placeholder);
    border-radius: 4px;
    transition: all 0.2s;
}

.print-template-action-btn:hover {
    background: #f7f8fa;
    color: var(--td-brand-color);
}

.print-template-action-btn-disabled {
    color: #ffd700 !important;
    cursor: not-allowed;
    opacity: 0.8;
}

.print-template-action-btn-disabled:hover {
    background: none !important;
    color: #ffd700 !important;
}

.print-template-card-body {
    padding: 16px 20px;
}

.print-template-card-type {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 82, 217, 0.1);
    color: var(--td-brand-color);
    border-radius: 12px;
    font-size: 12px;
    margin-bottom: 12px;
}

.print-template-card-description {
    color: var(--td-text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 12px;
    height: 42px; /* 固定高度，3行文字的高度 (14px * 1.5 * 3 = 63px) */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 限制显示3行 */
    -webkit-box-orient: vertical;
}

.print-template-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--td-text-placeholder);
}

.print-template-card-footer {
    padding: 12px 20px;
    background: #fafbfc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.print-template-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.print-template-status-active {
    background: rgba(0, 168, 112, 0.1);
    color: var(--td-success-color);
}

.print-template-status-inactive {
    background: rgba(237, 123, 47, 0.1);
    color: var(--td-warning-color);
}

/* 可点击的状态标签样式 */
.print-template-status {
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.print-template-status:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.print-template-status-active:hover {
    background: rgba(0, 168, 112, 0.15);
}

.print-template-status-inactive:hover {
    background: rgba(237, 123, 47, 0.15);
}


.print-template-default-tag {
    font-size: 12px;
    color: var(--td-brand-color);
    font-weight: 500;
}

.print-template-card-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 空状态样式 */
.print-template-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--td-text-placeholder);
}

.print-template-empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.print-template-empty-text {
    font-size: 16px;
    margin-bottom: 12px;
}

.print-template-empty-subtext {
    font-size: 14px;
    color: var(--td-text-secondary);
}

/* 分页样式 - 与货品辅材保持一致 */
.print-template-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.print-template-pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.print-template-btn-pagination {
    padding: 6px 12px;
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.print-template-btn-pagination:hover:not(:disabled) {
    background: #f5f5f5;
}

.print-template-btn-pagination:disabled {
    color: #bfbfbf;
    cursor: not-allowed;
}

.print-template-page-info {
    font-size: 14px;
    color: #666;
}

/* 按钮样式 */
.print-template-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: 1px solid;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    gap: 6px;
}

.print-template-btn-primary {
    background: var(--td-brand-color);
    border-color: var(--td-brand-color);
    color: white;
}

.print-template-btn-primary:hover {
    background: #003eb3;
    border-color: #003eb3;
}

.print-template-btn-outline {
    background: white;
    border-color: var(--td-border-color);
    color: var(--td-text-primary);
}

.print-template-btn-outline:hover {
    border-color: var(--td-brand-color);
    color: var(--td-brand-color);
}

.print-template-btn-danger {
    background: white;
    border-color: var(--td-error-color);
    color: var(--td-error-color);
}

.print-template-btn-danger:hover {
    background: var(--td-error-color);
    color: white;
}

/* 模态框样式 */
.print-template-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.print-template-modal.active {
    display: flex;
}

.print-template-modal-content {
    background: white;
    border-radius: 8px;
    width: 500px;
    max-width: 90vw;
    box-shadow: var(--td-shadow-medium);
    max-height: 90vh;
    overflow-y: auto;
}

.print-template-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--td-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.print-template-modal-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--td-text-primary);
}

.print-template-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--td-text-placeholder);
    padding: 4px;
    border-radius: 4px;
}

.print-template-modal-close:hover {
    background: #f7f8fa;
}

.print-template-modal-body {
    padding: 24px;
}

.print-template-modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--td-border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.print-template-form-group {
    margin-bottom: 20px;
}

.print-template-form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--td-text-secondary);
    font-weight: 500;
}

.print-template-form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--td-border-color);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.print-template-form-control:focus {
    border-color: var(--td-brand-color);
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.print-template-form-textarea {
    min-height: 80px;
    resize: vertical;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .print-template-page {
        padding: 16px;
    }
    
    .print-template-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .print-template-filter-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .print-template-action-bar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .print-template-batch-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .print-template-list-container {
        min-height: 300px;
        margin-bottom: 24px;
    }
    
    .print-template-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .print-template-modal-content {
        width: 95vw;
    }
}

/* 表格汇总信息样式 */
.print-template-table-summary {
    font-size: 14px;
    color: #666;
}

