/* ============================================
   老版本3368 中国官方站 · 共享样式
   复古电玩 × 财神文化 · /assets/site.css
   ============================================ */

/* ---------- 1. Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: #F2E8D0;
  background-color: #0D0B14;
  background-image:
    linear-gradient(rgba(245, 212, 66, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 212, 66, 0.018) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Noto Serif SC", "SimSun", "Songti SC", serif;
  font-weight: 900;
  line-height: 1.3;
  color: #F2E8D0;
}

p {
  margin-bottom: 12px;
}

a {
  color: #3E5C9A;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #F5D442;
}

ul, ol {
  padding-left: 1.4em;
}

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

button {
  font-family: inherit;
}

::selection {
  background: #F5D442;
  color: #0D0B14;
}

:focus-visible {
  outline: 2px solid #F5D442;
  outline-offset: 3px;
}

/* ---------- 2. CSS 变量 ---------- */
:root {
  --color-ink: #0D0B14;
  --color-panel: #141220;
  --color-gold: #F5D442;
  --color-vermilion: #C93A2E;
  --color-green: #1F8A70;
  --color-blue: #3E5C9A;
  --color-purple: #7B5EA7;
  --color-bone: #F2E8D0;
  --color-gray: #8C8A97;
  --color-iron: #2A2633;

  --font-heading: "Noto Serif SC", "SimSun", "Songti SC", serif;
  --font-body: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", "Consolas", "Liberation Mono", monospace;

  --content-max: 1200px;
  --space-page: 20px;
  --space-lg: 48px;
  --space-md: 24px;
  --space-sm: 12px;

  --duration-fast: 0.2s;
  --duration-base: 0.3s;
  --duration-slow: 0.6s;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-offset: 100px;
}

@media (min-width: 1024px) {
  :root {
    --space-page: 28px;
  }
}

/* ---------- 3. 通用容器与主内容 ---------- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding-left: var(--space-page);
  padding-right: var(--space-page);
}

.main-content {
  min-height: 60vh;
  scroll-margin-top: var(--header-offset);
  padding: 24px 0 80px;
}

main:focus {
  outline: none;
}

/* ---------- 4. 跳转链接 ---------- */
.skip-link {
  position: fixed;
  left: -9999px;
  top: 12px;
  z-index: 1005;
  background: #F5D442;
  color: #0D0B14;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.skip-link:focus {
  left: 12px;
}

/* ---------- 5. 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #0D0B14;
  border-bottom: 1px solid #2A2633;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.site-header::before,
.site-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 5px;
  height: 5px;
  background: #C93A2E;
  z-index: 3;
  pointer-events: none;
}

.site-header::before {
  left: 0;
}

.site-header::after {
  right: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 10px var(--space-page);
}

/* --- 品牌 --- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  color: #F5D442;
}

.brand:hover {
  color: #F5D442;
}

.brand-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: #141220;
  border: 1px solid #F5D442;
  box-shadow: 0 0 12px rgba(245, 212, 66, 0.12);
  flex-shrink: 0;
}

.brand-icon svg {
  width: 26px;
  height: 26px;
  display: block;
}

.brand-text {
  font-family: "Noto Serif SC", "SimSun", serif;
  font-weight: 900;
  font-size: 20px;
  color: #F5D442;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-shadow: 0 0 12px rgba(245, 212, 66, 0.25);
  white-space: nowrap;
}

.brand-label {
  font-size: 11px;
  color: #8C8A97;
  border: 1px solid #2A2633;
  padding: 2px 8px;
  letter-spacing: 0.12em;
  white-space: nowrap;
  transform: translateY(1px);
}

/* --- 导航 --- */
.site-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 8px 10px;
  font-size: 14px;
  color: #F2E8D0;
  letter-spacing: 0.06em;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 2px;
  background: #F5D442;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s var(--ease-out);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: #F5D442;
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-link[aria-current="page"] {
  color: #F5D442;
  text-shadow: 0 0 8px rgba(245, 212, 66, 0.3);
}

/* --- 移动端导航按钮 --- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: #141220;
  border: 1px solid #2A2633;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.25s ease;
}

.nav-toggle:hover {
  border-color: #F5D442;
}

.nav-toggle-line {
  display: block;
  width: 20px;
  height: 2px;
  background: #F5D442;
  transition: transform 0.3s var(--ease-out), opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --- 状态条 --- */
.header-status {
  border-top: 1px solid #2A2633;
  background: #141220;
}

.header-status-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 5px var(--space-page);
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
  color: #8C8A97;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1F8A70;
  box-shadow: 0 0 6px rgba(31, 138, 112, 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 6px rgba(31, 138, 112, 0.6);
  }
  50% {
    opacity: 0.55;
    box-shadow: 0 0 2px rgba(31, 138, 112, 0.25);
  }
}

.header-lang {
  margin-left: auto;
  color: #F5D442;
  letter-spacing: 0.1em;
  font-size: 11px;
}

/* --- 滚动进度条 --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #F5D442, #C93A2E);
  z-index: 1003;
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ---------- 6. 页脚 ---------- */
.site-footer {
  position: relative;
  border-top: 2px solid #F5D442;
  background: #141220;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -2px;
  right: 0;
  width: 120px;
  height: 2px;
  background: #C93A2E;
  z-index: 2;
  pointer-events: none;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: 40px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 48px var(--space-page) 40px;
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo {
  font-family: "Noto Serif SC", "SimSun", serif;
  font-weight: 900;
  font-size: 22px;
  color: #F5D442;
  letter-spacing: 0.08em;
}

.footer-version {
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
  color: #8C8A97;
  border: 1px solid #2A2633;
  padding: 2px 8px;
  letter-spacing: 0.08em;
}

.footer-about {
  font-size: 14px;
  color: #8C8A97;
  line-height: 1.7;
  max-width: 30em;
}

.footer-links,
.footer-contact {
  display: flex;
  flex-direction: column;
}

.footer-heading {
  font-family: "Noto Serif SC", "SimSun", serif;
  font-weight: 900;
  font-size: 18px;
  color: #F5D442;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  padding-bottom: 8px;
  position: relative;
}

.footer-heading::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 2px;
  background: #C93A2E;
}

.footer-link-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link-list a {
  color: #F2E8D0;
  font-size: 14px;
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}

.footer-link-list a:hover {
  color: #F5D442;
}

.footer-contact p {
  font-size: 13px;
  color: #8C8A97;
  line-height: 1.6;
  margin-bottom: 4px;
}

.footer-bottom {
  border-top: 1px solid #2A2633;
  background: #0D0B14;
}

.footer-bottom-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 14px var(--space-page);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
  color: #8C8A97;
}

.footer-copy,
.footer-icp {
  margin: 0;
}

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid #F5D442;
  background: transparent;
  color: #F5D442;
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s var(--ease-out);
  position: relative;
}

.btn:hover,
.btn:focus-visible {
  background: #F5D442;
  color: #0D0B14;
  box-shadow: 0 0 18px rgba(245, 212, 66, 0.3);
}

.btn-primary {
  background: #F5D442;
  color: #0D0B14;
  border-color: #F5D442;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: transparent;
  color: #F5D442;
  box-shadow: 0 0 18px rgba(245, 212, 66, 0.2);
}

.btn-outline {
  border-color: #2A2633;
  color: #F2E8D0;
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: #F5D442;
  color: #F5D442;
  background: transparent;
  box-shadow: none;
}

.btn-small {
  padding: 6px 14px;
  font-size: 13px;
}

/* ---------- 8. 面包屑 ---------- */
.breadcrumbs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 20px 0 12px;
  font-size: 13px;
  color: #8C8A97;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
  content: "▸";
  margin: 0 7px;
  color: #F5D442;
  font-size: 10px;
}

.breadcrumbs a {
  color: #8C8A97;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumbs a:hover {
  color: #F5D442;
}

.breadcrumbs [aria-current="page"] {
  color: #F2E8D0;
}

/* ---------- 9. 章节标题 ---------- */
.section-title {
  font-family: "Noto Serif SC", "SimSun", serif;
  font-weight: 900;
  font-size: 28px;
  color: #F2E8D0;
  line-height: 1.35;
  letter-spacing: 0.04em;
  position: relative;
  padding-left: 16px;
  margin-bottom: 20px;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 4px;
  background: #F5D442;
}

.section-num {
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 13px;
  font-weight: 400;
  color: #F5D442;
  letter-spacing: 0.12em;
  margin-left: 10px;
  vertical-align: 2px;
}

/* ---------- 10. 面板与像素角 ---------- */
.panel {
  background: #141220;
  border: 1px solid #2A2633;
  padding: 24px;
  position: relative;
}

.pixel-corners {
  position: relative;
}

.pixel-corners::before,
.pixel-corners::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #F5D442;
  pointer-events: none;
}

.pixel-corners::before {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
}

.pixel-corners::after {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
}

/* ---------- 11. 栅格 ---------- */
.grid {
  display: grid;
  gap: 24px;
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ---------- 12. 图片容器 ---------- */
.image-frame {
  position: relative;
  display: block;
  border: 1px solid #2A2633;
  background: #141220;
  padding: 8px;
  overflow: hidden;
}

.image-frame::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(245, 212, 66, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

.image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-frame--wide {
  aspect-ratio: 16 / 9;
}

.image-frame--square {
  aspect-ratio: 1 / 1;
}

.image-frame--portrait {
  aspect-ratio: 3 / 4;
}

.image-frame.is-placeholder {
  display: grid;
  place-items: center;
  min-height: 180px;
  background: repeating-conic-gradient(
    #141220 0% 25%,
    #0D0B14 0% 50%
  );
  background-size: 22px 22px;
}

.image-frame figcaption {
  font-size: 12px;
  color: #8C8A97;
  padding-top: 10px;
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  letter-spacing: 0.04em;
}

/* ---------- 13. 滚动显现 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal[data-revealed="true"] {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 14. 工具类 ---------- */
.text-gold {
  color: #F5D442;
}

.text-gray {
  color: #8C8A97;
}

.text-vermilion {
  color: #C93A2E;
}

.text-green {
  color: #1F8A70;
}

.text-blue {
  color: #3E5C9A;
}

.text-mono {
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 15. 平板与移动端响应 ---------- */
@media (max-width: 900px) {
  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .footer-main {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(360px, 100vw);
    height: 100vh;
    background: #141220;
    border-left: 1px solid #2A2633;
    transform: translateX(100%);
    transition: transform 0.3s var(--ease-out);
    z-index: 1001;
    padding: 96px var(--space-page) 32px;
    overflow-y: auto;
    display: block;
    box-shadow: none;
    visibility: hidden;
  }

  .site-nav[data-open="true"] {
    transform: translateX(0);
    visibility: visible;
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.55);
  }

  .nav-toggle {
    position: relative;
    z-index: 1002;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-link {
    display: block;
    padding: 14px 8px;
    font-size: 16px;
    border-bottom: 1px solid #2A2633;
  }

  .nav-link::after {
    display: none;
  }

  .nav-link[aria-current="page"] {
    color: #F5D442;
    background: linear-gradient(90deg, rgba(245, 212, 66, 0.06), transparent);
  }
}

html.is-nav-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .brand-text {
    font-size: 17px;
  }

  .brand-label {
    display: none;
  }

  .header-status-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-lang {
    font-size: 10px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 36px;
  }

  .footer-main {
    grid-column: auto;
  }

  .footer-bottom-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-title {
    font-size: 22px;
  }
}

/* ---------- 16. 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scroll-progress {
    transition: none;
  }

  .status-dot {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
