/* =========================================================
   巩义搜 · 停机改版公告  styles.css
   设计原则（七条铁律的落地版）：
   1) 移动优先，<768px 单列
   2) 字体有主张：标题用宋体体系建立重量感；正文用现代黑体
   3) 配色有目的：70-20-10，深空蓝主调 + 暖橙强调
   4) 触摸目标 ≥ 44×44，焦点态明显
   5) 无障碍：对比度 4.5:1+，可见焦点，semantic HTML
   6) 性能：图片固定宽高防 CLS；<picture> 媒体查询按需下载
   7) 一个记忆点：流动的星轨 + 发光中央
   ========================================================= */

:root {
  /* —— 70 / 20 / 10 —— */
  --c-bg-1: #061b4a;       /* 70% 深空蓝（背景底） */
  --c-bg-2: #0a2a6b;       /* 70% 深空蓝（背景中段） */
  --c-bg-3: #0d3b9c;       /* 70% 蓝色高光 */
  --c-surface: rgba(255, 255, 255, 0.06);
  --c-surface-strong: rgba(255, 255, 255, 0.10);
  --c-border: rgba(255, 255, 255, 0.18);

  --c-ink: #f3f6ff;        /* 20% 主前景色 */
  --c-ink-mute: #b8c4e6;
  --c-ink-soft: #8a98c0;

  --c-accent: #ff7a45;     /* 10% 暖橙强调（仅用于"距恢复"和 CTA） */
  --c-accent-2: #ffb347;
  --c-danger: #ff5577;

  /* 字体栈：有主张的中文配对，禁止 Inter / Roboto / 系统默认 sans */
  --font-display: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC",
    "STSong", "FangSong", "SimSun", ui-serif, serif;
  --font-body: "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", ui-sans-serif, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo,
    Consolas, monospace;

  /* 节奏 */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --shadow-1: 0 6px 24px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 18px 60px rgba(7, 22, 70, 0.55);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

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

body {
  /* 绝不铺纯白/纯灰；纵深感靠 4 段渐变 + 噪点 */
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-ink);
  background:
    radial-gradient(120% 80% at 20% 0%, #1947c4 0%, transparent 55%),
    radial-gradient(110% 80% at 100% 30%, #0e3a9a 0%, transparent 60%),
    radial-gradient(80% 60% at 50% 100%, #0b2c75 0%, transparent 60%),
    linear-gradient(180deg, var(--c-bg-1) 0%, var(--c-bg-2) 60%, #04123a 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* —— 装饰层：星轨 / 网格 / 中央光晕 —— */
.bg-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-stars {
  position: absolute;
  inset: -20% -20% -20% -20%;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.85), transparent 60%),
    radial-gradient(1px 1px at 28% 72%, rgba(255, 255, 255, 0.7), transparent 60%),
    radial-gradient(1.4px 1.4px at 47% 32%, rgba(255, 255, 255, 0.9), transparent 60%),
    radial-gradient(1px 1px at 64% 81%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1.2px 1.2px at 78% 12%, rgba(255, 255, 255, 0.85), transparent 60%),
    radial-gradient(1px 1px at 88% 56%, rgba(255, 255, 255, 0.6), transparent 60%),
    radial-gradient(1.6px 1.6px at 33% 9%, rgba(255, 220, 180, 0.9), transparent 60%),
    radial-gradient(1.2px 1.2px at 56% 90%, rgba(180, 220, 255, 0.7), transparent 60%);
  background-size: 100% 100%;
  opacity: 0.85;
  animation: drift 28s linear infinite;
}

@keyframes drift {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-4%, -2%, 0); }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 90% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 30%, #000 30%, transparent 75%);
}

.bg-glow {
  position: absolute;
  left: 50%;
  top: 38%;
  width: min(720px, 110vw);
  height: min(720px, 110vw);
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, rgba(120, 170, 255, 0.45), transparent 70%);
  filter: blur(20px);
  animation: pulse 6.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 0.9;  transform: translate(-50%, -50%) scale(1.06); }
}

/* =========================================================
   舞台
   ========================================================= */
.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding:
    calc(28px + env(safe-area-inset-top, 0px))
    16px
    32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

/* —— 跳过链接 —— */
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 10px 14px;
  background: var(--c-accent);
  color: #1a0a00;
  font-weight: 700;
  border-radius: var(--r-sm);
  transform: translateY(-200%);
  transition: transform 0.18s ease;
  z-index: 10;
}
.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* =========================================================
   海报（图片主图）
   ========================================================= */
.poster {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-2);
  background: rgba(255, 255, 255, 0.04);
  /* 移动端：mob.jpg 竖版比例 */
  aspect-ratio: 750 / 1333;
}

.poster img {
  display: block;
  width: 100%;
  height: auto;
  /* 移除 object-fit: cover，设计图已经是完整海报，让图片自然比例完整显示 */
  border-radius: var(--r-lg);
  /* 入场 */
  transform: scale(1.01);
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.8s ease;
}

.poster.is-loaded img {
  opacity: 1;
  transform: scale(1);
}

/* 加载骨架：仿海报色调 */
.poster__skeleton {
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
  background:
    linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.08) 50%, transparent 70%) 0 0 / 200% 100%,
    linear-gradient(180deg, #0e3a9a 0%, #0a2a6b 100%);
  animation: shimmer 1.4s linear infinite;
}
.poster.is-loaded .poster__skeleton {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* 图片加载失败：骨架隐藏后显示错误提示 */
.poster.is-error img {
  display: none;
}
.poster.is-error .poster__skeleton {
  opacity: 0;
  pointer-events: none;
}
.poster.is-error::after {
  content: "⚠ 海报图片加载失败，请确认 assets/ 目录与页面同级";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: #ff5577;
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--r-lg);
  z-index: 3;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* 宽屏时：pc.jpg 横版改为更宽的宽高比 */
@media (min-width: 768px) {
  .poster {
    aspect-ratio: 1920 / 849; /* pc.jpg 实际比例 */
  }
}

@keyframes shimmer {
  0%   { background-position: 0% 0%, 0 0; }
  100% { background-position: -200% 0%, 0 0; }
}

/* =========================================================
   公告正文
   ========================================================= */
.notice {
  width: 100%;
  max-width: 560px;
  padding: 22px 20px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-1);
  color: var(--c-ink);
}

.notice__eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
  box-shadow: 0 0 0 0 rgba(255, 122, 69, 0.6);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 69, 0.6); }
  50%      { box-shadow: 0 0 0 8px rgba(255, 122, 69, 0); }
}

.notice__title {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", ui-sans-serif, sans-serif;
  font-weight: 800;
  font-size: clamp(22px, 6vw, 28px);
  line-height: 1.25;
  margin: 0 0 8px;
  color: var(--c-ink);
  letter-spacing: 0.01em;
  text-align: center;
}

.notice__domain {
  font-family: var(--font-mono);
  font-size: 0.72em;
  font-weight: 700;
  color: var(--c-ink);
  background: rgba(255, 255, 255, 0.10);
  padding: 2px 8px;
  border-radius: 6px;
  vertical-align: 0.18em;
  letter-spacing: 0.05em;
}

.notice__lead {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--c-ink-mute);
  text-align: center;
}
.notice__lead strong {
  color: var(--c-accent-2);
  font-weight: 800;
  font-size: 1.15em;
  margin: 0 2px;
}

/* —— 焦点高亮："正在全新改版升级" —— */
.notice__highlight {
  display: inline-block;
  position: relative;
  color: #ffffff;
  text-shadow: 0 0 12px rgba(255, 179, 71, 0.5), 0 0 24px rgba(255, 122, 69, 0.3);
  animation: textGlow 2.4s ease-in-out infinite;
  overflow: hidden;
}

/* 伪元素扫光 */
.notice__highlight::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 15%,
    rgba(255, 200, 120, 0.85) 35%,
    rgba(255, 122, 69, 1) 50%,
    rgba(255, 200, 120, 0.85) 65%,
    rgba(255, 255, 255, 0.3) 85%,
    transparent 100%
  );
  transform: skewX(-20deg);
  animation: sweepLight 2.2s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: overlay;
}

@keyframes sweepLight {
  0%   { left: -120%; }
  80%  { left: 120%; }
  100% { left: 120%; }
}

@keyframes textGlow {
  0%, 100% {
    text-shadow: 0 0 8px rgba(255, 179, 71, 0.6), 0 0 20px rgba(255, 122, 69, 0.4), 0 0 32px rgba(255, 122, 69, 0.2);
  }
  50% {
    text-shadow: 0 0 14px rgba(255, 179, 71, 0.85), 0 0 32px rgba(255, 122, 69, 0.65), 0 0 48px rgba(255, 122, 69, 0.35);
  }
}

.notice__meta {
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.notice__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap; /* 允许内容在窄屏下换行 */
  gap: 4px 12px;   /* 行间距 4px，列间距 12px */
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.notice__row dt {
  font-size: 13px;
  color: var(--c-ink-soft);
  letter-spacing: 0.05em;
}
.notice__row dd {
  margin: 0;
  font-size: 14px;
  color: var(--c-ink);
  font-variant-numeric: tabular-nums;
}
.notice__row--accent {
  background: linear-gradient(90deg, rgba(255, 122, 69, 0.18), rgba(255, 179, 71, 0.08));
  border-color: rgba(255, 122, 69, 0.35);
}
.notice__row--accent dt {
  color: #ffd9c6;
}

/* —— 倒计时 —— */
.countdown {
  display: inline-flex;
  align-items: flex-end;
  flex-wrap: wrap; /* 允许数字在窄空间换行 */
  gap: 4px 6px;    /* 行间距 4px，列间距 6px */
  font-variant-numeric: tabular-nums;
}
.countdown__cell {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
  padding: 4px 0;
}
.countdown__cell b {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.countdown__cell i {
  font-style: normal;
  font-size: 10px;
  color: var(--c-ink-soft);
  margin-top: 2px;
  letter-spacing: 0.1em;
}

/* —— 按钮 —— */
.notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn {
  /* 触摸目标 44×44 起步 */
  min-height: 44px;
  padding: 12px 18px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.2s ease, box-shadow 0.2s ease,
    border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 3px;
}
.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(135deg, var(--c-accent), var(--c-accent-2));
  color: #2a0a00;
  box-shadow: 0 6px 18px rgba(255, 122, 69, 0.35);
}
.btn--primary:hover {
  box-shadow: 0 10px 24px rgba(255, 122, 69, 0.45);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--c-ink);
  border-color: var(--c-border);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

.notice__tip {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--c-ink-soft);
  line-height: 1.6;
  padding: 10px 12px;
  border-left: 2px solid var(--c-accent);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 8px 8px 0;
}

/* =========================================================
   页脚
   ========================================================= */
.foot {
  position: relative;
  z-index: 1;
  padding: 18px 16px calc(18px + var(--safe-bottom));
  text-align: center;
  color: var(--c-ink-soft);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}
.foot__sep {
  margin: 0 8px;
  color: rgba(255, 255, 255, 0.3);
}

/* =========================================================
   响应式：≥768px 切换为更宽的舞台，但仍保持单列堆叠的可读性
   ========================================================= */
@media (min-width: 768px) {
  body {
    font-size: 17px;
  }
  .stage {
    padding: 48px 24px 56px;
    gap: 32px;
  }
  .poster {
    max-width: 960px;
    border-radius: 24px;
  }
  .poster img {
    border-radius: 24px;
  }
  .notice {
    max-width: 720px;
    padding: 28px 32px 26px;
  }
  .notice__title {
    font-size: 28px;
  }
  .notice__lead {
    font-size: 16px;
  }
  .notice__meta {
    grid-template-columns: 1fr; /* 桌面端也保持单列上下排列 */
    gap: 10px;
  }
  .notice__row {
    flex-direction: row;        /* 每行内部保持水平：label 左、value 右 */
    justify-content: space-between;
    align-items: baseline;
    gap: 4px 12px;
    padding: 10px 12px;
  }
  .countdown__cell b {
    font-size: 22px;
  }
}

@media (min-width: 1100px) {
  .stage {
    /* 桌面端：海报 + 公告并排，给 PC 用户一个更高级的信息密度 */
    flex-direction: row;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    gap: 36px;
  }
  .poster {
    max-width: 720px;
    flex: 1 1 auto;
  }
  .notice {
    max-width: 420px;
    flex: 0 0 420px;
  }
}

/* —— 超大屏：海报和公告居中、不过宽 —— */
@media (min-width: 1440px) {
  .poster {
    max-width: 760px;
  }
  .notice {
    flex-basis: 440px;
    max-width: 440px;
  }
}

/* =========================================================
   减少动画偏好：尊重系统设置
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .bg-stars,
  .bg-glow {
    animation: none !important;
  }
  .poster img {
    transform: none;
  }
  /* 保留核心文本动画：用户明确要求的焦点效果 */
  .notice__highlight {
    animation: textGlow 2.4s ease-in-out infinite !important;
  }
  .notice__highlight::after {
    animation: sweepLight 2.2s ease-in-out infinite !important;
  }
}

/* —— 数据设备分支：JS 会给 <html> 加 data-device，备用钩子 —— */
html[data-device="mobile"] .only-desktop {
  display: none !important;
}
html[data-device="desktop"] .only-mobile {
  display: none !important;
}

/* —— 极窄屏（≤360px）微调 —— */
@media (max-width: 360px) {
  .notice {
    padding: 18px 16px 16px;
  }
  .countdown__cell {
    min-width: 34px;
  }
  .countdown__cell b {
    font-size: 18px;
  }
}
