/* 可复用控件：Modal 弹窗（含亮色主题覆写）。
   契约：加一种可复用控件 → components；随控件库 <link>。
   卡片基类（.card/.faq-container 营销卡面）已归页级 assets/css/shared.css。
   （历史遗留的无引用样式已清除：case/benefit/knowledge/pricing 卡、skill 卡家族、
   spotlight 容器变体、reveal-on-scroll、modal-header/body 及其滚动条伪元素） */

/* ===== Modal 弹窗 ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: none;
}

.modal.is-open {
    display: block;
}

.modal.is-open .modal-panel {
    animation: modal-in 280ms var(--ease-expo-out) both;
}

@keyframes modal-in {
    from { opacity: 0; transform: translate3d(-50%, calc(-50% + 10px), 0) scale(0.985); filter: blur(6px); }
    to { opacity: 1; transform: translate3d(-50%, -50%, 0) scale(1); filter: blur(0px); }
}

.modal.is-open .modal-overlay {
    animation: modal-overlay-in 220ms var(--ease-expo-out) both;
}

@keyframes modal-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(14px);
}

.modal-panel {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate3d(-50%, -50%, 0);
    width: min(700px, calc((100vw - 56px) * 0.7));
    max-height: min(78vh, 780px);
    overflow: hidden;
    background: linear-gradient(to bottom, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    color: var(--foreground);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-card-hover);
    backdrop-filter: blur(18px);
}

.modal-panel--wechat {
    width: min(340px, calc(100vw - 40px));
    max-height: none;
    padding: 0;
    overflow: visible;
    text-align: center;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    box-shadow: var(--shadow-card-hover);
    backdrop-filter: blur(18px);
}

.modal-close--floating {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
}

.modal-wechat-body {
    padding: 28px 22px 30px;
    padding-top: 22px;
}

.modal-wechat-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
}

.modal-wechat-desc {
    margin: 0 0 22px;
    color: rgba(237, 237, 239, 0.66);
    font-size: 14px;
    line-height: 1.65;
    padding: 0 20px;
    text-align: center;
}

.modal-wechat-qr {
    margin: 0 auto;
    width: 200px;
    height: 200px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}

.modal-wechat-qr img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: contain;
    display: block;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-default);
    background: rgba(255,255,255,0.04);
    color: rgba(237,237,239,0.78);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--t-fast) var(--ease-expo-out), background var(--t-fast) var(--ease-expo-out), color var(--t-fast) var(--ease-expo-out);
}

.modal-close:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(237,237,239,0.92);
    transform: translateY(-1px);
}

body.modal-open {
    overflow: hidden;
}

html.modal-open {
    overflow: hidden;
}

/* ===== 控件响应式 ===== */
@media (max-width: 768px) {
    .modal-panel {
        width: calc(100vw - 28px);
        max-height: 86vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal.is-open .modal-panel,
    .modal.is-open .modal-overlay {
        animation: none !important;
    }
}

/* ===== 亮色主题覆写（基样式在同一文件内，保持级联顺序） ===== */
[data-theme="light"] .modal-overlay {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
}

[data-theme="light"] .modal-panel,
[data-theme="light"] .modal-panel--wechat {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.98), rgba(248, 249, 252, 0.96));
    border-color: rgba(26, 29, 38, 0.08);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.9) inset,
        0 18px 48px rgba(26, 29, 38, 0.10),
        0 0 80px rgba(108, 92, 231, 0.08);
    backdrop-filter: none;
}

[data-theme="light"] .modal-close {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(26, 29, 38, 0.10);
    color: rgba(26, 29, 38, 0.62);
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.95), 0 1px 2px rgba(26, 29, 38, 0.04);
}

[data-theme="light"] .modal-close:hover {
    background: rgba(108, 92, 231, 0.06);
    border-color: rgba(108, 92, 231, 0.18);
    color: var(--foreground);
}

[data-theme="light"] .modal-wechat-title {
    color: var(--foreground);
}

[data-theme="light"] .modal-wechat-desc {
    color: rgba(26, 29, 38, 0.58);
}

[data-theme="light"] .modal-wechat-qr {
    padding: 8px;
    border-radius: 12px;
    background: #FFFFFF;
    border: 1px solid rgba(26, 29, 38, 0.08);
    box-shadow: 0 8px 24px rgba(26, 29, 38, 0.08);
}

[data-theme="light"] .modal-wechat-qr img {
    border-radius: 8px;
}
