/* 拼课众筹（前台）独立样式 */

.cf-page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 16px 60px;
}

/* 头部 */
.cf-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.cf-title {
    font-size: 26px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px;
}
.cf-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}
.cf-status-text {
    color: #6366f1;
}

/* 按钮 */
.cf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .2s;
    line-height: 1.4;
}
.cf-btn-primary {
    background: #6366f1;
    color: #fff;
}
.cf-btn-primary:hover {
    background: #4f46e5;
    color: #fff;
}
.cf-btn-light {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}
.cf-btn-light:hover {
    background: #e2e8f0;
}

/* 卡片网格 */
.cf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}
.cf-card {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s, transform .2s;
}
.cf-card:hover {
    box-shadow: 0 10px 26px rgba(30, 41, 59, .1);
    transform: translateY(-2px);
    text-decoration: none;
}
.cf-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}
.cf-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}
.cf-badge-zheng {
    background: #ecfdf5;
    color: #047857;
}
.cf-badge-dao {
    background: #fef2f2;
    color: #b91c1c;
}
.cf-badge-success {
    background: #eff6ff;
    color: #1d4ed8;
}
.cf-badge-going {
    background: #fefce8;
    color: #a16207;
}
.cf-card-name {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px;
}
.cf-card-meta {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 8px;
}
.cf-card-desc {
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 进度条 */
.cf-progress {
    margin-bottom: 14px;
}
.cf-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 6px;
}
/* 填充使用原生 <progress>：进度值走 value/max 属性，
   不在 style 属性里拼接 PHP，避免模板被 CSS 语法检查误判 */
.cf-progress-bar progress {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    padding: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
}
.cf-progress-bar progress::-webkit-progress-bar {
    background: transparent;
    border-radius: 999px;
}
.cf-progress-bar progress::-webkit-progress-value {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 999px;
    transition: width .4s;
}
.cf-progress-bar progress::-moz-progress-bar {
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 999px;
}
.cf-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
}

/* 卡片底部 */
.cf-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px dashed #e2e8f0;
    padding-top: 12px;
}
.cf-price {
    font-size: 15px;
    font-weight: 600;
    color: #e11d48;
}
.cf-join {
    font-size: 13px;
    color: #6366f1;
    font-weight: 500;
}

/* 空态 */
.cf-empty {
    padding: 80px 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
}

/* 分页 */
.cf-pager {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
    flex-wrap: wrap;
}
.cf-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 14px;
    text-decoration: none;
    transition: all .2s;
}
.cf-page-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}
.cf-page-btn.is-active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

/* 详情页 */
.cf-detail {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 26px;
    width: 100%;
    box-sizing: border-box;
}
.cf-detail-head {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 18px;
    margin-bottom: 18px;
}
.cf-detail-name {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 12px 0 8px;
}
.cf-detail-meta {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}
.cf-detail-body {
    margin-bottom: 4px;
}
.cf-detail-row {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}
.cf-detail-label {
    flex-shrink: 0;
    width: 110px;
    font-size: 14px;
    color: #94a3b8;
}
.cf-detail-value {
    flex: 1;
    font-size: 14px;
    color: #1e293b;
    line-height: 1.7;
    word-break: break-all;
}
.cf-detail-foot {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    align-items: center;
}
.cf-join-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex: 1;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(99, 102, 241, .08), rgba(99, 102, 241, .02));
    border: 1px solid rgba(99, 102, 241, .20);
    border-radius: 12px;
}
.cf-join-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
}
.cf-join-price-label {
    color: #64748b;
    font-size: 13px;
}
.cf-join-price-num {
    color: #ef4444;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}
.cf-join-price-sub {
    color: #94a3b8;
    font-size: 12px;
}
.cf-btn-lg {
    padding: 12px 30px;
    font-size: 15px;
    border-radius: 10px;
}

/* 发起页 */
.cf-create {
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 26px;
    width: calc(100% + 32px);
    max-width: 1440px;
    margin: 0 -16px;
}
.cf-form-group {
    margin-bottom: 18px;
}
.cf-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 8px;
}
.cf-form-label i {
    color: #ef4444;
    font-style: normal;
}
.cf-form input[type="text"],
.cf-form input[type="number"],
.cf-form textarea,
.cf-form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    box-sizing: border-box;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.cf-form input[type="text"]:focus,
.cf-form input[type="number"]:focus,
.cf-form textarea:focus,
.cf-form select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}
.cf-form textarea {
    resize: vertical;
}
.cf-form-radios {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 6px 0;
}
.cf-form-checkboxes {
    flex-wrap: wrap;
    gap: 10px 20px;
}
.cf-form-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
}
.cf-form-radio input {
    accent-color: #6366f1;
    width: 16px;
    height: 16px;
    margin: 0;
}
/* ===== 众筹类型：单选按钮做成 tab 分段控件（视觉与 .cf-tabs 保持一致） =====
   仅作用于 .cf-type-tabs 容器，动态字段的普通单选/多选仍走上面的原生样式 */
.cf-type-tabs {
    display: flex;
    width: 100%;
    align-items: stretch;
    gap: 4px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 12px;
}
/* 两个选项等分，横排铺满整行 */
.cf-type-tabs .cf-form-radio {
    position: relative;
    display: flex;
    flex: 1 1 0;
    align-items: stretch;
    gap: 0;
    min-width: 0;
    margin: 0;
    padding: 0;
}
/* 原生 radio 视觉隐藏，但保留键盘可聚焦、可读屏 */
.cf-type-tabs .cf-form-radio input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}
.cf-type-tabs .cf-form-radio > span {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 12px;
    text-align: center;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all .2s;
}
.cf-type-tabs .cf-form-radio:hover > span {
    color: #4f46e5;
}
.cf-type-tabs .cf-form-radio input[type="radio"]:checked + span {
    background: #fff;
    color: #4f46e5;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}
.cf-type-tabs .cf-form-radio input[type="radio"]:focus-visible + span {
    outline: 2px solid #6366f1;
    outline-offset: 1px;
}
.cf-form-submit {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

/* ===== 我的众筹（独立页 /crowdfunding/mine） ===== */
.cf-mine-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    font-size: 14px;
    color: #475569;
}
.cf-mine-bar strong {
    color: #4f46e5;
    font-size: 16px;
}
.cf-mine-bar .cf-btn {
    padding: 8px 18px;
}
.cf-mine-sec {
    margin-bottom: 26px;
}
.cf-mine-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
}
.cf-mine-title::before {
    content: '';
    width: 4px;
    height: 16px;
    border-radius: 2px;
    background: #6366f1;
}
.cf-mine-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cf-mine-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    transition: border-color .2s, box-shadow .2s;
}
.cf-mine-item:hover {
    border-color: #c7d2fe;
    box-shadow: 0 8px 20px rgba(30, 41, 59, .08);
}
.cf-mine-main {
    min-width: 0;
}
.cf-mine-name {
    margin-bottom: 6px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    word-break: break-all;
}
.cf-mine-meta {
    font-size: 13px;
    line-height: 1.6;
    color: #64748b;
}
.cf-mine-side {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 8px;
}
.cf-mine-side .cf-btn {
    padding: 6px 14px;
    font-size: 13px;
}
/* 补齐状态徽标配色（待审核 / 已下架等） */
.cf-badge-wait {
    background: #f1f5f9;
    color: #475569;
}

@media (max-width: 640px) {
    .cf-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .cf-grid {
        grid-template-columns: 1fr;
    }
    /* 我的众筹：卡片改为上下堆叠，操作按钮另起一行 */
    .cf-mine-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .cf-mine-side {
        width: 100%;
    }
    .cf-detail-row {
        flex-direction: column;
        gap: 4px;
    }
    .cf-detail-label {
        width: auto;
    }
    /* 详情页底部操作：价格 / 参加众筹 / 我也要发起众筹 分三行显示 */
    .cf-detail-foot {
        flex-direction: column;
        align-items: stretch;
    }
    .cf-join-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px;
    }
    .cf-join-price {
        justify-content: center;
    }
    .cf-detail-foot .cf-btn {
        width: 100%;
        padding: 12px 16px;
    }
}

/* 下拉多选组件 */
.cf-multi-dropdown {
    position: relative;
    width: 100%;
}
.cf-multi-trigger {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 34px 9px 14px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    min-height: 44px;
    transition: border-color .2s, box-shadow .2s;
}
.cf-multi-trigger:focus,
.cf-multi-trigger:focus-within {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}
.cf-multi-placeholder {
    color: #94a3b8;
    font-size: 14px;
}
.cf-multi-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.cf-multi-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(99, 102, 241, .10);
    border-radius: 6px;
    color: #4f46e5;
    font-weight: 500;
    font-size: 13px;
    line-height: 1.6;
}
.cf-multi-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(99, 102, 241, .15);
    color: #6366f1;
    font-size: 14px;
    line-height: 1;
    font-style: normal;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.cf-multi-tag-remove:hover {
    background: #6366f1;
    color: #fff;
}
.cf-multi-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 13px;
    pointer-events: none;
    transition: transform .25s, color .25s;
}
.cf-multi-trigger:focus .cf-multi-arrow {
    color: #6366f1;
}
.cf-multi-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(30, 41, 59, .10);
    max-height: 260px;
    overflow-y: auto;
    padding: 6px 0;
}
.cf-multi-menu.is-hidden {
    display: none;
}
.cf-multi-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #1e293b;
    transition: background-color .15s;
}
.cf-multi-option:hover {
    background: rgba(99, 102, 241, .06);
}
.cf-multi-checkbox {
    display: none;
}
.cf-multi-checkmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    color: transparent;
    font-size: 12px;
    transition: all .2s;
}
.cf-multi-checkbox:checked + .cf-multi-checkmark {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}
.cf-multi-label {
    flex: 1;
    user-select: none;
}
