/* ================== 字体 ================== */
@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;
}

/* 背景容器 */
.background {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: linear-gradient(to bottom left, #f0e5e8, #ffffff);
  overflow: hidden;
}

/* 背景视频 */
.background-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* ================== 核心内容布局 ================== */

.content {
  position: relative;
  z-index: 1;
  width: min(1200px, 90vw);
  height: calc(100% - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(24px, 4vh, 40px) clamp(24px, 4vw, 48px);
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .content {
    width: 100vw;
    height: auto;
    padding: 16px 12px 20px;
  }
}

.gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: linear-gradient(to right, rgba(255, 220, 230, 0.45), rgba(255, 230, 240, 0.45));
  pointer-events: none;
}

.content .title {
  font-family: "Microsoft Yahei UI";
  color: white;
  letter-spacing: 2px;
  font-size: clamp(18px, 2.4vw, 24px);
}

.content .time-box {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 90%;
  max-width: 1000px;
  height: 60%;
  margin-bottom: clamp(16px, 4vw, 48px);
}

@media (max-width: 480px) {
  .content .time-box {
    flex-wrap: wrap;
    row-gap: 8px;
  }
}

.content .time-box div {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 22%;
  height: auto;
}

.content .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, 192, 203, 0.4);
  text-stroke: 1px rgba(255, 192, 203, 0.4);
}

.content .time-box div span {
  color: rgb(255, 255, 255);
  font-size: clamp(20px, 4.4vw, 32px);
  letter-spacing: 8px;
  opacity: 0.8;
}

.content .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);
}

.content .sub-title.tips {
  margin: 16px;
}

.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, 192, 203, 0.2);
  padding: 6px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.music-control img:hover {
  transform: scale(1.1);
  background-color: rgba(255, 192, 203, 0.35);
}

@media (max-width: 768px) {
  .music-control {
    position: absolute;
    bottom: 12px;
    right: 12px;
  }
  .music-control img {
    width: clamp(24px, 8vw, 40px);
    height: clamp(24px, 8vw, 40px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.2);
  }
}

/* ================== 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;
}

/* 省略号动画：固定宽度 3ch 确保 Hello World 不会左右晃动 */
.dots {
  display: inline-block;
  width: 3ch;
  text-align: left;
}

.dots::after {
  content: "";
  display: inline-block;
  animation: dotsTyping 1.2s steps(4, end) infinite;
}

@keyframes dotsTyping {
  0%   { content: "";  }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "...";}
  100% { content: "";  }
}

/* 彻底移除光标效果 */
.caret {
  display: none !important;
}

.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 { animation: none; }
}

/* ================== Code Overlay ================== */

.code-overlay {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  width: fit-content;
  max-width: none;
  max-height: 100vh;
  padding: 20px 20px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: rgba(255, 192, 203, 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;
}

.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,192,203,.4), 0 0 2px rgba(255,192,203,.5);
}

@media (max-width: 900px){
  .code-overlay{ display:block !important; }
}

@media (max-width: 900px) and (orientation: landscape){
  .code-overlay{ left: .75rem; bottom: .75rem; font-size: 12px; }
}
@media (max-width: 900px) and (orientation: portrait){
  .code-overlay{ left: .75rem; bottom: .75rem; font-size: 12px; }
}

/* ================== 页脚徽章 ================== */

.meta-row {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  z-index: 1;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 9999px;
  font-size: 1rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  text-decoration: none;
  transition: transform .15s ease, background .2s ease;
}

.meta-badge:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.14);
}

.meta-badge.icp { letter-spacing: .2px; }

@media (max-width: 420px) {
  .meta-badge { font-size: 0.8rem; padding: 6px 10px; }
}

.footer {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  text-align: center;
  font-size: 14px;
  color: rgba(255, 192, 203, 0.8);
  z-index: 1;
}

video::-webkit-media-controls { display: none !important; }
