/* ================== 字体 ================== */
@font-face {
  font-family: "Microsoft Yahei UI.ttf";
  font-weight: 1 999;
  src: url("../font/Microsoft Yahei UI.ttf");
}

@font-face {
  font-family: "Microsoft Yahei UI";
  src: url("../font/Microsoft Yahei UI.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* 全局字体 */
html, body, * {
  font-family: "Microsoft Yahei UI", sans-serif !important;
}

/* ================== 页面基础布局 ================== */

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* 避免滚动条出现，如有需要可改为 overflow-x: hidden; */
}

/* 背景容器 */
.background {
  position: relative; /* 子元素定位基准 */
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: linear-gradient(to bottom left, #ff99e5, #ffffff);
  overflow: hidden;
}

/* 背景视频 */
.background-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0; /* 最底层 */
}

/* ================== 信息板 / 倒计时卡片 ================== */

/* 信息板主容器（桌面 / 大屏） */
.info {
  position: relative;
  /* 宽度：最大 1200px，小屏幕时占 90% 屏宽 */
  width: min(1200px, 90vw);
  /* 宽高比：宽:高 = 16:9 */
  aspect-ratio: 16 / 9;
  height: auto;

  border-radius: 8px;
  box-shadow: 0 8px 8px 8px rgba(0,0,0,0.1), 0 6px 20px 0 rgba(0,0,0,0.1);
  z-index: 1; /* 在视频上 */
  display: flex;
  overflow: hidden;
}

/* 覆盖层渐变 */
.gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2; /* 遮盖视频 */
  background: linear-gradient(to right, rgba(255, 189, 238, 0.555), rgba(255, 193, 193, 0.541));
}

/* 左右渐变覆盖层（预留） */
.info .left-box,
.info .right-box {
  height: 100%;
  top: 0;
  position: relative;
  z-index: 2; /* 遮盖视频 */
}

/* 小屏（手机）专用布局覆盖 */
@media (max-width: 768px) {
  .info {
    width: 100vw;        /* 左右贴边 */
    border-radius: 0;    /* 顶部/底部也贴边 */
    aspect-ratio: auto;  /* 不再强制 16:9，高度按内容自动撑开 */
    height: auto;
  }
}

/* ================== 倒计时内容布局 ================== */

/* 桌面端 / 默认布局 */
.info .time {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  align-items: center;
  /* 关键：让标题、数字区、副标题、徽章等在纵向均匀铺开 */
  justify-content: space-between;

  /* 给上下左右一点内边距，避免贴边太紧 */
  padding: clamp(24px, 4vh, 40px) clamp(24px, 4vw, 48px);
}


/* 手机端：改为正常流式布局，从上往下排，不居中压缩 */
@media (max-width: 768px) {
  .info .time {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;

    padding: 16px 12px 20px;
  }
}


.info .time .title {
  font-family: "Microsoft Yahei UI";
  color: white;
  letter-spacing: 2px;
  font-size: clamp(18px, 2.4vw, 24px);
}

/* 数字整体区域 */
.info .time .time-box {
  display: flex;
  justify-content: space-around;
  align-items: center;

  /* 占整个 info 的 90% 宽度，最大不超过 1000px */
  width: 90%;
  max-width: 1000px;

  /* 高度由内容撑开，不写死像素 */
  height: 60%;

  margin-bottom: clamp(16px, 4vw, 48px);
}

/* 手机端如果宽度实在太窄，允许自动换行 */
@media (max-width: 480px) {
  .info .time .time-box {
    flex-wrap: wrap;
    row-gap: 8px;
  }
}

.info .time .time-box div {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 22%;
  height: auto;
}

/* 数字本体 */
.info .time .time-box div p {
  font-family: "Microsoft Yahei UI", sans-serif;
  font-weight: 500;
  font-size: clamp(60px, 15vw, 150px);
  margin: 0;

  /* 主体白色要清晰可见 */
  color: #ffffff;
  /* 很轻的外描边，不抢主体 */
  -webkit-text-stroke-width: 1px;
  -webkit-text-stroke-color: rgba(255, 180, 180, 0.55);

  text-stroke: 1px rgba(255, 180, 180, 0.55);
}


/* 数字下面的单位文字（days / hours / min / sec） */
.info .time .time-box div span {
  color: rgb(255, 255, 255);
  font-size: clamp(20px, 4.4vw, 32px);
  letter-spacing: 8px;
  opacity: 0.8;
}

/* 副标题 */
.info .time .sub-title {
  font-family: "Microsoft Yahei UI";
  color: rgb(255, 255, 255);
  font-size: clamp(14px, 2vw, 20px);
  letter-spacing: 4px;
  margin: 0;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.15);
  text-stroke: 1px rgba(255, 255, 255, 0.21);
}

/* ================== 语言切换 ================== */

.lang-switch {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: clamp(14px, 2.4vw, 20px);
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  z-index: 100;
  user-select: none;
}

.lang-switch span {
  padding: 0 5px;
}

.lang-switch span:hover {
  text-decoration: underline;
}

/* ================== 音乐按钮 ================== */

/* 桌面端：定位在倒计时框右下角 */
.music-control {
  position: absolute;
  bottom: 20px;
  right: 40px;
  z-index: 10;
}

.music-control img {
  width: clamp(32px, 6vw, 55px);
  height: clamp(32px, 6vw, 55px);
  cursor: pointer;
  border-radius: 50%;
  background-color: rgba(255, 137, 137, 0.25);
  padding: 6px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.music-control img:hover {
  transform: scale(1.1);
  background-color: rgba(255, 137, 137, 0.4);
}

/* 手机端：取消绝对定位，变成正常流式元素，靠右对齐，避免和邮件按钮重叠 */
@media (max-width: 768px) {
  .music-control {
    position: static;
    align-self: flex-end;
    margin-top: 8px;
    margin-right: 4px;
  }
}

/* ================== Intro 黑屏遮罩 ================== */

@keyframes icp-fadein {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#intro {
  position: fixed;
  inset: 0;
  background: #000;
  color: #fff;
  z-index: 9999;            /* 保证在最上层 */
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 800ms ease; /* 淡出时间 */
}

#intro.hidden {
  opacity: 0;
  pointer-events: none; /* 淡出中禁用点击 */
}

.intro-inner {
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: .08em;
}

.intro-line {
  font-size: clamp(18px, 3vw, 28px);
  white-space: nowrap;
}

/* 打字样 “...”：逐步出现 0/1/2/3 个点 */
.dots::after {
  content: "";
  display: inline-block;
  width: 0;
  animation: dotsTyping 1.2s steps(4, end) infinite;
}

@keyframes dotsTyping {
  0%   { content: "";   }
  25%  { content: ".";  }
  50%  { content: ".."; }
  75%  { content: "...";}
  100% { content: "";   }
}

/* 复古终端风的方块光标闪烁 */
.caret {
  display: inline-block;
  width: .6ch;
  height: 1em;
  background: #fff;
  margin-left: .1ch;
  transform: translateY(.12em);
  animation: caretBlink 1s steps(1, end) infinite;
}

@keyframes caretBlink {
  0%, 50%   { opacity: 1; }
  50.01%,100% { opacity: 0; }
}

.intro-hint {
  margin-top: 12px;
  font-size: 0.9em;
  opacity: .65;
}

/* 盖屏期间禁止滚动 */
body.no-scroll {
  overflow: hidden;
}

/* 尊重“减少动态效果”系统设置 */
@media (prefers-reduced-motion: reduce) {
  #intro { transition: none; }
  .dots::after, .caret { animation: none; }
}

/* ================== Code Overlay（代码输出层） ================== */

.code-overlay {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  top: auto;

  /* 宽度由内容自适应（不设上限） */
  width: auto;                 /* 回退值 */
  width: -moz-fit-content;     /* 兼容旧版 Firefox */
  width: fit-content;          /* 现代浏览器 */
  max-width: none;
  overflow-x: visible;

  max-height: 100vh;
  padding: 20px 20px;

  /* 透明化 + 无容器阴影 */
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  mask-image: none !important;
  -webkit-mask-image: none !important;

  color: rgba(255, 157, 157, 0.5);

  font: 700 16px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  z-index: 1;
  pointer-events: none;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.code-overlay::-webkit-scrollbar {
  display: none;
}

/* 代码行：自动换行 + 红色发光 */
#code-stream .line {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-shadow:
    0 0 8px rgba(255,100,100,.45),
    0 0 2px rgba(255,100,100,.6);
}

/* 让手机也显示代码输出层 */
@media (max-width: 900px){
  .code-overlay{ 
    display:block !important;
  }
}

/* 手机横/竖屏时只调小字号，不再限制高度 */
@media (max-width: 900px) and (orientation: landscape){
  .code-overlay{
    left: .75rem;
    bottom: .75rem;
    /* 不限制 max-height，让它继续用 100vh */
    max-height: 100vh;
    font-size: 12px;
  }
}
@media (max-width: 900px) and (orientation: portrait){
  .code-overlay{
    left: .75rem;
    bottom: .75rem;
    /* 同上，铺满屏高 */
    max-height: 100vh;
    font-size: 12px;
  }
}


/* ================== 模拟时钟样式 ================== */

.clock-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  height: 60%;
  margin-bottom: clamp(16px, 4vw, 48px);
}

/* 模拟时钟 */
.analog-clock {
  position: relative;
  width: clamp(180px, 40vw, 280px);
  height: clamp(180px, 40vw, 280px);
  aspect-ratio: 1;
}

.clock-face {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 0 30px rgba(255, 182, 193, 0.3),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.clock-number {
  position: absolute;
  font-size: clamp(12px, 2.5vw, 16px);
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clock-number.n12 { top: 6%; left: 50%; transform: translateX(-50%); }
.clock-number.n3  { top: 50%; right: 6%; transform: translateY(-50%); }
.clock-number.n6  { bottom: 6%; left: 50%; transform: translateX(-50%); }
.clock-number.n9  { top: 50%; left: 6%; transform: translateY(-50%); }

/* 刻度线 */
.clock-face::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  background: 
    radial-gradient(circle, transparent 0%, transparent 85%, rgba(255, 255, 255, 0.2) 85%, rgba(255, 255, 255, 0.2) 100%);
  border-radius: 50%;
}

.hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
}

.hour-hand {
  width: clamp(4px, 1vw, 6px);
  height: 25%;
  margin-left: clamp(-3px, -0.5vw, -3px);
  background: #ffffff;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.minute-hand {
  width: clamp(3px, 0.8vw, 4px);
  height: 35%;
  margin-left: clamp(-2px, -0.4vw, -2px);
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.second-hand {
  width: clamp(1px, 0.5vw, 3px);
  height: 40%;
  margin-left: clamp(-1px, -0.25vw, -1px);
  background: #ff99e5;
  border-radius: 1px;
  box-shadow: 0 0 12px rgba(255, 153, 229, 0.6);
}

/* 中心点 */
.center-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(8px, 2vw, 12px);
  height: clamp(8px, 2vw, 12px);
  background: #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  z-index: 10;
}

/* 数字时间显示 */
.digital-time {
  font-size: clamp(36px, 8vw, 64px);
  font-weight: 500;
  color: #ffffff;
  text-shadow: 
    0 0 20px rgba(255, 255, 255, 0.5),
    0 0 40px rgba(255, 182, 193, 0.3);
  letter-spacing: 4px;
}

.digital-time .colon {
  opacity: 1;
  margin: 0 2px;
}

/* 日期显示 */
.date-display {
  font-size: clamp(14px, 2.5vw, 20px);
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 2px;
}

/* ================== 页脚版权声明 ================== */

.footer {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  text-align: center;
  font-size: 14px;
  color: rgba(255, 188, 188, 0.9);
  background: transparent;
  line-height: 1.4;
  font-family: "Microsoft Yahei UI", "Microsoft Yahei UI", sans-serif;
  user-select: none;
  pointer-events: none; /* 避免干扰点击 */
}

/* ==== 手机端专用：音乐按钮优化 ==== */
@media (max-width: 768px) {
  /* 让按钮在卡片内部居中，而不是靠右 */
  .music-control {
    position: static;         /* 取消绝对定位，参加正常布局 */
    align-self: center;       /* 在 .time 容器里居中 */
    margin-top: 8px;
    margin-right: 0;
  }

  .music-control img {
    /* 再缩小一点：20~32 像素之间自适应 */
    width: clamp(20px, 8vw, 32px);
    height: clamp(20px, 8vw, 32px);

    /* 加一点阴影，让它有按钮质感 */
    box-shadow:
      0 4px 10px rgba(0, 0, 0, 0.25),
      0 0 0 1px rgba(255, 255, 255, 0.2);
  }
}

video::-webkit-media-controls {
  display: none !important;
}

video::-webkit-media-controls-enclosure {
  display: none !important;
}

video::-webkit-media-controls-panel {
  display: none !important;
}
