/* ══ Download Modal — css/modules/download-modal.css ══
 * 从 modules/download-modal.php 迁移（TS-0324-01 Phase 3补）
 * 通过 mkl_enqueue_styles("modules/download-modal") 加载
 * ══════════════════════════════════════════════════ */

/* ══ Modal 弹窗（视觉与 action-buttons.php 完全一致） ══ */

/* 遮罩层 — 半透明 + 毛玻璃 */
.mkl-modal-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}
.mkl-modal-overlay.is-open { opacity: 1; visibility: visible; }

/* 弹窗卡片 — max-width 480px，圆角 16px */
.mkl-modal {
    background: #fff; border-radius: 16px;
    width: 90%; max-width: 480px; max-height: 85vh;
    overflow-y: auto;
    transform: scale(0.95); transition: transform .2s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.mkl-modal-overlay.is-open .mkl-modal { transform: scale(1); }

/* 头部 — sticky + 标题 + 关闭按钮 */
.mkl-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 0;
    position: sticky; top: 0; background: #fff;
    border-radius: 16px 16px 0 0; z-index: 1;
}
.mkl-modal-title {
    font-size: 17px; font-weight: 600; color: #1D1D1F; margin: 0;
}
.mkl-modal-close {
    width: 28px; height: 28px; border-radius: 50%; border: none;
    background: #F2F2F7; color: #8E8E93;
    font-size: 18px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s; font-family: inherit;
}
.mkl-modal-close:hover { background: #E5E5EA; color: #1D1D1F; }

/* 主体 */
.mkl-modal-body { padding: 16px 24px 24px; }

/* OS 检测提示 */
.mkl-dl-detected { font-size: 13px; color: #6E6E73; margin-bottom: 12px; }

/* 主下载按钮（检测到的 OS） */
.mkl-dl-main-btn {
    width: 100%; padding: 14px 16px; border-radius: 12px;
    background: #0071e3; color: #fff; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    font-size: 15px; font-weight: 500; font-family: inherit;
    transition: background .15s;
}
.mkl-dl-main-btn:hover { background: #0077ED; }
.mkl-dl-btn-icon { font-size: 18px; }
.mkl-dl-btn-size { margin-left: auto; font-size: 13px; opacity: 0.8; }

/* 其他系统折叠区 */
.mkl-dl-other { margin-top: 16px; }
.mkl-dl-other-toggle {
    font-size: 13px; color: #6E6E73; background: none; border: none;
    cursor: pointer; padding: 0; font-family: inherit;
    display: flex; align-items: center; gap: 4px;
}
.mkl-dl-other-toggle:hover { color: #1D1D1F; }
.mkl-dl-arrow { font-size: 10px; transition: transform .2s; }
.mkl-dl-arrow.is-open { transform: rotate(180deg); }
.mkl-dl-other-list {
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
    display: flex; flex-direction: column; gap: 8px; margin-top: 0;
}
.mkl-dl-other-list.is-open { margin-top: 10px; }

/* OS 行按钮（折叠内 / 无匹配时平铺） */
.mkl-dl-os-btn {
    width: 100%; padding: 10px 16px; border-radius: 10px;
    background: #F5F5F7; color: #1D1D1F; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-family: inherit; transition: background .15s;
}
.mkl-dl-os-btn:hover { background: #E8E8ED; }
.mkl-dl-flat-list { display: flex; flex-direction: column; gap: 8px; }

/* 补充下载区 */
.mkl-dl-supps { margin-top: 20px; padding-top: 16px; border-top: 1px solid #F2F2F7; }
.mkl-dl-supps-label { font-size: 13px; color: #6E6E73; margin-bottom: 10px; }
.mkl-dl-supp-btn {
    width: 100%; padding: 10px 16px; border-radius: 10px;
    background: #FFFBF0; color: #1D1D1F; border: 1px solid #F0E6CC;
    cursor: pointer; display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-family: inherit; transition: background .15s;
    margin-bottom: 4px;
}
.mkl-dl-supp-btn:hover { background: #FFF5E0; }
.mkl-dl-supp-note { font-size: 12px; color: #8E8E93; margin: 2px 0 8px 16px; }

/* 解锁态（验证通过后变绿） */
.mkl-dl-main-btn.is-unlocked { background: #34C759; }
.mkl-dl-main-btn.is-unlocked:hover { background: #2DB84D; }
.mkl-dl-os-btn.is-unlocked { background: #E8FAE8; color: #1D1D1F; }
.mkl-dl-os-btn.is-unlocked:hover { background: #D4F5D4; }
.mkl-dl-supp-btn.is-unlocked { background: #E8FAE8; border-color: #34C759; }
.mkl-dl-supp-btn.is-unlocked:hover { background: #D4F5D4; }
/* 其他系统 toggle 解锁态：绿色加粗，提示可展开 */
.mkl-dl-other-toggle.is-unlocked { color: #34C759; font-weight: 600; font-size: 14px; }

/* 数学验证区 */
.mkl-dl-verify { margin-top: 20px; padding-top: 16px; border-top: 1px solid #F2F2F7; }
.mkl-dl-verify-label { font-size: 13px; color: #6E6E73; margin-bottom: 10px; }
.mkl-dl-verify-row { display: flex; align-items: center; gap: 8px; }
.mkl-dl-verify-q { font-size: 15px; color: #1D1D1F; white-space: nowrap; }
.mkl-dl-verify-input {
    width: 56px; height: 36px;
    border: 1.5px solid #E5E5EA; border-radius: 8px;
    text-align: center; font-size: 15px; font-family: inherit; color: #1D1D1F;
    outline: none; transition: border-color .15s; background: #fff;
}
.mkl-dl-verify-input:focus { border-color: #0071e3; }
.mkl-dl-verify-input.is-error { border-color: #FF3B30; animation: mkl-shake .3s; }
.mkl-dl-verify-submit {
    min-width: 180px; padding: 0 16px; height: 36px; border-radius: 8px;
    display: inline-flex; justify-content: center; align-items: center;
    background: #1D1D1F; color: #fff; border: none; cursor: pointer;
    font-size: 14px; font-weight: 500; font-family: inherit;
    transition: background .15s; white-space: nowrap;
}
.mkl-dl-verify-submit:hover { background: #3a3a3c; }
.mkl-dl-verify-submit:disabled { background: #34C759; cursor: default; opacity: 1; }
.mkl-dl-verify-ok { font-size: 13px; color: #34C759; margin-top: 8px; display: none; }
.mkl-dl-verify-ok.is-show { display: block; }

@keyframes mkl-shake {
    0%,100% { transform: translateX(0); }
    20%,60%  { transform: translateX(-4px); }
    40%,80%  { transform: translateX(4px); }
}
