/* ==========================================================================
   资源团 · 会员制资源分享站
   版式参考：首页网格（图1） / 分页与页脚（图2） / 详情页（图3）
   ========================================================================== */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #ebedf2;
  --line-2: #e2e6ed;
  --text: #14171d;
  --text-2: #4b5262;
  --muted: #8a93a2;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eef4ff;
  --red: #e5484d;
  --red-soft: #fff1f1;
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1140px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 10px 28px -18px rgba(16, 24, 40, 0.22);
  --shadow-hover: 0 2px 4px rgba(16, 24, 40, 0.04), 0 22px 44px -20px rgba(16, 24, 40, 0.3);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 320px at 50% -140px, #ffffff 0%, rgba(255, 255, 255, 0) 70%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; outline: none; }
::selection { background: rgba(37, 99, 235, 0.16); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ------------------------------------------------------------------ 顶部导航 */

.site-header {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(226, 230, 237, 0.8);
  position: sticky;
  top: 0;
  z-index: 60;
}

.header-top {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.logo {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #0f1218;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 9px;
}
.logo::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(150deg, #3b82f6 0%, #2563eb 55%, #1e40af 100%);
  box-shadow: 0 4px 10px -3px rgba(37, 99, 235, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.main-nav a {
  font-size: 14px;
  color: #4b5262;
  height: 32px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.main-nav a:hover { color: #14171d; background: #f2f4f7; }

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 头部搜索组 */
.hsearch {
  display: flex;
  align-items: center;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f2f4f8;
  overflow: hidden;
  transition: background 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.hsearch:focus-within {
  background: #fff;
  border-color: #c9d8fb;
  box-shadow: var(--ring);
}
.hsearch input {
  width: 200px;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0 6px 0 16px;
  font-size: 13.5px;
  color: var(--text);
}
.hsearch input::placeholder { color: #9aa3b2; }
.hsearch button {
  height: 100%;
  width: 38px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  color: #7b8494;
}
.hsearch button:hover { color: var(--blue); }

/* 移动端搜索：默认隐藏（桌面用 .hsearch），≤680px 由放大镜按钮展开搜索条 */
.msearch { display: none; }
.msearch-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f2f4f8;
  color: #5c6573;
  cursor: pointer;
  flex: none;
}
.msearch-btn.on { color: var(--blue); background: var(--blue-soft); }
.msearch-form { display: flex; gap: 8px; padding: 10px 20px 4px; }
.msearch-form input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: #f7f8fa;
  padding: 0 16px;
  font-size: 14px;
  outline: none;
}
.msearch-form input:focus { border-color: #c9d8fb; background: #fff; box-shadow: var(--ring); }
.msearch-form button {
  flex: none;
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.msearch-form button:active { opacity: 0.85; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.16s, border-color 0.16s, color 0.16s, box-shadow 0.16s, transform 0.16s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #3b7bff, var(--blue));
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(37, 99, 235, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover { background: linear-gradient(180deg, #2f6ef5, var(--blue-dark)); }
.btn-ghost { background: #fff; border-color: var(--line-2); color: #333a45; }
.btn-ghost:hover { border-color: #c9d8fb; color: var(--blue); }
.btn-outline { background: #fff; border-color: #d7dbe3; color: #333a45; }
.btn-outline:hover { border-color: #c9d8fb; color: var(--blue); }
.btn-sm { height: 32px; padding: 0 13px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* 登录态 */
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px 0 5px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: #fff;
  position: relative;
  cursor: pointer;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.user-chip:hover { border-color: #c9d2e3; box-shadow: var(--shadow); }
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  background: linear-gradient(160deg, #60a5fa, #2563eb);
  flex: none;
}
.user-chip .uname { font-size: 13px; color: #333a45; max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
.badge-vip {
  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe08a, #f5a623);
  color: #6a3d00;
  font-weight: 600;
}
.badge-free {
  font-size: 11px;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  background: #f1f3f6;
  color: #8b93a1;
}

.dropdown {
  position: absolute;
  right: 0;
  top: 46px;
  width: 184px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px -16px rgba(16, 24, 40, 0.28), 0 2px 6px rgba(16, 24, 40, 0.06);
  padding: 6px;
  display: none;
  z-index: 80;
}
.dropdown.open { display: block; }
.dropdown a,
.dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border: 0;
  background: transparent;
  border-radius: 9px;
  font-size: 13px;
  color: #3b424e;
}
.dropdown a:hover,
.dropdown button:hover { background: #f4f6fa; color: var(--blue); }
.dropdown .sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* 第二行：分类标签行 */
.header-tags {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.catnav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.catnav::-webkit-scrollbar { display: none; }
/* 标签溢出时右缘渐隐，暗示还有内容可横向滑动；滑到末尾时取消，避免末项被淡 */
.catnav.can-scroll { mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent 100%); }
.catnav.can-scroll.at-end { mask-image: none; }
.catnav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: #4a5261;
  white-space: nowrap;
  transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}
.catnav a:hover { color: #14171d; background: #f2f4f8; }
.catnav a:focus-visible { outline: none; box-shadow: var(--ring); }
/* 当前分类：实心蓝胶囊，一眼看出「你在这」；浅底版本会像 hover 态，撑不起焦点 */
.catnav a.active {
  color: #fff;
  font-weight: 600;
  background: linear-gradient(180deg, #3b7bff, var(--blue));
  box-shadow: 0 4px 10px -4px rgba(37, 99, 235, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
/* 免费资源用绿色标出，但压一档饱和度，不能比当前项更抢眼 */
.catnav a.is-free { color: #0b8a4b; }
.catnav a.is-free:hover { color: #07713d; background: #eef8f3; }
.catnav a.is-free.active {
  color: #fff;
  background: linear-gradient(180deg, #12a862, #0b8a4b);
  box-shadow: 0 4px 10px -4px rgba(11, 138, 75, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

/* ------------------------------------------------------------------ 内容面板 */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* 结果条 */
.result-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px 6px;
  font-size: 14px;
  color: #333a45;
}
.result-bar .label { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.result-bar .divider { width: 1px; height: 14px; background: var(--line-2); }
.result-bar .keyword { color: var(--red); }
.result-bar .sub { color: var(--muted); font-size: 13px; margin-left: auto; }

/* ------------------------------------------------------------------ 卡片网格 */

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 22px 24px 26px;
}

.card {
  background: #fff;
  border: 1px solid #eef0f5;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}
.card:hover {
  border-color: #e3e8f2;
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.card-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #f2f4f8;
  overflow: hidden;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-cover img { transform: scale(1.03); }
.card-cover .corner {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 9px;
  font-size: 11px;
  line-height: 1.6;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #3b4453;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  letter-spacing: 0.2px;
}
.card-cover .free-tag {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 3px 9px;
  font-size: 11px;
  line-height: 1.6;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #0b7d45;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px -6px rgba(15, 157, 88, 0.9), inset 0 0 0 1px rgba(15, 157, 88, 0.18);
}
.card-body { padding: 13px 15px 15px; display: flex; flex-direction: column; flex: 1; }

.card-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: #14171d;
  height: 42px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
  letter-spacing: -0.005em;
}
.card:hover .card-title { color: var(--blue); }

.card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: #9aa3b0;
  padding-bottom: 11px;
}
.card-meta .cat {
  color: #5b6474;
  white-space: nowrap;
  flex: none;
  background: #f4f6fa;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 11.5px;
}
.card-meta .spacer { flex: 1; }
.card-meta .stat { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; flex: none; }

.card-foot {
  margin-top: auto;
  border-top: 1px solid #f2f4f7;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #98a1ae;
}
.card-foot .avatar { width: 19px; height: 19px; font-size: 10px; }
.card-foot .time { margin-left: auto; }

.empty {
  grid-column: 1 / -1;
  padding: 78px 0;
  text-align: center;
  color: var(--muted);
}
.empty b { display: block; font-size: 15px; color: #4b5262; margin-bottom: 6px; font-weight: 500; }

/* ------------------------------------------------------------------ 分页 */

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px 22px;
  border-top: 1px solid #f3f5f8;
}
/* 只有一页时 pager 为空，整块隐藏，避免卡片下方留一条空白带 */
.pager:empty { display: none; }
.pager .pages { display: flex; align-items: center; gap: 8px; }
.pager .pg {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #eaedf3;
  border-radius: 9px;
  color: #59616e;
  font-size: 13px;
  transition: border-color 0.16s, color 0.16s, background 0.16s;
}
.pager .pg:hover { border-color: #c9d8fb; color: var(--blue); background: #fbfcff; }
.pager .pg.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 14px -8px rgba(37, 99, 235, 0.9);
}
.pager .pg.disabled { color: #c8cdd6; pointer-events: none; }
.pager .dots { color: #b7bdc7; padding: 0 2px; }
.pager .jump {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  color: #8b93a1;
  font-size: 13px;
}
.pager .jump input {
  width: 48px;
  height: 34px;
  text-align: center;
  border: 1px solid #eaedf3;
  border-radius: 9px;
  color: #333a45;
}
.pager .jump input:focus { border-color: #c9d8fb; box-shadow: var(--ring); }
.pager .navs { margin-left: auto; display: flex; gap: 10px; }
.pager .nav-btn {
  width: 36px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid transparent;
  background: #f3f6fe;
  color: var(--blue);
  transition: background 0.16s;
}
.pager .nav-btn:hover { background: #e7eefe; }
.pager .nav-btn.disabled { background: #f5f6f9; color: #c8cdd6; pointer-events: none; }

/* ------------------------------------------------------------------ 页脚 */

.site-footer {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 24px 20px 46px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #6b7482;
  font-size: 13px;
}
.site-footer .right { margin-left: auto; color: #99a1ae; }

/* ------------------------------------------------------------------ 详情页 */

.detail-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 26px 20px 64px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.action-rail {
  position: sticky;
  top: 130px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 50px;
  flex: none;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding-bottom: 11px;
}
.rail-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #6b7482;
  display: grid;
  place-items: center;
  transition: background 0.16s, color 0.16s;
  position: relative;
}
.rail-btn:hover { color: var(--blue); background: #f3f6fe; }
.rail-btn.on { color: var(--red); background: #fff1f1; }
.rail-btn.on svg { fill: currentColor; }
.rail-btn .count {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #8b93a1;
  background: transparent;
  white-space: nowrap;
}
.rail-btn.has-count { margin-bottom: 13px; }

.article {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 34px 38px;
  box-shadow: var(--shadow);
}

.article h1 {
  font-size: 26px;
  line-height: 1.4;
  margin: 0 0 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #101319;
  word-break: break-word;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: #98a1ae;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f3f7;
  flex-wrap: wrap;
}
.article-meta .tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 500;
}
.article-meta .tag.free {
  background: #e8f7ef;
  color: #0b7d45;
}
.article-meta .stat { display: inline-flex; align-items: center; gap: 4px; }
.article-meta .btn-download {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 15px;
  border: 1px solid #cddbfa;
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.article-meta .btn-download:hover {
  background: var(--blue-soft);
  border-color: #b6cbf8;
  box-shadow: 0 6px 14px -10px rgba(37, 99, 235, 0.8);
}

/* 手机端收藏按钮（左侧悬浮栏在窄屏被隐藏） */
.btn-fav-m {
  display: none;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid #e4e7ed;
  border-radius: 999px;
  background: #fff;
  color: #4b5262;
  font-size: 12px;
}
.btn-fav-m:hover { color: var(--red); border-color: #ffd6d6; }
.btn-fav-m.on { color: var(--red); border-color: #ffd6d6; background: #fff7f7; }
.btn-fav-m.on svg { fill: currentColor; }

.article-desc {
  padding: 20px 0 4px;
  font-size: 14px;
  color: #3b424e;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
}

.article-cover {
  margin: 16px 0 4px;
  border-radius: 12px;
  overflow: hidden;
  background: #f2f4f8;
  border: 1px solid #f0f2f6;
}
.article-cover img { width: 100%; max-height: 340px; object-fit: cover; }

/* 下载区（左右两栏） */
.download-zone {
  display: grid;
  grid-template-columns: 216px 1fr;
  gap: 28px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #f1f3f7;
}

.perm-card {
  background: #f8fafc;
  border: 1px solid #eef1f6;
  border-radius: 12px;
  padding: 15px 17px 9px;
  align-self: start;
}
.perm-card .perm-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: #333a45;
  font-weight: 600;
  margin-bottom: 8px;
}
.perm-rows { display: flex; flex-direction: column; }
.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 13px;
  color: #5b6472;
  border-bottom: 1px dashed #e9edf3;
}
.perm-row:last-child { border-bottom: 0; }
.perm-row > span { white-space: nowrap; }
.perm-row .val { color: #0f9d58; }
.perm-row .val.locked { color: #b0b7c2; }
.perm-row .val.free { color: #0f9d58; font-weight: 600; }

.dl-main .dl-title {
  font-size: 19px;
  font-weight: 600;
  color: #14171d;
  margin: 0 0 14px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.notice-box {
  border: 1px solid #eef1f6;
  background: #fafbfd;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 12.5px;
  color: #7b8492;
  line-height: 1.95;
  margin-bottom: 16px;
}
.notice-box ol { margin: 0; padding-left: 16px; }
.notice-box li { margin-bottom: 2px; }
.notice-box b { color: #5b6472; font-weight: 600; }

.state-box {
  border: 1px solid #f6d4d4;
  background: #fff9f9;
  border-radius: 12px;
  padding: 15px 17px;
  font-size: 13px;
  color: #c05353;
  margin-bottom: 16px;
}
.state-box .row { display: flex; align-items: center; gap: 8px; }
.state-box .row + .row { margin-top: 4px; }
.state-box .level { color: #8b93a1; }
.state-box .strong { color: #d04545; font-weight: 600; }
.state-box a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.state-box.member {
  border-color: #d6ecdf;
  background: #f7fdf9;
  color: #2f8a5b;
}
.state-box.member .strong { color: #237a4b; }
.state-box.free {
  border-color: #d6ecdf;
  background: #f7fdf9;
  color: #2f8a5b;
}
.state-box.free .strong { color: #237a4b; }

.btn-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #3b7bff, var(--blue));
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 8px 18px -10px rgba(37, 99, 235, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: background 0.16s, transform 0.16s;
}
.btn-dl:hover { background: linear-gradient(180deg, #2f6ef5, var(--blue-dark)); }
.btn-dl:active { transform: translateY(1px); }
.btn-dl[disabled] { background: #c3ccdb; cursor: not-allowed; box-shadow: none; }

/* 评论区 */
.comments { margin-top: 36px; padding-top: 24px; border-top: 1px solid #f1f3f7; }
.comments h3 { font-size: 16px; margin: 0 0 16px; font-weight: 600; letter-spacing: -0.01em; }
.comment-form { display: flex; gap: 10px; margin-bottom: 20px; }
.comment-form textarea {
  flex: 1;
  min-height: 70px;
  resize: vertical;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.7;
  background: #fbfcfe;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}
.comment-form textarea:focus { border-color: #c9d8fb; background: #fff; box-shadow: var(--ring); }
.comment-list { display: flex; flex-direction: column; }
.comment {
  display: flex;
  gap: 11px;
  padding: 14px 0;
  border-bottom: 1px solid #f5f7fa;
}
.comment:last-child { border-bottom: 0; }
.comment .body { flex: 1; }
.comment .who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #4b5462; }
.comment .who .time { margin-left: auto; color: #b0b7c2; font-size: 12px; }
.comment .txt { font-size: 13.5px; color: #3b424e; margin-top: 4px; white-space: pre-wrap; }

/* ------------------------------------------------------------------ 会员页 */

.page-head {
  padding: 44px 20px 8px;
  text-align: center;
}
.page-head h1 { font-size: 30px; margin: 0 0 10px; font-weight: 700; letter-spacing: -0.03em; }
.page-head p { color: #7b8492; margin: 0; font-size: 14px; }

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  padding: 32px 24px 32px;
  align-items: stretch;
}
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px 16px 18px;
  border: 1px solid #e8ecf4;
  border-radius: 18px;
  background: linear-gradient(180deg, #fdfdff, #fff 42%);
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.plan:hover {
  transform: translateY(-3px);
  border-color: #cfdcfb;
  box-shadow: 0 22px 44px -26px rgba(37, 99, 235, 0.55);
}
.plan.hot {
  border-color: #2563eb;
  background: linear-gradient(180deg, #f2f7ff, #fff 58%);
  box-shadow: 0 20px 44px -26px rgba(37, 99, 235, 0.5), 0 2px 8px -4px rgba(37, 99, 235, 0.25);
}
.plan.hot:hover {
  border-color: #2563eb;
  box-shadow: 0 26px 52px -28px rgba(37, 99, 235, 0.6), 0 2px 8px -4px rgba(37, 99, 235, 0.28);
}
.plan .ribbon {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: #6b7280;
  background: #fff;
  border: 1px solid #e2e7f0;
  box-shadow: 0 8px 16px -12px rgba(16, 24, 40, 0.55);
}
.plan.hot .ribbon {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #3b7bff, var(--blue));
  box-shadow: 0 10px 20px -10px rgba(37, 99, 235, 0.85);
}
.plan .pname { font-size: 14px; color: #4b5262; font-weight: 600; letter-spacing: 0.01em; }
.plan .price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  margin: 14px 0 4px;
  color: #0f1520;
}
.plan .price .cur { font-size: 15px; font-weight: 600; color: #5b6472; }
.plan .price .num {
  font-size: 40px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.plan.hot .price .num { color: #1d4ed8; }
.plan .unit { font-size: 12px; color: #98a1b0; }
.plan .pdesc {
  font-size: 12.5px;
  color: #8b93a1;
  margin: 14px 0 18px;
  min-height: 40px;
  line-height: 1.65;
}
.plan .btn {
  margin-top: auto;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 13.5px;
}

.vip-note {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 0 24px 26px;
}
.vip-note .item {
  background: #fafbfd;
  border: 1px solid #eef1f6;
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 13px;
  color: #5b6472;
}
.vip-note .item b { display: block; color: #14171d; font-size: 14px; margin-bottom: 4px; }

/* ------------------------------------------------------------------ 后台 */

.admin-wrap { max-width: 1080px; margin: 0 auto; padding: 20px 16px 60px; }
.admin-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.admin-bar h2 { font-size: 16px; margin: 0; }
.admin-bar .spacer { flex: 1; }
.admin-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.admin-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.admin-panel h3 { font-size: 15px; margin: 0 0 14px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; color: #6b7482; margin-bottom: 5px; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13.5px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #b9cdf8; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th {
  text-align: left;
  font-weight: 500;
  color: #8b93a1;
  font-size: 12px;
  padding: 0 8px 8px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table td { padding: 9px 8px; border-bottom: 1px solid #f5f7fa; color: #3b424e; white-space: nowrap; }
.admin-table tr:hover td { background: #fafbfd; }
.admin-table .t { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-danger { color: #d04545; font-size: 12.5px; }

/* 后台：页签 / 用户权限 */
.admin-tag {
  font-size: 12px;
  color: #6b7482;
  border: 1px solid var(--line-2);
  padding: 2px 8px;
  border-radius: 8px;
}
.admin-input {
  height: 32px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 0 10px;
  width: 200px;
  font-size: 13px;
}
.admin-input:focus { border-color: #b9cdf8; }
.admin-tabs {
  display: flex;
  gap: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 18px;
  margin-bottom: 16px;
}
.admin-tabs a {
  padding: 13px 0;
  font-size: 14px;
  color: #4b5462;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.admin-tabs a:hover { color: var(--blue); }
.admin-tabs a.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.admin-note {
  background: #fafbfc;
  border: 1px solid #f0f2f5;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #6b7482;
  line-height: 1.85;
  margin-bottom: 14px;
}
.admin-note b { color: #333a45; }
.admin-hint { font-size: 12px; color: #98a1ae; margin: 10px 0 0; line-height: 1.7; }
#catHint { margin: -2px 0 10px; }

/* 新增资源 · 单个/批量 小 Tab */

.mini-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: #f2f4f8;
  border-radius: 10px;
  margin: 2px 0 16px;
}
.mini-tabs a {
  padding: 6px 15px;
  border-radius: 8px;
  font-size: 13px;
  color: #5b6474;
  transition: background 0.16s, color 0.16s;
}
.mini-tabs a:hover { color: #14171d; }
.mini-tabs a.active {
  background: #fff;
  color: var(--blue);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

/* 批量导入预览表 */

#batchTable th, #batchTable td { font-size: 12px; padding: 6px 8px; }
#batchTable td.bname { color: #98a1ae; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#batchTable td.btitle { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#batchTable .st-ok { color: #0f9d58; white-space: nowrap; }
#batchTable .st-warn { color: #c07f00; white-space: nowrap; }
#batchTable .st-err { color: #d23c3c; white-space: nowrap; }
#batchTable .breason { color: #d23c3c; }
#batchTable .bremove { color: #98a1ae; cursor: pointer; }
#batchTable .bremove:hover { color: #d23c3c; }

/* 新增资源 · 封面上传 */
.cover-pick {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  background: #fafbfc;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}
.cover-pick:hover,
.cover-pick:focus-visible {
  border-color: #b9cdf8;
  background: #f6f9ff;
  outline: none;
}
.cover-pick.has-img { border-style: solid; border-color: var(--line-2); }
.cover-pick [hidden] { display: none !important; }
.cover-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px;
  text-align: center;
  color: #98a1ae;
}
.cover-empty b { font-size: 13px; font-weight: 500; color: #5b6472; }
.cover-empty em { font-style: normal; font-size: 12px; }
.cover-plus { font-size: 22px; line-height: 1; color: #b3bcc8; }
.cover-clear {
  position: absolute;
  right: 8px;
  top: 8px;
  padding: 2px 8px;
  font-size: 12px;
  line-height: 1.7;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}
.cover-clear:hover { background: rgba(0, 0, 0, 0.72); }
.pill-free {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  font-size: 11px;
  line-height: 16px;
  border-radius: 8px;
  background: #e8f7ef;
  color: #0f9d58;
}

.user-cell { display: flex; align-items: center; gap: 8px; }
.user-cell .avatar { width: 24px; height: 24px; font-size: 11px; }
.role-pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 8px;
  background: #f1f3f6;
  color: #6b7482;
}
.role-pill.admin { background: #eef3ff; color: var(--blue); }
.status-off { color: #d04545; font-size: 11px; margin-left: 6px; }
.membership-cell { font-size: 12.5px; color: #5b6472; }
.membership-cell .exp { color: #98a1ae; font-size: 11.5px; display: block; }
.membership-cell .vip { color: #c8850a; font-weight: 600; }
.admin-table .acts { text-align: right; white-space: nowrap; }
.act {
  font-size: 12.5px;
  color: var(--blue);
  margin-left: 10px;
  cursor: pointer;
  white-space: nowrap;
}
.act:hover { text-decoration: underline; }
.act.danger { color: #d04545; }
.act.muted { color: #c3c9d3; cursor: not-allowed; text-decoration: none; }

.plan-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.plan-picker button {
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 10px;
  padding: 8px 6px;
  font-size: 12.5px;
  color: #3b424e;
  line-height: 1.5;
}
.plan-picker button:hover { border-color: var(--blue); color: var(--blue); background: #fafcff; }
.plan-picker button b { display: block; color: #1c1f26; font-size: 13px; }
.tag-pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 8px;
  background: #f1f3f6;
  color: #6b7482;
}

/* ------------------------------------------------------------------ 卡密兑换 / 支付结果 */

.gift-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7482;
  padding: 14px 20px 0;
  cursor: pointer;
  user-select: none;
}
.gift-toggle input { width: 15px; height: 15px; accent-color: var(--blue); cursor: pointer; }

.card-redeem { display: flex; gap: 10px; flex-wrap: wrap; }
.card-redeem input {
  flex: 1;
  min-width: 200px;
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.5px;
  color: var(--text);
}
.card-redeem input:focus { outline: none; border-color: #b9cdf8; }
.card-hint { font-size: 12.5px; color: #a3aab6; margin: 10px 0 0; line-height: 1.7; }

.pay-result {
  margin-top: 18px;
  border-radius: 6px;
  padding: 14px 18px;
  font-size: 13.5px;
  line-height: 1.8;
  border: 1px solid #cfe3ff;
  background: #f2f7ff;
  color: #2b4a7a;
}
.pay-result.ok { border-color: #c7ebd4; background: #f1fbf5; color: #1a6b3c; }
.pay-result.err { border-color: #f3cdcd; background: #fdf3f3; color: #a33a3a; }
.pay-result .code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 1px;
  background: #fff;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px dashed #bcd6f7;
  display: inline-block;
}
.pay-result a { color: var(--blue); }

/* ------------------------------------------------------------------ 弹窗 */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(18, 24, 38, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-mask.open { display: flex; }
.modal {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 70px -24px rgba(15, 22, 38, 0.4), 0 2px 8px rgba(15, 22, 38, 0.06);
  padding: 26px 26px 22px;
  position: relative;
  animation: pop 0.18s ease-out;
}
.modal.wide { max-width: 520px; }
.modal.edit-res {
  max-width: 560px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
/* 弹窗里的封面框压矮一点，小屏也能一屏看到「保存 / 取消」 */
.modal.edit-res .cover-pick {
  aspect-ratio: auto;
  height: 140px;
}
/* 保存 / 取消吸底：表单再长也不用滚到底才能提交 */
.modal.edit-res .modal-actions {
  position: sticky;
  bottom: -22px;
  margin-top: 14px;
  padding: 12px 0;
  background: #fff;
  border-top: 1px solid var(--line);
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}
.modal-actions .btn { min-width: 84px; }
@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal h3 { margin: 0 0 4px; font-size: 18px; }
.modal .sub { color: #8b93a1; font-size: 13px; margin: 0 0 18px; }
.modal .close {
  position: absolute;
  right: 14px;
  top: 12px;
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: #b0b7c2;
}
.modal .close:hover { color: #5b6472; }
.modal .field input { height: 40px; }
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-img {
  flex: 0 0 116px;
  width: 116px;
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  overflow: hidden;
  background: #f7f9fc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  color: #9aa3b1;
  user-select: none;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.captcha-img:hover { border-color: #b9cdf8; }
.captcha-img svg { display: block; width: 100%; height: 100%; }
.captcha-img.loading { opacity: 0.45; }
.captcha-img.failed { border-color: #f0c2c6; color: #e6424b; }
.captcha-hint { font-size: 11.5px; color: #a3aab6; margin-top: 5px; }
.modal-switch { text-align: center; font-size: 13px; color: #8b93a1; margin-top: 14px; }
.modal-switch a { color: var(--blue); cursor: pointer; }

.order-summary {
  background: #fafbfc;
  border: 1px solid #f0f2f5;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  color: #5b6472;
  margin-bottom: 16px;
}
.order-summary .line { display: flex; justify-content: space-between; padding: 3px 0; }
.order-summary .line b { color: #1c1f26; }
.order-summary .total { border-top: 1px dashed #e6e9ef; margin-top: 6px; padding-top: 8px; }
.order-summary .total .amount { color: #e6424b; font-size: 18px; font-weight: 700; }

.dl-links { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.dl-link {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: #3b424e;
  background: #fff;
}
.dl-link:hover { border-color: #b9cdf8; background: #fafcff; }
.dl-link .name { font-weight: 600; }
.dl-link .code { color: #8b93a1; }
.dl-link .dl-acts {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.dl-link .copy {
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 12px;
  color: #5b6472;
  line-height: 1.5;
  white-space: nowrap;
}
.dl-link .copy:hover { border-color: var(--blue); color: var(--blue); }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  top: 84px;
  transform: translateX(-50%) translateY(-10px);
  background: rgba(28, 33, 43, 0.92);
  color: #fff;
  padding: 9px 18px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s;
  z-index: 300;
  max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ------------------------------------------------------------------ 响应式 */

/* ------------------------------------------------------------------ 教程正文 */

/* 字数多的说明页收窄行宽，长行最难读 */
.prose {
  max-width: 820px;
  margin: 0 auto;
  padding: 38px 40px 46px;
  font-size: 14.5px;
  line-height: 2;
  color: #3b4453;
}
.prose h1 {
  font-size: 26px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #101319;
  margin: 0 0 10px;
}
.prose .prose-sub { color: #8a93a2; margin: 0 0 24px; }
.prose h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #14171d;
  margin: 30px 0 10px;
  padding-left: 11px;
  border-left: 3px solid var(--blue);
  line-height: 1.5;
}
.prose p { margin: 0 0 6px; color: #4b5262; }
.prose b { color: #14171d; }

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .plans { grid-template-columns: repeat(2, 1fr); }
  .vip-note { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: 1fr; }
  .header-top { gap: 14px; }
  .main-nav { display: none; }
  .download-zone { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 14px; }
  .catnav { gap: 2px; }
  .catnav a { font-size: 13px; padding: 0 11px; }
  .hsearch { display: none; }
  .msearch-btn { display: inline-flex; }
  .msearch.open {
    display: block;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }
  .logo { font-size: 18px; gap: 7px; }
  .logo::before { width: 19px; height: 19px; border-radius: 6px; }
  .header-top { height: 58px; gap: 10px; }
  .header-tags { height: 48px; }
  .btn { padding: 0 13px; }
  .card-meta { gap: 9px; }
  .card-meta .cat { display: none; }
  .result-bar { padding: 16px 16px 4px; }
  .detail-main { padding: 16px 12px 40px; gap: 12px; }
  .action-rail { display: none; }
  .btn-fav-m { display: inline-flex; }
  .article { padding: 22px 17px 28px; border-radius: 14px; }
  .article h1 { font-size: 20px; }
  .track, .detail-main { max-width: 100%; }
  .pager { flex-wrap: wrap; padding: 20px 16px 22px; }
  .pager .jump { margin-left: 0; }
  .site-footer { padding: 18px 16px 32px; font-size: 12px; }
  .page-head { padding: 30px 16px 6px; }
  .page-head h1 { font-size: 24px; }
  .plans { padding: 20px 16px 24px; }
  .prose { padding: 26px 20px 32px; }
  .prose h1 { font-size: 21px; }
  .prose h2 { font-size: 16px; margin-top: 26px; }
  .vip-note { padding: 0 16px 22px; }
}

@media (max-width: 430px) {
  .user-chip .uname { display: none; }
  .user-chip { padding: 0 6px 0 3px; }
  .card-body { padding: 11px 12px 12px; }
  .card-meta { gap: 8px; font-size: 11.5px; }
  .card-title { font-size: 13px; height: 39px; }
  .card-cover .corner { left: 7px; bottom: 7px; }
  .card-cover .free-tag { right: 7px; top: 7px; }
}
