/* =========================================================
   好传奇资源网 · tplmarket
   传奇资源发布站主题，独立设计，无外部依赖
   ========================================================= */

:root {
  --bg: #0b0a0f;
  --bg-2: #121016;
  --card: #16131c;
  --card-2: #1b1723;
  --line: #2b2433;
  --line-2: #3a3044;
  --ink: #efe7db;
  --ink-2: #d6cbbc;
  --muted: #9a90a3;
  --muted-2: #6f6779;
  --gold: #d8a94a;
  --gold-2: #f2d489;
  --blood: #a52f24;
  --blood-2: #d94a36;
  --jade: #4f9c86;
  --radius: 14px;
  --radius-lg: 20px;
  --head-h: 72px;          /* 顶栏高度，移动端由媒体查询下调 */
  --buybar-h: 68px;        /* 详情页底部操作条高度 */
  --shadow: 0 18px 40px rgba(0, 0, 0, .45);
  --shadow-lg: 0 34px 90px rgba(0, 0, 0, .6);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 { line-height: 1.3; color: var(--ink); margin: 0; }

p { margin: 0 0 1em; }

button { font-family: inherit; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.wrap {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #221c2b;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, #e0b45a, #c98f2e);
  color: #231a08;
  box-shadow: 0 10px 24px rgba(201, 143, 46, .3);
  font-weight: 700;
}
.btn-primary:hover { box-shadow: 0 14px 30px rgba(201, 143, 46, .4); }

.btn-ghost {
  background: transparent;
  border-color: var(--line-2);
  color: var(--ink-2);
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-2); }

.btn-light { background: #f4ecdf; color: #2a1f0c; }
.btn-outline-light {
  background: transparent;
  border-color: rgba(239, 231, 219, .42);
  color: #efe7db;
}
.btn-outline-light:hover { background: rgba(239, 231, 219, .1); border-color: var(--gold); color: var(--gold-2); }

.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ---------- 顶部导航 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(11, 10, 15, .9);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-head::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 169, 74, .55), transparent);
}

.head-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--head-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, #e6bd67, #a8741f 70%, #7d5310);
  color: #1d1405;
  font-family: var(--serif);
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 6px 18px rgba(168, 116, 31, .38), inset 0 1px 0 rgba(255, 255, 255, .45);
}

.brand-name {
  display: block;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .04em;
  line-height: 1.15;
  color: var(--ink);
}

.brand-sub {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .16em;
  margin-top: 2px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 8px;
}

.nav-link {
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink-2);
  transition: background .18s ease, color .18s ease;
}
.nav-link:hover { background: #1d1826; color: var(--gold-2); }
.nav-link.is-active { background: rgba(216, 169, 74, .12); color: var(--gold-2); font-weight: 700; }

.head-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.head-search {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 14px;
  background: #17131f;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .18s ease, background .18s ease;
}
.head-search:focus-within { border-color: var(--gold); background: #1b1624; }

.head-search input {
  width: 132px;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--ink);
}
.head-search input::placeholder { color: var(--muted-2); }

.head-search button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #251e30;
  color: var(--gold-2);
  cursor: pointer;
}
.head-search button:hover { background: #30263d; }

.link-login { font-size: 14px; color: var(--ink-2); font-weight: 600; }
.link-login:hover { color: var(--gold-2); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #17131f;
  font-size: 13px;
  font-weight: 600;
}
.user-chip:hover { border-color: var(--gold); }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #b8873a, #7c5a1d);
  color: #1d1405;
  font-size: 13px;
  font-weight: 700;
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #17131f;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  border-radius: 2px;
  background: var(--ink-2);
}

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 80px;
  background:
    radial-gradient(760px 420px at 8% 0%, rgba(165, 47, 36, .32), transparent 62%),
    radial-gradient(700px 380px at 86% 6%, rgba(216, 169, 74, .16), transparent 65%),
    linear-gradient(160deg, #0b0a0f 0%, #141018 55%, #0c0a11 100%);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(216, 169, 74, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 169, 74, .05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent 78%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent 78%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 60px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 6px 15px;
  border: 1px solid rgba(216, 169, 74, .34);
  border-radius: 999px;
  background: rgba(216, 169, 74, .07);
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
}
.eyebrow .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(216, 169, 74, .18);
}

.hero h1 {
  margin: 22px 0 18px;
  font-family: var(--serif);
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 1.18;
  letter-spacing: .01em;
  color: #f7efe2;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, #f6dc9c, #d8a94a 62%, #b8822c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 560px;
  margin: 0;
  color: #a99fb0;
  font-size: 16px;
}

.hero-search {
  display: flex;
  gap: 8px;
  margin-top: 30px;
  padding: 7px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: #141019;
  box-shadow: 0 22px 50px rgba(0, 0, 0, .4);
}
.hero-search:focus-within { border-color: rgba(216, 169, 74, .6); }

.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  padding: 10px 12px;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
}
.hero-search input::placeholder { color: var(--muted-2); }

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 18px;
  color: var(--muted-2);
  font-size: 13px;
}
.hero-tags a { color: #cbb894; border-bottom: 1px dashed rgba(203, 184, 148, .38); }
.hero-tags a:hover { color: var(--gold-2); border-bottom-color: var(--gold); }

.hero-stats {
  display: flex;
  gap: 44px;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-family: var(--serif); font-size: 26px; color: var(--gold-2); line-height: 1.2; }
.hero-stats span { font-size: 12px; color: var(--muted); letter-spacing: .06em; }

/* Hero 右侧装饰 */
.hero-visual { position: relative; }

.window {
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: #121017;
  box-shadow: var(--shadow-lg);
  transform: rotate(-1.6deg);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  background: #1a1521;
  border-bottom: 1px solid var(--line);
}
.window-bar i { width: 8px; height: 8px; border-radius: 50%; background: #3a3044; }
.window-bar i:nth-child(1) { background: #8f3126; }
.window-bar i:nth-child(2) { background: #a8843a; }
.window-bar i:nth-child(3) { background: #3d7a67; }
.window-bar span {
  margin-left: 10px;
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: .08em;
}

.window-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  background: #100e14;
}

.mini {
  position: relative;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 4 / 3;
  padding: 12px;
  border-radius: 9px;
  color: #f7efe2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  overflow: hidden;
}
.mini::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 34%, rgba(0, 0, 0, .5) 76%, rgba(0, 0, 0, .7));
}
.mini-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
.mini:hover .mini-art { transform: scale(1.07); }
.mini span { position: relative; z-index: 1; }
.mini-a { background: linear-gradient(140deg, #6d2a21, #2a1210); }
.mini-b { background: linear-gradient(140deg, #7a5a22, #2b2110); }
.mini-c { background: linear-gradient(140deg, #2f4f6d, #101c28); }
.mini-d { background: linear-gradient(140deg, #2c5a4b, #0f2019); }

.float-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(22, 19, 28, .94);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .5);
  line-height: 1.3;
}
.float-card b { font-size: 14px; color: var(--gold-2); letter-spacing: .04em; }
.float-card span { font-size: 11px; color: var(--muted); }
.float-card-a { top: -18px; right: 4px; }
.float-card-b { bottom: -20px; left: -14px; }

/* ---------- 通用区块 ---------- */
.section { padding: 74px 0; }
.section-tight { padding: 36px 0 64px; }
.section-alt {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.section-title {
  position: relative;
  padding-left: 14px;
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: .02em;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-2), #9c6a1d);
}
.section-sub { margin: 10px 0 0 14px; color: var(--muted); font-size: 14px; }

.link-more { color: var(--gold); font-size: 14px; font-weight: 700; white-space: nowrap; }
.link-more:hover { color: var(--gold-2); }

/* ---------- 资源卡片 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.tpl-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.tpl-card:hover {
  transform: translateY(-4px);
  border-color: rgba(216, 169, 74, .5);
  box-shadow: 0 22px 46px rgba(0, 0, 0, .55);
}

.card-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #1c1824;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.tpl-card:hover .card-cover img { transform: scale(1.04); }

.cover-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  color: #f6ecdc;
}
.cover-fallback::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(246, 236, 220, .16);
  border-radius: 6px;
  pointer-events: none;
}
.cover-fallback b { font-family: var(--serif); font-size: 26px; line-height: 1.3; letter-spacing: .06em; }
.cover-fallback i {
  font-style: normal;
  font-size: 9px;
  letter-spacing: .3em;
  opacity: .6;
  text-transform: uppercase;
}

.cover-0 .cover-fallback, .detail-cover.cover-0 { background: linear-gradient(145deg, #5c2419, #24100c); }
.cover-1 .cover-fallback, .detail-cover.cover-1 { background: linear-gradient(145deg, #6b4d18, #241b0c); }
.cover-2 .cover-fallback, .detail-cover.cover-2 { background: linear-gradient(145deg, #243f56, #0d1620); }
.cover-3 .cover-fallback, .detail-cover.cover-3 { background: linear-gradient(145deg, #234b3f, #0c1a16); }
.cover-4 .cover-fallback, .detail-cover.cover-4 { background: linear-gradient(145deg, #402744, #170d1a); }

.price-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 5px 12px;
  border: 1px solid rgba(216, 169, 74, .45);
  border-radius: 6px;
  background: rgba(12, 10, 15, .82);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.price-badge .price-num { color: var(--gold-2); font-size: 13px; }
.price-badge .price-free { color: #7fd3b4; }

.price-num { font-weight: 800; font-size: 18px; color: var(--gold-2); }
.price-num em { font-style: normal; font-size: .68em; margin-right: 1px; }
.price-free { font-weight: 700; color: #6fcaa6; }

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.card-cat { color: var(--gold); font-weight: 600; letter-spacing: .02em; }
.card-ver { color: var(--muted-2); font-variant-numeric: tabular-nums; }

.card-title { font-size: 17px; line-height: 1.5; font-weight: 700; }
.card-title a:hover { color: var(--gold-2); }

.card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: var(--muted-2);
  font-size: 12px;
}

/* ---------- 分类 ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.cat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: #14111a;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.cat-card:hover { transform: translateY(-3px); border-color: rgba(216, 169, 74, .45); background: #191420; }

.cat-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #6a2a20, #2a1210);
  color: #f0d4a4;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 800;
}
.cat-card.cover-1 .cat-icon { background: linear-gradient(145deg, #6b4d18, #241b0c); }
.cat-card.cover-2 .cat-icon { background: linear-gradient(145deg, #243f56, #0d1620); }
.cat-card.cover-3 .cat-icon { background: linear-gradient(145deg, #234b3f, #0c1a16); }
.cat-card.cover-4 .cat-icon { background: linear-gradient(145deg, #402744, #170d1a); }

.cat-body { display: flex; flex-direction: column; min-width: 0; }
.cat-body strong { font-size: 15px; }
.cat-body span { font-size: 12px; color: var(--muted); }
.cat-arrow { margin-left: auto; color: var(--muted-2); transition: transform .2s ease, color .2s ease; }
.cat-card:hover .cat-arrow { transform: translateX(3px); color: var(--gold); }

/* ---------- 优势 ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature {
  position: relative;
  padding: 26px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.feature h3 { margin: 16px 0 8px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 13px; }

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(216, 169, 74, .3);
  border-radius: 8px;
  background: rgba(216, 169, 74, .08);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .04em;
}

/* ---------- 授权 ---------- */
.license-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.license-card {
  padding: 26px;
  background: #14111a;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.license-card h3 { margin: 0 0 8px; font-size: 17px; color: var(--gold-2); }
.license-card p { margin: 0; color: var(--muted); font-size: 13px; }

/* ---------- FAQ ---------- */
.faq-wrap { max-width: 900px; }
.faq-list { display: grid; gap: 10px; }
.faq-list details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
}
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  color: var(--gold);
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}
.faq-list details[open] summary::after { content: "\2212"; }
.faq-list details p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- CTA ---------- */
.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin: 0 0 76px;
  padding: 44px;
  border: 1px solid rgba(216, 169, 74, .28);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(520px 240px at 90% 0%, rgba(165, 47, 36, .38), transparent 62%),
    linear-gradient(120deg, #1a1520, #241a1a);
  box-shadow: 0 26px 60px rgba(0, 0, 0, .45);
}
.cta h2 { margin: 0 0 8px; font-family: var(--serif); font-size: 25px; color: var(--ink); }
.cta p { margin: 0; color: var(--muted); font-size: 14px; }
.cta-actions { display: flex; gap: 12px; flex-shrink: 0; }

/* ---------- 列表页头 ---------- */
.page-head {
  padding: 46px 0 34px;
  background:
    radial-gradient(600px 240px at 10% 0%, rgba(165, 47, 36, .18), transparent 65%),
    linear-gradient(180deg, #121016 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.page-title { font-family: var(--serif); font-size: clamp(26px, 3vw, 36px); letter-spacing: .02em; }
.page-desc { max-width: 760px; margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.page-count { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.page-count strong { color: var(--gold-2); }

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--muted-2);
  font-size: 13px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb span[aria-hidden] { color: #4a4155; }
.breadcrumb .current { color: var(--ink-2); }

.search-again {
  display: flex;
  gap: 8px;
  max-width: 560px;
  margin-top: 20px;
  padding: 7px;
  background: #14111a;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.search-again input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
}
.search-again input::placeholder { color: var(--muted-2); }

/* ---------- 工具条 ---------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #14111a;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip.is-active { background: rgba(216, 169, 74, .14); border-color: rgba(216, 169, 74, .55); color: var(--gold-2); }

.toolbar-right { display: flex; align-items: center; gap: 16px; }
.result-count { color: var(--muted); font-size: 13px; }
.result-count strong { color: var(--ink); }

.select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #14111a;
  color: var(--ink-2);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.select:focus { border-color: var(--gold); }

/* ---------- 空状态 ---------- */
.empty {
  padding: 56px 24px;
  text-align: center;
  background: var(--card);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}
.empty strong { display: block; font-size: 17px; color: var(--ink); }
.empty p { max-width: 460px; margin: 8px auto 20px; color: var(--muted); font-size: 14px; }
.empty-filter { margin-top: 24px; }

/* ---------- 分页 ---------- */
.pagebar { margin-top: 38px; }
.pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.pager .page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 13px;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.pager a.page:hover { border-color: var(--gold); color: var(--gold-2); }
.pager .now-page { background: rgba(216, 169, 74, .16); border-color: rgba(216, 169, 74, .5); color: var(--gold-2); font-weight: 700; }

/* ---------- 详情页 ---------- */
.page-single { padding: 30px 0 70px; }

.detail-head { max-width: 920px; margin-bottom: 26px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border: 1px solid rgba(216, 169, 74, .32);
  border-radius: 6px;
  background: rgba(216, 169, 74, .09);
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 700;
}
.pill-soft {
  background: transparent;
  border-color: var(--line-2);
  color: var(--muted);
  font-weight: 600;
}

.detail-title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(26px, 3.3vw, 40px);
  letter-spacing: .01em;
  line-height: 1.28;
}
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 13px; }
.detail-meta a { color: var(--gold); font-weight: 600; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 28px;
  align-items: start;
}

.detail-main { min-width: 0; }

.detail-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-cover .cover-fallback b { font-size: clamp(24px, 3vw, 38px); }
.cover-demo {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 8px 14px;
  border: 1px solid rgba(216, 169, 74, .4);
  border-radius: 8px;
  background: rgba(12, 10, 15, .82);
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.cover-demo:hover { background: rgba(12, 10, 15, .95); }

.panel {
  margin-bottom: 20px;
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: .02em;
}
.panel-title::before {
  content: "";
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gold-2), #9c6a1d);
}
.panel-action { margin: 22px 0 0; }
.tag-panel .panel-title { margin-bottom: 14px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.tag-chip:hover {
  border-color: rgba(216, 169, 74, .55);
  background: rgba(216, 169, 74, .1);
  color: var(--gold-2);
}
.demo-video {
  display: block;
  width: 100%;
  max-height: 420px;
  margin: 22px 0 0;
  background: #000;
  border: 1px solid rgba(216, 169, 74, 0.28);
  border-radius: 6px;
}

.dl-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.dl-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .02);
}
.dl-name { flex: 1; min-width: 0; color: #e7dfe9; font-size: 14px; word-break: break-all; }
.dl-size { flex: none; color: #8d8195; font-size: 12px; }
.dl-code {
  flex: none;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(216, 169, 74, .12);
  color: var(--gold-2);
  font-size: 12px;
}
.dl-btn {
  flex: none;
  padding: 6px 16px;
  border: 1px solid rgba(216, 169, 74, .5);
  border-radius: 6px;
  color: var(--gold-2);
  font-size: 13px;
  text-decoration: none;
}
.dl-btn:hover { background: rgba(216, 169, 74, .12); color: var(--gold-2); }
.gate { padding: 10px 4px 4px; text-align: center; }
.gate strong { display: block; margin-bottom: 8px; color: #f2e8d8; font-size: 16px; }
.gate p { margin: 0 0 14px; color: #a89cae; font-size: 13px; line-height: 1.8; }
.download-panel .btn { display: inline-block; }

.article-body { color: #c3b9c8; font-size: 15px; line-height: 1.9; }
.article-body > :first-child { margin-top: 0; }
.article-body > :last-child { margin-bottom: 0; }
.article-body h2 {
  margin: 30px 0 12px;
  padding-left: 12px;
  border-left: 3px solid rgba(216, 169, 74, .7);
  font-size: 20px;
  color: #f2e8d8;
}
.article-body h3 { margin: 24px 0 10px; font-size: 16px; color: var(--gold-2); }
.article-body a { color: var(--gold); border-bottom: 1px solid rgba(216, 169, 74, .35); }
.article-body img { margin: 16px 0; border-radius: 10px; border: 1px solid var(--line); }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin: 6px 0; }
.article-body li::marker { color: var(--gold); }
.article-body blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 3px solid var(--gold);
  background: rgba(216, 169, 74, .06);
  border-radius: 0 8px 8px 0;
  color: #b9aec2;
}
.article-body code {
  padding: 2px 6px;
  border-radius: 4px;
  background: #221c2b;
  color: var(--gold-2);
  font-size: .9em;
}
.article-body pre {
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0f0d13;
  color: #cfc4d6;
}
.article-body pre code { padding: 0; background: transparent; color: inherit; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.article-body th, .article-body td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.article-body th { background: #1d1826; color: var(--gold-2); font-weight: 600; }

.file-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1a1622;
  font-size: 14px;
  color: var(--ink-2);
}
.file-check {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(79, 156, 134, .18);
  color: #6fcaa6;
  font-size: 11px;
  flex-shrink: 0;
}

.log-list { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line-2); }
.log-list li { position: relative; padding: 0 0 18px 22px; color: #b9aec2; font-size: 14px; }
.log-list li:last-child { padding-bottom: 0; }
.log-list li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(216, 169, 74, .14);
}

.license-list { margin: 0; padding: 0; list-style: none; }
.license-list li { padding: 11px 0; border-bottom: 1px dashed var(--line); color: #b9aec2; font-size: 14px; }
.license-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.license-list strong { color: var(--gold-2); }

.author-panel { display: flex; align-items: center; gap: 16px; }
.author-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(145deg, #b8873a, #6d4a14);
  color: #1d1405;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 800;
  flex-shrink: 0;
}
.author-info { min-width: 0; }
.author-info strong { display: block; font-size: 15px; }
.author-info p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.author-panel .btn { margin-left: auto; }

/* ---------- 购买卡 ---------- */
.detail-aside { min-width: 0; }
.buy-card {
  padding: 24px;
  background:
    radial-gradient(320px 160px at 100% 0%, rgba(216, 169, 74, .12), transparent 70%),
    var(--card);
  border: 1px solid rgba(216, 169, 74, .28);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.buy-label { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .06em; }
.buy-price { margin: 6px 0 2px; }
.buy-price .price-num { font-family: var(--serif); font-size: 42px; letter-spacing: -.01em; }
.buy-price .price-free { font-size: 34px; }
.buy-note { margin: 0 0 20px; color: var(--muted); font-size: 13px; }

.buy-actions { display: grid; gap: 10px; }

.buy-meta { margin: 22px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); }
.buy-meta div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; }
.buy-meta dt { color: var(--muted); }
.buy-meta dd { margin: 0; color: var(--ink); font-weight: 600; }

.buy-hint {
  margin: 18px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1a1622;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.buy-rights {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* ---------- 付费资源预览锁 ---------- */
.preview-body {
  position: relative;
  max-height: 240px;
  overflow: hidden;
}
.preview-body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  background: linear-gradient(rgba(23, 19, 30, 0), var(--card));
  pointer-events: none;
}
.preview-text { margin: 0; color: var(--ink); line-height: 1.9; }

.preview-gate {
  margin-top: 18px;
  padding: 20px;
  border: 1px dashed rgba(216, 169, 74, .38);
  border-radius: var(--radius);
  background: rgba(216, 169, 74, .06);
}
.preview-gate strong { display: block; color: var(--gold-2); font-size: 16px; }
.preview-gate p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.preview-gate .preview-rights { color: var(--ink); }
.preview-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.support-card {
  margin-top: 18px;
  padding: 22px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--card);
}
.support-card strong { display: block; font-size: 15px; color: var(--ink); }
.support-card p { margin: 6px 0 12px; color: var(--muted); font-size: 13px; }
.support-card a { color: var(--gold); font-size: 13px; font-weight: 700; }

/* ---------- 独立页面 ---------- */
.page-card {
  padding: 38px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.page-card-head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.page-card-head h1 { margin: 0 0 6px; font-family: var(--serif); font-size: 30px; }
.page-card-head p { margin: 0; color: var(--muted); font-size: 13px; }
.page-comments { margin-top: 22px; }

/* ---------- 404 ---------- */
.notfound {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 24px 60px;
  text-align: center;
}
.notfound-code {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(80px, 16vw, 150px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
  background: linear-gradient(120deg, #f6dc9c, #a8741f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.notfound h1 { margin: 10px 0 10px; font-size: 26px; }
.notfound p { color: var(--muted); }
.notfound .search-again { margin: 22px auto; text-align: left; }
.notfound-actions { display: flex; justify-content: center; gap: 12px; }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 5, 9, .74);
  backdrop-filter: blur(5px);
}
.modal[hidden] { display: none; }
.modal-card {
  position: relative;
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid rgba(216, 169, 74, .3);
  border-radius: var(--radius-lg);
  background: #17131e;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7);
}
.modal-card h3 { margin: 0 0 12px; font-size: 20px; color: var(--gold-2); }
.modal-card p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.modal-card #buyModalExtra { white-space: pre-line; }
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #241d2e;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: #2e2539; color: var(--ink); }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 评论 ---------- */
.comments-panel .msghead { margin: 0 0 10px; padding: 0; list-style: none; }
.comments-panel .tbname { font-weight: 700; color: var(--ink); }
.comments-panel .msg {
  margin: 0 0 14px;
  padding: 16px 18px;
  list-style: none;
  background: #1a1622;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.comments-panel .msg .msgname { font-weight: 700; color: var(--gold-2); }
.comments-panel .msg .msgtime { color: var(--muted-2); font-size: 12px; margin-left: 8px; }
.comments-panel .msg .msgcontent { margin-top: 6px; color: #b9aec2; }
.comments-panel #divCommentPost { margin-top: 18px; }
.comments-panel #divCommentPost .posttop { font-weight: 700; margin-bottom: 10px; }
.comments-panel #divCommentPost p { margin: 0 0 10px; }
.comments-panel #divCommentPost .text {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #14111a;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.comments-panel #divCommentPost .text:focus { border-color: rgba(216, 169, 74, .55); }
.comments-panel #divCommentPost .button {
  padding: 9px 20px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #e0b45a, #c98f2e);
  color: #231a08;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.comments-panel .postbottom { color: var(--muted-2); font-size: 12px; }

/* ---------- 页脚 ---------- */
.site-foot {
  margin-top: 20px;
  padding: 58px 0 26px;
  background: #08070b;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  gap: 36px;
}
.foot-brand .brand { color: var(--ink); }
.brand-light .brand-sub { color: var(--muted-2); }
.foot-brand p { max-width: 350px; margin: 16px 0 0; font-size: 13px; line-height: 1.8; }
.foot-col h4 { margin: 0 0 14px; color: var(--ink); font-size: 14px; letter-spacing: .04em; }
.foot-col a { display: block; padding: 4px 0; font-size: 13px; color: var(--muted); }
.foot-col a:hover { color: var(--gold-2); }
.foot-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted-2);
}
.foot-built a { color: var(--muted); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { max-width: 520px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-aside { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
  .support-card { margin-top: 0; }
}

@media (max-width: 860px) {
  .main-nav {
    display: none;
    position: absolute;
    top: var(--head-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 12px 20px 18px;
    background: #100d15;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px rgba(0, 0, 0, .5);
  }
  .main-nav.is-open { display: flex; }
  .nav-link { padding: 11px 14px; border-radius: 8px; }
  .nav-toggle { display: block; margin-left: auto; }
  .head-tools { margin-left: 0; }
  .head-search { display: none; }
  .head-inner { gap: 12px; position: relative; }

  .license-grid { grid-template-columns: 1fr; }
  .cta { flex-direction: column; align-items: flex-start; padding: 34px 26px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .detail-aside { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .wrap { width: calc(100% - 36px); }
  .hero { padding: 62px 0 56px; }
  .hero-search { flex-direction: column; padding: 10px; }
  .hero-search input { padding: 8px 6px; }
  .hero-stats { gap: 26px; }
  .hero-stats strong { font-size: 21px; }
  .section { padding: 52px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-title { font-size: 23px; }
  .card-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .file-list { grid-template-columns: 1fr; }
  .page-head { padding: 32px 0 26px; }
  .panel, .page-card { padding: 20px; }
  .detail-cover { border-radius: var(--radius); }
  .detail-meta { gap: 6px 16px; }
  .cta-actions { width: 100%; }
  .cta-actions .btn { flex: 1; }
  .foot-grid { grid-template-columns: 1fr; gap: 26px; }
  .foot-bottom { justify-content: flex-start; }
  .user-name { display: none; }
  .author-panel { flex-wrap: wrap; }
  .author-panel .btn { margin-left: 0; }
  .toolbar { align-items: flex-start; }
  .toolbar-right { width: 100%; justify-content: space-between; }
  .cover-fallback b { font-size: 22px; }
}

/* ---------- 移动端与触摸设备适配 ---------- */

html { scroll-padding-top: calc(var(--head-h) + 10px); }

/* 移动菜单内的搜索入口，桌面隐藏 */
.nav-search {
  display: none;
  gap: 8px;
  margin-top: 6px;
  padding: 5px 5px 5px 14px;
  background: #17131f;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.nav-search input {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  outline: none;
  color: var(--ink);
  font-size: 15px;
}
.nav-search input::placeholder { color: var(--muted-2); }
.nav-search button {
  flex: none;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: rgba(216, 169, 74, .16);
  color: var(--gold-2);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* 详情页底部固定操作条，桌面隐藏 */
.detail-buybar { display: none; }

@media (max-width: 860px) {
  :root { --head-h: 64px; }

  /* 兜底：意外超宽内容不产生整页横向滚动；用 clip 而非 hidden，避免影响 sticky 顶栏 */
  html { overflow-x: clip; }

  .main-nav {
    top: var(--head-h);
    max-height: calc(100vh - var(--head-h));
    max-height: calc(100dvh - var(--head-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  .nav-link { padding: 12px 14px; font-size: 15px; }
  .nav-search { display: flex; }

  /* 输入控件统一 16px：iOS Safari / 微信在字号 <16px 时聚焦会自动放大页面 */
  .hero-search input,
  .search-again input,
  .head-search input,
  .nav-search input,
  .comments-panel #divCommentPost .text,
  .select { font-size: 16px; }

  /* 详情页底部固定操作条 */
  .detail-buybar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    padding: 10px calc(16px + env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
    background: rgba(15, 12, 19, .96);
    border-top: 1px solid var(--line-2);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, .5);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }
  .buybar-price {
    display: flex;
    flex: none;
    flex-direction: column;
    font-family: var(--serif);
    font-weight: 800;
    line-height: 1.15;
    color: var(--gold-2);
  }
  .buybar-price .price-num { font-size: 20px; }
  .buybar-price .price-free { font-size: 17px; }
  .buybar-label {
    margin-top: 3px;
    color: var(--muted);
    font-family: var(--font);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .04em;
  }
  .detail-buybar .btn {
    flex: none;
    min-height: 44px;
    margin-left: auto;
    padding: 11px 22px;
  }
  .type-article { padding-bottom: calc(var(--buybar-h) + 16px); }
}

@media (max-width: 620px) {
  .head-inner { gap: 10px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 8px; font-size: 18px; }
  .brand-name { font-size: 16px; }
  .head-tools { gap: 8px; }
  .head-tools .btn-sm { padding: 8px 12px; }
  .link-login { font-size: 13px; }

  .page-single { padding: 22px 0 54px; }
  .detail-title { font-size: 24px; }
  .detail-badges { gap: 6px; }
  .buy-card { padding: 20px; }
  .buy-price .price-num { font-size: 36px; }

  /* 正文长串与宽表格：换行 / 横向滚动，避免撑破页面 */
  .article-body { overflow-wrap: break-word; word-break: break-word; }
  .article-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .article-body th, .article-body td { white-space: nowrap; }

  .dl-item { flex-wrap: wrap; }
  .dl-main { flex: 1 1 100%; }
  .dl-name { flex: 1 1 100%; }
  .dl-btn { margin-left: auto; }

  .panel, .page-card { padding: 18px; }
  .page-card { border-radius: var(--radius); }
  .page-card-head h1 { font-size: 24px; }
  .support-card { padding: 18px; }

  .notfound-actions { flex-wrap: wrap; }
  .notfound-actions .btn { flex: 1 1 140px; }

  .chip { min-height: 40px; padding: 9px 16px; }
  .pager .page { min-width: 42px; height: 42px; }
  .foot-col a { padding: 9px 0; }
  .foot-bottom { gap: 8px; }

  /* 弹窗贴底显示，内容可滚动 */
  .modal { align-items: flex-end; padding: 12px; }
  .modal-card {
    width: 100%;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 26px 20px calc(20px + env(safe-area-inset-bottom));
  }
  .modal-close { top: 8px; right: 8px; width: 40px; height: 40px; }
  .modal-actions .btn { flex: 1 1 auto; }

  .cta { padding: 28px 20px; }
}

@media (max-width: 420px) {
  .wrap { width: calc(100% - 28px); }
  .brand { gap: 8px; }
  .brand-mark { width: 30px; height: 30px; font-size: 16px; }
  .brand-name { font-size: 15px; }
  .brand-sub { display: block; font-size: 9px; letter-spacing: .06em; margin-top: 1px; max-width: 168px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .head-tools .btn-sm { padding: 7px 10px; font-size: 12px; }
  .nav-toggle { width: 38px; height: 38px; padding: 9px; }

  .hero { padding: 46px 0 42px; }
  .hero h1 { font-size: 28px; }
  .hero-lead { font-size: 14px; }
  .hero-stats { gap: 16px; margin-top: 28px; }
  .hero-stats strong { font-size: 18px; }
  .hero-tags { font-size: 12px; }
  .float-card { display: none; }

  .section { padding: 40px 0; }
  .section-title { font-size: 21px; }
  .section-head { gap: 10px; }

  .panel, .page-card { padding: 15px; }
  .detail-buybar {
    gap: 8px;
    padding: 8px calc(12px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(12px + env(safe-area-inset-left));
  }
  .buybar-price .price-num { font-size: 18px; }
  .detail-buybar .btn { padding: 10px 16px; font-size: 13px; }

  .pager { gap: 6px; }
  .pager .page { min-width: 38px; height: 38px; padding: 0 10px; }
  .foot-grid { gap: 20px; }
  .notfound-code { font-size: 72px; }
}

/* 触摸设备：去掉悬停位移，避免点按后卡片"粘"在浮起状态 */
@media (hover: none) {
  .tpl-card:hover { transform: none; border-color: var(--line); box-shadow: none; }
  .cat-card:hover { transform: none; background: #14111a; }
  .btn:hover { transform: none; }
}

/* 手机横屏：压缩首屏装饰，内容优先 */
@media (max-width: 900px) and (max-height: 520px) and (orientation: landscape) {
  .hero { padding: 42px 0 38px; }
  .hero h1 { font-size: 30px; }
  .hero-visual { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- 账号中心：注册 / 找回密码 ---------- */
.account-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 0 64px;
}

.account-card .page-card-head h1 { font-size: 26px; }

.acc-form { display: grid; gap: 16px; }

.acc-fld { display: grid; gap: 6px; min-width: 0; }

.acc-fld > label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: .02em;
}

.acc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.acc-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.acc-input::placeholder { color: var(--muted-2); }

.acc-input:hover { border-color: #4a3f56; }

.acc-input:focus {
  outline: 0;
  border-color: var(--gold);
  background: #17131d;
  box-shadow: 0 0 0 3px rgba(216, 169, 74, .16);
}

select.acc-input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.acc-token { font-family: Consolas, Menlo, monospace; letter-spacing: .04em; }

.acc-tip { margin: 0; color: var(--muted-2); font-size: 12px; line-height: 1.7; }

.acc-cap { display: flex; align-items: center; gap: 10px; }
.acc-cap .acc-input { flex: 1 1 auto; min-width: 0; }

.acc-cap-img {
  flex: 0 0 auto;
  width: 120px;
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  object-fit: cover;
}

.acc-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.7;
  cursor: pointer;
}

.acc-check input { flex: 0 0 auto; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--gold); }

.acc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.acc-alert {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.8;
}

.acc-alert-bad {
  border-color: rgba(217, 74, 54, .5);
  background: rgba(165, 47, 36, .16);
  color: #f3b6ac;
}

.acc-alert-good {
  border-color: rgba(79, 156, 134, .5);
  background: rgba(79, 156, 134, .14);
  color: #a7dcc9;
}

.acc-alert-tips {
  border-color: rgba(216, 169, 74, .38);
  background: rgba(216, 169, 74, .1);
  color: var(--gold-2);
}

.acc-block {
  margin: 0 0 18px;
  padding: 20px 22px 22px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.acc-block h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 18px;
}

.acc-block > p { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.8; }

.acc-done { margin: 0 0 18px; padding: 18px 20px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius); }

.acc-done h2 { margin: 0 0 10px; font-family: var(--serif); font-size: 17px; }

.acc-guide, .acc-meta { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 13.5px; line-height: 1.9; }

.acc-meta { padding-left: 0; list-style: none; }
.acc-guide li + li, .acc-meta li + li { margin-top: 4px; }
.acc-meta b, .acc-guide b { color: var(--gold-2); font-weight: 700; }

/* 个人中心：页签与已购资源列表 */
.account-page-wide { max-width: 900px; }

.acc-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 22px;
  padding: 4px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow-x: auto;
  scrollbar-width: none;
}

.acc-tabs::-webkit-scrollbar { display: none; }

.acc-tab {
  flex: 1 0 auto;
  padding: 9px 16px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease;
}

.acc-tab:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }

.acc-tab.is-active { background: var(--gold); color: #1a1206; }

.acc-tab-num {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
  font-size: 11px;
  line-height: 18px;
}

.acc-tab.is-active .acc-tab-num { background: rgba(0, 0, 0, .18); color: #1a1206; }

textarea.acc-input { min-height: 96px; resize: vertical; }

.acc-orders { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

.acc-order {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.acc-order-title { color: var(--ink); font-size: 14.5px; font-weight: 700; text-decoration: none; }

.acc-order-title:hover { color: var(--gold-2); }

.acc-order-meta { color: var(--muted-2); font-size: 12px; }

/* ---------- 顶栏登录态 ---------- */
.head-logout { margin: 0; }

.link-logout {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.link-logout:hover { color: var(--ink); }

.dl-main { flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }

.dl-note { color: var(--muted); font-size: 12.5px; }

.dl-time { color: var(--muted-2); font-size: 12px; white-space: nowrap; }

@media (max-width: 620px) {
  .account-page { padding: 22px 0 48px; }
  .acc-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .account-card .page-card-head h1 { font-size: 22px; }
  .acc-block { padding: 16px 16px 18px; }
  .acc-actions .btn { flex: 1 1 auto; }
}
