:root {
  --bg: #0b0d12;
  --bg-soft: #11141c;
  --card: #151924;
  --card-2: #1b2030;
  --line: rgba(255, 255, 255, .08);
  --text: #eef1f7;
  --muted: #98a2b8;
  --brand: #5b8cff;
  --brand-2: #a86bff;
  --accent: #ff7a59;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --max: 1240px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; }

/* 容器左右留白随视口收缩，窄屏不至于贴边 */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 clamp(12px, 3vw, 20px); }

/* ---------- 顶栏（深色胶囊条） ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 14px 0;
  background: linear-gradient(180deg, rgba(11, 13, 18, .94) 40%, rgba(11, 13, 18, .55));
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 62px;
  padding: 0 14px;
  border-radius: 999px;
  background: #1c1c20;
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .5);
}

.logo { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; letter-spacing: .5px; flex: none; }

.logo-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: url("../logo.png") center/contain no-repeat;
  flex: none;
}

.nav { display: flex; align-items: center; gap: 4px; margin-left: 4px; flex: 1; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 999px; color: #cfd3dc;
  font-size: 15px; font-weight: 600; white-space: nowrap; transition: .2s;
}
.nav a svg { width: 17px; height: 17px; flex: none; stroke: currentColor; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav a.active { color: #fff; background: #0a0a0c; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }

/* 搜索框：简约现代风，左侧图标 + 无边框输入 + 圆形提交按钮 */
.search {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 999px; padding: 5px 6px 5px 14px;
  width: 240px; flex: none;
  transition: width .25s ease, border-color .2s, background .2s, box-shadow .2s;
}
.search:focus-within {
  width: 300px;
  background: rgba(255, 255, 255, .07);
  border-color: rgba(91, 140, 255, .55);
  box-shadow: 0 0 0 3px rgba(91, 140, 255, .12);
}
.search-icon {
  width: 17px; height: 17px; flex: none;
  fill: none; stroke: #7c869c; stroke-width: 1.9;
  stroke-linecap: round; transition: stroke .2s;
}
.search:focus-within .search-icon { stroke: var(--brand); }
.search input {
  flex: 1; background: none; border: 0; outline: none;
  color: var(--text); font-size: 14px; min-width: 0; height: 28px;
}
.search input::placeholder { color: #6b7488; }
/* 提交按钮：默认低调，聚焦或悬停时点亮品牌色 */
.search-go {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; flex: none; padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .07); color: var(--muted);
  transition: .2s;
}
.search-go svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor;
  stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round;
}
.search-go:hover, .search:focus-within .search-go {
  background: var(--brand); color: #fff;
}

.menu-btn {
  display: none; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  color: var(--text); border-radius: 999px; padding: 6px 12px;
}

/* ---------- 轮播 ---------- */
.hero { position: relative; margin-top: 24px; }
.slider {
  position: relative; height: clamp(240px, 34vw, 460px); border-radius: 22px;
  overflow: hidden; box-shadow: var(--shadow); background: var(--card);
}
.slide {
  position: absolute; inset: 0; opacity: 0;
  transition: opacity .8s ease; pointer-events: none;
}
.slide.active { opacity: 1; pointer-events: auto; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-mask {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(6, 8, 13, .88) 0%, rgba(6, 8, 13, .45) 45%, rgba(6, 8, 13, .1) 100%);
}
.slide-body {
  position: absolute; left: 8%; top: 50%; transform: translateY(-50%);
  max-width: 520px;
}
.slide-tag {
  display: inline-block; font-size: 13px; color: #cfe0ff;
  background: rgba(91, 140, 255, .18); border: 1px solid rgba(91, 140, 255, .4);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 14px;
}
.slide-body h2 { margin: 0 0 10px; font-size: clamp(22px, 3.4vw, 42px); line-height: 1.15; }
.slide-body p { margin: 0 0 22px; color: #c6cede; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 12px; border: 1px solid transparent;
  font-size: 15px; transition: .2s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: 0 10px 24px rgba(91, 140, 255, .3);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost { background: rgba(255, 255, 255, .08); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, .16); }

.slider-dots { position: absolute; left: 8%; bottom: 28px; display: flex; gap: 8px; }
.slider-dots span {
  width: 26px; height: 4px; border-radius: 3px;
  background: rgba(255, 255, 255, .3); cursor: pointer; transition: .3s;
}
.slider-dots span.active { background: #fff; width: 40px; }

.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(10, 12, 18, .55); border: 1px solid var(--line);
  color: #fff; display: grid; place-items: center; z-index: 5;
}
.slider-arrow:hover { background: rgba(10, 12, 18, .85); }
.slider-arrow.prev { left: 18px; }
.slider-arrow.next { right: 18px; }

/* ---------- 区块 ---------- */
.section { margin: 56px 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
}
.section-head h3 { margin: 0; font-size: 24px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.section-head a { color: var(--brand); font-size: 14px; }

/* ---------- 分类卡片 ---------- */
/* auto-fill + minmax：列数随容器宽度自然增减，断点只做微调 */
.cat-grid {
  display: grid; gap: clamp(10px, 1.5vw, 16px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}
.cat-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4 / 3; background: var(--card); border: 1px solid var(--line);
}
.cat-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.cat-card:hover img { transform: scale(1.08); }
.cat-card .mask {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(6, 8, 13, .85));
}
.cat-card .info { position: absolute; left: 16px; right: 16px; bottom: 14px; }
.cat-card h4 { margin: 0; font-size: 17px; }
.cat-card span { font-size: 13px; color: #b9c2d4; }

/* ---------- 壁纸卡片 ---------- */
/* 默认按 4 列的最小宽度铺，cols-3 用更大的最小宽度得到更疏的排布 */
.wall-grid {
  display: grid; gap: clamp(10px, 1.6vw, 18px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}
.wall-grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

.wall-card {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: .28s;
}
.wall-card:hover { transform: translateY(-4px); border-color: rgba(91, 140, 255, .5); box-shadow: var(--shadow); }
.wall-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--card-2); }
.wall-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.wall-card:hover .wall-thumb img { transform: scale(1.06); }

/* 缩略图缺失时的占位：视频封面要等服务端截帧，空 <img> 会显示成裂图 */
.wall-noimg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-2); color: var(--muted); font-size: 13px;
}

/* 动态壁纸角标：与 hover 遮罩层叠，始终可见 */
.live-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px 4px 7px; border-radius: 999px;
  background: rgba(6, 8, 13, .62); border: 1px solid rgba(255, 255, 255, .18);
  color: #fff; font-size: 12px; font-weight: 600; backdrop-filter: blur(6px);
}
.live-badge svg { width: 13px; height: 13px; }

.wall-hover {
  position: absolute; inset: 0; opacity: 0; transition: .28s;
  background: linear-gradient(180deg, rgba(6, 8, 13, .1), rgba(6, 8, 13, .8));
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 12px;
}
.wall-card:hover .wall-hover { opacity: 1; }
/* 触屏没有 hover，操作条常显，否则收藏/下载按钮永远点不到 */
@media (hover: none) {
  .wall-hover { opacity: 1; background: linear-gradient(180deg, transparent 45%, rgba(6, 8, 13, .8)); }
}
.chip {
  background: rgba(255, 255, 255, .14); border: 1px solid var(--line);
  color: #fff; border-radius: 10px; padding: 6px 12px; font-size: 13px;
  backdrop-filter: blur(6px);
}
.chip:hover { background: rgba(91, 140, 255, .8); border-color: transparent; }

.wall-body { padding: 12px 14px 14px; }
.wall-body h4 {
  margin: 0 0 6px; font-size: 15px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wall-meta {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--muted); font-size: 12.5px;
}
.badge {
  font-size: 12px; color: #cfe0ff; background: rgba(91, 140, 255, .16);
  border-radius: 999px; padding: 2px 10px;
}

/* ---------- 筛选栏 ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 16px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 14px; margin-bottom: 24px;
}
.pill {
  padding: 7px 15px; border-radius: 999px; font-size: 14px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  transition: .2s;
}
.pill:hover { color: var(--text); }
.pill.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.filter-bar .spacer { flex: 1; }
.select {
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; font-size: 14px; outline: none;
  max-width: 100%; min-width: 0;
}

/* ---------- 分页 ---------- */
.pager { display: flex; justify-content: center; gap: 8px; margin: 36px 0 10px; flex-wrap: wrap; }
.pager button {
  min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
}
.pager button:hover:not(:disabled) { color: var(--text); border-color: var(--brand); }
.pager button.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.pager button:disabled { opacity: .4; cursor: not-allowed; }

.empty { text-align: center; color: var(--muted); padding: 70px 0; }

/* ---------- 桌面客户端介绍 ---------- */
.soft-card {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr);
  gap: 34px; align-items: center;
  padding: 34px; border-radius: 22px;
  background: linear-gradient(135deg, var(--card-2), var(--card));
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.soft-tag {
  display: inline-block; font-size: 13px; color: #cfe0ff;
  background: rgba(91, 140, 255, .18); border: 1px solid rgba(91, 140, 255, .4);
  padding: 4px 12px; border-radius: 999px;
}
.soft-intro h3 { margin: 14px 0 10px; font-size: 28px; }
.soft-intro > p { margin: 0 0 20px; color: var(--muted); font-size: 15px; }

.soft-feature { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
.soft-feature li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14px; color: #c6cede;
}
.soft-feature svg {
  width: 18px; height: 18px; flex: none; margin-top: 3px;
  stroke: var(--brand);
}
.soft-feature b { color: var(--text); margin-right: 6px; font-weight: 600; }

.soft-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.soft-actions .btn svg { width: 18px; height: 18px; }
.soft-note { font-size: 13px; color: var(--muted); }

.soft-shot { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.soft-shot img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 1000px) {
  .soft-card { grid-template-columns: 1fr; padding: 24px; gap: 24px; }
  .soft-shot { order: -1; }
}

/* ---------- 软件独立页 ---------- */
.soft-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  gap: 40px; align-items: center; margin: 34px 0 8px;
}
.soft-hero h1 { margin: 16px 0 12px; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.2; }
.soft-hero-text > p { margin: 0 0 24px; color: var(--muted); font-size: 16px; }
.soft-hero-text .soft-note { display: block; margin-top: 14px; }
.soft-hero-shot {
  border-radius: 20px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.soft-hero-shot img { width: 100%; }

.soft-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.soft-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 22px; transition: .2s;
}
.soft-item:hover { border-color: rgba(91, 140, 255, .45); transform: translateY(-3px); }
.soft-icon {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 12px; background: rgba(91, 140, 255, .14); color: var(--brand);
}
.soft-icon svg { width: 22px; height: 22px; }
.soft-item h4 { margin: 14px 0 8px; font-size: 17px; }
.soft-item p { margin: 0; color: var(--muted); font-size: 14px; }

.soft-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
.soft-steps li {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 22px;
}
.soft-step-no {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 50%; font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.soft-steps h4 { margin: 14px 0 8px; font-size: 17px; }
.soft-steps p { margin: 0; color: var(--muted); font-size: 14px; }

/* 界面截图 */
.shot-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}
.shot { margin: 0; }
/* 只有一张截图时不必占满两列宽，居中限宽看着更像展示图 */
.shot-grid-single { grid-template-columns: 1fr; max-width: 940px; margin: 0 auto; }
.shot-grid-single figcaption { text-align: center; }
.shot img {
  width: 100%; display: block; cursor: zoom-in;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--card-2); transition: .2s;
}
.shot img:hover { border-color: rgba(91, 140, 255, .5); transform: translateY(-2px); }
.shot figcaption { margin-top: 10px; font-size: 13.5px; color: var(--muted); }

.soft-faq { display: grid; gap: 12px; }
.soft-faq details {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px 20px;
}
.soft-faq summary {
  cursor: pointer; font-size: 15.5px; font-weight: 600;
  list-style: none; display: flex; align-items: center; justify-content: space-between;
}
.soft-faq summary::-webkit-details-marker { display: none; }
.soft-faq summary::after {
  content: "+"; color: var(--brand); font-size: 20px; line-height: 1; font-weight: 400;
}
.soft-faq details[open] summary::after { content: "−"; }
.soft-faq p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

.soft-cta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; margin: 56px 0 10px;
  padding: 30px 34px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(91, 140, 255, .16), rgba(168, 107, 255, .12));
  border: 1px solid rgba(91, 140, 255, .3);
}
.soft-cta h3 { margin: 0 0 6px; font-size: 24px; }
.soft-cta .btn svg { width: 18px; height: 18px; }

@media (max-width: 1000px) {
  .soft-hero { grid-template-columns: 1fr; gap: 26px; margin-top: 24px; }
  .soft-hero-shot { order: -1; }
  .soft-cta { padding: 24px; }
}

/* ---------- 详情页 ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; margin-top: 26px; }
.detail-main {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; overflow: hidden;
}
.detail-main .preview { position: relative; background: #05070b; }
.detail-main .preview img { width: 100%; max-height: min(620px, 70vh); object-fit: contain; margin: 0 auto; }
.detail-main .preview video { display: block; width: 100%; max-height: min(620px, 70vh); background: #05070b; }
.zoom-hint {
  position: absolute; right: 14px; bottom: 14px; font-size: 12.5px;
  color: #dbe3f2; background: rgba(8, 10, 16, .7);
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
}

.side-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 20px; margin-bottom: 18px;
}
.side-card h2 { margin: 0 0 6px; font-size: 22px; }
.side-card .author { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.info-list { display: grid; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.info-list li { display: flex; justify-content: space-between; font-size: 14px; }
.info-list span:first-child { color: var(--muted); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tag {
  font-size: 13px; color: #cbd5e8; background: var(--card-2);
  border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px;
}
.tag:hover { color: #fff; border-color: var(--brand); }
.btn-block { display: flex; width: 100%; justify-content: center; }
.dl-group { display: grid; gap: 10px; }

/* ---------- 灯箱 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: none;
  background: rgba(4, 6, 10, .92); padding: 40px;
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; }
.lightbox-close {
  position: absolute; top: 22px; right: 26px; width: 42px; height: 42px;
  border-radius: 50%; background: rgba(255, 255, 255, .12);
  border: 1px solid var(--line); color: #fff; font-size: 20px;
}

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px);
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  padding: 11px 20px; border-radius: 12px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: .3s; z-index: 200;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 底部 ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 70px; background: var(--bg-soft); }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px;
  padding: 44px 0 30px;
}
.footer h5 { margin: 0 0 14px; font-size: 15px; }
.footer p, .footer li { color: var(--muted); font-size: 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer a:hover { color: var(--brand); }
.footer-bottom {
  border-top: 1px solid var(--line); padding: 16px 0;
  color: #7c869c; font-size: 13px; text-align: center;
}

/* ---------- 登录 / 注册弹窗（复刻软件端 LoginDialog 的双栏结构） ---------- */
/* 顶栏登录入口与登录后的用户芯片 */
.user-area { display: flex; align-items: center; flex: none; }

.btn-login {
  height: 38px; padding: 0 20px; border-radius: 999px;
  background: var(--brand); border: none; color: #fff;
  font-size: 14px; font-weight: 600; transition: .2s;
}
.btn-login:hover { background: #6f9bff; }

/* 登录后顶栏只显示头像，芯片退化成一个圆形按钮 */
.user-chip {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  color: var(--text); transition: .2s;
}
.user-chip:hover { border-color: rgba(91, 140, 255, .5); }
.user-chip.vip { border-color: rgba(255, 255, 255, .55); }
/* 头像通用底样式：芯片、下拉菜单共用，尺寸各自覆盖 */
.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; overflow: hidden;
}
/* 有自定义头像时铺满圆形，无头像时保留渐变底 + 首字母 */
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-chip .avatar { width: 30px; height: 30px; }

/* 登录态由 JS 在 body 上切换，避免刷新瞬间两个入口同时出现 */
body.logged-in .btn-login { display: none; }
body.logged-in .user-chip { display: flex; }

/* 遮罩层 */
.auth-mask {
  position: fixed; inset: 0; z-index: 120; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(4, 6, 10, .72); backdrop-filter: blur(6px);
  overflow-y: auto;
}
.auth-mask.open { display: flex; }

/* 弹窗外壳：软件端窗口宽 624px，这里保持同一比例 */
.auth-dialog {
  position: relative; width: 100%; max-width: 624px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow);
  padding: 20px 46px 20px 20px;
  margin: auto;
  animation: auth-in .22s ease-out;
}
@keyframes auth-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.auth-close {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  border-radius: 8px; background: transparent; border: none;
  color: var(--muted); font-size: 19px; line-height: 1;
}
.auth-close:hover { background: var(--card-2); color: var(--text); }

/* 双栏舞台：左品牌 208px + 右表单，间距 44px 用于容纳 or 徽章 */
.auth-stage { display: flex; gap: 44px; position: relative; }

/* 左侧品牌面板 */
.auth-brand {
  width: 208px; flex: none; border-radius: 14px;
  padding: 22px 20px 18px;
  background: linear-gradient(160deg, #3454a8, #2b3f7d);
  display: flex; flex-direction: column;
}
.auth-brand .plate {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.auth-brand .plate span {
  width: 34px; height: 34px;
  background: url("../logo.png") center/contain no-repeat;
}
.auth-brand h4 { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: #fff; }
.auth-brand p { margin: 0; font-size: 12px; line-height: 1.7; color: rgba(255, 255, 255, .78); }

.brand-action {
  margin-top: auto; min-height: 38px; border-radius: 10px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff; font-size: 12px; font-weight: 600; transition: .2s;
}
.brand-action:hover { background: rgba(255, 255, 255, .26); }
.brand-action:disabled { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .5); }

/* 右侧表单面板 */
.auth-form {
  flex: 1; min-width: 0; border-radius: 14px;
  background: var(--card); padding: 18px 30px 18px 22px;
}

/* 分段切换器：登录 / 注册 */
.auth-seg {
  display: flex; gap: 3px; padding: 3px; margin-bottom: 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 11px;
}
.auth-seg button {
  flex: 1; min-height: 32px; border: none; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 13px; transition: .2s;
}
.auth-seg button:hover { color: var(--text); }
.auth-seg button.on { background: var(--brand); color: #fff; font-weight: 600; }

/* 输入组 */
.auth-fields { display: grid; gap: 8px; }
.auth-field { position: relative; }
.auth-field input {
  width: 100%; height: 44px; padding: 10px 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 11px;
  color: var(--text); font-size: 14px; transition: .2s;
}
.auth-field input::placeholder { color: var(--muted); }
.auth-field input:hover { border-color: rgba(255, 255, 255, .18); }
.auth-field input:focus {
  outline: none; border-color: var(--brand); background: var(--card-2);
}
/* 密码框要给右侧眼睛按钮让位，否则长密码会被图标压住 */
.auth-field.pwd input { padding-right: 42px; }

/* 密码可见性切换，图标用 SVG，描边跟随 currentColor */
.eye-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 13px; border: none;
  background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.eye-btn:hover { background: var(--card-2); color: var(--brand); }
.eye-btn svg { width: 18px; height: 18px; }
.eye-btn .slash { display: block; }
.eye-btn.on .slash { display: none; }

/* 错误提示条 */
.auth-error {
  display: none; margin-top: 10px; padding: 8px 11px;
  background: rgba(255, 95, 109, .12);
  border: 1px solid rgba(255, 95, 109, .35);
  border-radius: 9px; color: #ff5f6d; font-size: 12px;
}
.auth-error.show { display: block; }

/* or 徽章：压在两栏接缝上，与分段切换器同一水平线 */
.or-badge {
  position: absolute; z-index: 2;
  left: 208px; top: 16px; transform: translateX(9px);
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bg-soft); border: 3px solid var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text);
}

/* 圆形箭头提交按钮：压在表单右边缘，纵向对齐输入组中心 */
.arrow-btn {
  position: absolute; z-index: 2; right: -26px; top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--brand); border: 4px solid var(--bg-soft);
  color: #fff; display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.arrow-btn:hover { background: #6f9bff; }
.arrow-btn:disabled { background: #343a45; color: var(--muted); cursor: default; }
.arrow-btn svg { width: 22px; height: 22px; }

/* 窄屏改为单栏：品牌面板收成横条，浮层控件回归常规流 */
@media (max-width: 680px) {
  .auth-mask { padding: 16px; }
  .auth-dialog { max-width: 420px; padding: 20px; }
  .auth-stage { flex-direction: column; gap: 14px; }
  .auth-brand { width: auto; padding: 16px; }
  .auth-brand .plate { width: 44px; height: 44px; margin-bottom: 10px; }
  .auth-brand .plate span { width: 28px; height: 28px; }
  .auth-form { padding: 0; background: transparent; }
  .or-badge { display: none; }
  .arrow-btn {
    position: static; transform: none; width: 100%; height: 46px;
    border-radius: 11px; border: none; margin-top: 14px;
  }
}

/* ---------- 用户下拉菜单 ---------- */
.user-area { position: relative; }

.user-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 70;
  width: 250px; display: none;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.user-menu.open { display: block; }

/* 菜单顶部的资料摘要 */
.menu-head {
  display: flex; align-items: center; gap: 11px;
  padding: 14px; border-bottom: 1px solid var(--line);
}
.menu-head .avatar { width: 42px; height: 42px; font-size: 17px; }
.menu-head .who { min-width: 0; }
.menu-head .who b {
  display: block; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.menu-head .who span { font-size: 12px; color: var(--muted); }

.user-menu ul { list-style: none; margin: 0; padding: 6px; display: grid; gap: 2px; }
.user-menu button, .user-menu a {
  display: block; width: 100%; text-align: left;
  padding: 9px 11px; border: none; border-radius: 9px;
  background: transparent; color: var(--text); font-size: 14px; transition: .15s;
}
.user-menu button:hover, .user-menu a:hover { background: var(--card-2); }
.user-menu .danger { color: #ff7a84; }

/* ---------- 资料弹窗 ---------- */
.profile-dialog {
  position: relative; width: 100%; max-width: 400px;
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px; animation: auth-in .22s ease-out;
}
.profile-dialog h3 { margin: 0 0 4px; font-size: 18px; }
.profile-dialog .sub { margin: 0 0 18px; font-size: 13px; color: var(--muted); }

/* 头像与更换入口 */
.pf-avatar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.pf-avatar .pic {
  position: relative; width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff; overflow: hidden;
}
.pf-avatar .pic img { width: 100%; height: 100%; object-fit: cover; }
.pf-avatar .tip { font-size: 12px; color: var(--muted); margin: 5px 0 0; }
.btn-mini {
  padding: 6px 12px; border-radius: 9px; font-size: 13px;
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
}
.btn-mini:hover { border-color: rgba(91, 140, 255, .5); color: var(--brand); }

/* 资料字段：只读项与可编辑项统一行高 */
.pf-rows { display: grid; gap: 11px; margin-bottom: 18px; }
.pf-row { display: flex; align-items: center; gap: 12px; }
.pf-row > label { width: 62px; flex: none; font-size: 13px; color: var(--muted); }
.pf-row .val { font-size: 14px; }
.pf-row input {
  flex: 1; min-width: 0; height: 40px; padding: 8px 13px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font-size: 14px;
}
.pf-row input:focus { outline: none; border-color: var(--brand); background: var(--card-2); }
.pf-row .tag-vip {
  padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 700;
  background: rgba(255, 255, 255, .1); color: var(--muted);
}
.pf-row .tag-vip.on { background: rgba(232, 167, 44, .16); color: #f0b73f; }

.pf-foot { display: flex; justify-content: flex-end; gap: 10px; }
.pf-foot .btn { padding: 9px 20px; border-radius: 10px; font-size: 14px; }

@media (max-width: 460px) {
  .pf-row > label { width: 52px; }
}

/* ---------- 响应式 ---------- */
/* 超宽屏：放开容器上限，避免两侧大片空白 */
@media (min-width: 1700px) {
  :root { --max: 1560px; }
}

/* 中屏：顶栏元素先瘦身，详情页侧栏还放得下，先不拆栏 */
@media (max-width: 1180px) {
  .header-inner { gap: 10px; }
  .nav a { padding: 8px 12px; font-size: 14px; gap: 6px; }
  .search { width: 190px; }
  .search:focus-within { width: 240px; }
  .detail { grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* 平板横屏：导航挤不下就收进汉堡菜单，详情页改单栏 */
@media (max-width: 1000px) {
  .menu-btn { display: block; }
  .header-inner { position: relative; gap: 12px; }
  .nav {
    position: absolute; left: 0; right: 0; top: calc(100% + 8px); flex-direction: column;
    align-items: stretch; background: #1c1c20; border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 18px; box-shadow: var(--shadow);
    padding: 8px; gap: 2px; display: none; margin: 0;
  }
  .nav.open { display: flex; }
  .nav a { padding: 10px 14px; font-size: 15px; }
  .search, .search:focus-within { width: auto; flex: 1; min-width: 0; }
  .detail { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* 平板竖屏 / 大屏手机 */
@media (max-width: 760px) {
  .header { padding: 10px 0; }
  .header-inner { height: 56px; padding: 0 10px; }
  .logo { font-size: 16px; }
  .btn-login { padding: 0 13px; }
  .slider { border-radius: 16px; }
  .slide-mask { background: linear-gradient(180deg, rgba(6, 8, 13, .25) 0%, rgba(6, 8, 13, .88) 100%); }
  .slide-body { left: 22px; right: 22px; max-width: none; top: auto; bottom: 54px; transform: none; }
  .slider-dots { left: 22px; bottom: 20px; }
  .slider-arrow { display: none; }
  .section { margin: 40px 0; }
  .section-head h3 { font-size: 20px; }
  .lightbox { padding: 16px; }
  .footer { margin-top: 48px; }
  .footer-grid { padding: 32px 0 24px; gap: 22px; }
}

/* 手机：单列或双列小卡，触控目标放大 */
@media (max-width: 560px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall-grid, .wall-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall-body { padding: 10px 11px 12px; }
  .wall-body h4 { font-size: 14px; }
  .wall-meta { font-size: 12px; }
  .chip { padding: 5px 10px; font-size: 12px; }
  /* 搜索按钮与登录入口保证 38px 以上的可点面积 */
  .search { padding: 4px 5px 4px 12px; }
  .filter-bar { padding: 12px; gap: 8px; }
  .filter-bar .spacer { display: none; }
  .filter-bar .select { flex: 1 1 130px; }
  .btn { padding: 10px 18px; font-size: 14px; }
  .soft-cta { flex-direction: column; align-items: flex-start; }
  .soft-cta .btn { width: 100%; justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* 超窄屏：壁纸卡片改单列，顶栏站名只留图标腾出空间 */
@media (max-width: 400px) {
  .cat-grid, .wall-grid, .wall-grid.cols-3 { grid-template-columns: 1fr; }
  .logo { gap: 0; font-size: 0; }
  .logo-mark { width: 26px; height: 26px; }
  .header-inner { gap: 8px; }
  .search { padding-left: 10px; }
  .search input { font-size: 13px; }
}

/* 横屏矮屏（手机横放）：轮播别把整屏占满 */
@media (max-height: 480px) and (orientation: landscape) {
  .slider { height: 82vh; }
  .header { position: static; }
}
