/* ========== Contracts ========== */
/* ========== 合同列表页 ========== */
.cl-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:20px}
.cl-stat-card{background:#fff;border-radius:8px;padding:18px 20px;display:flex;align-items:center;gap:14px;box-shadow:0 1px 3px rgba(0,0,0,.06);transition:transform .2s}
.cl-stat-card:hover{transform:translateY(-2px)}
.cl-stat-icon{width:44px;height:44px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.cl-stat-icon svg{width:22px;height:22px;fill:#fff}
.cl-stat-icon.si-total{background:linear-gradient(135deg,#e2383e,#ff6b6b)}
.cl-stat-icon.si-sign{background:linear-gradient(135deg,#fa8c16,#ffd666)}
.cl-stat-icon.si-active{background:linear-gradient(135deg,#1890ff,#69c0ff)}
.cl-stat-icon.si-done{background:linear-gradient(135deg,#52c41a,#95de64)}
.cl-stat-num{font-size:24px;font-weight:700;color:#1a1a2e}
.cl-stat-label{font-size:13px;color:#888;margin-top:2px}

/* Tab */
.cl-tabs{display:flex;gap:0;background:#fff;border-radius:8px 8px 0 0;box-shadow:0 1px 3px rgba(0,0,0,.06);border-bottom:2px solid #f0f0f0;padding:0 16px}
.cl-tab{padding:14px 20px;font-size:14px;color:#666;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-2px;transition:all .2s;white-space:nowrap}
.cl-tab:hover{color:#e2383e}
.cl-tab.active{color:#e2383e;font-weight:600;border-bottom-color:#e2383e}
.cl-tab .cl-tab-count{display:inline-block;background:#f5f5f5;color:#999;font-size:11px;padding:1px 7px;border-radius:8px;margin-left:4px;font-weight:400}
.cl-tab.active .cl-tab-count{background:#fef2f2;color:#e2383e}

/* 工具栏 */
.cl-toolbar{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;background:#fff;border-bottom:1px solid #f5f5f5;flex-wrap:wrap;gap:10px}
.cl-toolbar-left{display:flex;align-items:center;gap:10px}
.cl-toolbar-right{display:flex;align-items:center;gap:10px}
.cl-btn{display:inline-flex;align-items:center;gap:5px;padding:8px 16px;border-radius:6px;border:1px solid #ddd;background:#fff;font-size:13px;cursor:pointer;transition:all .2s;color:#333}
.cl-btn:hover{border-color:#e2383e;color:#e2383e}
.cl-btn svg{width:14px;height:14px;fill:currentColor}
.cl-btn-primary{background:#e2383e;color:#fff;border-color:#e2383e}
.cl-btn-primary:hover{background:#c62a30;color:#fff;border-color:#c62a30}
.cl-search{padding:8px 12px 8px 34px;border:1px solid #ddd;border-radius:6px;font-size:13px;width:240px;transition:border-color .2s;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23999'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") no-repeat 10px center/16px}
.cl-search:focus{border-color:#e2383e;outline:none;box-shadow:0 0 0 2px rgba(226,56,62,.1)}
.cl-filter-select{padding:8px 28px 8px 12px;border:1px solid #ddd;border-radius:6px;font-size:13px;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E") right 10px center no-repeat;appearance:none;cursor:pointer;outline:none;transition:border-color .2s}
.cl-filter-select:focus{border-color:#e2383e}

/* 表格 */
.cl-table-wrap{background:#fff;border-radius:0 0 8px 8px;box-shadow:0 1px 3px rgba(0,0,0,.06);overflow:hidden}
.cl-table{width:100%;border-collapse:collapse}
.cl-table thead{background:#fafafa}
.cl-table th{padding:12px 14px;font-size:12px;font-weight:600;color:#666;text-align:left;border-bottom:1px solid #f0f0f0;white-space:nowrap}
.cl-table td{padding:14px;font-size:13px;color:#333;border-bottom:1px solid #f5f5f5;vertical-align:middle}
.cl-table tbody tr:hover{background:#fef2f2}
.cl-table tbody tr:last-child td{border-bottom:none}
.cl-checkbox{width:16px;height:16px;accent-color:#e2383e;cursor:pointer}

/* 合同编号 */
.cl-code{font-family:monospace;font-size:12px;color:#1890ff;cursor:pointer}
.cl-code:hover{text-decoration:underline;color:#096dd9}

/* 金额 */
.cl-amount{font-weight:600;color:#e2383e;font-size:14px}
.cl-amount .unit{font-size:11px;font-weight:400;color:#999;margin-left:2px}

/* 状态 */
.cl-status{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:4px;font-size:12px;font-weight:500}
.cl-status-dot{width:6px;height:6px;border-radius:50%}
.cl-status-draft{background:#f5f5f5;color:#999}
.cl-status-draft .cl-status-dot{background:#999}
.cl-status-sign{background:#fff7e6;color:#fa8c16}
.cl-status-sign .cl-status-dot{background:#fa8c16}
.cl-status-active{background:#e6f7ff;color:#1890ff}
.cl-status-active .cl-status-dot{background:#1890ff}
.cl-status-done{background:#f6ffed;color:#52c41a}
.cl-status-done .cl-status-dot{background:#52c41a}
.cl-status-terminate{background:#fff2f0;color:#ff4d4f}
.cl-status-terminate .cl-status-dot{background:#ff4d4f}

/* 合同类型 */
.cl-type{display:inline-block;padding:2px 8px;border-radius:3px;font-size:11px;font-weight:500}
.cl-type-purchase{background:#e6f7ff;color:#1890ff}
.cl-type-sale{background:#f6ffed;color:#52c41a}
.cl-type-service{background:#f9f0ff;color:#722ed1}
.cl-type-frame{background:#fff7e6;color:#fa8c16}

/* 操作 */
.cl-actions{display:flex;align-items:center;gap:8px}
.cl-link{color:#e2383e;text-decoration:none;font-size:13px;cursor:pointer;transition:color .2s;white-space:nowrap}
.cl-link:hover{color:#c62a30;text-decoration:underline}
.cl-link.secondary{color:#1890ff}
.cl-link.secondary:hover{color:#096dd9}
.cl-sep{color:#e8e8e8}

/* 分页 */
.cl-pagination{display:flex;align-items:center;justify-content:space-between;padding:14px 0}
.cl-page-info{font-size:13px;color:#999}
.cl-page-btns{display:flex;align-items:center;gap:4px}
.cl-page-btn{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border:1px solid #ddd;border-radius:4px;font-size:13px;color:#333;cursor:pointer;background:#fff;transition:all .2s}
.cl-page-btn:hover{border-color:#e2383e;color:#e2383e}
.cl-page-btn.active{background:#e2383e;color:#fff;border-color:#e2383e}
.cl-page-btn.disabled{color:#ccc;cursor:not-allowed;border-color:#f0f0f0}

/* 批量操作 */
.cl-batch{display:none;align-items:center;gap:12px;padding:10px 16px;background:linear-gradient(135deg,#fff5f5,#fee2e2);border-radius:8px;margin-bottom:12px;font-size:13px;color:#666}
.cl-batch.show{display:flex}
.cl-batch span{color:#e2383e;font-weight:600}

/* 响应式 */
@media(max-width:1200px){.cl-stats{grid-template-columns:repeat(2,1fr)}}
@media(max-width:900px){.cl-stats{grid-template-columns:1fr}.cl-toolbar{flex-direction:column;align-items:stretch}.cl-toolbar-right{flex-wrap:wrap}}
@media(max-width:640px){.cl-table{font-size:12px}.cl-table th,.cl-table td{padding:10px 8px}}

/* ========== 合同详情页 ========== */
.cd-breadcrumb{display:flex;align-items:center;gap:6px;margin-bottom:16px;font-size:13px;color:#999}
.cd-breadcrumb a{color:#999;text-decoration:none;transition:color .2s}
.cd-breadcrumb a:hover{color:#e2383e}
.cd-breadcrumb .sep{color:#ccc}
.cd-breadcrumb .current{color:#333;font-weight:500}

/* 顶部状态条 */
.cd-status-bar{background:#fff;border-radius:8px;padding:20px 24px;display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;box-shadow:0 1px 3px rgba(0,0,0,.06);flex-wrap:wrap;gap:14px}
.cd-status-left{display:flex;align-items:center;gap:14px}
.cd-status-icon{width:48px;height:48px;border-radius:12px;display:flex;align-items:center;justify-content:center}
.cd-status-icon svg{width:24px;height:24px;fill:#fff}
.cd-status-icon.si-active{background:linear-gradient(135deg,#1890ff,#69c0ff)}
.cd-status-icon.si-sign{background:linear-gradient(135deg,#fa8c16,#ffd666)}
.cd-status-icon.si-done{background:linear-gradient(135deg,#52c41a,#95de64)}
.cd-status-icon.si-draft{background:linear-gradient(135deg,#bbb,#ddd)}
.cd-status-icon.si-terminate{background:linear-gradient(135deg,#ff4d4f,#ff7875)}
.cd-status-title{font-size:20px;font-weight:700;color:#1a1a2e}
.cd-status-meta{font-size:13px;color:#999;margin-top:4px;display:flex;gap:16px}
.cd-status-meta span{display:flex;align-items:center;gap:4px}
.cd-status-actions{display:flex;gap:10px;flex-wrap:wrap}
.cd-btn{display:inline-flex;align-items:center;gap:5px;padding:8px 18px;border-radius:6px;border:1px solid #ddd;background:#fff;font-size:13px;cursor:pointer;transition:all .2s;color:#333}
.cd-btn:hover{border-color:#e2383e;color:#e2383e}
.cd-btn svg{width:14px;height:14px;fill:currentColor}
.cd-btn-primary{background:#e2383e;color:#fff;border-color:#e2383e}
.cd-btn-primary:hover{background:#c62a30;color:#fff;border-color:#c62a30}
.cd-btn-success{background:#52c41a;color:#fff;border-color:#52c41a}
.cd-btn-success:hover{background:#3fad0e;color:#fff;border-color:#3fad0e}
.cd-btn-danger{background:#fff;color:#ff4d4f;border-color:#ff4d4f}
.cd-btn-danger:hover{background:#fff2f0;color:#ff4d4f}

/* 双栏布局 */
.cd-layout{display:grid;grid-template-columns:1fr 340px;gap:16px;align-items:start}
.cd-main-col{display:flex;flex-direction:column;gap:16px}
.cd-side-col{display:flex;flex-direction:column;gap:16px}

/* 卡片 */
.cd-card{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.06);overflow:hidden}
.cd-card-head{padding:16px 20px;border-bottom:1px solid #f5f5f5;display:flex;align-items:center;justify-content:space-between}
.cd-card-title{font-size:15px;font-weight:600;color:#1a1a2e;display:flex;align-items:center;gap:8px}
.cd-card-title::before{content:'';width:3px;height:16px;background:#e2383e;border-radius:2px}
.cd-card-body{padding:20px}

/* 信息网格 */
.cd-info-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.cd-info-item{display:flex;flex-direction:column;gap:4px}
.cd-info-label{font-size:12px;color:#999}
.cd-info-value{font-size:13px;color:#333;font-weight:500}
.cd-info-value.code{font-family:monospace;color:#1890ff}
.cd-info-value.amount{color:#e2383e;font-size:16px;font-weight:700}
.cd-info-value.amount .unit{font-size:12px;font-weight:400;color:#999}

/* 状态标签 */
.cd-tag{display:inline-flex;align-items:center;gap:4px;padding:3px 10px;border-radius:4px;font-size:12px;font-weight:500}
.cd-tag-dot{width:6px;height:6px;border-radius:50%}
.cd-tag-purchase{background:#e6f7ff;color:#1890ff}
.cd-tag-sale{background:#f6ffed;color:#52c41a}
.cd-tag-service{background:#f9f0ff;color:#722ed1}
.cd-tag-frame{background:#fff7e6;color:#fa8c16}

/* 付款计划表 */
.cd-pay-table{width:100%;border-collapse:collapse}
.cd-pay-table th{padding:10px 14px;font-size:12px;font-weight:600;color:#666;text-align:left;background:#fafafa;border-bottom:1px solid #f0f0f0}
.cd-pay-table td{padding:12px 14px;font-size:13px;color:#333;border-bottom:1px solid #f5f5f5}
.cd-pay-table tbody tr:hover{background:#fef2f2}
.cd-pay-status{display:inline-flex;align-items:center;gap:3px;padding:2px 8px;border-radius:3px;font-size:12px}
.cd-pay-paid{background:#f6ffed;color:#52c41a}
.cd-pay-unpaid{background:#fff7e6;color:#fa8c16}
.cd-pay-overdue{background:#fff2f0;color:#ff4d4f}

/* 附件列表 */
.cd-attach-list{display:flex;flex-direction:column;gap:10px}
.cd-attach-item{display:flex;align-items:center;gap:10px;padding:10px 14px;border:1px solid #f0f0f0;border-radius:6px;transition:all .2s}
.cd-attach-item:hover{border-color:#e2383e;background:#fef2f2}
.cd-attach-icon{width:36px;height:36px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700;color:#fff;flex-shrink:0}
.cd-attach-icon.ai-pdf{background:#ff4d4f}
.cd-attach-icon.ai-doc{background:#1890ff}
.cd-attach-icon.ai-xls{background:#52c41a}
.cd-attach-icon.ai-img{background:#722ed1}
.cd-attach-info{flex:1;min-width:0}
.cd-attach-name{font-size:13px;color:#333;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cd-attach-size{font-size:11px;color:#999;margin-top:2px}
.cd-attach-dl{color:#1890ff;text-decoration:none;font-size:12px;cursor:pointer;white-space:nowrap}
.cd-attach-dl:hover{text-decoration:underline}

/* 右侧卡片 */
.cd-summary-header{background:linear-gradient(135deg,#e2383e,#ff6b6b);padding:20px;text-align:center;color:#fff}
.cd-summary-amount{font-size:28px;font-weight:700;margin-top:6px}
.cd-summary-amount .unit{font-size:14px;font-weight:400;opacity:.8}
.cd-summary-label{font-size:13px;opacity:.8}

.cd-summary-rows{padding:16px 20px}
.cd-summary-row{display:flex;justify-content:space-between;padding:10px 0;border-bottom:1px solid #f5f5f5;font-size:13px}
.cd-summary-row:last-child{border-bottom:none}
.cd-summary-row .label{color:#999}
.cd-summary-row .value{color:#333;font-weight:500}

/* 进度步骤 */
.cd-progress{padding:20px}
.cd-step-list{display:flex;flex-direction:column;gap:0}
.cd-step-item{display:flex;gap:12px;position:relative}
.cd-step-dot-col{display:flex;flex-direction:column;align-items:center;width:24px;flex-shrink:0}
.cd-step-dot{width:24px;height:24px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:700;flex-shrink:0;z-index:1}
.cd-step-dot.done{background:#52c41a;color:#fff}
.cd-step-dot.current{background:#e2383e;color:#fff;box-shadow:0 0 0 4px rgba(226,56,62,.15)}
.cd-step-dot.pending{background:#f0f0f0;color:#bbb}
.cd-step-line{flex:1;width:2px;min-height:24px;background:#e8e8e8}
.cd-step-line.done{background:#52c41a}
.cd-step-content{padding-bottom:16px;flex:1}
.cd-step-name{font-size:13px;font-weight:600;color:#333}
.cd-step-name.done{color:#52c41a}
.cd-step-name.pending{color:#bbb}
.cd-step-time{font-size:11px;color:#999;margin-top:2px}

/* 操作记录 */
.cd-timeline{padding:20px}
.cd-tl-item{display:flex;gap:12px;position:relative;padding-bottom:16px}
.cd-tl-item:last-child{padding-bottom:0}
.cd-tl-dot-col{display:flex;flex-direction:column;align-items:center;width:18px;flex-shrink:0}
.cd-tl-dot{width:10px;height:10px;border-radius:50%;background:#e2383e;border:2px solid #fef2f2;flex-shrink:0;z-index:1}
.cd-tl-dot.green{background:#52c41a;border-color:#f6ffed}
.cd-tl-dot.gray{background:#ddd;border-color:#fafafa}
.cd-tl-line{flex:1;width:1px;background:#e8e8e8;min-height:20px}
.cd-tl-info{flex:1}
.cd-tl-title{font-size:13px;color:#333;font-weight:500}
.cd-tl-meta{font-size:11px;color:#999;margin-top:2px}
.cd-tl-desc{font-size:12px;color:#666;margin-top:4px;padding:6px 10px;background:#fafafa;border-radius:4px}

/* 响应式 */
@media(max-width:1200px){.cd-layout{grid-template-columns:1fr}.cd-side-col{order:-1}.cd-info-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:640px){.cd-info-grid{grid-template-columns:1fr}.cd-status-bar{flex-direction:column;align-items:flex-start}}

/* ========== 新增合同页 ========== */
.ca-steps{display:flex;align-items:center;justify-content:center;gap:0;margin-bottom:24px;padding:20px 0}
.ca-step{display:flex;align-items:center;gap:0}
.ca-step-circle{width:32px;height:32px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;border:2px solid #ddd;color:#bbb;background:#fff;transition:all .3s;flex-shrink:0}
.ca-step-circle.active{border-color:#e2383e;background:#e2383e;color:#fff;box-shadow:0 0 0 4px rgba(226,56,62,.12)}
.ca-step-circle.done{border-color:#52c41a;background:#52c41a;color:#fff}
.ca-step-label{font-size:13px;color:#999;margin-top:6px;text-align:center;white-space:nowrap;transition:color .3s}
.ca-step-label.active{color:#e2383e;font-weight:600}
.ca-step-label.done{color:#52c41a}
.ca-step-connector{width:80px;height:2px;background:#e8e8e8;margin:0 8px;transition:background .3s}
.ca-step-connector.done{background:#52c41a}
.ca-step-content{display:flex;flex-direction:column;align-items:center}

/* 表单卡片 */
.ca-card{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.06);overflow:hidden;margin-bottom:16px}
.ca-card-head{padding:16px 20px;border-bottom:1px solid #f5f5f5;display:flex;align-items:center;justify-content:space-between}
.ca-card-title{font-size:15px;font-weight:600;color:#1a1a2e;display:flex;align-items:center;gap:8px}
.ca-card-title::before{content:'';width:3px;height:16px;background:#e2383e;border-radius:2px}
.ca-card-body{padding:20px}

/* 表单 */
.ca-form-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.ca-form-group{display:flex;flex-direction:column;gap:6px}
.ca-form-group.full{grid-column:1/-1}
.ca-form-label{font-size:13px;color:#666;font-weight:500}
.ca-form-label .required{color:#e2383e;margin-left:2px}
.ca-form-input,.ca-form-select,.ca-form-textarea{padding:8px 12px;border:1px solid #ddd;border-radius:6px;font-size:13px;color:#333;transition:border-color .2s;outline:none;background:#fff}
.ca-form-input:focus,.ca-form-select:focus,.ca-form-textarea:focus{border-color:#e2383e;box-shadow:0 0 0 2px rgba(226,56,62,.08)}
.ca-form-input::placeholder,.ca-form-textarea::placeholder{color:#bbb}
.ca-form-select{appearance:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E") right 10px center no-repeat;padding-right:28px;cursor:pointer}
.ca-form-textarea{resize:vertical;min-height:80px;line-height:1.6}
.ca-form-row{display:flex;gap:8px;align-items:center}
.ca-form-row .ca-form-input{flex:1}

/* Switch */
.ca-switch-wrap{display:flex;align-items:center;gap:8px;margin-top:4px}
.ca-switch{position:relative;width:40px;height:22px;cursor:pointer}
.ca-switch input{opacity:0;width:0;height:0}
.ca-switch-slider{position:absolute;inset:0;background:#ddd;border-radius:11px;transition:all .2s}
.ca-switch-slider::before{content:'';position:absolute;width:18px;height:18px;border-radius:50%;background:#fff;top:2px;left:2px;transition:transform .2s}
.ca-switch input:checked+.ca-switch-slider{background:#e2383e}
.ca-switch input:checked+.ca-switch-slider::before{transform:translateX(18px)}
.ca-switch-text{font-size:13px;color:#666}

/* 付款计划 */
.ca-pay-list{display:flex;flex-direction:column;gap:12px}
.ca-pay-item{border:1px solid #f0f0f0;border-radius:8px;padding:16px;transition:border-color .2s}
.ca-pay-item:hover{border-color:#e2383e}
.ca-pay-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.ca-pay-title{font-size:13px;font-weight:600;color:#333;display:flex;align-items:center;gap:6px}
.ca-pay-title .idx{display:inline-flex;width:22px;height:22px;border-radius:50%;background:#e2383e;color:#fff;font-size:11px;align-items:center;justify-content:center}
.ca-pay-remove{color:#ff4d4f;cursor:pointer;font-size:12px;border:none;background:none}
.ca-pay-remove:hover{text-decoration:underline}
.ca-pay-form{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}
.ca-add-pay{display:flex;align-items:center;justify-content:center;gap:6px;padding:12px;border:2px dashed #ddd;border-radius:8px;color:#999;cursor:pointer;font-size:13px;transition:all .2s;margin-top:4px}
.ca-add-pay:hover{border-color:#e2383e;color:#e2383e;background:#fef2f2}
.ca-add-pay svg{width:16px;height:16px;fill:currentColor}

/* 附件上传 */
.ca-upload-area{border:2px dashed #ddd;border-radius:8px;padding:32px;text-align:center;cursor:pointer;transition:all .2s}
.ca-upload-area:hover{border-color:#e2383e;background:#fef2f2}
.ca-upload-icon{width:48px;height:48px;margin:0 auto 10px;color:#ccc}
.ca-upload-icon svg{width:48px;height:48px;fill:#ccc}
.ca-upload-text{font-size:13px;color:#999}
.ca-upload-text em{color:#e2383e;font-style:normal}
.ca-upload-hint{font-size:11px;color:#bbb;margin-top:6px}
.ca-file-list{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.ca-file-item{display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid #f0f0f0;border-radius:6px}
.ca-file-icon{width:28px;height:28px;border-radius:4px;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:700;color:#fff;flex-shrink:0}
.ca-file-icon.fi-pdf{background:#ff4d4f}
.ca-file-icon.fi-doc{background:#1890ff}
.ca-file-icon.fi-xls{background:#52c41a}
.ca-file-name{flex:1;font-size:12px;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ca-file-size{font-size:11px;color:#999}
.ca-file-del{color:#ff4d4f;cursor:pointer;font-size:12px;border:none;background:none}
.ca-file-del:hover{text-decoration:underline}

/* 底部操作 */
.ca-footer{background:#fff;border-radius:8px;padding:16px 20px;box-shadow:0 1px 3px rgba(0,0,0,.06);display:flex;align-items:center;justify-content:space-between;position:sticky;bottom:0;z-index:10}
.ca-footer-left{display:flex;gap:10px}
.ca-footer-right{display:flex;gap:10px}
.ca-btn{display:inline-flex;align-items:center;gap:5px;padding:8px 20px;border-radius:6px;border:1px solid #ddd;background:#fff;font-size:13px;cursor:pointer;transition:all .2s;color:#333}
.ca-btn:hover{border-color:#e2383e;color:#e2383e}
.ca-btn-primary{background:#e2383e;color:#fff;border-color:#e2383e}
.ca-btn-primary:hover{background:#c62a30;border-color:#c62a30;color:#fff}
.ca-btn-success{background:#52c41a;color:#fff;border-color:#52c41a}
.ca-btn-success:hover{background:#3fad0e;border-color:#3fad0e;color:#fff}

/* 隐藏步骤内容 */
.ca-step-panel{display:none}
.ca-step-panel.active{display:block}

/* 响应式 */
@media(max-width:1200px){.ca-form-grid{grid-template-columns:repeat(2,1fr)}.ca-pay-form{grid-template-columns:repeat(2,1fr)}}
@media(max-width:768px){.ca-form-grid{grid-template-columns:1fr}.ca-pay-form{grid-template-columns:1fr}.ca-steps{flex-wrap:wrap;gap:8px}.ca-step-connector{width:40px}}


/* ===== 合同模板列表页 ===== */

/* 面包屑 */
.tl-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 16px;
}
.tl-breadcrumb a {
  color: var(--gray-500);
  text-decoration: none;
  transition: color .15s;
}
.tl-breadcrumb a:hover {
  color: var(--primary);
}
.tl-breadcrumb .current {
  color: var(--gray-900);
  font-weight: 500;
}
.tl-breadcrumb .sep {
  color: var(--gray-300);
}

/* 页面头部 */
.tl-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.tl-page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
}
.tl-page-desc {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* 统计 */
.tl-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.tl-stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: box-shadow .2s;
}
.tl-stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.tl-stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tl-stat-icon svg { width: 24px; height: 24px; fill: #fff; }
.tl-stat-icon.ic-total { background: linear-gradient(135deg, #e2383e, #ff6b6b); }
.tl-stat-icon.ic-enabled { background: linear-gradient(135deg, #16a34a, #4ade80); }
.tl-stat-icon.ic-disabled { background: linear-gradient(135deg, #9ca3af, #d1d5db); }
.tl-stat-icon.ic-recent { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.tl-stat-num { font-size: 28px; font-weight: 700; color: var(--gray-900); line-height: 1.2; }
.tl-stat-label { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* 筛选栏 */
.tl-filter-bar {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.tl-filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tl-filter-label {
  font-size: 13px;
  color: var(--gray-500);
  white-space: nowrap;
}
.tl-filter-select {
  height: 32px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 0 28px 0 10px;
  font-size: 13px;
  color: var(--gray-700);
  outline: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239ca3af'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 6px center;
  background-size: 18px;
  appearance: none;
  cursor: pointer;
  min-width: 130px;
}
.tl-filter-select:focus { border-color: var(--primary); }

.tl-search {
  position: relative;
  margin-left: auto;
}
.tl-search input {
  width: 260px;
  height: 32px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 0 32px 0 12px;
  font-size: 13px;
  color: var(--gray-700);
  outline: none;
  transition: border-color .2s;
}
.tl-search input:focus { border-color: var(--primary); }
.tl-search input::placeholder { color: var(--gray-400); }
.tl-search-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  display: flex;
}
.tl-search-icon svg { width: 16px; height: 16px; }

/* Tab切换 */
.tl-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-100);
  margin-bottom: 0;
  background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 0 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.tl-tab {
  padding: 14px 20px;
  font-size: 14px;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-weight: 500;
}
.tl-tab:hover { color: var(--gray-700); }
.tl-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tl-tab .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 4px;
}
.tl-tab.active .badge { background: #fef2f2; color: var(--primary); }
.tl-tab:not(.active) .badge { background: var(--gray-100); color: var(--gray-500); }

/* 工具栏 */
.tl-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: #fff;
  border-top: 1px solid var(--gray-100);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.tl-toolbar-left { display: flex; align-items: center; gap: 10px; }
.tl-toolbar-right { display: flex; align-items: center; gap: 10px; }

/* 按钮 */
.tl-btn {
  height: 34px;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .15s;
}
.tl-btn svg { width: 16px; height: 16px; }
.tl-btn-primary { background: var(--primary); color: #fff; }
.tl-btn-primary:hover { background: #c42e34; }
.tl-btn-outline { background: #fff; color: var(--gray-700); border: 1px solid var(--gray-200); }
.tl-btn-outline:hover { border-color: var(--gray-300); background: var(--gray-50); }
.tl-btn-text { background: none; color: var(--primary); padding: 0 8px; height: auto; }
.tl-btn-text:hover { background: #fef2f2; }

/* 数据表格 */
.tl-table-wrap {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.tl-table {
  width: 100%;
  border-collapse: collapse;
}
.tl-table th {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-align: left;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}
.tl-table td {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-50);
  vertical-align: middle;
}
.tl-table tr:hover td { background: #fafafa; }
.tl-table .cb {
  width: 40px;
  text-align: center;
}
.tl-table input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer;
}

/* 模板名称列 */
.tl-tpl-name {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tl-tpl-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tl-tpl-icon svg { width: 20px; height: 20px; fill: #fff; }
.tl-tpl-icon.type-purchase { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.tl-tpl-icon.type-sale { background: linear-gradient(135deg, #16a34a, #4ade80); }
.tl-tpl-icon.type-service { background: linear-gradient(135deg, #d97706, #fbbf24); }
.tl-tpl-icon.type-framework { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.tl-tpl-icon.type-labor { background: linear-gradient(135deg, #e2383e, #ff6b6b); }
.tl-tpl-icon.type-tech { background: linear-gradient(135deg, #0891b2, #22d3ee); }

.tl-tpl-info {}
.tl-tpl-title {
  font-weight: 500;
  color: var(--gray-900);
  font-size: 13px;
}
.tl-tpl-code {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* 分类标签 */
.tl-cat-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}
.tl-cat-tag.cat-purchase { background: #eff6ff; color: #2563eb; }
.tl-cat-tag.cat-sale { background: #f0fdf4; color: #16a34a; }
.tl-cat-tag.cat-service { background: #fffbeb; color: #d97706; }
.tl-cat-tag.cat-framework { background: #f5f3ff; color: #7c3aed; }
.tl-cat-tag.cat-labor { background: #fef2f2; color: #e2383e; }
.tl-cat-tag.cat-tech { background: #ecfeff; color: #0891b2; }

/* 状态 */
.tl-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}
.tl-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.tl-status.enabled .tl-status-dot { background: #16a34a; }
.tl-status.enabled { color: #16a34a; }
.tl-status.disabled .tl-status-dot { background: #9ca3af; }
.tl-status.disabled { color: #9ca3af; }
.tl-status.draft .tl-status-dot { background: #d97706; }
.tl-status.draft { color: #d97706; }

/* 操作列 */
.tl-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tl-act-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: none;
  color: var(--gray-500);
  transition: all .15s;
  white-space: nowrap;
}
.tl-act-btn:hover { color: var(--primary); background: #fef2f2; }
.tl-act-btn.primary { color: var(--primary); }
.tl-act-btn.primary:hover { background: #fef2f2; }
.tl-act-btn.danger:hover { color: #dc2626; background: #fef2f2; }

/* 使用次数 */
.tl-use-count {
  font-weight: 600;
  color: var(--primary);
}

/* 分页 */
.tl-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #fff;
  border-top: 1px solid var(--gray-100);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.tl-page-info { font-size: 13px; color: var(--gray-500); }
.tl-page-btns {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tl-page-btn {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.tl-page-btn:hover { border-color: var(--primary); color: var(--primary); }
.tl-page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tl-page-btn:disabled { color: var(--gray-300); cursor: not-allowed; }

/* 预览弹窗 */
.tl-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.tl-modal-overlay.show { display: flex; }
.tl-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 640px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  animation: tlModalIn .2s ease;
}
@keyframes tlModalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.tl-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.tl-modal-title { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.tl-modal-close {
  width: 32px; height: 32px; border: none; background: none; cursor: pointer;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: var(--gray-400); transition: all .15s;
}
.tl-modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.tl-modal-close svg { width: 18px; height: 18px; }

.tl-modal-body { padding: 24px; }
.tl-preview-section { margin-bottom: 20px; }
.tl-preview-section:last-child { margin-bottom: 0; }
.tl-preview-label {
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.tl-preview-content {
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.7;
  padding: 16px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-100);
}
.tl-preview-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tl-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tl-meta-key { font-size: 13px; color: var(--gray-500); min-width: 70px; }
.tl-meta-val { font-size: 13px; color: var(--gray-900); font-weight: 500; }

.tl-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: #fff;
}

/* 新增模板弹窗 */
.tl-form-group { margin-bottom: 18px; }
.tl-form-group:last-child { margin-bottom: 0; }
.tl-form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.tl-form-label .required { color: var(--primary); margin-left: 2px; }
.tl-form-input,
.tl-form-select,
.tl-form-textarea {
  width: 100%;
  height: 38px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 13px;
  color: var(--gray-700);
  outline: none;
  transition: border-color .2s;
  background: #fff;
}
.tl-form-textarea {
  height: 80px;
  padding: 8px 12px;
  resize: vertical;
}
.tl-form-input:focus,
.tl-form-select:focus,
.tl-form-textarea:focus { border-color: var(--primary); }
.tl-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* 拖拽上传 */
.tl-upload-area {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.tl-upload-area:hover { border-color: var(--primary); background: #fef2f2; }
.tl-upload-icon { color: var(--gray-400); margin-bottom: 8px; }
.tl-upload-icon svg { width: 36px; height: 36px; }
.tl-upload-text { font-size: 14px; color: var(--gray-600); }
.tl-upload-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* Toast */
.tl-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: #16a34a;
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  animation: tlModalIn .3s ease;
}

/* 响应式 */
@media (max-width: 1200px) {
  .tl-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .tl-stats { grid-template-columns: 1fr 1fr; }
  .tl-filter-bar { flex-direction: column; align-items: stretch; }
  .tl-search { margin-left: 0; }
  .tl-search input { width: 100%; }
  .tl-form-row { grid-template-columns: 1fr; }
  .tl-preview-meta { grid-template-columns: 1fr; }
}


/* ===== 合同模板分类列表页 ===== */

/* 页面头部 */
.tc-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.tc-page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gray-900);
}
.tc-page-desc {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 4px;
}

/* 统计卡片 */
.tc-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.tc-stat-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  transition: box-shadow .2s;
}
.tc-stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.tc-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tc-stat-icon svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}
.tc-stat-icon.ic-total { background: linear-gradient(135deg, #e2383e, #ff6b6b); }
.tc-stat-icon.ic-purchase { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.tc-stat-icon.ic-sale { background: linear-gradient(135deg, #16a34a, #4ade80); }
.tc-stat-icon.ic-service { background: linear-gradient(135deg, #d97706, #fbbf24); }

.tc-stat-info {}
.tc-stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.2;
}
.tc-stat-label {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* 工具栏 */
.tc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.tc-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tc-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 分类卡片网格 */
.tc-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.tc-category-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.tc-category-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
  transform: translateY(-2px);
}

/* 卡片头部 */
.tc-card-header {
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
}
.tc-card-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tc-cat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tc-cat-icon svg {
  width: 22px;
  height: 22px;
  fill: #fff;
}
.tc-cat-icon.type-purchase { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.tc-cat-icon.type-sale { background: linear-gradient(135deg, #16a34a, #4ade80); }
.tc-cat-icon.type-service { background: linear-gradient(135deg, #d97706, #fbbf24); }
.tc-cat-icon.type-framework { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.tc-cat-icon.type-labor { background: linear-gradient(135deg, #e2383e, #ff6b6b); }
.tc-cat-icon.type-tech { background: linear-gradient(135deg, #0891b2, #22d3ee); }

.tc-cat-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}
.tc-cat-count {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

.tc-card-actions {
  display: flex;
  gap: 4px;
}
.tc-card-actions button {
  width: 30px;
  height: 30px;
  border: none;
  background: var(--gray-50);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  transition: all .15s;
}
.tc-card-actions button:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}
.tc-card-actions button svg {
  width: 16px;
  height: 16px;
}

/* 卡片内容 */
.tc-card-body {
  padding: 16px 20px 20px;
}
.tc-sub-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.tc-sub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--gray-100);
  cursor: pointer;
  transition: color .15s;
}
.tc-sub-item:last-child {
  border-bottom: none;
}
.tc-sub-item:hover .tc-sub-name {
  color: var(--primary);
}
.tc-sub-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tc-sub-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-300);
  flex-shrink: 0;
}
.tc-sub-name {
  font-size: 14px;
  color: var(--gray-700);
  transition: color .15s;
}
.tc-sub-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tc-sub-num {
  font-size: 12px;
  color: var(--gray-400);
  background: var(--gray-50);
  padding: 2px 8px;
  border-radius: 10px;
}
.tc-sub-arrow {
  color: var(--gray-300);
  display: flex;
  transition: color .15s;
}
.tc-sub-item:hover .tc-sub-arrow {
  color: var(--primary);
}
.tc-sub-arrow svg {
  width: 14px;
  height: 14px;
}

/* 卡片底部 */
.tc-card-footer {
  padding: 12px 20px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tc-card-footer span {
  font-size: 13px;
  color: var(--gray-500);
}
.tc-card-footer a {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.tc-card-footer a:hover {
  text-decoration: underline;
}

/* 搜索框 */
.tc-search {
  position: relative;
}
.tc-search input {
  width: 240px;
  height: 36px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 0 36px 0 12px;
  font-size: 13px;
  color: var(--gray-700);
  outline: none;
  transition: border-color .2s;
}
.tc-search input:focus {
  border-color: var(--primary);
}
.tc-search input::placeholder {
  color: var(--gray-400);
}
.tc-search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  display: flex;
}
.tc-search-icon svg {
  width: 16px;
  height: 16px;
}

/* 新增分类弹窗 */
.tc-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.tc-modal-overlay.show {
  display: flex;
}
.tc-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 520px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.tc-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tc-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
}
.tc-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  transition: all .15s;
}
.tc-modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}
.tc-modal-close svg {
  width: 18px;
  height: 18px;
}
.tc-modal-body {
  padding: 24px;
}
.tc-form-group {
  margin-bottom: 18px;
}
.tc-form-group:last-child {
  margin-bottom: 0;
}
.tc-form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.tc-form-label .required {
  color: var(--primary);
  margin-left: 2px;
}
.tc-form-input,
.tc-form-select,
.tc-form-textarea {
  width: 100%;
  height: 38px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-size: 13px;
  color: var(--gray-700);
  outline: none;
  transition: border-color .2s;
  background: #fff;
}
.tc-form-textarea {
  height: 80px;
  padding: 8px 12px;
  resize: vertical;
}
.tc-form-input:focus,
.tc-form-select:focus,
.tc-form-textarea:focus {
  border-color: var(--primary);
}
.tc-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* 图标选择 */
.tc-icon-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tc-icon-opt {
  width: 40px;
  height: 40px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .15s;
}
.tc-icon-opt:hover {
  border-color: var(--primary);
}
.tc-icon-opt.active {
  border-color: var(--primary);
  background: #fef2f2;
}
.tc-icon-opt svg {
  width: 20px;
  height: 20px;
}

/* 颜色选择 */
.tc-color-options {
  display: flex;
  gap: 8px;
}
.tc-color-opt {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all .15s;
}
.tc-color-opt:hover {
  transform: scale(1.1);
}
.tc-color-opt.active {
  border-color: var(--gray-900);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--gray-300);
}

.tc-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.tc-btn {
  height: 36px;
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .15s;
}
.tc-btn svg {
  width: 16px;
  height: 16px;
}
.tc-btn-primary {
  background: var(--primary);
  color: #fff;
}
.tc-btn-primary:hover {
  background: #c42e34;
}
.tc-btn-outline {
  background: #fff;
  color: var(--gray-700);
  border: 1px solid var(--gray-200);
}
.tc-btn-outline:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
}
.tc-btn-text {
  background: none;
  color: var(--gray-500);
  padding: 0 10px;
}
.tc-btn-text:hover {
  color: var(--primary);
  background: #fef2f2;
}

/* 空状态 */
.tc-empty-row {
  padding: 10px 0;
  font-size: 13px;
  color: var(--gray-400);
  text-align: center;
}

/* 响应式 */
@media (max-width: 1200px) {
  .tc-category-grid { grid-template-columns: repeat(2, 1fr); }
  .tc-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .tc-category-grid { grid-template-columns: 1fr; }
  .tc-stats { grid-template-columns: 1fr 1fr; }
  .tc-toolbar { flex-direction: column; align-items: stretch; }
  .tc-toolbar-left, .tc-toolbar-right { justify-content: space-between; }
  .tc-form-row { grid-template-columns: 1fr; }
}
