/* ============================================================
   报名功能（前台）
   帖子卡片上的「报名中」角标 + 帖子详情里的报名条 + 填 QQ 的报名弹窗
   与 admin/signup-api.php 配套
   ============================================================ */

/* ---------- 帖子卡片角标 ---------- */
.post-signup-flag {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background: rgba(107, 203, 119, 0.9);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.18s ease, background 0.18s ease;
}
.post-signup-flag:hover,
.post-signup-flag:focus-visible {
    background: rgba(107, 203, 119, 1);
    transform: translateY(-1px);
    outline: none;
}
.post-signup-flag:focus-visible {
    box-shadow: 0 0 0 2px rgba(107, 203, 119, 0.45), 0 3px 12px rgba(0, 0, 0, 0.3);
}
.post-signup-flag svg {
    width: 12px;
    height: 12px;
}

/* ---------- 帖子详情里的报名条 ---------- */
.sg-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0 0 18px 0;
    padding: 13px 15px;
    border-radius: 14px;
    border: 1px solid rgba(107, 203, 119, 0.35);
    background: linear-gradient(135deg, rgba(107, 203, 119, 0.16), rgba(107, 203, 119, 0.06));
}
.sg-cta-left {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}
.sg-cta-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(107, 203, 119, 0.22);
    color: #9be2a4;
}
.sg-cta-icon svg {
    width: 19px;
    height: 19px;
}
.sg-cta-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.sg-cta-text strong {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.94);
}
.sg-cta-text span {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.66);
}
.sg-cta-btn {
    flex: 0 0 auto;
    padding: 9px 22px;
    border: none;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: #10331a;
    background: linear-gradient(135deg, #8ee89b, #5ec26d);
    box-shadow: 0 4px 14px rgba(107, 203, 119, 0.28);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.sg-cta-btn:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 18px rgba(107, 203, 119, 0.38);
}
.sg-cta-btn:active { transform: scale(.97); }

/* ---------- 报名弹窗 ---------- */
.sg-modal {
    position: fixed;
    inset: 0;
    z-index: 10001; /* 必须高于帖子灯箱(9999)与图片预览 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}
.sg-modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.sg-modal-card {
    width: min(430px, 100%);
    padding: 20px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(20, 20, 24, 0.94);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    transform: translateY(14px) scale(.98);
    opacity: 0;
    transition: transform .2s ease, opacity .2s ease;
}
.sg-modal.show .sg-modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.sg-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}
.sg-modal-head h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
}
.sg-modal-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease;
}
.sg-modal-close:hover { background: rgba(255, 255, 255, 0.13); }
.sg-modal-post {
    margin: 0 0 16px 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.55);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sg-modal-post:empty { display: none; }
.sg-modal-label {
    display: block;
    margin-bottom: 7px;
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.78);
}
/* 第二个字段（B 站 ID）的标签跟上一组输入框拉开距离 */
.sg-modal-label ~ .sg-modal-label { margin-top: 14px; }
.sg-modal-input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 13px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.95);
    font-size: 15px;
    font-family: inherit;
    letter-spacing: 1px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.sg-modal-input::placeholder {
    color: rgba(255, 255, 255, 0.32);
    letter-spacing: 0;
}
.sg-modal-input:focus {
    border-color: rgba(107, 203, 119, 0.6);
    box-shadow: 0 0 0 3px rgba(107, 203, 119, 0.15);
}
.sg-modal-hint {
    margin: 8px 0 0 0;
    font-size: 11.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.45);
}
.sg-modal-msg {
    margin: 12px 0 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    min-height: 0;
}
.sg-modal-msg:empty { display: none; }
.sg-modal-msg.is-ok { color: #9be2a4; }
.sg-modal-msg.is-err { color: #ff8f8f; }
.sg-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.sg-modal-submit,
.sg-modal-cancel {
    flex: 1;
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease, background .15s ease;
}
.sg-modal-submit {
    border: none;
    color: #10331a;
    background: linear-gradient(135deg, #8ee89b, #5ec26d);
}
.sg-modal-submit:hover:not(:disabled) { filter: brightness(1.06); }
.sg-modal-submit:disabled { opacity: .6; cursor: not-allowed; }
.sg-modal-cancel {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.07);
    color: rgba(255, 255, 255, 0.82);
}
.sg-modal-cancel:hover { background: rgba(255, 255, 255, 0.12); }
.sg-modal-submit:active,
.sg-modal-cancel:active { transform: scale(.98); }

@media (max-width: 480px) {
    .sg-cta { padding: 12px; }
    .sg-cta-btn { width: 100%; }
    .sg-modal-card { padding: 17px; }
}

@media (prefers-reduced-motion: reduce) {
    .sg-modal, .sg-modal-card, .sg-cta-btn, .sg-modal-submit, .sg-modal-cancel {
        transition: none !important;
    }
}
