打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

民间模板:NPC对话/style.css

来自EaseCation Wiki
/* 民间模板:NPC对话 样式 (Tkka 2026-10-25 10:11 版本) */

/* 外层容器 */
.npc-dialog {
    max-width: 600px;
    width: 100%;
    background-color: #c6c6c6;
    border: 2px solid #555;
    border-top-color: #eee;
    border-left-color: #eee;
    border-bottom-color: #333;
    border-right-color: #333;
    padding: 0 16px 12px 16px;
    margin: 0 auto;
    font-family: 'Microsoft YaHei', 'SimHei', sans-serif;
    box-sizing: border-box;
    box-shadow: inset 0 0 0 2px #8b8b8b;
}

/* 头部标题(平齐) */
.npc-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 8px 0 10px 0;
}

.npc-name {
    font-size: 16px;
    color: #444;
    font-weight: bold;
    word-break: break-word;
    white-space: pre-wrap;
}

.npc-close {
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 20px;
    color: #555;
    cursor: pointer;
    line-height: 1;
}

/* 内容区:头像 + 气泡(垂直居中) */
.npc-body {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
}

/* 肖像区(50x50 正方形,深色描边) */
.npc-portrait {
    width: 50px;
    min-width: 50px;
    height: 50px;
    flex-shrink: 0;
    background-color: #111;
    border: 2px solid #000;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-sizing: border-box;
}

/* 气泡区容器 */
.npc-bubble-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
}

/* 气泡本体(带圆角、粗边框和尾巴) */
.npc-bubble {
    background-color: #f2f2f2;
    border: 2px solid #555;
    border-radius: 6px;
    padding: 8px 12px;
    position: relative;
    width: 100%;
    min-height: 50px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 气泡文字 */
.npc-text {
    font-size: 15px;
    color: #222;
    line-height: 1.5;
    margin: 0;
    word-break: break-word;
    white-space: pre-wrap;
}

/* 气泡尾巴 - 内层(浅色) */
.npc-tail-inner {
    position: absolute;
    left: -9px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 9px solid #f2f2f2;
    z-index: 1;
}

/* 气泡尾巴 - 外层(深色边框) */
.npc-tail-outer {
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-right: 12px solid #555;
    z-index: 0;
}

/* 选项按钮行 */
.npc-option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

/* 单个选项按钮(紧凑3D像素风) */
.npc-option {
    flex: 1 1 30%;
    min-width: 100px;
    background-color: #c6c6c6;
    border: 2px solid #373737;
    box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #8b8b8b;
    padding: 5px 8px;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    cursor: pointer;
    text-align: center;
    box-sizing: border-box;
    word-break: break-word;
    white-space: pre-wrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 覆盖 McText 全局 .mctext 的 font-size:16px */
.npc-name .mctext {
    font-size: 16px;
}
.npc-text .mctext {
    font-size: 15px;
}
.npc-option .mctext {
    font-size: 14px;
}

/* 移动端适配:屏幕宽度小于768px时缩小字体 */
@media (max-width: 768px) {
    .npc-text {
        font-size: 12px;
    }
    .npc-text .mctext {
        font-size: 12px;
    }
}