/* ============================================================
   Dawnmaker — Share Modal (Material 3 + SVG Icon System)
   精简重构版（无冗余 / 无冲突）
   ============================================================ */

#dm-creation-share-modal {
    min-width: 260px;
}
/* ============================================================
   🔥 MODAL STATE CONTROL（核心修复）
   ============================================================ */

/* 默认：彻底不可交互 */
#dm-share-modal {
    visibility: hidden;
    opacity: 0;
}

#dm-share-modal.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}


/* aria 兜底（防止 JS 状态不同步） */
#dm-share-modal[aria-hidden="true"] {
    pointer-events: none !important;
    visibility: hidden !important;
}

#dm-share-modal[aria-hidden="true"] * {
    pointer-events: none !important;
}

/* overlay 同步控制 */
#dm-share-overlay {
    pointer-events: none;
}

#dm-share-overlay.active {
    pointer-events: auto;
}
/* ========================
   Overlay
======================== */
.dm-share-overlay {
    position: fixed;
    visibility: hidden;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: 9998;
}
.dm-share-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ========================
   Modal
======================== */
.dm-share-modal {
    position: fixed;
    pointer-events: none;
    visibility: hidden;
    top: 50%;
    left: 50%;
    width: 92%;
    max-width: 420px;
    padding: var(--dm-space-5);

    background: var(--dm-color-surface);
    border-radius: var(--dm-radius-lg);
    box-shadow: var(--dm-elevation-3);

    transform: translate(-50%, -50%);
    opacity: 0;

    transition:
        opacity .25s cubic-bezier(.2,0,.2,1),
        transform .25s cubic-bezier(.2,0,.2,1);

    z-index: 9999;
}
.dm-share-modal.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* ========================
   Title
======================== */
.dm-share-title {
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    margin-bottom: var(--dm-space-4);
    color: var(--dm-color-text);
}

/* ========================
   Input
======================== */
.dm-share-input {
    width: 100%;
    margin-bottom: var(--dm-space-4);
    padding: var(--dm-space-3) var(--dm-space-4);

    border-radius: var(--dm-radius-md);
    border: 1px solid var(--dm-color-outline);

    background: var(--dm-color-surface-variant);
    color: var(--dm-color-text);
    font-size: var(--dm-font-size-sm);

    transition: border-color .2s ease, background .2s ease;
}
.dm-share-input:focus {
    outline: none;
    border-color: var(--dm-color-primary);
    background: #fff;
}

/* ========================
   Buttons Layout
======================== */
.dm-share-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--dm-space-3);
    margin-bottom: var(--dm-space-4);
}

/* ========================
   Icon Button（统一体系）
======================== */
.dm-icon-style {
    position: relative;

    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 14px;
    border: none;
    padding: 0;
    cursor: pointer;

    overflow: hidden;

    transition:
        transform .18s cubic-bezier(.25,.46,.45,.94),
        box-shadow .18s ease;
}

/* Glass Layer（核心：独立层） */
.dm-icon-style::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;

    /* ✅ Apple 风浅灰玻璃 */
    background: rgba(240, 240, 245, 0.6);

    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    /* ✅ 关键：苹果式高光边缘 */
    border: 1px solid rgba(255,255,255,0.6);

    /* ✅ 更干净的阴影（不发黑） */
    box-shadow:
        0 2px 8px rgba(0,0,0,0.08),
        0 6px 18px rgba(0,0,0,0.06);

    z-index: 0;
}

/* Hover */
.dm-icon-style:hover {
    transform: translateY(-2px);
}
.dm-icon-style:hover::before {
    box-shadow:
        inset 0 0 0 0 rgba(255,255,255,0.6),
        0 6px 16px rgba(0,0,0,0.18);
}

/* Active */
.dm-icon-style:active {
    transform: scale(0.92);
}
.dm-icon-style:active::before {
    box-shadow:
        inset 0 2px 6px rgba(0,0,0,0.25),
        0 2px 6px rgba(0,0,0,0.12);
}

/* ========================
   SVG Icon（核心层）
======================== */
.dm-icon-svg {
    width: 60%;
    height: 60%;

    position: relative;
    z-index: 1;

    display: block;
    flex-shrink: 0;

    shape-rendering: geometricPrecision;
}

/* 禁用旧 background icon（兼容旧类） */
.share-whatsapp,
.share-messenger,
.share-linkedin {
    background-image: none !important;
}

/* ========================
   QR Code
======================== */
.dm-share-qrcode {
    display: flex;
    justify-content: center;
    margin-bottom: var(--dm-space-4);
}

/* ========================
   Copy Button
======================== */
.dm-share-copy {
    width: 100%;
    padding: var(--dm-space-3) var(--dm-space-4);

    border-radius: var(--dm-radius-pill);
    background: var(--dm-color-primary);
    color: var(--dm-color-on-primary);

    text-align: center;
    font-size: var(--dm-font-size-sm);
    font-weight: 500;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}
.dm-share-copy:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: var(--dm-elevation-2);
}

/* ========================
   Close Button
======================== */
.dm-share-close {
    position: absolute;
    top: var(--dm-space-3);
    right: var(--dm-space-3);

    width: 32px;
    height: 32px;

    border-radius: 50%;
    border: none;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    overflow: hidden;

    transition: transform .2s ease;
}

/* 背景层（独立） */
.dm-share-close::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;

    /* Apple 风浅灰 */
    background: rgba(240,240,245,0.6);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    border: 1px solid rgba(255,255,255,0.6);

    box-shadow:
        0 2px 6px rgba(0,0,0,0.08),
        0 4px 12px rgba(0,0,0,0.06);

    z-index: 0;
}

/* SVG 永远在最上层 */
.dm-share-close svg {
    position: relative;
    z-index: 1;

    width: 18px;
    height: 18px;

    stroke: #111;   /* 比纯白更适合浅灰背景 */
    fill: none !important;
}

/* Hover */
.dm-share-close:hover {
    transform: scale(1.05);
}

.dm-share-close:hover::before {
    background: rgba(255,255,255,0.8);
}

/* Active */
.dm-share-close:active {
    transform: scale(0.92);
}

.dm-share-close:active::before {
    background: rgba(0,0,0,0.12);
}

/* ========================
   Responsive
======================== */
@media (max-width: 480px) {
    .dm-share-modal {
        padding: var(--dm-space-4);
    }
    .dm-share-title {
        font-size: 20px;
    }
}