/* ================================================================
   TOPJOY 官网 — 重写版样式
   纯静态站点，深色主题，响应式
   ================================================================ */

:root {
  --bg: #0e0f12;
  --bg-soft: #16181d;
  --bg-card: #1b1e24;
  --line: #2a2e37;
  --text: #eef0f4;
  --text-dim: #9aa1ad;
  --accent: #e4322b;
  --accent-2: #ff5a52;
  --nav-h: 76px;
  --maxw: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  z-index: 100;
  background: linear-gradient(180deg, rgba(10,11,14,.85), rgba(10,11,14,0));
  transition: background .3s ease;
}
.nav.solid { background: rgba(12,13,16,.96); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.nav .logo img { height: 30px; width: auto; }
.nav ul { list-style: none; display: flex; gap: 34px; align-items: center; }
.nav ul a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; }
.nav ul a .cn { font-size: 16px; font-weight: 500; }
.nav ul a .en { font-size: 10px; letter-spacing: 1px; color: var(--text-dim); }
.nav ul a:hover .cn, .nav ul a.active .cn { color: var(--accent-2); }
.nav ul a.active { border-bottom: 2px solid var(--accent); margin-bottom: -2px; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 32px; height: 32px; }
.nav-toggle span { display: block; width: 24px; height: 2px; margin: 5px auto; background: var(--text); transition: .25s; }

/* ---------- 通用区块标题 ---------- */
.sec-head { text-align: center; padding: 70px 0 34px; }
.sec-head .en { font-size: 34px; font-weight: 800; letter-spacing: 4px; color: #2c313b; text-transform: uppercase; }
.sec-head .cn { font-size: 26px; font-weight: 700; margin-top: -14px; position: relative; }
.sec-head .cn::after { content: ""; display: block; width: 46px; height: 3px; background: var(--accent); margin: 16px auto 0; }

/* ---------- 首页 Banner 轮播 ---------- */
.hero { position: relative; height: 100vh; min-height: 560px; overflow: hidden; }
.hero .slide {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1s ease; z-index: 1;
}
.hero .slide.on { opacity: 1; z-index: 2; }
.hero .dots { position: absolute; bottom: 34px; left: 0; right: 0; z-index: 5; display: flex; gap: 12px; justify-content: center; }
.hero .dots button { width: 12px; height: 12px; border-radius: 50%; border: 0; background: rgba(255,255,255,.4); cursor: pointer; transition: .25s; }
.hero .dots button.on { background: var(--accent); transform: scale(1.15); }
.hero .arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; background: rgba(0,0,0,.28); border: 0; color: #fff; width: 48px; height: 64px; font-size: 26px; cursor: pointer; opacity: .55; transition: .2s; }
.hero .arrow:hover { opacity: 1; background: rgba(0,0,0,.5); }
.hero .prev { left: 0; } .hero .next { right: 0; }

/* ---------- 精品游戏（首页） ---------- */
.hotgames { background: var(--bg); padding-bottom: 80px; }
.hot-more { text-align: center; margin-top: -18px; margin-bottom: 26px; }
.hot-more a { color: var(--text-dim); font-size: 14px; }
.hot-more a:hover { color: var(--accent-2); }
.hot-grid { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.hot-card {
  position: relative; width: 280px; height: 360px; border-radius: 10px; overflow: hidden;
  background-size: cover; background-position: center; border: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.hot-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.82)); }
.hot-card .meta { position: relative; z-index: 2; padding: 22px; }
.hot-card .name { font-size: 22px; font-weight: 700; }
.hot-card .sub { font-size: 14px; color: var(--text-dim); margin-top: 4px; }
.hot-card.soon { filter: saturate(.35); }

/* ---------- 公司故事（首页） ---------- */
.storyband { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.storyband .wrap { display: flex; align-items: center; gap: 50px; padding: 80px 24px; flex-wrap: wrap; }
.storyband .txt { flex: 1 1 340px; }
.storyband .en { font-size: 15px; letter-spacing: 3px; color: var(--accent); font-weight: 700; }
.storyband h2 { font-size: 30px; margin: 8px 0 20px; }
.storyband p { color: var(--text-dim); font-size: 17px; max-width: 460px; }
.storyband .pic { flex: 1 1 380px; }
.storyband .pic img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }

.btn {
  display: inline-block; margin-top: 26px; padding: 12px 30px;
  border: 1px solid var(--accent); color: #fff; border-radius: 40px;
  font-size: 14px; transition: .25s; background: transparent;
}
.btn:hover { background: var(--accent); }

/* ---------- 内页公共头部（故事/游戏/联系） ---------- */
.page-hero {
  min-height: 60vh; display: flex; align-items: center;
  padding-top: var(--nav-h);
  background: radial-gradient(1200px 500px at 70% -10%, #24272f, var(--bg));
  border-bottom: 1px solid var(--line);
}
.page-hero .wrap { display: flex; gap: 50px; align-items: center; flex-wrap: wrap; padding-top: 30px; padding-bottom: 30px; }
.page-hero .txt { flex: 1 1 360px; }
.page-hero .en-title { font-size: 40px; font-weight: 800; letter-spacing: 4px; }
.page-hero .en-title span { color: var(--accent); }
.page-hero .lead { margin-top: 20px; color: var(--text-dim); font-size: 17px; max-width: 520px; }
.page-hero .pic { flex: 1 1 380px; }
.page-hero .pic img { width: 100%; border-radius: 10px; border: 1px solid var(--line); }

/* ---------- 故事页：数据统计 ---------- */
.stats { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; padding: 60px 24px; }
.stat {
  flex: 1 1 200px; max-width: 250px; text-align: center; padding: 34px 18px; cursor: pointer;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; transition: .25s;
}
.stat:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.stat:hover { transform: translateY(-6px); border-color: var(--accent); }
.stat .ico { width: 44px; height: 44px; margin: 0 auto 14px; color: var(--accent); }
.stat .en { font-size: 13px; letter-spacing: 2px; color: var(--text-dim); }
.stat .cn { font-size: 18px; font-weight: 600; margin-top: 4px; }

/* ---------- 故事页：办公相册 ---------- */
.gallery-head { text-align: center; padding: 10px 0 30px; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 0 24px 80px; max-width: var(--maxw); margin: 0 auto; }
.gallery img { width: 100%; height: 190px; object-fit: cover; border-radius: 8px; cursor: pointer; transition: .25s; border: 1px solid var(--line); }
.gallery img:hover { transform: scale(1.03); border-color: var(--accent); }

/* ---------- 游戏页：网格 ---------- */
.games-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: var(--maxw); margin: 0 auto; padding: 10px 24px 90px; }
.game-item { background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; transition: .25s; }
.game-item:hover { transform: translateY(-6px); border-color: var(--accent); }
.game-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.game-item.soon img { filter: saturate(.35); }

/* ---------- 联系页 ---------- */
.contact-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; padding: 20px 24px 90px; max-width: 1120px; margin: 0 auto; }
.contact-card {
  flex: 1 1 0; min-width: 260px; max-width: 360px; background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 14px; padding: 40px 34px; transition: .25s;
}
.contact-card:hover { transform: translateY(-6px); border-color: var(--accent); }
.contact-card .en { font-size: 14px; letter-spacing: 2px; color: var(--text-dim); }
.contact-card h3 { font-size: 22px; margin: 6px 0 20px; }
.contact-card .mail { display: flex; align-items: center; gap: 10px; font-size: 17px; color: var(--accent-2); }
.contact-card .mail svg { width: 20px; height: 20px; }

/* ---------- 法律/条款内页 ---------- */
.legal { max-width: 860px; margin: 0 auto; padding: calc(var(--nav-h) + 40px) 24px 80px; }
.legal .back { display: inline-block; margin-bottom: 24px; color: var(--text-dim); font-size: 14px; }
.legal .back:hover { color: var(--accent-2); }
.legal h1 { font-size: 30px; margin-bottom: 8px; }
.legal h1::after { content: ""; display: block; width: 46px; height: 3px; background: var(--accent); margin-top: 16px; }
.legal h2 { font-size: 22px; margin: 40px 0 16px; padding-left: 12px; border-left: 3px solid var(--accent); }
.legal h3 { font-size: 16px; color: var(--accent-2); margin: 24px 0 10px; }
.legal p { color: var(--text-dim); font-size: 15px; line-height: 1.9; margin: 10px 0; }
.legal img { margin: 20px 0; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
/* 监护申请流程图：橙色线稿，背景与页面一致 */
.legal img.flowchart {
  display: block; width: 100%; max-width: 680px; margin: 24px auto;
  padding: 30px 24px; background: var(--bg); border: 0; border-radius: 8px;
}

/* ---------- 页脚 ---------- */
.footer { background: #0a0b0e; border-top: 1px solid var(--line); }
.footer .top { display: flex; flex-wrap: wrap; gap: 40px; padding: 54px 24px; max-width: var(--maxw); margin: 0 auto; }
.footer .col-title { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.footer .col-title .con { font-size: 24px; font-weight: 700; }
.footer .col-title img { width: 54px; height: auto; }
.footer .info { color: var(--text-dim); font-size: 14px; line-height: 2; flex: 1 1 260px; }
.footer .addr { color: var(--text-dim); font-size: 14px; line-height: 1.9; flex: 1 1 320px; }
.footer .addr span { font-size: 12px; opacity: .8; }
.footer .bottom { border-top: 1px solid var(--line); padding: 24px; }
.footer .bottom .wrap { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.footer .bottom img.flogo { height: 30px; width: auto; }
.footer .bottom p { color: #6d7480; font-size: 12px; line-height: 2; }
.footer .bottom a { color: #8b93a0; }
.footer .bottom a:hover { color: var(--accent-2); }
.footer .bottom .beian { display: inline-flex; align-items: center; gap: 4px; }
.footer .bottom .beian img { height: 16px; }

/* ---------- 相册灯箱 ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.9); display: none; align-items: center; justify-content: center; z-index: 200; }
.lightbox.on { display: flex; }
.lightbox img { max-width: 90vw; max-height: 86vh; border-radius: 8px; }
.lightbox .close { position: absolute; top: 24px; right: 30px; font-size: 40px; color: #fff; background: none; border: 0; cursor: pointer; line-height: 1; }
.lightbox .lb-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,.12); border: 0; color: #fff; width: 52px; height: 68px; font-size: 28px; cursor: pointer; }
.lightbox .lb-prev { left: 24px; } .lightbox .lb-next { right: 24px; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav ul {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0; background: rgba(12,13,16,.98);
    border-bottom: 1px solid var(--line); max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav ul.open { max-height: 340px; }
  .nav ul a { width: 100%; padding: 16px 24px; flex-direction: row; gap: 10px; justify-content: flex-start; border-bottom: 1px solid var(--line); }
  .nav ul a.active { border-bottom: 1px solid var(--line); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .page-hero .en-title { font-size: 30px; }
  .sec-head .en { font-size: 26px; }
}
@media (max-width: 520px) {
  .hero { min-height: 460px; }
  .games-grid { grid-template-columns: 1fr; }
  .stat { max-width: none; }
}
