/* L4D2 创意工坊 Steam 主题 - 复刻 */
:root {
  --steam-bg: #1b2838;
  --steam-content-bg: #101822;
  --steam-card-bg: rgba(0, 0, 0, 0.2);
  --steam-text-main: #c6d4df;
  --steam-text-blue: #66c0f4;
  --steam-text-dim: #8f98a0;
  --steam-accent-green: #5c7e10;
  --steam-accent-green-hover: #76a113;
  --steam-border: #2a475e;
  --font-main: "Motiva Sans", "Arial", sans-serif;
}

.l4d2-container {
  background-color: var(--steam-bg);
  color: var(--steam-text-main);
  font-family: var(--font-main);
  padding: 20px;
  max-width: 1200px;
  margin: 10px auto; /* 增加上下边距 */
  box-sizing: border-box;
  /* 边缘柔化处理 */
  border-radius: 8px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.5); /* 增加阴影提升层次感 */
  border: 1px solid var(--steam-border); /* 微妙的边框融合 */
}

.l4d2-info-container {
  background-color: var(--steam-bg);
  color: var(--steam-text-main);
  font-family: var(--font-main);
  padding: 7px 14px;
  max-width: 1200px;
  margin: 3px auto;
  box-sizing: border-box;
  border-radius: 7px;
  box-shadow: 0 5px 25px rgba(0,0,0,0.5);
  border: 1px solid var(--steam-border);
}

.l4d2-info-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  padding: 4px 0;
  border-radius: 3px;
}

.l4d2-info-icon {
  color: var(--steam-text-blue);
  font-size: 13px;
  line-height: 1;
  flex: 0 0 auto;
}

.l4d2-info-text {
  color: var(--steam-text-blue);
  font-size: 13px;
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

/* --- 布局 --- */
.lf-main-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

/* --- 侧边栏（筛选器） --- */
.lf-sidebar {
  width: 210px;
  flex-shrink: 0;
  font-size: 13px;
}

.lf-filter-group {
  margin-bottom: 20px;
}

.lf-filter-title {
  color: var(--steam-text-blue);
  font-weight: bold;
  text-transform: uppercase;
  font-size: 11px;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}

.lf-filter-item {
  display: block;
  cursor: pointer;
  margin-bottom: 2px;
}

.lf-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
}

.lf-filter-check {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  color: var(--steam-text-blue);
  transition: color 0.2s;
}

.lf-filter-check:hover {
  color: #fff;
}

.lf-filter-checkbox {
  width: 16px;
  height: 16px;
  background: #3c3d3e;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #000;
  box-shadow: inset 0 0 3px rgba(0,0,0,0.5);
}

.lf-filter-item.active .lf-filter-checkbox::after {
  content: "✔";
  font-size: 12px;
  color: #fff;
}

.lf-filter-exclude {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4c4d4e;
  opacity: 0;
  transition: all 0.2s;
}

.lf-filter-item:hover .lf-filter-exclude {
  opacity: 1;
}

.lf-filter-exclude:hover {
  color: #fff;
  background: #d83030;
  border-radius: 2px;
}

.lf-filter-item.excluded .lf-filter-exclude {
  opacity: 1;
  color: #d83030;
}
.lf-filter-item.excluded .lf-filter-exclude:hover {
    color: #fff;
}

.lf-filter-item.excluded .lf-tag-name {
  text-decoration: line-through;
  color: #666;
}

.lf-filter-count {
  color: var(--steam-text-dim);
  font-size: 11px;
}

/* --- 顶栏 --- */
.lf-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px;
  border-radius: 3px;
}

.lf-controls {
  display: flex;
  gap: 10px;
  align-items: center; /* 确保垂直居中 */
}

#lf-search-tag-container {
    display: flex;
    align-items: center;
}

.lf-search-term-bar {
    display: flex;
    align-items: center;
    background: var(--steam-accent-green);
    color: #fff;
    padding: 4px 8px;
    border-radius: 2px;
    font-size: 12px;
    white-space: nowrap;
    margin-right: 5px; /* 与搜索框保持间距 */
    border: 1px solid rgba(0,0,0,0.2);
}

.lf-search-term-text {
    margin-right: 8px;
}

.lf-search-term-close {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 16px;
    height: 16px;
    background: rgba(0,0,0,0.2);
    border-radius: 2px;
    line-height: 1;
    font-size: 14px;
}

.lf-search-term-close:hover {
    background: rgba(255,255,255,0.2);
}

.lf-search-wrap {
  position: relative;
  flex: 1;
  max-width: 300px;
  /* PC端布局：Flex */
  display: flex;
  align-items: center;
}

.lf-search {
  background: #000;
  border: 1px solid #000;
  color: #fff;
  padding: 8px 30px 8px 10px;
  width: 100%;
  border-radius: 3px;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

.lf-search-icon {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  width: 28px;
  height: 28px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s;
  color: #66c0f4; /* 使用 Steam 蓝 */
}
.lf-search-icon:hover {
    opacity: 1;
    color: #fff;
}
.lf-search-icon i {
    font-size: 16px;
}

.lf-sort, .lf-time {
  background: #000;
  color: var(--steam-text-blue);
  border: 1px solid #000;
  padding: 8px;
  border-radius: 3px;
  cursor: pointer;
}

.lf-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2a475e;
  color: #66c0f4;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  border: 1px solid #66c0f4;
  transition: all 0.2s;
}
.lf-help-icon:hover {
  background: #66c0f4;
  color: #fff;
}

/* --- 网格 --- */
.lf-content {
  flex: 1;
}

.lf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.lf-card {
  background: var(--steam-card-bg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.lf-card:hover {
  background: #3d4c5d;
  border-color: var(--steam-text-blue);
}

.lf-thumb {
  width: 100%;
  aspect-ratio: 1/1; /* 如图1所示的正方形比例 */
  background-size: cover;
  background-position: center;
  border: 1px solid #000;
  box-sizing: border-box;
}

.lf-info {
  padding: 8px;
}

.lf-title {
  font-size: 13px;
  color: var(--steam-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 4px;
  font-weight: normal;
  line-height: normal;
  height: auto;
  max-width: 100%;
  display: block;
}

/* 确保没有其他全局样式覆盖此特定标题 */
.lf-info .lf-title {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.lf-author {
  font-size: 11px;
  color: var(--steam-text-dim);
}

.lf-stars {
  color: #8bc34a; /* 绿色星星 */
  font-size: 14px;
  letter-spacing: -2px;
}

/* --- 模态框（复刻图3） --- */
.lf-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}
.lf-modal.open { display: block; }
.lf-modal-dim {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.8);
}
.lf-modal-box {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 940px;
  max-width: 95vw;
  max-height: 90vh;
  background: #101822; /* 更暗的详情背景 */
  border: 1px solid #2a475e;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 20px #000;
}

.lf-modal-header {
  padding: 10px 15px;
  background: #101822;
  border-bottom: 1px solid #000;
  cursor: move;
}
.lf-breadcrumbs {
  color: var(--steam-text-dim);
  font-size: 12px;
  margin-bottom: 5px;
}

a.lf-breadcrumbs {
  text-decoration: none !important;
  border: none !important;
  border-bottom: none !important;
  display: inline-block;
  cursor: pointer;
  transition: color 0.2s;
}

a.lf-breadcrumbs:hover {
  text-decoration: underline !important;
  color: #fff;
}
.lf-modal-title {
  font-size: 24px;
  color: #fff;
  font-weight: normal;
  letter-spacing: 0.5px;
}

.lf-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: 2fr 1fr; /* 左侧图片，右侧元数据 */
  gap: 16px;
}

/* 左栏 */
.lf-modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  height: 100%;
}
.workshopItemPreviewImageEnlargeableContainer {
  position: relative;
  overflow: hidden;
  border: 1px solid #000;
  box-shadow: 0 0 10px #000;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}
.lf-carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .3s ease;
}
.lf-slide { 
  flex: 0 0 100%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  background: #0b1622; 
  height: 100%;
}
.lf-slide-media { 
  max-width: 100%; 
  max-height: 100%; 
  object-fit: contain;
}
.lf-modal-main-img {
  width: 100%;
  border: 1px solid #000;
  box-shadow: 0 0 10px #000;
}
.lf-carousel-prev,
.lf-carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: 1px solid #000;
  width: 32px;
  height: 32px;
  cursor: pointer;
}
.lf-carousel-prev { left: 6px; }
.lf-carousel-next { right: 6px; }
.lf-carousel-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; gap: 6px; justify-content: center; }
.lf-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.4); cursor: pointer; }
.lf-dot.active { background: #66c0f4; }
.lf-gallery-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 140px; /* 限制高度以防止挤压侧边栏 */
  overflow-y: auto; /* 如果缩略图过多则滚动 */
}
.lf-sidebar-preview {
  margin-bottom: 15px;
}
.lf-sidebar-preview img {
  width: 100%;
  border: 1px solid #000;
  box-shadow: 0 0 5px #000;
}
.lf-gallery-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border: 1px solid #000;
  cursor: pointer;
}
.lf-gallery-thumb.active { outline: 2px solid var(--steam-text-blue); }

/* 右栏 */
.lf-modal-sidebar {
  font-size: 12px;
}
.lf-download-btn {
  display: block;
  background: linear-gradient(to bottom, #799905 5%, #536904 95%);
  border: 1px solid #5c7e10;
  color: #d2efa9;
  text-align: center;
  padding: 12px 0;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.3);
  margin-bottom: 15px;
  border-radius: 2px;
}
.lf-download-btn:hover {
  background: linear-gradient(to bottom, #a4d007 5%, #536904 95%);
  color: #fff;
}
.lf-download-note {
  background: #222b35;
  padding: 8px;
  margin-bottom: 15px;
  border: 1px solid #000;
}
.lf-kv-table {
  width: 100%;
  color: var(--steam-text-dim);
}
.lf-kv-table td { padding: 4px 0; }
.lf-kv-val { color: #66c0f4; text-align: right; }
.lf-tag-cloud { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.lf-modal-tag {
  background: #1b2838;
  border: 1px solid #000;
  padding: 2px 6px;
  color: #66c0f4;
  border-radius: 2px;
}

.lf-author-block {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.lf-author-avatar {
  width: 20px;
  height: 20px;
  border: 1px solid #000;
}
.lf-author-link {
  color: #66c0f4;
  text-decoration: none;
}
.lf-author-link:hover {
  text-decoration: underline;
  color: #fff;
}

/* 描述与评论 */
.lf-modal-full-width {
  grid-column: 1 / -1;
  margin-top: 20px;
  border-top: 1px solid #2a475e;
  padding-top: 20px;
}
.lf-desc-text {
  font-size: 13px;
  line-height: 1.6;
  color: #acb2b8;
  white-space: pre-wrap;
  margin-bottom: 30px;
}
.lf-hr {
  border: 0;
  border-top: 1px solid var(--steam-border);
  margin: 16px 0;
  opacity: 0.7;
}
.lf-desc-text a { color: var(--steam-text-blue); text-decoration: none; }
.lf-desc-text a:hover { text-decoration: underline; }
.lf-desc-text strong, .lf-desc-text b { color: #acb2b8; font-weight: bold; }
.lf-desc-img { max-width: 100%; border: 1px solid #000; box-shadow: 0 0 5px #000; margin: 8px 0; }
.lf-h1 { font-size: 22px; color: #fff; margin: 12px 0; }
.lf-h2 { font-size: 18px; color: #fff; margin: 10px 0; }
.lf-h3 { font-size: 16px; color: #fff; margin: 8px 0; }
.lf-quote { border-left: 3px solid var(--steam-border); padding-left: 10px; color: #acb2b8; margin: 10px 0; background: rgba(0,0,0,0.2); }
.lf-code { background: #1b2838; border: 1px solid #000; padding: 10px; color: #d6dadf; overflow: auto; }
.lf-spoiler { margin: 10px 0; }
.lf-spoiler-toggle { background: #2a475e; color: #fff; border: 1px solid #000; padding: 4px 8px; cursor: pointer; border-radius: 2px; }
.lf-spoiler-body { display: none; margin-top: 6px; background: rgba(0,0,0,0.2); padding: 8px; border: 1px solid #000; }
.lf-desc-text ul, .lf-desc-text ol { margin: 8px 0 8px 20px; }

/* 评论 */
.lf-comment {
  display: flex;
  gap: 10px;
  background: rgba(0,0,0,0.2);
  margin-bottom: 8px;
  padding: 8px;
}
.lf-comment-avatar { width: 32px; height: 32px; border: 1px solid #000; }

.lf-avatar-wrap {
    position: relative;
    /* 恢复原始大小 */
    width: 32px; 
    height: 32px;
    display: block; /* 恢复为 block，避免 flex 居中导致的问题 */
    flex-shrink: 0;
    /* 移除 z-index 和 isolation，完全依赖 DOM 顺序 */
}

.lf-avatar-wrap .lf-comment-avatar {
    position: absolute; 
    top: 0;
    left: 0;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    max-width: 32px;
    /* 移除 z-index，依赖它是 DOM 中的第一个子元素 */
    border: 1px solid #000;
    box-sizing: border-box; /* 保持盒模型一致 */
    display: block; /* 确保图片作为块显示 */
}

.lf-comment-frame {
    position: absolute;
    /* 使用负边距进行中心定位，而不是 transform，有时更稳定 */
    top: -4px; 
    left: -4px;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    max-width: 40px;
    /* 移除 z-index，依赖它是 DOM 中的第二个子元素（后出现的层级高） */
    pointer-events: none;
    border: none; 
    background: none;
    transform: none; /* 移除缩放，直接使用大尺寸 */
}
.lf-comment-content { flex: 1; font-size: 12px; }
.lf-comment-author { color: #b0aeac; font-weight: bold; }
.lf-comment-author:hover { text-decoration: underline; }
.lf-comment-meta { color: #565452; margin-left: 5px; }
.lf-comment-body { color: #acb2b8; margin-top: 4px; }

/* 分页 */
.lf-pagination {
  margin-top: 20px;
  display: flex;
  justify-content: flex-start;
  gap: 5px;
}
.lf-page-btn {
  background: #000;
  border: 1px solid #2a475e;
  color: var(--steam-text-blue);
  padding: 5px 12px;
  cursor: pointer;
  border-radius: 2px;
}
.lf-page-btn:hover { background: #2a475e; color: #fff; }

/* 移除数字输入框的箭头 */
input[type=number].lf-page-num::-webkit-inner-spin-button, 
input[type=number].lf-page-num::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}
input[type=number].lf-page-num {
    -moz-appearance: textfield;
}

/* 评论分页 */
.lf-comment-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 12px;
}
.lf-comment-page-btn {
  background: #1b2838;
  border: 1px solid #2a475e;
  color: #66c0f4;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: 2px;
}
.lf-comment-page-btn:hover {
  background: #2a475e;
  color: #fff;
}
.lf-comment-page-info {
  color: #8f98a0;
}

@media (max-width: 800px) {
  .lf-main-layout { flex-direction: column; }
  .lf-sidebar { width: 100%; }
  .lf-modal-content { grid-template-columns: 1fr; }
  
  /* 顶栏在移动端折行 */
  .lf-top-bar {
      flex-wrap: wrap;
      gap: 10px;
  }
  
  /* 面包屑（左侧标题）在移动端占满一行 */
  .lf-top-bar > a,
  .lf-top-bar > div:first-child {
      flex: 1 1 100%;
      width: 100%;
      margin-bottom: 5px;
  }
  
  /* 控件区域（搜索框和筛选器）在移动端占满一行并保持弹性布局 */
  .lf-controls {
      flex: 1 1 100%;
      width: 100%;
      justify-content: flex-start; /* 改为左对齐 */
      gap: 10px;
      flex-wrap: wrap; /* 允许控件内部换行 */
  }
  
  /* 搜索框自适应宽度，但在极小屏幕下独占一行 */
  .lf-search-wrap {
      max-width: none;
      flex-grow: 1;
      flex-basis: 100%; /* 强制独占一行 */
      min-width: 200px;
      
      /* 让内部的绿色词条和搜索框在同一行 */
      display: flex;
      align-items: center;
      flex-wrap: wrap; /* 如果词条太长，允许换行，防止撑破 */
      gap: 5px;
  }
  
  /* 调整搜索输入框，使其填满剩余空间 */
  .lf-search-wrap .lf-search {
      flex: 1;
      min-width: 150px; /* 防止被压缩得太小 */
  }
  
  /* 调整绿色词条样式以适应 flex 布局 */
  #lf-search-tag-container {
      flex-shrink: 0;
      margin-right: 0; /* 移除之前可能的右边距 */
  }
  
  /* 排序下拉框 */
  .lf-sort, .lf-time {
      flex-shrink: 0;
      flex-grow: 1; /* 允许下拉框稍微拉伸以填充空间 */
  }
}

/* 合集物品网格 */
.lf-collection-box {
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border: 1px solid #2a475e;
}
.lf-collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}
.lf-collection-item {
    background: #1b2838;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}
.lf-collection-item:hover {
    background: #3d4c5d;
    border-color: #66c0f4;
}
.lf-collection-thumb {
    width: 100%;
    aspect-ratio: 1/1;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid #000;
}
.lf-collection-title {
    padding: 5px;
    font-size: 11px;
    color: #c6d4df;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 必需物品提示 */
.lf-req-prompt {
  background: #2a475e;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #000; /* 改为黑色边框，与整体风格一致 */
  border-left: 3px solid #d83030; /* 红色左边框表示警告/注意 */
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.lf-req-prompt:hover {
  background: #3d5f7a;
}
.lf-req-title {
  font-weight: bold;
  color: #d83030;
  margin-bottom: 4px;
}

/* 必需物品网格 */
.lf-req-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  padding: 10px;
}
.lf-req-item {
  background: #1b2838;
  border: 1px solid #000;
  cursor: pointer;
  transition: border-color 0.2s;
}
.lf-req-item:hover {
  border-color: #66c0f4;
}
.lf-req-thumb {
  width: 100%;
  aspect-ratio: 1/1; /* 修改为 1:1，与搜索列表保持一致 */
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid #000; /* 增加底部边框以区分图片和文字 */
}
.lf-req-info {
  padding: 8px;
  font-size: 12px;
  color: #c6d4df;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- 全屏图片查看器样式 --- */
.lf-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: lf-fade-in 0.3s forwards;
}

.lf-fullscreen-overlay.closing {
    animation: lf-fade-out 0.3s forwards;
}

.lf-fullscreen-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

.lf-fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 100000;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
    width: auto;
    height: auto;
}

.lf-fullscreen-close:hover {
    opacity: 1;
}

.lf-fullscreen-prev, .lf-fullscreen-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    color: #fff;
    border: none;
    font-size: 60px;
    padding: 20px;
    cursor: pointer;
    z-index: 100001;
    transition: background 0.2s;
    user-select: none;
    line-height: 0.5;
    outline: none;
    display: block;
    width: auto;
    height: auto;
}

.lf-fullscreen-prev:hover, .lf-fullscreen-next:hover {
    background: rgba(0,0,0,0.8);
}

.lf-fullscreen-prev { left: 0; }
.lf-fullscreen-next { right: 0; }

.lf-fullscreen-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.8);
    background: rgba(0,0,0,0.5);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    pointer-events: auto;
    z-index: 100002;
    transition: background 0.2s;
}

.lf-fullscreen-counter:hover {
    background: rgba(0,0,0,0.8);
    color: #fff;
}

.lf-thumbs-panel {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.95);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    gap: 8px;
    max-width: 90vw;
    overflow-x: auto;
    z-index: 100002;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    transform-origin: bottom center;
}

.lf-thumbs-panel.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.lf-fs-thumb {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s;
    flex-shrink: 0;
    opacity: 1;
}

.lf-fs-thumb:hover {
    border-color: #fff;
}

.lf-fs-thumb.active {
    border-color: #66c0f4;
}

@keyframes lf-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes lf-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* --- 分享模态框与生成器样式 --- */
.lf-share-modal .lf-modal-box {
    width: 95%;
    max-width: 1000px;
    background: #1b2838;
    height: 85vh; /* 稍微增加高度以适应预览 */
    display: flex;
    flex-direction: column;
}

.lf-share-container {
    display: flex;
    height: 100%;
    overflow: hidden;
}

/* 左侧预览/画布区域 */
.lf-share-canvas-area {
    flex: 1;
    background: #0d1219;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding: 20px;
    background-image: 
        linear-gradient(45deg, #131b24 25%, transparent 25%), 
        linear-gradient(-45deg, #131b24 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #131b24 75%), 
        linear-gradient(-45deg, transparent 75%, #131b24 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* 实际用于生成的卡片 DOM
   尺寸调整为：850px x 400px (约 2.125:1 比例，适合推特/分享预览)
*/
#lf-share-card-render {
    width: 850px; 
    height: 350px;
    background: #1b2838;
    position: relative;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    flex-shrink: 0;
    overflow: hidden;
    transform-origin: center; 
    font-family: "Motiva Sans", "Microsoft YaHei", "Arial", sans-serif;
    user-select: none;
    box-sizing: border-box;
}

/* --- 1. Steam 经典主题 (默认 - 纯色) --- */
.lf-theme-steam .lf-card-bg {
    display: none; /* 移除背景图 */
}
.lf-theme-steam .lf-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(27,40,56,0.95) 0%, rgba(27,40,56,0.8) 40%, rgba(27,40,56,0.6) 100%);
    /* 添加扫描线纹理 */
    background-image: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0,0,0,0.1) 2px);
}
.lf-theme-steam .lf-card-body { color: #fff; }
.lf-theme-steam .lf-card-app-name { color: #66c0f4; }
.lf-theme-steam .lf-card-meta-row { border-top: 1px solid rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255,255,255,0.1); }
.lf-theme-steam .lf-card-poster { border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.lf-theme-steam .lf-card-qr-box { background: #fff; color: #000; }

/* --- 1.1 Steam 经典主题 (带背景图) --- */
.lf-theme-steam_bg .lf-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: blur(15px) brightness(0.4);
    z-index: 0;
}
.lf-theme-steam_bg .lf-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, rgba(27,40,56,0.95) 0%, rgba(27,40,56,0.8) 40%, rgba(27,40,56,0.6) 100%);
    /* 添加扫描线纹理 */
    background-image: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0,0,0,0.1) 2px);
}
.lf-theme-steam_bg .lf-card-body { color: #fff; }
.lf-theme-steam_bg .lf-card-app-name { color: #66c0f4; }
.lf-theme-steam_bg .lf-card-meta-row { border-top: 1px solid rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255,255,255,0.1); }
.lf-theme-steam_bg .lf-card-poster { border: 1px solid rgba(255,255,255,0.2); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.lf-theme-steam_bg .lf-card-qr-box { background: #fff; color: #000; }

/* --- 2. Modern 明亮主题 --- */
.lf-theme-modern {
    background-color: #f5f5f7 !important;
}
.lf-theme-modern .lf-card-bg,
.lf-theme-modern .lf-card-overlay {
    display: none; /* 移除背景模糊 */
}
.lf-theme-modern .lf-card-body {
    color: #333;
    background: #f5f5f7;
}
.lf-theme-modern .lf-card-poster-wrap {
    /* padding-right: 20px; 已移除以修复宽高比 */
}
.lf-theme-modern .lf-card-poster {
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15); /* 柔和阴影 */
    border: none;
}
.lf-theme-modern .lf-card-app-name {
    color: #007aff; /* iOS蓝色 */
    font-weight: 800;
    letter-spacing: 1px;
}
.lf-theme-modern .lf-card-title {
    color: #1d1d1f;
    text-shadow: none;
    font-weight: 900;
}
.lf-theme-modern .lf-card-meta-row {
    border-top: 2px solid #e5e5ea;
    border-bottom: 2px solid #e5e5ea;
    margin: 20px 0;
}
.lf-theme-modern .lf-card-author-name {
    color: #1d1d1f;
}
.lf-theme-modern .lf-card-author-label {
    color: #86868b;
}
.lf-theme-modern .lf-card-stats-val {
    color: #007aff;
}
.lf-theme-modern .lf-card-qr-box {
    background: #1d1d1f;
    color: #fff;
    border-radius: 8px;
}
.lf-theme-modern .lf-card-qr-text {
    color: #fff;
}
.lf-theme-modern .lf-card-footer-text {
    color: #86868b;
}

/* --- 3. Cyberpunk 赛博朋克 --- */
.lf-theme-cyberpunk {
    background-color: #050505 !important;
    position: relative; /* 确保伪元素可以正确定位 */
    /* 移除旧的 border 属性 */
}

/* 使用伪元素创建更可靠且视觉效果更佳的边框 */
.lf-theme-cyberpunk::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #00f3ff;
    box-shadow: 0 0 10px #00f3ff, inset 0 0 10px #00f3ff;
    pointer-events: none; /* 确保伪元素不会干扰鼠标事件 */
    z-index: 15; /* 确保边框在最上层 */
}

.lf-theme-cyberpunk::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 0; height: 0;
    border-top: 60px solid #fcee0a;
    border-right: 60px solid transparent;
    z-index: 10;
}
.lf-theme-cyberpunk .lf-card-bg {
    filter: grayscale(100%) contrast(1.2) brightness(0.3);
    opacity: 0.5;
}
.lf-theme-cyberpunk .lf-card-overlay {
    background: 
        linear-gradient(90deg, rgba(5,5,5,0.9) 0%, rgba(5,5,5,0.7) 100%),
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 243, 255, 0.05) 3px);
    z-index: 1;
}
.lf-theme-cyberpunk .lf-card-body {
    font-family: "Courier New", monospace; /* 代码风格字体 */
    color: #00f3ff;
}
.lf-theme-cyberpunk .lf-card-poster {
    border: 2px solid #fcee0a;
    box-shadow: 5px 5px 0px #00f3ff;
    filter: contrast(1.1) saturate(1.2);
}
.lf-theme-cyberpunk .lf-card-title {
    color: #fcee0a;
    text-shadow: 2px 2px 0px #ff003c;
    font-family: "Courier New", monospace;
    text-transform: uppercase;
}
.lf-theme-cyberpunk .lf-card-app-name {
    color: #ff003c;
    text-shadow: 0 0 5px #ff003c;
    background: #000;
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #ff003c;
}
.lf-theme-cyberpunk .lf-card-meta-row {
    border-top: 1px dashed #00f3ff;
    border-bottom: 1px dashed #00f3ff;
}
.lf-theme-cyberpunk .lf-card-author-name { color: #fff; text-shadow: 0 0 5px #fff; }
.lf-theme-cyberpunk .lf-card-stats-val { color: #fcee0a; }
.lf-theme-cyberpunk .lf-card-qr-box {
    background: #fcee0a;
    border: 2px solid #000;
    box-shadow: 3px 3px 0 #00f3ff;
    color: #000;
}
.lf-theme-cyberpunk .lf-card-qr-text { color: #000; font-weight: 900; }

/* --- 4. Minimalist 极简黑白 --- */
.lf-theme-minimalist {
    background-color: #111 !important;
}
.lf-theme-minimalist .lf-card-bg, .lf-theme-minimalist .lf-card-overlay {
    display: none;
}
.lf-theme-minimalist .lf-card-body {
    background: #111;
    color: #fff;
    font-family: "Georgia", serif; /* 衬线字体 */
}
.lf-theme-minimalist .lf-card-poster {
    border: none;
    filter: grayscale(100%); /* 图片黑白 */
    transition: filter 0.2s;
}
.lf-theme-minimalist .lf-card-avatar {
    filter: grayscale(100%);
}
.lf-theme-minimalist .lf-card-app-name {
    color: #fff;
    font-family: sans-serif;
    font-size: 10px;
    letter-spacing: 3px;
    border: 1px solid #fff;
    padding: 4px 10px;
    display: inline-block;
}
.lf-theme-minimalist .lf-card-title {
    font-weight: normal;
    font-style: italic;
    letter-spacing: -0.5px;
}
.lf-theme-minimalist .lf-card-meta-row {
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
}
.lf-theme-minimalist .lf-card-author-name { font-weight: normal; }
.lf-theme-minimalist .lf-card-stats-val { color: #fff; font-family: sans-serif; }
.lf-theme-minimalist .lf-card-qr-box { background: #fff; padding: 5px; }
.lf-theme-minimalist .lf-card-qr-text { color: #000; font-family: sans-serif; }


/* --- 通用内部布局 --- */
.lf-card-body {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    padding: 30px; /* 减小内边距 */
    box-sizing: border-box;
    gap: 30px;
}

/* 左侧图片容器 */
.lf-card-poster-wrap {
    width: 290px; /* 350px 高度 - 60px 内边距 = 290px 正方形 */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lf-card-poster {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 填满容器 */
    background: #000;
}

/* 右侧信息 */
.lf-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0; /* 防止文本溢出 */
}

.lf-card-header {
    margin-bottom: 15px;
}
.lf-card-app-name {
    text-transform: uppercase;
    font-size: 12px;
    margin-bottom: 8px;
    font-weight: bold;
    letter-spacing: 1px;
    white-space: nowrap;
}
.lf-card-title {
    font-size: 28px; /* 字体调小适应高度 */
    line-height: 1.2;
    font-weight: bold;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 5px;
}

.lf-card-meta-row {
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 20px 0;
    padding: 15px 0;
}

.lf-card-author-box {
    display: flex;
    align-items: center;
    gap: 12px;
}
.lf-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 4px;
}
.lf-card-author-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 150px;
}
.lf-card-author-label { font-size: 10px; text-transform: uppercase; opacity: 0.7; margin-bottom: 2px; }
.lf-card-author-name { font-size: 16px; font-weight: bold; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; }

.lf-card-stats {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.lf-card-stats-label { font-size: 10px; text-transform: uppercase; opacity: 0.7; margin-bottom: 2px; }
.lf-card-stats-val { font-size: 18px; font-weight: bold; line-height: 1.2; }

.lf-card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}
.lf-card-footer-text {
    font-size: 11px;
    opacity: 0.6;
    line-height: 1.4;
}

.lf-card-qr-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: 4px;
}
.lf-card-qr {
    width: 60px;
    height: 60px;
    display: block; /* 消除img下间隙 */
}
.lf-card-qr-text {
    font-size: 10px;
    line-height: 1.3;
    font-weight: bold;
    text-transform: uppercase;
    width: 60px; 
}


/* 右侧控制栏 */
.lf-share-sidebar {
    width: 300px;
    background: #101822;
    padding: 20px;
    border-left: 1px solid #000;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 10;
}
.lf-control-group label { display: block; margin-bottom: 8px; color: #66c0f4; font-size: 13px; font-weight: bold;}
.lf-control-select { width: 100%; padding: 8px; background: #1b2838; border: 1px solid #2a475e; color: #fff; border-radius: 3px; }
.lf-share-btn-action {
    background: linear-gradient(to right, #47bfff 0%, #1a44c2 100%);
    border: none;
    color: #fff;
    padding: 12px;
    width: 100%;
    cursor: pointer;
    font-size: 16px;
    border-radius: 2px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    transition: filter 0.2s;
}
.lf-share-btn-action:hover { filter: brightness(1.1); }
.lf-share-btn-action:disabled { background: #333; color: #888; cursor: not-allowed; }

/* --- 用户信息模态框样式 --- */
.lf-user-info-card {
    background: #101822;
    padding: 20px;
    border-radius: 4px;
    color: var(--steam-text-main);
}

.lf-user-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.lf-user-avatar {
    width: 120px;
    height: 120px;
    border: 3px solid var(--steam-border);
    border-radius: 4px;
}

.lf-user-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.lf-user-name {
    font-size: 24px;
    color: #fff;
    font-weight: normal;
}

.lf-user-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 12px;
    width: fit-content;
}
.lf-status-online { color: #8bc34a; border: 1px solid #8bc34a; }
.lf-status-offline { color: #8f98a0; border: 1px solid #8f98a0; }
.lf-status-ingame { color: #90ba3c; border: 1px solid #90ba3c; }

.lf-user-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.lf-user-stat-item {
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-left: 2px solid var(--steam-text-blue);
}

.lf-user-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--steam-text-dim);
    margin-bottom: 2px;
}

.lf-user-stat-value {
    color: var(--steam-text-blue);
    font-size: 13px;
    word-break: break-all;
}

.lf-user-files-section {
    margin-top: 20px;
    border-top: 1px solid var(--steam-border);
    padding-top: 20px;
}

.lf-user-files-toggle {
    background: #2a475e;
    color: #fff;
    border: 1px solid #000;
    padding: 10px 20px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.lf-user-files-toggle:hover {
    background: #3d5f7a;
}

.lf-user-files-container {
    display: none;
    margin-top: 15px;
}
.lf-user-files-container.open {
    display: block;
}

@media (max-width: 600px) {
    .lf-user-header {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .lf-user-avatar {
        margin: 0 auto;
    }
    .lf-user-status {
        margin: 0 auto;
    }
}
