/* ===== 全局 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  background: #f5f6f8;
  color: #333;
  line-height: 1.6;
}

/* ===== 顶部导航（强制覆盖） ===== */
body.hp-search .header {
  background: #fff !important;
  border-bottom: 1px solid #eee !important;
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.04) !important;
  padding: 0 !important;
}
body.hp-search .header-inner {
  max-width: 900px !important;
  margin: 0 auto !important;
  padding: 14px 20px !important;
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  height: auto !important;
  line-height: normal !important;
  flex-wrap: wrap !important;
}
body.hp-search .header .logo {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #2b6cff !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  float: none !important;
  flex-shrink: 0 !important;
}
body.hp-search .search-form {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  min-width: 0 !important;
  max-width: 100% !important;
  gap: 8px !important;
}
body.hp-search .search-box {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  background: #f1f3f6 !important;
  border: 1px solid #e4e7eb !important;
  border-radius: 22px !important;
  padding: 8px 16px !important;
  transition: border-color .2s, box-shadow .2s !important;
  min-width: 0 !important;
  overflow: hidden !important;
}
body.hp-search .search-box:focus-within {
  border-color: #2b6cff !important;
  box-shadow: 0 0 0 3px rgba(43,108,255,.12) !important;
}
body.hp-search .search-box .icon-search {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0 !important;
  color: #9aa4b0 !important;
}
body.hp-search .search-box input {
  flex: 1 !important;
  border: none !important;
  outline: none !important;
  background: transparent !important;
  padding: 6px 10px !important;
  font-size: 16px !important;
  color: #333 !important;
  min-width: 0 !important;
  width: 100% !important;
}
body.hp-search .search-box input::placeholder { color: #b0b8c1 !important; }
body.hp-search .search-btn {
  background: #2b6cff !important;
  color: #fff !important;
  border: none !important;
  border-radius: 22px !important;
  padding: 10px 20px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  transition: background .15s !important;
  flex-shrink: 0 !important;
  min-width: auto !important;
}

/* ===== 手机端搜索框自适应（关键修复） ===== */
@media (max-width: 600px) {
  body.hp-search .header-inner {
    padding: 10px 12px !important;
    gap: 8px !important;
  }
  body.hp-search .header .logo {
    font-size: 14px !important;
    width: auto !important;
  }
  body.hp-search .search-form {
    width: 100% !important;
    flex: 1 1 100% !important;
    order: 3 !important;
    margin-top: 0 !important;
  }
  body.hp-search .search-box {
    padding: 8px 12px !important;
    border-radius: 20px !important;
  }
  body.hp-search .search-box input {
    font-size: 14px !important;
    padding: 5px 8px !important;
  }
  body.hp-search .search-btn {
    padding: 8px 14px !important;
    font-size: 14px !important;
    border-radius: 20px !important;
  }
  body.hp-search .header-inner {
    align-items: flex-start !important;
  }
}

@media (max-width: 400px) {
  body.hp-search .header-inner {
    padding: 8px 10px !important;
    gap: 6px !important;
  }
  body.hp-search .search-box {
    padding: 6px 10px !important;
  }
  body.hp-search .search-btn {
    padding: 7px 12px !important;
    font-size: 13px !important;
  }
  body.hp-search .search-box input {
    font-size: 13px !important;
  }
}

/* ===== 顶部提示模块 ===== */
.notice {
  max-width: 900px;
  margin: 16px auto 0;
  padding: 12px 18px;
  background: #fff8e6;
  border: 1px solid #ffe08a;
  border-left: 4px solid #f0a500;
  border-radius: 8px;
  font-size: 15px;
  color: #d32f2f;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.notice .notice-icon {
  flex-shrink: 0;
  width: 16px; height: 16px;
  margin-top: 2px;
  color: #f0a500;
}

/* ===== 主体列表 ===== */
.hp-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}
.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #444;
  margin-bottom: 14px;
  padding-left: 10px;
  border-left: 4px solid #2b6cff;
}
.post-list { display: flex; flex-direction: column; gap: 14px; }

.post-item {
  display: flex;
  gap: 16px;
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  transition: transform .15s, box-shadow .15s;
}
.post-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.09);
}
.post-body { flex: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.post-title {
  font-size: 17px;
  font-weight: 600;
  color: #222;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: #9aa4b0;
  flex-wrap: wrap;
}
.post-meta span { display: inline-flex; align-items: center; gap: 4px; }
.post-meta svg { width: 13px; height: 13px; }

/* ===== 底部分页 + footer ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 30px 0 10px;
  flex-wrap: wrap;
}
.pagination a {
  min-width: 34px;
  padding: 6px 12px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #e4e7eb;
  color: #555;
  text-decoration: none;
  font-size: 15px;
  text-align: center;
  transition: all .15s;
}
.pagination a:hover,
.pagination a.active {
  background: #2b6cff;
  border-color: #2b6cff;
  color: #fff;
}
.footer {
  text-align: center;
  font-size: 14px;
  color: #b0b8c1;
  padding: 24px 20px 10px;
}
.footer a { color: #9aa4b0; text-decoration: none; }
.footer a:hover { color: #2b6cff; }

/* ===== 文章正文链接高亮 ===== */
.article-body a { color: #2b6cff; text-decoration: none; transition: color .15s, opacity .15s; }
.article-body a:hover { color: #1a4fcf; opacity: .8; text-decoration: underline; }
.post-title { transition: color .15s; }
.post-title:hover { color: #2b6cff; }

/* ===== 后台登录入口 ===== */
.admin-entry {
  text-align: center;
  padding: 0 20px 32px;
}
.admin-btn {
  display: inline-block;
  padding: 10px 30px;
  background: #2b6cff;
  color: #fff;
  border-radius: 24px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: background .15s, transform .15s;
}
.admin-btn:hover {
  background: #1f57d6;
  transform: translateY(-1px);
}

/* ===== 弹窗样式 ===== */
.popup-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.popup-box {
  background: #fff;
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  animation: popupIn 0.3s ease;
}
@keyframes popupIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}
.popup-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}
.popup-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #999;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .15s, color .15s;
}
.popup-close:hover {
  color: #333;
  background: #f5f5f5;
}
.popup-content {
  padding: 20px;
  color: #555;
  font-size: 15px;
  line-height: 1.6;
}
.popup-action {
  padding: 0 20px 20px;
  text-align: center;
}
.popup-btn {
  display: inline-block;
  padding: 12px 40px;
  background: #2b6cff;
  color: #fff;
  border-radius: 24px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: background .15s, transform .15s;
}
.popup-btn:hover {
  background: #1f57d6;
  transform: translateY(-1px);
}
@media (max-width: 480px) {
  .popup-box { max-width: 90%; }
  .popup-title { font-size: 16px; }
  .popup-btn { padding: 10px 30px; font-size: 15px; }
}

/* ===== 文章详情页样式 ===== */
.article-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 10px;
}
.article-detail .page {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}
.article-detail .page-box {
  padding: 30px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.article-detail .page-header {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}
.article-detail .title {
  font-size: 26px;
  font-weight: 700;
  color: #222;
  line-height: 1.4;
  margin-bottom: 15px;
  word-wrap: break-word;
}
.article-detail .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  font-size: 14px;
  color: #9aa4b0;
}
.article-detail .meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.article-detail .meta a {
  color: #2b6cff;
  text-decoration: none;
  white-space: nowrap;
}
.article-detail .page-content {
  font-size: 16px;
  line-height: 1.8;
  color: #333;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.article-detail .page-content a {
  color: #2b6cff;
  text-decoration: none;
  word-break: break-all;
}
.article-detail .page-content a:hover {
  text-decoration: underline;
}
.article-detail .page-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 10px 0;
}
.article-detail .page-copyright {
  margin-top: 25px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  font-size: 13px;
  color: #888;
  word-wrap: break-word;
}
.article-detail .page-tags {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.article-detail .page-tags a {
  display: inline-block;
  padding: 4px 12px;
  background: #f0f2f5;
  color: #666;
  border-radius: 16px;
  font-size: 13px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.article-detail .page-tags a:hover {
  background: #2b6cff;
  color: #fff;
}
.article-detail .upper-lower {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.article-detail .upper-lower a {
  color: #2b6cff;
  text-decoration: none;
  font-size: 14px;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.article-detail .upper-lower a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .article-detail .page-box { padding: 20px 16px; }
  .article-detail .title { font-size: 22px; }
  .article-detail .meta { font-size: 13px; gap: 10px; }
  .article-detail .page-content { font-size: 15px; }
  .post-title { font-size: 16px; }
  .post-meta { font-size: 13px; gap: 10px; }
  .hp-main { padding: 16px 14px 32px; }
  .notice { font-size: 14px; padding: 10px 14px; margin: 12px 14px 0; }
}
