/**
 * 公路造价成本库 - 前端样式
 * 专业化现代UI设计
 */

/* ========================================
   CSS 变量定义
   ======================================== */
:root {
    /* 主色调 */
    --hcdb-primary: #2563eb;
    --hcdb-primary-light: #3b82f6;
    --hcdb-primary-dark: #1d4ed8;
    --hcdb-primary-bg: #eff6ff;

    /* 功能色 */
    --hcdb-success: #10b981;
    --hcdb-success-bg: #d1fae5;
    --hcdb-warning: #f59e0b;
    --hcdb-warning-bg: #fef3c7;
    --hcdb-danger: #ef4444;
    --hcdb-danger-bg: #fee2e2;
    --hcdb-info: #06b6d4;
    --hcdb-info-bg: #cffafe;

    /* 灰度 */
    --hcdb-gray-50: #f9fafb;
    --hcdb-gray-100: #f3f4f6;
    --hcdb-gray-200: #e5e7eb;
    --hcdb-gray-300: #d1d5db;
    --hcdb-gray-400: #9ca3af;
    --hcdb-gray-500: #6b7280;
    --hcdb-gray-600: #4b5563;
    --hcdb-gray-700: #374151;
    --hcdb-gray-800: #1f2937;
    --hcdb-gray-900: #111827;

    /* 渐变 */
    --hcdb-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --hcdb-gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --hcdb-gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --hcdb-gradient-blue: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    --hcdb-gradient-dark: linear-gradient(135deg, #1f2937 0%, #374151 100%);

    /* 圆角 */
    --hcdb-radius-sm: 6px;
    --hcdb-radius: 10px;
    --hcdb-radius-lg: 16px;
    --hcdb-radius-xl: 24px;

    /* 阴影 */
    --hcdb-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --hcdb-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --hcdb-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --hcdb-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --hcdb-shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --hcdb-shadow-glow: 0 0 20px rgba(37, 99, 235, 0.3);

    /* 过渡 */
    --hcdb-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --hcdb-transition-fast: all 0.15s ease;
}

/* ========================================
   基础重置和通用样式
   ======================================== */
.hcdb-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--hcdb-gray-800);
}

/* 通用按钮 */
.hcdb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--hcdb-radius);
    cursor: pointer;
    transition: var(--hcdb-transition);
    background: var(--hcdb-gradient-blue);
    color: #fff;
    text-decoration: none;
    box-shadow: var(--hcdb-shadow);
    position: relative;
    overflow: hidden;
}

.hcdb-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.hcdb-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--hcdb-shadow-lg), var(--hcdb-shadow-glow);
}

.hcdb-btn:hover::before {
    left: 100%;
}

.hcdb-btn:active {
    transform: translateY(0);
}

.hcdb-btn-secondary {
    background: var(--hcdb-gray-100);
    color: var(--hcdb-gray-700);
    box-shadow: none;
    border: 1px solid var(--hcdb-gray-200);
}

.hcdb-btn-secondary:hover {
    background: var(--hcdb-gray-200);
    box-shadow: var(--hcdb-shadow);
}

.hcdb-btn-success {
    background: var(--hcdb-gradient-success);
}

.hcdb-btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.hcdb-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.hcdb-btn-disabled, .hcdb-btn:disabled {
    background: var(--hcdb-gray-300);
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.hcdb-btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.hcdb-btn-large {
    padding: 16px 32px;
    font-size: 16px;
    border-radius: var(--hcdb-radius-lg);
}

.hcdb-btn-icon {
    font-size: 16px;
}

/* 标签/徽章 */
.hcdb-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    background: var(--hcdb-primary-bg);
    color: var(--hcdb-primary);
}

.hcdb-badge-success {
    background: var(--hcdb-success-bg);
    color: var(--hcdb-success);
}

.hcdb-badge-warning {
    background: var(--hcdb-warning-bg);
    color: #92400e;
}

.hcdb-badge-danger {
    background: var(--hcdb-danger-bg);
    color: var(--hcdb-danger);
}

/* 卡片 */
.hcdb-card {
    background: #fff;
    border-radius: var(--hcdb-radius-lg);
    box-shadow: var(--hcdb-shadow);
    overflow: hidden;
    transition: var(--hcdb-transition);
}

.hcdb-card:hover {
    box-shadow: var(--hcdb-shadow-lg);
}

.hcdb-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--hcdb-gray-100);
    background: var(--hcdb-gray-50);
}

.hcdb-card-body {
    padding: 24px;
}

.hcdb-card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--hcdb-gray-100);
    background: var(--hcdb-gray-50);
}

/* ========================================
   用户状态栏
   ======================================== */
.hcdb-user-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--hcdb-gray-50) 0%, #fff 100%);
    border: 1px solid var(--hcdb-gray-200);
    border-radius: var(--hcdb-radius-lg);
    margin-bottom: 24px;
    box-shadow: var(--hcdb-shadow-sm);
}

.hcdb-level {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--hcdb-gradient-primary);
    color: #fff;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.hcdb-remaining {
    font-size: 14px;
    color: var(--hcdb-gray-600);
}

.hcdb-views-count {
    color: var(--hcdb-primary);
    font-weight: 700;
    font-size: 16px;
}

.hcdb-login-btn {
    padding: 8px 20px;
    background: var(--hcdb-primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--hcdb-radius);
    font-weight: 500;
    transition: var(--hcdb-transition);
}

.hcdb-login-btn:hover {
    background: var(--hcdb-primary-dark);
    color: #fff;
}

/* ========================================
   搜索框区域
   ======================================== */
.hcdb-search-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.hcdb-search-box {
    margin-bottom: 24px;
}

.hcdb-search-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 4px;
    background: var(--hcdb-gray-100);
    border-radius: var(--hcdb-radius);
    width: fit-content;
}

.hcdb-tab {
    padding: 10px 24px;
    background: transparent;
    border: none;
    border-radius: var(--hcdb-radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--hcdb-gray-600);
    transition: var(--hcdb-transition);
}

.hcdb-tab:hover {
    color: var(--hcdb-gray-900);
}

.hcdb-tab.active {
    background: #fff;
    color: var(--hcdb-primary);
    box-shadow: var(--hcdb-shadow-sm);
}

.hcdb-search-input-wrap {
    display: flex;
    gap: 12px;
    position: relative;
}

.hcdb-search-input {
    flex: 1;
    padding: 16px 20px;
    padding-left: 48px;
    border: 2px solid var(--hcdb-gray-200);
    border-radius: var(--hcdb-radius-lg);
    font-size: 16px;
    transition: var(--hcdb-transition);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E") no-repeat 16px center;
    background-size: 20px;
}

.hcdb-search-input:focus {
    outline: none;
    border-color: var(--hcdb-primary);
    box-shadow: 0 0 0 4px var(--hcdb-primary-bg);
}

.hcdb-search-input::placeholder {
    color: var(--hcdb-gray-400);
}

.hcdb-search-btn {
    padding: 16px 32px;
    background: var(--hcdb-gradient-blue);
    color: #fff;
    border: none;
    border-radius: var(--hcdb-radius-lg);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--hcdb-transition);
    box-shadow: var(--hcdb-shadow);
}

.hcdb-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--hcdb-shadow-lg);
}

/* ========================================
   章节导航
   ======================================== */
.hcdb-chapters-sidebar {
    background: #fff;
    border: 1px solid var(--hcdb-gray-200);
    border-radius: var(--hcdb-radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.hcdb-chapters-sidebar h4 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--hcdb-gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

.hcdb-chapters-sidebar h4::before {
    content: '📂';
}

.hcdb-chapters-tree {
    max-height: 400px;
    overflow-y: auto;
}

/* ========================================
   搜索结果列表
   ======================================== */
.hcdb-search-results {
    background: #fff;
    border-radius: var(--hcdb-radius-lg);
    box-shadow: var(--hcdb-shadow);
    overflow: hidden;
}

.hcdb-results-header {
    padding: 16px 20px;
    background: var(--hcdb-gray-50);
    border-bottom: 1px solid var(--hcdb-gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hcdb-result-item {
    display: grid;
    grid-template-columns: 120px 1fr 80px 100px;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hcdb-gray-100);
    cursor: pointer;
    transition: var(--hcdb-transition);
    align-items: center;
}

.hcdb-result-item:hover {
    background: var(--hcdb-primary-bg);
}

.hcdb-result-item:last-child {
    border-bottom: none;
}

.hcdb-result-code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 13px;
    color: var(--hcdb-primary);
    font-weight: 600;
    background: var(--hcdb-primary-bg);
    padding: 4px 8px;
    border-radius: var(--hcdb-radius-sm);
}

.hcdb-result-name {
    font-size: 14px;
    color: var(--hcdb-gray-800);
    font-weight: 500;
}

.hcdb-result-unit {
    color: var(--hcdb-gray-500);
    font-size: 13px;
    text-align: center;
}

.hcdb-result-price {
    font-weight: 700;
    color: var(--hcdb-danger);
    font-size: 15px;
    text-align: right;
}

/* AI 理解展示 */
.hcdb-ai-understanding {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-bottom: 1px solid var(--hcdb-gray-200);
    margin-bottom: 8px;
}

.hcdb-ai-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.hcdb-ai-text {
    font-size: 14px;
    color: var(--hcdb-gray-700);
    line-height: 1.6;
}

.hcdb-ai-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.hcdb-tag {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.hcdb-tag-material { background: #dbeafe; color: #1e40af; }
.hcdb-tag-work { background: #d1fae5; color: #065f46; }
.hcdb-tag-project { background: #fef3c7; color: #92400e; }

/* 分页 */
.hcdb-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border-top: 1px solid var(--hcdb-gray-100);
}

.hcdb-page-btn {
    padding: 8px 14px;
    border: 1px solid var(--hcdb-gray-200);
    background: #fff;
    border-radius: var(--hcdb-radius-sm);
    cursor: pointer;
    transition: var(--hcdb-transition);
}

.hcdb-page-btn:hover {
    background: var(--hcdb-gray-100);
}

.hcdb-page-btn.active {
    background: var(--hcdb-primary);
    color: #fff;
    border-color: var(--hcdb-primary);
}

/* Sidebar pagination (budget editor right panel) */
.hcdb-sidebar-pagination .hcdb-pagination {
    padding: 8px;
    border-top: 1px solid var(--hcdb-gray-100);
    gap: 6px;
}

.hcdb-sidebar-pagination .hcdb-page-btn {
    padding: 4px 10px;
    font-size: 12px;
}

/* ========================================
   详情弹窗
   ======================================== */
.hcdb-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hcdb-modal.active {
    display: flex;
}

.hcdb-modal-content {
    background: #fff;
    border-radius: var(--hcdb-radius-xl);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--hcdb-shadow-xl);
    animation: hcdb-modal-in 0.3s ease;
}

@keyframes hcdb-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.hcdb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--hcdb-gradient-blue);
    color: #fff;
}

.hcdb-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.hcdb-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--hcdb-transition);
}

.hcdb-modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.hcdb-modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 100px);
}

/* ========================================
   在线组价计算器
   ======================================== */
.hcdb-calculator {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.hcdb-calc-settings {
    background: linear-gradient(135deg, var(--hcdb-gray-50) 0%, #fff 100%);
    border: 1px solid var(--hcdb-gray-200);
    border-radius: var(--hcdb-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.hcdb-calc-settings h4 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--hcdb-gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hcdb-pro-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--hcdb-gradient-warning);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 10px;
    text-transform: uppercase;
}

.hcdb-rate-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.hcdb-rate-inputs label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--hcdb-gray-600);
}

.hcdb-rate-inputs input {
    padding: 10px 14px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: var(--hcdb-radius);
    font-size: 14px;
    transition: var(--hcdb-transition);
}

.hcdb-rate-inputs input:focus {
    outline: none;
    border-color: var(--hcdb-primary);
    box-shadow: 0 0 0 3px var(--hcdb-primary-bg);
}

.hcdb-rate-inputs input:disabled {
    background: var(--hcdb-gray-100);
    cursor: not-allowed;
}

/* 计算器项目列表 */
.hcdb-calc-items {
    background: #fff;
    border-radius: var(--hcdb-radius-lg);
    box-shadow: var(--hcdb-shadow);
    overflow: hidden;
    margin-bottom: 24px;
}

.hcdb-calc-items h4 {
    margin: 0;
    padding: 16px 20px;
    background: var(--hcdb-gray-50);
    border-bottom: 1px solid var(--hcdb-gray-200);
    font-size: 16px;
    font-weight: 600;
}

.hcdb-items-header {
    display: grid;
    grid-template-columns: 100px 1fr 60px 90px 100px 100px 60px;
    gap: 12px;
    padding: 12px 20px;
    background: var(--hcdb-gray-100);
    font-size: 12px;
    font-weight: 600;
    color: var(--hcdb-gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hcdb-calc-item {
    display: grid;
    grid-template-columns: 100px 1fr 60px 90px 100px 100px 60px;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--hcdb-gray-100);
    align-items: center;
    transition: var(--hcdb-transition);
}

.hcdb-calc-item:hover {
    background: var(--hcdb-gray-50);
}

.hcdb-col-code {
    font-family: monospace;
    font-size: 12px;
    color: var(--hcdb-primary);
    font-weight: 600;
}

.hcdb-col-name {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hcdb-col-unit {
    color: var(--hcdb-gray-500);
    font-size: 12px;
    text-align: center;
}

.hcdb-qty-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: var(--hcdb-radius-sm);
    text-align: center;
    font-size: 13px;
}

.hcdb-col-price, .hcdb-col-total {
    font-weight: 600;
    font-size: 13px;
    text-align: right;
}

.hcdb-col-total {
    color: var(--hcdb-danger);
}

.hcdb-remove-item {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hcdb-danger-bg);
    color: var(--hcdb-danger);
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: var(--hcdb-transition);
}

.hcdb-remove-item:hover {
    background: var(--hcdb-danger);
    color: #fff;
}

.hcdb-items-footer {
    padding: 16px 20px;
    display: flex;
    gap: 12px;
}

.hcdb-add-item-btn {
    padding: 10px 20px;
    background: var(--hcdb-gray-100);
    border: 2px dashed var(--hcdb-gray-300);
    border-radius: var(--hcdb-radius);
    color: var(--hcdb-gray-600);
    font-size: 14px;
    cursor: pointer;
    transition: var(--hcdb-transition);
}

.hcdb-add-item-btn:hover {
    background: var(--hcdb-primary-bg);
    border-color: var(--hcdb-primary);
    color: var(--hcdb-primary);
}

/* 计算器汇总 */
.hcdb-calc-summary {
    background: linear-gradient(135deg, var(--hcdb-gray-800) 0%, var(--hcdb-gray-900) 100%);
    border-radius: var(--hcdb-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    color: #fff;
}

.hcdb-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.hcdb-summary-row:last-child {
    border-bottom: none;
}

.hcdb-summary-row span {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
}

.hcdb-summary-row strong {
    font-size: 18px;
    font-weight: 600;
}

.hcdb-summary-total {
    margin-top: 12px;
    padding-top: 16px;
    border-top: 2px solid rgba(255,255,255,0.2);
}

.hcdb-summary-total span {
    font-size: 16px;
    color: #fff;
}

.hcdb-summary-total strong {
    font-size: 28px;
    color: #10b981;
}

/* 计算器操作按钮 */
.hcdb-calc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ========================================
   AI 工程量智能估算器
   ======================================== */
.hcdb-ai-estimator {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.hcdb-estimator-header {
    text-align: center;
    margin-bottom: 40px;
}

.hcdb-estimator-header h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    background: var(--hcdb-gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hcdb-subtitle {
    color: var(--hcdb-gray-500);
    font-size: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.hcdb-estimator-input {
    max-width: 800px;
    margin: 0 auto 24px;
}

.hcdb-estimate-description {
    width: 100%;
    padding: 20px;
    border: 2px solid var(--hcdb-gray-200);
    border-radius: var(--hcdb-radius-lg);
    font-size: 16px;
    resize: vertical;
    min-height: 120px;
    transition: var(--hcdb-transition);
    font-family: inherit;
}

.hcdb-estimate-description:focus {
    outline: none;
    border-color: var(--hcdb-primary);
    box-shadow: 0 0 0 4px var(--hcdb-primary-bg);
}

.hcdb-estimate-btn {
    margin-top: 16px;
    padding: 16px 40px;
    font-size: 16px;
    border-radius: var(--hcdb-radius-lg);
}

.hcdb-estimator-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--hcdb-gray-50);
    border-radius: var(--hcdb-radius-lg);
}

.hcdb-examples-label {
    color: var(--hcdb-gray-500);
    font-size: 14px;
    font-weight: 500;
}

.hcdb-example-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: var(--hcdb-transition);
    font-weight: 500;
}

.hcdb-example-btn:hover {
    background: var(--hcdb-primary);
    color: #fff;
    border-color: var(--hcdb-primary);
    transform: translateY(-2px);
}

.hcdb-estimator-loading {
    text-align: center;
    padding: 80px 20px;
}

.hcdb-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--hcdb-gray-200);
    border-top-color: var(--hcdb-primary);
    border-radius: 50%;
    animation: hcdb-spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes hcdb-spin {
    to { transform: rotate(360deg); }
}

.hcdb-estimator-loading p {
    color: var(--hcdb-gray-500);
    font-size: 16px;
}

/* 估算结果区域 */
.hcdb-result-section {
    background: #fff;
    border: 1px solid var(--hcdb-gray-200);
    border-radius: var(--hcdb-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--hcdb-shadow-sm);
    transition: var(--hcdb-transition);
}

.hcdb-result-section:hover {
    box-shadow: var(--hcdb-shadow);
}

.hcdb-result-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--hcdb-gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hcdb-parsed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
}

.hcdb-parsed-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    background: var(--hcdb-gray-50);
    border-radius: var(--hcdb-radius);
}

.hcdb-parsed-item .hcdb-label {
    font-size: 12px;
    color: var(--hcdb-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.hcdb-parsed-item .hcdb-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--hcdb-gray-900);
}

.hcdb-parsed-understanding {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}

.hcdb-parsed-understanding .hcdb-value {
    font-weight: 400;
    font-size: 15px;
    color: var(--hcdb-gray-700);
    font-style: italic;
    line-height: 1.6;
}

/* 造价卡片 */
.hcdb-cost-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.hcdb-cost-card {
    background: var(--hcdb-gray-50);
    padding: 28px;
    border-radius: var(--hcdb-radius-lg);
    text-align: center;
    transition: var(--hcdb-transition);
}

.hcdb-cost-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hcdb-shadow-md);
}

.hcdb-cost-card.hcdb-cost-total {
    background: var(--hcdb-gradient-blue);
    color: #fff;
}

.hcdb-cost-label {
    display: block;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 500;
}

.hcdb-cost-total .hcdb-cost-label {
    opacity: 0.9;
}

.hcdb-cost-value {
    font-size: 32px;
    font-weight: 800;
}

/* 分部费用图表 */
.hcdb-cost-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.hcdb-breakdown-chart {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hcdb-breakdown-table {
    overflow: hidden;
}

.hcdb-breakdown-table table {
    width: 100%;
    border-collapse: collapse;
}

.hcdb-breakdown-table th,
.hcdb-breakdown-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--hcdb-gray-100);
}

.hcdb-breakdown-table th {
    background: var(--hcdb-gray-50);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hcdb-gray-600);
}

.hcdb-breakdown-table td {
    font-size: 14px;
}

.hcdb-progress-bar {
    display: inline-block;
    width: 100px;
    height: 10px;
    background: var(--hcdb-gray-200);
    border-radius: 5px;
    overflow: hidden;
    margin-right: 10px;
    vertical-align: middle;
}

.hcdb-progress {
    height: 100%;
    background: var(--hcdb-gradient-blue);
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* 推荐清单表格 */
.hcdb-bills-table {
    width: 100%;
    border-collapse: collapse;
}

.hcdb-bills-table th,
.hcdb-bills-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--hcdb-gray-100);
    font-size: 13px;
}

.hcdb-bills-table th {
    background: var(--hcdb-gray-50);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hcdb-gray-600);
}

.hcdb-bills-table tbody tr {
    transition: var(--hcdb-transition);
}

.hcdb-bills-table tbody tr:hover {
    background: var(--hcdb-gray-50);
}

.hcdb-bill-check {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 结果操作按钮 */
.hcdb-result-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

/* 注意事项 */
.hcdb-result-notes {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fde68a;
    border-radius: var(--hcdb-radius-lg);
    padding: 20px;
}

.hcdb-result-notes h5 {
    margin: 0 0 12px;
    color: #92400e;
    font-size: 16px;
    font-weight: 600;
}

.hcdb-notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hcdb-notes-list li {
    padding: 8px 0;
    color: #92400e;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.hcdb-notes-list li::before {
    content: '•';
    color: #d97706;
    font-weight: bold;
}

/* ========================================
   历史成本数据看板
   ======================================== */
.hcdb-cost-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.hcdb-dashboard-header {
    text-align: center;
    margin-bottom: 40px;
}

.hcdb-dashboard-header h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--hcdb-gray-900);
}

/* 概览卡片 */
.hcdb-overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.hcdb-stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    padding: 24px;
    border-radius: var(--hcdb-radius-lg);
    box-shadow: var(--hcdb-shadow);
    transition: var(--hcdb-transition);
    position: relative;
    overflow: hidden;
}

.hcdb-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.hcdb-card-schemes::before { background: var(--hcdb-primary); }
.hcdb-card-cost::before { background: var(--hcdb-success); }
.hcdb-card-database::before { background: var(--hcdb-warning); }
.hcdb-card-usage::before { background: var(--hcdb-info); }

.hcdb-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--hcdb-shadow-lg);
}

.hcdb-card-icon {
    font-size: 40px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hcdb-gray-100);
    border-radius: var(--hcdb-radius);
}

.hcdb-card-content {
    display: flex;
    flex-direction: column;
}

.hcdb-card-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--hcdb-gray-900);
    line-height: 1.2;
}

.hcdb-card-label {
    font-size: 14px;
    color: var(--hcdb-gray-500);
    font-weight: 500;
    margin-top: 4px;
}

.hcdb-card-sub {
    font-size: 12px;
    color: var(--hcdb-gray-400);
    margin-top: 6px;
}

/* 看板网格 */
.hcdb-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.hcdb-dashboard-section {
    background: #fff;
    border-radius: var(--hcdb-radius-lg);
    box-shadow: var(--hcdb-shadow);
    padding: 24px;
    transition: var(--hcdb-transition);
}

.hcdb-dashboard-section:hover {
    box-shadow: var(--hcdb-shadow-md);
}

.hcdb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--hcdb-gray-100);
}

.hcdb-section-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--hcdb-gray-800);
}

.hcdb-chart-container {
    height: 320px;
}

.hcdb-pie-container {
    height: 280px;
}

/* 趋势标签 */
.hcdb-trend-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.hcdb-trend-up {
    background: #dcfce7;
    color: #166534;
}

.hcdb-trend-down {
    background: #fee2e2;
    color: #991b1b;
}

.hcdb-trend-stable {
    background: #e0e7ff;
    color: #3730a3;
}

/* 分布图例 */
.hcdb-distribution-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--hcdb-gray-100);
}

.hcdb-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.hcdb-legend-color {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    flex-shrink: 0;
}

.hcdb-legend-label {
    color: var(--hcdb-gray-700);
    font-weight: 500;
}

.hcdb-legend-value {
    color: var(--hcdb-gray-500);
    font-size: 12px;
}

/* 表格样式 */
.hcdb-popular-table,
.hcdb-recent-table {
    width: 100%;
    border-collapse: collapse;
}

.hcdb-popular-table th,
.hcdb-popular-table td,
.hcdb-recent-table th,
.hcdb-recent-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--hcdb-gray-100);
    font-size: 13px;
}

.hcdb-popular-table th,
.hcdb-recent-table th {
    background: var(--hcdb-gray-50);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hcdb-gray-600);
}

.hcdb-popular-table tbody tr,
.hcdb-recent-table tbody tr {
    transition: var(--hcdb-transition);
}

.hcdb-popular-table tbody tr:hover,
.hcdb-recent-table tbody tr:hover {
    background: var(--hcdb-gray-50);
}

/* 排名徽章 */
.hcdb-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    background: var(--hcdb-gray-200);
    color: var(--hcdb-gray-600);
}

.hcdb-rank-1 {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

.hcdb-rank-2 {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    color: #fff;
}

.hcdb-rank-3 {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #fff;
}

/* 看板底部 */
.hcdb-dashboard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    color: var(--hcdb-gray-500);
    font-size: 13px;
    border-top: 1px solid var(--hcdb-gray-200);
    margin-top: 8px;
}

/* 空状态和加载状态 */
.hcdb-empty, .hcdb-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--hcdb-gray-400);
}

.hcdb-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--hcdb-gray-300);
    border-top-color: var(--hcdb-primary);
    border-radius: 50%;
    animation: hcdb-spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

/* ========================================
   添加项目弹窗
   ======================================== */
.hcdb-add-search-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.hcdb-add-search-wrap input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--hcdb-gray-200);
    border-radius: var(--hcdb-radius);
    font-size: 14px;
    transition: var(--hcdb-transition);
}

.hcdb-add-search-wrap input:focus {
    outline: none;
    border-color: var(--hcdb-primary);
    box-shadow: 0 0 0 3px var(--hcdb-primary-bg);
}

.hcdb-add-count {
    font-size: 13px;
    color: var(--hcdb-gray-500);
    white-space: nowrap;
    background: var(--hcdb-gray-100);
    padding: 6px 12px;
    border-radius: 20px;
}

.hcdb-add-results {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--hcdb-gray-200);
    border-radius: var(--hcdb-radius);
}

.hcdb-add-result-item {
    display: grid;
    grid-template-columns: 110px 1fr 60px auto;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--hcdb-gray-100);
    cursor: pointer;
    align-items: center;
    transition: var(--hcdb-transition);
}

.hcdb-add-result-item:hover {
    background: var(--hcdb-primary-bg);
}

.hcdb-add-result-item:last-child {
    border-bottom: none;
}

.hcdb-add-item-code {
    font-family: monospace;
    color: var(--hcdb-primary);
    font-size: 12px;
    font-weight: 600;
    background: var(--hcdb-primary-bg);
    padding: 4px 8px;
    border-radius: 4px;
}

.hcdb-add-item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.hcdb-add-item-unit {
    color: var(--hcdb-gray-500);
    font-size: 12px;
    text-align: center;
}

.hcdb-add-item-price {
    color: var(--hcdb-danger);
    font-weight: 600;
    font-size: 14px;
}

/* ========================================
   会员方案卡片
   ======================================== */
.hcdb-membership-plans {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.hcdb-membership-plans h3 {
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 40px;
    color: var(--hcdb-gray-900);
}

.hcdb-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.hcdb-plan-card {
    background: #fff;
    border: 2px solid var(--hcdb-gray-200);
    border-radius: var(--hcdb-radius-xl);
    padding: 32px;
    position: relative;
    transition: var(--hcdb-transition);
}

.hcdb-plan-card:hover {
    border-color: var(--hcdb-primary);
    transform: translateY(-8px);
    box-shadow: var(--hcdb-shadow-lg);
}

.hcdb-plan-card.hcdb-recommended {
    border-color: var(--hcdb-primary);
    box-shadow: var(--hcdb-shadow-lg), 0 0 0 4px var(--hcdb-primary-bg);
}

.hcdb-plan-card.hcdb-current-plan {
    border-color: var(--hcdb-success);
}

.hcdb-plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 20px;
    background: var(--hcdb-gradient-blue);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
}

.hcdb-plan-name {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--hcdb-gray-900);
}

.hcdb-plan-price {
    text-align: center;
    margin-bottom: 24px;
}

.hcdb-price {
    font-size: 42px;
    font-weight: 800;
    color: var(--hcdb-gray-900);
}

.hcdb-period {
    font-size: 16px;
    color: var(--hcdb-gray-500);
}

.hcdb-yearly-price {
    font-size: 13px;
    color: var(--hcdb-gray-500);
    margin-top: 8px;
}

.hcdb-plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
}

.hcdb-plan-features li {
    padding: 10px 0;
    font-size: 14px;
    color: var(--hcdb-gray-700);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--hcdb-gray-100);
}

.hcdb-plan-features li:last-child {
    border-bottom: none;
}

.hcdb-plan-features li.hcdb-disabled {
    color: var(--hcdb-gray-400);
}

.hcdb-check {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.hcdb-plan-features li:not(.hcdb-disabled) .hcdb-check {
    background: var(--hcdb-success-bg);
    color: var(--hcdb-success);
    border-radius: 50%;
}

.hcdb-plan-card .hcdb-btn {
    width: 100%;
    padding: 14px;
}

.hcdb-btn-current {
    background: var(--hcdb-gray-200);
    color: var(--hcdb-gray-600);
}

/* ========================================
   用户仪表板
   ======================================== */
.hcdb-user-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.hcdb-dashboard-card {
    background: #fff;
    border-radius: var(--hcdb-radius-lg);
    box-shadow: var(--hcdb-shadow);
    padding: 24px;
}

.hcdb-dashboard-card h4 {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--hcdb-gray-800);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hcdb-gray-100);
}

.hcdb-member-info .hcdb-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--hcdb-gray-100);
}

.hcdb-member-info .hcdb-info-row:last-child {
    border-bottom: none;
}

.hcdb-level-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.hcdb-level-free { background: var(--hcdb-gray-200); color: var(--hcdb-gray-700); }
.hcdb-level-basic { background: #dbeafe; color: #1e40af; }
.hcdb-level-pro { background: var(--hcdb-gradient-primary); color: #fff; }
.hcdb-level-enterprise { background: var(--hcdb-gradient-dark); color: #fff; }

.hcdb-warning {
    margin-left: 8px;
    padding: 2px 8px;
    background: var(--hcdb-warning-bg);
    color: #92400e;
    font-size: 11px;
    border-radius: 10px;
}

.hcdb-schemes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.hcdb-schemes-table th,
.hcdb-schemes-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--hcdb-gray-100);
}

.hcdb-schemes-table th {
    font-weight: 600;
    color: var(--hcdb-gray-600);
    font-size: 12px;
}

.hcdb-schemes-table a {
    color: var(--hcdb-primary);
    text-decoration: none;
    margin-right: 12px;
}

.hcdb-schemes-table a:hover {
    text-decoration: underline;
}

.hcdb-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.hcdb-stat-item {
    text-align: center;
    padding: 16px;
    background: var(--hcdb-gray-50);
    border-radius: var(--hcdb-radius);
}

.hcdb-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--hcdb-primary);
    display: block;
}

.hcdb-stat-label {
    font-size: 12px;
    color: var(--hcdb-gray-500);
    margin-top: 4px;
}

/* ========================================
   通知和提示
   ======================================== */
.hcdb-notice {
    padding: 16px 20px;
    border-radius: var(--hcdb-radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.hcdb-notice a {
    color: inherit;
    font-weight: 600;
}

.hcdb-success {
    background: var(--hcdb-success-bg);
    color: #065f46;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hcdb-success-icon {
    width: 24px;
    height: 24px;
    background: var(--hcdb-success);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.hcdb-error {
    background: var(--hcdb-danger-bg);
    color: #991b1b;
    padding: 16px 20px;
    border-radius: var(--hcdb-radius);
}

.hcdb-info {
    background: var(--hcdb-info-bg);
    color: #0e7490;
    padding: 16px 20px;
    border-radius: var(--hcdb-radius);
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1024px) {
    .hcdb-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .hcdb-cost-breakdown {
        grid-template-columns: 1fr;
    }

    .hcdb-breakdown-chart {
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .hcdb-estimator-header h3,
    .hcdb-dashboard-header h3 {
        font-size: 24px;
    }

    .hcdb-result-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .hcdb-result-code {
        width: fit-content;
    }

    .hcdb-result-price {
        text-align: left;
    }

    .hcdb-items-header,
    .hcdb-calc-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .hcdb-items-header {
        display: none;
    }

    .hcdb-calc-item {
        padding: 16px;
        border: 1px solid var(--hcdb-gray-200);
        border-radius: var(--hcdb-radius);
        margin-bottom: 12px;
    }

    .hcdb-overview-cards {
        grid-template-columns: 1fr 1fr;
    }

    .hcdb-stat-card {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .hcdb-cost-cards {
        grid-template-columns: 1fr;
    }

    .hcdb-result-actions {
        flex-direction: column;
    }

    .hcdb-result-actions .hcdb-btn {
        width: 100%;
    }

    .hcdb-search-input-wrap {
        flex-direction: column;
    }

    .hcdb-search-btn {
        width: 100%;
    }

    .hcdb-user-dashboard {
        grid-template-columns: 1fr;
    }

    .hcdb-plans-grid {
        grid-template-columns: 1fr;
    }

    .hcdb-stats {
        grid-template-columns: 1fr;
    }

    .hcdb-add-result-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .hcdb-modal-content {
        border-radius: var(--hcdb-radius);
        max-height: 95vh;
    }

    .hcdb-bills-table {
        display: block;
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .hcdb-overview-cards {
        grid-template-columns: 1fr;
    }

    .hcdb-estimator-examples {
        padding: 16px;
    }

    .hcdb-example-btn {
        flex: 1 1 calc(50% - 5px);
        text-align: center;
    }

    .hcdb-parsed-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ========================================
   动画效果
   ======================================== */
@keyframes hcdb-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hcdb-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hcdb-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.hcdb-animate-fade-in {
    animation: hcdb-fade-in 0.3s ease forwards;
}

.hcdb-animate-slide-up {
    animation: hcdb-slide-up 0.4s ease forwards;
}

.hcdb-animate-pulse {
    animation: hcdb-pulse 2s ease-in-out infinite;
}

/* 骨架屏加载效果 */
.hcdb-skeleton {
    background: linear-gradient(90deg, var(--hcdb-gray-200) 25%, var(--hcdb-gray-100) 50%, var(--hcdb-gray-200) 75%);
    background-size: 200% 100%;
    animation: hcdb-skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--hcdb-radius-sm);
}

@keyframes hcdb-skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ========================================
   综合工作台样式
   ======================================== */
.hcdb-page-wrapper {
    min-height: 100vh;
    background: var(--hcdb-gray-50);
}

.hcdb-page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.hcdb-page-header {
    text-align: center;
    padding: 40px 20px;
    background: var(--hcdb-gradient-blue);
    color: #fff;
    border-radius: var(--hcdb-radius-lg);
    margin-bottom: 30px;
}

.hcdb-page-header h1 {
    font-size: 2.5rem;
    margin: 0 0 10px 0;
    color: #fff;
}

.hcdb-page-desc {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

/* 工作台布局 */
.hcdb-workbench {
    background: #fff;
    border-radius: var(--hcdb-radius-lg);
    box-shadow: var(--hcdb-shadow-lg);
    overflow: hidden;
    min-height: 80vh;
}

.hcdb-workbench-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: var(--hcdb-gradient-dark);
    color: #fff;
}

.hcdb-workbench-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hcdb-workbench-brand .hcdb-logo {
    font-size: 2rem;
}

.hcdb-workbench-brand h1 {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
    color: #fff;
}

.hcdb-workbench-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hcdb-user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
}

.hcdb-user-name {
    font-weight: 500;
}

.hcdb-user-level {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    background: rgba(255,255,255,0.2);
}

.hcdb-user-level.hcdb-level-pro {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #333;
}

.hcdb-user-level.hcdb-level-enterprise {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* 工作台标签页 */
.hcdb-workbench-tabs {
    display: flex;
    background: var(--hcdb-gray-100);
    border-bottom: 1px solid var(--hcdb-gray-200);
    overflow-x: auto;
}

.hcdb-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: var(--hcdb-gray-600);
    transition: var(--hcdb-transition);
    white-space: nowrap;
    position: relative;
}

.hcdb-tab-btn:hover {
    color: var(--hcdb-primary);
    background: rgba(37, 99, 235, 0.05);
}

.hcdb-tab-btn.active {
    color: var(--hcdb-primary);
    background: #fff;
}

.hcdb-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--hcdb-primary);
    border-radius: 3px 3px 0 0;
}

.hcdb-tab-icon {
    font-size: 1.2em;
}

/* 工作台内容区 */
.hcdb-workbench-content {
    padding: 24px;
    min-height: 500px;
}

.hcdb-tab-panel {
    display: none;
    animation: hcdb-fade-in 0.3s ease;
}

.hcdb-tab-panel.active {
    display: block;
}

/* AI悬浮按钮 */
.hcdb-ai-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.hcdb-fab-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--hcdb-gradient-primary);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    box-shadow: var(--hcdb-shadow-lg), 0 0 20px rgba(102, 126, 234, 0.4);
    transition: var(--hcdb-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hcdb-fab-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--hcdb-shadow-xl), 0 0 30px rgba(102, 126, 234, 0.6);
}

.hcdb-fab-btn:active {
    transform: scale(0.95);
}

/* AI侧边栏 */
.hcdb-ai-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 30px rgba(0,0,0,0.15);
    z-index: 1001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.hcdb-ai-sidebar.open {
    right: 0;
}

.hcdb-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--hcdb-gradient-primary);
    color: #fff;
}

.hcdb-sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.hcdb-sidebar-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.hcdb-sidebar-close:hover {
    opacity: 1;
}

.hcdb-sidebar-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ========================================
   AI助手页面样式
   ======================================== */
.hcdb-ai-assistant-page {
    min-height: 80vh;
}

.hcdb-assistant-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.hcdb-assistant-main {
    background: #fff;
    border-radius: var(--hcdb-radius-lg);
    box-shadow: var(--hcdb-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hcdb-assistant-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.hcdb-assistant-avatar {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hcdb-avatar-icon {
    font-size: 32px;
}

.hcdb-assistant-info h2 {
    margin: 0 0 4px 0;
    font-size: 1.4rem;
    color: #fff;
}

.hcdb-assistant-info p {
    margin: 0;
    opacity: 0.85;
    font-size: 0.9rem;
}

.hcdb-assistant-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hcdb-status-dot {
    width: 10px;
    height: 10px;
    background: #4ade80;
    border-radius: 50%;
    animation: hcdb-pulse 2s ease-in-out infinite;
}

.hcdb-status-text {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* 聊天消息区 */
.hcdb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--hcdb-gray-50);
}

.hcdb-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: hcdb-slide-up 0.3s ease;
}

.hcdb-message-user {
    flex-direction: row-reverse;
}

.hcdb-message-avatar {
    width: 40px;
    height: 40px;
    background: var(--hcdb-gray-200);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.hcdb-message-assistant .hcdb-message-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.hcdb-message-user .hcdb-message-avatar {
    background: var(--hcdb-primary);
}

.hcdb-message-content {
    max-width: 70%;
}

.hcdb-message-bubble {
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
}

.hcdb-message-assistant .hcdb-message-bubble {
    background: #fff;
    border: 1px solid var(--hcdb-gray-200);
    border-radius: 18px 18px 18px 4px;
}

.hcdb-message-user .hcdb-message-bubble {
    background: var(--hcdb-primary);
    color: #fff;
    border-radius: 18px 18px 4px 18px;
}

.hcdb-message-bubble p {
    margin: 0 0 8px 0;
}

.hcdb-message-bubble p:last-child {
    margin-bottom: 0;
}

.hcdb-message-bubble ul {
    margin: 8px 0;
    padding-left: 20px;
}

.hcdb-message-bubble li {
    margin: 4px 0;
}

.hcdb-message-time {
    font-size: 11px;
    color: var(--hcdb-gray-400);
    margin-top: 4px;
    padding: 0 4px;
}

.hcdb-message-user .hcdb-message-time {
    text-align: right;
}

/* 打字动画 */
.hcdb-typing {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.hcdb-typing span {
    width: 8px;
    height: 8px;
    background: var(--hcdb-gray-400);
    border-radius: 50%;
    animation: hcdb-typing-bounce 1.4s ease-in-out infinite;
}

.hcdb-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.hcdb-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes hcdb-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-8px);
    }
}

/* 聊天输入区 */
.hcdb-chat-input-area {
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid var(--hcdb-gray-200);
}

.hcdb-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.hcdb-quick-label {
    font-size: 12px;
    color: var(--hcdb-gray-500);
}

.hcdb-quick-btn {
    padding: 6px 12px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: 20px;
    background: #fff;
    font-size: 12px;
    color: var(--hcdb-gray-600);
    cursor: pointer;
    transition: var(--hcdb-transition);
}

.hcdb-quick-btn:hover {
    border-color: var(--hcdb-primary);
    color: var(--hcdb-primary);
    background: var(--hcdb-primary-bg);
}

.hcdb-chat-input-wrap {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.hcdb-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--hcdb-gray-200);
    border-radius: var(--hcdb-radius);
    font-size: 14px;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.hcdb-chat-input:focus {
    outline: none;
    border-color: var(--hcdb-primary);
}

.hcdb-chat-send-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--hcdb-gradient-blue);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: var(--hcdb-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hcdb-chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--hcdb-shadow-glow);
}

.hcdb-input-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--hcdb-gray-400);
}

/* AI助手侧边栏 */
.hcdb-assistant-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hcdb-context-panel,
.hcdb-history-panel,
.hcdb-recommend-panel {
    background: #fff;
    border-radius: var(--hcdb-radius);
    padding: 16px;
    box-shadow: var(--hcdb-shadow-sm);
}

.hcdb-context-panel h4,
.hcdb-history-panel h4,
.hcdb-recommend-panel h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--hcdb-gray-700);
}

.hcdb-context-empty,
.hcdb-history-empty {
    color: var(--hcdb-gray-400);
    font-size: 13px;
    margin: 0;
}

.hcdb-context-hint {
    font-size: 12px;
    color: var(--hcdb-gray-400);
    margin-top: 8px;
}

.hcdb-history-list {
    max-height: 150px;
    overflow-y: auto;
}

.hcdb-recommend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.hcdb-recommend-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    background: var(--hcdb-gray-50);
    border-radius: var(--hcdb-radius-sm);
    text-decoration: none;
    color: var(--hcdb-gray-700);
    transition: var(--hcdb-transition);
}

.hcdb-recommend-card:hover {
    background: var(--hcdb-primary-bg);
    color: var(--hcdb-primary);
    transform: translateY(-2px);
}

.hcdb-recommend-card .hcdb-card-icon {
    font-size: 24px;
}

.hcdb-recommend-card .hcdb-card-name {
    font-size: 12px;
    font-weight: 500;
}

/* 聊天小组件 */
.hcdb-chat-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.hcdb-widget-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--hcdb-gray-50);
}

.hcdb-widget-messages .hcdb-message {
    margin-bottom: 12px;
}

.hcdb-widget-messages .hcdb-message-bubble {
    font-size: 13px;
    padding: 10px 14px;
}

.hcdb-widget-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #fff;
    border-top: 1px solid var(--hcdb-gray-200);
}

.hcdb-widget-text {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: var(--hcdb-radius);
    font-size: 13px;
}

.hcdb-widget-text:focus {
    outline: none;
    border-color: var(--hcdb-primary);
}

.hcdb-widget-send {
    padding: 10px 16px;
    background: var(--hcdb-primary);
    color: #fff;
    border: none;
    border-radius: var(--hcdb-radius);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.hcdb-widget-send:hover {
    background: var(--hcdb-primary-dark);
}

/* ========================================
   悬浮聊天组件 - 固定在右下角
   ======================================== */
.hcdb-chat-widget {
    position: fixed !important;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.hcdb-chat-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--hcdb-primary) 0%, #5b8def 100%);
    color: #fff;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
    transition: all 0.3s ease;
}

.hcdb-chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.5);
}

.hcdb-chat-icon {
    font-size: 20px;
}

.hcdb-chat-label {
    font-size: 14px;
    font-weight: 500;
}

.hcdb-chat-panel {
    display: none;
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 380px;
    height: 500px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    flex-direction: column;
}

.hcdb-chat-widget.hcdb-chat-open .hcdb-chat-panel {
    display: flex;
}

.hcdb-chat-widget.hcdb-chat-open .hcdb-chat-toggle {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.hcdb-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--hcdb-primary) 0%, #5b8def 100%);
    color: #fff;
    font-weight: 600;
}

.hcdb-chat-close {
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.hcdb-chat-close:hover {
    opacity: 1;
}

.hcdb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
}

.hcdb-chat-message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.hcdb-chat-message.hcdb-user-message {
    flex-direction: row-reverse;
}

.hcdb-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e8f0fe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.hcdb-message-content {
    max-width: 260px;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.hcdb-ai-message .hcdb-message-content {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px 16px 16px 16px;
}

.hcdb-user-message .hcdb-message-content {
    background: var(--hcdb-primary);
    color: #fff;
    border-radius: 16px 4px 16px 16px;
}

.hcdb-chat-panel .hcdb-chat-input-area {
    display: flex;
    gap: 10px;
    padding: 16px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.hcdb-chat-panel .hcdb-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    resize: none;
    min-height: 44px;
    max-height: 100px;
}

.hcdb-chat-panel .hcdb-chat-input:focus {
    outline: none;
    border-color: var(--hcdb-primary);
}

.hcdb-chat-panel .hcdb-chat-send {
    padding: 12px 20px;
    background: var(--hcdb-primary);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.hcdb-chat-panel .hcdb-chat-send:hover {
    background: var(--hcdb-primary-dark);
}

/* 响应式悬浮框 */
@media (max-width: 480px) {
    .hcdb-chat-widget {
        bottom: 10px;
        right: 10px;
    }

    .hcdb-chat-panel {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        bottom: 50px;
        right: -10px;
    }

    .hcdb-chat-toggle {
        padding: 10px 16px;
    }

    .hcdb-chat-label {
        display: none;
    }
}

/* ========================================
   CSV导入样式
   ======================================== */
.hcdb-csv-import-container {
    padding: 10px 0;
}

.hcdb-csv-import-tips {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.hcdb-csv-import-tips h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #333;
}

.hcdb-csv-import-tips p {
    margin: 0 0 10px;
    font-size: 13px;
    color: #666;
}

.hcdb-csv-import-tips ul {
    margin: 0 0 10px;
    padding-left: 20px;
}

.hcdb-csv-import-tips li {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.hcdb-csv-template-tip {
    margin-top: 10px !important;
}

.hcdb-download-csv-template {
    color: var(--hcdb-primary);
    text-decoration: none;
}

.hcdb-download-csv-template:hover {
    text-decoration: underline;
}

.hcdb-csv-dropzone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s;
    cursor: pointer;
}

.hcdb-csv-dropzone:hover,
.hcdb-csv-dropzone.dragover {
    border-color: var(--hcdb-primary);
    background: #f0f7ff;
}

.hcdb-dropzone-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.hcdb-dropzone-text {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}

.hcdb-selected-file {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 4px;
    margin-top: 10px;
}

.hcdb-file-name {
    font-size: 14px;
    color: #2e7d32;
}

.hcdb-clear-file {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
}

.hcdb-clear-file:hover {
    color: #e74c3c;
}

.hcdb-csv-preview {
    margin-top: 20px;
}

.hcdb-csv-preview h4 {
    font-size: 14px;
    margin: 0 0 10px;
    color: #333;
}

.hcdb-preview-count {
    color: #666;
    font-weight: normal;
}

.hcdb-csv-preview-table-wrap {
    max-height: 250px;
    overflow: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.hcdb-csv-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.hcdb-csv-preview-table th,
.hcdb-csv-preview-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    white-space: nowrap;
}

.hcdb-csv-preview-table th {
    background: #f5f5f5;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.hcdb-csv-preview-table tr:hover {
    background: #f8f9fa;
}

.hcdb-csv-import-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* ========================================
   仪表盘工具箱样式
   ======================================== */
.hcdb-tools-section {
    margin-top: 24px;
}

.hcdb-tools-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.hcdb-tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hcdb-tool-item:hover {
    border-color: var(--hcdb-primary);
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.15);
}

.hcdb-tool-item.active {
    border-color: var(--hcdb-primary);
    background: linear-gradient(135deg, #e8f2ff 0%, #f0f7ff 100%);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.2);
}

.hcdb-tool-item-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.hcdb-tool-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    text-align: center;
}

.hcdb-tool-expand-area {
    margin-top: 24px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.hcdb-tool-expand-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-bottom: 1px solid #e0e0e0;
}

.hcdb-tool-expand-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.hcdb-tool-expand-body {
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

/* 响应式工具箱 */
@media (max-width: 1200px) {
    .hcdb-tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .hcdb-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .hcdb-tool-item {
        padding: 16px 10px;
    }

    .hcdb-tool-item-icon {
        font-size: 28px;
    }

    .hcdb-tool-item-name {
        font-size: 12px;
    }
}

/* ========================================
   响应式 - 工作台和AI助手
   ======================================== */
@media (max-width: 1024px) {
    .hcdb-assistant-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .hcdb-assistant-sidebar {
        display: none;
    }

    .hcdb-assistant-main {
        height: calc(100vh - 150px);
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .hcdb-workbench-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .hcdb-workbench-brand h1 {
        font-size: 1.2rem;
    }

    .hcdb-tab-btn {
        padding: 12px 16px;
        font-size: 13px;
    }

    .hcdb-tab-name {
        display: none;
    }

    .hcdb-tab-icon {
        font-size: 1.4em;
    }

    .hcdb-workbench-content {
        padding: 16px;
    }

    .hcdb-ai-sidebar {
        width: 100%;
        right: -100%;
    }

    .hcdb-ai-fab {
        bottom: 20px;
        right: 20px;
    }

    .hcdb-fab-btn {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .hcdb-page-header h1 {
        font-size: 1.8rem;
    }

    .hcdb-assistant-header {
        flex-wrap: wrap;
    }

    .hcdb-assistant-avatar {
        width: 50px;
        height: 50px;
    }

    .hcdb-avatar-icon {
        font-size: 26px;
    }

    .hcdb-assistant-info h2 {
        font-size: 1.2rem;
    }

    .hcdb-message-content {
        max-width: 85%;
    }

    .hcdb-quick-questions {
        display: none;
    }
}

@media (max-width: 480px) {
    .hcdb-page-container {
        padding: 10px;
    }

    .hcdb-workbench-tabs {
        justify-content: space-around;
    }

    .hcdb-tab-btn {
        flex: 1;
        justify-content: center;
        padding: 12px 8px;
    }

    .hcdb-assistant-header {
        padding: 16px;
    }

    .hcdb-chat-input-area {
        padding: 12px;
    }

    .hcdb-chat-input {
        padding: 10px 12px;
    }

    .hcdb-chat-send-btn {
        width: 44px;
        height: 44px;
    }
}

/* ========================================
   打印样式
   ======================================== */
@media print {
    .hcdb-btn,
    .hcdb-search-box,
    .hcdb-calc-actions,
    .hcdb-result-actions,
    .hcdb-dashboard-footer,
    .hcdb-ai-fab,
    .hcdb-ai-sidebar,
    .hcdb-workbench-tabs,
    .hcdb-chat-input-area {
        display: none !important;
    }

    .hcdb-card,
    .hcdb-result-section,
    .hcdb-dashboard-section {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .hcdb-modal {
        position: static;
        background: none;
    }

    .hcdb-modal-content {
        box-shadow: none;
        max-height: none;
    }

    .hcdb-workbench {
        box-shadow: none;
    }
}

/* ========================================
   企业模块样式
   ======================================== */

/* 页面容器 */
.hcdb-container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.hcdb-container-full {
    max-width: 100%;
    padding: 20px;
}

/* ========================================
   企业工作台
   ======================================== */
.hcdb-enterprise-dashboard {
    background: var(--hcdb-gray-50);
    min-height: 80vh;
    padding: 30px;
}

.hcdb-enterprise-dashboard .hcdb-dashboard-header {
    margin-bottom: 30px;
}

.hcdb-enterprise-dashboard .hcdb-dashboard-header h2 {
    font-size: 28px;
    color: var(--hcdb-gray-800);
    margin: 0 0 8px 0;
}

.hcdb-enterprise-dashboard .hcdb-welcome {
    color: var(--hcdb-gray-500);
    font-size: 14px;
    margin: 0;
}

/* 快速统计卡片 */
.hcdb-quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.hcdb-stat-card {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.hcdb-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.hcdb-stat-card .hcdb-stat-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hcdb-radius);
    background: var(--hcdb-primary-bg);
}

.hcdb-stat-card.hcdb-card-projects .hcdb-stat-icon { background: #dbeafe; }
.hcdb-stat-card.hcdb-card-ongoing .hcdb-stat-icon { background: #d1fae5; }
.hcdb-stat-card.hcdb-card-contract .hcdb-stat-icon { background: #fef3c7; }
.hcdb-stat-card.hcdb-card-alerts .hcdb-stat-icon { background: #fee2e2; }

.hcdb-stat-card .hcdb-stat-info {
    flex: 1;
}

.hcdb-stat-card .hcdb-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--hcdb-gray-800);
    line-height: 1.2;
}

.hcdb-stat-card .hcdb-stat-label {
    display: block;
    font-size: 14px;
    color: var(--hcdb-gray-500);
    margin-top: 4px;
}

/* 功能模块卡片 */
.hcdb-module-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.hcdb-module-card {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    padding: 30px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    transition: all 0.2s;
}

.hcdb-module-card:hover {
    border-color: var(--hcdb-primary);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.hcdb-module-card .hcdb-module-icon {
    font-size: 40px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--hcdb-radius-lg);
    background: var(--hcdb-gradient-blue);
}

.hcdb-module-card.hcdb-module-projects .hcdb-module-icon { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.hcdb-module-card.hcdb-module-budgets .hcdb-module-icon { background: linear-gradient(135deg, #10b981, #059669); }
.hcdb-module-card.hcdb-module-costs .hcdb-module-icon { background: linear-gradient(135deg, #f59e0b, #d97706); }
.hcdb-module-card.hcdb-module-analysis .hcdb-module-icon { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }

.hcdb-module-card .hcdb-module-info h4 {
    margin: 0 0 6px 0;
    font-size: 18px;
    color: var(--hcdb-gray-800);
}

.hcdb-module-card .hcdb-module-info p {
    margin: 0;
    font-size: 13px;
    color: var(--hcdb-gray-500);
}

/* 最近项目 & 预警区域 */
.hcdb-recent-projects-section,
.hcdb-alerts-section {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hcdb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.hcdb-section-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--hcdb-gray-800);
}

.hcdb-view-all {
    color: var(--hcdb-primary);
    text-decoration: none;
    font-size: 14px;
}

/* 项目迷你列表 */
.hcdb-project-mini-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hcdb-project-mini-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--hcdb-gray-50);
    border-radius: var(--hcdb-radius);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.hcdb-project-mini-card:hover {
    background: var(--hcdb-primary-bg);
}

.hcdb-project-mini-card h5 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: var(--hcdb-gray-800);
}

.hcdb-project-mini-card .hcdb-mini-code {
    font-size: 12px;
    color: var(--hcdb-gray-500);
}

.hcdb-project-mini-card .hcdb-mini-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hcdb-project-mini-card .hcdb-mini-amount {
    font-weight: 600;
    color: var(--hcdb-gray-700);
}

/* ========================================
   项目列表页
   ======================================== */
.hcdb-project-list-container {
    padding: 20px 0;
}

.hcdb-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: white;
    border-radius: var(--hcdb-radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hcdb-toolbar h3 {
    margin: 0;
    font-size: 20px;
    color: var(--hcdb-gray-800);
}

.hcdb-toolbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hcdb-filter-group {
    display: flex;
    gap: 10px;
}

.hcdb-filter-group select,
.hcdb-filter-group input {
    padding: 8px 12px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: var(--hcdb-radius-sm);
    font-size: 14px;
}

.hcdb-project-search {
    width: 200px;
}

/* 项目统计卡片 */
.hcdb-project-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

/* 项目卡片网格 */
.hcdb-project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.hcdb-project-card {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.hcdb-project-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.hcdb-project-card .hcdb-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.hcdb-project-card .hcdb-card-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: var(--hcdb-gray-800);
    line-height: 1.4;
}

.hcdb-project-card .hcdb-card-code {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: var(--hcdb-gray-500);
}

.hcdb-project-card .hcdb-card-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.hcdb-project-card .hcdb-stat-item {
    display: flex;
    flex-direction: column;
}

.hcdb-project-card .hcdb-stat-item .hcdb-label {
    font-size: 12px;
    color: var(--hcdb-gray-500);
}

.hcdb-project-card .hcdb-stat-item .hcdb-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--hcdb-gray-800);
}

.hcdb-project-card .hcdb-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--hcdb-gray-200);
}

/* 状态徽章 */
.hcdb-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.hcdb-status-draft { background: var(--hcdb-gray-200); color: var(--hcdb-gray-600); }
.hcdb-status-approved { background: #dbeafe; color: #1d4ed8; }
.hcdb-status-ongoing { background: #d1fae5; color: #059669; }
.hcdb-status-completed { background: #fef3c7; color: #d97706; }
.hcdb-status-suspended { background: #fee2e2; color: #dc2626; }

/* 进度条 */
.hcdb-progress-bar {
    height: 8px;
    background: var(--hcdb-gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.hcdb-progress-fill {
    height: 100%;
    background: var(--hcdb-gradient-blue);
    border-radius: 4px;
    transition: width 0.3s;
}

/* ========================================
   项目详情页
   ======================================== */
.hcdb-project-detail-container {
    padding: 20px 0;
}

.hcdb-project-header {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hcdb-project-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.hcdb-project-title-row .hcdb-project-name {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: var(--hcdb-gray-800);
}

.hcdb-project-title-row .hcdb-project-code {
    color: var(--hcdb-gray-500);
    font-size: 14px;
    margin-right: 12px;
}

.hcdb-project-actions {
    display: flex;
    gap: 10px;
}

/* 项目概览卡片 */
.hcdb-project-overview {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
}

.hcdb-overview-card {
    background: var(--hcdb-gray-50);
    padding: 16px;
    border-radius: var(--hcdb-radius);
    text-align: center;
}

.hcdb-overview-card .hcdb-card-label {
    display: block;
    font-size: 13px;
    color: var(--hcdb-gray-500);
    margin-bottom: 6px;
}

.hcdb-overview-card .hcdb-card-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--hcdb-gray-800);
}

.hcdb-overview-card.hcdb-card-highlight {
    background: var(--hcdb-primary-bg);
}

.hcdb-overview-card.hcdb-card-highlight .hcdb-card-value {
    color: var(--hcdb-primary);
}

/* 项目标签页 */
.hcdb-project-tabs {
    display: flex;
    gap: 4px;
    background: white;
    padding: 8px;
    border-radius: var(--hcdb-radius);
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hcdb-project-tabs .hcdb-tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: var(--hcdb-radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--hcdb-gray-600);
    transition: all 0.2s;
}

.hcdb-project-tabs .hcdb-tab:hover {
    background: var(--hcdb-gray-100);
}

.hcdb-project-tabs .hcdb-tab.active {
    background: var(--hcdb-primary);
    color: white;
}

.hcdb-project-tab-content {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hcdb-tab-pane {
    display: none;
}

.hcdb-tab-pane.active {
    display: block;
}

/* ========================================
   预算编制器
   ======================================== */
.hcdb-budget-editor-container {
    padding: 20px 0;
}

.hcdb-budget-header {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hcdb-budget-header .hcdb-budget-name {
    margin: 0 0 4px 0;
    font-size: 22px;
    color: var(--hcdb-gray-800);
}

.hcdb-budget-header .hcdb-budget-project,
.hcdb-budget-header .hcdb-budget-version {
    font-size: 13px;
    color: var(--hcdb-gray-500);
    margin-right: 16px;
}

.hcdb-budget-actions {
    display: flex;
    gap: 10px;
}

/* 预算概览 */
.hcdb-budget-summary {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.hcdb-summary-card {
    background: white;
    padding: 20px;
    border-radius: var(--hcdb-radius);
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hcdb-summary-card.hcdb-card-total {
    background: var(--hcdb-gradient-blue);
}

.hcdb-summary-card.hcdb-card-total .hcdb-card-label,
.hcdb-summary-card.hcdb-card-total .hcdb-card-value {
    color: white;
}

.hcdb-summary-card .hcdb-card-label {
    display: block;
    font-size: 13px;
    color: var(--hcdb-gray-500);
    margin-bottom: 8px;
}

.hcdb-summary-card .hcdb-card-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: var(--hcdb-gray-800);
}

/* 预算编辑主体 */
.hcdb-budget-main {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

.hcdb-budget-sidebar {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-height: 70vh;
    overflow-y: auto;
}

.hcdb-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hcdb-gray-200);
}

.hcdb-sidebar-header h4 {
    margin: 0;
    font-size: 16px;
    color: var(--hcdb-gray-800);
}

/* 分部树 */
.hcdb-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hcdb-tree-item {
    padding: 4px 0;
}

.hcdb-tree-toggle {
    display: inline-block;
    width: 20px;
    cursor: pointer;
    color: var(--hcdb-gray-400);
    font-size: 10px;
}

.hcdb-tree-label {
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--hcdb-radius-sm);
    font-size: 14px;
    color: var(--hcdb-gray-700);
    transition: background 0.2s;
}

.hcdb-tree-label:hover {
    background: var(--hcdb-primary-bg);
    color: var(--hcdb-primary);
}

.hcdb-tree-amount {
    float: right;
    font-size: 12px;
    color: var(--hcdb-gray-500);
}

.hcdb-tree-children {
    list-style: none;
    margin: 0;
    padding-left: 24px;
    display: none;
}

.hcdb-tree-item.expanded > .hcdb-tree-children {
    display: block;
}

/* 预算内容区 */
.hcdb-budget-content {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hcdb-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hcdb-gray-200);
}

.hcdb-content-header h4 {
    margin: 0;
    font-size: 16px;
    color: var(--hcdb-gray-800);
}

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

/* 预算表格 */
.hcdb-budget-table-container {
    overflow-x: auto;
}

.hcdb-budget-table {
    width: 100%;
    border-collapse: collapse;
}

.hcdb-budget-table th,
.hcdb-budget-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--hcdb-gray-200);
    font-size: 14px;
}

.hcdb-budget-table th {
    background: var(--hcdb-gray-50);
    font-weight: 600;
    color: var(--hcdb-gray-700);
}

.hcdb-budget-table .col-no { width: 50px; }
.hcdb-budget-table .col-code { width: 120px; }
.hcdb-budget-table .col-unit { width: 60px; }
.hcdb-budget-table .col-qty { width: 100px; }
.hcdb-budget-table .col-price { width: 100px; }
.hcdb-budget-table .col-total { width: 120px; }
.hcdb-budget-table .col-action { width: 100px; }

.hcdb-budget-table input[type="number"] {
    width: 90px;
    padding: 6px 8px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: var(--hcdb-radius-sm);
}

.hcdb-budget-table tfoot td {
    font-weight: 600;
    background: var(--hcdb-gray-50);
}

/* ========================================
   成本控制面板
   ======================================== */
.hcdb-cost-control-container {
    padding: 20px 0;
}

.hcdb-cost-header {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hcdb-cost-header h2 {
    margin: 0 0 4px 0;
    font-size: 22px;
    color: var(--hcdb-gray-800);
}

.hcdb-cost-header .hcdb-cost-project {
    font-size: 13px;
    color: var(--hcdb-gray-500);
}

.hcdb-cost-actions {
    display: flex;
    gap: 10px;
}

/* 成本概览卡片 */
.hcdb-cost-overview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.hcdb-cost-card {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hcdb-cost-card .hcdb-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.hcdb-cost-card .hcdb-card-icon {
    font-size: 20px;
}

.hcdb-cost-card .hcdb-card-title {
    font-size: 13px;
    color: var(--hcdb-gray-500);
}

.hcdb-cost-card .hcdb-card-body .hcdb-card-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--hcdb-gray-800);
}

.hcdb-cost-card .hcdb-card-rate {
    font-size: 14px;
    color: var(--hcdb-gray-500);
    margin-left: 8px;
}

.hcdb-cost-card.hcdb-card-target { border-left: 4px solid var(--hcdb-primary); }
.hcdb-cost-card.hcdb-card-actual { border-left: 4px solid var(--hcdb-success); }
.hcdb-cost-card.hcdb-card-deviation { border-left: 4px solid var(--hcdb-warning); }
.hcdb-cost-card.hcdb-card-forecast { border-left: 4px solid var(--hcdb-info); }
.hcdb-cost-card.hcdb-card-progress { border-left: 4px solid #8b5cf6; }

.hcdb-cost-card .hcdb-card-value.hcdb-negative { color: var(--hcdb-danger); }
.hcdb-cost-card .hcdb-card-value.hcdb-positive { color: var(--hcdb-success); }

/* 成本预警 */
.hcdb-cost-alerts {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hcdb-cost-alerts h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: var(--hcdb-gray-800);
}

.hcdb-alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--hcdb-radius);
    margin-bottom: 10px;
}

.hcdb-alert-item.hcdb-alert-warning {
    background: var(--hcdb-warning-bg);
}

.hcdb-alert-item.hcdb-alert-danger {
    background: var(--hcdb-danger-bg);
}

.hcdb-alert-item.hcdb-alert-critical {
    background: #fecaca;
}

.hcdb-alert-level {
    font-weight: 600;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.1);
}

.hcdb-alert-project {
    color: var(--hcdb-gray-600);
    font-size: 13px;
}

.hcdb-alert-message {
    flex: 1;
    font-size: 14px;
}

.hcdb-alert-time {
    font-size: 12px;
    color: var(--hcdb-gray-500);
}

.hcdb-no-alerts {
    color: var(--hcdb-gray-500);
    font-size: 14px;
    text-align: center;
    padding: 20px;
}

/* 成本标签页 */
.hcdb-cost-tabs {
    display: flex;
    gap: 4px;
    background: white;
    padding: 8px;
    border-radius: var(--hcdb-radius);
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hcdb-cost-tabs .hcdb-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-radius: var(--hcdb-radius-sm);
    cursor: pointer;
    font-size: 14px;
    color: var(--hcdb-gray-600);
    transition: all 0.2s;
}

.hcdb-cost-tabs .hcdb-tab:hover {
    background: var(--hcdb-gray-100);
}

.hcdb-cost-tabs .hcdb-tab.active {
    background: var(--hcdb-primary);
    color: white;
}

.hcdb-cost-tab-content {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 成本类型分析 */
.hcdb-cost-by-type {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.hcdb-type-chart {
    max-width: 400px;
}

.hcdb-type-table table {
    width: 100%;
    border-collapse: collapse;
}

.hcdb-type-table th,
.hcdb-type-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--hcdb-gray-200);
    font-size: 14px;
}

.hcdb-type-table th {
    background: var(--hcdb-gray-50);
    font-weight: 600;
}

.hcdb-type-table .hcdb-negative { color: var(--hcdb-danger); }
.hcdb-type-table .hcdb-positive { color: var(--hcdb-success); }

.hcdb-status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.hcdb-status-dot.hcdb-status-normal { background: var(--hcdb-success); }
.hcdb-status-dot.hcdb-status-over { background: var(--hcdb-danger); }
.hcdb-status-dot.hcdb-status-under { background: var(--hcdb-info); }

/* 成本记录 */
.hcdb-records-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--hcdb-gray-200);
}

.hcdb-records-toolbar select,
.hcdb-records-toolbar input {
    padding: 8px 12px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: var(--hcdb-radius-sm);
    font-size: 14px;
}

.hcdb-records-table {
    width: 100%;
    border-collapse: collapse;
}

.hcdb-records-table th,
.hcdb-records-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--hcdb-gray-200);
    font-size: 14px;
}

.hcdb-records-table th {
    background: var(--hcdb-gray-50);
    font-weight: 600;
}

/* ========================================
   表单样式
   ======================================== */
.hcdb-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.hcdb-form-group {
    margin-bottom: 16px;
}

.hcdb-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hcdb-gray-700);
}

.hcdb-form-group label .required {
    color: var(--hcdb-danger);
}

.hcdb-form-group input,
.hcdb-form-group select,
.hcdb-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: var(--hcdb-radius-sm);
    font-size: 14px;
    transition: border-color 0.2s;
}

.hcdb-form-group input:focus,
.hcdb-form-group select:focus,
.hcdb-form-group textarea:focus {
    outline: none;
    border-color: var(--hcdb-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.hcdb-form-group .hcdb-readonly {
    background: var(--hcdb-gray-100);
    cursor: not-allowed;
}

.hcdb-input-with-btn {
    display: flex;
    gap: 8px;
}

.hcdb-input-with-btn input {
    flex: 1;
}

.hcdb-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--hcdb-gray-200);
}

/* ========================================
   大弹窗
   ======================================== */
.hcdb-modal-large {
    max-width: 800px;
    width: 90%;
}

/* ========================================
   Toast 提示
   ======================================== */
.hcdb-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    background: var(--hcdb-gray-800);
    color: white;
    border-radius: var(--hcdb-radius);
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 10001;
}

.hcdb-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.hcdb-toast.hcdb-toast-success {
    background: var(--hcdb-success);
}

.hcdb-toast.hcdb-toast-error {
    background: var(--hcdb-danger);
}

.hcdb-toast.hcdb-toast-warning {
    background: var(--hcdb-warning);
}

/* ========================================
   空状态
   ======================================== */
.hcdb-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.hcdb-empty-state p {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: var(--hcdb-gray-600);
}

.hcdb-empty-state .hcdb-hint {
    font-size: 14px;
    color: var(--hcdb-gray-500);
}

/* ========================================
   响应式 - 企业模块
   ======================================== */
@media (max-width: 1200px) {
    .hcdb-quick-stats,
    .hcdb-module-cards,
    .hcdb-project-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .hcdb-project-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hcdb-project-overview {
        grid-template-columns: repeat(3, 1fr);
    }

    .hcdb-budget-summary {
        grid-template-columns: repeat(3, 1fr);
    }

    .hcdb-cost-overview {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .hcdb-budget-main {
        grid-template-columns: 1fr;
    }

    .hcdb-budget-sidebar {
        max-height: 300px;
    }

    .hcdb-cost-by-type {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hcdb-quick-stats,
    .hcdb-module-cards,
    .hcdb-project-stats {
        grid-template-columns: 1fr;
    }

    .hcdb-project-grid {
        grid-template-columns: 1fr;
    }

    .hcdb-toolbar {
        flex-direction: column;
        gap: 16px;
    }

    .hcdb-toolbar-right {
        width: 100%;
        flex-direction: column;
    }

    .hcdb-filter-group {
        width: 100%;
        flex-direction: column;
    }

    .hcdb-project-search {
        width: 100%;
    }

    .hcdb-project-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .hcdb-budget-summary,
    .hcdb-cost-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .hcdb-project-tabs,
    .hcdb-cost-tabs {
        flex-wrap: wrap;
    }

    .hcdb-form-row {
        grid-template-columns: 1fr;
    }

    .hcdb-records-toolbar {
        flex-wrap: wrap;
    }
}

/* ========================================
   预算编辑器 - 新版层级结构样式
   ======================================== */

/* 超大弹窗 */
.hcdb-modal-xlarge {
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    overflow-y: auto;
}

/* 清单表格新样式 */
.hcdb-bills-table {
    width: 100%;
    border-collapse: collapse;
}

.hcdb-bills-table th {
    background: var(--hcdb-gray-100);
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid var(--hcdb-gray-200);
    white-space: nowrap;
}

.hcdb-bills-table td {
    padding: 8px;
    border-bottom: 1px solid var(--hcdb-gray-200);
    font-size: 13px;
    text-align: center;
}

.hcdb-bills-table .col-expand {
    width: 30px;
    text-align: center;
}

.hcdb-bills-table .col-name-cell {
    text-align: left;
    max-width: 200px;
}

.hcdb-expand-btn {
    cursor: pointer;
    color: var(--hcdb-gray-500);
    font-size: 10px;
    display: inline-block;
    transition: var(--hcdb-transition-fast);
}

.hcdb-expand-btn:hover {
    color: var(--hcdb-primary);
}

.hcdb-bill-row.expanded {
    background: var(--hcdb-primary-bg);
}

/* 组价模式标签 */
.hcdb-pricing-mode-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 500;
}

.hcdb-mode-direct {
    background: var(--hcdb-info-bg);
    color: var(--hcdb-info);
}

.hcdb-mode-composition {
    background: var(--hcdb-success-bg);
    color: var(--hcdb-success);
}

/* 组价构成子行 */
.hcdb-compositions-row td {
    padding: 0;
    background: var(--hcdb-gray-50);
}

.hcdb-compositions-container {
    padding: 15px 20px;
}

.hcdb-comp-block {
    margin-bottom: 15px;
}

.hcdb-comp-block:last-child {
    margin-bottom: 0;
}

.hcdb-comp-block h5 {
    font-size: 13px;
    font-weight: 600;
    color: var(--hcdb-gray-600);
    margin: 0 0 8px 0;
    padding-left: 10px;
    border-left: 3px solid var(--hcdb-primary);
}

.hcdb-comp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background: #fff;
    border-radius: var(--hcdb-radius-sm);
    overflow: hidden;
}

.hcdb-comp-table th {
    background: var(--hcdb-gray-200);
    padding: 6px 8px;
    font-weight: 500;
    text-align: center;
}

.hcdb-comp-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--hcdb-gray-100);
    text-align: center;
}

/* 清单编辑弹窗 */
.hcdb-form-section {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--hcdb-gray-50);
    border-radius: var(--hcdb-radius);
}

.hcdb-form-section h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--hcdb-gray-800);
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hcdb-gray-200);
}

.hcdb-form-group-wide {
    flex: 2;
}

/* 组价构成编辑区块 */
.hcdb-composition-block {
    margin-bottom: 20px;
    background: #fff;
    border-radius: var(--hcdb-radius);
    border: 1px solid var(--hcdb-gray-200);
    overflow: hidden;
}

.hcdb-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: var(--hcdb-gray-100);
    border-bottom: 1px solid var(--hcdb-gray-200);
}

.hcdb-block-header h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: var(--hcdb-gray-700);
}

.hcdb-composition-table {
    width: 100%;
    border-collapse: collapse;
}

.hcdb-composition-table th {
    background: var(--hcdb-gray-50);
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    border-bottom: 1px solid var(--hcdb-gray-200);
}

.hcdb-composition-table td {
    padding: 6px;
    border-bottom: 1px solid var(--hcdb-gray-100);
    text-align: center;
}

.hcdb-composition-table input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
}

.hcdb-composition-table input:focus {
    border-color: var(--hcdb-primary);
    outline: none;
    box-shadow: 0 0 0 2px var(--hcdb-primary-bg);
}

/* 输入框尺寸类 */
.hcdb-input-xs {
    max-width: 50px;
}

.hcdb-input-sm {
    max-width: 80px;
}

.hcdb-input-md {
    max-width: 150px;
}

/* 价格汇总区域 */
.hcdb-price-summary {
    background: var(--hcdb-gray-800);
    color: #fff;
    padding: 20px;
    border-radius: var(--hcdb-radius);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}

.hcdb-price-row {
    text-align: center;
}

.hcdb-price-label {
    display: block;
    font-size: 12px;
    color: var(--hcdb-gray-400);
    margin-bottom: 4px;
}

.hcdb-price-value {
    display: block;
    font-size: 16px;
    font-weight: 600;
}

.hcdb-price-row-highlight .hcdb-price-value {
    color: var(--hcdb-warning);
}

.hcdb-price-row-total {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: var(--hcdb-radius-sm);
}

.hcdb-price-row-total .hcdb-price-value {
    font-size: 20px;
    color: var(--hcdb-success);
}

/* 库选择弹窗 */
.hcdb-lib-search {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--hcdb-gray-200);
}

.hcdb-lib-search-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: var(--hcdb-radius);
    font-size: 14px;
}

.hcdb-lib-search-input:focus {
    border-color: var(--hcdb-primary);
    outline: none;
}

.hcdb-lib-category-filter {
    padding: 10px 15px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: var(--hcdb-radius);
    font-size: 14px;
    min-width: 150px;
}

.hcdb-lib-list {
    max-height: 400px;
    overflow-y: auto;
}

.hcdb-lib-list table {
    width: 100%;
    border-collapse: collapse;
}

.hcdb-lib-list th {
    background: var(--hcdb-gray-100);
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    position: sticky;
    top: 0;
}

.hcdb-lib-list td {
    padding: 10px;
    border-bottom: 1px solid var(--hcdb-gray-100);
    font-size: 13px;
    text-align: center;
}

.hcdb-lib-list tr:hover {
    background: var(--hcdb-primary-bg);
}

/* 分部树样式优化 */
.hcdb-tree-item.selected > .hcdb-tree-label {
    background: var(--hcdb-primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: var(--hcdb-radius-sm);
}

.hcdb-tree-spacer {
    display: inline-block;
    width: 16px;
}

.hcdb-tree-children {
    padding-left: 20px;
    display: none;
}

.hcdb-tree-item.expanded > .hcdb-tree-children {
    display: block;
}

/* 高亮列 */
.hcdb-highlight {
    font-weight: 600;
    color: var(--hcdb-primary);
}

/* 价差显示 */
.hcdb-price-diff {
    font-weight: 500;
}

/* 直接填单价区域 */
.hcdb-direct-price-section {
    background: var(--hcdb-info-bg);
}

/* 表单操作按钮组 */
.hcdb-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--hcdb-gray-200);
    margin-top: 20px;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .hcdb-price-summary {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .hcdb-modal-xlarge {
        width: 98%;
        max-height: 95vh;
    }

    .hcdb-price-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .hcdb-lib-search {
        flex-wrap: wrap;
    }

    .hcdb-lib-search-input {
        flex: 1 1 100%;
    }
}

/* ========================================
   成本分析 - EVA挣值分析样式
   ======================================== */

.hcdb-cost-analysis-container {
    padding: 20px;
}

.hcdb-analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--hcdb-gray-200);
}

.hcdb-analysis-period {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hcdb-analysis-period input[type="date"] {
    padding: 8px 12px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: var(--hcdb-radius-sm);
    font-size: 14px;
}

.hcdb-analysis-section {
    background: #fff;
    border-radius: var(--hcdb-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--hcdb-shadow-sm);
}

.hcdb-analysis-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: var(--hcdb-gray-800);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hcdb-gray-200);
}

/* KPI卡片 */
.hcdb-kpi-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.hcdb-kpi-card {
    background: var(--hcdb-gray-50);
    border-radius: var(--hcdb-radius);
    padding: 15px;
    text-align: center;
    position: relative;
}

.hcdb-kpi-label {
    display: block;
    font-size: 12px;
    color: var(--hcdb-gray-500);
    margin-bottom: 8px;
}

.hcdb-kpi-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--hcdb-gray-800);
}

.hcdb-kpi-status {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.hcdb-kpi-status.good {
    background: var(--hcdb-success);
    box-shadow: 0 0 8px var(--hcdb-success);
}

.hcdb-kpi-status.warning {
    background: var(--hcdb-warning);
    box-shadow: 0 0 8px var(--hcdb-warning);
}

.hcdb-kpi-status.danger {
    background: var(--hcdb-danger);
    box-shadow: 0 0 8px var(--hcdb-danger);
}

.hcdb-kpi-cpi .hcdb-kpi-value,
.hcdb-kpi-spi .hcdb-kpi-value {
    font-size: 28px;
}

/* 分析结论 */
.hcdb-analysis-conclusion {
    background: var(--hcdb-primary-bg);
    border-left: 4px solid var(--hcdb-primary);
    padding: 15px;
    border-radius: 0 var(--hcdb-radius) var(--hcdb-radius) 0;
}

.hcdb-conclusion-text {
    margin: 0;
    color: var(--hcdb-gray-700);
    line-height: 1.8;
}

/* EVA图表 */
.hcdb-eva-chart {
    height: 300px;
    margin-bottom: 15px;
}

.hcdb-eva-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 14px;
}

.hcdb-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hcdb-legend-pv {
    color: #3b82f6;
}

.hcdb-legend-ev {
    color: #10b981;
}

.hcdb-legend-ac {
    color: #ef4444;
}

/* 费用结构图表 */
.hcdb-structure-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.hcdb-chart-box {
    text-align: center;
}

.hcdb-chart-box h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: var(--hcdb-gray-600);
}

.hcdb-chart-box canvas {
    max-height: 250px;
}

/* 问题与建议 */
.hcdb-issues-section,
.hcdb-suggestions-section {
    margin-bottom: 15px;
}

.hcdb-issues-section h4,
.hcdb-suggestions-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: var(--hcdb-gray-700);
}

.hcdb-issues-section ul,
.hcdb-suggestions-section ul {
    margin: 0;
    padding-left: 20px;
}

.hcdb-issues-section li,
.hcdb-suggestions-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.hcdb-issue-warning {
    color: var(--hcdb-warning);
}

.hcdb-issue-danger {
    color: var(--hcdb-danger);
    font-weight: 500;
}

.hcdb-no-issues {
    text-align: center;
    color: var(--hcdb-success);
    padding: 20px;
    background: var(--hcdb-success-bg);
    border-radius: var(--hcdb-radius);
}

/* 响应式 */
@media (max-width: 1024px) {
    .hcdb-kpi-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hcdb-structure-charts {
        grid-template-columns: 1fr;
    }

    .hcdb-analysis-period {
        flex-wrap: wrap;
    }

    .hcdb-kpi-value {
        font-size: 20px;
    }
}

/* ========================================
   企业综合工作台样式
   ======================================== */

.hcdb-enterprise-wrapper {
    background: #f5f7fa;
    min-height: 100vh;
}

/* 顶部导航 */
.hcdb-enterprise-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    padding: 0 30px;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hcdb-nav-brand a {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
}

.hcdb-nav-menu {
    display: flex;
    gap: 5px;
}

.hcdb-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.hcdb-nav-item:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.hcdb-nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: 500;
}

.hcdb-nav-icon {
    font-size: 16px;
}

.hcdb-nav-user {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

/* 面包屑 */
.hcdb-breadcrumb {
    padding: 12px 30px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    color: #6b7280;
}

.hcdb-breadcrumb a {
    color: var(--hcdb-primary);
    text-decoration: none;
}

.hcdb-breadcrumb a:hover {
    text-decoration: underline;
}

/* 主内容区 */
.hcdb-enterprise-main {
    padding: 25px 30px;
    max-width: 1600px;
    margin: 0 auto;
}

/* 仪表盘首页 */
.hcdb-enterprise-dashboard {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.hcdb-quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.hcdb-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
}

.hcdb-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hcdb-stat-icon {
    font-size: 36px;
}

.hcdb-stat-info {
    display: flex;
    flex-direction: column;
}

.hcdb-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
}

.hcdb-stat-label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}

.hcdb-card-projects .hcdb-stat-value { color: #3b82f6; }
.hcdb-card-ongoing .hcdb-stat-value { color: #10b981; }
.hcdb-card-contract .hcdb-stat-value { color: #f59e0b; }
.hcdb-card-alerts .hcdb-stat-value { color: #ef4444; }

/* 模块卡片 */
.hcdb-module-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.hcdb-module-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    border: 2px solid #e5e7eb;
    transition: all 0.25s;
}

.hcdb-module-card:hover {
    border-color: var(--hcdb-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.15);
}

.hcdb-module-icon {
    font-size: 48px;
}

.hcdb-module-info h4 {
    margin: 0 0 5px;
    font-size: 18px;
    color: #1f2937;
}

.hcdb-module-info p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}

.hcdb-module-projects { border-left: 4px solid #3b82f6; }
.hcdb-module-budgets { border-left: 4px solid #10b981; }
.hcdb-module-costs { border-left: 4px solid #f59e0b; }

/* 最近项目区块 */
.hcdb-recent-projects-section,
.hcdb-alerts-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.hcdb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.hcdb-section-header h3 {
    margin: 0;
    font-size: 16px;
    color: #1f2937;
}

.hcdb-view-all {
    color: var(--hcdb-primary);
    font-size: 13px;
    text-decoration: none;
}

.hcdb-view-all:hover {
    text-decoration: underline;
}

.hcdb-recent-projects-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hcdb-recent-project-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.hcdb-recent-project-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hcdb-recent-project-info h4 {
    margin: 0;
    font-size: 14px;
    color: #1f2937;
}

.hcdb-recent-project-meta {
    color: #6b7280;
    font-size: 13px;
}

.hcdb-recent-project-actions {
    display: flex;
    gap: 8px;
}

/* 项目选择器 */
.hcdb-project-selector {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hcdb-selector-header {
    text-align: center;
    margin-bottom: 25px;
}

.hcdb-selector-header h3 {
    margin: 0 0 10px;
    font-size: 20px;
    color: #1f2937;
}

.hcdb-selector-header p {
    margin: 0;
    color: #6b7280;
}

.hcdb-selector-search {
    max-width: 500px;
    margin: 0 auto 25px;
}

.hcdb-project-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.hcdb-project-search-input:focus {
    outline: none;
    border-color: var(--hcdb-primary);
}

.hcdb-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.hcdb-selector-item {
    display: block;
    padding: 18px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.hcdb-selector-item:hover {
    border-color: var(--hcdb-primary);
    background: #eff6ff;
    transform: translateY(-2px);
}

.hcdb-selector-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.hcdb-selector-item-header h4 {
    margin: 0;
    font-size: 15px;
    color: #1f2937;
}

.hcdb-selector-item-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #6b7280;
}

/* 状态徽章 */
.hcdb-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.hcdb-status-badge.status-planning {
    background: #e0e7ff;
    color: #4338ca;
}

.hcdb-status-badge.status-in_progress {
    background: #dcfce7;
    color: #16a34a;
}

.hcdb-status-badge.status-paused {
    background: #fef3c7;
    color: #d97706;
}

.hcdb-status-badge.status-completed {
    background: #f3f4f6;
    color: #6b7280;
}

/* 无数据提示 */
.hcdb-no-data {
    text-align: center;
    padding: 30px;
    color: #9ca3af;
    font-size: 14px;
}

.hcdb-no-data a {
    color: var(--hcdb-primary);
}

/* 响应式 */
@media (max-width: 1200px) {
    .hcdb-quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .hcdb-module-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hcdb-enterprise-nav {
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 10px;
    }

    .hcdb-nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hcdb-nav-item {
        padding: 8px 12px;
        font-size: 13px;
    }

    .hcdb-quick-stats,
    .hcdb-module-cards {
        grid-template-columns: 1fr;
    }

    .hcdb-enterprise-main {
        padding: 15px;
    }

    .hcdb-recent-project-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .hcdb-recent-project-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ========================================
   工具箱样式
   ======================================== */

.hcdb-toolbox {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hcdb-toolbox-header {
    margin-bottom: 25px;
}

.hcdb-toolbox-header h2 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #1f2937;
}

.hcdb-toolbox-header p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.hcdb-toolbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.hcdb-tool-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s;
}

.hcdb-tool-card:hover {
    border-color: var(--hcdb-primary);
    background: #eff6ff;
}

.hcdb-tool-icon {
    font-size: 40px;
    flex-shrink: 0;
}

.hcdb-tool-info {
    flex: 1;
}

.hcdb-tool-info h4 {
    margin: 0 0 5px;
    font-size: 16px;
    color: #1f2937;
}

.hcdb-tool-info p {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.4;
}

/* 工具内容区 */
.hcdb-tool-content {
    margin-top: 30px;
    background: #fff;
    border: 2px solid var(--hcdb-primary);
    border-radius: 12px;
    overflow: hidden;
}

.hcdb-tool-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: #fff;
}

.hcdb-tool-content-title {
    margin: 0;
    font-size: 16px;
}

.hcdb-tool-content-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* 费率设置表格 */
.hcdb-rates-info {
    max-width: 500px;
    margin: 0 auto;
}

.hcdb-rates-info h4 {
    margin: 0 0 20px;
    text-align: center;
    color: #1f2937;
}

.hcdb-rates-table {
    width: 100%;
    border-collapse: collapse;
}

.hcdb-rates-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e5e7eb;
}

.hcdb-rates-table td:first-child {
    color: #6b7280;
}

.hcdb-rates-table td:last-child {
    text-align: right;
    color: var(--hcdb-primary);
}

.hcdb-rates-note {
    margin-top: 20px;
    padding: 12px;
    background: #fef3c7;
    border-radius: 6px;
    font-size: 13px;
    color: #92400e;
    text-align: center;
}

@media (max-width: 768px) {
    .hcdb-toolbox-grid {
        grid-template-columns: 1fr;
    }

    .hcdb-tool-card {
        flex-direction: column;
        text-align: center;
    }

    .hcdb-tool-card .hcdb-btn {
        width: 100%;
    }
}

/* ========================================
   清单库选择弹窗样式
   ======================================== */
.hcdb-bill-library-container {
    display: flex;
    flex-direction: column;
    height: 70vh;
    max-height: 600px;
}

.hcdb-library-search {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--hcdb-gray-50);
    border-bottom: 1px solid var(--hcdb-gray-200);
}

.hcdb-library-search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: var(--hcdb-radius-sm);
    font-size: 14px;
}

.hcdb-library-search-input:focus {
    outline: none;
    border-color: var(--hcdb-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.hcdb-library-category-filter {
    width: 150px;
    padding: 10px 12px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: var(--hcdb-radius-sm);
    font-size: 14px;
}

.hcdb-library-tree-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.hcdb-library-tree {
    flex: 2;
    overflow-y: auto;
    padding: 16px;
    border-right: 1px solid var(--hcdb-gray-200);
}

.hcdb-library-selected {
    flex: 1;
    min-width: 280px;
    padding: 16px;
    background: var(--hcdb-gray-50);
    overflow-y: auto;
}

.hcdb-library-selected h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--hcdb-gray-700);
}

.hcdb-library-chapters {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hcdb-library-chapter {
    border: 1px solid var(--hcdb-gray-200);
    border-radius: var(--hcdb-radius-sm);
    overflow: hidden;
}

.hcdb-chapter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--hcdb-gray-100);
    cursor: pointer;
    transition: var(--hcdb-transition-fast);
}

.hcdb-chapter-header:hover {
    background: var(--hcdb-gray-200);
}

.hcdb-chapter-toggle {
    font-size: 10px;
    color: var(--hcdb-gray-500);
    width: 16px;
}

.hcdb-chapter-code {
    font-family: monospace;
    font-size: 12px;
    color: var(--hcdb-primary);
    background: var(--hcdb-primary-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.hcdb-chapter-name {
    flex: 1;
    font-weight: 500;
    color: var(--hcdb-gray-800);
}

.hcdb-chapter-count {
    font-size: 12px;
    color: var(--hcdb-gray-500);
}

.hcdb-chapter-items {
    background: #fff;
}

.hcdb-library-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 10px 40px;
    border-bottom: 1px solid var(--hcdb-gray-100);
    cursor: pointer;
    transition: var(--hcdb-transition-fast);
}

.hcdb-library-item:last-child {
    border-bottom: none;
}

.hcdb-library-item:hover {
    background: var(--hcdb-primary-bg);
}

.hcdb-library-item.selected {
    background: var(--hcdb-primary-bg);
    border-left: 3px solid var(--hcdb-primary);
    padding-left: 37px;
}

.hcdb-item-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.hcdb-item-code {
    font-family: monospace;
    font-size: 12px;
    color: var(--hcdb-gray-600);
    min-width: 100px;
}

.hcdb-item-name {
    flex: 1;
    font-size: 14px;
    color: var(--hcdb-gray-800);
}

.hcdb-item-unit {
    font-size: 12px;
    color: var(--hcdb-gray-500);
    min-width: 60px;
    text-align: right;
}

.hcdb-selected-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hcdb-selected-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--hcdb-gray-200);
    border-radius: var(--hcdb-radius-sm);
}

.hcdb-selected-code {
    font-family: monospace;
    font-size: 11px;
    color: var(--hcdb-primary);
    background: var(--hcdb-primary-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

.hcdb-selected-name {
    flex: 1;
    font-size: 13px;
    color: var(--hcdb-gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hcdb-remove-selected-btn {
    background: none;
    border: none;
    color: var(--hcdb-gray-400);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    transition: var(--hcdb-transition-fast);
}

.hcdb-remove-selected-btn:hover {
    color: var(--hcdb-danger);
}

.hcdb-library-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--hcdb-gray-200);
    background: var(--hcdb-gray-50);
}

/* 预算编辑器全宽布局（无侧边栏） */
.hcdb-budget-main:has(.hcdb-budget-content-full) {
    display: block;
}

.hcdb-budget-content-full {
    width: 100%;
    padding: 20px;
    background: white;
    border-radius: var(--hcdb-radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.hcdb-budget-content-full .hcdb-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 0 16px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--hcdb-gray-200);
}

.hcdb-budget-content-full .hcdb-content-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.hcdb-budget-content-full .hcdb-budget-table-container {
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px;
}

.hcdb-budget-content-full .hcdb-budget-table {
    min-width: 1100px;
    width: 100%;
}

.hcdb-budget-content-full .hcdb-budget-table th,
.hcdb-budget-content-full .hcdb-budget-table td {
    white-space: nowrap;
    padding: 10px 8px;
}

.hcdb-budget-content-full .hcdb-budget-table .col-name-cell {
    white-space: normal;
    min-width: 150px;
    max-width: 250px;
}

/* 预算编辑器左右分栏布局 */
.hcdb-budget-main-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

.hcdb-budget-content-left {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.hcdb-budget-content-left .hcdb-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--hcdb-gray-200);
}

.hcdb-budget-content-left .hcdb-budget-table-container {
    overflow-x: auto;
}

.hcdb-budget-content-left .hcdb-budget-table {
    min-width: 900px;
}

/* 清单选择复选框 */
.hcdb-bill-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.hcdb-bills-table tr.selected {
    background: var(--hcdb-primary-bg) !important;
}

.hcdb-selected-bill-hint {
    margin-top: 12px;
    padding: 10px 16px;
    background: var(--hcdb-info-bg);
    border-radius: var(--hcdb-radius-sm);
    color: var(--hcdb-info);
    font-size: 13px;
}

.hcdb-selected-bill-name {
    font-weight: 600;
    color: var(--hcdb-primary);
}

/* 右侧库选择面板 */
.hcdb-budget-sidebar-right {
    background: white;
    border-radius: var(--hcdb-radius-lg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 300px);
    min-height: 500px;
}

.hcdb-sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--hcdb-gray-200);
    padding: 0;
    flex-shrink: 0;
}

.hcdb-sidebar-tab {
    flex: 1;
    padding: 12px 8px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--hcdb-gray-600);
    border-bottom: 2px solid transparent;
    transition: var(--hcdb-transition-fast);
}

.hcdb-sidebar-tab:hover {
    color: var(--hcdb-primary);
    background: var(--hcdb-gray-50);
}

.hcdb-sidebar-tab.active {
    color: var(--hcdb-primary);
    border-bottom-color: var(--hcdb-primary);
}

.hcdb-sidebar-search {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--hcdb-gray-100);
    flex-shrink: 0;
}

.hcdb-sidebar-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--hcdb-gray-300);
    border-radius: var(--hcdb-radius-sm);
    font-size: 13px;
}

.hcdb-sidebar-search-input:focus {
    outline: none;
    border-color: var(--hcdb-primary);
}

.hcdb-sidebar-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.hcdb-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hcdb-sidebar-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--hcdb-gray-400);
    font-size: 13px;
}

.hcdb-sidebar-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--hcdb-gray-200);
    border-radius: var(--hcdb-radius-sm);
    cursor: pointer;
    transition: var(--hcdb-transition-fast);
}

.hcdb-sidebar-item:hover {
    border-color: var(--hcdb-primary);
    background: var(--hcdb-primary-bg);
}

.hcdb-sidebar-item.selected {
    border-color: var(--hcdb-primary);
    background: var(--hcdb-primary-bg);
}

.hcdb-sidebar-item-checkbox {
    margin-top: 2px;
}

.hcdb-sidebar-item-info {
    flex: 1;
    min-width: 0;
}

.hcdb-sidebar-item-code {
    font-family: monospace;
    font-size: 11px;
    color: var(--hcdb-primary);
    background: var(--hcdb-primary-bg);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.hcdb-sidebar-item-name {
    font-size: 13px;
    color: var(--hcdb-gray-800);
    line-height: 1.4;
    word-break: break-all;
}

.hcdb-sidebar-item-meta {
    font-size: 11px;
    color: var(--hcdb-gray-500);
    margin-top: 4px;
}

.hcdb-sidebar-actions {
    padding: 12px;
    border-top: 1px solid var(--hcdb-gray-200);
    flex-shrink: 0;
}

.hcdb-sidebar-actions .hcdb-btn {
    width: 100%;
}

/* 侧边栏面板切换 */
.hcdb-sidebar-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.hcdb-sidebar-panel.active {
    display: flex;
}

.hcdb-sidebar-lib-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hcdb-sidebar-lib-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--hcdb-gray-200);
    border-radius: var(--hcdb-radius-sm);
    cursor: pointer;
    transition: var(--hcdb-transition-fast);
    background: white;
}

.hcdb-sidebar-lib-item:hover {
    border-color: var(--hcdb-primary-light);
    background: var(--hcdb-gray-50);
}

.hcdb-sidebar-lib-item.selected {
    border-color: var(--hcdb-primary);
    background: var(--hcdb-primary-bg);
    box-shadow: 0 0 0 1px var(--hcdb-primary);
}

.hcdb-sidebar-item-code {
    font-family: monospace;
    font-size: 11px;
    color: var(--hcdb-primary);
    background: var(--hcdb-primary-bg);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    align-self: flex-start;
}

.hcdb-sidebar-item-name {
    font-size: 13px;
    color: var(--hcdb-gray-800);
    line-height: 1.4;
    word-break: break-all;
}

.hcdb-sidebar-item-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--hcdb-gray-500);
}

.hcdb-sidebar-item-unit {
    background: var(--hcdb-gray-100);
    padding: 1px 6px;
    border-radius: 3px;
}

.hcdb-sidebar-item-price {
    color: var(--hcdb-success);
    font-weight: 500;
}

/* 清单复选框列样式 */
.hcdb-bills-table .col-select {
    width: 35px;
    text-align: center;
}

.hcdb-bill-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.hcdb-select-all-bills {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 响应式 */
@media (max-width: 1200px) {
    .hcdb-budget-main-with-sidebar {
        grid-template-columns: 1fr;
    }

    .hcdb-budget-sidebar-right {
        max-height: 400px;
        min-height: auto;
    }
}

/* 响应式清单库弹窗 */
@media (max-width: 992px) {
    .hcdb-library-tree-container {
        flex-direction: column;
    }

    .hcdb-library-tree {
        border-right: none;
        border-bottom: 1px solid var(--hcdb-gray-200);
        max-height: 300px;
    }

    .hcdb-library-selected {
        min-width: auto;
        max-height: 200px;
    }
}

/* ========================================
   施工工艺展示样式
   ======================================== */

/* 查看施工工艺按钮 */
.hcdb-btn-process {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
}

.hcdb-btn-process:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
}

.hcdb-btn-process.active {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
}

/* 施工工艺面板 */
.hcdb-process-panel {
    margin-top: 24px;
    background: var(--hcdb-gray-50);
    border-radius: var(--hcdb-radius-lg);
    padding: 24px;
    border: 1px solid var(--hcdb-gray-200);
}

.hcdb-process-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: var(--hcdb-gray-500);
}

.hcdb-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--hcdb-gray-200);
    border-top-color: var(--hcdb-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hcdb-process-empty,
.hcdb-process-error {
    text-align: center;
    padding: 40px;
    color: var(--hcdb-gray-500);
}

.hcdb-process-empty p,
.hcdb-process-error p {
    font-size: 16px;
    margin-bottom: 8px;
}

.hcdb-process-empty small {
    color: var(--hcdb-gray-400);
}

.hcdb-process-error {
    color: var(--hcdb-danger);
    background: var(--hcdb-danger-bg);
    border-radius: var(--hcdb-radius);
}

/* 施工工艺头部 */
.hcdb-process-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--hcdb-gray-200);
}

.hcdb-process-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--hcdb-gray-800);
}

.hcdb-process-count {
    background: var(--hcdb-primary-bg);
    color: var(--hcdb-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* 费用汇总卡片 */
.hcdb-process-cost-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.hcdb-cost-card {
    background: white;
    border-radius: var(--hcdb-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.hcdb-cost-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hcdb-cost-card.hcdb-cost-total {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
}

.hcdb-cost-card.hcdb-cost-total .hcdb-cost-label,
.hcdb-cost-card.hcdb-cost-total .hcdb-cost-percent {
    color: rgba(255, 255, 255, 0.8);
}

.hcdb-cost-icon {
    font-size: 28px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hcdb-gray-100);
    border-radius: var(--hcdb-radius);
}

.hcdb-cost-total .hcdb-cost-icon {
    background: rgba(255, 255, 255, 0.2);
}

.hcdb-cost-info {
    flex: 1;
}

.hcdb-cost-label {
    font-size: 12px;
    color: var(--hcdb-gray-500);
    margin-bottom: 4px;
}

.hcdb-cost-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--hcdb-gray-800);
}

.hcdb-cost-total .hcdb-cost-value {
    color: white;
}

.hcdb-cost-percent {
    font-size: 12px;
    color: var(--hcdb-gray-400);
    margin-top: 2px;
}

/* 施工流程图 */
.hcdb-process-flow {
    margin-bottom: 24px;
}

.hcdb-process-flow h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--hcdb-gray-700);
    margin: 0 0 16px 0;
}

.hcdb-flow-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 20px;
    background: white;
    border-radius: var(--hcdb-radius);
    overflow-x: auto;
}

.hcdb-flow-step {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hcdb-flow-node {
    position: relative;
}

.hcdb-flow-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.hcdb-flow-content {
    background: var(--hcdb-gray-50);
    padding: 8px 14px;
    border-radius: var(--hcdb-radius-sm);
    border: 1px solid var(--hcdb-gray-200);
    min-width: 100px;
    max-width: 180px;
}

.hcdb-flow-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--hcdb-gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.hcdb-flow-cost {
    font-size: 12px;
    color: var(--hcdb-primary);
    font-weight: 600;
}

.hcdb-flow-arrow {
    color: var(--hcdb-gray-400);
    font-size: 18px;
    margin: 0 4px;
}

/* 施工步骤详情 */
.hcdb-process-steps h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--hcdb-gray-700);
    margin: 0 0 16px 0;
}

.hcdb-step-item {
    background: white;
    border-radius: var(--hcdb-radius);
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid var(--hcdb-gray-200);
}

.hcdb-step-header {
    display: flex;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 16px;
}

.hcdb-step-header:hover {
    background: var(--hcdb-gray-50);
}

.hcdb-step-number {
    width: 32px;
    height: 32px;
    background: var(--hcdb-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.hcdb-step-info {
    flex: 1;
    min-width: 0;
}

.hcdb-step-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--hcdb-gray-800);
    margin-bottom: 2px;
}

.hcdb-step-code {
    font-size: 12px;
    color: var(--hcdb-gray-500);
    font-family: monospace;
}

.hcdb-step-cost-brief {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--hcdb-gray-600);
}

.hcdb-step-cost-brief span {
    white-space: nowrap;
}

.hcdb-step-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--hcdb-primary);
    white-space: nowrap;
}

.hcdb-step-toggle {
    color: var(--hcdb-gray-400);
    transition: transform 0.3s;
    font-size: 12px;
}

.hcdb-step-item.expanded .hcdb-step-toggle {
    transform: rotate(180deg);
}

/* 步骤详情内容 */
.hcdb-step-body {
    display: none;
    padding: 0 16px 16px 16px;
    border-top: 1px solid var(--hcdb-gray-100);
    background: var(--hcdb-gray-50);
}

.hcdb-step-item.expanded .hcdb-step-body {
    display: block;
}

.hcdb-step-section {
    margin-top: 16px;
}

.hcdb-step-section h6 {
    font-size: 13px;
    font-weight: 600;
    color: var(--hcdb-gray-700);
    margin: 0 0 10px 0;
}

.hcdb-step-section p {
    font-size: 13px;
    line-height: 1.7;
    color: var(--hcdb-gray-600);
    margin: 0;
    background: white;
    padding: 12px;
    border-radius: var(--hcdb-radius-sm);
    border: 1px solid var(--hcdb-gray-200);
}

/* 迷你表格 */
.hcdb-mini-table {
    width: 100%;
    font-size: 12px;
    border-collapse: collapse;
    background: white;
    border-radius: var(--hcdb-radius-sm);
    overflow: hidden;
    border: 1px solid var(--hcdb-gray-200);
}

.hcdb-mini-table th,
.hcdb-mini-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--hcdb-gray-100);
}

.hcdb-mini-table th {
    background: var(--hcdb-gray-100);
    font-weight: 600;
    color: var(--hcdb-gray-600);
    font-size: 11px;
    text-transform: uppercase;
}

.hcdb-mini-table tbody tr:hover {
    background: var(--hcdb-gray-50);
}

.hcdb-mini-table tbody tr.is-main {
    background: var(--hcdb-primary-bg);
}

.hcdb-mini-table tfoot td {
    background: var(--hcdb-gray-50);
    font-weight: 600;
    color: var(--hcdb-gray-800);
}

.hcdb-main-badge {
    display: inline-block;
    background: var(--hcdb-primary);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

/* 安全注意事项 */
.hcdb-safety-notes p {
    background: var(--hcdb-warning-bg) !important;
    border-color: var(--hcdb-warning) !important;
    color: var(--hcdb-gray-700) !important;
}

/* 响应式 */
@media (max-width: 992px) {
    .hcdb-process-cost-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .hcdb-step-cost-brief {
        display: none;
    }

    .hcdb-flow-container {
        flex-direction: column;
        gap: 16px;
    }

    .hcdb-flow-step {
        flex-direction: column;
        align-items: flex-start;
    }

    .hcdb-flow-arrow {
        transform: rotate(90deg);
        margin: 8px 0;
    }
}

@media (max-width: 576px) {
    .hcdb-process-cost-summary {
        grid-template-columns: 1fr;
    }

    .hcdb-process-panel {
        padding: 16px;
    }

    .hcdb-step-header {
        flex-wrap: wrap;
    }

    .hcdb-step-info {
        width: calc(100% - 48px);
    }

    .hcdb-step-total {
        width: 100%;
        margin-top: 8px;
        text-align: right;
    }

    .hcdb-mini-table {
        font-size: 11px;
    }

    .hcdb-mini-table th,
    .hcdb-mini-table td {
        padding: 8px;
    }
}

/* ========================================
   企业管理中心 - 施工工艺模态框
   ======================================== */
.hcdb-process-modal .hcdb-modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
}

.hcdb-process-modal .hcdb-modal-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 16px 24px;
}

.hcdb-process-modal .hcdb-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.hcdb-process-modal .hcdb-modal-close {
    color: white;
    background: rgba(255,255,255,0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.hcdb-process-modal .hcdb-modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.hcdb-process-modal .hcdb-modal-body {
    padding: 24px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

/* 费用汇总卡片 */
.hcdb-process-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.hcdb-summary-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.hcdb-summary-label {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
}

.hcdb-summary-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

/* 流程图 */
.hcdb-process-flow {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.hcdb-process-flow h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #334155;
}

.hcdb-flow-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.hcdb-flow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.hcdb-flow-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.hcdb-flow-name {
    font-size: 12px;
    color: #475569;
    text-align: center;
    max-width: 80px;
    word-break: break-all;
}

.hcdb-flow-arrow {
    color: #94a3b8;
    font-size: 18px;
    margin: 0 4px;
}

/* 步骤详情列表 */
.hcdb-process-steps-list {
    margin-top: 24px;
}

.hcdb-process-steps-list h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #334155;
}

.hcdb-process-step-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.hcdb-process-step-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hcdb-process-step-item .hcdb-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    background: #fafafa;
    border-bottom: 1px solid transparent;
    transition: background 0.2s;
}

.hcdb-process-step-item .hcdb-step-header:hover {
    background: #f1f5f9;
}

.hcdb-process-step-item.expanded .hcdb-step-header {
    background: #f0f9ff;
    border-bottom-color: #e0f2fe;
}

.hcdb-step-number {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.hcdb-step-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
}

.hcdb-step-toggle {
    color: #94a3b8;
    font-size: 12px;
    transition: transform 0.2s;
}

.hcdb-process-step-item.expanded .hcdb-step-toggle {
    transform: rotate(180deg);
}

/* 步骤详情内容 */
.hcdb-step-details {
    padding: 18px;
    background: white;
}

.hcdb-detail-section {
    margin-bottom: 18px;
}

.hcdb-detail-section:last-child {
    margin-bottom: 0;
}

.hcdb-detail-section h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.hcdb-detail-section p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    background: #f8fafc;
    padding: 12px 14px;
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
}

.hcdb-safety-section p {
    background: #fef3c7;
    border-left-color: #f59e0b;
    color: #92400e;
}

/* 模态框内的表格样式 */
.hcdb-process-modal .hcdb-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.hcdb-process-modal .hcdb-mini-table th,
.hcdb-process-modal .hcdb-mini-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.hcdb-process-modal .hcdb-mini-table th {
    background: #f1f5f9;
    font-weight: 600;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hcdb-process-modal .hcdb-mini-table tbody tr:hover {
    background: #f8fafc;
}

.hcdb-process-modal .hcdb-mini-table tbody tr:last-child td {
    border-bottom: none;
}

/* 无数据/错误/加载状态 */
.hcdb-process-content .hcdb-no-data,
.hcdb-process-content .hcdb-error {
    padding: 60px 20px;
    text-align: center;
}

.hcdb-process-content .hcdb-no-data p {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #64748b;
}

.hcdb-process-content .hcdb-hint {
    font-size: 14px;
    color: #94a3b8;
}

.hcdb-process-content .hcdb-error {
    color: #dc2626;
}

.hcdb-process-content .hcdb-loading {
    padding: 60px 20px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

/* 响应式 */
@media (max-width: 768px) {
    .hcdb-process-modal .hcdb-modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .hcdb-process-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .hcdb-flow-steps {
        flex-direction: column;
        align-items: flex-start;
    }

    .hcdb-flow-arrow {
        transform: rotate(90deg);
        margin: 4px 0 4px 12px;
    }
}

@media (max-width: 480px) {
    .hcdb-process-summary {
        grid-template-columns: 1fr 1fr;
    }

    .hcdb-summary-card {
        padding: 12px;
    }

    .hcdb-summary-value {
        font-size: 16px;
    }

    .hcdb-process-modal .hcdb-modal-body {
        padding: 16px;
    }
}
