@font-face {
  font-family: 'LanaPixel';
  src: url('fonts/lanapixel_bitmaponly/LanaPixel_BitmapOnly.ttf') format('truetype');
}

body {
  margin: 0;
  padding: 0;
  height:100%;
  font-family: 'Helvetica Neue', sans-serif;
  background:white;
  color: #333;
  display: block;
  overflow-y:scroll;
  overflow-x: hidden;
  width: 100%;
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
  scrollbar-width: none; 
}

/* ===============================
   全站中文页面默认正文字体（仅 zh-Hans）
   =============================== */
html[lang="zh-Hans"] body{
  font-family: "Noto Sans SC", "Helvetica Neue", sans-serif;
}

body::-webkit-scrollbar { width: 0; height: 0; } 
.scroll-down{
  position: absolute; 
  left: 50%; bottom: 30px; 
  transform: translateX(-50%);

  display: inline-flex; 
  flex-direction: column;
  align-items: center; 
  gap: 1px;
  
  padding: 10px 14px;
  border: 0.5px solid rgba(0,0,0,.35);
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(4px) saturate(110%);
  cursor: pointer;
  z-index: 3;
  font-family: "Codystar", sans-serif;
  font-size: 14px;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.scroll-down:hover{
  transform: translateX(-50%) translateY(-2px);
  background: rgba(255,255,255,.85);
  border-color: rgba(0,0,0,.55);
}

/* Magnetic effect – particles (no change to existing .scroll-down styles) */
.scroll-down.magnetic {
  overflow: visible;
}
.scroll-down .particles-field {
  position: absolute;
  inset: -300%;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.scroll-down .particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(102, 102, 102, 0.9);
  border-radius: 50%;
}
.scroll-down.magnetic:hover .particles-field {
  opacity: 1;
}
@keyframes particleFloat {
  0% { transform: translate(var(--x), var(--y)) scale(0); }
  50% { transform: translate(calc(var(--x) * -1), calc(var(--y) * -1)) scale(1); }
  100% { transform: translate(var(--x), var(--y)) scale(0); }
}

.scroll-icon{
  width: 28px;
  height: 28px;
  display: block;
  animation: sd-bounce 1.2s infinite ease-in-out;
}

/* 页面底部版权区 */
#page-footer{
  position: static;
  margin-top: 2rem;
  padding: 1.5rem 0 2.5rem;
  text-align: center;
  color: #555;
  font-family: "VT323", monospace;
  font-size: clamp(11px, 1.4vw, 14px); /* 随屏幕宽度等比变化 */
  /* 提高对比度，让渐变更明显 */
  background:#ffffff;
  border-top: 0.5px solid #989898;          /* 与上方 profile 用灰色分割线隔开 */
}

.footer-inner{
  display: flex;
  flex-direction: column;              /* 第一行 logo，第二行文字 */
  align-items: center;
  gap: 0.1rem;
}

.footer-text{
  display: inline-flex;                /* 文本和图标同一行 */
  align-items: center;                 /* 垂直方向居中对齐 */
  gap: 0.35rem;                        /* 文字与图标之间留一点间距 */
}

.footer-icon-instagram{
  width: 18px;
  height: auto;
  display: inline-block;
}

html[lang="zh-Hans"] #page-footer{
  font-family: "Noto Sans SC", "Helvetica Neue", sans-serif;
  font-size: clamp(9px, 1.3vw, 14px); 
}

.footer-logo{
  height: 40px;
  width: auto;
  display: block;
}

@keyframes sd-bounce {
  0%, 100% { transform: translateY(0); opacity: .9; }
  50% { transform: translateY(3px); opacity: 1; }
}

    aside {
    position: sticky;
    width: 120px;
    background-color: #ffffff;
    background-image: url('img/other/aside-test.webp');
    background-repeat: no-repeat;
    /* 缩小：整张图按比例完整显示，固定在上方 */
    background-size: contain;
    background-position: center 10px;
    border-right: 0.5px solid #ebebeb;
    padding: 0.5rem;
    box-sizing: border-box;
    display: flex;
    flex: 0 0 120px;  
    flex-direction: column;
    align-items: center;
    z-index: 130;
    gap: 0.5rem;
    overflow: hidden;
    height:calc(100vh - 30px); 
    }

    /* 侧栏抖动线条覆盖层 */
    aside::before{
      content: '';
      position: absolute;
      inset: 0;
      /* 竖向细线条纹理 */
      background-image: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,0.35) 0px,
        rgba(255,255,255,0.35) 1px,
        transparent 1px,
        transparent 3px
      );
      mix-blend-mode: soft-light;
      opacity: 0.5;
      pointer-events: none;
      z-index: 0;
      animation: aside-lines-jitter 1.6s ease-in-out infinite;
    }

    @keyframes aside-lines-jitter{
      0%,100%{
        transform: translateX(0);
      }
      25%{
        transform: translateX(0.6px);
      }
      50%{
        transform: translateX(-0.6px);
      }
      75%{
        transform: translateX(0.3px);
      }
    }

    @media (prefers-reduced-motion: reduce){
      aside::before{
        animation: none;
        opacity: 0.2;
      }
    }

    /* 侧栏顶部：示例2风格的水平波动线 */
    aside::after{
      content: '';
      position: absolute;
      left: 10px;
      right: 10px;
      top: 0;
      bottom: 0;        /* 让伪元素占满整个竖向高度 */
      pointer-events: none;
      z-index: 1;
      opacity: 0.7;
      /* 一条线内部有“亮点”在流动 */
      background-image: 
        linear-gradient(
          90deg,
          transparent 0,
          transparent 60%,
          rgba(0,0,0,0.55) 68%,
          transparent 55%,
          transparent 100%
        ),
        linear-gradient(
          90deg,
          transparent 0,
          transparent 60%,
          rgba(0,0,0,0.55) 68%,
          transparent 55%,
          transparent 100%
        );

        background-size:
        24px 2px,   /* 顶部那条：宽 24px，高 2px */
        24px 2px;   /* 底部那条：宽 24px，高 2px */
    
      background-repeat:
        repeat-x,
        repeat-x;
    
      /* Y 方向分别放在距离顶部 6px 和距离底部 6px 的位置 */
      background-position:
        0 6px,
        0 calc(100% - 6px);
    
      /* 2.5s 一圈：速度更慢、更平稳 */
      animation: aside-wave-scroll 4s linear infinite;
    }
    
    @keyframes aside-wave-scroll{
      from { background-position: 0 6px, 0 calc(100% - 6px); }
      to   { background-position: 24px 6px, 24px calc(100% - 2px); }
    }

    @media (prefers-reduced-motion: reduce){
      aside::after{
        animation: none;
        opacity: 0.3;
      }
    }

    .avatar {
      width: 64px;
      height: 64px;
      border-radius: 50%;
      object-fit: cover;
      cursor: pointer;
      border: 1px solid #ccc;
      transition: border 0.3s ease;
      z-index: 50;
    }

    .avatar:hover {
      border-color: #ed766b;
    }

    .avatar.active{
      border-color:#ed766b;
    }

    .avatar-container {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 0.7rem;
      overflow-y: auto;
      overflow-x: hidden;
      width: 100%;
      align-items: center;
      scrollbar-width: none;
    }
    .avatar-container::-webkit-scrollbar { display: none; }

    .aside-scroll-btn {
      background: transparent;
      border: none;
      cursor: pointer;
      padding: 0.3rem;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: opacity 0.2s ease;
      flex-shrink: 0;
    }

    .aside-scroll-btn:hover {
      opacity: 0.7;
    }

    .aside-scroll-btn:disabled {
      opacity: 0.3;
      cursor: not-allowed;
    }

    .aside-scroll-btn img {
      width: 20px;
      height: 20px;
    }


    main {
      flex: 1;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
    }

      #main-visual-wrapper{
      height: 100vh;
      width: 100vw;
      margin: 0 auto;
      display: flex;
      overflow: hidden;
      text-align: center;
      justify-content: center;
      align-items: center;
      position: relative;
      overflow: hidden;
      background-color: #ffffff;
    }

    #main-visual-container{
      position: absolute;
      top:50%;
      left:50%;
      transform: translate(-50%, -50%) scale(1.3);
      contain: layout paint;
      transform-origin: center center;
      z-index: 20;
      transition: transform 0.3s ease-in-out;
    }

    #main-visual{
        max-width: 100%;
        max-height: 100%;
        pointer-events: none;
        object-fit: contain;
        margin:0 auto;
        z-index: 20;
        transition:opacity 0.4s ease-in-out;
    }

    #main-visual.fullheight {
        height: 100vh;
        width: auto;
        object-fit: contain;
    }

    #main-visual.fade-out {
        opacity: 0;
    }

#main-visual.fade-in {
        opacity: 1;
    }

    @media (max-width: 600px){
      #main-visual-wrapper{
        background-color: transparent;
      }

  /* Mobile：Main visual 左右切换按钮 */
  #mobile-main-nav-buttons{
    position: absolute;
    bottom: 25%;              /* 稍微靠上一点，和中部的 zoom 按钮错开 */
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    pointer-events: none;      /* 容器不拦截点击，只让内部按钮可点 */
    z-index: 130;              /* 高于背景和立绘，低于菜单按钮等 UI */
  }

  .mv-nav-btn{
    pointer-events: auto;
    border: none;
    background: transparent;
    padding: 4px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mv-nav-btn img{
    width: 28px;
    height: 28px;
    display: block;
  }
    }
    
#background-image{
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  /* 背景图的写法（div） */
  background-color: #fff;            /* PNG 透明处的默认白底 */
  background-repeat: no-repeat;
  background-position: 50% 50%;
  background-size: cover;

  /* 过渡与可选的整体透明度 */
  opacity:1;                       /* 想一直很淡就留着；想正常亮度=1 */
  transition: opacity .45s ease, filter .45s ease, background-position .45s ease, background-size .45s ease;
}


   /* info 和 gauge 仅在 character section 显示，hero 时隐藏 */
   body.is-hero-active #info-wrapper,
   body.is-hero-active .wheel-cluster { display: none !important; }

   /* custom-info、char-meta(角色logo/name/description) 仅在 character section 的主视觉区显示，
      不在 hero、profile、character gallery 显示 */
   body.is-hero-active #custom-info,
   body.is-hero-active .char-meta,
   body.chara-section-bottom #custom-info,
   body.chara-section-bottom .char-meta { display: none !important; }

   #info-wrapper{
     display: flex;
     position: fixed;
     top: 30px;
     left: 130px;
     flex-direction: column;
     line-height: 1.8;
     gap:0.5rem;
     z-index: 30;
   }

@media (max-width: 600px){
  #info-wrapper{
    position: static;
    top: auto;
    left: auto;
    margin: 0 0 1rem 0;
  }
}

   #info{
     font-size: clamp(7px, 1vw, 28px);
     font-family:  "VT323", monospace;
   }

   #custom-info{
     display: flex;
     position: fixed;
     top: 30px;
     left: calc(130px + 12vw + 20px);
     flex-direction: column;
     line-height: 1.8;
     gap: 0.3rem;
     z-index: 30;
     max-width: 150px;
     padding: 0rem;
   }

@media (max-width: 600px){
  #custom-info{
    position: static;
    top: auto;
    left: auto;
    margin: 0 0 1rem 0;
    max-width: 100%;
  }
}

/* Mobile：Main Visual 与 Profile 之间的角色信息区容器 */
@media (max-width: 600px){
  #chara-info-block{
    width: min(90vw, 500px);      /* 不超过 500px，且最多占 90vw */
    margin: 0 auto 1rem auto;     /* 在屏幕中水平居中 */
    padding: 0.75rem 1rem 1.25rem;
    background: #ffffff;
    box-sizing: border-box;
  }

  /* 手机端使用 proximity 降低敏感度，保留阻尼感 */
  #character-scroll-container{
    scroll-snap-type: y proximity;
  }
  #main-visual-section,
  #profile-section,
  #chara-info-block{
    scroll-snap-align: start;
  }
}

   .custom-info-header{
     display: flex;
     align-items: center;
     gap: 0.3rem;
     margin-bottom: 0.3rem;
   }

   .custom-info-icon{
     width: 15px;
     height: 15px;
     opacity: 0.8;
   }

   .custom-info-label{
     font-size: 8px;
     font-family: 'DotGothic16', monospace;
     color: #999;
     text-transform: uppercase;
     letter-spacing: 0.5px;
   }

   .custom-info-title{
     font-size: clamp(7px, 0.9vw, 35px);
     font-family: 'DotGothic16', monospace;
     font-weight: bold;
     color: #333;
     text-align: left;
     line-height: 1.3;
   }

  .custom-info-description{
    font-size: clamp(5px, 0.9vw, 30px);
    font-family: 'DotGothic16', monospace;
    color: #666;
    text-align: left;
    line-height: 1.5;
  }

/* Totsukawa 等深色背景角色的 info / custom-info 透明底白字样式 */
body.char-info-light #info-wrapper {
  background: transparent;
  border-radius: 8px;
}

body.char-info-light #info {
  color: #ffffff;
}

body.char-info-light #custom-info {
  background: transparent;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}

body.char-info-light #custom-info .custom-info-label,
body.char-info-light #custom-info .custom-info-title,
body.char-info-light #custom-info .custom-info-description {
  color: #ffffff;
}

body.char-info-light #character-name,
body.char-info-light #character-description {
  color: #ffffff;
}

   .char-meta{
    display:flex;
    max-width: 30vw;
    position: fixed;
    bottom:5%;
    left:130px;
    flex-direction: column;
    gap:0.2rem;
    z-index:126;
   }

   #character-logo{
    position: relative;
    left: 10px;
    width: clamp(40px, 8vw, 120px);
    height: auto;
    margin-bottom: 0.1rem;
   }

   #character-description{
    font-size: clamp(1px,0.7vw,7px);
    letter-spacing: 1px;
    font-family: "ocr-b-std", monospace;
   }

   #character-name{
    font-size: clamp(15px,3vw,45px);
    font-family: "bc-vajgar", sans-serif;
   }

  /* 中文页面下，角色名为中文时的字体 */
  #character-name.is-zh{
    font-family: "Noto Serif SC",  "Noto Sans SC", "WDXL Lubrifont SC", system-ui, serif;
    font-weight: 800;
    letter-spacing: 0.08em;
  }

  /* 中文页面下，描述为中文时的字体与字距 */
  #character-description.is-zh{
    font-family: "ZCOOL XiaoWei", "Noto Sans SC", "WDXL Lubrifont SC", system-ui, serif;
    letter-spacing: 0.5em;
    margin-left: 5px;
  }

@media (max-width: 600px){
  /* 小屏：角色 Logo / 名称 / 描述作为叠加层，默认在屏幕底部中心。
     当 body 带有 char-meta-top 时移动到屏幕顶部中心。 */
  .char-meta{
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    max-width: 100vw;
    z-index: 126;
    gap: 0.2rem;
    align-items: center;
    text-align: center;
    pointer-events: none; /* 避免挡住下方内容的触控 */
  }
  body.char-meta-top .char-meta{
    top: 0;
    bottom: auto;
  }
  #character-logo{
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom:40px;
    width: clamp(50px, 14vw, 100px);
  }
  #character-description{
    position: fixed;
    display: center;
    max-width: 80vw;   
    bottom:40px;
    white-space: nowrap; 
    font-size: clamp(5px, 1vw, 10px);
  }
  #character-name{
    position: fixed;
    display: center;
    font-size: clamp(20px, 6vw, 40px);
    bottom:5px;
    max-width: 80vw;          /* 预留 80vw 宽度，不易被边缘挤压 */
    margin: 0 auto;           /* 在信息带内部水平居中 */
    white-space: nowrap;      /* 不换行，保持一行展示 */
  }
}

.wheel-cluster{
  position: fixed;
  left: 0;
  top: 30%;
  transform: translateY(50%);
  width: clamp(200px, 40vh, 300px);
  height: clamp(200px, 40vh, 300px);
  pointer-events: none;
  z-index: 125;
}
    #zoom-controls {
        position:absolute;
        display: flex;
        left: 60%;
        top:50%;
        transform:translateY(-50%) ;
        flex-direction: column;
        gap: 10px;
        padding: 0.5rem;
        pointer-events: auto;
        z-index: 125;
    }
    #zoom-controls button {
         font-size: 0.6rem;
         font-family:  "VT323", monospace;
         padding:4px 6px;;
         border: none;
         background: rgba(0, 0, 0, 0.2);
         cursor: pointer;
         transition: background 0.2s;
         border-radius: 0.5rem;
    }

    #zoom-controls button:hover {
        background: #dddddd;
    }

@media (max-width: 600px){
  /* 小屏：隐藏表盘，但保留缩放按钮并移到页面最左侧 */
  .wheel-wrapper{
    display: none;
  }
  #zoom-controls{
    position: fixed;
    left: 10px;
    top: 65%;
    transform: translateY(-50%);
    z-index: 140;
    padding: 0;
    gap: 6px;
    background: transparent;
    border-radius: 0;
  }
}

 
     .wheel-wrapper {
    position: absolute;
    inset: 0;
    left: 0px;
    overflow: hidden;
    pointer-events: none;
    z-index: 125;
    border-radius: 50%;
    box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3);
    }

    #wheel{
    width:100%;
    height: auto;
    transition:transform .3s ease;
    border-radius: 50%;
    }

.auxiliary{
  position: absolute;
  right: 1rem;
  top:2.5rem;
  background:transparent;
  object-fit:contain;

  display: inline-flex;
  flex-direction: column;
  flex-wrap: nowrap;              /* 单列纵向滚动 */
  max-height: 80vh;
  overflow: hidden;

  width:20vh;
  padding: 8px 0.3rem 12px;       /* 顶部留出 8px 呼吸区 */
  gap: 0.5rem;
  cursor: pointer;
  z-index: 120;
}

/* 默认隐藏 mobile 菜单按钮，避免在桌面视图出现 */
.mobile-aside-toggle{
  display: none;
}

/* ========== Mobile scroll-snap：使用 proximity 降低敏感度，保留阻尼感 ========== */
@media (max-width: 600px){
  /* 关闭整页的 snap，避免轻微滑动就“吸附跳跃” */
  body{
    scroll-snap-type: y proximity;
  }
  #character-scroll-container{
    scroll-snap-type: y proximity !important;
  }
  #main-visual-section,
  #profile-section,
  #chara-info-block{
    scroll-snap-align: start;
  }
}

@media (max-width: 600px){
  /* 小屏：辅助立绘作为 Profile 顶部信息区下方的一行缩略图，横向滚动 */
  .auxiliary{
    position: static;
    right: auto;
    top: auto;
    width: 100%;              /* 占满 chara-info-block 内部，但整体受 90vw/500px 限制 */
    max-height: none;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
    padding: 0.25rem 0 0.5rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    box-sizing: border-box;
    margin: 0 auto;          /* 在 90% 宽度内居中 */
  }
  .auxiliary-thumb {
    width: 22vw;
    height: auto;
    aspect-ratio: 1 / 1;
  }
}

/* ========== Mobile layout (<600px) base for character section ========== */
@media (max-width: 600px){
  /* mobile menu button in character section */
  .mobile-aside-toggle{
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 150;
    border: none;
    background: rgba(255,255,255,0.9);
    border-radius: 999px;
    padding: 6px 8px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,.15);
  }
  .mobile-aside-toggle img{
    width: 20px;
    height: 20px;
    display: block;
  }

  /* 仅在进入角色区时显示菜单按钮 */
  body.in-character-section .mobile-aside-toggle{
    display: inline-flex;
  }

  /* hide desktop aside by default on small screens */
  #character-section aside{
    display: none !important; /* 强制隐藏，避免 desktop 遗留的 inline display 把布局挤偏 */
  }

  /* when mobile aside is open, show it as full-screen overlay grid */
  body.mobile-aside-open #character-section aside{
    display: block !important;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    padding-top: 72px;
    padding-inline: 16px;
    box-sizing: border-box;
    z-index: 150;
    border-right: none;
  }
  body.mobile-aside-open .avatar-container{
    flex: none;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.75rem;
    align-items: flex-start;
    justify-items: center;
    max-height: none;
    overflow-y: auto;
    padding-bottom: 24px;
  }
  body.mobile-aside-open .aside-scroll-btn{
    display: none;
  }
}

/* 包装层：背景图 + 边框（图层顺序：边框 > avatar > 背景） */
.auxiliary-thumb {
  position: relative;
  width: 19vh;
  height: 19vh;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid #ccc;
  border-top: 1px solid #ccc;
  background-image: url('img/Hero/card-background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-sizing: border-box;
  transition: transform .3s, border-color .2s, border-top-width .2s, box-shadow .3s;
}

.auxiliary-thumb:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 6px -2px rgba(237,118,107,.9);
}

.auxiliary-thumb:has(img.active) {
  border-top-color: #ed766b;
  border-top-width: 2px;
}

.auxiliary img{
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  object-fit: contain;
  object-position: center 35%;
  display: block;
  transition: transform .3s;
}


   /* DEBUG：把按钮强制显示成大红圆，压到最上层 */
    #aux-prev, #aux-next{
    position: fixed;
    left: auto !important;          
    right: 25vh !important;
    width: 30px;
    height:30px;
    display: none;
    align-items: center;
    justify-content: center;
    background: #d5d5d5 ;     
    color: #fff;
    border-radius: 50% !;
    z-index: 50;      
    opacity: 1;
    visibility: visible !important;
    pointer-events: auto !important;
    cursor: pointer;
    transition:opacity .2s ease;
    }

#aux-prev{ top: 3rem !important; }
#aux-next{ top: 5rem !important; }

/* 防止任何 disabled 规则把它禁用 */
#aux-prev.disabled, #aux-next.disabled{
  opacity:.35;
  pointer-events:none;
}

@media (max-width: 600px){
  /* 手机视图中不显示辅助列表的翻页按钮，仅保留手势滚动 */
  #aux-prev,
  #aux-next{
    display: none !important;
    pointer-events: none !important;
  }
}

#page-header{
    position: fixed;
    top: 0;
    left:0;
    width: 100%;
    background: linear-gradient(to bottom, rgba(255, 108, 108, 0.3), rgba(255, 255, 255, 0));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter:blur(6px);
    text-align: center;
    padding: 0.3rem rem;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 135;
    pointer-events: none;
}

.header-content {
  display: flex;
  flex-wrap: wrap; 
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  align-items: center;
  position: relative;
}


#page-header.visible {
  opacity: 1;
  pointer-events: auto;
}

#logo-container {
  position: fixed;
  top:50px;
  left: 55%;
  width: 45vw;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
  z-index: 1;
}

.stretch-text {
  font-family: "copperplate", serif;
  font-weight: 400;
  font-size: clamp(1px, 0.5vw, 15px);
  white-space: nowrap;
  display: inline-block;
  overflow: hidden;
  width: 45%;
  text-align: center;
  letter-spacing: normal;
}

.logo-img {
  width:clamp(2px, 2vw, 30px);
  height: auto;
}


.header-title {
  position: relative;
  display: flex;
  align-items: center;
  font-family: "Codystar", sans-serif;
  font-size: 1rem;
  color: #111;
}

.header-nav{
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-nav a{
  margin-left: 0;
  color: #111;
  font-family:  "Codystar", sans-serif;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  text-decoration: none;      /* desktop: 去掉下划线 */
}

/* 让带有 zcool-qingke-huangyou-regular 的导航链接使用站酷字体，覆盖默认 Codystar */
.header-nav a.zcool-qingke-huangyou-regular{
  font-family: "ZCOOL QingKe HuangYou", sans-serif;
}

/* 导航中的 info 图标按钮尺寸 */
.header-nav .nav-icon-info{
  display: none;
}

/* 中文视图：About 仅图标无文字标签，laptop 下也显示图标 */
html[lang="zh-Hans"] .header-nav .nav-icon-info{
  display: block;
  width: 18px;
  height: 18px;
}

.header-nav .nav-icon-instagram{
  display: none;
}

/* Desktop：图标右侧可以有文字标签 */
.header-nav .nav-label{
  margin-left: 0.25rem;
}

/* Mobile (<600px)：只显示图标，隐藏文字标签 */
@media (max-width: 600px){
  #page-header{
    position: static;
    opacity: 1;
    pointer-events: auto;  /* 允许点击语言切换等按钮 */
  }
  .header-nav .nav-label{
    display: none;
  }

  .header-nav .nav-icon-info{
    width: 18px;
    height: 18px;
    display: block;
  }
  
  .header-nav .nav-icon-instagram{
    width: 18px;
    height: 18px;
    display: block;
  }

}

.lang-switch{
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-toggle{
  border: none;
  background: transparent;
  padding: 0;
  margin-left: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

/* 去掉点击 / 聚焦时的红色/蓝色边框高亮 */
.lang-toggle:focus,
.lang-toggle:focus-visible{
  outline: none;
  box-shadow: none;
}

.lang-toggle img{
  width: 16px;
  height: 16px;
  display: block;
}

.lang-menu{
  position: absolute;
  top: 120%;
  right: 0;
  min-width: 100px;
  padding: 0.2rem 0;
  background: rgba(255,255,255,0.98);
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 200;
}

.lang-menu[hidden]{
  display: none;
}

/* Mobile：把语言菜单固定到视口右上角，避免被布局挤出或挡住 */
@media (max-width: 600px){
  .lang-menu{
    position: fixed;
    top: 10px;        /* 约在 header 下方一点点，你可以微调这个值 */
    right: 8px;
    z-index: 150;     /* 确保在其他内容之上 */
  }
}

.lang-menu a{
  padding: 0.1rem 0.2rem;
  font-family: "Noto sans SC";
  font-size: 0.6rem;
  color: #111;
  text-decoration: none;
  white-space: nowrap;
}

.lang-menu a:hover{
  background: #ed766b;
  color: #fff;
}

.tl-overlay{
  position: fixed; inset: 0; z-index: 130;
  background:rgba(236, 236, 236, 0.55);
  backdrop-filter: blur(2px) saturate(115%);
  opacity: 0; transition: opacity .22s ease-out;
}
.tl-overlay.is-open{ opacity: 1; }

.tl-dialog{
  font-family: "VT323", monospace;
  position: fixed; inset: 0; z-index: 131;
  display: grid; place-items: center;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease-out;
}
.tl-dialog.is-open{ opacity: 1; pointer-events: auto; }

.tl-dialog__panel{
  position: relative;
  display: flex; flex-direction: column;
  width: min(92vw, 750px); max-height: 75vh; overflow: visible;
  padding: 24px 22px; border-radius: 12px;
  background: rgba(236, 236, 236, 0.55); color: #090909;
  box-shadow:
    0 8px 12px -6px rgba(215,120,120,.35),
    0 24px 40px -18px rgba(215,120,120,.50);

  transform: translateY(8px); transition: transform .22s ease-out;
}
.tl-dialog.is-open .tl-dialog__panel{ transform: translateY(0); }

.tl-dialog__close{
  position: sticky; bottom: 0;right:0; margin-left: auto;
  font-size: 20px; border: none; background: transparent;
  color: #444444; cursor: pointer;
}
.tl-dialog__close:hover{ color: #fff; }
.tl-dialog__title{ margin: 4px 0 8px; font-size: 18px; }
.tl-dialog__content{ flex: 1 1 auto; min-height: 0; overflow: auto; }
/* 仅在 Disclaimer 弹窗中使用 DotGothic16 字体 */
#disclaimer-dialog .tl-dialog__content{ font-family: "DotGothic16", sans-serif; font-size: 12px;}
.tl-dialog__content p{ margin: 10px 0; line-height: 1.6; }

/* 仅让 Disclaimer 弹窗内容区滚动，尺寸与 About 保持一致 */
#disclaimer-dialog .tl-dialog__content{ overflow: auto; }
.tl-dialog__content p{ margin: 10px 0; line-height: 1.6; }

/* Dev-log 弹窗内容区与 Music Credits 同风格 */
#devlog-dialog .tl-dialog__content{ font-family: "DotGothic16", sans-serif; font-size: 12px; overflow: auto; }

body.tl-no-scroll{ overflow: hidden; }

/* —— 邮件界面风格 —— */
.mail-header{
  display:flex; align-items:center; gap:12px;
  padding:10px 12px; margin:4px 0 6px;
  background: rgba(230, 230, 230, 0.55);
  border:0.25px solid rgba(86, 86, 86, 0.55);
  border-radius:10px;
}
.mail-avatar{
  width:40px; height:40px; border-radius:50%;
  background: linear-gradient(135deg, #2b2f3a, #1b1f27);
  display:grid; place-items:center; flex:0 0 auto; overflow:hidden;
  border:1px solid rgba(255,255,255,.55);
}
.mail-avatar img{ width:100%; height:100%; object-fit:cover; display:block; }
.mail-avatar span{
  font-size:.9rem; font-weight:700; color:#ff9088; letter-spacing:.04em;
}
.mail-meta .muted{ opacity:.7; }
.mail-from{ font-size:.95rem; }

.mail-subject{
  margin:10px 0 8px;
  font-size:1.1rem; letter-spacing:.02em;
}

.mail-body p{ margin:10px 0; line-height:1.65; }
.mail-body .muted{ opacity:.7; }
.mail-divider{
  border:0; height:1px; margin:14px 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.92), transparent);
}

/* 联系方式 + 图标 */
.contact-list{ list-style:none; padding:0; margin:10px 0 0; display:grid; gap:8px; }
.contact-list li{ display:flex; align-items:center; gap:8px; }
.contact-list a{ color:#686868; text-decoration:none; border-bottom:1px dotted rgba(94, 94, 94, 0.92); }
.contact-list a:hover{ border-bottom-color: rgba(152, 55, 55, 0.6); }

/* 中文界面 About 正文使用 DotGothic16 字体 */
html[lang="zh-Hans"] #about-dialog .tl-dialog__content.mail-body,
html[lang="zh-Hans"] #about-dialog .tl-dialog__content.mail-body p,
html[lang="zh-Hans"] #about-dialog .tl-dialog__content.mail-body .tl-btn,
html[lang="zh-Hans"] #about-dialog .tl-dialog__content.mail-body .contact-list,
html[lang="zh-Hans"] #about-dialog .tl-dialog__content.mail-body .contact-list a{
  font-family: "DotGothic16", monospace;
}

.icon{
  width:18px; height:18px; flex:0 0 auto;
  fill: currentColor; color:#525252; opacity:.9;
  transform: translateY(1px);
}

/* 让邮件头与面板整体风格统一（可按站点色系改） */
.tl-dialog__panel{
  background: rgba(227, 227, 227, 0.92);
}


@media (prefers-reduced-motion: reduce){
  .tl-overlay, .tl-dialog, .tl-dialog__panel{ transition: none; }
}

/* Disclaimer 返回按钮与表格样式 */
.tl-dialog__back{ position:absolute; top:-12px; right:-12px; display:inline-flex; align-items:center; justify-content:center; gap:0; width:32px; height:32px; padding:0; border:1px solid #ccc; background:rgba(255,255,255,.98); border-radius:50%; box-shadow:0 2px 6px rgba(0,0,0,.15); cursor:pointer; z-index:2; }
.tl-dialog__back img{ width:18px; height:18px; }
.tl-dialog__back span{ display:none; }
.tl-dialog__back:hover{ background:#ed766b; color:#fff; border-color:#ed766b; }
.tl-table-wrap{ overflow: visible; max-height: none; margin-top:8px; }
.tl-table{ width:100%; border-collapse:collapse; font-family:"Noto Sans SC","VT323",monospace; font-size:14px; }
.tl-table th, .tl-table td{ border:1px solid #bbb; padding:6px 8px; text-align:left; }
.tl-table thead th{ background:rgba(230,230,230,.8); position:sticky; top:0; }

/* Disclaimer 打开按钮字体 */
#disclaimer-open{ font-family: "VT323", monospace; }
#changelog-open{ font-family: "VT323", monospace; }

@media (max-width: 600px){
  .button-wrapper{
    display: none;
  }
  #full-screen-button{
    display: none;
  }
}

.button-wrapper{
display: flex;
position: fixed;
flex-direction: column;
right: 1rem;
bottom:1rem;
z-index: 35;
gap: 20px;
  }

.button-wrapper div {
  padding: 0;
  margin: 0;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#scroll-up-to-the-previous-page {
  width: 1.8vw;
  min-width: 24px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 100, 100, 0.95);
  color: inherit;
  background: linear-gradient(rgba(255, 255, 255, 0) 0 0),
    linear-gradient(#ff6464 0 0) no-repeat calc(200% - var(--p, 0%)) 100% / 200% var(--p, 0%);
  transition: 0.5s var(--t, 0s), background-position 0.5s calc(0.5s - var(--t, 0s)), border-color 0.3s ease;
  z-index: 130;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

#scroll-up-to-the-previous-page:hover {
  --p: 100%;
  --t: 0.5s;
  border-color: #ff6464;
}

#scroll-up-to-the-previous-page:hover .scroll-up-icon {
  filter: brightness(0) invert(1);
}

#scroll-up-to-the-previous-page .orb-scroll-up {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: orb-spin 10s linear infinite;
  pointer-events: none;
}

#scroll-up-to-the-previous-page .scroll-up-icon {
  width: 60%;
  height: auto;
  position: relative;
  z-index: 1;
}

#full-screen-button {
  background: transparent;
}

#full-screen-button img,
#full-screen-button .fullscreen-icon {
  width: 1.8vw;
}

#music-control{ 
  position: relative; 
  display: inline-flex;
  align-items:center;
  gap:8px
}

#music-button{
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}

#music-icon{
  width: 15px;
  height: auto;
  opacity:60%;
}

.music-title-wrap{
  display: inline-block;
  vertical-align: middle;
  max-width: 200px;    
  overflow: hidden;
  white-space: nowrap;
  visibility: hidden;   /* 暂停时隐藏，播放时用 JS 设为 visible */
}


.music-title{
  display: inline-block;
  will-change: transform;
  font-family: "VT323", monospace;
  font-size: 14px;          
  line-height: 1;
  white-space: nowrap;
  max-width: none;           
  overflow: visible;
  text-overflow: clip;
  opacity: 0.7;
}

#music-control{ position: relative; }

.music-title.is-scrolling{
  animation-name: tl-title-marquee;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  padding-left: 2rem;       /* 循环间隔，避免回弹突兀 */
}

@keyframes tl-title-marquee{
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-1 * var(--scroll-distance, 0px))); }
}

/* 可选：减少动效时不滚动 */
@media (prefers-reduced-motion: reduce){
  .music-title.is-scrolling{ animation: none; }
}

section{
  height: 100vh;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  scroll-snap-align: start;
}

#character-section{
  overflow: clip;
}

#hero-slider{
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

#hero-slider .hero-slide {
  flex: 1;
  z-index: 2;
  background-size: cover;
  background-position: center;
  display:grid;
  justify-content:center;
  align-items:center;
  height: 100%;
  width: 100%;
}

#hero-slider .version-tag {
    top:60px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(1px, 0.7vw, 15px);
    font-family:  "VT323", monospace;
    color:rgb(0, 0, 0);

    width: 60vw;
    text-align: center;
    letter-spacing: 1.2em;
    text-transform: uppercase;
    opacity: 0.8;
    user-select: none;

    opacity: 0;                                   /* 初始透明 */
    animation: fadeInVersion 2s ease-out forwards;
}

/* 中文页面中，Hero 区的“继续”按钮文字使用 DotGothic16 */
html[lang="zh-Hans"] #scroll-down span{
  font-family: "Codystar", sans-serif;
}

@keyframes fadeInVersion {
  from { opacity: 0; }
  to   { opacity: 1; }
}

#hero-slider h3{
  color:rgb(0, 0, 0);
  font-family: "Codystar", sans-serif;
  font-size: clamp(28px, 3vw, 64px);
  padding: .5rem 1rem;
  border-radius: .6rem;
}

.corner-orbs{
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.orb{
  position: absolute;
  width: 60px;
  height: 60px;
  animation: orb-spin 10s linear infinite;
}

.orb-tl{top:20px;left:20px;}
.orb-tr{top:20px;right:20px;animation-direction: reverse; }
.orb-bl{bottom:20px;left: 20px;}
.orb-br{bottom:20px;right:20px;}
@keyframes orb-spin {
  to { transform: rotate(360deg); }
}

#character-section{position: relative;}
.character-layout{
  display: flex;
  height: 100%;
}

/*section与section之间转场 */
#character-section .will-enter {
  opacity: 0;
  transform: translateY(100px);
  transition:
    opacity .6s ease,
    transform .6s ease;
  will-change: opacity, transform;
}

#character-section .will-enter.in {
  opacity: 1;
  transform: translateY(0);
}

.color-pulse{
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%,-40%); 

  width: 400px;
  height: 300px;

  background-color:white;
  animation: colorShift 4s linear infinite;
  z-index: 0;  
  pointer-events: none;

  clip-path: polygon(50% 0%,0% 100%,100% 100%);
}

@keyframes colorShift {
  0%   { background-color: #d4b1b2; }  
  25%  { background-color: #dfb4a2; } 
  50%  { background-color: #9dcdc1; } 
  75%  { background-color: #95c2c8; }  
  100% { background-color: #d4b1b2; }  
}

/* ===============================
   Character Gallery Section
   =============================== */

#character-gallery {
  height: 100vh;
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 8vw;
  box-sizing: border-box;
}

.gallery-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}

.gallery-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  padding: 3rem 3.5rem 2.5rem;
  box-sizing: border-box;
}

.gallery-grid {
  display: grid;
  /* 固定两行，高度为卡片高度；列按需自动增加 */
  grid-template-rows: repeat(2, 160px);
  grid-auto-flow: column;          /* 按列填充：1行 -> 2行 -> 新列 */
  grid-auto-columns: 160px;        /* 每列卡片宽度 */
  row-gap: calc(1.2rem + 10px);     /* 行间距比列间距多 5px，避免两行卡片重叠 */
  column-gap: 1.2rem;
  max-width: 100%;
  padding: 1.5rem 0 1rem; /* 顶部留出空间给凸起标签 */
  min-height: 180px;
  scroll-behavior: smooth;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(173, 173, 173, 0.3) transparent;
  transition: opacity 0.5s ease;
}

.gallery-grid::-webkit-scrollbar {
  height: 8px;
}

.gallery-grid::-webkit-scrollbar-track {
  background: transparent;
}

.gallery-grid::-webkit-scrollbar-thumb {
  background: rgba(173, 173, 173, 0.3);
  border-radius: 4px;
}

.gallery-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(237, 107, 95, 0.5);
}

/* 打字机播放期间隐藏卡片，结束后淡入 */
.gallery-grid.gallery-cards-hidden {
  opacity: 0;
  pointer-events: none;
}

/* 900px 以下：稍微增高卡片、收窄列宽，让纵向呼吸感更好 */
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-rows: repeat(2, 190px);
    grid-auto-columns: 140px;
    transform: scale(0.9);
    transform-origin: top left;
    width: calc(100% / 0.9);
  }
}

/* Gallery 导航按钮 */
.gallery-nav {
  position: absolute;
  top: 50%;
  margin:3rem;
  transform: translateY(-50%);
  width: clamp(25px, 8vw, 35px);
  height: clamp(25px, 8vw, 35px);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}

.gallery-nav img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-nav-left {
  left: -2.5rem;
}

.gallery-nav-right {
  right: -2.5rem;
}

@media (max-width: 600px) {
  .gallery-nav {
    width: clamp(10px, 4vw, 22px);
    height: clamp(10px, 4vw, 22px);
  }
}

/* Gallery 标题 */
.gallery-info{
  font-family: 'Courier New', Courier, monospace;
  text-align: center;
  font-size: clamp(5px,1vw,10px);
  color: #111;
  letter-spacing: 0.6rem;
  margin: 0 0 1.2rem;;
}
.gallery-title {
  font-family: "Copperplate", "Copperplate Gothic Light", system-ui, serif;
  text-align: center;
  font-size: clamp(10px, 2.4vw, 30px);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin: 0 0 1.2rem;
  color: #111;
}


/* 角色卡片样式 */
.character-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 5px;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  backdrop-filter: blur(10px);
  border: 0.5px solid #cecece;
  min-height: 160px;
  justify-content: flex-end;
  overflow: visible; /* 允许左上角标签页凸出显示 */
  position: relative;
}

/* 文件夹风格的左上角标签（显示排序号等 Badge） */
.character-card .card-tab {
  position: absolute;
  top: -20px;            /* 向上凸起 */
  left: 7px;            /* 左侧内缩一点 */
  padding: 2px 8px;
  font-family: "VT323", monospace;
  font-size: 12px;
  line-height: 1.2;
  color: #333;
  background: rgba(255, 255, 255, 0.95);
  border: 0.5px solid #9aa0a6;             /* 标签边框 */
  border-bottom: none;                    /* 与卡片上边框衔接 */
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  z-index: 3;
  pointer-events: none;                   /* 不影响交互 */
}

/* 卡片内部右上角红色角标（默认显示 UID） */
.character-card .card-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 2px 6px;
  font-family: "bc-vajgar", sans-serif;
  font-size: 25px;
  line-height: 1.2;
  color: #a7a7a7;
  background:transparent;
  border-radius: 4px;
  z-index: 2;
  pointer-events: none;
}

.character-card:hover .card-badge {
  color: #de4444;
}


.character-card:hover {
  transform: translateY(-8px) scale(1.02);
  background: rgba(255, 255, 255, 0.95);
}

.character-card-media {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 3px;
  overflow: hidden;
  z-index: 1;
  /* 底层：背景图（图层顺序：边框 > avatar > 背景） */
  background-image: url('img/Hero/card-background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.character-card-image {
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  top: 4px;
  left: 4px;
  object-fit: cover;
  border-radius: 3px;
  position: absolute;
  z-index: 1;
  transition: transform 0.3s ease;
}

.character-card:hover .character-card-image {
  transform: scale(1.05);
}

.character-card-name {
  font-family: "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(7px, 1vw, 15px);
  color: white;
  text-align: center;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.06em;
  word-wrap: break-word;
  hyphens: auto;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.2));
  padding: 1rem 0.5rem 0.5rem;
  z-index: 2;
  border-radius: 0 0 3px 3px;
}

/* 画廊卡片中，中文角色名字体（仅在 js 中检测到中文时添加 is-zh） */
.character-card-name.is-zh{
  font-family: "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.08em;
}

/* Gallery进入动画 */
#character-gallery .will-enter {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity .6s ease,
    transform .6s ease;
  will-change: opacity, transform;
}

#character-gallery .will-enter.in {
  opacity: 1;
  transform: translateY(0);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .gallery-grid {
    /* 仍然固定两行，列宽 150px，横向滚动 */
    grid-template-rows: repeat(2, 150px);
    grid-auto-flow: column;
    grid-auto-columns: 150px;
    gap: 1rem;
    padding: 1rem 0; /* 小屏也留出适当顶部空间 */
  }
  
  .character-card {
    min-height: 150px;
  }
  
  .gallery-container {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    /* 仍然固定两行，列宽 120px，横向滚动 */
    grid-template-rows: repeat(2, 120px);
    grid-auto-flow: column;
    grid-auto-columns: 120px;
    gap: 0.8rem;
    padding: 0.8rem 0;
  }
  
  .character-card {
    min-height: 120px;
  }
  
  .gallery-container {
    padding: 0.5rem;
  }
}

/* ========== Character Profile System ========== */
@media (max-width: 600px){
  #main-visual-section {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    pointer-events: none;
  }
}
/* 滚动容器 */
#character-scroll-container {
  height: 100vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  scroll-snap-type: y proximity;
}

/* Main Visual Section - 第一屏 */
#main-visual-section {
  height: 100vh;
  scroll-snap-align: start;
  position: relative;
}

/* Profile Section - 第二屏 */
#profile-section {
  height: 100vh;
  scroll-snap-align: start;
  background: #ffffff;
  padding: 2rem;
  padding-top: 5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS 惯性滚动 */
  display: none; /* 默认隐藏，有profile数据时显示 */
}

/* View Profile 按钮 */
#view-profile-btn {
  margin-top: 0rem;
  display: flex;
  align-items: center;
  gap: 0.1rem;
  background: #ffffff;
  border: 0.3px solid #8b8b8b;
  padding: 0.1rem 0,1rem;
  cursor: pointer;
  font-family: "VT323", monospace;
  font-size: clamp(7px, 1vw, 28px);
  transition: all 0.3s ease;
}

/* 仅在中文页面，将“查看完整档案 / 返回”按钮文字改为 DotGothic16 */
html[lang="zh-Hans"] #view-profile-btn,
html[lang="zh-Hans"] #profile-return-btn,
html[lang="zh-Hans"] #profile-return-btn-inline{
  font-family: "DotGothic16", monospace;
}

#view-profile-btn:hover {
  background: #ed766b;
  color: white;
}

/* Return 按钮 */
#profile-return-btn {
  position: fixed;
  top: 5rem;
  left: 1rem;
  display: none; /* 默认隐藏 */
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  padding: 0.5rem 1rem;
  cursor: pointer;
  z-index: 100;
  font-family: "VT323", monospace;
  transition: all 0.3s ease;
}


#profile-return-btn img {
  width: 20px;
  height: 20px;
}

#profile-return-btn:hover {
  background: #ed766b;
  color: white;
}

/* Profile Content */
#profile-content {
  max-width: 100%;
  margin: 0 auto;
  margin-left: 0;
  margin-right: 0;
  background: white;
  padding: 3rem;
  border-radius: 8px;
  box-sizing: border-box;
  overflow-x: hidden; /* 防止内部内容横向溢出 */
}

@media (max-width: 600px) {
  /* 全局：彻底禁止横向滚动 */
  html,
  body{
    overflow-x: hidden;
  }

  #profile-content {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    padding: 0.75rem 0.75rem 1rem;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .profile-section-1,
  .profile-section-2,
  .profile-section-3,
  .profile-section-gallery{
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
  }
  .profile-section-1 {
    display: grid;
    grid-template-columns: 1fr;  /* info-grid 和 introduction 垂直堆叠 */
    row-gap: 0.5rem;
  }
  
  /* 小屏幕时grid改为单列 */
  #profile-info-grid {
    width: 100%;
    margin: 0 0 0.5rem 0;
    overflow-x: hidden;
  }

  .profile-introduction{
    width: 100%;
  }

  /* Mobile：profile 内文本统一左对齐 */
  #profile-content,
  .profile-section-1,
  .profile-section-2,
  .profile-section-3,
  #profile-info-grid,
  .profile-introduction,
  #profile-story{
    text-align: left;
  }

  /* 缩小手机端 profile 文字尺寸，避免显得拥挤，同时保证可读性 */
  #profile-info-grid .label,
  #profile-info-grid .value{
    font-size: clamp(10px, 2.6vw, 14px);
  }
  /* introduction 比正文再小一点 */
  .profile-introduction{
    font-size: clamp(9px, 2.3vw, 13px);
    width: 90%;
  }
  #profile-story{
    font-size: clamp(10px, 2.6vw, 14px);
    width: 90%;
  }
  
  #profile-info-grid .label {
    text-align: left;
  }
  #profile-story {
    font-family: "Noto Sans SC", "VT323", monospace;
    line-height: 1.8;
    width: 90%;
    color: #333;
  }
}

/* Profile Info Grid */
#profile-info-grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0.5rem 1rem;
  margin-bottom: 2rem;
  margin-right: 5rem;
  font-family: "VT323", monospace;
}

#profile-info-grid .label {
  font-weight: bold;
  text-align: right;
  color: #666;
}

#profile-info-grid .value {
  color: #333;
}

/* 包含汉字的 value 使用 DotGothic16 字体，label 保持 VT323 */
#profile-info-grid .module-row .value {
  font-family: "DotGothic16", "VT323", monospace;
}

/* Profile Story */
#profile-story {
  font-family: "Noto Sans SC", "VT323", monospace;
  line-height: 1.8;
  margin-right: 2rem;
  color: #333;
}

#profile-story h3 {
  margin-bottom: 1rem;
  color: #979797;
}

/* ===== Profile Section 1: 基本信息 ===== */
.profile-section-1 {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 2rem;
  width: clamp(600px, 70vw, 800px);
  margin-left: 40px;
  margin-right: auto;
}

.profile-left-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-right-column {
  display: flex;
  flex-direction: column;
}

.profile-introduction {
  font-family: "Noto Sans SC", "VT323", monospace;
  line-height: 1.8;
  color: #333;
  font-size: 1rem;
  text-align: justify;
  width: 100%;
  word-wrap: break-word;
  transition: opacity 0.5s ease-in;
}

/* 打字机效果光标 */
.typewriter-cursor::after {
  content: '|';
  animation: blink 1s infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

#profile-return-btn-inline {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-family: "VT323", monospace;
  transition: all 0.3s ease;
  position: fixed;
  top: 5rem;
  left: 1rem;
  z-index: 150;
}

#profile-return-btn-inline:hover {
  background: #ed766b;
  color: white;
}

#profile-return-btn-inline img {
  width: 20px;
  height: 20px;
}


@media (max-width: 600px) {
  /* 隐藏 Profile 内的所有 return 按钮（浮动+内联） */
  #profile-return-btn,
  #profile-return-btn-inline {
    display: none !important;
  }

  #profile-return-btn img,
  #profile-return-btn-inline img {
    display: none;
  }
}


.profile-avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  border: 0.5px solid #555;
}

.profile-basic-info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  width: 100%;
  border: 0.5px solid #555;
  border-radius: 2px;
  padding: 0.5rem;
}

.info-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  border: 0.5px solid #555;
  border-top: none;
}

.info-row:first-child {
  border-top: 0.5px solid #555;
}

.info-cell {
  padding: 0.5rem;
}

.info-cell:first-child {
  border-right: 0.5px solid #555;
}

.info-cell:last-child {
  border-right: none;
}

.info-row .label {
  font-weight: bold;
  text-align: left;
  color: #666;
}

.info-row .value {
  color: #333;
}

/* Sex选项样式 */
.sex-option {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  margin-right: 0.5rem;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.sex-option.selected {
  background-color: #474747;
  color: white;
  border-radius: 3px;
  font-weight: bold;
}

.sex-option:not(.selected) {
  color: #999;
}

/* Sex备注样式 */
.sex-note {
  display: inline-block;
  font-size: 0.85em;
  color: #666;
  font-style: italic;
  margin-left: 0.3rem;
}

/* ===== Profile Divider ===== */
.profile-divider {
  border: none;
  border-top: 0.5px solid #000;
  margin: 0.5rem 0;
  width: 70vw;
  margin-left: 40px;
  margin-right:5px;
}

/* ===== Profile Section 2: 关联人物 ===== */
.profile-section-2 {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 80%;
  margin-left: 40px;
  margin-right: auto;
  margin-top: 0;
  padding-bottom: 2rem;
}

.profile-section-2 h3 {
  font-family: "Bungee Outline", sans-serif;
  font-weight: 400;
  font-style: normal;
  grid-column: 1 / -1;
  margin-bottom: 1rem;
  color: #8e8e8e;
  font-size: 1.8rem;
}

.associated-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: wrap; /* 小屏幕时允许换行 */
}

.associated-content.is-link { cursor: pointer; }
.associated-content.is-link .assoc-name { text-decoration: underline; }

.associated-avatar {
  flex-shrink: 0;
}

.associated-avatar img {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: cover;
  border: 0.5px solid #555;
}

.avatar-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  border: 0.5px solid #555;
  background-color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #999;
  font-weight: bold;
}

.associated-info {
  flex: 1;
  min-width: 0; /* 允许flex item收缩 */
}

.assoc-name {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: #333;
  word-wrap: break-word;
}

.assoc-desc {
  color: #666;
  line-height: 1.6;
  word-wrap: break-word;
}

/* ===== Ohgi Section: 極秘奧義 ===== */
.profile-section-ohgi {
  width: 80%;
  margin: 1.5rem auto 0 auto;
}

.ohgi-section-title {
  font-family: "Bungee Outline", sans-serif;
  font-weight: 1200;
  font-style: normal;
  margin-bottom: 1rem;
  color: #8e8e8e;
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.ohgi-section-title-en {
  font-family: "Space Mono", monospace;
  font-weight: 400;
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

.ohgi-entry {
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(135deg, #ffffff, #f5f5f7);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.ohgi-entry-title {
  font-family: "Noto Sans SC", "Space Mono", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.75rem 0;
  letter-spacing: 0.08em;
}

.ohgi-meta-row {
  display: grid;
  grid-template-columns: minmax(0, 140px) minmax(0, 1fr);
  column-gap: 0.75rem;
  row-gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.ohgi-meta-label {
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #777;
}

.ohgi-meta-value {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #333;
}

.ohgi-description .ohgi-meta-label {
  margin-top: 0.5rem;
}

@media (max-width: 600px) {
  .profile-section-ohgi {
    width: 90%;
    margin-left: 10px;
    margin-right: 10px;
  }

  .ohgi-entry {
    padding: 0.75rem 0.9rem;
  }

  .ohgi-meta-row {
    grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
  }
}

/* Mobile：Connections 文本缩小并确保不超出屏幕 */
@media (max-width: 600px){
  .associated-content{
    flex-wrap: nowrap;
    gap: 1rem;
  }
  .associated-avatar img,
  .avatar-placeholder{
    width: 72px;
    height: 72px;
  }
  .associated-info{
    font-size: clamp(9px, 2.4vw, 13px);
    overflow-wrap: break-word;
  }
  .assoc-desc{
    line-height: 1.6;
  }
}

/* ===== Profile Section 3: 故事内容 ===== */
.profile-section-3 {
  width: 80%;
  margin-left: 40px;
  margin-right: auto;
}

.profile-section-3 h3 {
  font-family: "Bungee Outline", sans-serif;
  font-weight: 400;
  font-style: normal;
  margin-bottom: 1rem;
  color: #929292;
  font-size: 1.8rem;
}

.profile-notification {
  background: #dcdcdc;
  border: 1px solid #c2c2c2;
  padding: 1.5rem;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
  border-radius: 8px;
  text-align: center;
}

.profile-notification strong {
  display: block;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

#confirm-spoiler-btn {
  background: #8f8f8f;
  color: white;
  border: none;
  padding: 0.5rem 1.5rem;
  cursor: pointer;
  font-family: "Noto Sans SC", "VT323", monospace;
  font-size: 1rem;
  border-radius: 4px;
  transition: background 0.3s ease;
}

#confirm-spoiler-btn:hover {
  background: #d65a4f;
}

.profile-story-content p {
  line-height: 1.8;
  color: #333;
}

/* ===== Profile Gallery Section ===== */
.profile-section-gallery {
  width: 80%;
  max-width: 1200px;
  margin: 0.75rem 0 4rem;
  margin-left: 40px;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.profile-section-gallery h3 {
  font-family: "Bungee Outline", sans-serif;
  font-weight: 400;
  font-style: normal;
  margin-bottom: 1rem;
  color: #929292;
  font-size: 1.8rem;
}

/* Gallery 前的分割线与上一节的间距（减少阻尼感，使下拉更顺畅） */
.profile-divider--before-gallery {
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.gallery-item a {
  display: block;
  width: calc(100% - 60px);
  max-width: calc(1200px - 60px);
  margin: 0 30px;
  aspect-ratio: 1200 / 500;
  overflow: hidden;
  border-radius: 8px;
  align-self: center;
  box-sizing: border-box;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-item-date {
  font-family: "VT323", monospace;
  font-size: 1rem;
  color: #333;
  text-align: left;
  margin-left: 30px;
  width: calc(100% - 30px);
}

.gallery-item-title {
  font-family: "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  color: #333;
  text-align: left;
  margin-left: 30px;
  width: calc(100% - 30px);
}

.gallery-item-title {
  font-weight: 500;
}

/* ===== 响应式调整 ===== */
@media (max-width: 768px) {
  .profile-section-1 {
    flex-direction: column;
  }
  
  .profile-left {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
  
  .profile-avatar {
    width: 100px;
    height: 100px;
  }
  
  .info-row {
    grid-template-columns: 1fr;
  }
  
  .info-row .label {
    text-align: left;
  }
  
  .associated-content {
    flex-direction: column;
  }
  
  .profile-section-2 {
    width: 90%;
    margin-left: 10px;
  }
  
  .profile-section-3 {
    width: 90%;
    margin-left: 10px;
  }
  
  .profile-section-gallery {
    width: 90%;
    margin-left: 10px;
    margin-right: auto;
  }
  
  .profile-divider {
    width: 90vw;
    margin-left: 10px;
  }
}

/* 隐藏原有的固定 return 按钮 */
#profile-return-btn {
  display: none !important;
}

/* ===== Copyright Section (as bar) ===== */
#copyright-section {
  height: auto;                 /* 覆盖全局 section 高度 */
  min-height: auto;
  max-height: none;
  display: block;
  background: #ffffff;
  position: relative;
  z-index: 1;
  border-top: 1px solid #ededed;
  border-bottom: 1px solid #ededed;
}

.copyright-container {
  width: min(92vw, 1100px);
  margin: 0 auto;
  padding: 10px 0 28px;         /* 底部留白，拉开与年份的间隔 */
  box-sizing: border-box;
}

.cr-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;          /* 增加与 copyright-year 的垂直间隔 */
}

.cr-viewport {            /* 视口：仅显示当前 slide */
  flex: 1 1 auto;
  overflow: hidden;
}

.cr-track {               /* 轨道：横向排列 */
  display: flex;
  align-items: stretch;
  transition: transform .3s ease;
}

/* 小屏下可禁用过渡，避免翻页时看到其他语言滑过 */
.cr-track.cr-no-anim{
  transition: none;
}

/* 让滑块中的文本链接可点击（覆盖父元素的 pointer 捕获影响） */
.cr-track .about-inline-link, .cr-track .about-xuanyu-link{ pointer-events: auto; }

.cr-slide {
  flex: 0 0 100%;
  padding: 8px 4px;
}

.cr-slide p {
  font-family: "Noto Sans SC", "VT323", monospace;
  line-height: 1.8;
  color: #333;
  font-size: clamp(13px, 1.2vw, 16px);
  margin: 0;
}

#copyright-title {
  font-family: "Codystar", sans-serif;
  font-size: clamp(12px, 1.2vw, 16px);
  color: #8e8e8e;
  margin: 0 0 4px;
}

.copyright-year {
  font-family: "VT323", monospace;
  font-size: clamp(12px, 1.2vw, 16px);
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  color: #8e8e8e;
  margin: 0 0 4px;
}

/* 统一各语言版权标题样式 */
#copyright-section .cr-slide h2 {
  font-family: "Codystar", sans-serif;
  font-size: clamp(12px, 1.2vw, 16px);
}

.cr-nav {
  flex: 0 0 auto;
  background: rgba(255,255,255,.8);
  border: 1px solid #ccc;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.cr-nav:hover { background:#ed766b; border-color:#ed766b; }
.cr-nav img { width: 14px; height: 14px; display:block; }
.cr-prev img { transform: rotate(90deg); }
.cr-next img { transform: rotate(-90deg); }

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

@media (max-width: 768px) {
  .copyright-container { width: 94vw; padding: 8px 0; }
  .cr-slide p { font-size: 13px; }
}

/* About 内联链接样式 */
.about-inline-link{
  text-decoration: underline;
  color: inherit;
  cursor: pointer;
}
.about-inline-link:hover{
  color: #ed766b;
}

/* Xuanyu 内联链接样式（与 about-inline-link 保持一致） */
.about-xuanyu-link{
  text-decoration: underline;
  color: inherit;
  cursor: pointer;
}
.about-xuanyu-link:hover{ color:#ed766b; }

/* Xuanyu 弹窗宽度微调 */
#xuanyu-dialog .tl-dialog__panel{ width: min(92vw, 650px); }

/* ===============================
   Responsive adjustments (<600px)
   =============================== */
@media (max-width: 600px){
  /* Hero: use smaller background image on narrow screens */
  #hero-slider .hero-slide{
    background-image: url('img/Hero/hero-slider-1000px.webp') !important;
    background-size: cover;
    background-position: center;
  }

  /* About dialog: always keep ~50px gap to viewport edges */
  #about-dialog .tl-dialog__panel{
    width: calc(100vw - 100px);
    max-width: none;
    max-height: calc(100vh - 100px);
  }

  /* Music Credits / Dev-log: 5px gap to viewport edges */
  #disclaimer-dialog .tl-dialog__panel,
  #devlog-dialog .tl-dialog__panel{
    width: calc(100vw - 80px);
    max-width: none;
  }
}

/* Xuanyu 弹窗提示块 */
#xuanyu-dialog .xuanyu-callout{
  margin: 6px 0 12px;
  padding: 10px 12px;
  background: rgba(236,236,236,.6);
  border: 1px solid #ccc;
  border-left: 3px solid #ed766b;
  border-radius: 8px;
}
#xuanyu-dialog .xuanyu-callout__badge{
  display: inline-block;
  font-weight: 600;
  margin-right: 6px;
}
#xuanyu-dialog .xuanyu-callout__text{ display: inline; }

/* 新中文字体工具类 */
.wdxl-lubrifont-sc-regular {
  font-family: "WDXL Lubrifont SC", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.zcool-qingke-huangyou-regular {
  font-family: "ZCOOL QingKe HuangYou", sans-serif;
  font-weight: 400;
  font-style: normal;
}

/* 仅在 Xuanyu 弹窗标题与内容使用新中文字体 */
#xuanyu-dialog #xuanyu-name{
  font-family: "WDXL Lubrifont SC", "Noto Sans SC", sans-serif;
  font-size: 1.6rem;
}

/* Xuanyu 弹窗正文使用 Noto Sans SC */
#xuanyu-dialog .tl-dialog__content p{
  font-family: "Noto Sans SC", "VT323", monospace;
  font-size: 12px;
}