/* ===================================================
 * 玖源社功能整合插件 - 下载弹窗样式
 * 合并了原 xiaz style.css 中弹窗部分 + 软件单页弹窗样式
 * 保留 jx-* CSS 类名
 * =================================================== */

.jx-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 99999;
    background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all .28s ease;
    padding: 20px; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.jx-modal-overlay.jx-show { opacity: 1; visibility: visible; }

.jx-modal {
    background: var(--main-bg-color, #fff); border-radius: 14px;
    max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0,0,0,.22); position: relative;
    transform: scale(.92) translateY(20px);
    transition: transform .28s cubic-bezier(.175,.885,.32,1.275);
}
.jx-modal-overlay.jx-show .jx-modal { transform: scale(1) translateY(0); }

.jx-modal-close {
    position: absolute; top: 12px; right: 16px;
    width: 30px; height: 30px; line-height: 28px; text-align: center;
    font-size: 22px; cursor: pointer;
    color: var(--muted-2-color, #999); z-index: 10; border-radius: 50%;
    transition: .2s; user-select: none;
}
.jx-modal-close:hover {
    color: var(--key-color, #333);
    background: var(--muted-bg-color, #f0f0f0);
}

.jx-modal-body { display: flex; padding: 28px 26px 24px; gap: 22px; }
.jx-modal-left { flex-shrink: 0; }
.jx-modal-img-wrap {
    width: 120px; height: 120px; border-radius: 16px; overflow: hidden;
    background: var(--muted-bg-color, #f5f5f5);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--main-border-color, #eee);
}
.jx-modal-img { width: 100%; height: 100%; object-fit: cover; }

.jx-modal-right {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px;
}
.jx-modal-title {
    margin: 0; font-size: 19px; font-weight: 700;
    color: var(--key-color, #222); line-height: 1.3;
}
.jx-modal-rating .jx-star { font-size: 15px; }

.jx-modal-info {
    display: grid; grid-template-columns: auto 1fr;
    row-gap: 4px; column-gap: 12px; font-size: 13px; margin-top: 2px;
}
.jx-info-label { color: var(--muted-2-color, #888); white-space: nowrap; }
.jx-info-val { color: var(--main-color, #444); font-weight: 500; }

.jx-modal-desc {
    font-size: 13px; color: var(--main-color, #666); line-height: 1.7;
    max-height: 72px; overflow-y: auto;
    padding: 8px 10px; background: var(--muted-bg-color, #fafafa);
    border-radius: 6px; border: 1px solid var(--muted-border-color, #f0f0f0);
    word-break: break-all;
}

.jx-modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.jx-modal-download-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 38px; padding: 0 28px; font-size: 14px; font-weight: 600;
    color: #fff; background: linear-gradient(135deg,var(--theme-color,#4080ff),#2563eb);
    border: none; border-radius: 6px; text-decoration: none; cursor: pointer;
    letter-spacing: .3px; transition: all .22s ease;
}
.jx-modal-download-btn:hover {
    box-shadow: 0 4px 14px rgba(64,128,255,.35); color: #fff;
    transform: translateY(-1px);
}
.jx-modal-view-btn {
    display: inline-flex; align-items: center; justify-content: center;
    height: 38px; padding: 0 20px; font-size: 14px; font-weight: 500;
    color: var(--main-color, #555); background: var(--muted-bg-color, #f5f5f5);
    border: 1px solid var(--muted-border-color, #e0e0e0); border-radius: 6px;
    text-decoration: none; cursor: pointer; transition: .2s ease;
}
.jx-modal-view-btn:hover {
    color: var(--theme-color, #4080ff);
    border-color: var(--theme-color, #4080ff); background: #eff6ff;
}

/* ---- 星星样式 ---- */
.jx-star {
    color: var(--muted-4-color, #e0e0e0); font-size: 13px;
    line-height: 1; position: relative; display: inline-block;
}
.jx-star-full { color: #ffb400; }
.jx-star-half { color: #ffb400; clip-path: inset(0 50% 0 0); -webkit-clip-path: inset(0 50% 0 0); }
.jx-star-three-quarter { color: #ffb400; clip-path: inset(0 25% 0 0); -webkit-clip-path: inset(0 25% 0 0); }

/* ================================
 * 弹窗响应式适配
 * ================================ */
@media (max-width: 900px) {
    .jx-modal-body { flex-direction: column; align-items: center; text-align: center; padding: 22px 20px 18px; }
    .jx-modal-img-wrap { width: 90px; height: 90px; }
    .jx-modal-title { font-size: 17px; }
    .jx-modal-info { grid-template-columns: 70px 1fr; }
    .jx-modal-actions { justify-content: center; }
    .jx-modal-download-btn, .jx-modal-view-btn { flex: 1; max-width: 180px; }
}

@media (max-width: 600px) {
    .jx-modal-overlay { padding: 12px; }
    .jx-modal { border-radius: 12px; }
    .jx-modal-body { padding: 18px 16px 16px; gap: 16px; }
    .jx-modal-img-wrap { width: 76px; height: 76px; border-radius: 12px; }
    .jx-modal-desc { max-height: 56px; font-size: 12px; padding: 6px 8px; }
    .jx-modal-download-btn, .jx-modal-view-btn { height: 34px; font-size: 13px; }
}

/* ================================
 * 暗色模式
 * ================================ */
.dark-theme .jx-modal {
    background: var(--main-bg-color, #323335);
    color: var(--main-color, #e5eef7);
}
.dark-theme .jx-modal-close { color: var(--muted-2-color, #888a8f); }
.dark-theme .jx-modal-close:hover { background: var(--muted-bg-color, #2d2e31); color: var(--key-color, #ccc); }
.dark-theme .jx-modal-title { color: var(--key-color, #f8fafc); }
.dark-theme .jx-info-label { color: var(--muted-2-color, #888a8f); }
.dark-theme .jx-info-val { color: var(--main-color, #b4b6bb); }
.dark-theme .jx-modal-desc {
    background: var(--muted-bg-color, #2d2e31); color: var(--muted-color, #b4b6bb);
    border-color: var(--muted-border-color, rgba(184,184,184,.02));
}
.dark-theme .jx-modal-view-btn {
    color: var(--muted-2-color, #888a8f);
    background: var(--muted-bg-color, #2d2e31);
    border-color: var(--main-border-color, rgba(114,114,114,.1));
}
.dark-theme .jx-modal-view-btn:hover { color: var(--theme-color, #60a5fa); border-color: var(--theme-color, #4080ff); background: rgba(64,128,255,.08); }
.dark-theme .jx-modal-img-wrap { background: var(--muted-bg-color, #2d2e31); border-color: var(--main-border-color, rgba(114,114,114,.1)); }
.dark-theme .jx-star:not(.jx-star-full):not(.jx-star-half):not(.jx-star-three-quarter) { color: var(--muted-4-color, #43454a); }
