/**
 *Copyright (C), 2025, GOSUN CL
 *file: widgets.css
 *brief: 视评图说主题
 *Theme URI: https://faq7777.com
 *author: 视评图说
 *date: 2025年7月7日
 *version: 7.7.0
 */
/* widgets module extracted for per-page loading */

/* CSS 变量兜底定义 */
:root {
  --spt-primary: #006abe;
  --spt-primary-rgb: 0, 106, 190;
  --spt-background: #f9f9f9;
  --spt-border: #e4e4e4;
  --spt-grad: linear-gradient(135deg, var(--spt-primary), #0056b3);
  --spt-grad-vert: linear-gradient(180deg, var(--spt-primary), #0056b3);
}

/* 容器样式 */
.box {
  background-color: rgba(255,255,255,0.8);
  padding: 12px;
  overflow: hidden;
  margin-bottom: 15px;
  border-radius: 12px;
}

/* 标题样式 */
.boxTitle {
  border-bottom: 1px solid rgba(255,255,255,0.5);
  position: relative;
  padding-bottom: 5px;
  margin-bottom: 8px;
  list-style-type: none;
}

.boxTitle .name {
  font-size: 16px;
  line-height: 1.5em;
  margin-right: 50px;
  color: #fff;
}

/* 移除伪元素，防止出现黑点 */
.boxTitle::after,
.boxTitle::before {
  content: none;
  display: none;
}

.boxTitle span,
.boxTitle .arrow {
  display: block;
  position: absolute;
  right: 0;
  top: 0;
  font-weight: bold;
  font-size: 14px;
  line-height: 24px;
  overflow: hidden;
}

.boxTitle i {
  font-style: normal;
  font-weight: bold;
  color: var(--spt-primary);
}

.boxTitle span a {
  font-weight: normal;
  color: #888;
  position: relative;
  padding-right: 10px;
  font-size: 12px;
}

.boxTitle span a::after {
  width: 6px;
  height: 6px;
  border-right: 1px solid #888;
  border-bottom: 1px solid #888;
  content: '';
  display: block;
  position: absolute;
  right: 1px;
  top: 50%;
  transform: rotate(-45deg);
  margin-top: -4px;
}

/* WordPress标题样式 */
.wp-block-heading {
  font-size: 16px;
  line-height: 1.5em;
  border-bottom: 1px solid var(--spt-border);
  padding-bottom: 5px;
  margin-bottom: 10px;
  position: relative;
  list-style-type: none;
}

/* 移除WordPress标题伪元素 */
.wp-block-heading::after,
.wp-block-heading::before {
  content: none;
  display: none;
}

/* 表格布局样式 */
.table {
  display: flex;
  width: 100%;
  flex-wrap: nowrap;
}

.table .td {
  display: block;
  vertical-align: top;
}

/* 文章页两栏布局 - 位置对换 */
.table #main {
  order: 2;
  flex: 0 0 70%;
  padding-left: 30px;
  box-sizing: border-box;
}

.table #sidebar {
  order: 1;
  flex: 0 0 30%;
  padding-right: 30px;
  box-sizing: border-box;
}

/* 全局统一清除小部件列表默认样式 */
.widget ul {
  overflow: hidden;
  list-style-type: none;
  padding: 0;
  margin: 0;
}
.widget li {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.875em;
}
.widget img {
  max-width: 100%;
  height: auto;
}
.widget .custom {
  margin-bottom: 15px;
  padding-bottom: 15px;
}
.widget .custom:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}
.widget .thumbnail {
  width: 100px;
  float: left;
}
.widget .info {
  margin-left: 110px;
}
.widget .title {
  font-size: 14px;
  line-height: 1.75em;
  height: 3.5em;
  color: #333;
  overflow: hidden;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.widget .meta {
  font-size: 12px;
  line-height: 1.5em;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: no-repeat left center;
  background-size: auto 12px;
  padding-left: 17px;
}
.widget .views {
  background-image: url("../images/icon_01.png");
}
.widget .rand {
  background-image: url("../images/icon_02.png");
}
.widget .cmt {
  background-image: url("../images/icon_04.png");
}
.widget .date {
  background-image: url("../images/icon_03.png");
}

.textwidget a {
  display: block;
}
.textwidget img {
  display: block;
}

.widget_mza_recent_comments li {
  overflow: hidden;
  color: #444;
  margin-bottom: 10px;
  padding-bottom: 8px;
  text-align: justify;
}
.widget_mza_recent_comments li:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
}
.widget_mza_recent_comments li .top {
  border: 1px solid #eee;
  padding: 5px 10px;
  font-size: 12px;
  line-height: 1.75em;
  color: #999;
  position: relative;
  margin-bottom: 10px;
}
.widget_mza_recent_comments li .top::after {
  content: '';
  display: block;
  width: 7px;
  height: 7px;
  border-right: 1px solid #eee;
  border-bottom: 1px solid #eee;
  background-color: #fff;
  transform: rotate(45deg);
  position: absolute;
  bottom: -5px;
  left: 7px;
}
.widget_mza_recent_comments li .gravatar {
  float: left;
  width: 24px;
  height: 24px;
  overflow: hidden;
  border-radius: 50%;
}
.widget_mza_recent_comments li img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.widget_mza_recent_comments li .text {
  margin-left: 30px;
  line-height: 24px;
  max-height: 48px;
  display: -webkit-box;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.widget_mza_recent_comments li a {
  overflow: hidden;
  color: #555;
}

.widget_nav_menu ul li,
.wp-block-page-list ul li,
.widget_categories ul li,
.wp-block-categories ul li,
.widget_pages ul li,
.widget_meta ul li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.5% 0;
  list-style-type: none;
}
.wp-block-page-list ul li a,
.widget_categories ul li a,
.wp-block-categories ul li a,
.widget_pages ul li a,
.widget_nav_menu ul li a,
.widget_meta ul li a {
  background-color: var(--spt-background);
  color: #555;
  padding: 4px 8px;
  display: block;
}
.wp-block-page-list ul li ul li a,
.widget_categories ul li ul li a,
.wp-block-categories ul li ul li a,
.widget_pages ul li ul li a {
  padding-left: 2em;
}

.widget_archive ul li,
.wp-block-archives ul li,
.widget_links ul li {
  float: left;
  width: 48%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.5% 0;
  font-size: 12px;
  list-style-type: none;
}
.widget_archive ul li:nth-child(2n),
.wp-block-archives ul li:nth-child(2n),
.widget_links ul li:nth-child(2n) {
  float: right;
}
.widget_links ul li a,
.widget_archive ul li a,
.wp-block-archives ul li a {
  background-color: var(--spt-background);
  color: #555;
  padding: 4px 8px;
  display: block;
}

.widget_calendar .wp-block-calendar,
.widget_calendar .calendar_wrap {
  padding: 20px;
}
.widget_calendar caption {
  margin-bottom: 10px;
  line-height: 1.35em;
  font-weight: bold;
  vertical-align: middle;
}
.widget_calendar .wp-calendar-nav a {
  font-size: 0.875em;
  line-height: 2em;
}
/* 修正日历单元格宽度为标准 7 等分 */
.widget_calendar td,
.widget_calendar th {
  width: 14.285%;
  padding: 0 0.5%;
  text-align: center;
  font-size: 14px;
}
.widget_calendar td a {
  padding: 10%;
  background-color: var(--spt-primary);
  border-radius: 50%;
  color: #fff;
}

.widget_search form {
  position: relative;
}
.widget_search .searchform > div,
.widget_search .wp-block-search__inside-wrapper {
  position: relative;
  padding-right: 42px;
  overflow: hidden;
}
.widget_search label {
  font-size: 0.875em;
  position: absolute;
  left: 0;
  top: 0;
  line-height: 40px;
  padding: 0 3%;
  cursor: text;
  width: 94%;
  display: none;
}
.widget_search input[type='text'],
.widget_search .wp-block-search__input {
  height: 24px;
  line-height: 24px;
  padding: 8px 3%;
  border: 1px solid var(--spt-border);
  width: 94%;
  box-sizing: content-box;
}
/* 统一搜索按钮样式 */
.widget_search input[type='submit'],
.widget_search .wp-element-button {
  color: #fff;
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 42px;
  background-color: var(--spt-primary);
  cursor: pointer;
  font-size: 14px;
  border: none;
}
.widget_search input[type='submit']:hover,
.widget_search .wp-element-button:hover {
  background-color: rgba(0, 106, 190, 0.8);
}

.widget_recent_comments li,
.widget_recent_entries li {
  position: relative;
  padding: 0 0 8px 0;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--spt-border);
  list-style-type: none;
}

/* 移除伪元素，确保没有黑点显示 */
.widget_recent_comments ul li::before,
.widget_recent_entries ul li::before,
.widget_recent_comments ul li::after,
.widget_recent_entries ul li::after {
  content: none;
  display: none;
}

.widget_recent_comments li:last-child,
.widget_recent_entries li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.widget_tag_cloud .tagcloud,
.widget_tag_cloud .wp-block-tag-cloud {
  display: flex;
  flex-wrap: wrap;
}
/* 修复标签云文字颜色视觉冲突，默认深色，hover白色 */
.widget_tag_cloud a {
  display: block;
  background-color: var(--spt-background);
  border-radius: 0;
  padding: 0 10px;
  color: #555;
  font-size: 12px;
  margin: 1% 1% 1% 0;
  line-height: 2.2em;
}

/* 标签云颜色和交互效果 */
.widget_tag_cloud a:hover {
  opacity: 0.8;
  color: #fff;
}
.widget_tag_cloud a:nth-child(8n-7) {
  background-color: #8A9B0F;
}
.widget_tag_cloud a:nth-child(8n-6) {
  background-color: #EB6841;
}
.widget_tag_cloud a:nth-child(8n-5) {
  background-color: #3FB8AF;
}
.widget_tag_cloud a:nth-child(8n-4) {
  background-color: #FE4365;
}
.widget_tag_cloud a:nth-child(8n-3) {
  background-color: #FC9D9A;
}
.widget_tag_cloud a:nth-child(8n-2) {
  background-color: #EDC951;
}
.widget_tag_cloud a:nth-child(8n-1) {
  background-color: #C8C8A9;
}
.widget_tag_cloud a:nth-child(8n) {
  background-color: #83AF9B;
}
.widget_tag_cloud a:first-child {
  background-color: #E1474D;
}
.widget_tag_cloud a:last-child {
  background-color: #3299BB;
}

/* 响应式设计调整 */
@media (max-width: 768px) {
  .widget .info {
    margin-left: 110px;
  }
  .widget .custom {
    margin-bottom: 10px;
    padding-bottom: 10px;
  }
  .widget_mza_recent_comments li {
    margin-bottom: 12px;
    padding-bottom: 8px;
  }
}

/* 点标记样式 */
.dot {
  position: relative;
  padding-left: 13px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 文本省略样式，补全行数和兼容前缀 */
.line {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
  .btn-ghost,
  .widget_search input[type='submit'],
  .widget_search .wp-element-button {
    color: #cfe1ff;
    border-color: rgba(255, 255, 255, 0.25);
  }
  .btn-ghost:hover,
  .widget_search input[type='submit']:hover,
  .widget_search .wp-element-button:hover {
    background: rgba(255, 255, 255, 0.08);
  }
}

/* 侧边栏样式 */
#sidebar {
  width: 300px;
}
@media (max-width: 1024px) {
  #sidebar {
    width: 100%;
  }
}

/* 小屏列布局：避免表格等高导致侧栏下方出现大空白 */
@media (max-width: 1024px) {
  .table {
    display: block;
    table-layout: auto;
    margin: 0 auto;
    max-width: 100%;
  }
  .table .td {
    display: block;
    width: 100%;
    margin: 0 auto;
  }
  .table #main {
    padding-left: 0;
    padding-right: 0;
  }
  .table #sidebar {
    padding-right: 0;
    padding-left: 0;
  }
}

/* 友情链接样式，修正宽度计算错误 */
.sptsz-friendlink {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 0;
}
.sptsz-friendlink a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(50% - 5px);
  height: 40px;
  background: var(--spt-background);
  border: 1px solid var(--spt-border);
  border-radius: 6px;
  text-align: center;
  padding: 0 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: all 0.3s ease;
}
.sptsz-friendlink a:hover {
  background: var(--spt-primary);
  color: #fff;
  border-color: var(--spt-primary);
}

/* 渐变工具类 */
.u-grad {
  background: var(--spt-grad);
  color: #fff;
}
.u-grad-vert {
  background: var(--spt-grad-vert);
  color: #fff;
}

/* 玻璃拟态工具类 */
.u-glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.10));
  border: 1px solid rgba(255, 255, 255, 0.30);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), inset 0 1px rgba(255, 255, 255, 0.45);
}
@media (max-width: 768px) {
  .u-glass {
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10), inset 0 1px rgba(255, 255, 255, 0.35);
  }
}
