/* ============================================================
   仙魔世界 官网样式
   配色取自游戏主视觉：暗紫夜雾 + 血月红 + 鎏金描边
   不依赖任何外部 CDN，字体回退到系统黑体
   ============================================================ */

:root {
  --bg-0: #07060d;
  --bg-1: #0d0a18;
  --bg-2: #151024;
  --line: rgba(212, 167, 106, 0.28);
  --gold: #d4a76a;
  --gold-bright: #f3c98b;
  --crimson: #b8303a;
  --crimson-bright: #e0434f;
  --purple: #6b4b8a;
  --text: #e8e2f0;
  --text-dim: #a99fbd;
  --ok: #6ddb8f;
  --warn: #f0c04a;
  --radius: 4px;
  --max: 1160px;
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Heiti SC", "WenQuanYi Micro Hei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

/* ============================================================
   滚动条隐藏（仍然可以正常滚动）

   ① 手机 / 平板：全局隐藏，观感更像 App（桌面端保留滚动条，方便定位）
   ② 嵌入模式（游戏 iframe，URL 带 ?from=game）：任何宽度都隐藏
   ============================================================ */
@media (max-width: 960px) {
  html,
  body {
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* IE / 旧 Edge */
  }
  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
  }
}

html.in-game,
html.in-game body {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html.in-game::-webkit-scrollbar,
html.in-game body::-webkit-scrollbar,
html.in-game *::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg-0);
  line-height: 1.7;
  font-size: 15px;
  overflow-x: hidden;
}

/* 页面整体背景：血月 + 紫雾 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 8%, rgba(184, 48, 58, 0.42) 0%, rgba(184, 48, 58, 0.12) 22%, transparent 46%),
    radial-gradient(circle at 15% 70%, rgba(107, 75, 138, 0.30) 0%, transparent 48%),
    radial-gradient(circle at 85% 78%, rgba(107, 75, 138, 0.24) 0%, transparent 46%),
    linear-gradient(180deg, #0a0714 0%, #07060d 55%, #05040a 100%);
}

/* 细密星点 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 78% 12%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1px 1px at 42% 32%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 66% 44%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 28% 62%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 88% 58%, rgba(255, 255, 255, 0.4), transparent);
}

a { color: var(--gold-bright); text-decoration: none; transition: color .18s; }
a:hover { color: #fff0d0; }

img { max-width: 100%; height: auto; border: 0; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 18px; }

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 6, 13, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 62px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #fff;
  text-shadow: 0 0 14px rgba(224, 67, 79, 0.55);
  white-space: nowrap;
}
.logo .seal {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font-size: 15px; letter-spacing: 0;
  color: #1a0d0f;
  background: linear-gradient(160deg, var(--gold-bright), var(--gold));
  border-radius: 3px;
  box-shadow: 0 0 12px rgba(212, 167, 106, 0.5);
}
.logo small {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 2px;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 8px 14px;
  color: var(--text);
  font-size: 15px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  white-space: nowrap;
}
.nav a:hover { color: var(--gold-bright); border-color: var(--line); }
.nav a.active { color: var(--gold-bright); border-color: var(--line); background: rgba(212, 167, 106, 0.08); }

.nav-toggle {
  display: none;
  width: 42px; height: 36px;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--gold);
  font-size: 18px;
  cursor: pointer;
}

/* ---------------- 公告条 ---------------- */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--gold-bright);
  background: rgba(184, 48, 58, 0.10);
  border: 1px solid rgba(184, 48, 58, 0.35);
  border-radius: var(--radius);
}
.notice-bar .tag {
  flex: 0 0 auto;
  padding: 1px 8px;
  font-size: 12px;
  color: #fff;
  background: var(--crimson);
  border-radius: 2px;
}
.notice-bar .text {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 首屏 ---------------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
  padding: 56px 0 46px;
}

.hero-title {
  margin: 0 0 6px;
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 6px;
  background: linear-gradient(180deg, #fff 8%, var(--gold-bright) 58%, #b98b4f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 12px rgba(224, 67, 79, 0.35));
}

.hero-sub {
  margin: 0 0 14px;
  font-size: clamp(14px, 2.2vw, 18px);
  letter-spacing: 3px;
  color: var(--gold);
}

.hero-desc {
  margin: 0 0 26px;
  max-width: 34em;
  color: var(--text-dim);
  font-size: 15px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* 主按钮：鎏金描边 + 内部渐变，与游戏内 UI 同源 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 168px;
  height: 50px;
  padding: 0 26px;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #1a0d0f;
  background: linear-gradient(180deg, #f6d7a4 0%, #d4a76a 46%, #a97f45 100%);
  border: 1px solid #f3c98b;
  border-radius: var(--radius);
  box-shadow: 0 4px 0 #6d4f27, 0 8px 24px rgba(212, 167, 106, 0.28);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 5px 0 #6d4f27, 0 10px 26px rgba(212, 167, 106, 0.36); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #6d4f27; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 22px;
  font-family: var(--font);
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--gold-bright);
  background: rgba(212, 167, 106, 0.06);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-ghost:hover { background: rgba(212, 167, 106, 0.14); border-color: var(--gold); color: #fff0d0; }

.hero-meta {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13px;
  color: var(--text-dim);
}
.hero-meta b { color: var(--gold-bright); font-weight: 600; }

/* 右侧手机预览 */
.hero-visual {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 300 / 620;
  border-radius: 26px;
  overflow: hidden;
  border: 2px solid rgba(212, 167, 106, 0.55);
  box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.6), 0 26px 60px rgba(184, 48, 58, 0.28);
  background: #0a0714 center/cover no-repeat url("../assets/img/hero.webp");
}
.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(6, 4, 10, 0.92) 100%);
}
.hero-visual .caption {
  position: absolute;
  left: 0; right: 0; bottom: 14px;
  z-index: 2;
  text-align: center;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--gold-bright);
}

/* ---------------- 通用区块 ---------------- */
.section { padding: 40px 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.section-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 2px;
  color: #fff;
}
.section-head h2::before {
  content: "";
  display: inline-block;
  width: 4px; height: 18px;
  margin-right: 10px;
  vertical-align: -2px;
  background: linear-gradient(180deg, var(--crimson-bright), var(--gold));
  border-radius: 2px;
}
.section-head .more { font-size: 13px; color: var(--text-dim); }
.section-head .more:hover { color: var(--gold-bright); }

/* 特色卡片 */
.grid-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.feature {
  padding: 20px 18px;
  background: linear-gradient(180deg, rgba(21, 16, 36, 0.9), rgba(13, 10, 24, 0.9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.feature:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: 0 10px 28px rgba(184, 48, 58, 0.18);
}
.feature .ico {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  margin-bottom: 12px;
  font-size: 21px;
  border-radius: 50%;
  color: var(--gold-bright);
  background: radial-gradient(circle at 35% 30%, rgba(224, 67, 79, 0.35), rgba(212, 167, 106, 0.06));
  border: 1px solid var(--line);
}
.feature h3 { margin: 0 0 6px; font-size: 16px; color: #fff; letter-spacing: 1px; }
.feature p { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.65; }

/* 新闻 */
.news-list { display: grid; gap: 10px; }

.news-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(21, 16, 36, 0.68);
  border: 1px solid var(--line);
  border-left: 3px solid var(--crimson);
  border-radius: var(--radius);
  transition: background .16s, border-color .16s, transform .16s;
}
.news-item:hover {
  background: rgba(28, 21, 46, 0.95);
  border-left-color: var(--gold);
  transform: translateX(3px);
}
.news-item .tag {
  flex: 0 0 auto;
  padding: 2px 9px;
  font-size: 12px;
  border-radius: 2px;
  color: var(--gold-bright);
  border: 1px solid var(--line);
  background: rgba(212, 167, 106, 0.08);
}
.news-item .title {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-item:hover .title { color: #fff; }
.news-item .date { flex: 0 0 auto; font-size: 13px; color: var(--text-dim); }

/* 文章详情 */
.article {
  padding: 26px 28px;
  background: rgba(21, 16, 36, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.article h1 {
  margin: 0 0 10px;
  font-size: clamp(20px, 3.4vw, 27px);
  line-height: 1.4;
  color: #fff;
}
.article .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding-bottom: 14px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
}
.article .content p { margin: 0 0 14px; color: #ddd6ea; }
.article .content p:last-child { margin-bottom: 0; }

.back-link { display: inline-block; margin-top: 20px; font-size: 14px; }

/* 分页 */
.pager { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.pager a, .pager span {
  min-width: 38px;
  padding: 7px 12px;
  text-align: center;
  font-size: 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(21, 16, 36, 0.6);
}
.pager a:hover { border-color: var(--gold); color: var(--gold-bright); }
.pager .cur { color: #1a0d0f; background: linear-gradient(180deg, #f6d7a4, #d4a76a); border-color: #f3c98b; font-weight: 700; }
.pager .disabled { opacity: .4; }

/* 下载页 */
.download-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  align-items: start;
}

.card {
  padding: 22px 24px;
  background: rgba(21, 16, 36, 0.75);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card h3 { margin: 0 0 14px; font-size: 17px; color: #fff; letter-spacing: 1px; }
.card + .card { margin-top: 16px; }

.dl-main { text-align: center; padding: 30px 24px; }
.dl-main .ver { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.dl-main .btn { min-width: 220px; height: 56px; font-size: 19px; }
.dl-main .hint { margin-top: 14px; font-size: 13px; color: var(--text-dim); }

.qr-box { text-align: center; }
.qr-box canvas, .qr-box img { display: inline-block; background: #fff; padding: 8px; border-radius: 4px; }
.qr-box .qr-tip { margin-top: 10px; font-size: 13px; color: var(--text-dim); }

.steps { margin: 0; padding-left: 20px; color: var(--text-dim); font-size: 14px; }
.steps li { margin-bottom: 8px; }
.steps li b { color: var(--gold-bright); font-weight: 600; }

.servers { display: grid; gap: 8px; }
.server-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  font-size: 14px;
  background: rgba(13, 10, 24, 0.8);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.server-row .st { font-size: 12px; padding: 1px 9px; border-radius: 10px; }
.st-流畅 { color: #07130a; background: var(--ok); }
.st-繁忙 { color: #1a1200; background: var(--warn); }
.st-爆满 { color: #fff; background: var(--crimson-bright); }

/* QQ 群 */
.qq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.qq-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: rgba(21, 16, 36, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.qq-card .num { margin-left: auto; font-family: Consolas, Monaco, monospace; font-size: 16px; color: var(--gold-bright); letter-spacing: 1px; }
.qq-card .copy {
  flex: 0 0 auto;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--gold-bright);
  background: rgba(212, 167, 106, 0.1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.qq-card .copy:hover { background: rgba(212, 167, 106, 0.2); }

/* 页脚 */
.site-footer {
  margin-top: 50px;
  padding: 28px 0 34px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}
.site-footer .links { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-bottom: 12px; }
.site-footer .copy { line-height: 1.9; }

/* 空状态 */
.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--text-dim);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  z-index: 999;
  transform: translate(-50%, 20px);
  padding: 10px 20px;
  font-size: 14px;
  color: #1a0d0f;
  background: linear-gradient(180deg, #f6d7a4, #d4a76a);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 后台 ---------------- */
.admin-wrap { max-width: 860px; margin: 0 auto; padding: 34px 18px 60px; }
.admin-login { max-width: 400px; margin: 12vh auto 0; }

.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--text-dim); }
.input, .textarea, .select {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: rgba(9, 7, 16, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: none;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--gold); }
.textarea { min-height: 220px; resize: vertical; line-height: 1.7; }

.flash {
  margin-bottom: 16px;
  padding: 10px 14px;
  font-size: 14px;
  border-radius: var(--radius);
}
.flash.ok { color: #d8ffe4; background: rgba(109, 219, 143, 0.14); border: 1px solid rgba(109, 219, 143, 0.4); }
.flash.err { color: #ffd9dc; background: rgba(224, 67, 79, 0.16); border: 1px solid rgba(224, 67, 79, 0.45); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table th { color: var(--text-dim); font-weight: 500; font-size: 13px; }
.admin-table tr:hover td { background: rgba(212, 167, 106, 0.05); }

.row-actions { display: flex; gap: 8px; }
.mini {
  padding: 4px 10px;
  font-size: 12px;
  font-family: var(--font);
  color: var(--gold-bright);
  background: rgba(212, 167, 106, 0.08);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
}
.mini:hover { background: rgba(212, 167, 106, 0.2); }
.mini.danger { color: #ffb3b9; border-color: rgba(224, 67, 79, 0.45); }
.mini.danger:hover { background: rgba(224, 67, 79, 0.2); }


/* ---------------- 进群下载页 ---------------- */
.qq-lead {
  display: flex;
  align-items: center;
  gap: 22px;
  border-left: 3px solid var(--crimson);
}
.qq-lead-text { flex: 1 1 auto; min-width: 0; }
.qq-lead-text h3 { margin: 0 0 8px; }
.qq-lead-text p { margin: 0; font-size: 14px; color: var(--text-dim); line-height: 1.85; }
.qq-lead-text p b { color: var(--gold-bright); font-weight: 600; }
.qq-lead-badge {
  flex: 0 0 auto;
  padding: 10px 16px;
  font-size: 14px;
  letter-spacing: 1px;
  color: #1a0d0f;
  background: linear-gradient(180deg, #f6d7a4, #d4a76a);
  border-radius: var(--radius);
  white-space: nowrap;
}

.qq-card-lg { padding: 18px 20px; }
.qq-card-lg .qq-name { color: #fff; font-size: 16px; }
.qq-card-lg .qq-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.qq-card-lg .num { font-size: 18px; }

.note-list p {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.85;
}
.note-list p:last-child { margin-bottom: 0; }
.note-list p b { color: var(--gold-bright); font-weight: 600; }

@media (max-width: 720px) {
  .qq-lead { flex-direction: column; align-items: flex-start; gap: 14px; }
  .qq-lead-badge { align-self: flex-start; }
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 960px) {
  .grid-features { grid-template-columns: repeat(2, 1fr); }
  .download-grid { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; gap: 30px; padding: 34px 0 30px; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-desc { margin-left: auto; margin-right: auto; }
  .hero-meta { justify-content: center; }
  .hero-visual { max-width: 250px; }
}

@media (max-width: 720px) {
  .header-inner { height: 56px; }
  .logo { font-size: 18px; letter-spacing: 2px; }
  .logo small { display: none; }
  .nav-toggle { display: block; }
  .nav {
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 12px 14px;
    background: rgba(7, 6, 13, 0.98);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 10px; border-bottom: 1px solid rgba(212, 167, 106, 0.12); }
  .nav a:last-child { border-bottom: 0; }

  .section { padding: 28px 0; }
  .section-head h2 { font-size: 19px; }
  .news-item { flex-wrap: wrap; gap: 8px 10px; }
  .news-item { align-items: flex-start; }
  .news-item .tag { order: 1; }
  .news-item .title { order: 2; flex: 1 1 auto; white-space: normal; }
  .news-item .date { order: 3; align-self: center; margin-left: 8px; }
  .article { padding: 20px 16px; }
  .card { padding: 18px 16px; }
  .dl-main .btn { width: 100%; min-width: 0; }
}

@media (max-width: 420px) {
  .grid-features { grid-template-columns: 1fr; }
  .hero-actions .btn, .hero-actions .btn-ghost { width: 100%; }
}
