* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==================== 一、 基础全局响应式底色 ==================== */
html,
body {
    width: 100%;
    min-height: 100vh;
}

body {
    background-image: url("resources/img/earth.jpg");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Google Sans", sans-serif;
}

.contents {
    padding-top: 80vh;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ==================== 二、 一言小组件本体 (Widget) ==================== */
.mtkit-excerpt-widget {
    width: min(320px, 80%);
    padding: 0.8em;
    background-color: rgba(var(--adt-colorBoard-Background) / var(--adt-colorAlpha-3));
    backdrop-filter: blur(2px) saturate(120%);
    -webkit-backdrop-filter: blur(2px) saturate(120%);
    border-radius: 24px;
    corner-shape: squircle;
    border: 1px solid rgba(var(--adt-colorBoard-Background) / var(--adt-colorAlpha-7));
    display: grid;
    grid-template-rows: auto 0fr;
    gap: 0;
    cursor: pointer;
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0);
    transition:
        backdrop-filter 0.5s ease,
        grid-template-rows 0.5s var(--adt-ease-out-expo),
        background-color 0.5s ease,
        gap 0.5s ease,
        border-color 0.5s ease,
        transform 0.4s var(--adt-ease-out-expo),
        box-shadow 0.4s var(--adt-ease-out-expo);
}

.mtkit-excerpt-widget p {
    font-size: 13px;
    line-height: 1.3em;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

.mtkit-ew-contents p {
    color: #FFFFFF;
    font-weight: 600;
}

.mtkit-ew-author {
    overflow: hidden;
    opacity: 0;
    color: rgba(var(--adt-colorBoard-White) / var(--adt-colorAlpha-50));
    text-align: right;
    transition: opacity 0.4s ease;
}

@media (color-gamut: p3) {
    .mtkit-ew-contents p {
        color: oklch(1 0 0);
    }
}

.mtkit-excerpt-widget:hover {
    grid-template-rows: auto 1fr;
    gap: 0.5em;
    backdrop-filter: blur(23px) saturate(120%);
    -webkit-backdrop-filter: blur(23px) saturate(120%);
    background-color: rgba(var(--adt-colorBoard-Background) / var(--adt-colorAlpha-7));
    border: 1px solid rgba(var(--adt-colorBoard-Background) / var(--adt-colorAlpha-13));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.mtkit-excerpt-widget:hover .mtkit-ew-author {
    opacity: 1;
}

/* ==================== 三、 全屏暗化遮罩层 ==================== */
.mtkit-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
    background-color: rgba(0, 0, 0, 0.07);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s var(--adt-ease-out-expo), visibility 0.5s var(--adt-ease-out-expo), backdrop-filter 0.5s var(--adt-ease-out-expo), -webkit-backdrop-filter 0.5s var(--adt-ease-out-expo);
}

.mtkit-dialog-overlay.active {
    opacity: 1;
    visibility: visible;
    /* backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); */
    background-color: rgba(var(--adt-colorBoard-Black) / var(--adt-colorAlpha-40));
}

/* ==================== 四、 详情窗体主框架 (重构版) ==================== */
.mtkit-dialog-sheet {
    position: fixed;
    z-index: 1000;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    display: flex;
    overflow: hidden;
    color: rgb(var(--adt-colorBoard-Label));
    opacity: 0;
    visibility: hidden;
    transition: transform 0.5s var(--adt-ease-out-expo), opacity 0.5s var(--adt-ease-out-expo), visibility 0.5s var(--adt-ease-out-expo);
}

/* 💻 4A. 桌面端 / 横屏布局规范 (左侧模糊，右侧纯白) */
@media (min-width: 769px) and (orientation: landscape) {
    .mtkit-dialog-sheet {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -45%) scale(0.96);
        width: min(800px, 80vw);
        height: min(600px, 80vh);
        max-width: 800px;
        max-height: 600px;
        border-radius: 24px;
        corner-shape: squircle;
        flex-direction: row;
        background-color: transparent;
        /* 容器透明，交由子列控色 */
        border: 1px solid rgba(var(--adt-colorBoard-Label) / var(--adt-colorAlpha-13));
    }

    /* 左侧：毛玻璃质感 */
    .mtkit-ds-left {
        width: 240px;
        flex-shrink: 0;
        background-color: rgba(var(--adt-colorBoard-Background) / var(--adt-colorAlpha-64));
        backdrop-filter: blur(30px) saturate(180%);
        -webkit-backdrop-filter: blur(30px) saturate(180%);
        border-right: 1px solid rgba(var(--adt-colorBoard-Label) / var(--adt-colorAlpha-7));
    }

    /* 右侧：纯色实体层 */
    .mtkit-ds-right {
        background-color: rgb(var(--adt-colorBoard-Background));
    }

    .mtkit-dialog-sheet.active {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 📱 4B. 移动端 / 竖屏布局规范 (整体全白，90%垂直高度抽屉) */
@media (max-width: 768px),
(orientation: portrait) {
    .mtkit-dialog-sheet {
        left: 0;
        bottom: 0;
        width: 100vw;
        height: 90vh;
        max-height: 90%;
        border-radius: 24px 24px 0 0;
        corner-shape: squircle;
        flex-direction: column;
        transform: translateY(100%);
        /* 💡 核心：移动端去掉全部模糊，整体呈现纯白底色 */
        background-color: rgb(var(--adt-colorBoard-Background));
        border: 1px solid rgba(var(--adt-colorBoard-Label) / var(--adt-colorAlpha-13));
        border-bottom: none;
    }

    .mtkit-dialog-sheet::before {
        content: '';
        display: block;
        width: 40px;
        height: 5px;
        background: rgba(var(--adt-colorBoard-Label) / var(--adt-colorAlpha-24));
        border-radius: 3px;
        corner-shape: squircle;
        margin: 10px auto 0 auto;
        flex-shrink: 0;
    }

    .mtkit-ds-top,
    .mtkit-ds-bottom {
        background-color: transparent;
    }

    .mtkit-ds-top {
        padding: 1.5em 1em;
        border-bottom: 1px solid rgba(var(--adt-colorBoard-Label) / var(--adt-colorAlpha-7));
    }

    .mtkit-ds-avatar {
        width: 72px;
        height: 72px;
    }

    .mtkit-ds-name {
        margin-top: 0.6em;
        font-size: 15px;
    }

    .mtkit-ds-bottom {
        padding: 1.5em;
    }

    .mtkit-dialog-sheet.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

/* ==================== 五、 窗体内部公用细节与间距微调 ==================== */
.mtkit-ds-left,
.mtkit-ds-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2em;
}

.mtkit-ds-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(var(--adt-colorBoard-Background) / var(--adt-colorAlpha-40));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mtkit-ds-name {
    margin-top: 1em;
    font-weight: 700;
    font-size: 16px;
}

.mtkit-ds-right,
.mtkit-ds-bottom {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2em;
    overflow: hidden;
}

/* 头部固定栏 */
.mtkit-ds-header {
    flex-shrink: 0;
    margin-bottom: 1.5em;
    border-bottom: 1px solid rgba(var(--adt-colorBoard-Label) / var(--adt-colorAlpha-13));
    padding-bottom: 1em;
}

.mtkit-ds-title {
    font-size: 18px;
    font-weight: 700;
    color: rgb(var(--adt-colorBoard-Label));
}

/* 滚动主容器 */
.mtkit-ds-scroll-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5em;
    scrollbar-width: thin;
}

.mtkit-ds-scroll-body::-webkit-scrollbar {
    width: 4px;
}

.mtkit-ds-scroll-body::-webkit-scrollbar-thumb {
    background: rgba(var(--adt-colorBoard-Label) / var(--adt-colorAlpha-24));
    border-radius: 4px;
    corner-shape: squircle;
}

/* 💡 优化：大段落原句高亮，并扩大与后方元素的呼吸间距 */
.mtkit-ds-quote {
    font-style: italic;
    opacity: 0.85;
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 2.5em;
    /* 扩大了和后面聊天区/Story的纵向距离 */
    padding-left: 0.5em;
    border-left: 3px solid rgb(var(--adt-colorBoard-Blue));
}

/* 💡 优化：Story 富文本内部元素行间距及版式细节优化 */
.mtkit-ds-item {
    margin-bottom: 2em;
    /* 撑开 Story 模块元素之间的纵向距离 */
}

.mtkit-ds-item h2 {
    font-size: 17px;
    font-weight: 700;
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    color: rgb(var(--adt-colorBoard-Label));
}

.mtkit-ds-item p {
    font-size: 14.5px;
    line-height: 1.65em;
    /* 💡 大幅放宽行高，阅读极度舒适，绝不拥挤 */
    color: rgba(var(--adt-colorBoard-Label) / var(--adt-colorAlpha-80));
    margin-bottom: 0.8em;
}

.mtkit-ds-item img {
    max-width: 100%;
    border-radius: 14px;
    corner-shape: squircle;
    margin: 0.8em 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* ==================== 六、 Chat（对话流）专属高级涂层样式 ==================== */
.mtkit-chat-container {
    display: flex;
    flex-direction: column;
    gap: 1.2em;
    margin-bottom: 2.5em;
    /* 💡 扩大了聊天区和后续 Story 之间的距离 */
    padding: 1.5em 1.2em;
    border-radius: 20px;
    corner-shape: squircle;
    /* 💡 核心：调用 ADT 调色板对应的 #F5F5F7 浅色背景图层（在暗色模式下会自动变暗） */
    background-color: rgba(var(--adt-colorBoard-Light) / var(--adt-colorAlpha-3));
    border: 1px solid rgba(var(--adt-colorBoard-Label) / var(--adt-colorAlpha-3));
}

.mtkit-chat-row {
    display: flex;
    gap: 0.8em;
    align-items: flex-start;
    width: 100%;
}

.mtkit-chat-row.right {
    flex-direction: row-reverse;
}

.mtkit-chat-row .mtkit-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.mtkit-chat-content-box {
    display: flex;
    flex-direction: column;
    max-width: 70%;
}

.mtkit-chat-row.right .mtkit-chat-content-box {
    align-items: flex-end;
}

.mtkit-chat-name {
    font-size: 11px;
    color: rgba(var(--adt-colorBoard-Label) / var(--adt-colorAlpha-40));
    margin-bottom: 0.3em;
    padding: 0 4px;
}

/* 对话气泡微调 */
.mtkit-chat-bubble {
    padding: 0.7em 1em;
    border-radius: 16px;
    corner-shape: squircle;
    font-size: 13.5px;
    line-height: 1.45;
}

/* 在 #F5F5F7 底色上，左侧聊天泡泡使用纯白色，右侧使用系统标准蓝色 */
.mtkit-chat-row.left .mtkit-chat-bubble {
    background-color: rgba(var(--adt-colorBoard-Light) / var(--adt-colorAlpha-7));
    color: rgb(var(--adt-colorBoard-Label));
    border-top-left-radius: 4px;
    corner-shape: squircle;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.mtkit-chat-row.right .mtkit-chat-bubble {
    background-color: rgb(var(--adt-colorBoard-Blue));
    color: #FFFFFF;
    border-top-right-radius: 4px;
    corner-shape: squircle;
}

.mtkit-chat-bubble img {
    max-width: 100%;
    border-radius: 10px;
    corner-shape: squircle;
    display: block;
}

/* ==================== 七、 WordPress 场景排版微调补丁 ==================== */
/* 防止部分 WP 主题在小组件空隙内自动插入无效的空白段落边距 */
.mtkit-excerpt-widget p,
.mtkit-chat-bubble p {
    margin: 0 !important;
}

/* 限制短代码直接塞入正文时，小组件本体居中显示 */
.entry-content .mtkit-excerpt-widget {
    margin-left: auto;
    margin-right: auto;
}