/* ============================================================
   hero-demo.css — 首页 Hero 动态演示面板样式 (hd-*)
   ============================================================ */

/* ── Hero 两栏布局（覆盖默认 padding） ── */
.db-hero--split {
    padding: var(--spacing-xl) var(--spacing-xl) !important;
}

.db-hero--split .db-hero-content {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: var(--spacing-2xl);
    align-items: center;
    text-align: left;
    max-width: 1100px;
    margin: 0 auto;
}

.db-hero--split .db-hero-left {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.db-hero--split .db-hero-title {
    font-size: 2.2rem;
    text-align: left;
}

.db-hero--split .db-hero-sub {
    text-align: left;
    margin-bottom: 0;
}

.db-hero--split .db-hero-actions {
    justify-content: flex-start;
    margin-top: 0;
}

.db-hero--split .db-hero-stats {
    justify-content: flex-start;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-sm);
}

/* ── 演示面板容器（玻璃拟态） ── */
.hd-panel {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255,255,255,0.15);
    overflow: hidden;
    position: relative;
    color: rgba(255, 255, 255, 0.92);
    min-height: 340px;
    display: flex;
    flex-direction: column;
}

/* ── 标签栏 ── */
.hd-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.18);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0 var(--spacing-sm);
    gap: 2px;
    flex-shrink: 0;
}

.hd-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 9px 12px;
    border: none;
    background: transparent;
    font-size: 0.76rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: var(--font-sans);
}

.hd-tab:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.06);
}

.hd-tab.active {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.8);
    background: transparent;
}

.hd-tab i {
    font-size: 0.9rem;
}

/* ── 进度条 ── */
.hd-progress {
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    overflow: hidden;
}

.hd-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.6), rgba(255,255,255,0.9));
    width: 0%;
    transition: width linear;
    transform-origin: left;
}

/* ── 场景容器 ── */
.hd-scenes {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.hd-scene {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md) var(--spacing-lg);
    gap: var(--spacing-sm);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.hd-scene.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    position: relative;
}

/* ── 表单区 ── */
.hd-form-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hd-form-area.hide {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    position: absolute;
}

.hd-scene-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

/* ── 字段行 ── */
.hd-field {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-md);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.hd-field.active {
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.12);
}

.hd-field-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    flex-shrink: 0;
    min-width: 56px;
}

.hd-field-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 1px;
    min-height: 20px;
}

.hd-cursor::after {
    content: '|';
    animation: hdBlink 0.7s step-end infinite;
    opacity: 1;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
    margin-left: 1px;
}

.hd-cursor.done::after {
    display: none;
}

@keyframes hdBlink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

/* ── 表格型输入（商品结构） ── */
.hd-mini-table {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-md);
    overflow: hidden;
    font-size: 0.78rem;
}

.hd-table-head {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr;
    background: rgba(0, 0, 0, 0.2);
    padding: 5px 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.72rem;
}

.hd-table-row {
    display: grid;
    grid-template-columns: 2fr 1.2fr 1.2fr;
    padding: 5px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hd-table-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.04);
}

.hd-table-row span:first-child {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
}

.hd-table-row span:nth-child(2) {
    color: rgba(255, 255, 255, 0.7);
}

.hd-table-row span:last-child {
    font-weight: 600;
    color: #6ee7b7;
}

/* ── 竞品列表 ── */
.hd-comp-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hd-comp-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hd-comp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── 执行按钮 ── */
.hd-run-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: var(--radius-md);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    margin-top: 4px;
}

.hd-run-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
}

.hd-run-btn.clicking {
    transform: scale(0.96);
    background: rgba(237, 137, 54, 0.7);
    border-color: rgba(237, 137, 54, 0.9);
}

/* ── 图表区 ── */
.hd-chart-area {
    flex: 1;
    min-height: 200px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.hd-chart-area.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── 图表标题栏 ── */
.hd-chart-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
    padding: 0 2px;
}

.hd-chart-header i {
    color: rgba(255, 255, 255, 0.55);
}

/* ── 结果 KPI 条（净利润计算器） ── */
.hd-kpi-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.hd-kpi {
    flex: 1;
    background: #f0f9f4;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-md);
    padding: 6px 10px;
    text-align: center;
}

.hd-kpi.warn {
    background: #fff7ed;
    border-color: #fed7aa;
}

.hd-kpi-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: #059669;
    display: block;
}

.hd-kpi.warn .hd-kpi-val {
    color: #d97706;
}

.hd-kpi-lbl {
    font-size: 0.68rem;
    color: var(--text-muted);
}

/* ── 响应式 ── */
@media (max-width: 900px) {
    .db-hero--split .db-hero-content {
        grid-template-columns: 1fr;
    }

    .db-hero--split .db-hero-title {
        font-size: 1.85rem;
        text-align: center;
    }

    .db-hero--split .db-hero-sub {
        text-align: center;
    }

    .db-hero--split .db-hero-actions {
        justify-content: center;
    }

    .db-hero--split .db-hero-stats {
        justify-content: center;
    }

    .hd-panel {
        display: none;
    }
}

@media (max-width: 480px) {
    .db-hero--split .db-hero-title {
        font-size: 1.65rem;
    }
}
