/* ============================================
   变量管理样式
   ============================================ */

.vars-stats-bar {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.vars-stats-bar .stat-card {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    background: #fafafa;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.2s;
}

.vars-stats-bar .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.vars-stats-bar .stat-card .stat-value {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.2;
}

.vars-stats-bar .stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.vars-stats-bar .stat-card.stat-input {
    border-left: 3px solid #52c41a;
}

.vars-stats-bar .stat-card.stat-calc {
    border-left: 3px solid #1890ff;
}

.vars-stats-bar .stat-card.stat-assumption {
    border-left: 3px solid #faad14;
}

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-input {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    min-width: 180px;
}

.filter-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    min-width: 120px;
    background: var(--bg-white);
}

.toolbar-actions {
    display: flex;
    gap: 8px;
}

.vars-table-container {
    padding: 0;
    max-height: calc(100vh - 340px);
    overflow: auto;
}

.vars-table {
    table-layout: fixed;
    width: 100%;
}

.vars-table th {
    background: #fafafa;
    font-weight: 600;
    font-size: 13px;
    padding: 12px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.vars-table td {
    padding: 12px;
    vertical-align: middle;
}

.vars-table .col-name { width: 200px; }
.vars-table .col-type { width: 100px; text-align: center; }
.vars-table .col-level { width: 90px; text-align: center; }
.vars-table .col-step { width: 70px; text-align: center; }
.vars-table .col-rules-igoc { width: 90px; text-align: center; }
.vars-table .col-rules-poc { width: 90px; text-align: center; }
.vars-table .col-formula { width: 280px; max-width: 280px; text-align: center; }
.vars-table .col-actions { width: 120px; text-align: center; }

.var-name-cell {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-color);
}

.var-name-cell:hover {
    color: var(--primary-color);
    cursor: pointer;
}

.var-type-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.var-type-tag::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.var-type-tag.input { background: #f6ffed; color: #389e0d; }
.var-type-tag.input::before { background: #52c41a; }

.var-type-tag.calc { background: #e6f7ff; color: #096dd9; }
.var-type-tag.calc::before { background: #1890ff; }

.var-type-tag.assumption { background: #fffbe6; color: #d48806; }
.var-type-tag.assumption::before { background: #faad14; }

.level-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Monaco', monospace;
}

.level-badge.AGOC { background: #f0f5ff; color: #2f54eb; }
.level-badge.IGOC { background: #f6ffed; color: #389e0d; }
.level-badge.POC { background: #fff7e6; color: #fa8c16; }

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #f5f5f5;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.rule-badges {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
}

.rule-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 8px;
    background: #f5f5f5;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.formula-cell {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.formula-cell:hover {
    color: var(--text-color);
    white-space: normal;
    word-break: break-all;
}

.var-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}

.var-actions .btn {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.vars-table tbody tr {
    transition: background 0.2s;
}

.vars-table tbody tr:hover {
    background: #f5f5f5;
}

.vars-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.vars-empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.vars-empty-state h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-color);
}

.vars-empty-state p {
    margin-bottom: 20px;
    font-size: 14px;
}
