/*!
 * 整蛊弹窗链接生成器 prank-link.css
 * 布局：左侧参数面板 + 右侧预览/链接（仿田字格双栏），含整蛊运行时全屏舞台
 * 依赖 home.css 全局变量 + tool-detail.css / calc-common.css，完整适配黑夜模式
 */

/* ======================================================================
 *  一、整体布局
 * ==================================================================== */
.pl-layout {
    display: grid;
    grid-template-columns: 328px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.pl-side {
    position: sticky;
    top: 88px;
    border: 1px solid var(--c-border, #eef1f6);
    border-radius: 18px;
    background: var(--c-bg-card, #fff);
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    max-height: calc(100vh - 104px);
    overflow-y: auto;
}

.pl-side-block { padding: 14px 16px; }
.pl-side-block + .pl-side-block { border-top: 1px solid var(--c-border, #eef1f6); }

.pl-label {
    display: block;
    margin-bottom: 9px;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: .02em;
    color: var(--c-text-muted, #94a3b8);
}
.pl-label em {
    margin-left: 6px;
    font-style: normal;
    font-weight: 600;
    color: var(--c-primary, #0066ff);
}

.pl-caption {
    margin-top: 8px;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--c-text-muted, #94a3b8);
    margin-bottom: 0;
}

.pl-text {
    display: block;
    width: 100%;
    min-height: 118px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--c-text, #0f172a);
    background: var(--c-surface-soft, #f7f9fc);
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 10px;
    outline: none;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}
.pl-text:focus, .pl-input:focus {
    border-color: var(--c-primary, #0066ff);
    box-shadow: 0 0 0 3px rgba(0, 102, 255, .12);
}

.pl-input {
    display: block;
    width: 100%;
    height: 38px;
    padding: 0 12px;
    font-size: 13.5px;
    color: var(--c-text, #0f172a);
    background: var(--c-surface-soft, #f7f9fc);
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 9px;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

.pl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-chip {
    padding: 6px 11px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--c-text-sub, #475569);
    background: var(--c-surface-soft, #f1f5f9);
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
}
.pl-chip:hover { border-color: var(--c-primary, #0066ff); color: var(--c-primary, #0066ff); }
.pl-chip.is-active {
    color: #fff;
    background: linear-gradient(135deg, #ff5f8f, #ff2d6f);
    border-color: transparent;
}

/* ---------------- 右侧 ---------------- */
.pl-main { min-width: 0; display: flex; flex-direction: column; }

.pl-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    margin-bottom: 14px;
    border: 1px solid var(--c-border, #eef1f6);
    border-radius: 14px;
    background: var(--c-bg-card, #fff);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
}
.pl-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 12.5px;
    color: var(--c-text-muted, #94a3b8);
    background: var(--c-surface-soft, #f1f5f9);
    border-radius: 999px;
}
.pl-stat-item b {
    color: var(--c-text, #0f172a);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    font-weight: 800;
}
.pl-btn-group { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }

.pl-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #ff5f8f, #ff2d6f);
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    transition: opacity .15s, transform .15s, box-shadow .15s;
    font-family: inherit;
    white-space: nowrap;
}
.pl-btn:hover { opacity: .94; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255, 45, 111, .24); }
.pl-btn:active { transform: translateY(0); }
.pl-btn--preview { background: #1c7ed6; }
.pl-btn--preview:hover { box-shadow: 0 6px 16px rgba(28, 126, 214, .24); }
.pl-btn--ghost {
    color: var(--c-text-sub, #475569);
    background: var(--c-surface-soft, #f1f5f9);
    border: 1px solid var(--c-border, #e2e8f0);
    box-shadow: none;
}
.pl-btn--ghost:hover { color: #ff2d6f; border-color: #ff2d6f; box-shadow: none; }

/* 链接输出条 */
.pl-linkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 45, 111, .28);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 95, 143, .08), rgba(255, 45, 111, .04));
    margin-bottom: 8px;
}
.pl-link-icon { font-size: 16px; flex: 0 0 auto; }
.pl-link-out {
    flex: 1 1 auto;
    min-width: 0;
    height: 32px;
    padding: 0 10px;
    font-size: 12.5px;
    color: var(--c-text-sub, #475569);
    background: var(--c-bg-card, #fff);
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 8px;
    font-family: ui-monospace, Menlo, Consolas, monospace;
}
.pl-link-copy {
    flex: 0 0 auto;
    height: 32px;
    padding: 0 14px;
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    background: #ff2d6f;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}
.pl-link-copy:hover { background: #e02662; }
.pl-link-tip {
    margin: 0 2px 16px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--c-text-muted, #94a3b8);
}
.pl-link-tip.is-ok { color: #1f9d43; }

/* 预览屏幕 */
.pl-screen-label { font-size: 12.5px; font-weight: 700; color: var(--c-text-sub, #475569); margin-bottom: 8px; }
.pl-screen {
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 14px;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 10%, rgba(99, 102, 241, .12), transparent 42%),
        radial-gradient(circle at 85% 90%, rgba(255, 45, 111, .12), transparent 42%),
        var(--c-surface-soft, #eef2f8);
    box-shadow: 0 10px 30px -12px rgba(15, 23, 42, .22);
}
.pl-screen-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(15, 23, 42, .08);
}
[data-theme="dark"] .pl-screen-bar { background: rgba(255, 255, 255, .06); }
.pl-screen-bar i { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; display: inline-block; }
.pl-screen-bar i:nth-child(2) { background: #febc2e; }
.pl-screen-bar i:nth-child(3) { background: #28c840; }
.pl-screen-url {
    margin-left: 10px;
    font-size: 11px;
    color: var(--c-text-muted, #94a3b8);
    font-family: ui-monospace, Menlo, Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pl-screen-stage {
    position: relative;
    min-height: 360px;
    padding: 26px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pl-tips {
    margin: 16px 2px 0;
    font-size: 12.5px;
    line-height: 2;
    color: var(--c-text-muted, #94a3b8);
}
.pl-tips b { color: var(--c-text-sub, #475569); font-weight: 700; }

/* ======================================================================
 *  二、弹窗（预览 & 运行时共用）
 * ==================================================================== */
.pl-modal {
    position: relative;
    width: min(420px, 88%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(2, 8, 23, .34);
    animation: plPop .22s cubic-bezier(.2, 1.4, .4, 1);
    background: #fff;
}
@keyframes plPop {
    from { opacity: 0; transform: scale(.82); }
    to { opacity: 1; transform: scale(1); }
}

.pl-modal-x {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 24px;
    height: 24px;
    line-height: 22px;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, .82);
    background: rgba(0, 0, 0, .22);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    z-index: 3;
    font-family: inherit;
}
.pl-modal-x:hover { background: rgba(0, 0, 0, .4); color: #fff; }

/* —— 系统弹窗皮肤 —— */
.pl-modal--system .pl-modal-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 36px 9px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #2b6cff, #1154d6);
}
.pl-modal--system .pl-modal-body { padding: 22px 18px 18px; color: #1f2937; }
.pl-modal--system .pl-modal-title { font-size: 18px; font-weight: 800; margin: 0 0 10px; }
.pl-modal--system .pl-modal-text {
    font-size: 14px;
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
    color: #374151;
    margin: 0;
}
.pl-modal--system .pl-modal-sign { margin-top: 14px; text-align: right; font-size: 12.5px; color: #6b7280; }
.pl-modal--system .pl-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 16px 16px;
}

/* —— 经典 alert 皮肤 —— */
.pl-modal--alert { border: 1px solid #b9c2d0; }
.pl-modal--alert .pl-modal-body { padding: 22px 20px 8px; display: flex; gap: 14px; color: #1f2937; }
.pl-modal--alert .pl-modal-warn { font-size: 30px; flex: 0 0 auto; }
.pl-modal--alert .pl-modal-title { font-size: 15px; font-weight: 800; margin: 2px 0 6px; color: #111827; }
.pl-modal--alert .pl-modal-text {
    font-size: 13.5px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    color: #374151;
    margin: 0;
}
.pl-modal--alert .pl-modal-sign { margin-top: 10px; font-size: 12px; color: #6b7280; }
.pl-modal--alert .pl-modal-foot { display: flex; justify-content: center; padding: 10px 16px 18px; }
.pl-modal--alert .pl-modal-x { color: #6b7280; background: rgba(0,0,0,.06); }
.pl-modal--alert .pl-modal-x:hover { background: rgba(0,0,0,.14); color: #111827; }

/* —— 喜庆通知皮肤 —— */
.pl-modal--notice {
    background:
        radial-gradient(circle at 100% 0, rgba(255, 215, 0, .28), transparent 38%),
        linear-gradient(160deg, #d7261e, #a81410);
    color: #ffe9b0;
    border: 2px solid #f4c95d;
}
.pl-modal--notice .pl-modal-body {
    padding: 26px 22px 18px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0, rgba(255, 236, 170, .22), transparent 55%);
}
.pl-modal--notice .pl-modal-ribbon { font-size: 12px; letter-spacing: .35em; color: #ffd974; font-weight: 700; }
.pl-modal--notice .pl-modal-title {
    font-size: 26px;
    font-weight: 900;
    color: #fff3cf;
    letter-spacing: .12em;
    margin: 8px 0 4px;
    text-shadow: 0 2px 0 rgba(120, 10, 6, .6);
}
.pl-modal--notice .pl-modal-rule { width: 56px; height: 2px; background: #f4c95d; margin: 10px auto 14px; }
.pl-modal--notice .pl-modal-text {
    font-size: 14px;
    line-height: 2;
    white-space: pre-wrap;
    word-break: break-word;
    color: #ffeec6;
    margin: 0;
}
.pl-modal--notice .pl-modal-sign { margin-top: 14px; font-size: 12.5px; color: #f6d073; }
.pl-modal--notice .pl-modal-foot { display: flex; justify-content: center; padding: 0 20px 24px; }
.pl-modal--notice .pl-modal-x { background: rgba(0, 0, 0, .28); }

/* 弹窗按钮 */
.pl-ok-btn, .pl-cancel-btn {
    min-width: 84px;
    height: 34px;
    padding: 0 16px;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: 7px;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid transparent;
    transition: background .15s;
}
.pl-ok-btn { background: #1e6fe8; color: #fff; }
.pl-ok-btn:hover { background: #1560cf; }
.pl-cancel-btn { background: #f1f3f7; color: #4b5563; border-color: #d7dce5; }
.pl-cancel-btn:hover { background: #e6e9f0; }
.pl-modal--notice .pl-ok-btn {
    background: linear-gradient(135deg, #ffe28a, #f0b429);
    color: #7a1c08;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
}
.pl-modal--notice .pl-ok-btn:hover { filter: brightness(1.05); }

/* ======================================================================
 *  三、整蛊运行时舞台
 * ==================================================================== */
.pl-stage[hidden] { display: none !important; }
.pl-stage {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background:
        radial-gradient(circle at 30% 12%, rgba(99, 102, 241, .25), transparent 45%),
        radial-gradient(circle at 78% 88%, rgba(255, 45, 111, .25), transparent 45%),
        #0b1020;
    overflow: hidden;
}
.pl-stage-canvas { position: absolute; inset: 0; }

/* 运行时弹窗绝对定位（普通模式由 JS 用负 margin 居中，风暴模式随机位置） */
.pl-stage .pl-modal { position: absolute; margin: 0; }
.pl-stage .pl-modal.is-in { animation: plPop .22s cubic-bezier(.2, 1.4, .4, 1); }

.pl-exit {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100001;
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    backdrop-filter: blur(6px);
}
.pl-exit:hover { background: rgba(255, 255, 255, .24); }

/* 揭晓页 */
.pl-reveal[hidden] { display: none !important; }
.pl-reveal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 20%, rgba(255, 95, 143, .35), transparent 55%),
        #0b1020;
    animation: plReveal .35s ease;
}
@keyframes plReveal { from { opacity: 0; } to { opacity: 1; } }
.pl-reveal-emoji { font-size: 72px; animation: plBounce 1.1s ease infinite; }
@keyframes plBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.pl-reveal-title { font-size: clamp(28px, 5vw, 44px); font-weight: 900; color: #fff; margin: 14px 0 8px; }
.pl-reveal-sub { font-size: 15px; line-height: 1.9; color: #c7d0e8; max-width: 460px; margin: 0 0 26px; }
.pl-reveal-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.pl-reveal-btn {
    height: 46px;
    padding: 0 24px;
    font-size: 15px;
    font-weight: 800;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    border: 0;
}
.pl-reveal-btn.primary { background: linear-gradient(135deg, #ff5f8f, #ff2d6f); color: #fff; box-shadow: 0 10px 26px rgba(255, 45, 111, .4); }
.pl-reveal-btn.primary:hover { transform: translateY(-2px); }
.pl-reveal-btn.ghost { background: rgba(255,255,255,.1); color: #e5e9f5; border: 1px solid rgba(255,255,255,.25); }
.pl-reveal-btn.ghost:hover { background: rgba(255,255,255,.18); }

/* 预览里不需要交互/关闭按钮以外的舞台样式 */
.pl-screen-stage .pl-modal { position: relative; }

/* ======================================================================
 *  四、轻提示
 * ==================================================================== */
.pl-toast {
    position: fixed;
    left: 50%;
    bottom: 44px;
    transform: translate(-50%, 16px);
    padding: 11px 22px;
    font-size: 13.5px;
    font-weight: 600;
    color: #fff;
    background: rgba(15, 23, 42, .93);
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 100002;
}
.pl-toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ======================================================================
 *  五、响应式
 * ==================================================================== */
@media (max-width: 1024px) {
    .pl-layout { grid-template-columns: minmax(0, 1fr); }
    .pl-side { position: static; max-height: none; }
}
@media (max-width: 640px) {
    .pl-side-block { padding: 12px 13px; }
    .pl-bar { padding: 10px 12px; gap: 8px; }
    .pl-btn { padding: 0 12px; font-size: 12.5px; height: 36px; }
    .pl-btn-group { margin-left: 0; width: 100%; }
    .pl-btn-group .pl-btn { flex: 1 1 auto; justify-content: center; }
    .pl-screen-stage { min-height: 300px; padding: 18px 12px; }
    .pl-modal--notice .pl-modal-title { font-size: 22px; }
    .pl-exit { top: 10px; right: 10px; height: 32px; padding: 0 12px; font-size: 12px; }
}

/* 侧栏滚动条（桌面） */
@media (min-width: 1025px) {
    .pl-side::-webkit-scrollbar { width: 6px; }
    .pl-side::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
    .pl-side::-webkit-scrollbar-track { background: transparent; }
}

/* ======================================================================
 *  六、黑夜模式（弹窗与通知始终保持本色，模拟真实系统窗口）
 * ==================================================================== */
[data-theme="dark"] .pl-side,
[data-theme="dark"] .pl-bar {
    background: var(--c-bg-card, #131c31);
    border-color: rgba(255, 255, 255, .08);
}
[data-theme="dark"] .pl-text,
[data-theme="dark"] .pl-input,
[data-theme="dark"] .pl-link-out {
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .12);
    color: var(--c-text, #e5e7eb);
}
[data-theme="dark"] .pl-chip,
[data-theme="dark"] .pl-btn--ghost {
    color: var(--c-text-sub, #9ca3af);
    background: rgba(255, 255, 255, .04);
    border-color: rgba(255, 255, 255, .12);
}
[data-theme="dark"] .pl-chip:hover,
[data-theme="dark"] .pl-btn--ghost:hover { color: #ff7ba4; border-color: #ff7ba4; }
[data-theme="dark"] .pl-chip.is-active { color: #fff; }
[data-theme="dark"] .pl-stat-item { background: rgba(255, 255, 255, .05); }
[data-theme="dark"] .pl-stat-item b { color: var(--c-text, #e5e7eb); }
[data-theme="dark"] .pl-linkbox { background: linear-gradient(135deg, rgba(255,95,143,.14), rgba(255,45,111,.07)); }
[data-theme="dark"] .pl-link-out { background: #0f1830; }
