/* ==========================================================================
   美途导航 MT123 主题样式（还原 meitu123.com）
   依赖：Bootstrap 5.3.8 + Font Awesome 6
   ========================================================================== */

:root {
  --color-primary: #2f66ff;
  --color-dark: #2f2f33;
  --color-secondary: #555557;
  --color-muted: #828488;
  --color-light: #dbe0ea;
  --color-info: #6fcba1;
  --color-danger: #ff2f52;
  --color-warning: #ff7b2f;
  --base-color: #000;
  --bg-base: #fff;
  --body-color: #212529;
  --bg-body: #f5f7fa;
  --secondary-color: #595c5f;
  --bg-secondary: #f5f7fa;
  --tertiary-color: #909294;
  --bg-tertiary: #f8f9fa;
  --emphasis-color: #000;
  --border-color: #dee2e6;
  --radius-xs: 2px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 19px;
  --shadow-xs: 0 15px 30px 5px rgb(62 61 80 / 1%);
  --shadow-sm: 0 5px 30px 5px rgb(62 61 80 / 1%);
  --shadow-md: 0 0 20px 5px rgb(62 61 80 / 2%);
  --shadow-lg: 0 10px 40px 5px rgb(62 61 80 / 10%);
}

[data-bs-theme="dark"] {
  --color-light: #dbe0ea;
  --base-color: #fff;
  --bg-base: #191919;
  --body-color: #c7cbd4;
  --bg-body: #212121;
  --secondary-color: #a5a8af;
  --bg-secondary: #272727;
  --tertiary-color: #71767a;
  --bg-tertiary: #2f2f33;
  --emphasis-color: #827b7b;
  --border-color: #343434;
}

/* ---------- 全局 ---------- */
body {
  background-color: var(--bg-body);
  color: var(--body-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.text-muted {
  color: var(--tertiary-color) !important;
}

/* ---------- 布局骨架 ---------- */
.site-wrapper {
  padding-left: 260px;
  position: relative;
}

.site-aside {
  background: linear-gradient(180deg, var(--bg-base) 0%, var(--bg-secondary) 100%);
  bottom: 0;
  box-shadow: 6px 0 28px 0 rgba(47, 47, 51, 0.08);
  height: 100%;
  left: 0;
  overflow: visible;
  position: fixed;
  top: 0;
  transition: all 0.3s ease-in-out;
  width: 260px;
  z-index: var(--bs-offcanvas-zindex, 1045);
  --bs-offcanvas-width: 260px;
  --bs-offcanvas-bg: var(--bg-base);
  border-right: 1px solid var(--border-color);
}

/* 顶部装饰渐变条 */
.site-aside::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-info), var(--color-warning));
  z-index: 2;
}

.site-aside .aside-brand {
  flex-shrink: 0;
  position: relative;
  padding-top: 1.4rem;
  padding-bottom: 1rem;
}

/* 品牌区底部细分割线 */
.site-aside .aside-brand::after {
  content: "";
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.site-aside .aside-brand img {
  height: auto;
  max-width: 100%;
}

.site-aside .aside-brand .logo {
  height: auto;
  max-width: 100%;
}

.site-aside .aside-brand .logo-sm {
  display: none;
  height: auto;
  max-height: 40px;
}

.site-aside .aside-wrapper {
  height: 100%;
  pointer-events: inherit;
}

.site-aside .aside-menu {
  list-style: none;
}

.site-aside .aside-menu li,
.site-aside .aside-scroll {
  position: relative;
}

.site-aside .aside-scroll {
  padding: 0.4rem 0;
}

/* 侧栏细滚动条 */
.aside-scroll.scrollable::-webkit-scrollbar {
  width: 6px;
}
.aside-scroll.scrollable::-webkit-scrollbar-track {
  background: transparent;
}
.aside-scroll.scrollable::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
.aside-scroll.scrollable:hover::-webkit-scrollbar-thumb {
  background: var(--tertiary-color);
}

/* 菜单项：圆角芯片式，hover/active 有主色淡底与左侧高亮条 */
.site-aside .aside-menu li a {
  align-items: center;
  display: flex;
  flex-wrap: nowrap;
  opacity: 0.72;
  padding: 0.55rem 0.85rem;
  margin: 0.15rem 0.6rem;
  border-radius: var(--radius-md);
  color: var(--secondary-color);
  position: relative;
  transition: background-color 0.25s ease, color 0.25s ease, opacity 0.25s ease, transform 0.2s ease;
}

.site-aside .aside-menu li a:hover {
  opacity: 1;
  background-color: color-mix(in srgb, var(--color-primary) 8%, transparent);
  color: var(--color-primary);
}

/* 当前分类：主色淡底 + 左侧高亮条，视觉聚焦 */
.site-aside .aside-menu li a.active {
  color: var(--color-primary);
  opacity: 1;
  background-color: color-mix(in srgb, var(--color-primary) 14%, transparent);
}

.site-aside .aside-menu li a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 1.35rem;
  border-radius: 0 4px 4px 0;
  background: var(--color-primary);
}

.site-aside .aside-menu li a.active .menu-text {
  font-weight: 600;
}

.site-aside .aside-menu li a .menu-text {
  display: -webkit-box;
  flex: 1 1 auto;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  font-size: 0.9375rem;
  overflow: hidden;
  transition: opacity 0.45s ease, max-width 0.45s ease, margin 0.45s ease;
}

/* 图标：圆角方块 + 主色淡底，激活时填充主色白字，层次更分明 */
.site-aside .menu-icon {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  font-size: 1.1rem;
  height: 2.25rem;
  width: 2.25rem;
  justify-content: center;
  border-radius: var(--radius-sm);
  background-color: color-mix(in srgb, var(--color-primary) 7%, transparent);
  color: var(--color-primary);
  opacity: 0.92;
  position: relative;
  transition: background-color 0.25s ease, transform 0.2s ease, opacity 0.25s ease;
}

.site-aside .aside-menu li a:hover .menu-icon {
  opacity: 1;
  background-color: color-mix(in srgb, var(--color-primary) 16%, transparent);
  transform: scale(1.06);
}

.site-aside .aside-menu li a.active .menu-icon {
  opacity: 1;
  background-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--color-primary) 35%, transparent);
}

/* 滚动条沿用原站 scrollable 风格 */
.scrollable {
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
  overflow-y: auto;
}

.scrollable.hover:hover,
.scrollable.hover:focus,
.scrollable.hover:active {
  overflow: visible;
  overflow-y: auto;
}

.scrollable::-webkit-scrollbar {
  width: 6px;
}

.scrollable::-webkit-scrollbar-thumb {
  background-color: rgba(47, 47, 51, 0.3);
  border-radius: 10px;
}

/* ---------- 顶栏 ---------- */
.site-header {
  background: var(--bg-base);
  box-shadow: var(--shadow-xs);
  left: 0;
  padding-left: 260px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 99;
}

.navbar-brand {
  flex-shrink: 0;
  margin: 0;
  max-width: 150px;
  padding: 0;
}

.navbar-brand img {
  max-height: 45px;
}

.navbar-site li {
  margin: 0 0 0 0.5rem;
  position: relative;
}

.navbar-site li a {
  display: block;
  font-size: 0.9375rem;
  opacity: 0.6;
  padding: 1rem;
  position: relative;
  transition: all 0.25s ease-out 0s;
}

.navbar-site li a:hover {
  opacity: 1;
}

/* ---------- 主体 ---------- */
.site-main {
  margin-top: 95px;
  transition: all 0.2s ease-in-out;
}

/* ---------- 卡片 ---------- */
.block,
.card {
  background-color: var(--bg-base);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.card-xl .card-header {
  margin: 0 0 -0.5rem;
  padding: 1.75rem 1.75rem 0;
  background: transparent;
  border: 0;
}

.card-xl .card-body {
  margin: 1.75rem;
  padding: 0;
}

.card-header .h4 {
  font-size: 1.125rem;
  margin: 0 0.375rem 0 0;
  color: var(--base-color);
  font-weight: 600;
}

.card-tab {
  gap: 0.25rem;
}

.card-tab .nav-link {
  border-radius: var(--radius-sm);
  color: var(--tertiary-color);
  cursor: pointer;
  font-size: 0.8125rem;
  padding: 0.25rem 0.625rem;
  transition: all 0.25s;
  white-space: nowrap;
}

.card-tab .nav-link:hover {
  color: var(--color-primary);
}

.card-tab .nav-link.active {
  background: rgba(47, 102, 255, 0.1);
  color: var(--color-primary);
  font-weight: 600;
}

.card-tab::-webkit-scrollbar {
  height: 3px;
}

/* ---------- 搜索块 ---------- */
.search-block .search-tab {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.search-tab .btn {
  border-radius: var(--radius-sm);
  color: var(--secondary-color);
  font-size: 0.875rem;
  padding: 0.25rem 0.75rem;
}

.search-tab .btn.active {
  background: rgba(47, 102, 255, 0.1);
  color: var(--color-primary);
  font-weight: 600;
}

.search-block .form-control {
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--body-color);
  height: 3rem;
  padding-left: 1rem;
}

.search-block .form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 0.2rem rgba(47, 102, 255, 0.15);
}

/* ---------- 网址列表 ---------- */
.list-grid > div {
  display: flex;
}

.list-grid > div .list-item {
  flex: 1 1 auto;
  flex-direction: row;
}

.list-grid.list-grid-padding .list-item {
  border-radius: var(--radius-sm);
  padding: 1rem;
  transition: all 0.5s;
}

.list-grid.list-grid-padding .list-item:hover {
  background: var(--bg-secondary);
  box-shadow: inset 0 0 40px rgba(16, 16, 44, 0.06);
}

/* 原站在 head 中为小卡片注入的边框（需晚于上面规则，圆角才是 8px） */
.site-main .list-grid .list-item {
  border: 1px solid var(--color-primary) !important;
  border-radius: 8px;
}

.list-grid.list-grid-padding .list-item .media {
  border-radius: inherit;
}

.list-grid.list-grid-padding .list-content {
  padding: 0 0 0 1rem;
}

.list-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  word-wrap: break-word;
}

.list-item.block .list-content {
  padding: 1rem;
}

.list-content {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 1rem 0;
}

.list-body {
  flex: 1 1 auto;
  min-width: 0;
}

.list-title {
  color: inherit;
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4285714286;
}

.list-item:hover .list-title {
  color: var(--color-primary);
}

.list-goto {
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 1;
}

.list-item .drop-favorite {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-in-out, visibility 0.15s ease-in-out;
  visibility: hidden;
  z-index: 2;
}

.list-item:hover .drop-favorite {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

/* ---------- 媒体（网站图标） ---------- */
.media {
  border-radius: inherit;
  display: block;
  flex-shrink: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.media:after {
  content: "";
  display: block;
  padding-top: 100%;
}

.media-content {
  background-color: var(--bg-tertiary);
  background-position: 50% 50%;
  background-repeat: no-repeat;
  background-size: cover;
  border: 0;
  border-radius: inherit;
  bottom: 0;
  height: 100%;
  left: 0;
  object-fit: cover;
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
}

.w-36 {
  font-size: 0.875em;
  height: 36px !important;
  width: 36px !important;
}

/* ---------- 文字工具 ---------- */
.h-1x {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.text-xx {
  font-size: 0.75rem !important;
}

.text-xs {
  font-size: 0.8125rem !important;
}

.text-sm {
  font-size: 0.875rem !important;
}

.text-md {
  font-size: 1rem !important;
}

/* ---------- 按钮 ---------- */
.btn-icon {
  flex-shrink: 0;
  font-size: 1.125rem;
  height: 2.125rem;
  padding: 0 !important;
  position: relative;
  text-align: center;
  width: 2.125rem;
}

.btn-icon span {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  position: absolute;
  top: 0;
  width: 100%;
}

.btn-rounded {
  border-radius: var(--radius-sm);
}

.btn-link {
  color: var(--secondary-color);
}

.btn-link:hover {
  background: var(--bg-secondary);
  color: var(--color-primary);
}

/* ---------- 页脚 / 固定按钮 ---------- */
.site-footer {
  padding-bottom: 2rem;
  padding-top: 3rem;
}

.friend-link {
  color: var(--tertiary-color);
  margin: 0 0.375rem;
}

.friend-link:hover {
  color: var(--color-primary);
}

.site-fixedmenu {
  bottom: 100px;
  list-style: none;
  margin: 0;
  padding: 0;
  position: fixed;
  right: 30px;
  z-index: 999;
}

.site-fixedmenu .btn-start {
  background-color: rgba(22, 22, 24, 0.7);
  border-radius: var(--radius-sm);
  color: #fff;
  transition: all 0.25s;
}

.site-fixedmenu .btn-start:hover {
  background-color: rgba(22, 22, 24, 0.9);
  color: #fff !important;
}

/* ---------- 侧栏折叠 ---------- */
/* 折叠后鼠标移入侧栏时临时展开（与原站 sidemenu-hover-active 一致） */
.sidemenu-hover-active .site-aside.folded {
  width: 240px;
  --bs-offcanvas-width: 240px;
}

.sidemenu-hover-active .site-aside.folded .aside-brand {
  justify-content: flex-start;
}

.sidemenu-hover-active .site-aside.folded .aside-brand .logo {
  margin: 0;
  opacity: 1;
  width: auto;
}

.sidemenu-hover-active .site-aside.folded .aside-brand .logo-sm {
  display: none;
}

.sidemenu-hover-active .site-aside.folded .aside-menu li .menu-text {
  flex: 1 1 auto;
  margin: 0;
  max-width: 200px;
  opacity: 1;
  pointer-events: auto;
}

.menu-collasped-active .site-aside {
  width: 100px;
  --bs-offcanvas-width: 100px;
}

.menu-collasped-active .site-header {
  padding-left: 100px;
}

.menu-collasped-active .site-wrapper {
  padding-left: 100px;
}

.menu-collasped-active .site-aside.folded .aside-brand .logo {
  display: none;
  margin: 0;
  opacity: 0;
  overflow: hidden;
  transition: opacity 0.45s ease, width 0.45s ease, margin 0.45s ease;
  width: 0;
}

.menu-collasped-active .site-aside.folded .aside-brand .logo-sm {
  display: block;
  transition: opacity 0.45s ease;
}

.menu-collasped-active .site-aside.folded .aside-menu li .menu-text {
  flex: 0 0 0;
  margin: 0;
  max-width: 0;
  opacity: 0;
  pointer-events: none;
}

.menu-collasped-active .site-aside.folded .aside-menu li .menu-icon {
  margin-left: auto;
  margin-right: auto;
  transition: margin 0.45s ease;
}

.menu-collasped-active .site-aside.folded .aside-menu li a {
  justify-content: center;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1199.98px) {
  .site-wrapper {
    padding-left: 0;
  }

  .site-header {
    padding-left: 0;
  }
}

@media (min-width: 1200px) and (max-width: 1399.98px) {
  .site-wrapper {
    padding-left: 220px;
  }

  .site-header {
    padding-left: 220px;
  }

  .site-aside {
    width: 220px;
    --bs-offcanvas-width: 220px;
  }
}

@media (max-width: 767.98px) {
  .site-footer {
    padding-bottom: 2rem;
    padding-top: 2rem;
  }

  .card-xl .card-header {
    margin: 0 0 -0.375rem;
    padding: 1.125rem 1.125rem 0;
  }

  .card-xl .card-body {
    margin: 1.125rem;
  }

  .list-grid.list-grid-padding .list-item {
    padding: 0.625rem;
  }

  .site-fixedmenu {
    bottom: 60px;
    right: 16px;
  }
}

/* ---------- 内页文章 ---------- */
.post-heading {
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}

.post-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--base-color);
}

.post-meta {
  color: var(--tertiary-color);
  font-size: 0.875rem;
}

.post-excerpt {
  margin: 0 0 1rem;
}

.post-content {
  font-size: 1rem;
  line-height: 2;
  position: relative;
}

.post-content a:focus,
.post-content a:hover {
  text-decoration: none;
}

.post-content p {
  margin: 0 0 1.5rem;
}

.post-content p > a {
  border-bottom: 1px dashed var(--color-primary);
  transition: 0.3s ease-in;
}

.post-content p > a:hover {
  border-bottom-style: solid;
}

.post-content .h3,
.post-content .h4,
.post-content h3,
.post-content h4 {
  margin: 2.5rem auto 1.5rem;
}

.post-content ul {
  list-style: disc;
  margin-bottom: 1.5rem;
  padding: 0 0 0 1.25rem;
}

.post-content li {
  line-height: 1.5;
  margin: 0 0 1rem;
}

/* ---------- 评论区 ---------- */
#comment-form .comment-form-control {
  background-color: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: none;
  color: var(--body-color);
}

#comment-form .comment-form-control::placeholder {
  color: var(--tertiary-color);
}

#comment-form .comment-form-control:focus {
  background-color: var(--bg-base) !important;
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(47, 102, 255, 0.15);
  color: var(--body-color);
}

#comment-form .comment-submit-btn {
  background-color: var(--color-primary) !important;
  border-color: var(--border-color) !important;
  color: var(--bg-base) !important;
}

#comment-form .comment-submit-btn:hover {
  background-color: var(--color-dark) !important;
  color: var(--bg-base) !important;
}

.comments-empty {
  background: var(--bg-secondary);
}

.comments-empty-icon {
  background: var(--bg-base);
  height: 56px;
  width: 56px;
}

.comment-item {
  border-bottom: 1px solid var(--border-color);
}

.comment-item:last-child {
  border-bottom: 0;
}

.min-w-0 {
  min-width: 0;
}

.comment-avatar {
  align-items: center;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  font-size: 1rem;
  font-weight: 600;
  height: 40px;
  justify-content: center;
  width: 40px;
}

/* ---------- 内页美化（留言树洞 / 时间目录） ---------- */
body[data-page] .post.card {
  border: none;
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 12px 40px rgba(47, 47, 51, 0.07);
  overflow: hidden;
}
/* 卡片顶部渐变装饰条，呼应首页侧栏风格 */
body[data-page] .post-other-style::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-info), var(--color-warning));
}
/* 标题居中 + 渐变下划线 */
body[data-page] .post-heading { padding-top: 3rem; padding-bottom: 1.5rem; }
body[data-page] .post-title {
  position: relative;
  display: inline-block;
}
body[data-page] .post-title::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -14px;
  width: 64px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-info));
}
body[data-page] .post-meta { margin-top: 1.4rem; margin-bottom: 0; }
body[data-page] .post-content { color: var(--secondary-color); padding-bottom: 1rem; }
body[data-page] .post-content p { color: var(--secondary-color); }

/* 留言树洞：评论项精致化 */
#comments { background: var(--bg-base); }
.comment-item {
  padding: 1.1rem 0;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid var(--border-color);
}
.comment-item:hover { background-color: color-mix(in srgb, var(--color-primary) 4%, transparent); }
.comment-avatar {
  background: linear-gradient(135deg, var(--color-primary), var(--color-info));
  box-shadow: 0 4px 12px rgba(47, 102, 255, 0.25);
}
.comment-name { font-weight: 600; color: var(--base-color); }
.comment-text { color: var(--secondary-color); line-height: 1.8; }

/* 时间目录：站点目录组件 */
.archive-note {
  font-size: 0.85rem;
  color: var(--tertiary-color);
  margin: 0.25rem 0 1.75rem;
}
.archive-dir { margin-top: 0.25rem; }
.archive-cat { margin-bottom: 2rem; }
.archive-cat-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.08rem;
  color: var(--base-color);
  margin-bottom: 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border-color);
}
.archive-cat-title i { color: var(--color-primary); }
.archive-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.dir-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 12px);
  text-decoration: none;
  color: var(--secondary-color);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  min-width: 0;
}
.dir-item:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--color-primary) 6%, transparent);
  border-color: color-mix(in srgb, var(--color-primary) 40%, transparent);
  box-shadow: 0 6px 18px rgba(47, 102, 255, 0.12);
  color: var(--color-primary);
}
.dir-ico {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-base);
}
.dir-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
