/* USD Fan Theme Styles */

/* 重置和基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

a {
  color: #10b981;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #059669;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 顶部导航 */
.site-header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-left {
  flex-shrink: 0;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: #10b981;
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: #10b981;
}

.header-center {
  flex: 1;
  max-width: 500px;
}

.search-form {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #9ca3af;
}

.search-input {
  width: 100%;
  padding: 8px 12px 8px 40px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  background: #f9fafb;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: #10b981;
  background: white;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-nav {
  display: flex;
}

.header-menu {
  display: flex;
  list-style: none;
  gap: 16px;
  margin: 0;
}

.header-menu li {
  margin: 0;
}

.header-menu a {
  color: #6b7280;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}

.header-menu a:hover {
  color: #10b981;
  background: #f0fdf4;
}

.header-link {
  color: #6b7280;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}

.header-link:hover {
  color: #10b981;
  background: #f0fdf4;
}

.header-link-primary {
  background: #10b981;
  color: white;
}

.header-link-primary:hover {
  background: #059669;
  color: white;
}

/* 主容器 */
.site-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.content-wrapper {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  position: relative;
}

/* 主内容区 */
.main-content {
  flex: 1;
  min-width: 0;
  margin-left: 240px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
}

/* 内容操作区 */
.content-actions {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.login-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  margin-bottom: 16px;
  color: #6b7280;
}

.user-icon {
  width: 32px;
  height: 32px;
  color: #10b981;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #374151;
  transition: all 0.2s;
}

.action-btn:hover {
  border-color: #10b981;
  background: #f0fdf4;
  color: #10b981;
}

.action-btn svg {
  width: 24px;
  height: 24px;
}

.action-btn-post svg {
  color: #8b5cf6;
}

.action-btn-article svg {
  color: #3b82f6;
}

.action-btn-question svg {
  color: #ef4444;
}

.action-btn-collab svg {
  color: #10b981;
}

/* 左侧边栏 */
.left-sidebar {
  position: fixed;
  left: 0;
  top: 64px;
  width: 240px;
  height: calc(100vh - 64px);
  background: #e8f5f0;
  padding: 16px 8px;
  overflow-y: auto;
  z-index: 50;
}

/* 添加滚动条样式 */
.left-sidebar::-webkit-scrollbar {
  width: 6px;
}

.left-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.left-sidebar::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.3);
  border-radius: 3px;
}

.left-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.5);
}

.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-menu li {
  margin: 0;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  /* 调整内边距和字体大小 */
  padding: 14px 16px;
  color: #1f2937;
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s;
}

/* 优化悬停和选中状态样式 */
.sidebar-menu a:hover {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.sidebar-menu .current-menu-item a,
.sidebar-menu .current_page_item a {
  background: #10b981;
  color: white;
  font-weight: 600;
}

/* 添加图标样式 */
.sidebar-menu a::before {
  content: "";
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* 为不同菜单项添加图标 */
.sidebar-menu li:nth-child(1) a::before {
  content: "🏠";
  background: none;
  font-size: 18px;
}

.sidebar-menu li:nth-child(2) a::before {
  content: "🔥";
  background: none;
  font-size: 18px;
}

.sidebar-menu li:nth-child(3) a::before {
  content: "👍";
  background: none;
  font-size: 18px;
}

.sidebar-menu li:nth-child(4) a::before {
  content: "❓";
  background: none;
  font-size: 18px;
}

.sidebar-menu li:nth-child(5) a::before {
  content: "👤";
  background: none;
  font-size: 18px;
}

.sidebar-menu li:nth-child(6) a::before {
  content: "🔊";
  background: none;
  font-size: 18px;
}

.sidebar-menu li:nth-child(7) a::before {
  content: "💰";
  background: none;
  font-size: 18px;
}

/* 右侧边栏 */
.right-sidebar {
  position: sticky;
  top: 88px;
  width: 300px;
  flex-shrink: 0;
  align-self: flex-start;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
}

/* 添加右侧边栏滚动条样式 */
.right-sidebar::-webkit-scrollbar {
  width: 6px;
}

.right-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.right-sidebar::-webkit-scrollbar-thumb {
  background: rgba(16, 185, 129, 0.2);
  border-radius: 3px;
}

.right-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.4);
}

.widget {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.widget-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #111827;
}

.widget-ad {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  text-align: center;
}

.widget-ad h3 {
  font-size: 20px;
  color: #92400e;
  margin-bottom: 16px;
  line-height: 1.4;
}

.btn-register {
  display: inline-block;
  padding: 10px 32px;
  background: #10b981;
  color: white;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 12px;
}

.btn-register:hover {
  background: #059669;
  color: white;
}

.ad-footer {
  font-size: 13px;
  color: #92400e;
}

/* 分页 */
.pagination {
  padding: 20px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.pagination a,
.pagination span {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: #374151;
  transition: all 0.2s;
}

.pagination a:hover,
.pagination .current {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

/* 单篇文章页面 */
.single-article {
  padding: 40px;
}

.single-header {
  margin-bottom: 32px;
}

.single-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  margin: 16px 0;
  color: #111827;
}

.single-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.single-meta .author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.single-meta img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.single-content {
  font-size: 16px;
  line-height: 1.8;
  color: #374151;
}

.single-content img {
  margin: 24px 0;
  border-radius: 8px;
}

.single-content h2 {
  font-size: 24px;
  margin: 32px 0 16px;
  color: #111827;
}

.single-content h3 {
  font-size: 20px;
  margin: 24px 0 12px;
  color: #111827;
}

.single-content p {
  margin-bottom: 16px;
}

.single-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tags a {
  padding: 4px 12px;
  background: #f3f4f6;
  border-radius: 6px;
  font-size: 13px;
  color: #6b7280;
}

.post-tags a:hover {
  background: #d1fae5;
  color: #10b981;
}

/* 文章列表 */
.article-list {
  padding: 0;
}

.article-card {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  transition: background 0.2s;
}

.article-card:hover {
  background: #f9fafb;
}

.article-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.article-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-author img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-weight: 600;
  color: #111827;
  font-size: 14px;
}

.article-meta {
  font-size: 13px;
  color: #9ca3af;
}

.article-badges {
  display: flex;
  gap: 6px;
}

.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.badge-yellow {
  background: #fef3c7;
  color: #92400e;
}

.badge-blue {
  background: #dbeafe;
  color: #1e40af;
}

.badge-purple {
  background: #ede9fe;
  color: #5b21b6;
}

.badge-green {
  background: #d1fae5;
  color: #065f46;
}

.article-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}

.article-title a {
  color: #111827;
}

.article-title a:hover {
  color: #10b981;
}

.article-excerpt {
  color: #6b7280;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
}

/* 单图样式 - 图片在下方 */
.article-image-single {
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
}

.article-image-single img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
}

/* 多图样式 */
.article-images-multi {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.multi-image-item {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.multi-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 文章底部 */
.article-footer {
  margin-top: 12px;
}

.article-stats {
  display: flex;
  gap: 16px;
}

.stat-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  color: #9ca3af;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.stat-btn:hover {
  background: #f3f4f6;
  color: #10b981;
}

.stat-btn svg {
  width: 16px;
  height: 16px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .left-sidebar {
    width: 200px;
  }

  .right-sidebar {
    width: 280px;
  }
}

@media (max-width: 992px) {
  .left-sidebar {
    display: none;
  }

  .content-wrapper {
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .right-sidebar {
    display: none;
  }

  .action-buttons {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-container {
    flex-wrap: wrap;
  }

  .header-center {
    order: 3;
    flex-basis: 100%;
    max-width: 100%;
  }
}

/* 购买记录页面样式 */
.purchases-page {
  padding: 40px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  color: #111827;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-state svg {
  margin: 0 auto 20px;
}

.empty-state p {
  color: #9ca3af;
  font-size: 16px;
}

.purchases-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.purchase-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  transition: all 0.2s;
}

.purchase-item:hover {
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.purchase-info {
  flex: 1;
}

.purchase-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.purchase-title a {
  color: #111827;
}

.purchase-title a:hover {
  color: #10b981;
}

.purchase-meta {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: #6b7280;
}

.purchase-amount {
  color: #10b981;
  font-weight: 600;
}

.purchase-actions {
  flex-shrink: 0;
}

.btn-view {
  display: inline-block;
  padding: 10px 24px;
  background: #10b981;
  color: white;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s;
}

.btn-view:hover {
  background: #059669;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

@media (max-width: 768px) {
  .purchase-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .purchase-meta {
    flex-direction: column;
    gap: 8px;
  }

  .purchase-actions {
    width: 100%;
  }

  .btn-view {
    width: 100%;
    text-align: center;
  }
}

/* 付费内容保护样式 */
.paid-content-preview {
  position: relative;
}

.preview-text {
  color: #6b7280;
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 32px;
  position: relative;
}

.preview-text::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to bottom, transparent, white);
}

.payment-wall {
  background: linear-gradient(135deg, #f0fdf4 0%, #d1fae5 100%);
  border: 2px solid #10b981;
  border-radius: 16px;
  padding: 48px 32px;
  text-align: center;
  margin-top: 32px;
}

.payment-wall-icon {
  margin-bottom: 24px;
}

.payment-wall h3 {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 12px;
}

.payment-wall p {
  color: #6b7280;
  font-size: 16px;
  margin-bottom: 24px;
}

.payment-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 32px;
}

.price-symbol {
  font-size: 24px;
  color: #10b981;
  font-weight: 600;
}

.price-amount {
  font-size: 48px;
  font-weight: 700;
  color: #10b981;
}

.payment-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.payment-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.payment-btn-wechat {
  background: #07c160;
  color: white;
}

.payment-btn-wechat:hover {
  background: #06ad56;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
}

.payment-btn-alipay {
  background: #1677ff;
  color: white;
}

.payment-btn-alipay:hover {
  background: #0958d9;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.3);
}

.payment-login-prompt {
  margin-top: 24px;
}

.payment-login-prompt p {
  color: #6b7280;
  font-size: 14px;
}

.payment-login-prompt a {
  color: #10b981;
  font-weight: 600;
}

/* 支付弹窗样式 */
.payment-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
}

.payment-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.payment-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.payment-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 32px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s;
}

.payment-modal-close:hover {
  background: #f3f4f6;
  color: #374151;
}

.payment-modal-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  color: #111827;
}

.payment-qrcode {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  background: #f9fafb;
  border-radius: 12px;
  margin-bottom: 16px;
}

.payment-qrcode img {
  max-width: 260px;
  width: 100%;
}

.payment-modal-tip {
  text-align: center;
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 16px;
}

.payment-modal-status {
  text-align: center;
}

.payment-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #10b981;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.payment-success {
  color: #10b981;
  font-weight: 600;
}

.payment-error {
  color: #ef4444;
  font-weight: 600;
}
