/* tgrhk.com — i社游戏导航
   视觉方向：近景萤火微光 / 墨绿 · 暗金 · 浅琥珀 / 纵向分组卡片 */

:root {
  --ink-0: #050d0a;
  --ink-1: #08150f;
  --ink-2: #0c1f17;
  --ink-3: #122c20;
  --moss: #1c4232;
  --gold-deep: #7a5c22;
  --gold: #b48b34;
  --amber: #f0c274;
  --amber-soft: #ffe0ad;
  --text: #e9f1e6;
  --text-dim: #a9c0b0;
  --line: rgba(180, 139, 52, 0.28);
  --line-soft: rgba(180, 139, 52, 0.14);
  --radius: 14px;
  --shell: 860px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  color: var(--text);
  background-color: var(--ink-1);
  /* 静态回退背景：左右边缘的琥珀微光，Canvas 失效时仍保持同一氛围 */
  background-image:
    radial-gradient(38vw 62vh at -6vw 26vh, rgba(240, 194, 116, 0.20), rgba(240, 194, 116, 0) 70%),
    radial-gradient(42vw 68vh at 106vw 72vh, rgba(180, 139, 52, 0.22), rgba(180, 139, 52, 0) 70%),
    radial-gradient(70vw 50vh at 50vw 0vh, rgba(28, 66, 50, 0.55), rgba(8, 21, 15, 0) 72%),
    linear-gradient(180deg, #08150f 0%, #061109 58%, #050d0a 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

.firefly-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 40px 20px 48px;
}

/* ---------- 头部 ---------- */

.masthead {
  padding: 26px 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(18, 44, 32, 0.92) 0%, rgba(8, 21, 15, 0.9) 100%);
  box-shadow: 0 18px 40px rgba(3, 9, 6, 0.55), inset 0 1px 0 rgba(240, 194, 116, 0.12);
}

.masthead__bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--line-soft);
}

.masthead__logo {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line);
  box-shadow: 0 0 18px rgba(240, 194, 116, 0.18);
}

.masthead__mark {
  margin: 0;
  font-size: 0.86rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.masthead__title {
  margin: 20px 0 0;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  line-height: 1.3;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--amber-soft);
  text-shadow: 0 0 22px rgba(240, 194, 116, 0.25);
}

.masthead__title::after {
  content: "";
  display: block;
  width: 84px;
  height: 2px;
  margin-top: 14px;
  background: linear-gradient(90deg, var(--amber), rgba(180, 139, 52, 0));
}

.masthead__lead {
  margin: 16px 0 0;
  max-width: 62ch;
  color: var(--text-dim);
  font-size: 0.98rem;
}

/* ---------- 背景控制 ---------- */

.motion-toggle {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  font: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--amber-soft);
  background: rgba(12, 31, 23, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.motion-toggle::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(240, 194, 116, 0.9);
}

.motion-toggle[aria-pressed="false"]::before {
  background: var(--gold-deep);
  box-shadow: none;
}

.motion-toggle:hover,
.motion-toggle:focus-visible {
  border-color: var(--amber);
  box-shadow: 0 0 16px rgba(240, 194, 116, 0.22);
}

.motion-toggle[hidden] { display: none; }

/* ---------- 通用标题 ---------- */

.main { margin-top: 34px; }

.section-title {
  margin: 0 0 18px;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: "";
  width: 6px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--amber), var(--gold-deep));
  box-shadow: 0 0 12px rgba(240, 194, 116, 0.35);
}

/* ---------- 入口列表（纵向分组卡片） ---------- */

.portal__list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 18px 16px 18px 26px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(10, 26, 19, 0.82), rgba(6, 17, 11, 0.82));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 纵向光带：把卡片串成一列 */
.portal__list::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 26px;
  bottom: 26px;
  width: 1px;
  background: linear-gradient(180deg, rgba(240, 194, 116, 0) 0%, rgba(180, 139, 52, 0.55) 18%, rgba(180, 139, 52, 0.55) 82%, rgba(240, 194, 116, 0) 100%);
}

.portal__item { position: relative; }

.portal__item::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--gold-deep);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.portal__item:hover::before,
.portal__item:focus-within::before {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(240, 194, 116, 0.85);
}

.portal__link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  min-height: 56px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(180, 139, 52, 0.2);
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(18, 44, 32, 0.85) 0%, rgba(10, 26, 19, 0.7) 100%);
  transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.portal__link:hover,
.portal__link:focus-visible {
  transform: translateX(4px);
  border-color: rgba(240, 194, 116, 0.65);
  box-shadow: 0 0 22px rgba(240, 194, 116, 0.16), inset 0 0 0 1px rgba(240, 194, 116, 0.08);
}

.portal__index {
  flex: 0 0 auto;
  min-width: 2.2em;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
}

.portal__name {
  flex: 1 1 auto;
  font-size: 1.04rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.portal__go {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(180, 139, 52, 0.45);
  position: relative;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

.portal__go::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-top: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
  transform: rotate(45deg);
}

.portal__link:hover .portal__go,
.portal__link:focus-visible .portal__go {
  border-color: var(--amber);
  background: rgba(240, 194, 116, 0.12);
}

/* ---------- 辅助内容 ---------- */

.guide { margin-top: 40px; }

.guide__group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide__card {
  padding: 18px 18px 18px 20px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid rgba(180, 139, 52, 0.55);
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(10, 26, 19, 0.85), rgba(6, 17, 11, 0.7));
  transition: border-left-color 0.3s ease;
}

.guide__card:hover { border-left-color: var(--amber); }

.guide__name {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--amber-soft);
}

.guide__text {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.96rem;
}

/* ---------- 页脚 ---------- */

.footer {
  margin-top: 44px;
  padding: 22px 20px;
  border-top: 1px solid var(--line-soft);
  border-radius: 0 0 var(--radius) var(--radius);
  background: linear-gradient(180deg, rgba(6, 17, 11, 0.3), rgba(5, 13, 10, 0.7));
}

.footer__note {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.footer__copy {
  margin: 12px 0 0;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--gold);
}

/* ---------- 焦点可见 ---------- */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

/* ---------- 响应式 ---------- */

@media (max-width: 720px) {
  .page { padding: 26px 14px 36px; }
  .masthead { padding: 20px 16px; }
  .masthead__logo { width: 54px; height: 54px; }
  .main { margin-top: 26px; }
  .portal__list { padding: 14px 12px 14px 22px; }
  .portal__list::before { left: 11px; }
  .portal__item::before { left: -14px; }
  .portal__link { padding: 12px 12px; gap: 10px; min-height: 52px; }
  .portal__name { font-size: 0.98rem; }
  .footer { margin-top: 32px; padding: 18px 14px; }
}

@media (max-width: 380px) {
  body { font-size: 15px; }
  .page { padding: 20px 10px 30px; }
  .masthead__bar { gap: 10px; }
  .masthead__mark { font-size: 0.76rem; letter-spacing: 0.14em; }
  .portal__index { min-width: 1.9em; font-size: 0.78rem; }
  .portal__go { width: 18px; height: 18px; }
  .portal__go::after { left: 5px; }
}

/* ---------- 减少运动 ---------- */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .portal__link:hover,
  .portal__link:focus-visible { transform: none; }
}
