/* 详情页组件样式。
 *
 * .agent-price-display / .x-gift-* 逐条照抄参考站 daituai.cc 的
 * assets/user/css/item-agent-price.css（?x_gift=2），.api-cc-project-picker 两条
 * 照抄它的 assets/user/css/item-api-cc.css；末尾的 order:-1 是本项目补充：
 * 参考站的接码项目是插件注入在表单最前面，本站由 widget 渲染在表单末尾，
 * 用 flex order 把它提到最前（form.vstack 是 flex column）。
 *
 * 主题模板在 /data/themes（PVC）上，构建期改不了，所以样式文件挂在镜像的
 * 静态资源里，由 index_var() 补丁在 <head> 里引入。
 */

.agent-price-display {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: -6px 0 14px;
}

.agent-price-display[hidden] {
    display: none;
}

.agent-price-row {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-left: 2px solid var(--acg-primary);
    background: rgba(255, 255, 255, 0.35);
    color: var(--acg-text-muted);
    font-size: 13px;
    line-height: 1.4;
    user-select: text;
}

.agent-price-label,
.agent-price-value {
    white-space: nowrap;
}

.agent-price-value {
    color: #ff5c8e;
    font-weight: 700;
}

@media (max-width: 575.98px) {
    .agent-price-display {
        gap: 5px;
        margin-bottom: 12px;
    }

    .agent-price-row {
        padding: 2px 6px;
        font-size: 12px;
    }
}

.x-gift-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
}

.x-gift-check-button {
    min-width: 116px;
    min-height: 42px;
    border: 1px solid var(--acg-primary);
    border-radius: 6px;
    padding: 0 14px;
    background: var(--acg-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.x-gift-check-button i {
    margin-right: 6px;
}

.x-gift-check-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.x-gift-check-button.is-loading i {
    animation: x-gift-spin 0.9s linear infinite;
}

.x-gift-check-result {
    min-height: 20px;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
}

.x-gift-check-result.is-checking {
    color: var(--acg-text-muted);
}

.x-gift-check-result.is-success {
    color: #178f55;
}

.x-gift-check-result.is-error {
    color: #d73a49;
}

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

@media (max-width: 575.98px) {
    .x-gift-input-row {
        grid-template-columns: 1fr;
    }

    .x-gift-check-button {
        width: 100%;
    }
}

.api-cc-project-picker select {
    min-height: 42px;
}

.api-cc-project-picker option:disabled {
    color: #8a8f98;
}

/* 接码项目置顶：.vstack 是 flex column，order:-1 让它排在下单表单最前面 */
form.vstack > .api-cc-project-picker {
    order: -1;
}
