/**
 * 卡尼奶主题 用户中心样式
 * 结构与用户中心：author-header + user-center + drawer-sm。
 * 全部规则收敛于 .knn-uc 作用域，避免污染全站其它元素。
 */

/*---------- 变量映射 ----------*/
.knn-uc {
  --uc-page-bg: #f4f8fd;
  --uc-surface: #ffffff;
  --uc-surface-soft: #f8fbff;
  --uc-primary: #1683ff;
  --uc-primary-hover: #0878e8;
  --uc-primary-soft: #eaf5ff;
  --uc-title: #102346;
  --uc-text: #506684;
  --uc-muted: #8fa0ba;
  --uc-border: #e4ecf6;
  --uc-success: #22c77a;
  --uc-warning: #ffaa2c;
  --uc-danger: #ff5d73;
  --uc-shadow: 0 12px 36px rgba(50, 84, 124, 0.1);
  --uc-shadow-hover: 0 16px 42px rgba(50, 84, 124, 0.15);
  --main-bg-color: var(--knn-bg-color-card, #fff);
  --body-bg-color: var(--knn-bg-color, #f5f6f7);
  --main-shadow: var(--knn-shadow-color, rgba(116, 116, 116, 0.08));
  --main-radius: 8px;
  --mini-radius: calc(var(--main-radius) / 1.4);
  --muted-color: #777;
  --muted-2-color: #999;
  --muted-3-color: #b1b1b1;
  --muted-border-color: rgba(0, 0, 0, 0.03);
  --main-border-color: rgba(50, 50, 50, 0.06);
  --theme-color: var(--knn-color-primary, #f04494);
  --focus-color: var(--theme-color);
  --focus-color-opacity1: rgba(0, 122, 255, 0.1);
  color: var(--knn-text-color, #4e5358);
}

body.dark-mode .knn-uc,
body.dark-mode-auto .knn-uc {
  --uc-page-bg: #0e151d;
  --uc-surface: #252525;
  --uc-surface-soft: #303030;
  --uc-primary: #4da3ff;
  --uc-primary-hover: #72b6ff;
  --uc-primary-soft: rgba(77, 163, 255, 0.14);
  --uc-title: #eef6ff;
  --uc-text: #a8b9cc;
  --uc-muted: #758ba3;
  --uc-border: rgba(255, 255, 255, 0.09);
  --uc-success: #3ad693;
  --uc-warning: #ffba4a;
  --uc-danger: #ff7185;
  --uc-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
  --uc-shadow-hover: 0 18px 48px rgba(0, 0, 0, 0.3);
  --main-shadow: rgba(24, 24, 24, 0.1);
  --muted-color: #b4b6bb;
  --muted-2-color: #888a8f;
  --muted-3-color: #636469;
  --main-border-color: rgba(114, 114, 114, 0.1);
  --muted-border-color: rgba(184, 184, 184, 0.02);
}

/*---------- SVG 图标----------*/
.knn-uc svg {
  fill: currentColor;
  height: 1em;
  overflow: hidden;
  vertical-align: -0.15em;
  width: 1em;
}

/*---------- 等级 PNG 图标----------*/
.knn-uc .img-icon {
  display: inline-block;
  height: 1.1em;
  max-width: 6em;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  vertical-align: -0.15em;
}
.knn-uc .img-icon img { height: 100%; }

/*---------- flex 布局工具 ----------*/
.knn-uc .flex { display: flex; }
.knn-uc .inflex { display: inline-flex; }
.knn-uc .flex.hh { flex-wrap: wrap; }
.knn-uc .flex.xx { flex-direction: column; }
.knn-uc .flex.ac { align-items: center; }
.knn-uc .flex.at { align-items: flex-start; }
.knn-uc .flex.jc { align-items: center; justify-content: center; }
.knn-uc .flex.jsb { justify-content: space-between; }
.knn-uc .flex.jsa { justify-content: space-around; }
.knn-uc .flex .flex0 { flex: none; }
.knn-uc .flex .flex1 { flex: 1; overflow: hidden; }

/*---------- 通用工具 ----------*/
.knn-uc .relative { position: relative; }
.knn-uc .absolute { position: absolute; }
.knn-uc .hide { display: none; }
.knn-uc .text-center { text-align: center; }
.knn-uc .font-bold { font-weight: bold; }
.knn-uc .opacity5 { opacity: 0.5; }

.knn-uc .px12 { font-size: 12px; }
.knn-uc .em09 { font-size: 0.9em; }
.knn-uc .em12 { font-size: 1.2em; }
.knn-uc .em14 { font-size: 1.4em; }
.knn-uc .em16 { font-size: 1.6em; }
.knn-uc .em2x { font-size: 2em; }
.knn-uc .em4x { font-size: 4em; }

.knn-uc .muted-color { color: var(--muted-color); }
.knn-uc .muted-2-color { color: var(--muted-2-color); }
.knn-uc .muted-3-color { color: var(--muted-3-color); }
.knn-uc .main-bg { background: var(--main-bg-color); }

.knn-uc .mt3 { margin-top: 3px; }
.knn-uc .mt6 { margin-top: 6px; }
.knn-uc .mt10 { margin-top: 10px; }
.knn-uc .mb6 { margin-bottom: 6px; }
.knn-uc .mb10 { margin-bottom: 10px; }
.knn-uc .mb20 { margin-bottom: 20px; }
.knn-uc .mb40 { margin-bottom: 40px; }
.knn-uc .ml3 { margin-left: 3px; }
.knn-uc .ml6 { margin-left: 6px; }
.knn-uc .ml10 { margin-left: 10px; }
.knn-uc .mr3 { margin-right: 3px; }
.knn-uc .mr6 { margin-right: 6px; }
.knn-uc .mr10 { margin-right: 10px; }
.knn-uc .padding-6 { padding: 6px; }
.knn-uc .padding-10 { padding: 10px; }
.knn-uc .padding-w10 { padding-left: 10px; padding-right: 10px; }
.knn-uc .radius8 { border-radius: 8px; }

/*---------- 卡片 ----------*/
.knn-uc .knn-widget {
  background-color: var(--main-bg-color);
  border-radius: var(--main-radius);
  box-shadow: 0 0 10px var(--main-shadow);
  clear: both;
  margin-bottom: 20px;
  padding: 15px;
}

/*---------- 按钮 / 徽章 ----------*/
.knn-uc .but,
.knn-uc .badg {
  --this-bg: rgba(136, 136, 136, 0.1);
  --this-border: transparent;
  --this-color: #888;
  --this-shadow: none;
  background: var(--this-bg);
  border: 1px solid var(--this-border);
  border-radius: 4px;
  box-shadow: var(--this-shadow);
  color: var(--this-color);
  display: inline-block;
  font-weight: normal;
  line-height: 1.44;
  padding: 0.3em 0.6em;
  text-align: center;
  text-shadow: 0 0 0;
  transition: 0.15s;
  vertical-align: middle;
}
.knn-uc .but a { color: inherit; }
.knn-uc .but.pw-1em { padding-right: 1em; padding-left: 1em; }
.knn-uc .but .icon,
.knn-uc .but > .fa { margin-right: 0.25em; }
.knn-uc .but.radius,
.knn-uc .badg.radius { border-radius: 50px; padding: 0.3em 1em; }
.knn-uc .but:hover { opacity: 0.8; color: var(--this-color); }

/*---------- 颜色类 ----------*/
.knn-uc .c-gray { --this-color: #888; --this-bg: rgba(136, 136, 136, 0.1); }
.knn-uc .c-red { --this-color: #ff5473; --this-bg: rgba(255, 84, 115, 0.1); }
.knn-uc .c-yellow { --this-color: #ff6f06; --this-bg: rgba(255, 111, 6, 0.1); }
.knn-uc .c-blue { --this-color: #2997f7; --this-bg: rgba(41, 151, 247, 0.1); }
.knn-uc .c-cyan { --this-color: #09a4a1; --this-bg: rgba(8, 196, 193, 0.1); }
.knn-uc .c-green { --this-color: #18a52a; --this-bg: rgba(18, 185, 40, 0.1); }
.knn-uc .c-purple { --this-color: #e434e1; --this-bg: rgba(213, 72, 245, 0.1); }
.knn-uc .c-blue, .knn-uc .c-green, .knn-uc .c-purple, .knn-uc .c-red { color: var(--this-color); }

/*---------- 头像 ----------*/
.knn-uc .avatar {
  width: 100%;
  height: 100%;
  transition: all 0.2s;
  overflow: hidden;
  object-fit: cover;
  border-radius: 100px;
  display: inline-block;
}
.knn-uc .avatar-img,
.knn-uc .avatar-lg {
  --this-size: 38px;
  display: inline-block;
  flex-shrink: 0;
  height: var(--this-size);
  position: relative;
  width: var(--this-size);
}
.knn-uc .avatar-lg { --this-size: 80px; }
.knn-uc .avatar-mini { --this-size: 20px; }

/*---------- 徽章 badge / badg-sm ----------*/
.knn-uc badge {
  font-size: 0.8em;
  line-height: 1.2;
  padding: 0.1em 0.4em;
  min-width: 0.8em;
  display: inline-block;
  vertical-align: 0.1em;
  border-radius: 50px;
  background: var(--this-bg);
  color: var(--this-color);
  --this-color: #fff;
  --this-bg: #fe3459;
  text-align: center;
}
.knn-uc .badg.p2-10,
.knn-uc badge.p2-10 { padding: 2px 10px; }
.knn-uc .badg.badg-sm {
  font-size: 0.8em;
  padding: 0 0.2em;
  vertical-align: 0.1em;
  min-width: 1.6em;
}
.knn-uc .checkin-mini-box > .badg.badg-sm {
  display: block;
  margin: 2px;
  padding: 0.2em;
  line-height: 1.2;
}
.knn-uc .smail { font-size: 0.8em; }

/* 填充色（背景色）变体 */
.knn-uc .b-green { --this-bg: #12b928; --this-color: #fff; color: var(--this-color); background: var(--this-bg); }
.knn-uc .b-purple { --this-bg: #d448f5; --this-color: #fff; color: var(--this-color); background: var(--this-bg); }
.knn-uc .b-blue { --this-bg: #2997f7; --this-color: #fff; color: var(--this-color); background: var(--this-bg); }

/*---------- 签到弹窗 ----------*/
.knn-uc-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.knn-uc-modal.knn-open { display: flex; }
.knn-uc-modal.knn-open .knn-uc-modal-mask {
  animation: knn-fade-in 0.3s ease forwards;
}
.knn-uc-modal.knn-open .knn-uc-modal-dialog {
  animation: knn-modal-in 0.4s cubic-bezier(0.28, 0.9, 0.34, 0.99) forwards;
}
@keyframes knn-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes knn-modal-in {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}
.knn-uc-modal .knn-uc-modal-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.knn-uc-modal .knn-uc-modal-dialog {
  position: relative;
  width: 400px;
  max-width: calc(100% - 20px);
  background: var(--main-bg-color);
  border-radius: var(--main-radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  z-index: 1;
}
.knn-uc-modal .knn-modal-loading {
  display: none;
  align-items: center;
  justify-content: center;
  height: 120px;
  opacity: 0.5;
}
.knn-uc-modal .knn-modal-loading .loading-circle {
  width: 2em;
  height: 2em;
  animation: knn-rotate 2s linear infinite;
  fill: none;
}
.knn-uc-modal .knn-modal-loading .loading-circle circle {
  animation: knn-dash 1.5s ease-in-out infinite;
  stroke-dasharray: 90, 150;
  stroke-dashoffset: 0;
  stroke-width: 3;
  stroke: var(--muted-2-color);
  stroke-linecap: round;
}
@keyframes knn-rotate {
  100% { transform: rotate(360deg); }
}
@keyframes knn-dash {
  0% { stroke-dasharray: 1, 200; stroke-dashoffset: 0; }
  50% { stroke-dasharray: 89, 200; stroke-dashoffset: -35px; }
  100% { stroke-dasharray: 89, 200; stroke-dashoffset: -124px; }
}
.knn-uc-modal .modal-colorful-header {
  border-radius: var(--main-radius) var(--main-radius) 0 0;
  background-size: 120%;
  position: relative;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4em;
  --this-bg: rgba(41, 151, 247, 0.6);
  --this-color: #fff;
}
.knn-uc-modal .modal-colorful-header > .close {
  position: absolute;
  right: 10px; top: 10px;
  color: var(--this-color);
  opacity: 0.6;
  font-size: 18px;
  z-index: 9;
  cursor: pointer;
}
.knn-uc-modal .modal-colorful-body { padding: 15px; }
.knn-uc-modal .modal-colorful-body .knn-widget { margin-bottom: 0; }

/*
 * 签到弹窗的彩色头部处于正常文档流，已经自身占据 120px 高度。
 * 兼容样式中的 `.modal-colorful-header + *` 顶部让位只供绝对定位头部使用，
 * 在签到弹窗中必须归零，否则正文前会重复多出 120px 空白。
 */
#knn-checkin-modal .modal-colorful-header + .modal-colorful-body {
  margin-top: 0;
}

/*---------- 多彩背景 ----------*/
.knn-uc .colorful-bg {
  background: var(--this-bg);
  background-size: 120%;
  color: var(--this-color);
  overflow: hidden;
  position: relative;
}
.knn-uc .colorful-bg > .colorful-make::after,
.knn-uc .colorful-bg > .colorful-make::before,
.knn-uc .colorful-bg > .colorful-make {
  background: var(--this-bg);
  border-radius: 100%;
  color: var(--this-color);
  content: ' ';
  position: absolute;
}
.knn-uc .colorful-bg > .colorful-make { bottom: 0; height: 290px; width: 323px; top: 60%; }
.knn-uc .colorful-bg > .colorful-make::before {
  right: -558px; bottom: 0; height: 300px; width: 677px; top: -325px;
  transform: rotate(341deg); opacity: 0.6;
}
.knn-uc .colorful-bg > .colorful-make::after {
  left: -262px; bottom: 0; height: 214px; width: 402px; top: -170px;
  transform: rotate(326deg); opacity: 0.4;
}
.knn-uc .colorful-bg > .colorful-make + * { position: relative; }
.knn-uc-modal .modal-colorful-header.colorful-bg > .colorful-make {
  animation: knn-random1 120s linear infinite;
}
@keyframes knn-random1 {
  from { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  20% { transform: translate3d(-30px, -20px, 50px) rotate(87deg) scale(0.9); }
  65% { transform: translate3d(-80px, -40px, 0px) rotate(156deg) scale(0.6); }
  to { transform: translate3d(0, 0, 0) rotate(360deg) scale(1); }
}
.knn-uc .jb-vip1 {
  --this-bg: linear-gradient(25deg, #eabe7b 10%, #f5e3c7 70%, #edc788 100%);
  --this-color: #866127;
}

.knn-uc .linear-mask {
  background-image: linear-gradient(0deg, rgba(29, 41, 49, 0.4) 3em, rgba(255, 255, 255, 0) 8em);
}

/*---------- 用户中心头部 ----------*/
.knn-uc .main-shadow {
  box-shadow: 0 0 10px var(--main-shadow);
  transition: box-shadow 0.3s;
}
.knn-uc .author-header {
  --knn-profile-cover-height: 180px;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--uc-border);
  border-radius: 16px;
  background: var(--uc-surface);
  box-shadow: var(--uc-shadow);
}
.knn-uc .author-header .page-cover {
  position: relative;
  box-sizing: border-box;
  height: var(--knn-profile-cover-height);
  border-radius: 16px 16px 0 0;
  z-index: auto;
  background-size: 100% 100%;
  background-position: center center;
  background-repeat: no-repeat;
  background-color: var(--uc-primary-soft);
  background-image: linear-gradient(135deg, #dff2ff 0%, #edf6ff 45%, #dbeaff 100%);
}
.knn-uc .author-header .page-cover.is-default-cover {
  height: var(--knn-profile-cover-height);
  aspect-ratio: auto;
}
.knn-uc .author-header .page-cover .linear-mask {
  display: none;
}
.knn-uc .author-header .header-content { position: relative; z-index: 1; min-height: 74px; padding: 0 24px 14px; }
.knn-uc .author-header .header-info { min-height: 60px; align-items: flex-start; }
.knn-uc .author-header .header-info > .header-avatar {
  margin-top: -46px;
  margin-right: 0;
}
.knn-uc .author-header .avatar-img { --this-size: 92px; }
.knn-uc .author-header .avatar-img .avatar {
  border-radius: 50%;
  border: 4px solid var(--main-bg-color);
  box-shadow: 0 8px 24px rgba(50, 84, 124, .16);
}
.knn-uc .knn-profile-avatar-change {
  box-sizing: border-box;
  display: inline-flex;
  height: 30px;
  margin: 13px 0 0 10px;
  padding: 0 11px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--uc-border);
  border-radius: 999px;
  color: var(--uc-title);
  background: var(--uc-surface);
  box-shadow: 0 4px 12px rgba(50, 84, 124, .1);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.knn-uc .knn-profile-avatar-change:hover { color: var(--uc-primary); border-color: rgba(22, 131, 255, .35); }
.knn-uc .author-header .knn-cover-menu { top: 12px; right: 12px; bottom: auto; }
.knn-uc .author-header .knn-cover-edit-control {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
}
.knn-uc .author-header .knn-cover-edit-button {
  box-sizing: border-box;
  display: inline-flex;
  height: 30px;
  padding: 0 11px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 999px;
  color: #25364d;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 5px 14px rgba(42, 70, 102, .14);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.knn-uc .author-header .knn-cover-edit-button:hover { color: var(--uc-primary); background: #fff; }
.knn-uc .knn-profile-checkin-card {
  position: absolute;
  box-sizing: border-box;
  top: auto;
  right: 12px;
  bottom: 32px;
  z-index: 6;
  width: 292px;
  height: 108px;
  padding: 13px 74px 11px 13px;
  border: 1px solid rgba(22, 131, 255, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 24px rgba(50, 84, 124, .12);
}
.knn-uc .knn-profile-checkin-heading { display: flex; min-width: 0; align-items: flex-start; gap: 8px; }
.knn-uc .knn-profile-checkin-icon {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  color: var(--uc-primary);
  background: var(--uc-primary-soft);
  font-size: 14px;
}
.knn-uc .knn-profile-checkin-icon svg { width: 16px; height: 16px; }
.knn-uc .knn-profile-checkin-copy { min-width: 0; }
.knn-uc .knn-profile-checkin-copy strong,
.knn-uc .knn-profile-checkin-copy span,
.knn-uc .knn-profile-checkin-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knn-uc .knn-profile-checkin-copy strong { color: var(--uc-title); font-size: 14px; line-height: 1.25; }
.knn-uc .knn-profile-checkin-copy span { margin-top: 3px; color: var(--uc-text); font-size: 11px; }
.knn-uc .knn-profile-checkin-copy small { margin-top: 2px; color: var(--uc-muted); font-size: 10px; }
.knn-uc .knn-profile-checkin-copy b { font: inherit; color: inherit; }
.knn-uc .knn-profile-checkin-btn {
  display: inline-flex;
  box-sizing: border-box;
  width: 116px;
  min-height: 30px;
  margin: 8px 0 0 38px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--uc-primary);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}
.knn-uc .knn-profile-checkin-btn:hover { color: #fff; background: var(--uc-primary-hover); }
.knn-uc .knn-profile-checkin-btn.is-checkined { background: #0878e8; }
.knn-uc .knn-profile-checkin-illustration {
  position: absolute;
  top: 50%;
  right: 8px;
  bottom: auto;
  width: 70px;
  height: 70px;
  object-fit: contain;
  transform: translateY(-50%);
  pointer-events: none;
  user-select: none;
}
body.dark-mode .knn-uc .knn-profile-checkin-card,
body.dark-mode-auto .knn-uc .knn-profile-checkin-card { background: #252525; }

/*---------- 栅格----------*/
.knn-uc .row { display: flex; flex-wrap: wrap; margin-left: -10px; margin-right: -10px; }
.knn-uc .col-md-5,
.knn-uc .col-md-7 { padding-left: 10px; padding-right: 10px; box-sizing: border-box; width: 100%; }
.knn-uc .col-md-5 > .knn-widget,
.knn-uc .col-md-7 > .knn-widget { margin-bottom: 20px; }
@media (min-width: 768px) {
  .knn-uc .col-md-5 { width: 41.66667%; }
  .knn-uc .col-md-7 { width: 58.33333%; }
}

/*---------- 工具类补充（等级页）----------*/
.knn-uc .ab { align-items: flex-end; }
.knn-uc .opacity8 { opacity: 0.8; }
.knn-uc .shrink0 { flex-shrink: 0; }
.knn-uc .text-right { text-align: right; }
.knn-uc .mr20 { margin-right: 20px; }
.knn-uc .mt20 { margin-top: 20px; }
.knn-uc .padding-h6 { padding-top: 6px; padding-bottom: 6px; }
.knn-uc .padding-h10 { padding-top: 10px; padding-bottom: 10px; }
.knn-uc .border-bottom { border-bottom: 1px solid var(--main-border-color); }
.knn-uc .focus-color { color: var(--focus-color); }
.knn-uc .block { display: block; }
.knn-uc .muted-box { background-color: var(--muted-border-color); border-radius: var(--main-radius); padding: 15px; }

/*---------- 灰色卡片配色 ----------*/
.knn-uc .colorful-bg.c-gray { --this-bg: linear-gradient(25deg, #f0f2f5 10%, #fafbfc 70%, #eef0f3 100%); --this-color: #666; }

/*---------- 等级进度条 ----------*/
.knn-uc .progress.integral-progress {
  background: #dbbd8e;
  border-radius: 4px;
  height: 3px;
  margin: 0;
  position: relative;
  z-index: 1;
}
.knn-uc .progress.integral-progress .progress-bar {
  height: 100%;
  border-radius: 4px;
  background: #9b6b4e;
}

/*---------- 成长体系柱状图 ----------*/
.knn-uc .pillar-box {
  height: 100%;
  display: flex;
  align-items: flex-end;
  position: relative;
  flex: auto;
  width: 100%;
}
.knn-uc .pillar-item {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: flex-end;
  overflow: unset;
  flex: 1;
}
.knn-uc .pillar-item .value { margin-bottom: 6px; font-size: 0.85em; color: var(--muted-2-color); }
.knn-uc .pillar-item + .pillar-item { padding-left: 20px; }
.knn-uc .pillar-item .pillar {
  width: 6px;
  border-radius: 6px;
  background: linear-gradient(0deg, #707479 10%, #bfc5cc 100%);
}
.knn-uc .pillar-item .level-name { margin-top: 6px; }
.knn-uc .pillar-item.active ~ .pillar-item { opacity: 0.5; }
.knn-uc .pillar-item.active { color: #b97030; }
.knn-uc .pillar-item.active .pillar { background: linear-gradient(0deg, #c1764a 10%, #e8c48e 100%); }

/*---------- tab 切换----------*/
.knn-uc .tab-content { display: block; }
.knn-uc .tab-content > .tab-pane { display: none; }
.knn-uc .tab-content > .tab-pane.active { display: block; }
.knn-uc .but.active { --this-bg: var(--focus-color); --this-color: #fff; color: var(--this-color); }

/*---------- 用户中心主体 ----------*/
.knn-uc .user-center { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.knn-uc .user-center .user-center-sidebar { width: 210px; min-width: 0; }
.knn-uc .user-center .user-center-content { width: 100%; min-width: 0; }

/* 与文章详情保持一致：桌面端导航栏下方留出 20px。 */
@media only screen and (min-width: 769px) {
  .knn-uc { padding-top: 20px; }
}

.knn-uc .user-center-sidebar { position: sticky; top: 84px; }
.knn-uc .knn-sidebar-account-card { padding: 18px 10px 10px; }
.knn-uc .knn-sidebar-profile { display: flex; align-items: center; padding: 0 4px 16px; flex-direction: column; text-align: center; }
.knn-uc .knn-sidebar-profile .avatar-img { --this-size: 72px; }
.knn-uc .knn-sidebar-profile .avatar { border: 3px solid var(--uc-primary-soft); }
.knn-uc .knn-sidebar-profile-copy { min-width: 0; max-width: 100%; }
.knn-uc .knn-sidebar-profile-name { display: flex; max-width: 100%; margin-top: 16px; align-items: center; justify-content: center; gap: 4px; white-space: nowrap; }
.knn-uc .knn-sidebar-profile-name strong { overflow: hidden; color: var(--uc-title); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.knn-uc .knn-sidebar-profile-name > .user-auth-icon,
.knn-uc .knn-sidebar-profile-name > .knn-medal-wear-icon { margin-left: 0; flex: 0 0 auto; }
.knn-uc .knn-sidebar-profile-copy .knn-sidebar-member-badge { display: inline-flex; width: auto; height: 24px; margin-top: 7px; padding: 0 9px; align-items: center; border-radius: 999px; color: #e88913; background: rgba(255, 170, 44, .13); font-size: 11px; }
.knn-uc .knn-sidebar-member-badge i { margin-right: 4px; }
.knn-uc .knn-sidebar-statistics { padding-top: 13px; border-top: 1px solid var(--uc-border); }

/*---------- 侧边栏 统计 ----------*/
.knn-uc .user-statistics-item {
  flex: 1;
  color: inherit;
  display: block;
}
.knn-uc .user-statistics-item strong,
.knn-uc .user-statistics-item span { display: block; }
.knn-uc .user-statistics-item strong { color: var(--uc-title); font-size: 16px; line-height: 1.3; }
.knn-uc .user-statistics-item span { margin-top: 4px; color: var(--uc-muted); font-size: 11px; }
.knn-uc .user-statistics-item:hover { color: var(--focus-color); }

/*---------- 侧边栏 图标按钮组 ----------*/
.knn-uc .knn-sidebar-nav { margin-top: 10px; }
.knn-uc .icon-but-box { display: grid; gap: 3px; }
.knn-uc .user-icon-but-box > item {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
}
.knn-uc .user-icon-but-box > item.icon-but-cart { padding: 0; }
.knn-uc .user-icon-but-box > item.icon-but-cart > a.knn-sidebar-nav-row { display: grid; padding: 0 10px; }
.knn-uc .knn-sidebar-nav-row {
  display: grid;
  box-sizing: border-box;
  grid-template-columns: 27px minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  min-height: 38px;
  padding: 0 10px;
  align-items: center;
  border-radius: 8px;
  color: var(--uc-text);
  font-size: 13px;
  transition: color .18s ease, background .18s ease;
}
.knn-uc .knn-sidebar-nav-row:hover,
.knn-uc .knn-sidebar-nav-row.current { color: var(--uc-primary); background: var(--uc-primary-soft); }
.knn-uc .knn-sidebar-nav-icon { display: inline-flex; width: 17px; align-items: center; justify-content: center; color: #7286a2; font-size: 14px; }
.knn-uc .knn-sidebar-nav-row:hover .knn-sidebar-nav-icon,
.knn-uc .knn-sidebar-nav-row.current .knn-sidebar-nav-icon { color: var(--uc-primary); }
.knn-uc .knn-sidebar-nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knn-uc .knn-sidebar-nav-divider { height: 1px; margin: 9px 6px; background: var(--uc-border); }
.knn-uc .knn-sidebar-logout { color: var(--uc-text); }

/*---------- 右侧 tab 内容 ----------*/
.knn-uc .user-tab-content { display: none; }
.knn-uc .user-tab-content.active { display: block; }
.knn-uc .drawer-header { display: none; }

/*---------- 个人资料页：严格对应双栏资料编辑稿 ----------*/
.knn-uc .knn-profile-edit,
.knn-uc .knn-profile-edit * { box-sizing: border-box; }
.knn-uc .knn-profile-edit {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(310px, 1fr);
  gap: 14px;
  color: var(--uc-text);
}
.knn-uc .knn-profile-basic-card,
.knn-uc .knn-profile-social-card {
  min-width: 0;
  padding: 18px 20px 20px;
  border: 1px solid var(--uc-border);
  border-radius: 12px;
  background: var(--uc-surface);
  box-shadow: 0 5px 18px rgba(50, 84, 124, .07);
}
.knn-uc .knn-profile-basic-card h2,
.knn-uc .knn-profile-social-card h2 {
  margin: 0 0 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--uc-border);
  color: var(--uc-title);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}
.knn-uc .knn-profile-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-width: 0;
  margin: 0 0 13px;
  padding: 0;
  align-items: center;
  border: 0;
}
.knn-uc .knn-profile-row:last-child { margin-bottom: 0; }
.knn-uc .knn-profile-bio-row { align-items: start; }
.knn-uc .knn-profile-bio-row > label { padding-top: 9px; }
.knn-uc .knn-profile-row > label,
.knn-uc .knn-profile-row > .knn-profile-row-label {
  margin: 0;
  padding: 0;
  color: var(--uc-title);
  font-size: 13px;
  font-weight: 500;
}
.knn-uc .knn-profile-control { position: relative; min-width: 0; }
.knn-uc .knn-profile-control input,
.knn-uc .knn-profile-control textarea,
.knn-uc .knn-profile-social-row input {
  display: block;
  width: 100%;
  margin: 0;
  border: 1px solid var(--uc-border);
  border-radius: 6px;
  outline: 0;
  color: var(--uc-title);
  background: var(--uc-surface);
  box-shadow: none;
  font-family: inherit;
  font-size: 13px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.knn-uc .knn-profile-control input,
.knn-uc .knn-profile-social-row input { height: 36px; padding: 0 11px; }
.knn-uc .knn-profile-control textarea {
  height: 104px;
  min-height: 104px;
  max-height: 104px;
  padding: 10px 12px 27px;
  line-height: 1.65;
  resize: none;
}
.knn-uc .knn-profile-control input:focus,
.knn-uc .knn-profile-control textarea:focus,
.knn-uc .knn-profile-social-row input:focus {
  border-color: var(--uc-primary);
  box-shadow: 0 0 0 3px rgba(22, 131, 255, .1);
}
.knn-uc .knn-profile-control input:disabled {
  cursor: not-allowed;
  color: var(--uc-text);
  background: var(--uc-page-bg);
  opacity: 1;
}
.knn-uc .knn-profile-control input::placeholder,
.knn-uc .knn-profile-control textarea::placeholder,
.knn-uc .knn-profile-social-row input::placeholder { color: var(--uc-muted); opacity: .8; }
.knn-uc .knn-profile-inline-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.knn-uc .knn-profile-inline-note small {
  color: var(--uc-muted);
  font-size: 11px;
  white-space: nowrap;
}
.knn-uc .knn-profile-counted > span {
  position: absolute;
  right: 10px;
  bottom: 7px;
  color: var(--uc-muted);
  font-size: 11px;
  pointer-events: none;
}
.knn-uc .knn-profile-counted > span b { font-weight: 500; }
.knn-uc .knn-profile-counted > input { padding-right: 52px; }
.knn-uc .knn-profile-email-control { display: flex; align-items: center; gap: 9px; }
.knn-uc .knn-profile-email-control input { min-width: 0; flex: 1; }
.knn-uc .knn-profile-bound {
  display: inline-flex;
  height: 26px;
  padding: 0 9px;
  align-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #16a765;
  background: rgba(34, 199, 122, .12);
  font-size: 11px;
  white-space: nowrap;
}
.knn-uc .knn-profile-bound i { margin-right: 4px; }
.knn-uc .knn-profile-radio-group { display: flex; min-width: 0; align-items: center; flex-wrap: nowrap; gap: 20px; }
.knn-uc .knn-profile-radio-group label { display: inline-flex; min-width: max-content; align-items: center; flex: 0 0 auto; gap: 6px; margin: 0; color: var(--uc-title); cursor: pointer; font-size: 13px; line-height: 1; white-space: nowrap; }
.knn-uc .knn-profile-control.knn-profile-radio-group input[type="radio"] {
  appearance: none !important;
  -webkit-appearance: none !important;
  display: inline-block;
  box-sizing: border-box;
  width: 14px !important;
  min-width: 14px !important;
  max-width: 14px !important;
  height: 14px !important;
  min-height: 14px !important;
  max-height: 14px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 14px;
  border: 1.5px solid #9aabbe !important;
  border-radius: 50% !important;
  outline: 0;
  background: var(--uc-surface) !important;
  box-shadow: none !important;
}
.knn-uc .knn-profile-control.knn-profile-radio-group input[type="radio"]:checked {
  border-color: var(--uc-primary) !important;
  background: var(--uc-primary) !important;
  box-shadow: inset 0 0 0 3px var(--uc-surface) !important;
}
.knn-uc .knn-profile-control.knn-profile-radio-group input[type="radio"]:focus-visible { box-shadow: 0 0 0 3px rgba(22, 131, 255, .14), inset 0 0 0 3px var(--uc-surface) !important; }
.knn-uc .knn-profile-social-list { display: grid; gap: 11px; }
.knn-uc .knn-profile-social-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.knn-uc .knn-profile-social-row label {
  display: flex;
  align-items: center;
  margin: 0;
  color: var(--uc-title);
  font-size: 12px;
  white-space: nowrap;
}
.knn-uc .knn-profile-social-icon {
  display: inline-flex;
  width: 27px;
  height: 27px;
  margin-right: 7px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #fff;
  background: var(--uc-primary);
  font-size: 12px;
}
.knn-uc .knn-profile-social-icon.is-qq { background: #14b8a6; }
.knn-uc .knn-profile-social-icon.is-weibo { background: #f43f5e; }
.knn-uc .knn-profile-social-icon.is-github { background: #111827; }
.knn-uc .knn-profile-social-icon.is-bilibili { border-radius: 8px; background: #fb7185; }
.knn-uc .knn-profile-save {
  display: inline-flex;
  width: 100%;
  min-height: 38px;
  margin-top: 16px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(90deg, #1683ff 0%, #0878e8 100%);
  box-shadow: 0 6px 16px rgba(22, 131, 255, .2);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: background .18s ease, transform .18s ease, opacity .18s ease;
}
.knn-uc .knn-profile-save:hover { color: #fff; background: var(--uc-primary-hover); transform: translateY(-1px); }
.knn-uc .knn-profile-save:focus-visible { outline: 3px solid rgba(22, 131, 255, .2); outline-offset: 2px; }
.knn-uc .knn-profile-save:disabled { cursor: wait; opacity: .72; }
.knn-uc .knn-profile-save.is-loading .knn-profile-save-icon { display: none; }
.knn-uc .knn-profile-save.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: knn-profile-spin .8s linear infinite;
}
@keyframes knn-profile-spin { to { transform: rotate(360deg); } }
.knn-uc .knn-profile-form-status {
  min-height: 16px;
  margin: 6px 0 -7px;
  color: var(--uc-muted);
  font-size: 11px;
  text-align: center;
}
.knn-uc .knn-profile-form-status[data-state="success"] { color: var(--uc-success); }
.knn-uc .knn-profile-form-status[data-state="error"] { color: var(--uc-danger); }
.knn-uc .knn-profile-form-status[data-state="loading"] { color: var(--uc-primary); }

@media (max-width: 980px) {
  .knn-uc .knn-profile-edit { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .knn-uc .author-header { --knn-profile-cover-height: 170px; }
  .knn-uc .knn-profile-basic-card,
  .knn-uc .knn-profile-social-card { padding: 16px; }
  .knn-uc .knn-profile-row { grid-template-columns: 68px minmax(0, 1fr); }
}
@media (max-width: 430px) {
  .knn-uc .knn-profile-edit { gap: 10px; }
  .knn-uc .knn-profile-basic-card,
  .knn-uc .knn-profile-social-card {
    padding: 14px 12px 16px;
    border-radius: 10px;
  }
  .knn-uc .knn-profile-basic-card h2,
  .knn-uc .knn-profile-social-card h2 {
    margin-bottom: 13px;
    padding-bottom: 10px;
  }
  .knn-uc .knn-profile-row,
  .knn-uc .knn-profile-social-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .knn-uc .knn-profile-row { margin-bottom: 15px; }
  .knn-uc .knn-profile-control input,
  .knn-uc .knn-profile-social-row input { height: 40px; }
  .knn-uc .knn-profile-control textarea {
    height: 116px;
    min-height: 116px;
    max-height: 116px;
  }
  .knn-uc .knn-profile-inline-note { grid-template-columns: 1fr; gap: 5px; }
  .knn-uc .knn-profile-inline-note small { white-space: normal; }
  .knn-uc .knn-profile-email-control {
    width: 100%;
    align-items: center;
    flex-direction: row;
    gap: 8px;
  }
  .knn-uc .knn-profile-email-control input {
    width: auto;
    min-width: 0;
    min-height: 40px;
    flex: 1 1 auto;
  }
  .knn-uc .knn-profile-radio-group { gap: 16px; }
  .knn-uc .knn-profile-social-list { gap: 13px; }
  .knn-uc .knn-profile-save { min-height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
  .knn-uc .knn-profile-edit *,
  .knn-uc .knn-profile-edit *::before,
  .knn-uc .knn-profile-edit *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/*---------- 移动端全屏抽屉 ----------*/
@media (max-width: 768px) {
  .knn-uc .mb10-sm { margin-bottom: 10px; }
  .knn-uc .user-center { display: block; }
  .knn-uc .user-center .user-center-sidebar,
  .knn-uc .user-center .user-center-content { width: 100%; }
  .knn-uc .user-center-sidebar { position: static; }
  .knn-uc .author-header .header-content { min-height: 70px; padding: 0 16px 12px; }

  /* 移动端通栏 + 头部（full-widget-sm 区块；出血量须等于 .main-container 移动端左右 padding 8px，否则右侧超出视口撑出横向滚动条 */
  .knn-uc .full-widget-sm {
    box-shadow: none;
    border-radius: 0;
    margin-left: -8px;
    margin-right: -8px;
  }
  .knn-uc .author-header.full-widget-sm { margin-top: -20px; }
  .knn-uc .author-header.full-widget-sm .page-cover { border-radius: 0; }
  .knn-uc .author-header .avatar-img { --this-size: 100px; }
  .knn-uc .author-header .header-info > .header-avatar {
    margin-top: -52px;
    margin-bottom: 0;
  }
  .knn-uc .author-header .avatar-img .avatar {
    border-radius: 100px;
    border-width: 3px;
  }
  .knn-uc .knn-profile-avatar-change { margin-top: 12px; }
  .knn-uc .knn-profile-checkin-card {
    top: auto;
    right: 10px;
    bottom: 32px;
    width: min(276px, calc(100% - 126px));
    height: 106px;
    padding: 12px 70px 11px 12px;
  }
  .knn-uc .knn-profile-checkin-icon { width: 30px; height: 30px; }
  .knn-uc .knn-profile-checkin-heading { gap: 7px; }
  .knn-uc .knn-profile-checkin-btn { width: 112px; min-height: 30px; margin: 8px 0 0 37px; }
  .knn-uc .knn-profile-checkin-illustration { top: 50%; right: 5px; bottom: auto; width: 66px; height: 66px; transform: translateY(-50%); }

  .knn-uc .drawer-sm {
    position: fixed;
    top: 0; right: 0; left: 0;
    height: 100%;
    width: 100%;
    /* 主题无全局 border-box 重置，width:100%+padding 必须显式声明，否则内容右侧超出视口被 overflow-x:hidden 裁掉 */
    background: var(--body-bg-color);
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 72px 10px calc(92px + env(safe-area-inset-bottom));
    transform: translateX(110%);
    transition: 0.6s;
    visibility: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 996;
  }
  .knn-uc .drawer-sm.show {
    transition: 0.6s cubic-bezier(0.28, 0.9, 0.34, 0.99);
    visibility: unset;
    transform: unset;
  }
  .knn-uc .drawer-sm .drawer-header {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0; left: 0;
    background: var(--main-bg-color);
    box-shadow: 0 4px 10px var(--main-shadow);
    box-sizing: border-box;
    color: var(--muted-color);
    font-size: 18px;
    height: 68px;
    padding: 0 26px;
    width: 100%;
    z-index: 1000;
  }
  .knn-uc .drawer-sm .drawer-close { font-size: 22px; width: 30px; }
  .knn-uc .drawer-sm .drawer-title { flex: 1; text-align: center; margin-right: 30px; }

  /* 内容抽屉展开时隐藏全站悬浮工具，避免遮住资料表单。 */
  body.drawer-show .knn-float-right { display: none !important; }
}

@media (max-width: 430px) {
  .knn-uc .author-header {
    --knn-profile-cover-height: 200px;
    margin-bottom: 10px;
  }
  .knn-uc .author-header .header-content {
    min-height: 54px;
    padding: 0 10px 9px;
  }
  .knn-uc .author-header .header-info { min-height: 48px; }
  .knn-uc .author-header .avatar-img { --this-size: 64px; }
  .knn-uc .author-header .header-info > .header-avatar { margin-top: -32px; }
  .knn-uc .author-header .avatar-img .avatar { border-width: 3px; }
  .knn-uc .knn-profile-avatar-change {
    min-height: 26px;
    height: 26px;
    margin: 7px 0 0 5px;
    padding: 0 8px;
    font-size: 11px;
  }
  .knn-uc .knn-profile-checkin-card {
    right: 7px;
    bottom: 11px;
    width: 176px;
    height: 72px;
    padding: 7px 35px 6px 7px;
    border-radius: 10px;
  }
  .knn-uc .knn-profile-checkin-icon { width: 20px; height: 20px; }
  .knn-uc .knn-profile-checkin-icon svg { width: 13px; height: 13px; }
  .knn-uc .knn-profile-checkin-heading { gap: 4px; }
  .knn-uc .knn-profile-checkin-copy strong { font-size: 12px; }
  .knn-uc .knn-profile-checkin-copy span { margin-top: 1px; font-size: 9px; line-height: 1.25; }
  .knn-uc .knn-profile-checkin-copy small { display: none; }
  .knn-uc .knn-profile-checkin-btn {
    width: 80px;
    min-height: 24px;
    margin: 4px 0 0 24px;
    font-size: 11px;
  }
  .knn-uc .knn-profile-checkin-illustration { right: 1px; width: 34px; height: 34px; }

  /* 固定移动导航高 50px，侧栏账户卡额外下移，头像不再进入导航覆盖区。 */
  .knn-uc .knn-sidebar-account-card {
    margin-top: 55px;
    padding-top: 0;
  }
  .knn-uc .knn-sidebar-profile {
    padding-top: 20px;
    padding-bottom: 13px;
  }
  .knn-uc .knn-sidebar-profile .avatar-img { --this-size: 64px; }
  .knn-uc .knn-sidebar-profile-name { margin-top: 16px; }
}

@media (max-width: 360px) {
  .knn-uc .knn-profile-avatar-change {
    width: 26px;
    padding: 0;
    justify-content: center;
  }
  .knn-uc .knn-profile-avatar-change span { display: none; }
}

/*---------- 作者主页 /user/:id ----------*/
/* 封面右上角统计胶囊 */
.knn-author-home .abs-right {
  position: absolute;
  right: 0.7em;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}
.knn-author-home .single-metabox {
  right: 0;
  font-size: 15px;
  --meta-color: var(--muted-color);
}
.knn-author-home .single-metabox .post-metas {
  background: var(--body-bg-color);
  border-radius: 100px;
  color: var(--meta-color);
  padding: 2px 6px;
  right: 0;
}
.knn-author-home .single-metabox .post-metas item { margin: 0 6px; }
.knn-author-home .single-metabox .post-metas item a { color: inherit; }
.knn-author-home .single-metabox .post-metas item .fa,
.knn-author-home .single-metabox .post-metas item .icon { margin-right: 3px; }
.knn-author-home .single-metabox.cover-meta {
  font-size: 14px;
  right: 1em;
  top: 1.6em;
  transform: none;
  --meta-color: rgba(255, 255, 255, 0.8);
  --body-bg-color: rgba(0, 0, 0, 0.3);
}

/* 个人主页头部标识与封面菜单 */
.knn-author-home .author-header { overflow: visible; }
.knn-author-home .author-header .header-content {
  padding-top: 10px;
  padding-bottom: 8px;
}
.knn-author-home .author-header .header-info > .flex1 {
  min-width: 0;
  margin-left: 24px;
}
.knn-author-home .author-header .header-btns {
  align-self: center;
  margin-top: 0;
}
.knn-author-home .author-header .name {
  display: flex;
  min-width: 0;
  min-height: 22px;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  line-height: 1.2;
}
.knn-author-home .author-header .name .display-name { min-width: 0; }
.knn-author-home .author-header .name > .user-auth-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  margin: 0;
  line-height: 1;
}
.knn-author-home .author-header .name > .user-auth-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}
.knn-author-home .author-header .name > .img-icon {
  display: block;
  width: auto;
  max-width: 34px;
  height: 18px;
  margin: 0;
  object-fit: contain;
  flex: 0 0 auto;
}
.knn-author-home .author-header .name > .moderator-bagd {
  box-sizing: border-box;
  display: inline-flex;
  width: auto;
  min-width: 0;
  height: 20px;
  margin: 0;
  padding: 0 7px;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}
.knn-author-home .author-header .name > .moderator-bagd i { font-size: 10px; }
.knn-author-home .author-header .user-identity {
  display: flex;
  min-height: 20px;
  margin-top: 6px;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.knn-author-home .author-header .user-identity > .knn-medal-wear-icon {
  display: block;
  width: 18px;
  max-width: 18px;
  height: 18px;
  margin: 0;
  border-radius: 4px;
  object-fit: contain;
  flex: 0 0 18px;
}
.knn-author-home .author-header .user-identity > .badg,
.knn-author-home .author-header .user-identity > .but {
  box-sizing: border-box;
  display: inline-flex;
  width: auto;
  min-width: 0;
  height: 20px;
  margin: 0;
  padding: 0 7px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}
.knn-author-home .author-header .knn-cover-menu {
  top: auto;
  right: 14px;
  bottom: 12px;
  z-index: 20;
}
.knn-author-home .author-header .knn-cover-menu-list {
  top: calc(100% + 8px);
  right: 0;
  bottom: auto;
  z-index: 21;
}
body.dark-mode .knn-author-home .author-header .knn-cover-menu-list,
body.dark-mode-auto .knn-author-home .author-header .knn-cover-menu-list {
  border: 1px solid rgba(255, 255, 255, .09);
  background: #252525;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .38);
}
body.dark-mode .knn-author-home .author-header .knn-cover-menu-list li a,
body.dark-mode-auto .knn-author-home .author-header .knn-cover-menu-list li a { color: #d8dde5; }
body.dark-mode .knn-author-home .author-header .knn-cover-menu-list li a:hover,
body.dark-mode-auto .knn-author-home .author-header .knn-cover-menu-list li a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .07);
}

/* svg 图标基础 */
.knn-uc svg.icon {
  fill: currentColor;
  height: 1em;
  overflow: hidden;
  vertical-align: -0.15em;
  width: 1em;
}

/* 渐变按钮 */
.knn-uc .jb-pink,
.knn-uc .jb-blue {
  border: none;
  --this-color: #fff;
  color: var(--this-color);
  background: var(--this-bg);
}
.knn-uc .jb-pink { --this-bg: linear-gradient(135deg, #ff5e7f 30%, #ff967e 100%); }
.knn-uc .jb-blue { --this-bg: linear-gradient(135deg, #59c3fb 10%, #268df7 100%); }

/* 关注按钮已关注态 */
[data-action="knn-follow-user"].jb-pink.actived {
  background: var(--muted-2-color, #ccc);
  color: var(--muted-color, #777);
}

/* Tab 导航 */
.knn-author-tab { overflow: hidden; }
.knn-author-tab-nav {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.knn-author-tab-nav .knn-author-tab-link {
  position: relative;
  flex-shrink: 0;
  padding: 13px 22px;
  font-size: 15px;
  color: var(--muted-color, #777);
  transition: color 0.2s;
}
.knn-author-tab-nav .knn-author-tab-link .tab-count {
  margin-left: 5px;
  font-size: 12px;
  opacity: 0.75;
}
.knn-author-tab-nav .knn-author-tab-link:hover { color: var(--focus-color, #ff5e5c); }
.knn-author-tab-nav .knn-author-tab-link.active {
  color: var(--focus-color, #ff5e5c);
  font-weight: bold;
}
.knn-author-tab-nav .knn-author-tab-link.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  transform: translateX(-50%);
  background: var(--focus-color, #ff5e5c);
}

/* Tab 面板：全量渲染 + JS 切换 */
.knn-author-panels .knn-author-tab-pane { display: none; }
.knn-author-panels .knn-author-tab-pane.active { display: block; }

/* 粉丝/关注 minicard 列表 */
.knn-minicard-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.author-minicard {
  padding: 14px 16px;
  background: var(--main-bg-color, #fff);
  box-shadow: 0 2px 8px var(--main-shadow, rgba(0, 0, 0, 0.05));
}
.author-minicard .avatar-img { --this-size: 60px; }
.author-minicard .avatar-img .avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}
.author-minicard .knn-mini-name {
  font-size: 15px;
  font-weight: bold;
  color: var(--knn-text-color, #333);
  max-width: 9em;
}
.author-minicard .knn-mini-name:hover { color: var(--focus-color, #ff5e5c); }

/* 个人主页文章：只将付费类型移到左上角，价格沿用全局右上角位置。 */
.knn-author-home .knn-card-thumbnail .knn-card-ribbon-container {
  top: 8px;
  right: auto;
  left: 8px;
}
.knn-author-home .knn-card-thumbnail .knn-card-ribbon {
  height: 24px;
  padding: 0 8px;
  border-radius: 10px;
  clip-path: none;
  box-shadow: 0 2px 7px rgba(166, 92, 0, 0.13);
  color: #a65c00;
  background: #ffe8bd;
  font-size: 11px;
  line-height: 1;
}
.knn-author-home .knn-card-thumbnail .knn-card-ribbon.pay-read,
.knn-author-home .knn-card-thumbnail .knn-card-ribbon.pay-download {
  color: #a65c00;
  background: #ffe8bd;
}
.knn-author-home .knn-card-thumbnail .knn-card-ribbon i {
  font-size: 10px;
}
/* 作者页评论列表 */
.knn-author-comment-list { padding: 6px 20px; }
.knn-author-comment-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--main-border-color, #eee);
}
.knn-author-comment-item:last-child { border-bottom: 0; }
.knn-author-comment-item .comment-text {
  font-size: 14px;
  line-height: 1.7;
  word-break: break-all;
}
.knn-author-comment-item .comment-meta a { color: var(--focus-color, #ff5e5c); }

@media (max-width: 992px) {
  .knn-minicard-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .knn-author-home,
  .knn-author-home * {
    box-sizing: border-box;
  }
  .knn-author-home {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .knn-author-home .author-header,
  .knn-author-home .knn-author-tab,
  .knn-author-home .knn-author-panels,
  .knn-author-home .knn-au-post-item,
  .knn-author-home .knn-card-item {
    max-width: 100%;
    min-width: 0;
  }
  .knn-author-home .knn-author-tab-nav {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .knn-author-home .knn-author-tab-nav::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }
  .knn-author-home .single-metabox.cover-meta { font-size: 13px; }
  .knn-author-home .single-metabox .post-metas item { margin: 0 4px; }
  .knn-author-tab-nav .knn-author-tab-link { padding: 11px 15px; font-size: 14px; }
  .knn-minicard-list { grid-template-columns: 1fr; }
  .knn-author-comment-list { padding: 2px 14px; }
  .knn-author-home .author-header .header-btns {
    position: static;
    width: 100%;
    flex-wrap: wrap;
    margin: 8px 0 0;
  }
  .knn-author-home .author-header .header-btns .but {
    margin: 5px 6px 0 0;
    padding-left: 0.85em;
    padding-right: 0.85em;
    font-size: 13px;
    line-height: 1.9;
  }
  .knn-author-home .author-header .display-name {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .knn-author-home .single-metabox.cover-meta {
    right: 0.7em;
    max-width: calc(100% - 1.4em);
  }
  .knn-author-home .knn-card-thumbnail .knn-card-ribbon-container {
    top: 6px;
    right: auto;
    left: 6px;
  }
  .knn-author-home .knn-card-thumbnail .knn-card-ribbon {
    height: 22px;
    max-width: calc(100% - 12px);
    padding: 0 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .knn-author-home .knn-card-thumbnail .knn-card-price-badge {
    max-width: calc(100% - 12px);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
}

/* 本人视角：文章状态过滤 + 状态角标 + 编辑/删除操作条 */
.knn-au-status-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.knn-au-status-tab {
  padding: 4px 14px;
  border-radius: 14px;
  background: var(--main-bg-color, #fff);
  font-size: 13px;
  color: var(--knn-text-color, #333);
}
.knn-au-status-tab.is-active {
  background: var(--focus-color, #ff5e5c);
  color: #fff;
}
.knn-au-post-item { position: relative; }
.knn-au-post-item .knn-card-item { margin: 8px 0; }

/* 操作条悬浮在文章卡片内右上角 */
.knn-au-post-actions {
  position: absolute;
  top: 16px;
  right: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--main-bg-color, #fff);
  box-shadow: 0 1px 6px var(--main-shadow, rgba(0, 0, 0, 0.08));
  font-size: 12px;
  line-height: 1.6;
}
.knn-au-post-badge {
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
}
.knn-au-post-badge.is-pending {
  background: rgba(255, 152, 0, 0.12);
  color: #b26a00;
}
.knn-au-post-badge.is-draft {
  background: rgba(0, 0, 0, 0.07);
  color: var(--muted-color, #888);
}
.knn-au-post-act { color: var(--muted-color, #888); }
.knn-au-post-act:hover { color: var(--focus-color, #ff5e5c); }
.knn-au-post-act.knn-au-post-del:hover { color: #e53935; }


/* 作者主页商品列表 */
.knn-author-shop-scope,
.knn-author-shop-scope * {
  box-sizing: border-box;
}
.knn-author-shop-scope {
  --main-bg-color: var(--knn-bg-color-card, #ffffff);
  --main-border-color: var(--knn-border-color, #eeeeee);
  --muted-border-color: var(--knn-bg-color-grey, #f5f6f8);
  --muted-color: var(--knn-text-color-grey, #999999);
  --focus-color: var(--knn-color-primary, #007aff);
  --main-radius: 8px;
  --main-shadow: rgba(0, 0, 0, 0.04);
}
.knn-author-shop-scope .product-lists-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.knn-author-shop-scope .product-item.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: var(--main-radius);
  background: var(--main-bg-color);
  box-shadow: 0 8px 22px var(--main-shadow);
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.knn-author-shop-scope .product-item.card:hover {
  transform: translateY(-2px);
}
.knn-author-shop-scope .product-item.card .item-thumbnail {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  padding-bottom: 0;
  overflow: hidden;
  border-radius: var(--main-radius) var(--main-radius) 0 0;
  background: var(--muted-border-color);
}
.knn-author-shop-scope .product-item.card .item-thumbnail > a,
.knn-author-shop-scope .product-item.card .item-thumbnail img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.knn-author-shop-scope .product-item.card .item-thumbnail img {
  object-fit: cover;
}
.knn-author-shop-scope .product-item.card .item-thumbnail.contain img {
  object-fit: cover;
}
.knn-author-shop-scope .product-item.card .product-item-body {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  padding: 10px 12px 12px;
  text-align: left;
}
.knn-author-shop-scope .product-item.card .item-heading {
  display: -webkit-box;
  height: 41px;
  margin: 0 0 8px;
  overflow: hidden;
  color: var(--knn-text-color, #333333);
  font-size: 14px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.knn-author-shop-scope .product-item.card .item-heading a { color: inherit; }
.knn-author-shop-scope .product-item.card .item-excerpt {
  height: 18px;
  margin-bottom: 8px;
  overflow: hidden;
  color: var(--muted-color);
  font-size: 12px;
}
.knn-author-shop-scope .product-item.card .item-excerpt:empty {
  display: none;
}
.knn-author-shop-scope .product-item.card .item-discount-badge {
  height: 24px;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
}
.knn-author-shop-scope .product-item.card .item-discount-badge:empty {
  display: none;
}
.knn-author-shop-scope .product-item.card .product-price,
.knn-author-shop-scope .product-item.card .item-price {
  display: flex !important;
  align-items: baseline;
  gap: 6px;
  min-height: 26px;
  margin-top: 0;
  overflow: hidden;
  color: #ff5000;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.knn-author-shop-scope .product-item.card .item-price .show-price-box,
.knn-author-shop-scope .product-item.card .item-price .crossed-price-box {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  min-width: 0;
}
.knn-author-shop-scope .product-item.card .item-price .crossed-price-box {
  margin-left: 0;
}
.knn-author-shop-scope .product-item.card .img-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
}
.knn-author-shop-scope .product-item.card .item-seckill-img-badge {
  top: 8px;
  right: 8px;
  bottom: auto;
  left: auto;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.4;
  color: #fff;
  background: linear-gradient(135deg, #ff6238 0%, #ee0a24 100%);
  writing-mode: horizontal-tb;
  white-space: nowrap;
}
.knn-author-shop-scope .product-item.card .item-group-buy-img-badge {
  top: 16px;
}
.knn-author-shop-scope .product-item.card .item-seckill-box {
  margin-top: 6px;
  padding: 6px 7px;
  border-radius: 6px;
  color: #fff;
  background: linear-gradient(135deg, #ff6238 0%, #ee0a24 100%);
  box-shadow: 0 6px 14px rgba(238, 10, 36, 0.12);
}
.knn-author-shop-scope .product-item.card .item-seckill-row,
.knn-author-shop-scope .product-item.card .item-seckill-progress {
  display: flex;
  align-items: center;
  min-width: 0;
}
.knn-author-shop-scope .product-item.card .item-seckill-row {
  justify-content: space-between;
  gap: 8px;
}
.knn-author-shop-scope .product-item.card .item-seckill-progress {
  flex: 1;
  gap: 6px;
}
.knn-author-shop-scope .product-item.card .item-seckill-progress-bar {
  flex: 1;
  overflow: hidden;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
}
.knn-author-shop-scope .product-item.card .item-seckill-progress-bar i {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: #fff;
}
@media (max-width: 992px) {
  .knn-author-shop-scope .product-lists-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 768px) {
  .knn-author-shop-scope .product-lists-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .knn-author-shop-scope .product-item.card .product-item-body { padding: 8px 9px 10px; }
  .knn-author-shop-scope .product-item.card .item-heading { font-size: 13px; }
}

/* 用户中心：每日下载额度与下载记录 */
.knn-download-center { display: grid; gap: 10px; }
.knn-download-summary { padding: 20px; }
.knn-download-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.knn-download-summary-title { color: var(--knn-text-color); font-size: 18px; font-weight: 700; }
.knn-download-summary-sub { margin-top: 5px; color: var(--knn-text-color-lighten); font-size: 13px; }
.knn-download-summary-icon { display: inline-flex; width: 42px; height: 42px; flex: 0 0 auto; }
.knn-download-summary-icon svg { width: 100%; height: 100%; }
.knn-download-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; border-top: 1px solid var(--knn-border-color); }
.knn-download-metrics > div { min-width: 0; padding: 16px 12px 0; text-align: center; }
.knn-download-metrics > div + div { border-left: 1px solid var(--knn-border-color); }
.knn-download-metrics strong, .knn-download-metrics span { display: block; }
.knn-download-metrics strong { overflow-wrap: anywhere; color: var(--knn-text-color); font-size: 20px; line-height: 1.3; }
.knn-download-metrics span { margin-top: 4px; color: var(--knn-text-color-lighten); font-size: 12px; }
.knn-download-list-head { padding: 15px 18px; }
.knn-download-list-head strong { font-size: 16px; }
.knn-download-list-head span { margin-left: 8px; color: var(--knn-text-color-lighten); font-size: 12px; }
.knn-download-records { overflow: hidden; border-radius: 6px; background: var(--knn-bg-color-card); box-shadow: 0 2px 12px rgba(0, 0, 0, .05); }
.knn-download-record + .knn-download-record { border-top: 1px solid var(--knn-border-color); }
.knn-download-record { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 9px 14px; }
.knn-download-record-thumb { display: flex; width: 54px; height: 54px; flex: 0 0 auto; align-items: center; justify-content: center; overflow: hidden; border-radius: 4px; background: var(--knn-bg-color-grey); }
.knn-download-record-thumb img { width: 100%; height: 100%; object-fit: cover; }
.knn-download-record-thumb svg { width: 30px; height: 30px; }
.knn-download-record-main { min-width: 0; flex: 1; }
.knn-download-record-title { overflow: hidden; color: var(--knn-text-color); font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.knn-download-record-title a { color: inherit; }
.knn-download-record-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 5px; color: var(--knn-text-color-lighten); font-size: 12px; }
.knn-download-record-meta i { margin-right: 5px; }
.knn-download-record-action { flex: 0 0 auto; }
.knn-download-center > .knn-captain-pagination { padding: 6px 0 0; }

@media (max-width: 600px) {
  .knn-download-summary { padding: 16px; }
  .knn-download-metrics > div { padding: 14px 6px 0; }
  .knn-download-metrics strong { font-size: 17px; }
  .knn-download-record { gap: 10px; padding: 9px 12px; }
  .knn-download-record-thumb { width: 50px; height: 50px; }
  .knn-download-record-action { display: none; }
  .knn-download-record-meta { display: block; margin-top: 6px; }
  .knn-download-record-meta span { display: block; margin-top: 3px; }
}
