/* =========================================
   site.css — 全局基础样式
   * 作用范围：全站通用
   * 页面/模块样式请在 pageCSS 中引入单独文件
   ========================================= */

/* ---------- 0) 字体与基础 ---------- */

/* 自定义字体（Fusion Pixel） */
@font-face {
  font-family: 'Fusion Pixel';
  src: url('/assets/Fonts/fusion-pixel-12px-monospaced-zh_hans.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Fusion Pixel', Arial, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.6;
  background: #fff;
  color: #000;
}

/* 全局排版 */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Fusion Pixel', sans-serif;
  margin: 1.2em 0 0.6em;
  line-height: 1.3;
}
h1 { font-size: 40px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }

p {
  margin: 16px 0;
  line-height: 1.8;
}

/* 全局图片自适应 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== 回到顶部按钮样式 ===== */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #000;
  color: #fff;
  font-size: 22px;
  line-height: 44px;
  text-align: center;
  font-family: 'Fusion Pixel', Arial, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
  cursor: pointer;
  z-index: 999;
}
.back-to-top:hover { opacity: .9; }
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }

.back-to-top svg {
  width: 17px;
  height: 10px;
  fill: currentColor;
}

/* 页面容器（正文宽度由各页面单独设定） */
main.page-wrap {
  max-width: 1400px;
  width: 80%; /* 左右各留10%边距 */
  margin: 24px auto;
  padding: 0 16px;
}

/* 响应式设计：在小屏幕上调整边距 */
@media (max-width: 768px) {
  main.page-wrap {
    width: 90%; /* 移动设备上减少边距到5% */
  }
}

@media (max-width: 480px) {
  main.page-wrap {
    width: 95%; /* 小屏幕设备上进一步减少边距 */
  }
}

/* ===== 页脚样式 ===== */
.footer {
  margin: 40px auto 24px;
  padding: 0 16px;
  max-width: 1400px;
  width: 80%; /* 左右各留10%边距 */
}

/* 响应式设计：在小屏幕上调整边距 */
@media (max-width: 768px) {
  .footer {
    width: 90%; /* 移动设备上减少边距到5% */
  }
}

@media (max-width: 480px) {
  .footer {
    width: 95%; /* 小屏幕设备上进一步减少边距 */
  }
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  font-size: 14px;
}

.footer-welcome {
  color: #666;
  font-family: 'Fusion Pixel', sans-serif;
  font-size: 14px;
}

.footer-beian {
  color: #666;
  font-family: 'Fusion Pixel', sans-serif;
  font-size: 14px;
}

.beian-link {
  color: #666;
  text-decoration: underline;
  text-decoration-style: solid;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.beian-link:hover {
  color: #333;
}

.footer-copyright {
  color: #666;
  font-family: 'Fusion Pixel', sans-serif;
  position: relative;
  cursor: pointer;
}

.copyright-text {
  text-decoration: underline;
  text-decoration-style: solid;
  text-underline-offset: 2px;
}

/* 版权声明独立弹窗样式 */
.copyright-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(.98);
  opacity: 0;
  visibility: hidden;
  transition: transform .2s ease, opacity .2s ease;
  z-index: 1000;
}

.copyright-popup::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
}

.copyright-popup-content {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  padding: 16px;
  max-width: 400px;
  min-width: 300px;
}

.copyright-popup-content p {
  margin: 0 0 12px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #333;
}

.copyright-popup-content p:last-child {
  margin-bottom: 0;
}

.copyright-popup-content a {
  color: #4fc3f7;
  text-decoration: underline;
  word-break: break-all;
  pointer-events: auto;
  cursor: pointer;
}

.copyright-popup-content a:hover {
  color: #81d4fa;
}

.copyright-link.active .copyright-popup {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

.footer-social {
  display: flex;
  gap: 12px;
  align-items: center;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #666;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.social-link:hover {
  color: #000;
  background-color: #f5f5f5;
}

.social-link svg {
  fill: currentColor;
}

/* 微信浮窗样式 */
.wechat-link {
  position: relative;
}

.wechat-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(.98);
  opacity: 0;
  visibility: hidden;
  transition: transform .2s ease, opacity .2s ease;
  z-index: 1000;
  pointer-events: none;
}

.wechat-link:hover .wechat-tooltip,
.wechat-link:focus-within .wechat-tooltip,
.wechat-link.active .wechat-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) scale(1);
}

.wechat-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
}

.tooltip-content {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  padding: 10px;
  width: 180px;
}

.wechat-qr {
  display: block;
  width: 160px;
  height: 160px;
  object-fit: cover;
  background: #fff;
  border-radius: 6px;
}

.footer-subscribe {
  display: flex;
  gap: 8px;
  align-items: center;
}

.email-input {
  padding: 4px 0;
  border: none;
  border-bottom: 1px solid #ddd;
  font-family: 'Fusion Pixel', sans-serif;
  font-size: 14px;
  background: transparent;
  width: 120px;
}

.email-input:focus {
  outline: none;
  border-bottom-color: #000;
}

.subscribe-btn {
  padding: 0;
  border: none;
  background: transparent;
  color: #000;
  font-family: 'Fusion Pixel', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.subscribe-btn:hover {
  color: #666;
}

.footer-contact {
  display: flex;
  gap: 12px;
  align-items: center;
}

.contact-btn,
.message-btn {
  padding: 0;
  border: none;
  background: transparent;
  color: #666;
  font-family: 'Fusion Pixel', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.contact-btn:hover,
.message-btn:hover {
  color: #000;
}

.footer-like {
  display: flex;
  align-items: center;
}

.like-btn {
  background: transparent;
  border: none;
  color: #666;
  font-family: 'Fusion Pixel', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.like-btn:hover {
  color: #333;
}

.like-btn.clicked {
  color: #e91e63;
  text-decoration: none;
}

/* 联系表单弹窗样式 */
.contact-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.contact-modal.active {
  opacity: 1;
  visibility: visible;
}

.contact-modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.contact-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.contact-modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: #333;
}

.contact-form {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4fc3f7;
  box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.checkbox-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: normal;
  margin-bottom: 0;
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
}

.checkbox-text {
  font-size: 14px;
  color: #333;
  line-height: 1;
  vertical-align: middle;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.cancel-btn,
.send-btn {
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Fusion Pixel', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cancel-btn {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.cancel-btn:hover {
  background: #e5e7eb;
}

.send-btn {
  background: #4fc3f7;
  color: white;
  border: 1px solid #4fc3f7;
}

.send-btn:hover {
  background: #29b6f6;
  border-color: #29b6f6;
}

.send-btn:disabled {
  background: #9ca3af;
  border-color: #9ca3af;
  cursor: not-allowed;
}

/* 消息弹窗样式 */
.message-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.message-modal.active {
  opacity: 1;
  visibility: visible;
}

.message-modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  padding: 30px;
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.message-text {
  font-size: 16px;
  color: #333;
  margin-bottom: 25px;
  line-height: 1.5;
}

.message-close-btn {
  background: #4fc3f7;
  color: white;
  border: none;
  padding: 12px 30px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Fusion Pixel', sans-serif;
  cursor: pointer;
  transition: background 0.2s ease;
}

.message-close-btn:hover {
  background: #29b6f6;
}

/* 联系表单响应式设计 */
@media (max-width: 768px) {
  .contact-modal-content {
    width: 95%;
    margin: 20px;
  }
  
  .contact-modal-header,
  .contact-form {
    padding: 16px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .cancel-btn,
  .send-btn {
    width: 100%;
  }
  
  .checkbox-group {
    flex-direction: column;
    gap: 12px;
  }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  .footer-welcome {
    order: -1;
  }
  
  .footer-subscribe {
    flex-direction: column;
    gap: 8px;
  }
  
  .email-input {
    min-width: 200px;
    text-align: center;
  }
  
  .copyright-popup-content {
    max-width: 280px;
    min-width: 250px;
    font-size: 12px;
    padding: 12px;
  }
  
  .copyright-popup {
    left: 0;
    transform: translateX(0) scale(.98);
  }
  
  .copyright-link.active .copyright-popup {
    transform: translateX(0) scale(1);
    pointer-events: auto;
  }
}

/* ---------- 1) 顶部导航（Navbar） ---------- */

:root {
  --nav-h: 80px;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  width: 100%;

  /* 背景图：居中，自适应铺满 */
  background-image: url('/assets/Pics/navbar.svg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;

  backdrop-filter: saturate(1.05);
}

/* ===== 二级导航栏样式 ===== */
.secondary-nav {
  position: absolute;
  top: 100px;
  right: 20px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 2px 12px;
  transition: all 0.3s ease;
  width: fit-content;
}

.secondary-nav:hover {
  background: rgba(255, 255, 255, 0.95);
}

.secondary-nav-container {
  display: flex;
  gap: 16px;
  align-items: center;
}

.secondary-nav-link {
  font-family: 'Fusion Pixel', monospace;
  font-size: 14px;
  color: #666;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.secondary-nav-link:hover {
  color: #000;
}

.secondary-nav-link.active {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 600;
}

/* 二级导航栏响应式设计 */
@media (max-width: 768px) {
  .secondary-nav {
    right: 15px;
    padding: 6px 10px;
  }
  
  .secondary-nav-container {
    gap: 12px;
  }
  
  .secondary-nav-link {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .secondary-nav {
    right: 10px;
    padding: 5px 8px;
  }
  
  .secondary-nav-container {
    gap: 8px;
  }
  
  .secondary-nav-link {
    font-size: 12px;
  }
}

/* 头像 Logo */
#navlogo {
  display: block;
  margin-left: 20px;
  width: 65px;
  height: 65px;
  flex-shrink: 0;
  border-radius: 50%;
  background: url('/assets/Pics/Ellipse 1.png') lightgray 50% / cover no-repeat;
}
#navlogo img {
  display: none; /* 隐藏原始 <img> */
}

/* 导航链接 */
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0 40px 0 0;
  display: flex;
  gap: 28px;
  align-items: center;
}
.navlink {
  color: #000;
  text-align: center;
  font-family: 'Fusion Pixel', sans-serif;
  font-size: 32px;
  font-weight: 400;
  text-decoration: none;
}
.navlink:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* 当前栏目高亮 */
body[data-section="zhi"] .navlink[href="/zhi/"],
body[data-section="xing"] .navlink[href="/xing/"],
body[data-section="he"]  .navlink[href="/he/"],
body[data-section="yi"]  .navlink[href="/yi/"] {
  text-decoration: underline;
  text-underline-offset: 6px;
}

/* 响应式 */
@media (max-width: 768px) {
  :root { --nav-h: 72px; }
  .nav-list { gap: 16px; padding-right: 20px; }
  .navlink { font-size: 24px; }
}

/* =========================================
   首页致谢按钮样式
   ========================================= */
.home-actions {
  margin: 32px 0;
  text-align: center;
}

.thanks-btn {
  display: inline-block;
  padding: 12px 24px;
  background: #000;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-family: 'Fusion Pixel', sans-serif;
  font-size: 16px;
  transition: all 0.2s ease;
}

.thanks-btn:hover {
  background: #333;
  transform: translateY(-1px);
}

/* =========================================
   文章点赞按钮样式
   ========================================= */
.article-like-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 48px 0 32px;
  padding: 0;
}

.article-like-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 67px;
  height: 67px;
  padding: 0;
  background: transparent;
  background-image: url('/assets/Icons/circle.svg');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Fusion Pixel', sans-serif;
  position: relative;
}

.article-like-btn:hover {
  background-image: url('/assets/Icons/circle-selected.svg');
  transform: scale(1.05);
}

.article-like-btn:hover svg {
  color: #fff;
}

.article-like-btn:active {
  transform: scale(0.95);
}

.article-like-btn svg {
  width: 24px;
  height: 24px;
  color: #000;
  transition: color 0.3s ease;
  flex-shrink: 0;
}

.article-like-btn .like-count {
  position: absolute;
  bottom: -20px;
  font-size: 12px;
  color: #666;
  font-family: 'Fusion Pixel', sans-serif;
  white-space: nowrap;
}

.article-like-btn.liked {
  background-image: url('/assets/Icons/circle-selected.svg');
}

.article-like-btn.liked svg {
  color: #fff;
}

.article-like-btn.liked .like-count {
  color: #000;
}

.article-like-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.article-like-btn:disabled:hover {
  background-image: url('/assets/Icons/circle.svg');
  transform: none;
}

.article-like-btn:disabled:hover svg {
  color: #000;
}

/* 响应式 */
@media (max-width: 768px) {
  .article-like-container {
    margin: 32px 0 24px;
  }
  
  .article-like-btn {
    width: 56px;
    height: 56px;
    background-size: 56px 56px;
  }
  
  
  .article-like-btn svg {
    width: 20px;
    height: 20px;
  }
  
  .article-like-btn .like-count {
    font-size: 11px;
    bottom: -18px;
  }
}

/* =========================================
   提示：
   - 各分类页/详情页额外样式：
     /assets/Css/xing.css
     /assets/Css/project.css
   - site.css 只管全局
   ========================================= */