/* ============================================================
   桌面模式
   ============================================================ */

/* ============ 主站同款背景层 ============ */
.bg-fallback {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: #0a0c12;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.06);
    will-change: transform;
}

.bg-front { z-index: 2; transform: scale(1.12); }

.bg-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: 3;
    pointer-events: none;
}

* { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    width: 100%; height: 100%;
    overflow: hidden;
}

body.desktop-body {
    font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 13px;
    color: #e6ebf5;
    background: #0a0c12;
    user-select: none;
    -webkit-user-select: none;
}

/* ============ 壁纸 ============ */
.dt-wallpaper-overlay {
    position: fixed;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.12) 100%);
}

/* ============ 桌面图标 ============ */
.dt-icons {
    position: fixed;
    top: 24px;
    left: 24px;
    right: 24px;
    bottom: 70px;      /* 任务栏上方留白 */

    z-index: 5;

    display: grid;
    grid-template-columns: repeat(auto-fill, 84px);
    grid-template-rows: repeat(auto-fill, 88px);
    grid-auto-flow: column;
    gap: 8px;

    align-content: start;
    justify-content: start;

    pointer-events: none;   /* 让空白区域能右键 */
}
.dt-icons .dt-icon {
    pointer-events: auto;   /* 图标自身可点 */
}
.dt-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 84px;
    padding: 8px 4px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, transform .15s;
}
.dt-icon:hover {
    background: rgba(90, 140, 220, 0.22);
    border-color: rgba(140, 190, 240, 0.45);
    transform: translateY(-1px);
}
.dt-icon:active { transform: scale(.97); }

.dt-icon-img {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(20, 24, 34, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.dt-icon-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.dt-icon-glyph {
    font-size: 22px;
    line-height: 1;
}
.dt-icon-label {
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    letter-spacing: .3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ============ 窗口 ============ */
.dt-windows {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}
.dt-window {
    position: absolute;
    top: 80px;
    left: 200px;
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 140px);
    background: rgba(24, 28, 38, 0.96);
    border: 1px solid rgba(140, 190, 240, 0.35);
    border-radius: 10px;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    animation: dtWinIn .22s cubic-bezier(.2,.9,.3,1.05);
}
.dt-window[hidden] { display: none; }

@keyframes dtWinIn {
    from { opacity: 0; transform: scale(.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.dt-window-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px 8px 14px;
    background: linear-gradient(180deg, rgba(60, 100, 170, 0.55) 0%, rgba(40, 60, 100, 0.45) 100%);
    border-bottom: 1px solid rgba(140, 190, 240, 0.25);
    cursor: grab;
    user-select: none;
}
.dt-window-titlebar:active { cursor: grabbing; }

.dt-window-title {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    color: #e6ebf5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.dt-window-controls {
    display: flex;
    gap: 6px;
}
.dt-win-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 100%);
    color: #e6ebf5;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    transition: all .15s;
}
.dt-win-close:hover {
    background: linear-gradient(180deg, #e74c5a 0%, #b8293a 100%);
    border-color: #e74c5a;
}

.dt-window-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
    color: #dce0e6;
    font-size: 13px;
    line-height: 1.7;
    user-select: text;
    -webkit-user-select: text;
}
.dt-window-body::-webkit-scrollbar { width: 6px; }
.dt-window-body::-webkit-scrollbar-thumb {
    background: rgba(140, 190, 240, 0.35);
    border-radius: 3px;
}

.dt-empty {
    color: #7a8298;
    text-align: center;
    padding: 20px 0;
    font-size: 13px;
}

/* ---- 关于我窗口 ---- */
.dt-about-body { text-align: center; }
.dt-about-avatar {
    width: 84px;
    height: 84px;
    margin: 4px auto 14px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(140, 190, 240, 0.45);
    box-shadow: 0 0 20px rgba(91, 158, 232, 0.4);
}
.dt-about-avatar img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
.dt-about-name {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: #f0f4fa;
    letter-spacing: .5px;
}
.dt-about-domain {
    margin: 0 0 12px;
    font-size: 12px;
    color: #7a8298;
}
.dt-about-signature {
    margin: 8px 0 0;
    font-size: 13px;
    color: #c8d0dc;
    line-height: 1.7;
}
.dt-about-job {
    display: inline-block;
    margin: 10px 0 0;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #c8d0dc;
    background: rgba(90, 140, 220, 0.15);
    border: 1px solid rgba(140, 190, 240, 0.3);
    border-radius: 999px;
}
.dt-about-buttons {
    display: flex;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}
.dt-btn {
    padding: 8px 14px;
    font-size: 12px;
    font-family: inherit;
    color: #e6ebf5;
    text-decoration: none;
    background: rgba(90, 140, 220, 0.22);
    border: 1px solid rgba(140, 190, 240, 0.45);
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
}
.dt-btn:hover {
    background: rgba(120, 170, 240, 0.35);
    border-color: rgba(180, 220, 255, 0.85);
    box-shadow: 0 0 14px rgba(91, 158, 232, 0.55);
}

/* ---- 联系我 ---- */
.dt-contact-line {
    margin: 0 0 6px;
    font-size: 12px;
    color: #7a8298;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.dt-contact-email {
    color: #8ab4f8;
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
    transition: color .15s;
}
.dt-contact-email:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(139, 180, 240, 0.8);
}

/* ============ 任务栏 ============ */
.dt-taskbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 42px;
    z-index: 50;
    display: flex;
    align-items: center;
    padding: 0 8px;
    background: linear-gradient(180deg, rgba(28, 34, 48, 0.85) 0%, rgba(16, 20, 28, 0.95) 100%);
    border-top: 1px solid rgba(140, 190, 240, 0.25);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.dt-start {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 12px;
    background: linear-gradient(180deg, rgba(90, 140, 220, 0.55) 0%, rgba(50, 90, 160, 0.55) 100%);
    border: 1px solid rgba(140, 190, 240, 0.5);
    border-radius: 6px;
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.dt-start:hover {
    box-shadow: 0 0 14px rgba(91, 158, 232, 0.7);
    border-color: rgba(180, 220, 255, 0.9);
}
.dt-start-icon { font-size: 14px; }

.dt-tasks {
    flex: 1;
    display: flex;
    gap: 4px;
    margin: 0 12px;
    overflow-x: auto;
}
.dt-task {
    height: 30px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #c8d0dc;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.dt-task:hover { background: rgba(255, 255, 255, 0.12); }
.dt-task.active {
    background: rgba(90, 140, 220, 0.35);
    border-color: rgba(140, 190, 240, 0.6);
    color: #fff;
}

.dt-clock {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: #c8d0dc;
    padding: 0 12px;
    letter-spacing: .5px;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ============ 开始菜单 ============ */
.dt-startmenu {
    position: fixed;
    bottom: 50px;
    left: 8px;
    width: 240px;
    z-index: 60;
    background: rgba(24, 28, 38, 0.96);
    border: 1px solid rgba(140, 190, 240, 0.35);
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    overflow: hidden;
    animation: dtMenuIn .18s ease;
}
.dt-startmenu[hidden] { display: none; }
@keyframes dtMenuIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dt-startmenu-head {
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(60, 100, 170, 0.55) 0%, rgba(40, 60, 100, 0.45) 100%);
    border-bottom: 1px solid rgba(140, 190, 240, 0.25);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dt-startmenu-brand {
    font-size: 13px;
    font-weight: 700;
    color: #f0f4fa;
    letter-spacing: .5px;
}
.dt-startmenu-sub {
    font-size: 11px;
    color: #8ab4f8;
    letter-spacing: 1px;
}
.dt-startmenu-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}
.dt-startmenu-list button {
    display: block;
    width: 100%;
    padding: 9px 18px;
    background: transparent;
    border: none;
    color: #dce0e6;
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.dt-startmenu-list button:hover {
    background: rgba(90, 140, 220, 0.3);
    color: #fff;
}
.dt-startmenu-foot {
    padding: 8px 16px;
    border-top: 1px solid rgba(140, 190, 240, 0.2);
    background: rgba(0, 0, 0, 0.2);
}
.dt-startmenu-foot a {
    color: #8ab4f8;
    text-decoration: none;
    font-size: 12px;
    letter-spacing: .5px;
}
.dt-startmenu-foot a:hover { color: #fff; }

/* ============ 响应式 ============ */
@media (max-width: 640px) {
    .dt-icons {
        top: 12px;
        left: 12px;
        gap: 6px;
    }
    .dt-icon {
        width: 70px;
        padding: 6px 2px;
        font-size: 11px;
    }
    .dt-icon-img {
        width: 38px; height: 38px;
    }
    .dt-icon-glyph { font-size: 18px; }

    .dt-window {
        top: 40px !important;
        left: 8px !important;
        right: 8px;
        width: auto;
        max-width: none;
        max-height: calc(100vh - 100px);
    }
    .dt-window-titlebar { cursor: default; }

    .dt-start-text { display: none; }
    .dt-clock { padding: 0 6px; }
}

/* ============ 图标角标 ============ */
.dt-icon-img {
    position: relative;
}
.dt-icon-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: linear-gradient(180deg, #e74c5a 0%, #b8293a 100%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(231, 76, 90, 0.55);
    letter-spacing: 0;
}

/* ============ 公告列表 ============ */
.dt-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.dt-list-item {
    border-bottom: 1px solid rgba(140, 190, 240, 0.12);
}
.dt-list-item:last-child {
    border-bottom: none;
}
.dt-list-link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 4px;
    text-decoration: none;
    color: #dce0e6;
    transition: color .15s, padding .15s;
}
.dt-list-link:hover {
    color: #fff;
    padding-left: 8px;
}
.dt-list-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dt-list-date {
    flex-shrink: 0;
    font-size: 11px;
    color: #7a8298;
    font-variant-numeric: tabular-nums;
}

/* ============ 社团 / 网站条目 ============ */
.dt-entries {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dt-entry {
    border-radius: 8px;
    overflow: hidden;
}
.dt-entry-link,
.dt-entry {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none;
    color: inherit;
    transition: background .15s;
    border-radius: 8px;
}
.dt-entry-link:hover {
    background: rgba(90, 140, 220, 0.2);
}

.dt-entry-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.dt-entry-logo-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #8ab4f8;
}

.dt-entry-info {
    min-width: 0;
    flex: 1;
}
.dt-entry-title {
    font-size: 13px;
    font-weight: 500;
    color: #f0f4fa;
}
.dt-entry-intro {
    font-size: 12px;
    color: #8a92a3;
    margin-top: 2px;
    line-height: 1.5;
}

/* ============ 公告详情窗口 ============ */
.dt-list-link {
    /* 从 <a> 改成 <button> 后补一下按钮重置 */
    width: 100%;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    text-align: left;
}
.dt-list-link.loading {
    opacity: .5;
    pointer-events: none;
}

.dt-post-meta {
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(140, 190, 240, 0.15);
    font-size: 11px;
    color: #7a8298;
    letter-spacing: .5px;
}

.dt-post-body {
    color: #dce0e6;
    font-size: 13px;
    line-height: 1.75;
    word-wrap: break-word;
}
.dt-post-body p { margin: 0 0 1em; }
.dt-post-body h1,
.dt-post-body h2,
.dt-post-body h3,
.dt-post-body h4 {
    margin: 1.4em 0 .6em;
    color: #f0f4fa;
    font-weight: 700;
    line-height: 1.4;
}
.dt-post-body h1 { font-size: 18px; }
.dt-post-body h2 { font-size: 16px; }
.dt-post-body h3 { font-size: 15px; }
.dt-post-body a {
    color: #8ab4f8;
    text-decoration: none;
    border-bottom: 1px solid rgba(138, 180, 248, 0.4);
}
.dt-post-body a:hover { border-bottom-color: #8ab4f8; }
.dt-post-body ul,
.dt-post-body ol { margin: 0 0 1em; padding-left: 1.5em; }
.dt-post-body li { margin: .25em 0; }
.dt-post-body blockquote {
    margin: 1em 0;
    padding: 6px 14px;
    border-left: 3px solid rgba(140, 190, 240, 0.5);
    color: #b0b8c8;
    background: rgba(90, 140, 220, 0.08);
    border-radius: 0 6px 6px 0;
}
.dt-post-body code {
    padding: 1px 5px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 4px;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 12px;
    color: #ff9db0;
}
.dt-post-body pre {
    margin: 1em 0;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(140, 190, 240, 0.15);
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.6;
}
.dt-post-body pre code {
    background: transparent;
    color: #dce0e6;
    padding: 0;
}
.dt-post-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.dt-post-body hr {
    border: none;
    border-top: 1px solid rgba(140, 190, 240, 0.15);
    margin: 1.6em 0;
}
.dt-post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    font-size: 12px;
}
.dt-post-body th,
.dt-post-body td {
    padding: 6px 10px;
    border: 1px solid rgba(140, 190, 240, 0.15);
    text-align: left;
}
.dt-post-body th {
    background: rgba(90, 140, 220, 0.1);
    font-weight: 600;
}

/* ============ 最大化 ============ */
.dt-window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: calc(100vh - 42px) !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0;
    border: none;
}

/* ============ 最小化按钮 ============ */
.dt-win-min:hover {
    background: linear-gradient(180deg, #4a90e2 0%, #2a6cb5 100%);
    border-color: #4a90e2;
}

/* ============ 右键菜单 ============ */
.dt-context-menu {
    position: fixed;
    z-index: 200;
    min-width: 180px;
    padding: 6px;
    background: rgba(24, 28, 38, 0.97);
    border: 1px solid rgba(140, 190, 240, 0.35);
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    animation: dtMenuIn .15s ease;
}
.dt-context-menu[hidden] { display: none; }

.dt-context-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 5px;
    color: #dce0e6;
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.dt-context-item:hover {
    background: rgba(90, 140, 220, 0.3);
    color: #fff;
}
.dt-context-icon {
    display: inline-block;
    width: 16px;
    text-align: center;
    color: #8ab4f8;
    font-size: 13px;
}
.dt-context-sep {
    height: 1px;
    margin: 4px 8px;
    background: rgba(140, 190, 240, 0.15);
}

/* ============ 响应式 ============ */
@media (max-width: 640px) {
    .dt-window.maximized {
        height: calc(100vh - 42px) !important;
    }
}

/* ============================================================
   Konami 彩蛋 · 猫头阵（和 style.css 同款）
   ============================================================ */
.cat-swarm {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 8vh 0;
}

.cat-row {
    display: flex;
    gap: 32px;
    white-space: nowrap;
    width: max-content;
    will-change: transform;
}

.cat-item {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    opacity: 0.9;
}

@media (max-width: 640px) {
    .cat-item {
        width: 56px;
        height: 56px;
    }
    .cat-row { gap: 20px; }
}

/* ============ 最大化按钮 ============ */
.dt-win-max:hover {
    background: linear-gradient(180deg, #4a90e2 0%, #2a6cb5 100%);
    border-color: #4a90e2;
}

/* ============ 窗口边缘调整提示 ============ */
.dt-window {
    /* 防止拖动或调整时内容选中 */
    user-select: none;
}
.dt-window .dt-window-body {
    user-select: text;
    -webkit-user-select: text;
}

/* 窗口最小尺寸 */
.dt-window:not(.maximized) {
    min-width: 260px;
    min-height: 160px;
}

/* ============ 强制光标（边缘调整） ============ */
body.dt-resize-cursor,
body.dt-resize-cursor * {
    cursor: var(--dt-cursor, auto) !important;
}

/* ============ 关于我 · 社交图标 ============ */
.dt-about-icons {
    display: flex;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(140, 190, 240, 0.15);
}
.dt-about-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #a8b0c0;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s, transform .15s;
}
.dt-about-icon:hover {
    background: rgba(90, 140, 220, 0.2);
    color: #fff;
    transform: translateY(-2px);
}
.dt-about-icon.disabled {
    opacity: .4;
    cursor: default;
}
.dt-about-icon.disabled:hover {
    background: transparent;
    color: #a8b0c0;
    transform: none;
}

/* ============ 二维码弹窗 ============ */
.dt-qr-mask {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: qrMaskIn .18s ease;
}
.dt-qr-mask[hidden] { display: none; }
@keyframes qrMaskIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.dt-qr-dialog {
    position: relative;
    padding: 20px;
    background: rgba(24, 28, 38, 0.98);
    border: 1px solid rgba(140, 190, 240, 0.4);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: qrIn .22s cubic-bezier(.2,.9,.3,1.05);
}
@keyframes qrIn {
    from { transform: scale(.92); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
.dt-qr-dialog img {
    display: block;
    max-width: min(360px, 80vw);
    max-height: 70vh;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}
.dt-qr-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: background .15s;
}
.dt-qr-close:hover {
    background: rgba(231, 76, 90, 0.85);
}

/* ============ 背景说明 · 侧边卡片 ============ */
.dt-credit-panel {
    position: fixed;
    right: 0;
    bottom: 80px;
    z-index: 40;

    display: flex;
    width: 250px;

    background: rgba(24, 28, 38, 0.94);
    border: 1px solid rgba(140, 190, 240, 0.4);
    border-right: none;
    border-radius: 10px 0 0 10px;

    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.5);

    overflow: hidden;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;

    /* 收起：整块右移，只留右侧 28px（handle）露在外面 */
    transform: translateX(222px);
    transition: transform .32s cubic-bezier(.4, 0, .2, 1);
}
.dt-credit-panel.open {
    transform: translateX(0);
}
.dt-credit-panel:hover {
    border-color: rgba(180, 220, 255, 0.75);
}

/* 内容区 */
.dt-credit-content {
    flex: 1;
    min-width: 0;
    padding: 12px 14px;
}

.dt-credit-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #8ab4f8;
    margin-bottom: 6px;
}

.dt-credit-text {
    font-size: 12px;
    line-height: 1.55;
    color: #dce0e6;
    word-break: break-word;
}

/* 右侧把手（箭头） */
.dt-credit-handle {
    flex-shrink: 0;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c8d0dc;
    font-size: 16px;
}

.dt-credit-arrow {
    display: inline-block;
    transition: transform .3s ease;
}
.dt-credit-panel:not(.open) .dt-credit-arrow {
    transform: rotate(180deg);
}

@media (max-width: 640px) {
    .dt-credit-panel {
        width: 210px;
        transform: translateX(182px);
    }
}

/* 内容面板 */
.dt-credit-body {
    position: absolute;
    right: 26px;
    bottom: 0;
    transform: translateX(16px);
    opacity: 0;
    pointer-events: none;
    width: 220px;
    padding: 14px 18px;
    background: rgba(24, 28, 38, 0.94);
    border: 1px solid rgba(140, 190, 240, 0.4);
    border-radius: 10px 0 0 10px;
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    box-shadow: -8px 0 28px rgba(0, 0, 0, 0.5);
    transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .25s ease;
}
.dt-credit-panel.open .dt-credit-body {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.dt-credit-label {
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #8ab4f8;
    margin-bottom: 6px;
}

.dt-credit-text {
    font-size: 12px;
    line-height: 1.55;
    color: #dce0e6;
    word-break: break-word;
}

@media (max-width: 640px) {
    .dt-credit-body {
        width: 180px;
        padding: 12px 14px;
    }
}

/* ============ iframe 类应用窗口 ============ */
.dt-iframe-body {
    padding: 0 !important;
    overflow: hidden !important;
}
.dt-iframe-body iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
    background: #fff;
}

/* 拖动 / 调整大小时，iframe 不接收鼠标事件 */
body.dt-dragging .dt-iframe-body iframe,
body.dt-dragging .dt-window iframe {
    pointer-events: none !important;
}

@media (max-width: 640px) {
    .dt-win-max { display: none; }
}