@charset "utf-8";
/*!
 * 酷猫评论系统 KMComment - 前台样式
 * 自适应（桌面 / 平板 / 手机）+ IE11 兼容
 * 说明：不使用 CSS 变量、grid、flex-gap；布局用 inline-block / float / absolute，
 * 需要弹性布局处补 -ms- 前缀，保证 IE11 正常显示。
 */

.km-comments,
.km-comments * { box-sizing: border-box; }

.km-comments {
    max-width: 860px;
    margin:-10px auto -20px ;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.75;
    color: #303845;
    text-align: left;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

.km-comments a { color: #409eff; text-decoration: none; }
.km-comments a:hover { color:#f30; text-decoration: none; }
.km-comments img { border: 0; }

/* ---------------- 标题 ---------------- */
.km-head {
    padding: 4px 0 14px;
    border-bottom: 1px solid #eceff4;
    margin-bottom: 20px;
    /* 整行不换行，右侧提示语过长时直接裁掉，不撑高标题区 */
    white-space: nowrap;
    overflow: hidden;
}
.km-title {
    font-size: 20px;
    font-weight: 700;
    color: #1b2432;
    letter-spacing: 0.01em;
}
.km-count { font-size: 13px; color: #98a1b0; margin-left: 2px; }

/* 提示语：与评论数同一行、靠右对齐；窄屏不换行，超出部分裁掉 */
.km-notice {
    float: right;
    max-width: 62%;
    margin-top: 7px;
    color: #98a1b0;
    font-size: 14px;
    font-weight: 500;
    line-height: 19px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------------- 表单 ---------------- */
.km-form {
    margin-bottom: 30px;
    padding: 18px;
    background: #fff;
    border: 1px solid #e9edf3;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(20, 32, 52, 0.04), 0 10px 28px -14px rgba(20, 32, 52, 0.14);
}

.km-form-title {
    margin-bottom: 14px;
    padding: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: #3d4757;
    border-bottom: 1px solid #f1f4f8;
}
.km-form-title:before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 1em;
    margin-right: 8px;
    border-radius: 2px;
    background: #409eff;
    vertical-align: -0.16em;
}

.km-replybar {
    margin-bottom: 12px;
    padding: 8px 12px;
    background: #f2f7ff;
    border-radius: 8px;
    font-size: 13px;
    color: #4a6b96;
}
.km-replybar .km-cancel-reply { float: right; color: #8b95a5; }
.km-replybar .km-cancel-reply:hover { color: #f56c6c; }

.km-cols { font-size: 0; margin: 0 -6px 12px; }
.km-col {
    display: inline-block;
    vertical-align: top;
    width: 33.3333%;
    padding: 0 6px;
    font-size: 14px;
}

.km-input,
.km-textarea {
    display: block;
    width: 100%;
    padding: 11px 13px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.5;
    color: #303845;
    background: #fbfcfe;
    border: 1px solid #e4e9f0;
    border-radius: 10px;
    outline: 0;
    -webkit-appearance: none;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.km-input:hover,
.km-textarea:hover { border-color: #d2dae5; }
.km-input:focus,
.km-textarea:focus {
    background: #fff;
    border-color: #409eff;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.13);
}

.km-input:-ms-input-placeholder,
.km-textarea:-ms-input-placeholder { color: #a2a9b3; }
.km-input::-webkit-input-placeholder,
.km-textarea::-webkit-input-placeholder { color: #a2a9b3; }
.km-input::-moz-placeholder,
.km-textarea::-moz-placeholder { color: #a2a9b3; }

.km-textwrap { position: relative; margin-bottom: 14px; }
.km-textarea {
    min-height: 108px;
    resize: vertical;
    overflow: auto;
}
.km-charcount {
    position: absolute;
    right: 12px;
    bottom: 8px;
    padding: 1px 3px;
    font-size: 12px;
    line-height: 1;
    color: #a8adb5;
    background: #fbfcfe;
    pointer-events: none;
}
.km-charcount-warn { color: #e6a23c; }
.km-charcount-over { color: #f56c6c; }

.km-hp {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.km-form-foot { overflow: hidden; }
.km-btn {
    display: inline-block;
    padding: 10px 24px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    background: #409eff;
    border: 1px solid #409eff;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    outline: 0;
    box-shadow: 0 1px 2px rgba(64, 158, 255, 0.28), 0 8px 18px -8px rgba(64, 158, 255, 0.55);
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.km-btn:hover {
    background: #2f8cf0;
    border-color: #2f8cf0;
    box-shadow: 0 2px 4px rgba(64, 158, 255, 0.3), 0 12px 24px -10px rgba(64, 158, 255, 0.65);
}
.km-btn:active { -webkit-transform: translateY(1px); -ms-transform: translateY(1px); transform: translateY(1px); }
.km-btn[disabled],
.km-btn-busy { opacity: 0.65; cursor: not-allowed; box-shadow: none; }
.km-btn-primary { float: right; }

.km-captcha { float: left; font-size: 0; padding-top: 4px; }
.km-captcha-input {
    display: inline-block;
    width: 104px;
    vertical-align: middle;
    font-size: 14px;
    margin-right: 8px;
}
.km-captcha-img {
    display: inline-block;
    width: 110px;
    height: 40px;
    vertical-align: middle;
    border: 1px solid #e4e9f0;
    border-radius: 10px;
    cursor: pointer;
    background: #f7f8fa;
}
.km-captcha-question {
    display: none;
    vertical-align: middle;
    font-size: 14px;
    color: #5b6675;
    margin-right: 8px;
    padding: 8px 12px;
    background: #f4f6fa;
    border-radius: 8px;
}
.km-captcha-refresh {
    display: inline-block;
    vertical-align: middle;
    font-size: 13px;
    margin-left: 8px;
    color: #98a1b0;
}

/* 提示语：悬浮在页面顶部居中，出现后自动收起，不占表单位置 */
.km-msg {
    position: fixed;
    top: 26px;
    left: 50%;
    z-index: 2147483000;
    max-width: 320px;
    padding: 11px 20px;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
    color: #fff;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 10px 30px -10px rgba(20, 32, 52, 0.5);
    word-wrap: break-word;
    opacity: 0;
    visibility: hidden;
    -webkit-transform: translateX(-50%) translateY(-10px);
    -ms-transform: translateX(-50%) translateY(-10px);
    transform: translateX(-50%) translateY(-10px);
    -webkit-transition: opacity 0.22s, visibility 0.22s, -webkit-transform 0.22s;
    transition: opacity 0.22s, visibility 0.22s, transform 0.22s;
}
.km-msg-show {
    opacity: 1;
    visibility: visible;
    -webkit-transform: translateX(-50%) translateY(0);
    -ms-transform: translateX(-50%) translateY(0);
    transform: translateX(-50%) translateY(0);
}
.km-msg-ok  { background: #2f9e56; }
.km-msg-err { background: #e5484d; }
.km-msg-ing { background: #4a5568; }
.km-msg-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    vertical-align: 2px;
}

/* ---------------- 评论列表 ---------------- */
.km-list { list-style: none; margin: 0; padding: 0; }
.km-list ul { list-style: none; margin: 0; }

.km-item {
    position: relative;
    padding: 0 0 0 64px;
    margin-bottom: 5px;
}
.km-avatar {
    position: absolute;
    left: 0;
    top: 0;
    width: 52px;
    height: 52px;
    border: 1px solid #ddd;
    border-radius: 50%;
    overflow: hidden;
    background: #f8f8f8;
    text-align: center;
}
.km-avatar-img {
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
}
.km-avatar-link { 
	display: block; 
	width: 100%; 
	height: 100%; 
	text-decoration: none; 
}
.km-letter {
    display: block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: #bbb;
    text-align: center;
    -webkit-user-select: none;
    user-select: none;
}

.km-meta { font-size: 13px; color: #999; margin-bottom: 3px; line-height: 1.6; }
.km-author { color: #444; font-weight: 700; font-size: 15px; }
.km-author a { color: inherit; text-decoration: none; }
/* 徽章：Waline 用的是描边小标签，不是实心色块 */
.km-badge {
    display: inline-block;
    font-style: normal;
    font-size: 12px;
    line-height: 17px;
    padding: 0 4px;
    margin-left: 6px;
    color: #409eff;
    background: transparent;
    border: 1px solid #409eff;
    border-radius: 4px;
    vertical-align: 1px;
}
.km-time { margin-left: 10px; font-size: 12px; color: #999; }

.km-content {
    font-size: 15px;
    color: #444;
	line-height: 2.3;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}
.km-content a { word-break: break-all; }

/* 注意：必须带 .km-comments 前缀。.km-comments a 的优先级（0,1,1）高于 .km-reply-link（0,1,0），
   不写前缀的话「回复」会被强制成链接蓝，与 Waline 里深灰的操作项不符。 */
.km-actions { font-size: 13px; margin-top: 4px; }
.km-comments .km-reply-link {
    display: inline-block;
    margin-left: -8px;
    padding: 1px 8px;
    margin-bottom: 10px;
    color: #666;
    border-radius: 6px;
    transition: color 0.25s, background 0.25s;
}
.km-comments .km-reply-link:hover {
    color: #409eff;
    background: #f0f0f0;
    text-decoration: none;
}

.km-children {
    margin-top: 14px;
    padding-left: 14px;      /* 与更深层保持一致：头像距左侧竖线 2+14 = 16px */
    border-left: 2px solid #f0f0f0;
}
.km-children .km-item { padding-left: 56px; margin-bottom: 14px; }
.km-children .km-avatar { width: 44px; height: 44px; }
.km-children .km-avatar-img,
.km-children .km-letter { width: 42px; height: 42px; }
.km-children .km-letter { line-height: 42px; font-size: 15px; }
.km-children .km-children { border-left-color: #f5f5f5; padding-left: 14px; }
.km-empty,
.km-loading {
    list-style: none;
    padding: 24px 0;
    text-align: center;
    color: #999;
    font-size: 13px;
}
.km-loading:before {
    content: "";
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 7px;
    vertical-align: -2px;
    border: 2px solid #e5e5e5;
    border-top-color: #409eff;
    border-radius: 50%;
    -webkit-animation: km-spin 0.8s linear infinite;
    animation: km-spin 0.8s linear infinite;
}
@-webkit-keyframes km-spin { to { -webkit-transform: rotate(360deg); } }
@keyframes km-spin { to { transform: rotate(360deg); } }
.km-retry { margin-left: 4px; }

/* ---------------- 分页 ---------------- */
.km-pager { margin-top: 20px; font-size: 0; }
.km-pager a,
.km-pager span {
    display: inline-block;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    margin: 0 6px 6px 0;
    font-size: 13px;
    line-height: 30px;
    text-align: center;
    color: #666;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 8px;
    vertical-align: middle;
    transition: border-color 0.25s, color 0.25s;
}
.km-pager a:hover { border-color: #409eff; color: #409eff; text-decoration: none; }
.km-pager .km-cur { border-color: #409eff; color: #409eff; }
.km-pager .km-pginfo { border-color: transparent; color: #999; padding: 0 6px; }

/* ---------------- 自适应 ---------------- */
@media (max-width: 640px) {
    .km-comments { padding: 0; }
    .km-title { font-size: 18px; }
    .km-notice { max-width: 56%; }
    .km-form { padding: 14px; border-radius: 12px; }
    .km-col { display: block; width: 100%; padding: 0; margin-bottom: 10px; }
    .km-cols { margin: 0 0 12px; }
    .km-form-foot { text-align: right; }
    .km-btn-primary { float: none; width: 100%; }
    .km-captcha { float: none; margin-bottom: 12px; text-align: left; }
    .km-captcha-input { width: 124px; }
    .km-msg { max-width: 86%; top: 18px; }

    /* —— 评论列表：Waline 风格 —— */
    .km-item { padding-left: 56px; margin-bottom: 14px; }
    .km-avatar { width: 44px; height: 44px; }
    .km-avatar-img,
    .km-letter { width: 42px; height: 42px; }
    .km-letter { line-height: 42px; font-size: 16px; }

    /* 窄屏下给嵌套回复足够的缩进，同时逐层收小头像，避免正文被挤成窄条 */
    .km-children { padding-left: 12px; margin-top: 12px; }
    .km-children .km-item { padding-left: 48px; margin-bottom: 12px; }
    .km-children .km-avatar { width: 38px; height: 38px; }
    .km-children .km-avatar-img,
    .km-children .km-letter { width: 36px; height: 36px; }
    .km-children .km-letter { line-height: 36px; font-size: 14px; }
    .km-children .km-children { padding-left: 12px; }
    .km-children .km-children .km-item { padding-left: 42px; }
    .km-children .km-children .km-avatar { width: 32px; height: 32px; }
    .km-children .km-children .km-avatar-img,
    .km-children .km-children .km-letter { width: 30px; height: 30px; }
    .km-children .km-children .km-letter { line-height: 30px; font-size: 13px; }
}

/* ==========================================================================
   夜间模式适配
   —— 针对本站主题的夜间模式（给 <body> 加 night 类，cookie 记忆）
   ========================================================================== */

body.night .km-comments { color: #f8fafc; }

/* 链接：保持组件自己的蓝色（站点夜间把链接改成近白，会盖掉这里的蓝色）。
   hover 必须显式写，否则会被站点的 body.night a:hover { color: #f30 } 改成橙红。 */
body.night .km-comments a { color: #6cb2ff; }
body.night .km-comments a:hover { color: #f30 }

/* ---------------- 标题栏 ---------------- */
body.night .km-head { border-bottom-color: #3b4a61; }
body.night .km-title { color: #f8fafc; }
body.night .km-count,
body.night .km-notice { color: #a8aab0; }

/* ---------------- 表单 ---------------- */
body.night .km-form {
    background: #334155;
    border-color: #3f5170;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.30), 0 10px 28px -14px rgba(0, 0, 0, 0.60);
}
body.night .km-form-title {
    color: #e2e8f0;
    border-bottom-color: #3f5170;
}

/* 输入框比面板再深一档，形成「凹陷」的层次 */
body.night .km-input,
body.night .km-textarea {
    color: #f8fafc;
    background: #1e293b;
    border-color: #475569;
}
body.night .km-input:hover,
body.night .km-textarea:hover { border-color: #5b6b83; }
body.night .km-input:focus,
body.night .km-textarea:focus {
    background: #1e293b;
    border-color: #409eff;
    box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.22);
}
body.night .km-input:-ms-input-placeholder,
body.night .km-textarea:-ms-input-placeholder { color: #94a3b8; }
body.night .km-input::-webkit-input-placeholder,
body.night .km-textarea::-webkit-input-placeholder { color: #94a3b8; }
body.night .km-input::-moz-placeholder,
body.night .km-textarea::-moz-placeholder { color: #94a3b8; }

body.night .km-charcount { color: #94a3b8; background: #1e293b; }

body.night .km-replybar { background: #26364f; color: #9ec3ef; }
body.night .km-replybar .km-cancel-reply { color: #94a3b8; }
body.night .km-replybar .km-cancel-reply:hover { color: #ff8a80; }

/* 验证码图是「深字浅底」，反相后正好变成浅字深底，融进深色表单。
   站点全局的 body.night img 压暗滤镜会被这条更具体的选择器覆盖掉。 */
body.night .km-captcha-img {
    border-color: #475569;
    background: #1e293b;
    filter: invert(0.92) hue-rotate(180deg);
}
body.night .km-captcha-question { background: #26364f; color: #cbd5e1; }
body.night .km-captcha-refresh { color: #a8aab0; }

/* 提交按钮：主色不变，只把投影换成深色环境下的量级 */
body.night .km-btn {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.30), 0 8px 18px -8px rgba(64, 158, 255, 0.45);
}
body.night .km-btn:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), 0 12px 24px -10px rgba(64, 158, 255, 0.55);
}

/* 悬浮提示 */
body.night .km-msg { box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.70); }

/* ---------------- 评论列表 ---------------- */
body.night .km-avatar { border-color: #475569; background: #1e293b; }
body.night .km-meta,
body.night .km-time { color: #a8aab0; }
body.night .km-author { color: #f8fafc; }
body.night .km-author a { color: inherit; }
body.night .km-content { color: #e2e8f0; }
body.night .km-badge { color: #6cb2ff; border-color: #6cb2ff; }
body.night .km-comments .km-reply-link { color: #a8aab0; }
body.night .km-comments .km-reply-link:hover { color: #6cb2ff; background: #3f4f66; }
body.night .km-children { border-left-color: #3f5170; }
body.night .km-children .km-children { border-left-color: #364662; }
body.night .km-empty,
body.night .km-loading { color: #a8aab0; }
body.night .km-loading:before { border-color: #475569; border-top-color: #409eff; }

/* ---------------- 分页 ---------------- */
body.night .km-pager a,
body.night .km-pager span { color: #a8aab0; border-color: #475569; }
body.night .km-pager a:hover { border-color: #409eff; color: #6cb2ff; }
body.night .km-pager .km-cur { border-color: #409eff; color: #6cb2ff; }
body.night .km-pager .km-pginfo { border-color: transparent; color: #94a3b8; }
