/* 行业扩展包中心 / 包工作台（2026-11-07） */

/* ---------- 包卡片 ---------- */
.pack-card {
    background: #fff;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    transition: box-shadow .15s ease, transform .15s ease;
}
.dark .pack-card {
    background: #161616;
    border-color: rgb(255 255 255 / 0.08);
}
.pack-card:hover {
    box-shadow: 0 6px 18px rgb(0 0 0 / 0.08);
    transform: translateY(-1px);
}
.pack-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.pack-card-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.pack-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(30 41 59);
}
.dark .pack-card-title { color: rgb(226 232 240); }
.pack-card-desc {
    font-size: 0.72rem;
    color: rgb(100 116 139);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.dark .pack-card-desc { color: rgb(148 163 184); }

.pack-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.625rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
    white-space: nowrap;
}
.pack-badge-green { background: rgb(16 185 129 / 0.12); color: rgb(5 150 105); }
.pack-badge-gray  { background: rgb(148 163 184 / 0.15); color: rgb(100 116 139); }
.pack-badge-amber { background: rgb(245 158 11 / 0.12); color: rgb(180 83 9); }
.pack-badge-blue  { background: rgb(59 130 246 / 0.12); color: rgb(37 99 235); }

.pack-card-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-top: 1px dashed rgb(226 232 240);
    border-bottom: 1px dashed rgb(226 232 240);
}
.dark .pack-card-stats { border-color: rgb(255 255 255 / 0.08); }
.pack-stat { text-align: center; }
.pack-stat-num {
    font-size: 0.95rem;
    font-weight: 700;
    color: rgb(30 41 59);
}
.dark .pack-stat-num { color: rgb(226 232 240); }
.pack-stat-label {
    font-size: 0.625rem;
    color: rgb(148 163 184);
}

.pack-card-sku {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.pack-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}
.pack-btn {
    flex: 1;
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.72rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all .15s ease;
}
.pack-btn-primary {
    background: var(--primary-500, #6366f1);
    color: #fff;
}
.pack-btn-primary:hover { background: var(--primary-600, #4f46e5); }
.pack-btn-ghost {
    border: 1px solid rgb(226 232 240);
    color: rgb(71 85 105);
}
.dark .pack-btn-ghost {
    border-color: rgb(255 255 255 / 0.1);
    color: rgb(203 213 225);
}
.pack-btn-ghost:hover { background: rgb(241 245 249); }
.dark .pack-btn-ghost:hover { background: rgb(255 255 255 / 0.05); }

/* ---------- 工作台 TAB ---------- */
.pack-tab-btn {
    padding: 0.5rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: rgb(100 116 139);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: pointer;
    transition: all .15s ease;
}
.dark .pack-tab-btn { color: rgb(148 163 184); }
.pack-tab-btn:hover { color: rgb(51 65 85); }
.dark .pack-tab-btn:hover { color: rgb(226 232 240); }
.pack-tab-btn.active {
    color: var(--primary-600, #4f46e5);
    border-bottom-color: var(--primary-500, #6366f1);
}
.dark .pack-tab-btn.active { color: rgb(165 180 252); }

/* ---------- 工作台面板通用件 ---------- */
.pack-panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}
.pack-kpi-card {
    background: #fff;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.75rem;
    padding: 0.85rem;
}
.dark .pack-kpi-card {
    background: #161616;
    border-color: rgb(255 255 255 / 0.08);
}
.pack-kpi-num {
    font-size: 1.35rem;
    font-weight: 700;
    color: rgb(30 41 59);
}
.dark .pack-kpi-num { color: rgb(226 232 240); }
.pack-kpi-label {
    font-size: 0.68rem;
    color: rgb(100 116 139);
    margin-top: 0.15rem;
}
.pack-section {
    background: #fff;
    border: 1px solid rgb(226 232 240);
    border-radius: 0.75rem;
    margin-bottom: 0.85rem;
    overflow: hidden;
}
.dark .pack-section {
    background: #161616;
    border-color: rgb(255 255 255 / 0.08);
}
.pack-section-head {
    padding: 0.65rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgb(51 65 85);
    border-bottom: 1px solid rgb(241 245 249);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dark .pack-section-head {
    color: rgb(203 213 225);
    border-color: rgb(255 255 255 / 0.06);
}
.pack-section-body { padding: 0.75rem 0.9rem; }
.pack-table {
    width: 100%;
    font-size: 0.72rem;
    border-collapse: collapse;
}
.pack-table th {
    text-align: left;
    padding: 0.4rem 0.5rem;
    color: rgb(100 116 139);
    font-weight: 500;
    border-bottom: 1px solid rgb(226 232 240);
    white-space: nowrap;
}
.dark .pack-table th { border-color: rgb(255 255 255 / 0.08); color: rgb(148 163 184); }
.pack-table td {
    padding: 0.4rem 0.5rem;
    color: rgb(51 65 85);
    border-bottom: 1px solid rgb(241 245 249);
}
.dark .pack-table td { border-color: rgb(255 255 255 / 0.05); color: rgb(203 213 225); }

.pack-contract-ok   { color: rgb(5 150 105); }
.pack-contract-miss { color: rgb(220 38 38); }
.pack-contract-warn { color: rgb(180 83 9); }

.pack-empty-hint {
    text-align: center;
    color: rgb(148 163 184);
    font-size: 0.75rem;
    padding: 2rem 0;
}

/* ============ Pack Builder 向导（2026-11-09） ============ */
.pack-builder-input {
    width: 100%;
    padding: 2px 6px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    color: inherit;
}
.pack-builder-input:hover { border-color: rgba(148, 163, 184, 0.4); }
.pack-builder-input:focus {
    border-color: #6366f1;
    outline: none;
    background: rgba(99, 102, 241, 0.05);
}
.pack-builder-del {
    color: #94a3b8;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 12px;
}
.pack-builder-del:hover { color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.pack-builder-dryrun {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.35);
    white-space: nowrap;
}
.pack-builder-dryrun:hover { background: rgba(99, 102, 241, 0.08); }
.pack-builder-dryrun:disabled { opacity: 0.5; }
.pack-builder-dryrun-out { font-size: 11px; margin-left: 4px; word-break: break-all; }

/* ============ R3 交付回路（Delivery Loop, 2026-11-21） ============ */
.dl-progress {
    height: 6px;
    border-radius: 9999px;
    background: rgba(148, 163, 184, .25);
    overflow: hidden;
}
.dl-progress-bar {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #06b6d4, #2563eb);
    transition: width .3s ease;
}
.dl-stage-dot {
    width: 10px;
    height: 10px;
    border-radius: 9999px;
    background: rgba(148, 163, 184, .35);
    display: inline-block;
}
.dl-stage-dot.dl-dot-part { background: #f59e0b; }
.dl-stage-dot.dl-dot-full { background: #10b981; }
.dl-check-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .25rem;
    border-bottom: 1px dashed rgba(148, 163, 184, .18);
    cursor: pointer;
}
.dl-check-row:last-child { border-bottom: none; }
.dl-check-row input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #2563eb;
    cursor: pointer;
}
.dl-check-row input[type="checkbox"]:disabled { cursor: not-allowed; }
.dl-check-label { font-size: 12.5px; color: #475569; }
.dark .dl-check-label { color: #cbd5e1; }
.dl-check-row input:checked + .dl-check-label {
    color: #94a3b8;
    text-decoration: line-through;
}
/* 成果卡 markdown 渲染 */
.dl-markdown .dl-md-h {
    font-weight: 700;
    color: #1e293b;
    margin: .9rem 0 .4rem;
}
.dark .dl-markdown .dl-md-h { color: #e2e8f0; }
.dl-markdown h2.dl-md-h { font-size: 15px; border-bottom: 1px solid rgba(148,163,184,.25); padding-bottom: .25rem; }
.dl-markdown h3.dl-md-h { font-size: 13.5px; }
.dl-markdown h4.dl-md-h, .dl-markdown h5.dl-md-h { font-size: 12.5px; }
.dl-markdown .dl-md-p { font-size: 12.5px; line-height: 1.7; margin: .25rem 0; }
.dl-markdown .dl-md-ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin: .25rem 0;
    font-size: 12.5px;
    line-height: 1.7;
}
.dl-markdown .dl-md-quote {
    border-left: 3px solid #06b6d4;
    padding: .25rem .75rem;
    margin: .4rem 0;
    color: #64748b;
    background: rgba(6, 182, 212, .06);
    border-radius: 0 .5rem .5rem 0;
    font-size: 12.5px;
}
.dark .dl-markdown .dl-md-quote { color: #94a3b8; }
.dl-markdown code {
    background: rgba(148, 163, 184, .15);
    border-radius: .25rem;
    padding: 0 .3rem;
    font-size: 11.5px;
}
