/* ====================================================
   Links Page — simple theme
   完全复用主题设计令牌（--green, --ink, --muted, --faint 等）
   ==================================================== */

/* ── 页面标题 ── */
.links-title {
  font-family: var(--font-title);
  font-size: var(--font-size-3xl);
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 var(--sp-2);
  position: relative;
  display: inline-block;
}
.links-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, var(--green), transparent);
  border-radius: var(--radius-full);
}

/* ── 统计栏 ── */
.lk-stats {
  font-size: var(--font-size-base);
  color: var(--muted);
  margin: var(--sp-5) 0 var(--sp-5);
  line-height: 1.7;
}
.lk-stats em {
  font-style: normal;
  font-weight: 600;
  color: var(--green);
}

/* ── 绿色虚线分隔 ── */
.lk-divider {
  height: 1px;
  background: repeating-linear-gradient(
    to right,
    var(--green) 0px,
    var(--green) 3px,
    transparent 3px,
    transparent 6px
  );
  margin: var(--sp-5) 0;
}

/* ── 分组标题 ── */
.lk-section-title {
  font-size: var(--font-size-md);
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.lk-section-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-bg);
  flex-shrink: 0;
}

/* ── 卡片网格 ── */
.lk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

/* ── 卡片 ── */
.lk-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--bg);
  border: 1px solid var(--faint);
  transition: box-shadow var(--transition-normal),
              border-color var(--transition-normal),
              transform var(--transition-normal);
  overflow: visible;
}
.lk-card:hover {
  border-color: rgba(39, 174, 96, .35);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.lk-card.lk-dead {
  opacity: .5;
  filter: grayscale(.65);
}
.lk-card.lk-dead:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--faint);
}
.lk-card.lk-oneway {
  opacity: .75;
}

/* ── 卡片内链接 ── */
.lk-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-lg);
}

/* ── 头像 ── */
.lk-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--faintest);
}
.lk-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slow);
}
.lk-card:hover .lk-avatar {
  transform: scale(1.08);
}

/* 首字母兜底 */
.lk-avatar-fb {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--muted);
  border-radius: 50%;
  text-transform: uppercase;
  user-select: none;
}
.lk-avatar-fb.show { display: flex; }
.lk-avatar.hidden  { display: none; }

/* ── 信息区 ── */
.lk-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lk-name {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  transition: color var(--transition-fast);
}
.lk-card:hover .lk-name { color: var(--green); }
.lk-desc {
  font-size: var(--font-size-sm);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* ── 失效标记 ── */
.lk-dead-badge {
  flex-shrink: 0;
  font-size: var(--font-size-xs);
  color: var(--muted);
  background: var(--faintest);
  border: 1px solid var(--faint);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  line-height: 1.6;
  white-space: nowrap;
}

/* ── 单链标记 ── */
.lk-oneway-badge {
  flex-shrink: 0;
  font-size: var(--font-size-xs);
  color: var(--muted);
  background: var(--faintest);
  border: 1px solid var(--faint);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  line-height: 1.6;
  white-space: nowrap;
}

/* ── RSS 按钮（右上角绿点） ── */
.lk-rss-btn {
  position: absolute;
  top: -7px;
  right: -7px;
  z-index: 2;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background var(--transition-fast),
              transform var(--transition-normal) var(--easing-bounce);
  box-shadow: var(--shadow-xs);
}
.lk-rss-btn:hover {
  background: var(--green-700);
  transform: scale(1.15);
}
.lk-rss-btn svg {
  width: 10px;
  height: 10px;
}

/* ── RSS 弹窗遮罩 ── */
.lk-rss-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, .45);
  align-items: center;
  justify-content: center;
}
.lk-rss-modal.open { display: flex; }

/* ── RSS 弹窗面板 ── */
.lk-rss-panel {
  background: var(--bg);
  border-radius: var(--radius-xl);
  width: 340px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: lk-panel-in .18s ease;
}
@keyframes lk-panel-in {
  from { opacity: 0; transform: scale(.94) translateY(8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
.lk-rss-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--faint);
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--ink);
  flex-shrink: 0;
}
.lk-rss-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--faintest);
  color: var(--muted);
  font-size: var(--font-size-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}
.lk-rss-close:hover {
  background: var(--faint);
  color: var(--ink);
}
.lk-rss-list {
  list-style: none;
  margin: 0;
  padding: var(--sp-1) 0;
  overflow-y: auto;
}
.lk-rss-list li a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--font-size-base);
  color: var(--ink);
  text-decoration: none;
  transition: background var(--transition-fast);
  line-height: 1.5;
}
.lk-rss-list li a:hover {
  background: var(--green-bg);
  color: var(--green);
}
.lk-rss-list li a .rss-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lk-rss-list li a .rss-date {
  flex-shrink: 0;
  font-size: var(--font-size-sm);
  color: var(--muted);
}

/* ── 申请友链区 ── */
.lk-apply {
  margin-top: var(--sp-8);
}
.lk-apply-body {
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  align-items: stretch;
  background: var(--faintest);
  border: 1px solid var(--faint);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

/* 左侧：本站信息 */
.lk-apply-mine {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  min-width: 220px;
  max-width: 280px;
  flex-shrink: 0;
  border-right: 1px solid var(--faint);
}
.lk-apply-mine-avatar img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: block;
  background: var(--faint);
  object-fit: cover;
  flex-shrink: 0;
}
.lk-apply-mine-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  flex: 1;
}
.lk-apply-mine-name {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .03em;
  transition: color var(--transition-fast);
}
.lk-apply-mine-name:hover { color: var(--green); }
.lk-apply-mine-url {
  font-size: var(--font-size-sm);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lk-apply-mine-desc {
  font-size: var(--font-size-md);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 右侧：申请说明 */
.lk-apply-rules {
  flex: 1;
  min-width: 200px;
  font-size: var(--font-size-base);
  color: var(--muted);
  line-height: 1.8;
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--sp-2);
}
.lk-apply-rules-lead {
  margin: 0;
  color: var(--ink);
  font-size: var(--font-size-base);
}
.lk-apply-fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
}
.lk-apply-field {
  display: inline-block;
  padding: 2px var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-md);
  font-weight: 500;
  line-height: 1.8;
}
.lk-apply-field.required {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(39, 174, 96, .25);
}
.lk-apply-field.optional {
  background: var(--faintest);
  color: var(--muted);
  border: 1px solid var(--faint);
}
.lk-apply-note {
  font-size: var(--font-size-md);
  color: var(--muted);
  margin: 0;
  opacity: .7;
}

/* ── 深色模式适配 ── */
[data-theme="dark"] .lk-card {
  background: var(--bg);
  border-color: rgba(255, 255, 255, .08);
}
[data-theme="dark"] .lk-card:hover {
  border-color: rgba(39, 174, 96, .4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}
[data-theme="dark"] .lk-apply-body {
  background: rgba(255, 255, 255, .03);
  border-color: rgba(255, 255, 255, .08);
}
[data-theme="dark"] .lk-apply-mine {
  border-right-color: rgba(255, 255, 255, .08);
}
[data-theme="dark"] .lk-rss-list li a:hover {
  background: rgba(39, 174, 96, .08);
}

/* ── 响应式 ── */
@media (max-width: 600px) {
  .lk-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--sp-2);
  }
  .lk-apply-body { flex-direction: column; }
  .lk-apply-mine {
    max-width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--faint);
  }
}
@media (max-width: 380px) {
  .lk-grid { grid-template-columns: repeat(2, 1fr); }
}
