/* 云端静态版补充样式：只补"现有 styles.css 里没有的"那几块
   （顶部栏、分类入口、登录框、详情弹层、提示条）。
   卡片/标签/分页的样式全部沿用 styles.css + tags.css，不重复定义。 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(20, 20, 24, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.brand {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.search-form {
  display: flex;
  flex: 1;
  max-width: 520px;
  gap: 8px;
}

.search-input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 14px;
}

.search-input:focus { outline: none; border-color: #4a9eff; }

.search-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: #4a9eff;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.user-btn {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  white-space: nowrap;
}

.user-btn[data-logged="1"] { border-color: #4ade80; color: #4ade80; }

/* 首页分类入口 */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  padding: 20px;
}

.cat-card {
  display: block;
  padding: 18px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: #fff;
  transition: transform 0.15s, border-color 0.15s;
}

.cat-card:hover { transform: translateY(-2px); border-color: #4a9eff; }
.cat-card-name { font-size: 16px; font-weight: 600; }
.cat-card-count { margin-top: 6px; font-size: 13px; opacity: 0.65; }

.loading-text { padding: 40px; text-align: center; opacity: 0.7; }

/* 登录弹层 */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
}

.modal.show { display: flex; }

.login-box {
  position: relative;
  width: 320px;
  padding: 28px 24px;
  border-radius: 14px;
  background: #1c1c20;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.login-box h3 { margin: 0 0 18px; font-size: 18px; }

.login-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  cursor: pointer;
}

.login-input {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
}

.login-submit {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #4a9eff;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.login-err { margin-top: 10px; min-height: 18px; font-size: 13px; color: #ff6b6b; }

/* 详情弹层 */
.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 40px 16px;
  background: rgba(0, 0, 0, 0.75);
}

.detail-box {
  position: relative;
  width: min(760px, 100%);
  padding: 22px;
  border-radius: 14px;
  background: #1c1c20;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.detail-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  font-size: 20px;
  cursor: pointer;
}

.detail-title { margin: 0 0 16px; font-size: 17px; line-height: 1.5; padding-right: 28px; }

.detail-images { display: flex; flex-direction: column; gap: 10px; }
.detail-images img { width: 100%; border-radius: 8px; display: block; }

.detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.detail-magnet {
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  background: #f0a020;
  color: #1a1a1a;
  font-weight: 600;
  cursor: pointer;
}

.detail-source { color: #4a9eff; font-size: 14px; }
.detail-muted { opacity: 0.6; font-size: 14px; }

.detail-rate { display: flex; align-items: center; gap: 4px; margin-top: 16px; }

.detail-rate .star {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.25);
  font-size: 22px;
  cursor: pointer;
  padding: 0 2px;
}

.detail-rate .star.on { color: #f5c518; }
.rate-hint { margin-left: 8px; font-size: 13px; opacity: 0.6; }

/* 提示条（沿用 .update-toast 的定位，这里补显示逻辑） */
.update-toast.show { display: block; }

@media (max-width: 640px) {
  .site-header { gap: 10px; padding: 8px 12px; }
  .brand { font-size: 15px; }
  .search-input { padding: 7px 10px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px; }
}
