/* =========================================================================
   DSH Theme Skin — 视觉美化层
   只改样式，不动主题结构 / 不改任何 PHP 逻辑
   加载于 main.min.css 之后，通过特异性覆盖
   ========================================================================= */

:root {
  --dsh-radius:    14px;
  --dsh-radius-sm: 10px;
  --dsh-radius-xs: 8px;

  --dsh-line:      #e8ecf3;
  --dsh-line-soft: #f1f4f9;

  --dsh-ink:   #151a21;
  --dsh-ink-2: #4d5766;
  --dsh-ink-3: #8b95a5;

  --dsh-bg:    #f5f7fa;
  --dsh-card:  #ffffff;
  --dsh-brand: #2f6bff;

  --dsh-shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
  --dsh-shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 8px  rgba(15, 23, 42, .05);
  --dsh-shadow-md: 0 4px 12px rgba(15, 23, 42, .07), 0 12px 32px rgba(15, 23, 42, .07);
  --dsh-shadow-lg: 0 10px 24px rgba(15, 23, 42, .10), 0 24px 56px rgba(15, 23, 42, .10);
}

/* ---------- 1. 全局 ---------- */
body {
  background: var(--dsh-bg);
  color: var(--dsh-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; }

/* ---------- 2. 顶栏 ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--dsh-line);
  box-shadow: var(--dsh-shadow-xs);
}
.site-header .navbar { padding-top: 9px; padding-bottom: 9px; }
.site-header .logo.regular { max-height: 40px; width: auto; }

.nav-list .menu-item > a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--dsh-ink-2);
  padding: 8px 13px;
  border-radius: var(--dsh-radius-xs);
  transition: color .18s, background-color .18s;
}
.nav-list .menu-item > a:hover,
.nav-list .menu-item.current-menu-item > a {
  color: var(--dsh-ink);
  background: var(--dsh-line-soft);
}
.nav-list .menu-item > a i { font-size: 11.5px; opacity: .5; }

/* 顶栏右侧按钮 */
.site-header .btn-login,
.site-header .header-actions .btn {
  border-radius: 999px !important;
  font-size: 13.5px;
  font-weight: 600;
}

/* ---------- 3. 首页 Hero / 搜索 ---------- */
.search-bg-overlay {
  background: linear-gradient(180deg, rgba(8, 18, 34, .58) 0%, rgba(8, 18, 34, .34) 100%);
}

.search-warp { padding-top: 54px; padding-bottom: 46px; }

.search-title {
  font-size: 29px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .28);
  margin-bottom: 0;
}

.search-desc { color: rgba(255, 255, 255, .78); font-size: 13.5px; margin-top: 8px; }

.search-form { max-width: 740px; margin: 24px auto 0; }

.search-form form {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--dsh-shadow-lg);
  border: 1px solid rgba(255, 255, 255, .6);
}

.search-select { flex: 0 0 auto; }
.search-select .form-select {
  border: 0 !important;
  background-color: transparent !important;
  box-shadow: none !important;
  font-size: 13.5px;
  color: var(--dsh-ink-2);
  padding-left: 18px;
  padding-right: 30px;
  max-width: 128px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%238b95a5'%3E%3Cpath d='M4.5 6.5 8 10l3.5-3.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  appearance: none;
}

/* 主题用 .search-form .search-fields button{background:0 0!important;position:absolute} 强制透明+绝对定位，
   窄屏下绝对定位会失效。这里改成 flex 排布，桌面/移动都稳定。 */
.search-form .search-fields {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding-right: 5px;
  min-width: 0;
  overflow: visible;
}
.search-form .search-fields input {
  flex: 1 1 auto;
  width: auto;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  font-size: 15px;
  padding: 11px 4px 11px 14px !important;
  min-width: 0;
}
.search-form .search-fields input::placeholder { color: var(--dsh-ink-3); }
.search-form .search-fields button {
  position: static !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  flex: 0 0 38px;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--dsh-brand) !important;
  color: #fff !important;
  opacity: 1 !important;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  font-size: 14px !important;
  transition: background-color .18s;
}
.search-form .search-fields button:hover {
  background: #1f57e0 !important;
  opacity: 1 !important;
}

.search-hots { margin-top: 16px; font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.search-hots a { color: rgba(255, 255, 255, .92); margin-right: 10px; }
.search-hots a:hover { color: #fff; text-decoration: underline; }

/* ---------- 4. 网格间距 ---------- */
.posts-warp.row {
  --bs-gutter-x: 20px;
  --bs-gutter-y: 20px;
}

/* ---------- 5. 卡片 ---------- */
.post-item {
  background: var(--dsh-card);
  border: 1px solid var(--dsh-line);
  border-radius: var(--dsh-radius);
  box-shadow: var(--dsh-shadow-xs);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  transition: transform .22s cubic-bezier(.2, .7, .3, 1),
              box-shadow .22s cubic-bezier(.2, .7, .3, 1),
              border-color .22s;
}
.post-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--dsh-shadow-md);
  border-color: transparent;
}

/* 竖版卡片（首页） */
.item-grid {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.item-grid .entry-media {
  border-radius: var(--dsh-radius) var(--dsh-radius) 0 0;
  overflow: hidden;
}
.item-grid .entry-wrapper {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.item-grid .entry-meta { margin-top: auto; }

/* 防止长标题/中文串撑破卡片 */
.post-item .entry-wrapper,
.post-item .entry-body,
.post-item .entry-title,
.post-item .entry-title a,
.post-item .entry-desc {
  min-width: 0;
  max-width: 100%;
}
.post-item .entry-title a,
.post-item .entry-desc {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 横版卡片（分类页） */
.item-list {
  display: flex;
  align-items: stretch;
  height: 100%;
}
/* 主题的 .ratio 用 --ri-aspect-ratio(非 Bootstrap 变量)，会把左图压成矮条并留白。
   这里让左图拉伸填满卡片高度。 */
.item-list .entry-media {
  flex: 0 0 240px;
  width: 240px;
  max-width: 240px;
  margin-right: 0;
  align-self: stretch;
  border-radius: var(--dsh-radius) 0 0 var(--dsh-radius);
  overflow: hidden;
}
.item-list .entry-media.ratio::before {
  padding-top: 0;
  content: none;
  display: none;
}
.item-list .entry-media .media-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.item-list .entry-wrapper {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.item-list .entry-body { padding: 14px 16px 0; }
.item-list .entry-footer { padding: 0 16px 14px; }

.entry-media .media-img {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform .35s cubic-bezier(.2, .7, .3, 1);
}
.post-item:hover .entry-media .media-img { transform: scale(1.04); }

/* ---------- 6. 卡片内部排版 ---------- */
.entry-wrapper { padding: 14px 16px 15px; }

.entry-cat-dot { margin-bottom: 8px; line-height: 1; }
.entry-cat-dot a {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dsh-brand);
  background: rgba(47, 107, 255, .08);
  padding: 4px 10px;
  border-radius: 999px;
  transition: background-color .18s;
}
.entry-cat-dot a:hover { background: rgba(47, 107, 255, .15); }

.entry-title {
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: -.005em;
  margin: 0 0 8px;
}
.entry-title a {
  color: var(--dsh-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .18s;
}
.entry-title a:hover { color: var(--dsh-brand); }

.entry-desc {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--dsh-ink-3);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 横版卡片：描述压到 1 行，卡片更紧凑，左图裁切更少 */
.item-list .entry-desc {
  -webkit-line-clamp: 1;
  margin-bottom: 8px;
}

.entry-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 13px;
  font-size: 11.5px;
  color: var(--dsh-ink-3);
  padding-top: 10px;
  border-top: 1px solid var(--dsh-line-soft);
}
.entry-meta i { font-size: 11px; opacity: .55; }
.entry-meta span { white-space: nowrap; }

/* ---------- 7. VIP 徽章 ---------- */
.tips-badge .badge {
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: .04em;
  padding: 4px 10px !important;
  border-radius: 7px !important;
  background: linear-gradient(135deg, #f7b733 0%, #e08b1a 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(224, 139, 26, .38);
  backdrop-filter: blur(4px);
}

/* ---------- 8. 加载更多 / 分页 ---------- */
.infinite-scroll-button {
  border-radius: 999px !important;
  font-size: 14px !important;
  font-weight: 600;
  padding: 12px 46px !important;
  background: var(--dsh-ink) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: var(--dsh-shadow-sm);
  transition: transform .18s, box-shadow .18s, background-color .18s;
}
.infinite-scroll-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--dsh-shadow-md);
  background: #000 !important;
}

.page-nav .page-link {
  border-radius: var(--dsh-radius-xs) !important;
  border-color: var(--dsh-line) !important;
  color: var(--dsh-ink-2);
  font-size: 13.5px;
  margin: 0 3px;
}
.page-nav .page-link:hover { background: var(--dsh-line-soft); color: var(--dsh-ink); }

/* ---------- 9. 分类 / 归档 Hero ---------- */
.archive-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 4px;
}
.archive-hero-bg {
  filter: blur(2px) brightness(.5) saturate(1.1);
  transform: scale(1.06);
}
.archive-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 18, 32, .44) 0%, rgba(10, 18, 32, .68) 100%);
  pointer-events: none;
}
.archive-hero > .container { position: relative; z-index: 2; }
.archive-title {
  color: #fff !important;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -.02em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .45);
  margin-bottom: 0 !important;
}

/* ---------- 10. 侧边栏 ---------- */
.sidebar .widget {
  background: #fff;
  border: 1px solid var(--dsh-line);
  border-radius: var(--dsh-radius);
  padding: 18px 18px 20px;
  margin-bottom: 18px;
  box-shadow: var(--dsh-shadow-xs);
}
.sidebar .widget:last-child { margin-bottom: 0; }

.sidebar .widget .wp-block-heading,
.sidebar .widget .widget-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dsh-ink);
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--dsh-line-soft);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -.01em;
}

/* 侧边栏搜索框 —— 修复「搜索」按钮文字竖排 */
.wp-block-search__label {
  display: block;
  font-size: 13px;
  color: var(--dsh-ink-2);
  font-weight: 600;
  margin-bottom: 9px;
}
.wp-block-search__inside-wrapper {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: stretch;
  border: 1px solid var(--dsh-line) !important;
  border-radius: var(--dsh-radius-sm) !important;
  overflow: hidden;
  background: #fff;
  transition: border-color .18s, box-shadow .18s;
}
.wp-block-search__inside-wrapper:focus-within {
  border-color: var(--dsh-brand) !important;
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}
.wp-block-search__input {
  flex: 1 1 auto !important;
  min-width: 0;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: 13.5px !important;
  padding: 10px 13px !important;
  background: transparent !important;
}
.wp-block-search__button {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  letter-spacing: normal !important;
  min-width: 68px;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--dsh-brand) !important;
  color: #fff !important;
  font-size: 13.5px !important;
  font-weight: 600;
  padding: 0 18px !important;
  transition: background-color .18s;
}
.wp-block-search__button:hover { background: #1f57e0 !important; }

/* 近期文章 / 评论列表 */
.wp-block-latest-posts__list,
.sidebar .widget ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.wp-block-latest-posts__list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--dsh-line-soft);
  font-size: 13px;
  line-height: 1.6;
}
.wp-block-latest-posts__list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.wp-block-latest-posts__list a { color: var(--dsh-ink-2); transition: color .18s; }
.wp-block-latest-posts__list a:hover { color: var(--dsh-brand); }

/* ---------- 11. 文章页 ---------- */
.single .content-wrapper .entry-title,
.single .post-content > .entry-title,
.single h1.entry-title {
  font-size: 27px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--dsh-ink);
  margin-bottom: 16px;
}

/* 元信息框 */
.entry-page-info {
  background: linear-gradient(180deg, #f9fbfd 0%, #f3f7fb 100%);
  border: 1px solid var(--dsh-line);
  border-radius: var(--dsh-radius-sm);
  padding: 14px 16px;
  font-size: 12.5px;
  color: var(--dsh-ink-2);
  line-height: 1.9;
}

/* 下载 / 购买区 */
.down-buy-warp {
  background: #fff;
  border: 1px solid var(--dsh-line);
  border-radius: var(--dsh-radius);
  padding: 18px 20px;
  box-shadow: var(--dsh-shadow-xs);
}
.buy-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--dsh-ink);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.buy-title i { color: var(--dsh-brand); }

.prices-info {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}
.price-item {
  font-size: 12.5px;
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--dsh-line-soft);
  color: var(--dsh-ink-2);
  border: 1px solid transparent;
  line-height: 1.2;
}
.price-item.no { background: #f2f5f9; }
.price-item.vip {
  background: rgba(47, 107, 255, .08);
  color: #2f6bff;
  border-color: rgba(47, 107, 255, .18);
  font-weight: 600;
}
.price-item.boosvip {
  background: linear-gradient(135deg, rgba(247, 183, 51, .16), rgba(224, 139, 26, .16));
  color: #a56a00;
  border-color: rgba(224, 139, 26, .26);
  font-weight: 600;
}

.buy-btns .btn-danger {
  background: linear-gradient(135deg, #ff5f57 0%, #e8342b 100%) !important;
  border: 0 !important;
  border-radius: var(--dsh-radius-sm) !important;
  font-size: 14px !important;
  font-weight: 600;
  padding: 11px 26px !important;
  box-shadow: 0 6px 18px rgba(232, 52, 43, .28);
  transition: transform .18s, box-shadow .18s;
}
.buy-btns .btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(232, 52, 43, .36);
}

/* Tab 切换 */
.single-content-nav .nav-pills { gap: 9px; border: 0; }
.single-content-nav .nav-pills .nav-link {
  border-radius: var(--dsh-radius-sm);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 22px;
  color: var(--dsh-ink-2);
  background: #fff;
  border: 1px solid var(--dsh-line);
  transition: all .18s;
}
.single-content-nav .nav-pills .nav-link:hover {
  border-color: #d5dded;
  color: var(--dsh-ink);
}
.single-content-nav .nav-pills .nav-link.active {
  background: var(--dsh-brand);
  border-color: var(--dsh-brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 107, 255, .28);
}

/* 正文排版 */
.content-wrapper .post-content p,
.content-wrapper .post-content li {
  font-size: 15.5px;
  line-height: 1.95;
  color: #2a3340;
}
.content-wrapper .post-content p { margin-bottom: 1.1em; }

.content-wrapper .post-content img {
  border-radius: var(--dsh-radius-sm);
  box-shadow: var(--dsh-shadow-sm);
  height: auto;
}

.content-wrapper .post-content h2 {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.45;
  margin: 1.9em 0 .75em;
  padding-left: 13px;
  border-left: 4px solid var(--dsh-brand);
  color: var(--dsh-ink);
}
.content-wrapper .post-content h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 1.6em 0 .65em;
  color: var(--dsh-ink);
}
.content-wrapper .post-content blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  background: #f8fafc;
  border-left: 3px solid var(--dsh-brand);
  border-radius: 0 var(--dsh-radius-xs) var(--dsh-radius-xs) 0;
  color: var(--dsh-ink-2);
}
.content-wrapper .post-content blockquote p:last-child { margin-bottom: 0; }

.content-wrapper .post-content a { color: var(--dsh-brand); }
.content-wrapper .post-content a:hover { text-decoration: underline; }

.content-wrapper .post-content table {
  border-radius: var(--dsh-radius-xs);
  overflow: hidden;
  box-shadow: var(--dsh-shadow-xs);
}

/* 面包屑 */
.breadcrumb, .entry-breadcrumb {
  font-size: 12.5px;
  color: var(--dsh-ink-3);
  margin-bottom: 14px;
}
.breadcrumb a, .entry-breadcrumb a { color: var(--dsh-ink-3); }
.breadcrumb a:hover, .entry-breadcrumb a:hover { color: var(--dsh-brand); }

/* ---------- 12. 页脚 ---------- */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--dsh-line);
  color: var(--dsh-ink-3);
  font-size: 12.5px;
  line-height: 1.85;
  margin-top: 40px !important;
}
.site-footer .container { padding-top: 8px; padding-bottom: 8px; }

/* ---------- 13. 回到顶部 ---------- */
.back-top {
  border-radius: 50% !important;
  box-shadow: var(--dsh-shadow-md);
}

/* ---------- 14. 响应式 ---------- */
@media (max-width: 991.98px) {
  .search-warp { padding-top: 38px; padding-bottom: 32px; }
  .search-title { font-size: 22px; }
  .archive-title { font-size: 24px; }
  .single .content-wrapper .entry-title,
  .single h1.entry-title { font-size: 21px; }
}

@media (max-width: 767.98px) {
  .posts-warp.row { --bs-gutter-x: 12px; --bs-gutter-y: 12px; }
  .entry-wrapper { padding: 11px 12px 12px; }
  .entry-title { font-size: 13.5px; line-height: 1.45; }
  .entry-desc { font-size: 12px; -webkit-line-clamp: 2; }
  .entry-meta { gap: 9px; font-size: 11px; }
  .item-list { flex-direction: column; }
  .item-list .entry-media {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    align-self: auto;
    border-radius: var(--dsh-radius) var(--dsh-radius) 0 0;
  }
  /* 移动端恢复 3:2 比例，避免整块被压扁 */
  .item-list .entry-media.ratio::before {
    display: block;
    content: "";
    padding-top: var(--ri-aspect-ratio, 66.6666667%);
  }
  .item-list .entry-body { padding: 11px 12px 0; }
  .item-list .entry-footer { padding: 0 12px 12px; }
  .search-form form { border-radius: 14px; padding: 5px; }
  .search-select { display: none; }
  .content-wrapper .post-content p,
  .content-wrapper .post-content li { font-size: 15px; line-height: 1.85; }
}
