/**
 * 赞助推荐 /ads — 单列表单式页面
 * 使用 findly-ui.css 中的 --f-* 设计 token，自动适配暗色模式（.io-black-mode）
 */

/* ============================== 页面容器 ============================== */

.ads-bidding-page {
    padding-top: 36px;
    padding-bottom: 64px;
}

.ads-bidding-page .content-wrap {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
}

.ads-bidding-page .content-layout {
    float: none !important;
    width: 100% !important;
    max-width: 660px;
    margin: 0 auto !important;
}

/* ============================== 页头 ============================== */

.ads-head {
    margin: 0 0 28px;
    text-align: center;
}

.ads-head-title {
    margin: 0 0 10px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.25;
    color: var(--f-text);
}

.ads-head-desc {
    margin: 0 auto;
    max-width: 560px;
    font-size: 13.5px;
    line-height: 1.75;
    color: var(--f-text-3);
}

/* ============================== 表单卡片 ============================== */

.ads-card {
    padding: 32px 36px;
    background: var(--f-surface);
    border: 1px solid var(--f-border);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    margin-bottom: 44px;
}

@media (max-width: 619px) {
    .ads-card {
        padding: 22px 18px;
        border-radius: 12px;
    }
}

.ads-empty {
    padding: 56px 20px;
    text-align: center;
    font-size: 13.5px;
    color: var(--f-text-3);
}

/* 表单字段 */

.ads-field {
    margin-bottom: 18px;
}

.ads-field > label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--f-text);
}

.ads-field-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 7px;
}

.ads-field-head > label {
    margin-bottom: 0;
}

.ads-submit-link {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--f-text-3);
    text-decoration: none;
    transition: color 0.15s ease;
}

.ads-submit-link:hover {
    color: var(--f-text);
    text-decoration: underline;
}

.ads-req {
    color: #e5484d;
    margin-left: 1px;
}

.ads-opt {
    font-weight: 400;
    font-size: 11.5px;
    color: var(--f-text-3);
    margin-left: 2px;
}

.ads-input {
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--f-text);
    background: var(--f-surface);
    border: 1px solid var(--f-border-strong);
    border-radius: 9px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ads-input::placeholder {
    color: var(--f-text-3);
}

.ads-input:focus {
    border-color: var(--f-text-3);
    box-shadow: 0 0 0 3px var(--f-muted-fill);
}

/* ============================== 站内搜索选择器 ============================== */

.ads-search {
    position: relative;
}

.ads-search-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    max-height: 320px;
    overflow-y: auto;
    padding: 5px;
    background: var(--f-surface);
    border: 1px solid var(--f-border);
    border-radius: 11px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
    animation: adsMenuIn 0.15s ease;
}

.io-black-mode .ads-search-menu {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

.ads-search-menu[hidden] {
    display: none;
}

.ads-search-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s ease;
}

.ads-search-option:hover {
    background: var(--f-muted-fill);
}

.ads-search-option img {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    object-fit: contain;
    background: var(--f-icon-bg);
    border: 1px solid var(--f-border);
}

.ads-search-option-txt {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ads-search-option-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--f-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ads-search-option-url {
    font-size: 11px;
    color: var(--f-text-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ads-search-empty {
    padding: 18px 12px;
    text-align: center;
    font-size: 12.5px;
    color: var(--f-text-3);
}

/* ============================== 替换预览 ============================== */

.ads-swap {
    margin: -4px 0 18px;
    padding: 14px;
    background: var(--f-muted-fill);
    border-radius: 10px;
}

.ads-swap-placeholder {
    padding: 8px 4px;
    text-align: center;
    font-size: 12px;
    color: var(--f-text-3);
}

.ads-swap-placeholder[hidden] {
    display: none;
}

.ads-swap-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.ads-swap-row[hidden] {
    display: none;
}

.ads-swap-side {
    flex: 1 1 0;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 10px;
    background: var(--f-surface);
    border: 1px solid var(--f-border);
    border-radius: 10px;
    min-width: 0;
}

.ads-swap-side img {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    object-fit: contain;
    background: var(--f-icon-bg);
    border: 1px solid var(--f-border);
}

.ads-swap-name {
    max-width: 100%;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--f-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ads-swap-label {
    font-size: 10.5px;
    color: var(--f-text-3);
}

.ads-swap-side--new {
    border-color: var(--f-border-strong);
    box-shadow: 0 0 0 3px var(--f-muted-fill);
}

.ads-swap-arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--f-text-3);
}

/* ============================== 位置下拉选择器 ============================== */

.ads-select {
    position: relative;
}

.ads-select-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    padding: 6px 12px;
    background: var(--f-surface);
    border: 1px solid var(--f-border-strong);
    border-radius: 9px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ads-select-trigger:hover {
    border-color: var(--f-text-3);
}

.ads-select.is-open .ads-select-trigger {
    border-color: var(--f-text-3);
    box-shadow: 0 0 0 3px var(--f-muted-fill);
}

.ads-select-value {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--f-text);
}

.ads-select-value.is-placeholder {
    font-weight: 400;
    color: var(--f-text-3);
}

.ads-select-value img {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    object-fit: contain;
    background: var(--f-icon-bg);
}

.ads-select-value .ads-select-value-status {
    font-size: 11.5px;
    font-weight: 400;
    color: var(--f-text-3);
    white-space: nowrap;
}

.ads-select-arrow {
    flex-shrink: 0;
    color: var(--f-text-3);
    transition: transform 0.18s ease;
}

.ads-select.is-open .ads-select-arrow {
    transform: rotate(180deg);
}

.ads-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px;
    background: var(--f-surface);
    border: 1px solid var(--f-border);
    border-radius: 11px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
    animation: adsMenuIn 0.15s ease;
}

.io-black-mode .ads-select-menu {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

.ads-select-menu[hidden] {
    display: none;
}

@keyframes adsMenuIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.ads-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s ease;
}

.ads-select-option:hover {
    background: var(--f-muted-fill);
}

.ads-select-option.is-selected {
    background: var(--f-muted-fill);
}

.ads-select-option.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ads-select-option.is-disabled:hover {
    background: transparent;
}

.ads-select-option-ico {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    object-fit: contain;
    background: var(--f-icon-bg);
    border: 1px solid var(--f-border);
}

.ads-select-option-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--f-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ads-select-option-status {
    flex-shrink: 0;
    font-size: 11.5px;
    color: var(--f-text-3);
    white-space: nowrap;
}

.ads-select-option-status.is-free {
    color: #10b981;
    font-weight: 600;
}

.ads-select-option-status.is-queue {
    color: #f59e0b;
    font-weight: 500;
}

.ads-select-option-status.is-muted {
    color: var(--f-text-3);
}

/* 排队提示 */

.ads-queue-tip {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 9px 11px;
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: var(--f-text-2);
    background: var(--f-muted-fill);
    border-radius: 8px;
}

.ads-queue-tip[hidden] {
    display: none;
}

.ads-queue-tip .iconfont {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 12px;
    color: var(--f-text-3);
}

.ads-queue-tip b {
    color: var(--f-text);
}

/* ============================== 时长套餐 ============================== */

.ads-plans {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

@media (max-width: 559px) {
    .ads-plans {
        grid-template-columns: 1fr;
    }
}

.ads-plan {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    background: var(--f-surface);
    border: 1px solid var(--f-border-strong);
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.ads-plan:hover {
    border-color: var(--f-text-3);
}

.ads-plan.active {
    background: var(--f-black);
    border-color: var(--f-black);
    color: var(--f-on-black);
}

.ads-plan-time {
    font-size: 13px;
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
}

.ads-plan:not(.active) .ads-plan-time {
    color: var(--f-text);
}

.ads-plan-price {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: inherit;
    white-space: nowrap;
}

.ads-plan:not(.active) .ads-plan-price {
    color: var(--f-text);
}

.ads-plan.active .ads-plan-price {
    color: var(--f-on-black);
}

.ads-plan-tag {
    position: absolute;
    top: -8px;
    right: 10px;
    padding: 1px 8px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.6;
    color: #fff;
    background: var(--f-black);
    border-radius: 999px;
    white-space: nowrap;
}

.ads-plan.active .ads-plan-tag {
    background: var(--f-purple);
}

/* ============================== 金额 + 支付 ============================== */

.ads-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 13px 16px;
    margin: 20px 0 16px;
    background: var(--f-muted-fill);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--f-text-2);
}

.ads-total b {
    font-size: 14px;
    font-weight: 600;
    color: var(--f-text);
}

.ads-total b em {
    font-style: normal;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-left: 2px;
}

/* 支付区域收敛（iopay_get_pay_input 输出结构） */

.ads-bid-form .dependency-box {
    margin-top: 0;
}

.ads-bid-form .dependency-box > .d-flex {
    gap: 8px;
    margin-bottom: 12px;
}

.ads-bid-form .dependency-box .io-radio[data-for="pay_method"] {
    padding: 8px 10px;
    background: var(--f-surface);
    border: 1px solid var(--f-border-strong);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.ads-bid-form .dependency-box .io-radio[data-for="pay_method"]:hover {
    border-color: var(--f-text-3);
}

.ads-bid-form .dependency-box .io-radio[data-for="pay_method"].active {
    border-color: var(--f-text);
    background: var(--f-muted-fill);
}

.ads-bid-form .dependency-box .io-radio[data-for="pay_method"] img {
    height: 24px;
    width: auto;
}

.ads-bid-form .dependency-box {
    text-align: center;
}

.ads-bid-form .initiate-pay {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: auto;
    padding: 9px 36px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff !important;
    background: #07c160 !important;
    border: none;
    border-radius: 8px;
    box-shadow: none;
    cursor: pointer;
    transition: background 0.18s ease;
}

.ads-bid-form .initiate-pay:hover,
.ads-bid-form .initiate-pay:focus {
    background: #06ad56 !important;
    color: #fff !important;
}

.ads-bid-form .initiate-pay .ads-pay-ico {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

/* ============================== 广告位示例 ============================== */

.ads-section {
    margin-bottom: 44px;
}

.ads-section-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--f-text);
}

.ads-section-desc {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--f-text-3);
}

.ads-example-frame {
    border: 1px solid var(--f-border);
    border-radius: 14px;
    overflow: hidden;
    background: var(--f-muted-fill);
}

.ads-example-frame img {
    display: block;
    width: 100%;
    height: auto;
}

/* ============================== 常见问题 ============================== */

.ads-faq {
    margin: 0;
    padding: 0;
}

/* ============================== 支付成功感谢弹窗 ============================== */

.ads-thanks-mask {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    animation: adsThanksFadeIn 0.25s ease;
}

.ads-thanks-card {
    width: min(360px, calc(100vw - 48px));
    padding: 36px 30px 28px;
    background: var(--f-surface, #fff);
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: adsThanksPopIn 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.ads-thanks-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: #07c160;
    border-radius: 50%;
}

.ads-thanks-card h3 {
    margin-bottom: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--f-text, #171717);
}

.ads-thanks-card p {
    margin-bottom: 22px;
    font-size: 13px;
    line-height: 1.9;
    color: var(--f-text-3, #8a8a8a);
}

.ads-thanks-btn {
    padding: 9px 42px;
    font-size: 14px;
    font-weight: 600;
    color: var(--f-on-black, #fff);
    background: var(--f-black, #171717);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.18s ease;
}

.ads-thanks-btn:hover {
    background: var(--f-black-hover, #000);
}

.ads-thanks-confetti {
    position: fixed;
    inset: 0;
    z-index: 99991;
    pointer-events: none;
}

@keyframes adsThanksFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes adsThanksPopIn {
    from { opacity: 0; transform: scale(0.85) translateY(14px); }
    to { opacity: 1; transform: none; }
}
