/* ==========================================================
   云梦 - 版权声明 / 右侧反馈按钮 / 留言弹窗 公共样式
   同时适配：
   - 主站（ThinkPHP，<html data-sp-theme="light|dark">，默认深色）
   - 子站（静态站，<html data-theme="light|dark">，默认浅色）
   颜色全部走中性灰 + 主题强调色变量，任一主题下都不会串色
   ========================================================== */

/* ---------- 底部声明区 ---------- */
.ym-legal {
    --ym-accent: var(--sp-accent, var(--accent, #2f6bd8));
    width: 100%;
    max-width: 1240px;
    margin: 28px auto 0;
    padding: 16px 18px;
    box-sizing: border-box;
    border: 1px solid rgba(128, 128, 128, .22);
    border-radius: 14px;
    background: rgba(128, 128, 128, .06);
    font-size: 13px;
    line-height: 1.85;
    color: inherit;
    opacity: .92;
    text-align: left;
}

.ym-legal__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .3px;
    color: var(--ym-accent);
}

.ym-legal__title::before {
    content: "";
    width: 3px;
    height: 13px;
    border-radius: 2px;
    background: var(--ym-accent);
}

.ym-legal__text {
    margin: 0;
    color: inherit;
    opacity: .82;
    word-break: break-word;
}

.ym-legal__text+.ym-legal__text {
    margin-top: 6px;
}

.ym-legal__link {
    color: var(--ym-accent);
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
    cursor: pointer;
    background: none;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    padding: 0 1px;
    font: inherit;
}

.ym-legal__link:hover {
    opacity: .8;
}

/* ---------- 右侧悬浮按钮 ---------- */
/* 注意：主站 override.css / theme-day.css 里有 `body > * { position: relative; z-index: 1 }`，
   用 html body 提高优先级 + !important 保证 fixed 不被吃掉（否则按钮会掉到页面最底部）。 */
html body .ym-fb-btn {
    position: fixed !important;
    right: 0 !important;
    top: 50% !important;
    bottom: auto !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    z-index: 2147482000 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 46px;
    padding: 14px 0;
    border: 1px solid rgba(128, 128, 128, .25);
    border-right: 0;
    border-radius: 14px 0 0 14px;
    background: var(--ym-accent, var(--sp-accent, var(--accent, #2f6bd8)));
    color: #fff;
    font-size: 12px;
    line-height: 1.15;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    -webkit-tap-highlight-color: transparent;
}

.ym-fb-btn:hover {
    filter: brightness(1.06);
    box-shadow: 0 14px 32px rgba(0, 0, 0, .24);
}

.ym-fb-btn:active {
    transform: translateY(-50%) scale(.97) !important;
}

.ym-fb-btn svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}

.ym-fb-btn span {
    writing-mode: vertical-rl;
    text-orientation: upright;
    font-weight: 600;
}

/* ---------- 弹窗 ---------- */
html body .ym-fb-mask {
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483000 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12, 15, 22, .55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.ym-fb-mask.is-open {
    display: flex;
}

.ym-fb-dialog {
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 40px);
    overflow: auto;
    box-sizing: border-box;
    padding: 22px 22px 18px;
    border-radius: 16px;
    background: #fff;
    color: #1f2430;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .3);
    font-size: 14px;
    line-height: 1.6;
    animation: ymFbIn .18s ease-out;
}

@keyframes ymFbIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

html[data-sp-theme="dark"] .ym-fb-dialog,
html[data-theme="dark"] .ym-fb-dialog {
    background: #1b1f27;
    color: #e6e8ee;
}

.ym-fb-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.ym-fb-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
}

.ym-fb-sub {
    margin: 4px 0 14px;
    font-size: 12px;
    line-height: 1.7;
    opacity: .6;
}

/* 主站 tailwind Preflight 有 button,[type=submit]{background-color:transparent}，
   同权重且后加载，会把这里的底色吃掉，必须抬选择器权重 */
html body .ym-fb-close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: rgba(128, 128, 128, .12);
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
}

.ym-fb-close:hover {
    background: rgba(128, 128, 128, .22);
}

.ym-fb-row {
    margin-bottom: 12px;
}

.ym-fb-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    opacity: .78;
}

.ym-fb-label em {
    font-style: normal;
    color: #e0484d;
    margin-left: 2px;
}

.ym-fb-input,
.ym-fb-select,
.ym-fb-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border: 1px solid rgba(128, 128, 128, .32);
    border-radius: 9px;
    background: rgba(128, 128, 128, .05);
    color: inherit;
    font: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.ym-fb-input::placeholder,
.ym-fb-textarea::placeholder {
    color: rgba(128, 128, 128, .9);
}

.ym-fb-input:focus,
.ym-fb-select:focus,
.ym-fb-textarea:focus {
    border-color: var(--ym-accent, #2f6bd8);
    box-shadow: 0 0 0 3px rgba(47, 107, 216, .12);
}

.ym-fb-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 30px;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}

.ym-fb-select option {
    color: #1f2430;
    background: #fff;
}

.ym-fb-textarea {
    min-height: 92px;
    resize: vertical;
    line-height: 1.6;
}

.ym-fb-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.ym-fb-tip {
    font-size: 11px;
    line-height: 1.5;
    opacity: .55;
}

html body .ym-fb-submit {
    flex: 0 0 auto;
    min-width: 108px;
    padding: 10px 20px;
    border: 0;
    border-radius: 10px;
    background: var(--ym-accent, var(--sp-accent, var(--accent, #2f6bd8)));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s, transform .15s;
}

.ym-fb-submit:hover {
    filter: brightness(1.06);
}

.ym-fb-submit:active {
    transform: scale(.98);
}

html body .ym-fb-submit[disabled] {
    opacity: .62;
    cursor: not-allowed;
}

/* 轻提示 */
html body .ym-fb-toast {
    position: fixed !important;
    left: 50% !important;
    bottom: 44px !important;
    z-index: 2147483600 !important;
    transform: translateX(-50%) translateY(8px);
    max-width: min(86vw, 420px);
    padding: 10px 18px;
    border-radius: 10px;
    background: rgba(20, 24, 32, .92);
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}

.ym-fb-toast.is-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ym-fb-toast.is-error {
    background: rgba(180, 38, 45, .94);
}

@media (max-width: 640px) {
    .ym-legal {
        margin: 20px 12px 0;
        padding: 13px 14px;
        font-size: 12px;
        line-height: 1.8;
        border-radius: 12px;
        width: auto;
    }

    .ym-fb-btn {
        width: 40px;
        padding: 11px 0;
        font-size: 11px;
        border-radius: 12px 0 0 12px;
    }

    .ym-fb-btn svg {
        width: 15px;
        height: 15px;
    }

    .ym-fb-dialog {
        padding: 18px 16px 14px;
        border-radius: 14px;
    }

    .ym-fb-foot {
        flex-direction: column;
        align-items: stretch;
    }

    .ym-fb-submit {
        width: 100%;
    }

    .ym-fb-tip {
        text-align: center;
    }
}
