* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  line-height: 1.5;
  min-height: 100vh;
  padding: 20px;
}

.container {
  width: 100%;
  margin: 0 auto;
}

.content {
  width: 100%;
}

header {
  text-align: center;
  margin-bottom: 12px;
  padding: 20px;
}

.page-title {
  position: relative;
  font-size: 2.5rem;
  color: white;
  margin-bottom: 10px;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
/* 标题悬停提示：显示域名 jmk.xyz（无背景，紧贴标题） */
.page-title::after {
  content: "jmk.xyz";
  position: absolute;
  left: 50%;
  bottom: 100%;
  margin-bottom: 1px;
  transform: translateX(-50%);
  background: none;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 400;
  padding: 0;
  border-radius: 0;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.page-title:hover::after { opacity: 1; }

.page-subtitle {
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  margin-top: 8px;
  margin-bottom: 0;
  font-weight: normal;
}

/* ========== 公告图标（透明背景，悬浮在分类右上角） ========== */
#nav-container {
  position: relative;
}

.global-announce-icon {
  position: absolute;
  right: 8px;
  top: -38px;
  font-size: 1.4rem;
  cursor: pointer;
  opacity: 0.9;
  transition: all 0.2s;
  user-select: none;
  z-index: 10;
  /* 无背景，仅文字阴影增加可见度 */
  text-shadow: 0 0 6px rgba(255,255,255,0.5);
}

.global-announce-icon:hover {
  opacity: 1;
  transform: scale(1.15);
  text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

/* ========== 分类容器 ========== */
.categories-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  width: 100%;
  padding: 0;
}

.category-section {
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  width: 100%;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.category-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.category-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.category-title-main {
  font-size: inherit;
  font-weight: inherit;
}

.category-subtitle {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 400;
  white-space: nowrap;
}

/* ========== 栏目锁定 ========== */
.cat-lock {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 4px;
}
/* 锁定卡片：不加任何视觉效果，外观与普通卡片完全一致；
   仅保留“点击即提示解锁”的行为（由 JS 的 onclick 处理），鼠标移上去显示可点击指针。 */
.card-locked,
.card-locked:hover {
  cursor: pointer;
}
.lock-icon { font-size: 28px; line-height: 1; }
.lock-hint { font-size: 13px; color: #555; }
.lock-input { padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; outline: none; }
.lock-input:focus { border-color: #165DFF; }
.lock-btn { background: #165DFF; color: #fff; border: none; border-radius: 8px; padding: 8px 20px; font-size: 14px; cursor: pointer; }
.lock-btn:hover { opacity: 0.9; }
.lock-btn.gray { background: #e5e8f0; color: #333; }
.lock-msg { font-size: 12px; color: #e5484d; min-height: 16px; }
/* 解锁弹窗 */
.lock-modal-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 28px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  min-width: 260px;
}
.lock-actions { display: flex; gap: 10px; }

/* ========== 隐藏版块 ========== */
/* 卡片级密码锁标（右上角；用 🔐 与版块级锁 🔒 区分） */
.card-lock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 13px;
  line-height: 1;
  z-index: 3;
  pointer-events: none;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.6);
}
/* 页脚版权行：双击打开隐藏版块；双击时不选中文字 */
#copyright-line {
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}
/* 隐藏版块：始终占满整行。
   PC 两栏时宽度自动 = 两个版块 + 版块间距（即 100%），独占一行；
   内部网格沿用 .site-grid 的同一套规则，卡片列数与列位自动适配，保持垂直对齐。 */
#hidden-section {
  width: 100%;
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  padding: 20px;
}

.site-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 10px;
  border-radius: 12px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  color: #333;
  height: 100%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.site-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.98);
}

/* 末行补齐用的空白占位卡：淡虚线空卡槽，与真卡同尺寸、不可点、无悬停动效 */
.site-card.card-pad,
.site-card.card-pad:hover {
  background: rgba(255, 255, 255, 0.10);
  border: 1.5px dashed rgba(255, 255, 255, 0.35);
  box-shadow: none;
  transform: none;
  cursor: default;
  pointer-events: none;
}

.site-card.external {
  background: rgba(255, 255, 255, 0.85);
}
.site-card.external:hover {
  background: rgba(255, 255, 255, 0.98);
}

/* 七种淡色背景 */
.site-card.vip-red {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}
.site-card.vip-red:hover {
  background: linear-gradient(135deg, #fff5f5 0%, #fee2e2 100%);
}
.site-card.vip-orange {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
}
.site-card.vip-orange:hover {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
}
.site-card.vip-yellow {
  background: linear-gradient(135deg, #fef9c3 0%, #fde047 100%);
}
.site-card.vip-yellow:hover {
  background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
}
.site-card.vip-green {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}
.site-card.vip-green:hover {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}
.site-card.vip-blue {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}
.site-card.vip-blue:hover {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}
.site-card.vip-purple {
  background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
}
.site-card.vip-purple:hover {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
}
.site-card.vip-gray {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}
.site-card.vip-gray:hover {
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.site-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin-bottom: 10px;
  object-fit: cover;
  background-color: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  color: #555;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.site-name {
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
  font-size: 0.9rem;
  line-height: 1.2;
  color: #222;
}

.site-desc {
  font-size: 0.75rem;
  color: #666;
  text-align: center;
  word-break: break-all;
  line-height: 1.2;
}

.loading {
  text-align: center;
  color: white;
  font-size: 1.1rem;
  padding: 50px;
}

.page-footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  margin-top: 24px;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ========== 回顶部箭头（透明背景，页面滚动后显示） ========== */
.to-top {
  position: fixed;
  right: 10px;                  /* 与右下角聊天按钮同 right，垂直中心线对齐 */
  bottom: 104px;                /* 悬浮在聊天框“发送”按钮上方，不与其重合 */
  width: 36px;                  /* 与聊天按钮同尺寸，中心线一致 */
  height: 36px;
  border-radius: 50%;
  background: transparent;      /* 透明背景 */
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  padding: 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.to-top:hover { color: #fff; }

/* ========== 移动端 ========== */
@media (max-width: 768px) {
  body { padding: 10px; }
  .page-title { font-size: 1.8rem; }

  .global-announce-icon {
    right: 6px;
    top: -32px;
    font-size: 1.2rem;
  }

  .site-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    padding: 15px;
  }
  .category-section { width: 100%; }
  .site-icon { width: 40px; height: 40px; }
  .category-title { padding: 6px 12px; }
}

/* ========== PC端 ========== */
@media (min-width: 769px) {
  .container { width: 90% !important; max-width: 1400px; margin: 0 auto; }
  .category-section { width: calc(50% - 10px); }
}

@media (min-width: 1200px) {
  .site-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* 服务状态灯 */
.status-dot {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
  z-index: 2;
}
.status-dot.offline {
  display: block;
  background: #e74c3c;
}
/* 未知灯（黄）：如 HTTPS 页面无法探测 HTTP 卡片，浏览器策略不允许，不代表离线 */
.status-dot.unknown {
  display: block;
  background: #f5a623;
  animation: dot-pulse 1.6s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 166, 35, 0.55); }
  50%      { box-shadow: 0 0 0 4px rgba(245, 166, 35, 0); }
}

/* ========== 友情链接（版块与页脚之间，低调不突兀） ========== */
.friend-links {
  width: 100%;
  margin: 4px 0 0;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
}
.friend-links-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}
.friend-links-emoji {
  font-size: 1.4rem;
  line-height: 1;
}
.friend-links-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  flex: 1;
}
.friend-link {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.82rem;
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.35);
  line-height: 1.4;
  transition: color 0.2s, border-color 0.2s;
}
.friend-link:hover {
  color: #fff;
  border-bottom-color: #fff;
}
@media (max-width: 768px) {
  .friend-links { padding: 10px 14px; gap: 6px 14px; }
  .friend-links-title { width: 100%; }
}