/* ===== 链接页面样式 ===== */

/* 覆盖全局 body 背景（提高优先级确保覆盖 layout 内嵌样式） */
html body { background: #f8f8f5; }

.links-page-root {
  min-height: 100vh;
  background: #f8f8f5;
  color: #374151;
}

/*
 * ─── 轮播横幅（ID 选择器，隔离全局 CSS 冲突）────────────────
 * 两份相同文本拼接，从 translateX(0) 滚到 translateX(-50%)，
 * 第一份滚出时第二份刚好填补 → 无缝循环。
 * 用 #id 而不是 .class 确保不会被 Halo/全局样式覆盖。
 */
#links-banner-bar {
  position: relative;
  display: block;
  width: 100%;
  height: 2.5rem;
  line-height: 2.5rem;
  margin: 0;
  padding: 0;
  border: none;
  overflow: hidden;
  background: #f5f0e1;
  z-index: auto;
  contain: layout style;
}

#links-banner-bar .links-banner-track {
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  width: max-content;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  animation: links-marquee var(--banner-speed, 20s) linear infinite;
}

#links-banner-bar .links-banner-track span {
  display: inline-block;
  flex-shrink: 0;
  flex-grow: 0;
  padding-right: 4rem;
  margin: 0;
  white-space: nowrap;
  line-height: 2.5rem;
  font-size: inherit;
}

@keyframes links-marquee {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-50%); }
}

/* ----- 全屏背景视频/图片层 ----- */
.links-bg-layer { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.links-bg-layer video { width: 100%; height: 100%; object-fit: cover; display: block; }
.links-bg-img { width: 100%; height: 100%; object-fit: cover; }

/* ----- 返回首页链接 ----- */
.links-back-home { display: block; padding: 2rem 2rem 0.5rem; font-size: 2rem; font-weight: 600; color: #f472b6; }
.links-back-home:hover { color: #db2777; }

/* ----- 页面内容层（在背景之上）---- */
.links-page-content { position: relative; z-index: 1; }

/* ----- 页面整体容器 ----- */
.links-page-outer {
  max-width: 64rem;
  margin: 3rem auto 4rem;
  padding: 0 1.5rem;
}

/* ----- 链接表格区域 ----- */
.links-table-section {
  margin-bottom: 3rem;
}

.links-table-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f472b6;
  margin-bottom: 1.25rem;
  padding-left: 0.75rem;
  border-left: 4px solid #f472b6;
}

.links-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  background: #fff;
}

.links-table thead th {
  background: #f9fafb;
  padding: 0.85rem 1.25rem;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 2px solid #e5e7eb;
}

.links-table tbody td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f3f4f6;
  font-size: 1rem;
  color: #374151;
  transition: background-color 0.15s;
}

.links-table tbody tr:hover td {
  background: #fdf2f8;
}

.links-table tbody tr:last-child td {
  border-bottom: none;
}

.links-table .col-name {
  font-weight: 500;
  width: 35%;
}

.links-table .col-url {
  width: 45%;
}

.links-table .col-url a {
  color: #f472b6;
  word-break: break-all;
  transition: color 0.15s;
}

.links-table .col-url a:hover {
  color: #db2777;
  text-decoration: underline;
}

.links-table .col-visit {
  width: 20%;
  text-align: center;
}

.links-table .btn-visit {
  display: inline-block;
  padding: 0.35rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  background: #f472b6;
  border-radius: 0.375rem;
  transition: background-color 0.2s, box-shadow 0.2s;
}

.links-table .btn-visit:hover {
  background: #db2777;
  box-shadow: 0 2px 8px rgba(219,39,119,0.25);
}

/* 空状态 */
.links-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #9ca3af;
  font-size: 1rem;
}

/* ----- 热门网站链接区域 ----- */
.hot-links-section {
  margin-top: 3rem;
}

.hot-links-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #f472b6;
  margin-bottom: 1.25rem;
  padding-left: 0.75rem;
  border-left: 4px solid #f472b6;
}

.hot-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.hot-link-card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.5rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  transition: background-color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.hot-link-card:hover {
  background: #fdf2f8;
  border-color: #fbcfe8;
  box-shadow: 0 4px 12px rgba(244,114,182,0.1);
}

.hot-link-card .hot-link-name {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.35rem;
}

.hot-link-card:hover .hot-link-name {
  color: #f472b6;
}

.hot-link-card .hot-link-desc {
  font-size: 0.85rem;
  color: #6b7280;
  line-height: 1.4;
}

.hot-link-card .hot-link-url {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 0.5rem;
  word-break: break-all;
}

/* 响应式 */
@media (max-width: 640px) {
  .links-page-outer {
    padding: 0 0.75rem;
    margin: 1.5rem auto 2.5rem;
  }
  .links-table thead { display: none; }
  .links-table tbody td {
    display: block;
    padding: 0.65rem 0.75rem;
  }
  .links-table tbody td::before {
    font-weight: 600;
    color: #6b7280;
  }
  .links-table .col-name::before { content: '名称：'; }
  .links-table .col-url::before  { content: '链接：'; }
  .links-table .col-visit { text-align: left; }
  .links-table .col-visit::before { content: '操作：'; font-weight: 600; color: #6b7280; }
  .hot-links-grid {
    grid-template-columns: 1fr;
  }
}
