/* +----------------------------------------------------------------------
/* | Static Plugin for ThinkAdmin
/* +----------------------------------------------------------------------
/* | 官方网站: https://thinkadmin.top
/* +----------------------------------------------------------------------
/* | 版权所有 2014~2025 ThinkAdmin [ thinkadmin.top ]
/* +----------------------------------------------------------------------
/* | 开源协议 ( https://mit-license.org )
/* | 免责声明 ( https://thinkadmin.top/disclaimer )
/* +----------------------------------------------------------------------
/* | gitee 代码仓库：https://gitee.com/zoujingli/think-plugs-static
/* | github 代码仓库：https://github.com/zoujingli/think-plugs-static
/* +----------------------------------------------------------------------
/* | 自定义后台扩展样式，需要在加载 console.css 后载入
/* | 使用 composer require zoujingli/think-plugs-static 时不会更新此文件
/* +---------------------------------------------------------------------- */

.layui-layer-page .cke,
.layui-layer-page .cke_inner,
.layui-layer-page .ck-editor {
    max-width: 100% !important;
}

.layui-layer-page .layui-layer-content {
    overflow-x: hidden;
}

/* 列表行鼠标移入加深；layui 默认移入色与斑马纹同为 #f8f8f8，偶数行看不出 */
.layui-table tbody tr.layui-table-hover:not(.layui-table-checked),
.layui-table tbody tr:hover:not(.layui-table-checked),
.layui-table[lay-even] tbody tr:nth-child(even).layui-table-hover:not(.layui-table-checked),
.layui-table[lay-even] tbody tr:nth-child(even):hover:not(.layui-table-checked) {
    background-color: #e9eef5;
}

.visit-remark-form .cke {
    width: 100% !important;
}

.spo-config-form .layui-form-label {
    width: 90px;
    white-space: nowrap;
}

.spo-config-form .layui-input-block {
    margin-left: 120px;
}

.spo-config-form .spo-form-tips {
    display: block;
    margin-top: 4px;
    line-height: 18px;
    color: #999;
    font-size: 12px;
}

.spo-config-form .layui-elem-field {
    margin-bottom: 16px;
}

.layui-table.spo-dingtalk-table {
    margin: 0;
}

.layui-table.spo-dingtalk-table th,
.layui-table.spo-dingtalk-table td {
    padding: 6px 10px;
    height: auto;
    min-height: 0;
    line-height: 1.4;
    vertical-align: middle;
}

.layui-table.spo-dingtalk-table input.layui-input {
    display: block;
    width: 100%;
    height: 38px;
    line-height: 38px;
    margin: 0;
    box-sizing: border-box;
}

.mail-template-form {
    box-sizing: border-box;
}

.mail-template-form .mail-template-body {
    padding-top: 8px !important;
    padding-bottom: 0 !important;
}

.mail-template-form .mail-template-actions {
    margin: 0;
    padding: 0 0 10px;
    background: #fff;
}

.mail-template-form .mail-template-actions .hr-line-dashed {
    margin: 0 0 10px;
}

/* 邮件模板弹层：全程禁止外层滚动，避免加载前后滚动条闪动 */
.layui-layer.mail-template-layer > .layui-layer-content {
    overflow: hidden !important;
}

/* 编辑器未就绪：占位，避免原始 HTML 闪一下 */
.mail-template-form:not(.is-editor-ready) textarea[data-editor] {
    display: block;
    width: 100%;
    height: 320px;
    min-height: 320px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    resize: none;
}

.mail-template-form.is-editor-fallback textarea[data-editor] {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.mail-template-form .mail-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.mail-template-form .mail-editor-toolbar-tip {
    color: #98a2b3;
    font-size: 12px;
}

/* 壳子高度锁死内容区；工具栏单独在外，避免被裁切 */
.mail-template-form .mail-editor-shell {
    position: relative;
    height: 360px;
    min-height: 360px;
    max-height: 360px;
    overflow: hidden;
}

.mail-template-form:not(.is-editor-ready) .mail-editor-shell::before {
    content: '编辑器加载中…';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #98a2b3;
    font-size: 13px;
    background: #f7f8fa;
    border: 1px solid #e8ebf0;
    pointer-events: none;
}

.mail-template-form .cke {
    position: relative;
    z-index: 2;
    width: 100% !important;
    max-height: 360px;
    overflow: hidden;
}

/* 正文超出时只在编辑器内滚动，不撑高弹层 */
.mail-template-form .cke_contents {
    height: 320px !important;
    max-height: 320px !important;
    overflow: auto !important;
}

.mail-template-form .mail-editor-shell .ck.ck-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mail-template-form .mail-editor-shell .ck.ck-editor__main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* 编辑区吃掉工具栏以外的剩余高度，避免工具栏换行时底边框被外层裁掉 */
.mail-template-form .ck-editor__editable,
.mail-template-form .ck-editor__editable_inline {
    flex: 1;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
}

.mail-template-form .ck.ck-editor__main > .ck-editor__editable.ck-focused:not(.ck-editor__nested-editable) {
    border-color: var(--ck-color-base-border) !important;
    box-shadow: none !important;
}

.ck.ck-editor__editable.spo-format-painting,
.ck.ck-editor__editable.spo-format-painting * {
    cursor: url(../plugs/ckeditor4/plugins/copyformatting/cursors/cursor.svg) 12 1, text !important;
}

.ck.ck-button.spo-format-painter.is-sticky {
    box-shadow: inset 0 0 0 1px #1677ff;
}

.mail-template-form .cke_bottom {
    display: none !important;
}

.spo-mail-preview {
    --spo-mail-ink: #1c2430;
    --spo-mail-muted: #7a8699;
    --spo-mail-line: #e6ebf0;
    --spo-mail-stage: #eef2f5;
    --spo-mail-paper: #ffffff;
    --spo-mail-accent: #16b777;
    padding: 0;
    min-height: 280px;
    background: var(--spo-mail-stage);
}

.spo-mail-preview-shell {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--spo-mail-stage, #eef2f5);
}

.spo-mail-preview-shell > .spo-mail-letter {
    flex: 1 1 auto;
    min-height: 0;
}

.spo-mail-preview-stage {
    padding: 18px 20px 20px;
}

.spo-mail-preview-paper {
    overflow: hidden;
    background: var(--spo-mail-paper);
    border: 1px solid #dde3ea;
    border-radius: 10px;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .7) inset,
        0 10px 28px rgba(28, 36, 48, .06);
}

.spo-mail-preview-paper::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--spo-mail-accent) 0%, #4fd6a0 55%, #a7e8cd 100%);
}

.spo-mail-preview-head {
    padding: 16px 22px 14px;
    background: linear-gradient(180deg, #fbfcfd 0%, #ffffff 100%);
}

.spo-mail-preview-meta {
    margin-bottom: 10px;
}

.spo-mail-preview-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    color: #0f766e;
    background: #ecfdf7;
    border: 1px solid #c6f0e0;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    line-height: 20px;
}

.spo-mail-preview-label {
    margin-bottom: 6px;
    color: var(--spo-mail-muted);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .08em;
    line-height: 1;
    text-transform: uppercase;
}

.spo-mail-preview-subject {
    color: var(--spo-mail-ink);
    font-size: 18px;
    font-weight: 650;
    letter-spacing: -.01em;
    line-height: 1.4;
    word-break: break-word;
}

.spo-mail-preview-divider {
    height: 1px;
    margin: 0 22px;
    background: linear-gradient(90deg, transparent, var(--spo-mail-line) 12%, var(--spo-mail-line) 88%, transparent);
}

.spo-mail-preview-body {
    position: relative;
    padding: 0;
    background: var(--spo-mail-paper);
}

.spo-mail-preview-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 240px;
    color: var(--spo-mail-muted);
    font-size: 13px;
    background: var(--spo-mail-paper);
    transition: opacity .22s ease;
}

.spo-mail-preview-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--spo-mail-accent);
    animation: spo-mail-preview-pulse 1s ease-in-out infinite;
}

@keyframes spo-mail-preview-pulse {
    0%, 100% { opacity: .35; transform: scale(.85); }
    50% { opacity: 1; transform: scale(1); }
}

.spo-mail-preview.is-ready .spo-mail-preview-loading {
    opacity: 0;
    pointer-events: none;
}

.spo-mail-letter-frame {
    display: block;
    width: 100%;
    min-height: 240px;
    border: 0;
    background: transparent;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .28s ease, transform .28s ease;
}

.spo-mail-preview.is-ready .spo-mail-letter-frame {
    opacity: 1;
    transform: translateY(0);
}

.spo-mail-subject {
    color: #16b777;
    cursor: pointer;
}

.spo-mail-subject:hover {
    text-decoration: underline;
}

.spo-mail-mono {
    color: #666;
    font-family: Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}

.spo-mail-pill {
    display: inline-block;
    min-width: 52px;
    height: 22px;
    padding: 0 8px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 500;
    line-height: 22px;
}

.spo-mail-pill-wait {
    color: #d48806;
    background: #fff7e6;
}

.spo-mail-pill-run {
    color: #1677ff;
    background: #e6f4ff;
}

.spo-mail-pill-ok {
    color: #389e0d;
    background: #f6ffed;
}

.spo-mail-pill-warn {
    color: #d4380d;
    background: #fff2e8;
}

.spo-mail-pill-bad {
    color: #cf1322;
    background: #fff1f0;
}

.spo-mail-pill-mute {
    color: #8c8c8c;
    background: #f5f5f5;
}

.spo-mail-preview-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 0 20px 18px;
    background: transparent;
    border-top: 0;
}

.spo-mail-preview-actions-hint {
    margin-right: auto;
    color: #8a95a5;
    font-size: 12px;
    line-height: 1.4;
}

.spo-mail-preview-actions .layui-btn {
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(22, 119, 255, .12);
}

.spo-mail-error {
    color: #cf1322;
    line-height: 1.45;
    word-break: break-word;
}

.spo-mail-fail-tip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    padding: 10px 14px;
    color: #a8071a;
    background: #fff1f0;
    border: 1px solid #ffa39e;
    border-radius: 6px;
    line-height: 1.55;
}

.spo-mail-fail-tip b {
    margin: 0 2px;
}

.spo-mail-row-flash {
    animation: spo-mail-row-flash 1.2s ease 3;
}

.spo-mail-row-flash td {
    background: #fff7e6 !important;
}

@keyframes spo-mail-row-flash {
    0%, 100% { background-color: transparent; }
    40% { background-color: #fff7e6; }
}

.mail-send-debug-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 12px;
    padding: 12px 14px;
    color: #ad6800;
    background: linear-gradient(90deg, #fff7e6 0%, #fffbe6 100%);
    border: 1px solid #ffd666;
    border-radius: 6px;
    line-height: 1.55;
}

.mail-send-debug-banner > .layui-icon {
    margin-top: 2px;
    font-size: 18px;
    color: #d48806;
}

.mail-send-debug-banner b {
    display: block;
    margin-bottom: 2px;
    color: #ad4e00;
    font-size: 14px;
}

.mail-send-debug-banner em {
    font-style: normal;
    font-weight: 600;
    color: #d46b08;
}

.mail-send-tip {
    margin: 0 0 12px;
    padding: 12px 14px;
    background: #f8fafb;
    border: 1px solid #eef1f4;
    border-radius: 6px;
}

.mail-send-tip-text {
    margin-bottom: 10px;
    color: #888;
    line-height: 22px;
}

.mail-send-tip .count {
    margin-bottom: 10px;
    color: #333;
}

.mail-send-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.mail-send-bar .count {
    color: #333;
}

.mail-send-tip .count b,
.mail-send-bar .count b {
    margin: 0 2px;
    color: #16b777;
}

.mail-send-template {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mail-send-template-label {
    color: #333;
    font-size: 13px;
    white-space: nowrap;
}

.mail-send-template .layui-form {
    margin: 0;
}

.mail-send-template .layui-form-select {
    width: 260px;
}

.mail-send-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.mail-send-page .layui-table-checked,
.mail-send-page .layui-table-checked.layui-table-click,
.mail-send-page .layui-table-checked.layui-table-hover {
    background-color: #fff;
}

.mail-send-page .layui-table[lay-even] tbody tr:nth-child(even).layui-table-checked,
.mail-send-page .layui-table[lay-even] tbody tr:nth-child(even).layui-table-checked.layui-table-click,
.mail-send-page .layui-table[lay-even] tbody tr:nth-child(even).layui-table-checked.layui-table-hover {
    background-color: #f8f8f8;
}
