/**
 * 施工工艺展示样式
 */

/* 查询区 */
.hcdb-process-search {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px;
    border-radius: 16px;
    color: #fff;
    text-align: center;
    margin-bottom: 30px;
}

.hcdb-process-search h2 {
    margin: 0 0 20px;
    font-size: 28px;
}

.hcdb-process-search .hcdb-search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto 15px;
    gap: 10px;
}

.hcdb-process-search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
}

.hcdb-process-search-btn {
    padding: 15px 30px;
    background: #fff;
    color: #667eea;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.hcdb-search-tips {
    font-size: 14px;
    opacity: 0.9;
}

.hcdb-hot-search {
    color: #fff;
    text-decoration: underline;
    margin: 0 8px;
    cursor: pointer;
}

/* 主容器 */
.hcdb-process-container {
    max-width: 1000px;
    margin: 0 auto;
}

/* 清单头部 */
.hcdb-process-header {
    background: #fff;
    border-radius: 12px;
    padding: 25px 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

.hcdb-bill-code {
    display: inline-block;
    background: #e0e7ff;
    color: #4f46e5;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-family: monospace;
    margin-bottom: 10px;
}

.hcdb-bill-name {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #1f2937;
}

.hcdb-bill-meta {
    display: flex;
    gap: 20px;
    color: #6b7280;
    font-size: 14px;
}

.hcdb-bill-feature {
    margin-top: 15px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    font-size: 14px;
    color: #4b5563;
}

/* 费用概览 */
.hcdb-cost-overview {
    background: #fff;
    border-radius: 12px;
    padding: 25px 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 25px;
}

.hcdb-cost-overview h3 {
    margin: 0 0 20px;
    font-size: 18px;
    color: #1f2937;
}

.hcdb-cost-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

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

.hcdb-cost-card {
    background: #f9fafb;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.hcdb-cost-card.hcdb-cost-total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.hcdb-cost-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.hcdb-cost-total .hcdb-cost-label {
    color: rgba(255,255,255,0.8);
}

.hcdb-cost-value {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.hcdb-cost-total .hcdb-cost-value {
    color: #fff;
}

.hcdb-cost-percent {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 5px;
}

/* 饼图 */
.hcdb-cost-chart {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.hcdb-pie-chart {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    position: relative;
}

.hcdb-chart-legend {
    flex: 1;
}

.hcdb-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 14px;
}

.hcdb-legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.hcdb-legend-color.labor { background: #3b82f6; }
.hcdb-legend-color.material { background: #10b981; }
.hcdb-legend-color.machinery { background: #f59e0b; }

/* 施工步骤 */
.hcdb-steps-section {
    margin-bottom: 25px;
}

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

.hcdb-steps-header h3 {
    margin: 0;
    font-size: 18px;
    color: #1f2937;
}

.hcdb-steps-count {
    background: #e0e7ff;
    color: #4f46e5;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
}

/* 步骤卡片 */
.hcdb-step-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s;
}

.hcdb-step-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.hcdb-step-header {
    display: flex;
    align-items: center;
    padding: 20px 25px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}

.hcdb-step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 15px;
    flex-shrink: 0;
}

.hcdb-step-info {
    flex: 1;
}

.hcdb-step-name {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 5px;
}

.hcdb-step-code {
    font-size: 12px;
    color: #9ca3af;
    font-family: monospace;
}

.hcdb-step-cost {
    text-align: right;
}

.hcdb-step-cost-value {
    font-size: 18px;
    font-weight: 600;
    color: #ef4444;
}

.hcdb-step-cost-label {
    font-size: 12px;
    color: #9ca3af;
}

.hcdb-step-toggle {
    width: 30px;
    height: 30px;
    margin-left: 15px;
    color: #9ca3af;
    transition: transform 0.3s;
}

.hcdb-step-card.expanded .hcdb-step-toggle {
    transform: rotate(180deg);
}

/* 步骤详情 */
.hcdb-step-body {
    display: none;
    padding: 25px;
    background: #fafafa;
}

.hcdb-step-card.expanded .hcdb-step-body {
    display: block;
}

/* 工艺描述 */
.hcdb-process-desc {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

.hcdb-process-desc h4 {
    margin: 0 0 10px;
    font-size: 15px;
    color: #4f46e5;
}

.hcdb-process-desc p {
    margin: 0;
    line-height: 1.8;
    color: #4b5563;
}

/* 技术要求 */
.hcdb-tech-requirements {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.hcdb-tech-requirements h4 {
    margin: 0 0 15px;
    font-size: 15px;
    color: #1f2937;
}

.hcdb-tech-requirements ul {
    margin: 0;
    padding-left: 20px;
}

.hcdb-tech-requirements li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #4b5563;
}

/* 人材机明细 */
.hcdb-resource-section {
    margin-bottom: 20px;
}

.hcdb-resource-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
}

.hcdb-resource-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.hcdb-resource-icon.labor { background: #dbeafe; }
.hcdb-resource-icon.material { background: #d1fae5; }
.hcdb-resource-icon.machinery { background: #fef3c7; }

.hcdb-resource-table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.hcdb-resource-table th,
.hcdb-resource-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
}

.hcdb-resource-table th {
    background: #f9fafb;
    font-weight: 500;
    color: #6b7280;
}

.hcdb-resource-table .text-right {
    text-align: right;
}

.hcdb-resource-table .subtotal {
    color: #ef4444;
    font-weight: 500;
}

.hcdb-resource-table tfoot td {
    background: #f0fdf4;
    font-weight: 600;
}

.hcdb-main-material {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-left: 8px;
}

/* 多媒体资源 */
.hcdb-media-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.hcdb-media-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
}

.hcdb-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.hcdb-media-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.hcdb-media-item:hover {
    transform: translateY(-3px);
}

.hcdb-media-thumb {
    width: 100%;
    height: 120px;
    object-fit: cover;
    background: #f3f4f6;
}

.hcdb-media-info {
    padding: 12px;
}

.hcdb-media-type {
    font-size: 11px;
    color: #fff;
    background: #4f46e5;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 5px;
}

.hcdb-media-type.video { background: #ef4444; }
.hcdb-media-type.document { background: #10b981; }

.hcdb-media-name {
    font-size: 13px;
    color: #1f2937;
    line-height: 1.4;
}

/* 规范标准 */
.hcdb-standards-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.hcdb-standard-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 10px;
}

.hcdb-standard-icon {
    width: 24px;
    height: 24px;
    background: #e0e7ff;
    color: #4f46e5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.hcdb-standard-info {
    flex: 1;
}

.hcdb-standard-name {
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 4px;
}

.hcdb-standard-clause {
    font-size: 12px;
    color: #6b7280;
}

/* 质量安全提示 */
.hcdb-tips-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

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

.hcdb-tips-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
}

.hcdb-tips-card.quality {
    border-left: 4px solid #10b981;
}

.hcdb-tips-card.safety {
    border-left: 4px solid #ef4444;
}

.hcdb-tips-card h5 {
    margin: 0 0 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hcdb-tips-card.quality h5 { color: #10b981; }
.hcdb-tips-card.safety h5 { color: #ef4444; }

.hcdb-tips-card p {
    margin: 0;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.6;
}

/* 加载动画 */
.hcdb-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* 展开/收起按钮 */
.hcdb-expand-all {
    background: none;
    border: 1px solid #d1d5db;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    color: #4b5563;
}

.hcdb-expand-all:hover {
    background: #f9fafb;
}

/* ========================================
   管理员工具区
   ======================================== */
.hcdb-process-admin-tools {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
}

.hcdb-admin-tools-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-bottom: 1px solid #fcd34d;
}

.hcdb-admin-tools-header h3 {
    margin: 0;
    font-size: 16px;
    color: #92400e;
}

.hcdb-admin-tools-body {
    padding: 20px;
}

/* 统计区 */
.hcdb-process-stats {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 20px;
}

.hcdb-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    border-right: 1px solid #e2e8f0;
}

.hcdb-stat-item:last-of-type {
    border-right: none;
}

.hcdb-stat-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.hcdb-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

/* 导入区 */
.hcdb-process-import-section,
.hcdb-process-generate-section {
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 16px;
}

.hcdb-process-import-section h4,
.hcdb-process-generate-section h4 {
    margin: 0 0 8px 0;
    font-size: 15px;
    color: #334155;
}

.hcdb-import-tip {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 12px 0;
}

.hcdb-import-actions,
.hcdb-generate-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.hcdb-import-actions select,
.hcdb-generate-actions select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

/* 进度条 */
.hcdb-import-progress {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hcdb-progress-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.hcdb-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    width: 30%;
    animation: progress-animate 1.5s ease-in-out infinite;
}

@keyframes progress-animate {
    0% { width: 10%; }
    50% { width: 70%; }
    100% { width: 10%; }
}

.hcdb-progress-text {
    font-size: 13px;
    color: #64748b;
}

/* 结果提示 */
.hcdb-import-result,
.hcdb-generate-result {
    margin-top: 12px;
}

.hcdb-import-result .hcdb-success,
.hcdb-generate-result .hcdb-success {
    padding: 10px 14px;
    background: #dcfce7;
    color: #166534;
    border-radius: 6px;
    font-size: 14px;
}

.hcdb-import-result .hcdb-warning,
.hcdb-generate-result .hcdb-warning {
    padding: 10px 14px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 8px;
}

.hcdb-import-result .hcdb-error,
.hcdb-generate-result .hcdb-error {
    padding: 10px 14px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 6px;
    font-size: 14px;
}

/* 响应式 */
@media (max-width: 768px) {
    .hcdb-process-stats {
        flex-wrap: wrap;
    }

    .hcdb-stat-item {
        flex: 1;
        min-width: 80px;
        padding: 10px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .hcdb-import-actions,
    .hcdb-generate-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hcdb-import-actions .hcdb-btn,
    .hcdb-generate-actions .hcdb-btn {
        width: 100%;
        text-align: center;
    }
}
