/* ============================================================
   源码社 SourceHub —— 设计系统
   浅色底 + 绿色主调，参考传统源码站布局做现代化改良
   ============================================================ */

:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #1b2430;
  --ink-2: #455160;
  --muted: #8b95a5;
  --line: #e6e9f0;
  --line-strong: #d6dbe5;

  --brand: #15a865;
  --brand-strong: #0c8f54;
  --brand-soft: #e7f7ef;
  --brand-ink: #0a5c38;

  --accent: #f59e0b;
  --accent-soft: #fef3e2;
  --danger: #e5484d;
  --danger-soft: #fdebec;
  --info: #3b82f6;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 10px 28px -14px rgba(16,24,40,.16);
  --shadow-lg: 0 24px 60px -24px rgba(10, 36, 24, .35);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas,
          "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::selection { background: rgba(21, 168, 101, .22); }

.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.app-main { flex: 1; }

/* ---------------- 通用组件 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px; font-weight: 600;
  line-height: 1.4;
  transition: background .18s ease, color .18s ease, border-color .18s ease,
              box-shadow .18s ease, transform .12s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); box-shadow: 0 6px 16px -6px rgba(21,168,101,.55); }
.btn-dark { background: var(--ink); color: var(--surface); }
.btn-dark:hover { background: #2c394a; }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--brand-strong); border-color: var(--brand); background: var(--brand-soft); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 13px; font-size: 13px; }
.btn-lg { padding: 12px 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag-cat { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.tag-lang { background: #f2f4f8; color: #3d4a5c; border-color: transparent; }
.tag-lang .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lang-color, var(--muted)); }
.tag-admin { background: #fff7e6; color: #b45309; border-color: transparent; }

.icon { width: 16px; height: 16px; flex: none; }

/* ---------------- 顶部导航 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  width: min(1280px, 100% - 40px);
  margin: 0 auto;
  height: 62px;
  display: flex; align-items: center; gap: 26px;
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand-mark {
  font-family: var(--mono);
  font-size: 13px; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  padding: 5px 8px; border-radius: 8px;
  letter-spacing: -.5px;
  box-shadow: 0 4px 10px -3px color-mix(in srgb, var(--brand) 55%, transparent);
}
.brand-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: contain; display: block; }
.brand-mark.has-logo { background: transparent; padding: 0; box-shadow: none; }
.brand-mark.has-logo .brand-sym { display: none; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: .5px; }
.brand-name em { font-style: normal; color: var(--brand); }

.mainnav { display: flex; gap: 4px; flex: 1; min-width: 0; }
.mainnav a {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14.5px; font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.mainnav a:hover { color: var(--brand-strong); background: var(--brand-soft); }
.mainnav a.active { color: var(--brand-strong); font-weight: 700; }

.nav-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 15px;
  width: 220px; flex: none;
  color: var(--muted);
  transition: border-color .15s, box-shadow .15s, width .2s;
}
.nav-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21,168,101,.12); width: 260px; }
.nav-search input { border: 0; background: none; outline: none; width: 100%; font-size: 13.5px; }
.nav-search input::-webkit-search-cancel-button { cursor: pointer; }

.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13.5px; font-weight: 600; font-family: inherit; color: var(--ink);
  cursor: pointer;
  transition: border-color .15s;
}
.user-chip:hover { border-color: var(--brand); }
.user-chip .uname { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .caret { font-size: 10px; color: var(--muted); }
.user-menu-wrap { position: relative; }
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 210;
  min-width: 208px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: none;
}
.user-menu-wrap.open .user-menu { display: block; }
.user-menu .um-head {
  padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
  display: flex; flex-direction: column; gap: 6px;
}
.user-menu .um-name { display: flex; align-items: center; gap: 7px; }
.user-menu .um-points { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #a16207; font-weight: 600; }
.user-menu .um-points svg { color: var(--accent); }
.user-menu a { display: block; padding: 8px 10px; border-radius: 8px; font-size: 13.5px; color: var(--ink-2); }
.user-menu a:hover { background: var(--surface-2); color: var(--brand); }
.user-menu a.um-danger { color: var(--danger); }
.user-menu a.um-danger:hover { background: var(--danger-soft); }
html[data-theme="night"] .user-menu .um-points { color: #f0c877; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #2bbf7e, #0c8f54);
  flex: none;
}
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }

.nav-toggle { display: none; background: none; border: 0; padding: 8px; }
.nav-toggle span { display: block; width: 21px; height: 2px; background: var(--ink); margin: 4px 0; border-radius: 2px; transition: .2s; }
.mobile-panel { display: none; border-top: 1px solid var(--line); padding: 12px 20px 16px; background: #fff; }
.mobile-panel.open { display: block; }
.mobile-search input {
  width: 100%; padding: 10px 15px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  outline: none; background: var(--surface-2);
}
.mobile-panel nav { display: flex; flex-direction: column; margin-top: 10px; }
.mobile-panel nav a { padding: 10px 6px; font-weight: 500; color: var(--ink-2); border-bottom: 1px solid var(--line); }

/* ---------------- 公告条 ---------------- */
.notice-bar {
  background: linear-gradient(90deg, #0f7a4b, #15a865);
  color: #eafff5;
  font-size: 13px;
}
.notice-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 7px 0;
  display: flex; align-items: center; gap: 10px;
}
.notice-inner .label {
  background: rgba(255,255,255,.18);
  padding: 1px 9px; border-radius: 5px;
  font-weight: 700; font-size: 12px; flex: none;
}
.notice-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .96; }
.notice-bar .close { margin-left: auto; background: none; border: 0; color: #d8f5e6; font-size: 16px; line-height: 1; flex: none; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  background: var(--hero-bg, radial-gradient(900px 420px at 12% -10%, rgba(21,168,101,.32), transparent 60%), radial-gradient(700px 380px at 92% 0%, rgba(45, 212, 160, .18), transparent 55%), linear-gradient(160deg, #0d2b20 0%, #081a13 70%, #06140f 100%));
  color: #eaf7f0;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 100% at 50% 0%, #000 30%, transparent 75%);
}
.hero-inner {
  position: relative;
  width: min(880px, calc(100% - 40px));
  margin: 0 auto;
  text-align: center;
  padding: 64px 0 58px;
}
.hero h1 {
  font-size: clamp(28px, 4.4vw, 42px);
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.25;
}
.hero h1 .hl {
  background: var(--hero-hl, linear-gradient(90deg, #4ade80, #34d399 60%, #6ee7b7));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  margin-top: 14px;
  color: rgba(220, 244, 232, .72);
  font-size: 16px;
}
.hero-search {
  margin: 30px auto 0;
  display: flex; gap: 8px;
  background: #fff;
  padding: 7px 7px 7px 20px;
  border-radius: 999px;
  max-width: 620px;
  box-shadow: var(--shadow-lg);
}
.hero-search input {
  flex: 1; border: 0; outline: none; min-width: 0;
  font-size: 15px; background: transparent;
}
.hero-hot {
  margin-top: 16px;
  font-size: 13px; color: rgba(220,244,232,.6);
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
}
.hero-hot a { color: var(--hero-link, #9fe8c6); }
.hero-hot a:hover { color: #fff; text-decoration: underline; }

.hero-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  width: min(880px, calc(100% - 40px));
  margin: -30px auto 0;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 14px;
  text-align: center;
}
.stat-num {
  font-family: var(--mono);
  font-size: 26px; font-weight: 700;
  color: var(--ink);
  letter-spacing: -.5px;
}
.stat-num em { font-style: normal; color: var(--brand); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------------- 列表区 ---------------- */
.list-section { padding: 42px 0 60px; }

/* 首页积分引导条（未登录） */
.points-strip {
  width: min(1180px, calc(100% - 40px));
  margin: 20px auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(90deg, #0f7a4b, #15a865);
  color: #eafff5; font-size: 13.5px; font-weight: 500;
  padding: 13px 20px; border-radius: 12px;
  box-shadow: 0 6px 18px -10px rgba(21,168,101,.55);
}
.points-strip b { color: #ffd97a; font-weight: 700; }
.points-strip .btn { flex: none; }
.points-strip svg.icon { width: 16px; height: 16px; vertical-align: -2px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.section-title {
  font-size: 22px; font-weight: 800;
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ""; width: 5px; height: 21px; border-radius: 3px;
  background: linear-gradient(var(--brand), var(--brand-strong));
}
.section-title small { font-size: 13px; font-weight: 500; color: var(--muted); }

.sort-tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.sort-tabs button {
  border: 0; background: none; padding: 6px 15px;
  border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--ink-2);
}
.sort-tabs button.active { background: var(--ink); color: var(--surface); }

.chip-row {
  display: flex; gap: 9px; flex-wrap: wrap;
  margin-bottom: 26px;
}
.chip {
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 500;
  color: var(--ink-2);
  transition: all .15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand-strong); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 5px 14px -5px color-mix(in srgb, var(--brand) 60%, transparent); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 20px;
}
.source-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.source-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
}
.card-cover {
  position: relative;
  height: 132px;
  background: linear-gradient(135deg, var(--cov-1, #2bbf7e), var(--cov-2, #0c8f54));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.card-cover::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 22px 22px;
}
.card-cover .brackets {
  font-family: var(--mono);
  font-size: 46px; font-weight: 700;
  color: rgba(255,255,255,.9);
  text-shadow: 0 6px 18px rgba(0,0,0,.18);
  position: relative;
}
.card-cover .cov-lang {
  position: absolute; right: 10px; bottom: 8px;
  font-family: var(--mono);
  font-size: 11px; font-weight: 700;
  color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.22);
  padding: 2px 8px; border-radius: 6px;
  letter-spacing: .5px;
}
.card-cover .cov-cat {
  position: absolute; left: 10px; top: 10px;
  font-size: 11.5px; font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,.25);
  padding: 2px 10px; border-radius: 999px;
  backdrop-filter: blur(4px);
}
/* 有封面图时的样式 */
.card-cover.has-cover {
  background-size: cover;
  background-position: center;
}
.card-cover.has-cover::before {
  background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.35) 100%);
  background-image: none;
}
.card-cover.has-cover .cov-lang {
  background: rgba(0,0,0,.45);
}
.card-body { padding: 15px 16px 14px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card-title {
  font-size: 15.5px; font-weight: 700;
  line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s;
}
.source-card:hover .card-title { color: var(--brand-strong); }
.card-desc {
  font-size: 13px; color: var(--muted);
  line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.card-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px; color: var(--muted);
}
.card-meta .author { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.card-meta .author span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta .avatar { width: 21px; height: 21px; font-size: 10.5px; }
.card-stats { display: flex; gap: 11px; flex: none; }
.card-stats span { display: inline-flex; align-items: center; gap: 3px; }
.card-stats svg { width: 13px; height: 13px; opacity: .7; }

/* ---------------- 分页 ---------------- */
.pagination {
  display: flex; justify-content: center; gap: 6px;
  margin-top: 38px;
}
.pagination button {
  min-width: 38px; height: 38px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px; font-weight: 600;
  color: var(--ink-2);
  padding: 0 8px;
}
.pagination button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-strong); }
.pagination button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------- 空状态 / 加载 ---------------- */
.empty-state {
  text-align: center;
  padding: 72px 20px;
  color: var(--muted);
}
.empty-state .glyph {
  font-family: var(--mono);
  font-size: 52px; font-weight: 700;
  color: var(--line-strong);
  display: block; margin-bottom: 14px;
}
.empty-state h3 { color: var(--ink-2); font-size: 17px; margin-bottom: 6px; }
.empty-state p { font-size: 14px; margin-bottom: 20px; }

.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 20px; }
.skeleton-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.skeleton-cover { height: 132px; background: linear-gradient(100deg, #eef1f5 30%, #f6f8fa 50%, #eef1f5 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skeleton-line { height: 13px; border-radius: 5px; margin: 14px 16px; background: #eef1f5; animation: shimmer 1.3s infinite; }
.skeleton-line.w70 { width: 70%; } .skeleton-line.w40 { width: 40%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------- 详情页 ---------------- */
.crumb {
  padding: 18px 0 0;
  font-size: 13px; color: var(--muted);
}
.crumb a:hover { color: var(--brand-strong); }
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 26px;
  padding: 18px 0 56px;
  align-items: start;
}
.detail-main { min-width: 0; }
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px 30px;
}
.detail-title { font-size: 25px; font-weight: 800; line-height: 1.4; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.detail-info-row {
  display: flex; flex-wrap: wrap; gap: 22px;
  margin-top: 18px; padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.detail-info-row b { color: var(--ink); font-weight: 600; }
.detail-info-row span { display: inline-flex; align-items: center; gap: 6px; }
.detail-info-row svg { width: 15px; height: 15px; }

.detail-h2 {
  font-size: 16px; font-weight: 700;
  margin: 24px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.detail-h2::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--brand); }
.detail-desc { white-space: pre-wrap; color: var(--ink-2); font-size: 14.5px; line-height: 1.85; }

.code-head {
  display: flex; align-items: center; justify-content: space-between;
  background: #1c2333;
  border-radius: 12px 12px 0 0;
  padding: 9px 14px;
  color: #aab4c5;
  font-family: var(--mono); font-size: 12.5px;
}
.code-head .dots { display: flex; gap: 6px; }
.code-head .dots i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.code-head .dots i:nth-child(1) { background: #ff5f57; }
.code-head .dots i:nth-child(2) { background: #febc2e; }
.code-head .dots i:nth-child(3) { background: #28c840; }
.copy-btn {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  color: #d4dce8; border-radius: 7px;
  padding: 4px 12px; font-size: 12px; font-weight: 600;
  display: inline-flex; gap: 5px; align-items: center;
}
.copy-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.copy-btn.done { color: #4ade80; border-color: rgba(74,222,128,.4); }
pre.code-block {
  background: #0d1117 !important;
  border-radius: 0 0 12px 12px;
  padding: 18px 20px !important;
  max-height: 640px;
  overflow: auto;
  font-size: 13.5px;
  line-height: 1.7;
  tab-size: 4;
}
pre.code-block code { font-family: var(--mono); background: transparent !important; padding: 0 !important; }
.code-empty { color: var(--muted); font-size: 14px; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 22px; text-align: center; }

/* 付费墙：未兑换资源代码预览锁定 */
.code-block-wrap { position: relative; }
.code-block-wrap.code-locked pre.code-block { max-height: 240px; overflow: hidden; filter: blur(7px); user-select: none; pointer-events: none; }
.code-lock-mask {
  position: absolute; left: 0; right: 0; top: 44px; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13,17,23,.5);
  border-radius: 0 0 12px 12px;
}
.lock-box {
  text-align: center; color: #d7e0ec;
  background: rgba(13,17,23,.94); border: 1px solid rgba(255,255,255,.16);
  border-radius: 14px; padding: 22px 28px; max-width: 340px;
  box-shadow: 0 18px 50px -18px rgba(0,0,0,.8);
}
.lock-box .lock-ico { font-size: 26px; color: #fbbf24; margin-bottom: 8px; }
.lock-box p { font-size: 13.5px; line-height: 1.65; margin: 0 0 16px; color: #aab4c5; }
.lock-box p b { color: #fff; }
.lock-box .btn { width: 100%; }
.lock-tip { font-size: 12.5px; color: #8fa3b5; }

/* 详情页相关推荐 */
.related-box { margin-top: 36px; padding-bottom: 24px; }
.related-head { margin-bottom: 16px; }

.detail-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 82px; }
.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.side-author { display: flex; align-items: center; gap: 13px; }
.side-author .meta { min-width: 0; }
.side-author .name { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.side-author .sub { font-size: 12.5px; color: var(--muted); }

.download-box .dl-primary {
  width: 100%; margin-bottom: 10px;
  font-size: 15px; padding: 13px;
}
.download-box .dl-external { width: 100%; }
.dl-note {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--accent-soft);
  color: #92400e;
  font-size: 12.5px; line-height: 1.6;
  border-radius: 9px;
  padding: 10px 12px;
  margin-top: 12px;
}
.dl-note svg { flex: none; margin-top: 2px; }
.dl-file-meta {
  font-size: 12.5px; color: var(--muted);
  margin: 10px 0 0;
  word-break: break-all;
}
.side-stat-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 7px 0; color: var(--ink-2); }
.side-stat-row b { font-family: var(--mono); color: var(--ink); }

.owner-actions { display: flex; gap: 8px; }
.owner-actions .btn { flex: 1; }

/* ---------------- 认证页 ---------------- */
.auth-wrap {
  display: flex; justify-content: center;
  padding: 56px 20px 70px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 34px 34px 28px;
}
.auth-card h1 { font-size: 23px; font-weight: 800; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 14px; margin: 8px 0 26px; }
.auth-switch { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 20px; }
.auth-switch a { color: var(--brand-strong); font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; }
.demo-hint {
  margin-top: 18px;
  background: var(--brand-soft);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  color: var(--brand-ink);
  text-align: center;
}
.demo-hint code { font-family: var(--mono); font-weight: 700; background: rgba(255,255,255,.6); padding: 1px 7px; border-radius: 5px; }

/* ---------------- 表单 ---------------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--ink-2); }
.form-group label .req { color: var(--danger); margin-left: 2px; }
.form-group .hint { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 7px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(21,168,101,.13); }
textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.7; }
textarea.code-input {
  font-family: var(--mono); font-size: 13px;
  min-height: 280px; line-height: 1.7;
  background: #0d1117; color: #c9d1d9;
  border-color: #1c2333;
  tab-size: 4;
}
textarea.code-input:focus { box-shadow: 0 0 0 3px rgba(21,168,101,.2); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-error {
  background: var(--danger-soft); color: var(--danger);
  font-size: 13px; font-weight: 600;
  padding: 9px 14px; border-radius: 9px;
  margin-bottom: 16px;
}
.field-toggle {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--ink-2);
  padding: 9px 0;
}
.file-drop {
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop.dragover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.file-drop input { display: none; }
.file-drop strong { color: var(--brand-strong); }
.file-current {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
}
.file-current .fname { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-current .fsize { color: var(--muted); flex: none; font-size: 12px; }
.file-current button { background: none; border: 0; color: var(--danger); font-size: 12.5px; font-weight: 600; flex: none; }
.cover-current {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
}
.cover-current img { max-width: 100px; max-height: 70px; border-radius: 6px; object-fit: cover; }
.cover-current button { background: none; border: 0; color: var(--danger); font-size: 12.5px; font-weight: 600; }

.form-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0;
  color: var(--muted); font-size: 12.5px;
}
.form-divider::before, .form-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------- 发布 / 管理页 ---------------- */
.page-head {
  padding: 34px 0 22px;
}
.page-head h1 { font-size: 24px; font-weight: 800; }
.page-head p { color: var(--muted); font-size: 14px; margin-top: 5px; }

.publish-card, .manage-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px 30px 30px;
  margin-bottom: 60px;
}
.publish-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 26px; }

/* 站内私信（我的消息） */
.chat-layout { display: flex; gap: 16px; align-items: stretch; min-height: 480px; }
.chat-list { width: 280px; flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.chat-search { padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--card); }
.chat-search input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; background: var(--bg); color: var(--ink); }
.chat-search input:focus { outline: none; border-color: var(--brand); }
.chat-admin-pin { background: var(--brand-soft); border-left: 3px solid var(--brand, #e86a2b); }
.chat-admin-pin:hover { background: var(--brand-soft); filter: brightness(.97); }
.chat-list-empty { padding: 40px 16px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 2; }
.chat-list-hint { padding: 20px 16px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.chat-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--line); position: relative; }
.chat-item:hover { background: var(--bg); }
.chat-item.active { background: var(--brand-soft); }
.chat-item .ci-body { flex: 1; min-width: 0; }
.chat-item .ci-top { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.chat-item .ci-time { margin-left: auto; color: var(--muted); font-size: 11.5px; flex: none; }
.chat-item .ci-preview { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.chat-item .ci-unread { background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; line-height: 18px; border-radius: 999px; text-align: center; padding: 0 5px; flex: none; }
.chat-item .ci-del { position: absolute; right: 6px; top: 6px; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; opacity: 0; padding: 2px 6px; border-radius: 6px; }
.chat-item:hover .ci-del { opacity: 1; }
.chat-item .ci-del:hover { color: #d9534f; background: rgba(217, 83, 79, .1); }
.chat-main { flex: 1; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.chat-placeholder { margin: auto; color: var(--muted); font-size: 14px; padding: 40px; text-align: center; }
.chat-hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.chat-hd .chat-peer { display: flex; align-items: center; gap: 8px; }
.chat-hd .chat-profile { margin-left: 8px; font-size: 12.5px; color: var(--brand-ink); }
.chat-back { display: none; border: 1px solid var(--line); background: transparent; border-radius: 8px; padding: 4px 10px; cursor: pointer; color: var(--ink-2); }
.chat-body { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; background: var(--bg); min-height: 300px; }
.chat-msg { display: flex; gap: 8px; align-items: flex-end; }
.chat-msg.me { flex-direction: row; justify-content: flex-end; }
.chat-msg.ta { justify-content: flex-start; }
.chat-bubble { max-width: 68%; background: var(--card); border: 1px solid var(--line); border-radius: 12px 12px 12px 3px; padding: 9px 13px; }
.chat-msg.me .chat-bubble { background: var(--brand); border-color: var(--brand); color: #fff; border-radius: 12px 12px 3px 12px; }
.chat-msg.me .chat-time { color: rgba(255, 255, 255, .75); }
.chat-text { font-size: 14px; line-height: 1.65; word-break: break-word; white-space: pre-wrap; }
.chat-time { font-size: 11px; color: var(--muted); margin-top: 4px; }
.avatar.sm { width: 30px; height: 30px; font-size: 14px; flex: none; }
.chat-input { display: flex; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--card); }
.chat-input textarea { flex: 1; resize: none; max-height: 96px; border-radius: 10px; padding: 9px 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-size: 14px; font-family: inherit; }
.nav-badge { background: #ef4444; color: #fff; font-size: 11px; font-weight: 700; min-width: 17px; height: 17px; line-height: 17px; border-radius: 999px; text-align: center; padding: 0 5px; margin-left: 8px; display: inline-block; }
@media (max-width: 760px) {
  .chat-list { width: 100%; }
  .chat-main { display: none; }
  .chat-layout.chat-open .chat-list { display: none; }
  .chat-layout.chat-open .chat-main { display: flex; }
  .chat-back { display: inline-block; }
}

/* 发布页免责声明 */
.disclaimer-box {
  margin-top: 26px; padding: 16px 20px; border-radius: 12px;
  background: var(--accent-soft, #fdf6e3); border: 1px solid #f0dcae; color: var(--ink-2);
}
.disclaimer-box h4 { margin: 0 0 10px; font-size: 14px; color: #92590c; }
.disclaimer-box ol { margin: 0; padding-left: 20px; font-size: 12.5px; line-height: 1.9; }
.disclaimer-box a { color: #a16207; font-weight: 600; }
.disclaimer-note { margin-top: 10px; font-size: 12.5px; color: #92590c; font-weight: 600; }

.manage-table { width: 100%; border-collapse: collapse; }
.manage-table th {
  text-align: left;
  font-size: 12.5px; font-weight: 600;
  color: var(--muted);
  padding: 0 14px 11px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.manage-table td { padding: 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.manage-table tr:last-child td { border-bottom: 0; }
.manage-table .t-title { font-weight: 600; max-width: 340px; }
.manage-table .t-title a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manage-table .t-title a:hover { color: var(--brand-strong); }
.manage-table .t-sub { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 400; }
.manage-table .num { font-family: var(--mono); color: var(--ink-2); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table-wrap { overflow-x: auto; }

/* ---------------- 用户主页 ---------------- */
.profile-head {
  background: linear-gradient(135deg, #0f2b20, #0a1f18);
  color: #eaf7f0;
  margin-top: 0;
}
.profile-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 40px 0;
  display: flex; align-items: center; gap: 20px;
}
.profile-inner .avatar.lg { width: 68px; height: 68px; font-size: 26px; }
.profile-inner h1 { font-size: 24px; display: flex; align-items: center; gap: 10px; }
.profile-inner p { color: rgba(220,244,232,.65); font-size: 14px; }

/* ---------------- Toast & 模态 ---------------- */
.toast-wrap {
  position: fixed; top: 78px; left: 50%; transform: translateX(-50%);
  z-index: 1000;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease;
  display: flex; align-items: center; gap: 8px;
}
.toast.success { background: #0c8f54; }
.toast.error { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

.modal-mask {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .18s ease;
}
.modal {
  background: var(--surface);
  border-radius: 15px;
  width: 100%; max-width: 400px;
  padding: 26px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease;
}
.modal h3 { font-size: 17px; margin-bottom: 8px; }
.modal p { font-size: 14px; color: var(--ink-2); margin-bottom: 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------------- 焦点可达性 ---------------- */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1120px) {
  .mainnav { display: none; }
  .nav-search { display: none; }
  .nav-toggle { display: block; }
  .topbar-inner { gap: 14px; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-side { position: static; }
}

@media (max-width: 640px) {
  .container, .hero-inner, .hero-stats, .notice-inner, .profile-inner { width: calc(100% - 28px); }
  .topbar-inner { width: calc(100% - 24px); height: 56px; }
  .brand-name { font-size: 17px; }
  .topbar-actions .btn:not(.btn-primary):not(.btn-login) { display: none; }
  .hero-inner { padding: 44px 0 46px; }
  .hero-search { border-radius: 16px; flex-direction: column; padding: 12px; gap: 10px; background: #fff; }
  .hero-search input { width: 100%; text-align: center; }
  .hero-search .btn { width: 100%; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: -24px; }
  .stat-card { padding: 14px 8px; }
  .stat-num { font-size: 21px; }
  .list-section { padding: 30px 0 44px; }
  .card-grid { grid-template-columns: 1fr; gap: 14px; }
  .detail-panel { padding: 20px 18px; }
  .detail-title { font-size: 20px; }
  .publish-card, .manage-card { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 22px; }
  .section-head { gap: 10px; }
  .sort-tabs { width: 100%; justify-content: space-around; }
  .sort-tabs button { flex: 1; padding: 6px 8px; }
  .publish-actions { flex-direction: column-reverse; }
  .publish-actions .btn { width: 100%; }
  .profile-inner { flex-direction: column; text-align: center; padding: 30px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ================= 会员积分 ================= */
.points-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px; border-radius: 999px;
  background: var(--accent-soft); color: #a16207;
  border: 1px solid #f6dcae; font-size: 13px; font-weight: 600;
  flex: none; white-space: nowrap;
  transition: transform .15s, box-shadow .15s;
}
.points-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.points-chip svg { color: var(--accent); }
.points-chip b { font-weight: 700; }
.points-chip span { color: #a16207; opacity: .8; font-weight: 500; }

.tag-price {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--accent-soft); color: #a16207; border-color: #f6dcae;
}
.tag-price svg { color: var(--accent); }
.tag-free { background: var(--brand-soft); color: var(--brand-ink); }
.tag-rec { background: var(--accent-soft); color: #a16207; border-color: #f6dcae; font-weight: 700; }
.tag-pending { background: #eaf3fd; color: #2a6db0; border-color: #bcd8f5; font-size: 11.5px; margin-left: 6px; }
.tag-rejected { background: #fdecec; color: #c0392b; border-color: #f5c6c2; font-size: 11.5px; margin-left: 6px; }
.reject-note { color: #c0392b; margin-top: 3px; }
.review-banner { border-radius: 10px; padding: 12px 16px; font-size: 13.5px; margin-bottom: 16px; line-height: 1.7; }
.review-banner.rb-pending { background: #eaf3fd; color: #2a6db0; border: 1px solid #bcd8f5; }
.review-banner.rb-rejected { background: #fdecec; color: #b03326; border: 1px solid #f5c6c2; }

.cov-price {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(245, 158, 11, .95); color: #4a2c00;
  font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
.card-cover .cov-rec {
  position: absolute; right: 10px; top: 10px; z-index: 2;
  background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #4a2c00;
  font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, .45);
}
.card-cover .cov-demo {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  background: rgba(16, 185, 129, .9); color: #fff;
  font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, .45);
}
.card-cover.has-cover .cov-demo {
  background: rgba(16, 185, 129, .85);
}

.dl-points-note { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }

.points-preview {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 14px 0 4px; text-align: center;
}
.points-preview > div {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 6px;
  display: flex; flex-direction: column; gap: 4px;
}
.points-preview span { font-size: 12px; color: var(--muted); }
.points-preview b { font-size: 17px; color: var(--ink); }
.points-preview b.minus { color: var(--accent); }

.points-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #fffaf0, #fff5e0);
  border: 1px solid #f3e0b8; border-radius: var(--radius);
  padding: 22px 26px; margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.points-balance { display: flex; flex-direction: column; gap: 2px; }
.pb-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #a16207; font-weight: 600; }
.pb-label svg { color: var(--accent); }
.pb-num { font-size: 40px; font-weight: 800; color: #7a4a00; letter-spacing: -1px; line-height: 1.1; }
.points-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.points-log-head {
  padding: 14px 18px; font-weight: 700; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.pt-plus { color: var(--brand); font-weight: 700; }
.pt-minus { color: var(--danger); font-weight: 700; }

/* ================= 视觉模板（可切换） ================= */
/* 模板通过 html[data-theme] 覆盖设计变量实现；默认为清新绿，无需 data-theme 也正常 */
html { color-scheme: light; }

/* 信息流 · 晴空蓝 */
html[data-theme="feed"] {
  --bg:#f2f6fb; --surface:#ffffff; --surface-2:#f5f8fd;
  --ink:#16233a; --ink-2:#3d4c66; --muted:#8492ab;
  --line:#e2e9f3; --line-strong:#cfd9e8;
  --brand:#2f7fe0; --brand-strong:#1e63bd; --brand-soft:#e7f1fd; --brand-ink:#14456f;
  --accent:#f59e0b; --accent-soft:#fef3e2; --info:#2f7fe0;
  --hero-bg: radial-gradient(900px 420px at 12% -10%, rgba(47,127,224,.38), transparent 60%), radial-gradient(700px 380px at 92% 0%, rgba(90,162,245,.2), transparent 55%), linear-gradient(160deg,#0b2440 0%,#061a2e 70%,#04121f 100%);
  --hero-hl: linear-gradient(90deg,#60a5fa,#38bdf8 60%,#7dd3fc);
  --hero-link:#9cc6ff;
}

/* 经典卡片 · 清新绿（基础模板） */
html[data-theme="classic"] {
  --bg:#f3f5f8; --surface:#ffffff; --surface-2:#f8fafc;
  --ink:#1b2430; --ink-2:#455160; --muted:#8b95a5;
  --line:#e6e9f0; --line-strong:#d6dbe5;
  --brand:#15a865; --brand-strong:#0c8f54; --brand-soft:#e7f7ef; --brand-ink:#0a5c38;
  --accent:#f59e0b; --accent-soft:#fef3e2; --info:#3b82f6;
}

/* 杂志 · 暖阳橙 */
html[data-theme="magazine"] {
  --bg:#fdf6f0; --surface:#ffffff; --surface-2:#fff9f4;
  --ink:#3a2418; --ink-2:#6b4a35; --muted:#ab8f7c;
  --line:#f0e2d6; --line-strong:#e4d0bd;
  --brand:#ef6c2b; --brand-strong:#d1500f; --brand-soft:#fdeade; --brand-ink:#8a3a0d;
  --accent:#f2b705; --accent-soft:#fdf3d6; --info:#e8661f;
  --hero-bg: radial-gradient(900px 420px at 12% -10%, rgba(239,108,43,.38), transparent 60%), radial-gradient(700px 380px at 92% 0%, rgba(245,158,11,.2), transparent 55%), linear-gradient(160deg,#331f0d 0%,#241608 70%,#1a0f06 100%);
  --hero-hl: linear-gradient(90deg,#fbbf24,#fb923c 60%,#fdba74);
  --hero-link:#ffc98a;
}

/* 极简 · 极简灰 */
html[data-theme="minimal"] {
  --bg:#f4f5f7; --surface:#ffffff; --surface-2:#f8f9fb;
  --ink:#1c2024; --ink-2:#464c55; --muted:#8b929c;
  --line:#e6e8ec; --line-strong:#d5d9df;
  --brand:#4b5563; --brand-strong:#374151; --brand-soft:#eef0f3; --brand-ink:#2b3038;
  --accent:#f59e0b; --accent-soft:#fef3e2; --info:#3b82f6;
  --hero-bg: radial-gradient(900px 420px at 12% -10%, rgba(75,85,99,.5), transparent 60%), radial-gradient(700px 380px at 92% 0%, rgba(148,163,184,.2), transparent 55%), linear-gradient(160deg,#232830 0%,#171b21 70%,#0f1216 100%);
  --hero-hl: linear-gradient(90deg,#cbd5e1,#94a3b8 60%,#e2e8f0);
  --hero-link:#cfd6df;
}

/* 暗夜 · 暗夜黑 */
html[data-theme="night"] {
  color-scheme: dark;
  --bg:#0f1318; --surface:#171c24; --surface-2:#1e242e;
  --ink:#e8edf4; --ink-2:#b3bdcb; --muted:#7d8798;
  --line:#262d38; --line-strong:#333c4a;
  --brand:#2bbf7e; --brand-strong:#1fa76a; --brand-soft:#14302a; --brand-ink:#7ee2b4;
  --accent:#f5a623; --accent-soft:#3a2f16; --danger:#f0655f; --danger-soft:#3a1e1e; --info:#5aa2f5;
  --hero-bg: radial-gradient(900px 420px at 12% -10%, rgba(43,191,126,.32), transparent 60%), radial-gradient(700px 380px at 92% 0%, rgba(56,189,248,.14), transparent 55%), linear-gradient(160deg,#0b2018 0%,#07130e 70%,#050d09 100%);
  --hero-hl: linear-gradient(90deg,#4ade80,#34d399 60%,#6ee7b7);
  --hero-link:#9fe8c6;
}
html[data-theme="night"] .topbar { background: rgba(23,28,36,.9); }
html[data-theme="night"] .mobile-panel { background: var(--surface); }
html[data-theme="night"] .hero-search { background: var(--surface); }
html[data-theme="night"] .tag-admin { background: #3a2f16; color: #f0c877; }
html[data-theme="night"] .demo-hint code { background: rgba(255,255,255,.12); }
html[data-theme="night"] .points-hero { background: linear-gradient(135deg,#1e1a10,#241f12); border-color:#3a2f16; }
html[data-theme="night"] .pb-num { color: #f0c877; }
html[data-theme="night"] .pb-label, html[data-theme="night"] .points-chip { color: #f0c877; }
html[data-theme="night"] .points-chip { background:#2a2313; border-color:#4a3d1b; }
html[data-theme="night"] .chip.active, html[data-theme="night"] .pagination button.active,
html[data-theme="night"] .btn-primary { color: #06231a; }

/* 模板切换器 */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  flex: none; transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }
.theme-panel {
  position: fixed; top: 70px; right: 20px; z-index: 200;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px;
  width: 316px; display: none;
}
.theme-panel.open { display: block; }
.theme-panel h4 { font-size: 13px; color: var(--muted); font-weight: 600; margin: 2px 4px 10px; }
.theme-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.theme-item {
  display: flex; align-items: center; gap: 11px; cursor: pointer;
  padding: 9px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 13px; color: var(--ink-2);
}
.theme-item:hover { border-color: var(--brand); }
.theme-item.active { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 22%, transparent); }
.theme-prev {
  width: 40px; height: 40px; border-radius: 9px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--c1, #15a865), var(--c2, #0c8f54)); color: #fff;
}
.theme-prev svg { width: 22px; height: 22px; }
.theme-info { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.theme-info b { font-size: 13.5px; color: var(--ink); }
.theme-info small { font-size: 11.5px; color: var(--muted); }
.theme-item .ck { margin-left: auto; color: var(--brand); font-weight: 700; display: none; }
.theme-item.active .ck { display: inline; }
@media (max-width: 640px) {
  .theme-panel { right: 10px; left: 10px; width: auto; }
}

/* ================= 布局模板（data-layout） ================= */
html[data-layout="classic"], html[data-layout="night"] { }

/* —— 信息流模板 —— */
.slim-hero { background: var(--hero-bg, #0d2b20); color: #eaf7f0; padding: 40px 0 44px; }
.slim-hero .hero-inner2 { width: min(880px, calc(100% - 40px)); margin: 0 auto; text-align: center; }
.slim-hero h1 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; }
.slim-hero p { margin-top: 10px; color: rgba(220,244,232,.72); font-size: 14.5px; }
.slim-hero .hero-search { margin-top: 20px; }
.feed-list { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.feed-item {
  display: flex; gap: 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.feed-item:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.feed-thumb {
  width: 92px; height: 92px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--cov-1), var(--cov-2));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--mono); font-size: 13px; font-weight: 700;
}
.feed-thumb.has-img { background-size: cover; background-position: center; background-repeat: no-repeat; }
.feed-body { flex: 1; min-width: 0; }
.feed-body h3 { font-size: 16.5px; color: var(--ink); }
.feed-body p { color: var(--muted); font-size: 13.5px; margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-tags { margin-top: 9px; display: flex; gap: 6px; flex-wrap: wrap; }
.feed-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 7px;
  color: var(--muted); font-size: 12.5px; flex: none; min-width: 104px; }
.feed-meta .author { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
@media (max-width: 640px) {
  .feed-item { flex-wrap: wrap; }
  .feed-thumb { width: 64px; height: 64px; }
  .feed-meta { flex-direction: row; width: 100%; justify-content: space-between; min-width: 0; }
}

/* —— 杂志模板 —— */
.magazine-layout { display: grid; grid-template-columns: 1fr 300px; gap: 22px; margin-top: 18px; align-items: start; }
.mag-grid { grid-template-columns: repeat(2, 1fr); }
.mag-side { display: flex; flex-direction: column; gap: 16px; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.side-card h3 { font-size: 14px; color: var(--ink); margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.mag-rank-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.mag-rank-item:last-child { border-bottom: 0; }
.mag-rank-no { width: 20px; height: 20px; border-radius: 6px; background: var(--brand-soft); color: var(--brand-ink);
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.mag-rank-item .t { font-size: 13.5px; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mag-cat a { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13.5px;
  color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.mag-cat a:last-child { border-bottom: 0; }
.mag-cat a:hover { color: var(--brand); }
.mag-cat .cnt { color: var(--muted); font-size: 12.5px; }
@media (max-width: 900px) { .magazine-layout { grid-template-columns: 1fr; } }

/* —— 极简模板 —— */
.minimal-wrap { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 64px; }
.mini-title { font-size: 30px; font-weight: 800; letter-spacing: .5px; color: var(--ink); }
.mini-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.minimal-list { display: flex; flex-direction: column; margin-top: 16px; border-top: 1px solid var(--line); }
.minimal-item { display: flex; align-items: center; gap: 12px; padding: 13px 6px;
  border-bottom: 1px solid var(--line); cursor: pointer; }
.minimal-item:hover { background: var(--surface-2); }
.min-rank { width: 26px; color: var(--muted); font-family: var(--mono); font-size: 12.5px; flex: none; }
.min-title { flex: 1; min-width: 0; font-size: 15px; color: var(--ink); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.min-cat { font-size: 12.5px; color: var(--muted); flex: none; }
.min-lang { font-size: 12px; color: var(--brand); flex: none; }
.min-num { font-size: 12.5px; color: var(--muted); width: 64px; text-align: right; flex: none; }
@media (max-width: 640px) { .min-cat, .min-lang { display: none; } .min-sort .sort-tabs { width: 100%; } }

/* 极简模板的素雅搜索框 */
.search-plain { background: transparent; box-shadow: none; padding: 0; max-width: 520px; margin: 20px 0 0; border-radius: 0; }
.search-plain input { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 12px 18px; font-size: 14.5px; }
.search-plain input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }
.search-plain .btn { border-radius: 999px; }

/* 二级分类 chips */
.chip-row-sub { margin-top: 10px; padding-left: 4px; }
.chip-sm { font-size: 12.5px; padding: 4px 12px; }

/* ================= 设计打磨（前台） ================= */
/* 首屏更紧凑、信息更靠上 */
.hero-inner { padding: 50px 0 44px; }
.hero h1 { font-size: clamp(26px, 3.6vw, 38px); letter-spacing: .5px; line-height: 1.28; }
.hero p { margin-top: 12px; font-size: 15px; }
.hero-search { margin-top: 24px; }
.hero-hot { margin-top: 14px; }
.slim-hero { padding: 34px 0 36px; }

/* 列表区节奏 */
.list-section { padding: 36px 0 56px; }
.section-head { margin-bottom: 16px; }
.section-title { font-size: 21px; }
.chip-row { gap: 8px; margin-bottom: 22px; }
.chip { padding: 6px 14px; font-size: 13px; }

/* 卡片：统一封面比例与文字对齐 */
.card-grid { gap: 18px; }
.source-card:hover { transform: translateY(-3px); }
.card-cover { aspect-ratio: 16 / 10; height: auto; }
.card-body { padding: 14px 15px 13px; gap: 8px; }
.card-title { font-size: 15px; min-height: calc(1.45em * 2); }
.card-desc { line-height: 1.65; }
.card-meta { font-size: 12px; padding-top: 9px; }

/* 杂志模板侧栏统计 */
.mag-stat-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13.5px; color: var(--ink-2); border-bottom: 1px dashed var(--line); }
.mag-stat-row:last-child { border-bottom: 0; }
.mag-stat-row b { color: var(--ink); font-weight: 700; }

/* ================= 购买积分 ================= */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; padding: 16px 18px 4px; }
.pkg-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--surface-2); transition: border-color .15s, transform .15s;
}
.pkg-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.pkg-name { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.pkg-points { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -.5px; }
.pkg-points small { font-size: 12px; font-weight: 600; color: var(--muted); }
.pkg-bonus { font-size: 12px; color: var(--accent); min-height: 16px; }
.pkg-price { font-size: 16px; font-weight: 700; color: var(--brand-strong); margin-top: 2px; }
.pkg-card .btn { margin-top: 6px; }
.ord { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.ord-pending { background: var(--accent-soft); color: #a16207; }
.ord-paid { background: var(--brand-soft); color: var(--brand-ink); }
.ord-canceled { background: var(--surface-2); color: var(--muted); }

/* 扫码支付弹窗 */
.pay-modal { text-align: center; }
.pay-modal p { color: var(--ink-2); }
.pay-qr { display: flex; align-items: center; justify-content: center; min-height: 190px; margin: 14px 0; }
.pay-qr img { width: 200px; height: 200px; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 8px; }
.wx-steps { margin: 12px 0 14px; padding-left: 22px; font-size: 13px; line-height: 1.9; color: var(--ink-2); text-align: left; }
.wx-steps b { color: var(--ink); }
.wx-form { display: grid; gap: 10px; margin-bottom: 14px; }
.wx-form .field { text-align: left; }
.wx-form .field label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.pay-tip { font-size: 12.5px; color: var(--muted); }

/* ---------- 微信支付弹窗（买家扫码转账 + 提交凭证） ---------- */
.wx-pay-modal { max-width: 400px; padding: 0; overflow: hidden; max-height: calc(100vh - 40px); display: flex; flex-direction: column; border-radius: 20px; background: var(--surface); }
.wx-pay-head { background: linear-gradient(135deg, #07c160 0%, #05a04f 100%); padding: 16px 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; }
.wx-pay-brand { display: flex; align-items: center; gap: 11px; }
.wx-pay-logo { width: 38px; height: 38px; border-radius: 10px; background: #fff; color: #07c160; font-size: 21px; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.wx-pay-title { color: #fff; font-size: 16px; font-weight: 700; line-height: 1.25; }
.wx-pay-sub { color: rgba(255,255,255,.88); font-size: 12px; margin-top: 2px; }
.wx-pay-x { width: 30px; height: 30px; border: none; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; padding: 0; }
.wx-pay-x:hover { background: rgba(255,255,255,.32); }
.wx-pay-body { padding: 20px 20px 22px; overflow-y: auto; overscroll-behavior: contain; }
.wx-pay-amount { text-align: center; padding: 2px 0 14px; }
.wx-pay-cur { font-size: 20px; font-weight: 700; color: #1f2329; vertical-align: top; margin-right: 1px; }
.wx-pay-num { font-size: 40px; font-weight: 800; color: #1f2329; letter-spacing: -1px; line-height: 1.1; }
.wx-pay-desc { font-size: 13px; color: var(--muted); margin-top: 6px; }
.wx-pay-desc b { color: #07c160; font-weight: 700; }
.wx-pay-qr-wrap { display: flex; justify-content: center; margin: 2px 0 12px; }
.wx-pay-qr { width: min(300px, 78vw); height: min(300px, 78vw); border: 1px solid #e8ecf0; border-radius: 16px; padding: 10px; background: #fff; box-shadow: 0 4px 16px rgba(7,193,96,.10); display: flex; align-items: center; justify-content: center; }
.wx-pay-qr img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.wx-pay-zoom { position: fixed; inset: 0; z-index: 1000; background: rgba(10,18,28,.82); display: flex; align-items: center; justify-content: center; animation: fadeIn .15s ease; }
.wx-pay-zoom-box { background: #fff; border-radius: 16px; padding: 22px; width: min(88vw, 420px); text-align: center; }
.wx-pay-zoom-box img { width: 100%; max-height: 62vh; object-fit: contain; border-radius: 8px; }
.wx-pay-zoom-box p { font-size: 13px; color: #57606a; margin: 14px 0 2px; }
.wx-pay-scan { text-align: center; font-size: 13.5px; color: var(--ink-2); }
.wx-pay-scan b { color: #1f2329; font-weight: 700; }
.wx-pay-scan i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #07c160; margin-right: 7px; vertical-align: 1px; }
.wx-pay-oid { text-align: center; font-size: 11.5px; color: var(--muted); margin-top: 6px; word-break: break-all; }
.wx-pay-oid b { color: var(--ink-2); font-weight: 600; }
.wx-pay-steps { border-top: 1px dashed #e3e8ee; margin-top: 16px; padding-top: 15px; display: grid; gap: 11px; }
.wx-pay-step { display: flex; gap: 11px; align-items: flex-start; text-align: left; }
.wx-pay-step-no { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, #07c160, #05a04f); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; box-shadow: 0 2px 6px rgba(7,193,96,.3); }
.wx-pay-step b { font-size: 13.5px; display: block; color: var(--ink); }
.wx-pay-step small { font-size: 12px; color: var(--muted); display: block; margin-top: 1px; }
.wx-pay-form { margin: 16px 0 14px; }
.wx-pay-form label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; text-align: left; }
.wx-pay-form label em { color: #e5484d; font-style: normal; }
.wx-pay-form input { width: 100%; box-sizing: border-box; border: 1.5px solid #e3e8ee; border-radius: 11px; padding: 11px 14px; font-size: 14px; background: #fafbfc; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.wx-pay-form input:focus { border-color: #07c160; background: #fff; box-shadow: 0 0 0 3px rgba(7,193,96,.13); }
.wx-pay-form input::placeholder { color: #b3bcc6; }
.wx-pay-submit { width: 100%; border: none; border-radius: 11px; padding: 12px 0; font-size: 15px; font-weight: 600; color: #fff; background: linear-gradient(135deg, #07c160 0%, #05a04f 100%); cursor: pointer; box-shadow: 0 4px 14px rgba(7,193,96,.32); transition: opacity .15s, transform .1s; }
.wx-pay-submit:hover { opacity: .93; }
.wx-pay-submit:active { transform: scale(.99); }
.wx-pay-submit:disabled { opacity: .6; cursor: default; }
.wx-pay-actions { display: flex; gap: 10px; margin-top: 10px; }
.wx-pay-actions .btn { flex: 1; justify-content: center; }

/* ---------------- 页脚 ---------------- */
.site-footer { margin-top: 56px; background: linear-gradient(180deg, #13231b, #0e1b15); color: #c3cec6; border-top: 3px solid var(--brand); }
.footer-inner { padding-top: 38px; padding-bottom: 24px; display: flex; flex-direction: column; gap: 18px; }
.footer-brand { display: flex; flex-direction: column; gap: 9px; }
.footer-brand .brand-mark { align-self: flex-start; margin-bottom: 2px; }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { margin: 0; color: #92a097; font-size: 13.5px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 10px 24px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.09); }
.footer-links a { color: #c3cec6; font-size: 14px; text-decoration: none; transition: color .15s; }
.footer-links a:hover { color: #fff; }
.footer-copy { margin: 0; color: #7c8a81; font-size: 12.5px; }
@media (max-width: 640px) {
  .footer-links { gap: 8px 18px; }
  .site-footer { margin-top: 36px; }
}

/* ---------------- 演示图（发布页上传 & 详情页图集） ---------------- */
.demo-current, .demo-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.demo-current:empty, .demo-preview:empty { display: none; }
.demo-thumb {
  position: relative; width: 104px; height: 74px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line-strong); background: var(--surface-2); flex: none;
}
.demo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.demo-thumb.new { border-style: dashed; border-color: var(--brand); }
.demo-thumb .demo-rm {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 12px; line-height: 20px; cursor: pointer; transition: background .15s;
}
.demo-thumb .demo-rm:hover { background: var(--danger); }

.detail-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; margin-top: 4px; }
.gallery-item {
  padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--surface-2); cursor: zoom-in; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.gallery-item:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.gallery-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }

.gallery-lightbox {
  position: fixed; inset: 0; z-index: 950; background: rgba(8, 12, 16, .9);
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.gallery-lightbox img {
  max-width: min(92vw, 1140px); max-height: 86vh; border-radius: 10px;
  object-fit: contain; box-shadow: var(--shadow-lg); background: #0b0f13;
}
.gallery-lightbox .lb-btn {
  position: absolute; border: 0; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .14);
  border-radius: 50%; display: grid; place-items: center; transition: background .15s;
}
.gallery-lightbox .lb-btn:hover { background: rgba(255, 255, 255, .3); }
.gallery-lightbox .lb-close { top: 20px; right: 24px; width: 40px; height: 40px; font-size: 18px; }
.gallery-lightbox .lb-prev, .gallery-lightbox .lb-next {
  top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 28px; line-height: 1;
}
.gallery-lightbox .lb-prev { left: 24px; }
.gallery-lightbox .lb-next { right: 24px; }
.gallery-lightbox .lb-count {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: #fff; font-size: 13px; letter-spacing: .5px; background: rgba(0, 0, 0, .4);
  padding: 5px 14px; border-radius: 999px;
}
@media (max-width: 640px) {
  .gallery-lightbox { padding: 16px; }
  .gallery-lightbox .lb-prev { left: 8px; } .gallery-lightbox .lb-next { right: 8px; }
  .gallery-lightbox .lb-close { top: 10px; right: 12px; }
}

/* ================= 登录页：密码 / 扫码 切换 ================= */
.auth-tabs {
  display: flex; background: #f3f4f6; border-radius: 11px; padding: 4px;
  margin: 0 0 18px; gap: 4px;
}
.auth-tab {
  flex: 1; border: 0; background: transparent; padding: 9px 0; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: #6b7280; cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.auth-tab:hover { color: #374151; }
.auth-tab.active {
  background: #fff; color: var(--primary, #2563eb);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .09);
}

/* ================= 扫码登录 ================= */
.qr-panel { text-align: center; }
.qr-box {
  position: relative; display: inline-block; padding: 16px;
  background: #fff; border-radius: 18px; border: 1px solid #f0f1f3;
  box-shadow: 0 6px 24px rgba(15, 23, 42, .08);
  margin-top: 6px;
}
.qr-img {
  width: 208px; height: 208px; display: block; border-radius: 10px;
}
/* 二维码四角装饰 */
.qr-corn {
  position: absolute; width: 14px; height: 14px; border: 2.5px solid var(--primary, #2563eb);
}
.qr-cn { top: -3px; left: -3px; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.qr-cs { top: -3px; right: -3px; border-left: 0; border-bottom: 0; border-top-right-radius: 10px; }
.qr-ce { bottom: -3px; right: -3px; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }
.qr-cw { bottom: -3px; left: -3px; border-right: 0; border-top: 0; border-bottom-left-radius: 10px; }
.qr-steps {
  list-style: none; margin: 18px auto 6px; padding: 0; text-align: left; display: table;
}
.qr-steps li {
  position: relative; font-size: 13px; color: #4b5563; padding: 4px 0 4px 30px; line-height: 1.5;
}
.qr-steps li::before {
  content: attr(data-n); position: absolute; left: 0; top: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary, #2563eb); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 20px; text-align: center;
}
.qr-tip {
  color: #4b5563; font-size: 14px; margin: 16px 0 4px; font-weight: 500;
}
.qr-hint { color: #9aa0ac; font-size: 12px; margin: 6px 0 0; }
.qr-loading {
  color: #6b7280; font-size: 13px; padding: 34px 0; display: flex;
  align-items: center; justify-content: center; gap: 10px;
}
.qr-spinner {
  width: 18px; height: 18px; border-radius: 50%; display: inline-block;
  border: 2.5px solid #e5e7eb; border-top-color: var(--primary, #2563eb);
  animation: qr-spin .8s linear infinite;
}
@keyframes qr-spin { to { transform: rotate(360deg); } }

/* 管理员登录二次确认 */
.confirm-tip {
  color: #e8601f; font-size: 13px; text-align: center;
  padding: 6px 0 2px; font-weight: 600;
}
