@font-face {
    font-family: roboto-font;
    src: url('/font/Roboto-Regular.ttf');
    unicode-range: U+00-024F;
}

:root {
    --main-text-color: #dfdfdf;
    --main-keydown-color: #019e87;
    --main-lowlight-color: #015a4d;
    --main-shadow-color: #03887476;
    --main-highlight-color: #03b79c;
    --main-background-color: #101216;
    --main-disabled-text-color: #888888;
    --main-background-highlight-color: #22252d;
    --main-fullscreen-wrapper-background-color: #000000a4;
    --main-background-highlight-transparent-color: #22252d50;
}

* {
    padding: 0;
    margin: 0;
    font-family: roboto-font;
}

[is-actived] {
    color: var(--main-highlight-color) !important;
}
[is-actived-bg] {
    background-color: var(--main-highlight-color) !important;
}
[no-display] {
    display: none !important;
}
[transparent] {
    opacity: 0 !important;
}

.no-border {
    border: none !important;
}

a {
    text-decoration: none;
}

p {
    text-shadow: #000000 0.1em 0.1em 0.1em;
}

body {
    background-color: var(--main-background-color);
    color: var(--main-text-color);
    -webkit-tap-highlight-color: rgba(0,0,0,0); 
    background-attachment: fixed;
}

#loading-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1500;
    display: flex;
    flex-wrap: nowrap;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.5s;
    background-color: var(--main-background-color);
}

#loading-page-content-wrapper {
    z-index: 1502;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#loading-page .up-text-wrapper,
#loading-page .down-text-wrapper {
    height: 100px;
    width: 100%;
    font-size: 35px;
    user-select: none;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-wrap: nowrap;
    padding: 20px;
}
#loading-page .up-text-wrapper {
    justify-content: end;
}

#loading-page .down-text-wrapper {
    justify-content: start;
}

#loading-page .up-text,
#loading-page .down-text {
    transition: all 0.5s;
    transition-timing-function: cubic-bezier(.94,.89,.17,.98)
}

#loading-page .up-text {
    margin-bottom: -70px;
}
#loading-page .down-text {
    margin-top: -70px;
}
#loading-page .up-text img,
#loading-page .down-text img {
    height: 100%;
}
#loading-page-progress-bar {
    width: 95%;
    height: 3px;
    border-radius: 10px;
}
#loading-page-progress-bar .bar {
    height: 100%;
    width: 0%;
    background-color: var(--main-text-color);
}

#sidebar {
    z-index: 999;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box; /* 防止padding调整后尺寸改变 */
}

#sidebar div.p1 img {
    cursor: pointer;
    user-select: none;
}

#sidebar ul {
    margin: 0px auto;
    width: fit-content;
    list-style: none;
    box-sizing: border-box;
}
#sidebar ul li {
    cursor: pointer;
}

#sidebar ul a {
    display: block;
    padding: 0px 30px;
    user-select: none;
    transition: 0.3s color;
}

#sidebar ul a:link,
#sidebar ul a:visited {
    color: var(--main-text-color);
}
#sidebar ul a:hover {
    color: var(--main-highlight-color);
}
#sidebar ul a:active {
    color: var(--main-keydown-color);
}

#sidebar #lang-switch {
    background-color: var(--main-background-color);
    color: var(--main-text-color);
    cursor: pointer;
    border: none;
    outline: none;
    font-size: 16px;
    width: fit-content;
    padding: 0px 20px 10px;
    margin: 0px auto;
    transition: 0.3s color;
}
#sidebar #lang-switch:hover {
    color: var(--main-highlight-color);
}
#sidebar #lang-switch #lang-selector {
    display: none;
    cursor: default;
    position: absolute;
    margin-top: 3px;
    padding: 10px 30px;
    background-color: var(--main-background-highlight-color);
    box-shadow: 0px 0px 3px var(--main-shadow-color);
}
#sidebar #lang-switch:hover #lang-selector {
    display: block;
}
#sidebar #lang-switch #lang-selector a {
    display: block;
    cursor: pointer;
    color: var(--main-text-color);
}
#sidebar #lang-switch #lang-selector a:hover {
    color: var(--main-highlight-color);
}

/* 右侧大分区 */
#main .attacher {
    min-height: 100%;
    width: 100%;
    box-sizing: border-box;
    scroll-snap-align: start;
}

#main-view {
    display: flex;
    justify-content: center;
    align-items: center;
}

#main-view img {
    max-width: 90%;
}

#main section .content-basic {
    border-left: solid 0px var(--main-text-color);
}

#main section .content-noflex {
    padding: 10px 15px;
}

#main section .content-noflex150 {
    padding: 10px 150px;
}

#main section .content-flex-wrapper {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
}
#main section .content-flex {
    padding: 20px 25px;
    margin: 10px 10px;
}

#news .news-link,
#news .news-link:link,
#news .news-link:visited,
#news .news-link:active {
    display: block;
    border-radius: 5px;
    padding: 20px 15px;
    color: var(--main-text-color);
    border-bottom: dotted 2px var(--main-keydown-color);
    transition: 0.1s background-color;
}
#news .news-link:hover {
    background-color: var(--main-background-highlight-transparent-color);
}

#news .title-wrapper {
    padding: 0px 0px 10px 0px;
}
#news .title-wrapper .title {
    font-size: 20px;
}
#news .title-wrapper .time {
    margin-left: 10px;
    color: var(--main-highlight-color);
}

#news .more-news-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
    padding: 20px 0px 5px;
}
#news .more-news,
#news .more-news:link,
#news .more-news:visited,
#news .more-news:active {
    padding: 15px 15px;
    margin-right: 10px;
    color: var(--main-highlight-color);
    transition: 0.3s margin-right;
}
#news .more-news:hover {
    margin-right: 0px;
}

.no-border-flex-wrapper {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
}

#story section #story-content-wrapper {
    border: none;
}

#setting-big-card-content-wrapper {
    overscroll-behavior: contain;
}
#setting .pic-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
}

#setting .more-setting-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    padding: 20px 0px 5px;
}

#setting .more-setting {
    padding: 15px 15px;
    color: var(--main-highlight-color);
    transition: 0.3s margin-right;
}

.button-div {
    font-size: 20px;
    border: solid 1px #ffffff8f;
    height: 40px;
    line-height: 40px;
    margin: 10px 8px;
    cursor: pointer;
    text-align: center;
    user-select: none;
}

.button-div label {
    display: block;
    cursor: pointer;
    padding: 0px 15px;
    transition: all 0.2s;
    color: var(--main-text-color);
}

.button-div>input[type="radio"] {
    display: none;
}

[label-selected],
.button-div > input[type="radio"]:checked + label {
    background-color: var(--main-text-color) !important;
    color: var(--main-background-color) !important;
}

#setting-big-card-wrapper {
    z-index: 1002;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    background-color: var(--main-fullscreen-wrapper-background-color);
    transition: all 0.2s;
}

.character-selector {
    background-color: #353535;
    overflow: hidden;
    border-radius: 1000px;
    cursor: pointer;
    user-select: none;
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-shrink: 0;
}

.character-selector-radio {
    display: none;
}

.character-selector-radio[type="radio"]:checked + div.character-selector {
    background-color: var(--main-highlight-color) !important;
}

.character-selector label {
    cursor: pointer;
    user-select: none;
}

#character-intro-wrapper,
#character-name,
#character-img,
#character-img-mobile {
    transition: all 0.2s;
}

#contact {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: space-between;
}

#icp {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

#icp a,
#icp a:link,
#icp a:visited,
#icp a:hover,
#icp a:active {
    display: block;
    color: white;
    font-size: 18px;
}

#news-item .title-wrapper {
    padding-bottom: 20px;
    margin-bottom: 25px;
    border-bottom: solid 2px var(--main-text-color);
}

#news-item .title-wrapper span.title {
    display: block;
    font-size: 30px;
    margin: 10px 0px;
}
#news-item .title-wrapper span.time {
    display: block;
    font-size: 18px;
    margin: 10px 0px;
    color: var(--main-highlight-color);
}

/* 添加淡入动画 */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  .attacher section {
    opacity: 0;
    transform: translateY(20px);
    /* 移除transition改用animation */
    animation: fadeInUp 0.6s ease forwards paused;
  }
  
  .attacher section.active {
    animation-play-state: running;
  }

  /* 全局滚动条样式 (支持Webkit和Firefox) */
:root {
    --scrollbar-track: transparent;
    --scrollbar-thumb: var(--main-highlight-color);
    --scrollbar-width: 10px;
    --scrollbar-border: 0 solid transparent;
  }
  
  /* Webkit内核浏览器 */
  ::-webkit-scrollbar {
    width: var(--scrollbar-width);
    height: var(--scrollbar-width);
    background: transparent;
  }
  
  ::-webkit-scrollbar-track {
    background: 0 solid transparent;
    border-radius: calc(var(--scrollbar-width)/2);
    margin: 4px 0;
  }
  
  ::-webkit-scrollbar-thumb {
    background-clip: padding-box;
    background-color: var(--scrollbar-thumb);
    border: var(--scrollbar-border);
    border-radius: calc(var(--scrollbar-width)/2);
    min-height: 40px;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background-color: var(--main-keydown-color);
  }
  
  ::-webkit-scrollbar-corner {
    background: transparent;
  }
  
  /* Firefox浏览器 */
  @supports (scrollbar-color: red blue) {
    html {
      scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
      scrollbar-width: thin;
    }
  }
  
  /* 特定容器滚动条优化 */
  #main, 
  #setting-big-card-content-wrapper,
  .character-select {
    scrollbar-gutter: stable; /* 防止布局偏移 */
    --scrollbar-track: var(--main-background-highlight-color);
  }
  
  /* 移动端优化 */
  @media (max-width: 768px) {
    :root {
      --scrollbar-width: 6px;
    }
  
    /* 移动端隐藏滚动条（保留滚动功能） */
    .mobile-scroll-hide::-webkit-scrollbar {
      display: none;
      width: 0;
    }
  
    /* 保留滚动惯性效果 */
    .mobile-scroll-hide {
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
  }
  
  /* 自定义滚动容器示例 */
  .custom-scroll {
    overflow: auto;
    scroll-behavior: smooth;
    padding-right: 4px; /* 防止内容被遮挡 */
  }
  
  /* 横向滚动条优化 */
  .horizontal-scroll {
    --scrollbar-height: var(--scrollbar-width);
  }
  
  .horizontal-scroll::-webkit-scrollbar {
    height: var(--scrollbar-width);
  }



  .scroll-guide-container {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    opacity: 0;
    animation: guideEntrance 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 3s forwards;
}

.scroll-dancer {
    position: relative;
    width: 120px;
    height: 120px;
}

/* 动态路径系统 */
.scroll-arc {
    width: 100%;
    height: 100%;
    position: absolute;
    bottom: 0;
}

.arrow-head {
    fill: var(--main-highlight-color);
    animation: headBob 1.8s ease-in-out infinite;
}

/* 文字提示系统 */
.hint-text {
    position: absolute;
    bottom: -30px;
    width: 200px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--main-highlight-color);
    font-size: 14px;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 4px rgba(3, 183, 156, 0.3);
    line-height: 1.4;
}

.device-hint::after {
    content: "SCROLL DOWN";
    font-size: 0.9em;
    opacity: 0.7;
}

/* 智能适配 */
@media (pointer: coarse) {
    .device-hint::after {
        content: "SWIPE DOWN";
    }
}

/* 关键帧动画 */
@keyframes guideEntrance {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    100% { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes pathFlow {
    0% { stroke-dashoffset: 150; opacity: 0; }
    30% { opacity: 1; }
    90% { stroke-dashoffset: 0; opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes dotFall {
    0% { transform: translateY(0); opacity: 0; }
    20% { opacity: 1; }
    90% { transform: translateY(80px); opacity: 1; }
    100% { transform: translateY(80px); opacity: 0; }
}

@keyframes pulseScale {
    0% { transform: scale(0.6); }
    50% { transform: scale(1); }
    100% { transform: scale(0.6); }
}

@keyframes pulseFade {
    0% { opacity: 0.4; }
    50% { opacity: 0.8; }
    100% { opacity: 0.4; }
}

@keyframes headBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
}

/* 隐藏逻辑 */
body:not(.scrolled) .scroll-guide-container {
    display: block;
}

body.scrolled .scroll-guide-container {
    animation: guideExit 0.6s forwards;
}

@keyframes guideExit {
    0% { opacity: 1; transform: translate(-50%, 0px); }
    100% { opacity: 0; transform: translate(-50%, 20px); }
}