/* Thymeleaf 页面统一样式补丁（在 base.css 之后加载） */

.section-title {
  margin: 0 0 16px;
}

.section-title h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
}

.section-more {
  margin-top: 12px;
  text-align: right;
}

.section-more a {
  color: var(--theme-color);
  text-decoration: none;
}

.section-more a:hover {
  text-decoration: underline;
}

.featured-ad-items .item {
  overflow: hidden;
}

.featured-ad-items .item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.game-confirm {
  position: fixed;
  inset: 0;
  z-index: 10060;
}

.game-confirm-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.game-confirm-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(90vw, 360px);
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 12px;
  padding: 18px 18px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

.game-confirm-title {
  margin: 0 0 10px;
  font-size: 18px;
}

.game-confirm-message {
  margin: 0;
  color: #666;
  line-height: 1.6;
  font-size: 14px;
}

.game-confirm-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.game-confirm-actions .btn-cancel,
.game-confirm-actions .btn-ok {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}

.game-confirm-actions .btn-cancel {
  background: #f2f2f2;
  color: #333;
}

.game-confirm-actions .btn-ok {
  background: var(--theme-color);
  color: #fff;
}

body.game-confirm-show {
  overflow: hidden;
}

.latest-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 14px;
}

.latest-tabs a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 16px;
  background: #f5f5f5;
  color: #666;
  text-decoration: none;
  font-size: 13px;
  line-height: 1;
}

.latest-tabs a.active {
  background: var(--theme-color);
  color: #fff;
}

#latestGridWrap {
  transition: opacity 0.2s ease;
}

#latestGridWrap.is-loading {
  opacity: 0.65;
}

#latestGridWrap .latest-empty {
  padding: 20px 0;
  text-align: center;
  color: #999;
}

.posts.grids .post.grid .img {
  border-radius: 10px;
  overflow: hidden;
}

.posts.grids .post.grid .img .thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.posts.grids .post.grid .con h3 {
  margin: 10px 0 8px;
  line-height: 1.4;
}

.posts.grids .post.grid .excerpt {
  min-height: 42px;
  color: #666;
}

.pagination ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.pagination ul li a,
.pagination ul li span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  background: #fff;
}

.login-page-wrap .form-row,
.invite-wrap .form-row {
  margin-bottom: 14px;
}

.login-page-wrap input,
.invite-wrap input,
.invite-wrap textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 10px 12px;
}

.login-page-wrap button,
.invite-wrap button {
  border: none;
  border-radius: 8px;
  background: var(--theme-color);
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
}

.sidebar--sticky {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.header-user {
  position: relative;
}

.header-user .user-avatar-link {
  display: inline-block;
  padding: 0 !important;
}

.header-user .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
}

.header-user .user-dropdown {
  position: absolute;
  top: 68px;
  right: 0;
  min-width: 140px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border-radius: 12px;
  background-color: #fff;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(0, 0, 0, 0.03), transparent 35%),
    radial-gradient(circle at 80% 30%, rgba(0, 0, 0, 0.025), transparent 40%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 1));
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
  z-index: 10010;
  display: none;
}

.header-user .user-dropdown::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 16px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.header-user .user-dropdown li + li {
  margin-top: 4px;
}

.header-user .user-dropdown li {
  padding: 0;
  margin: 0;
  width: 100%;
}

.header-user.is-open .user-dropdown,
.header-user:focus-within .user-dropdown,
.header-user:hover .user-dropdown {
  display: block;
}

.header-user .user-dropdown li a {
  display: block;
  margin: 0 -8px;
  padding: 10px 20px;
  border-radius: 0;
  color: #2e3757;
  text-decoration: none;
  white-space: nowrap;
  box-sizing: border-box;
  border: none !important;
  position: relative;
  text-align: center;
}

.header-user .user-dropdown li:first-child a {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

.header-user .user-dropdown li:last-child a {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

.header-user .user-dropdown li a:hover {
  background: rgba(0, 0, 0, 0.05);
}

#authModal .auth-close {
  position: absolute;
  top: 10px;
  right: 14px;
  color: #999;
  text-decoration: none;
  z-index: 2;
}

#authModal .captcha-sms-clk {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--theme-color);
  text-decoration: none;
}

#authModal .captcha-sms-clk.disabled {
  color: #999;
  pointer-events: none;
}

.single-content .article-act {
  text-align: center !important;
  margin: 10px 0 30px;
  position: relative;
  display: block;
  background: #fff !important;
  text-decoration: none !important;
}

#single-content .article-act .article-collect,
#single-content .article-act .article-zan {
  -webkit-appearance: none;
  appearance: none;
  display: inline-block;
  color: #bbb !important;
  width: 60px;
  height: 60px;
  padding: 0;
  line-height: 53px;
  margin: 0 5px;
  border-radius: 50%;
  border: 2px solid hsla(210, 8%, 51%, 0.09);
  position: relative;
  text-align: center;
  background: transparent !important;
  text-decoration: none !important;
  cursor: pointer;
  outline: none;
}

#single-content .article-act .article-collect .icon,
#single-content .article-act .article-zan .icon {
  top: -6px;
  font-size: 26px;
}

#single-content .article-act .article-zan.active,
#single-content .article-act .article-zan.is-liked {
  color: var(--theme-color) !important;
}

#single-content .article-act .article-collect.active,
#single-content .article-act .article-collect.is-favorited {
  color: #fbb715 !important;
}

#single-content .article-act .article-collect.active .icon:before,
#single-content .article-act .article-collect.is-favorited .icon:before {
  content: "\e8d3";
}

#single-content .article-act a span {
  font-family: tahoma, arial, sans-serif;
  position: absolute;
  bottom: -12px;
  left: 0;
  right: 0;
  font-size: 12px;
  text-decoration: none !important;
}

.comments-wrap {
  margin-top: 18px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 16px;
  overflow: visible;
}

.comments-wrap .commentform .comt-box {
  background: #fff;
  border: none;
  border-radius: 12px;
  padding: 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.comments-wrap .reply-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: #666;
}

.comments-wrap .reply-hint a {
  margin-left: 8px;
  color: var(--theme-color);
  text-decoration: none;
}

.comments-wrap .reply-hint a:hover {
  text-decoration: underline;
}

.comments-wrap .commentform .comt-main {
  width: 100%;
}

.comments-wrap .comt-textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fafafa;
  outline: none;
}

.comments-wrap .comt-textarea:focus,
.comments-wrap .commentform .input-control:focus {
  border-color: var(--theme-color);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 95, 51, 0.12);
}

.comments-wrap .comt-captcha {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.comments-wrap .captcha-input {
  width: 160px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
  background: #fafafa;
}

.comments-wrap .captcha-img {
  width: 110px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.comments-wrap .captcha-refresh {
  font-size: 13px;
  color: var(--theme-color);
  text-decoration: none;
  white-space: nowrap;
}

.comments-wrap .captcha-refresh:hover {
  text-decoration: underline;
}

.comments-wrap .captcha-refresh.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.comments-wrap .comments-title {
  margin-top: 0;
}

.comments-wrap .comment-signarea {
  background: #fff;
  border: 1px dashed rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
  color: #666;
}

.comments-wrap .comment-signarea a {
  color: var(--theme-color);
  text-decoration: none;
}

.comments-wrap .comment-signarea a:hover {
  text-decoration: underline;
}

.comments-wrap .postcomments {
  overflow: visible;
  padding-top: 4px;
}

.comments-wrap .postcomments .commentlist {
  overflow: visible;
}

.comments-wrap .postcomments .commentlist .comment {
  overflow: visible;
  box-sizing: border-box;
}

.comments-wrap .postcomments .commentlist .comment.comment-empty {
  padding-left: 0 !important;
}

.comments-wrap .postcomments .commentlist .comment.comment-empty .comt-main {
  padding: 0 !important;
  text-align: center;
}

.comments-wrap .comment.comment-reply .comt-main {
  border-left: 3px solid rgba(0, 0, 0, 0.08);
  padding-left: 12px;
}

.comments-wrap .comment.comment-reply {
  margin-top: 4px;
}

.comments-wrap .comment-replyto {
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
}

.comments-wrap .comment-replyto .replyto-name {
  color: var(--theme-color);
  font-weight: 600;
}

.comments-wrap .comt-pending {
  margin-left: 8px;
  font-size: 12px;
  color: #ff7a4f;
  border: 1px solid rgba(255, 122, 79, 0.35);
  padding: 2px 6px;
  border-radius: 10px;
  line-height: 1;
}

.comments-wrap .comment-reply-login {
  margin-left: 10px;
  color: var(--theme-color);
  text-decoration: none;
  font-size: 12px;
}

.comments-wrap .comment-reply-login:hover {
  text-decoration: underline;
}

.comments-wrap .commentform .btn {
  border-radius: 10px;
  padding: 10px 16px;
  line-height: 1;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  user-select: none;
  transition: transform 0.08s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.comments-wrap .commentform .btn:active {
  transform: translateY(1px);
}

.comments-wrap .commentform .btn-primary {
  color: #fff !important;
  background: #ff7a4f !important;
  margin-top: 10px;
  border-radius: 5px;
  height: 35px;
}

.comments-wrap .commentform .btn-primary:hover {
  box-shadow: 0 12px 28px rgba(255, 95, 51, 0.32);
}

.comments-wrap .commentform .btn-primary:disabled {
  opacity: 0.65;
  box-shadow: none;
  cursor: not-allowed;
}

.user-main {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
}

.user-meta {
  list-style: none;
  margin: 0;
  padding: 0;
}

.user-meta li {
  margin-bottom: 12px;
}

.user-meta label {
  display: block;
  margin-bottom: 6px;
  color: #555;
}

.user-meta .form-control {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 10px 12px;
}

.avatar-tip {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.4;
}

.avatar-tip.success {
  color: #2a7;
}

.avatar-tip.error {
  color: #c00;
}

.captcha-sms-clk {
  color: var(--theme-color);
  text-decoration: none;
}

.captcha-sms-clk.disabled {
  pointer-events: none;
  opacity: 0.6;
}

.user-comments-list {
  padding: 10px 0;
}

.user-comment-item {
  padding: 14px 0;
  border-bottom: 1px solid #eee;
}

.user-comment-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.user-comment-time {
  color: #888;
  font-size: 13px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.user-comment-right {
  flex: 1 1 auto;
  min-width: 0;
}

.user-comment-title {
  color: #222;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 6px;
  white-space: pre-wrap;
  word-break: break-word;
}

.user-comment-post {
  color: #666;
  font-size: 13px;
  line-height: 1.6;
}

.user-comment-post-link {
  color: #222;
  text-decoration: none;
}

.user-comment-post-link:hover {
  color: var(--theme-color);
  text-decoration: underline;
}

.pagination-wrap {
  margin-top: 24px;
  text-align: center;
}

.user-main .pagination {
  list-style: none;
  display: inline-flex;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.user-main .pagination a,
.user-main .pagination span {
  padding: 6px 12px;
  display: inline-block;
}

.user-main .pagination li.active span,
.user-main .pagination li.active a {
  font-weight: bold;
}

.user-fav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.user-fav-item {
  width: calc(33.3333% - 8px);
  margin: 0 4px 16px;
  background: #fff;
  border: none;
  border-radius: 8px;
  overflow: hidden;
  padding: 8px;
  box-sizing: border-box;
}

.user-fav-cover {
  display: block;
  width: 100%;
  height: 120px;
  overflow: hidden;
  background: #f6f6f6;
  border-radius: 8px;
}

.user-fav-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.user-fav-body {
  padding: 10px 0 0 0;
}

.user-fav-item .user-fav-title {
  display: block;
  font-weight: 400;
  color: #222;
  text-decoration: none;
  font-size: 15px;
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
}

.user-fav-item .user-fav-title:hover {
  color: var(--theme-color);
}

.user-fav-meta {
  margin: 0;
  color: #bbb;
  font-size: 12px;
}

.user-fav-cancel {
  display: inline-block;
  margin: 0;
  color: #bbb;
  font-size: 12px;
  text-decoration: none;
}

.user-fav-cancel:hover {
  color: #ff5f33;
  text-decoration: underline;
}

.promo-card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
}

.promo-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.promo-link-row {
  display: flex;
  gap: 10px;
}

.promo-link-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding: 8px 10px;
}

.btn-copy {
  white-space: nowrap;
  background: var(--theme-color);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
}

.promo-msg {
  margin-top: 10px;
  color: #2a7;
}

.promo-table-wrap {
  overflow-x: auto;
}

.promo-table {
  width: 100%;
  border-collapse: collapse;
}

.promo-table th,
.promo-table td {
  border-bottom: 1px solid #efefef;
  padding: 10px 8px;
  text-align: left;
  font-size: 13px;
}

@media (max-width: 768px) {
  .posts.grids .post.grid .img .thumb {
    height: 150px;
  }

  .user-fav-list {
    flex-direction: column;
  }

  .user-fav-item {
    width: 100% !important;
    margin: 0 0 12px !important;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* 移动端右上角头像入口（对齐 app/header 行为） */
.nav-mobile-user {
  display: none;
}

@media (max-width: 768px) {
  .nav-right .nav-login {
    display: none !important;
  }

  .nav-mobile-user {
    display: list-item !important;
    margin-right: 2px;
  }

  .nav-right .nav-button {
    display: list-item !important;
  }

  .nav-mobile-avatar-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0 !important;
    margin: 15px 2px 15px 6px;
    border: none !important;
    border-radius: 50%;
    background: transparent;
    vertical-align: middle;
  }

  .nav-mobile-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #f5f5f5;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  }

  .nav-mobile-default-avatar {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f5f5f5;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
  }

  .nav-mobile-default-avatar .icon {
    font-size: 17px;
    color: #8b919a;
    top: 0;
  }

  .nav-mobile-user.is-guest .nav-mobile-default-avatar {
    border-color: rgba(255, 95, 51, 0.22);
    background: rgba(255, 95, 51, 0.08);
  }

  .nav-mobile-user.is-guest .nav-mobile-default-avatar .icon {
    color: var(--theme-color);
  }

  .nav-mobile-user.is-auth .nav-mobile-avatar-img {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  }

  body.night .nav-mobile-avatar-img {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
  }

  body.night .nav-mobile-default-avatar {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
  }

  body.night .nav-mobile-default-avatar .icon {
    color: #a8aeb8;
  }
}

