/* #region ANIMATION */
@keyframes shimmerMove {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
/* #endregion */

/* #region BASE */
html {
    background-color: #191970;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
    background-image: url(../images/background/16.png);
    transform-origin: top center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    image-rendering: crisp-edges;
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;   
    margin: 0 auto;   
    min-height: 100vh;
    scale: 1.2;
}
/* #endregion */

/* #region FRAME */
.outerInfFrame {
    transform: translate(0px, 20px);
    position: relative;
    width: 960px;
    height: 17.5px;
    border: 1px solid blue; 
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;  
}

.outerInfFrame::after {
    content: '';
    inset: 0;
    position: absolute;
    border-radius: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(185, 0, 172, 0.15) 30%,
        rgba(185, 0, 172, 0.35) 50%,
        rgba(185, 0, 172, 0.15) 70%,
        transparent 100%
    );
    pointer-events: none;
    animation: shimmerMove 3s linear infinite;
}

.mainFrame {
    transform: translate(0px, 60px);
    position: relative;
    width: 960px;
    height: 600px;
    border: 1px solid purple; 
    margin: 0 auto;
    background-image: url('../images/background/15.png');
    background-repeat: no-repeat;
    background-size: cover;
}

.mainFrame::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/background/17.png') center/contain no-repeat;
  pointer-events: none;
}

#shapeCanvas {
    z-index: -1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.leftFrame {
    z-index: 0;
    display: grid;
    place-items: center; 
    position: absolute;
    width: 480px;
    height: 600px;
    left: 0;
    top: 50%;
    transform: translateY(-50%); 
}

.musicListFrame {
    z-index: 0;
    width: 400px;
    height: 270px;
}

.rightFrame {
    z-index: 0;
    position: absolute;
    width: 480px;
    height: 600px;
    right: 0;
    top: 50%;
    transform: translateY(-50%); 
}

.storyFrame {
    z-index: 0;
    position: relative;
    width: 375px;
    height: 180px;
    margin: 0 auto;
    bottom: -100px;
    overflow: hidden;  
}
/* #endregion */

/* #region TEXT */
.mainTitle {
    margin: 0;
    color: yellow;
    font-size: 15px; 
    font-weight: normal;
    text-align: center;
}

.albumTitle {
    vertical-align: middle;
    line-height: 1; 
    font-family: "PC-9800-Bold";
    text-align: center;
    position: absolute;
    color: white;
    font-weight: normal;
    font-size: 25px; 
    top: 40px;
}

#albumAuthor {
    font-family: "PC-9800-Bold";
    text-align: center;
    position: absolute;
    color: #eac1f2;
    font-weight: normal;
    left: 40px;
    bottom: 50px;
    font-size: 17.5px; 
}

.prompts {
    font-family: "PC-9800";
    text-align: left;
    position: absolute;
    color: white;
    font-weight: normal;
    left: 0;
    bottom: 0;
    font-size: 15px; 
}

.upLine {
    font-family: "PC-9800-Bold";
    text-align: center;
    position: absolute;
    color: #babafe;
    font-weight: normal;
    font-size: 22.5px; 
    top: 135px;
}

.downLine {
    font-family: "PC-9800-Bold";
    text-align: center;
    position: absolute;
    color: #babafe;
    font-weight: normal;
    font-size: 22.5px; 
    bottom: 135px;
}

#rightTitleIndex {
    position: absolute;
    font-family: "PC-9800-Bold";
    color: #eac1f2;
    font-weight: normal;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 95%;
    font-size: 24px; 
    top: 40px;
    left: -5px;
}

#rightTitleName {
    vertical-align: middle;
    line-height: 1.4; 
    position: absolute;
    font-family: "PC-9800-Bold";
    color: #eac1f2;
    font-weight: normal;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 75%; 
    font-size: 24px; 
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
}

#storyText {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 8;
    line-clamp: 8;
    overflow: hidden;
    text-overflow: ellipsis;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    font-family: "PC-9800-Bold";
    font-size: 22.5px;
    color: #eac1f2;
    font-weight: normal;
    line-height: 1;
    text-align: left;
    word-wrap: break-word;
    word-break: break-word;
}

.rightTips {
    font-family: "PC-9800-Bold";
    text-align: center;
    color: white;
    font-weight: normal;
    font-size: 12.5px; 
    transform: translateY(115px);
}

.cornerInformation {
    font-family: "PC-9800";
    text-align: center;
    position: absolute;
    color: white;
    font-weight: normal;
    right: 0;
    bottom: 0;
    font-size: 17.5px; 
}
/* #endregion */

/* #region BUTTON */
#albButton {
    max-width: 375px;
}

.albumHeader {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 375px;
    width: 100%;
    top: 40px;
}

.album-nav-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    line-height: 1;
}

.album-nav-btn:hover {
    color: grey;
}

.album-nav-btn:active {
    transform: scale(0.92);
}

.buutonIcon {
    width: 15px;
    height: auto;
}
/* #endregion */

/* #region MUSIC */
.musicListFrame * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.musicListFrame {
  display: flex;
  justify-content: center;
  align-items: center;
}
.musicListFrame h2 {
  font-weight: 400;
  font-size: 1.2rem;
  color: #1e2b3a;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #eef2f6;
  padding-bottom: 0.5rem;
}

.musicListFrame .player {
  max-width: 500px;
  width: 100%;
  margin: 0 auto; 
}

.musicListFrame .track-list {
  width: 400px;
  height: 270px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.musicListFrame .track-list::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
.musicListFrame .track-list::-webkit-scrollbar-track {
  background: rgb(0, 0, 0, 0);
}
.musicListFrame .track-list::-webkit-scrollbar-thumb {
  background: #babafe76;
}
.musicListFrame .track-list::-webkit-scrollbar-corner {
  background: rgb(0, 0, 0, 0); ;
}

.musicListFrame .track-item {
  display: block;
  width: 100%;
  padding: 0.375rem 0rem;
  font-size: 25px;
  font-family: "PC-9800-Bold";
  text-align: left;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #babafe;
  transition: background 0.1s;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 0.4;
}

.musicListFrame .track-item:last-of-type {
  border: none;
}
.musicListFrame .track-item:hover {
  border: 1px solid white;
}
.musicListFrame .track-item.active {
  font-weight: 500;
  color: white;
  border: 1.5px solid #babafe;
}

.musicListFrame .track-item .name {
  font-size: 20px;
  font-family: "PC-9800-Bold";
  flex: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
}

.musicListFrame .track-item .badge {
  flex-shrink: 0;
}

/* Music Player Style */

.musicListFrame .custom-audio {
  transform: translate(-45px, 350px);
  transform-origin: center center;
  position: absolute;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  scale: 0.9;
}

.musicListFrame .play-btn {
  color: #eac1f2;
  background: transparent; 
  width: 36px;
  height: 36px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.musicListFrame .play-btn:active {
  transform: scale(0.95);
}

.musicListFrame .progress-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.musicListFrame .progress-bar {
  flex: 1;
  height: 4px;
  background: black;
  cursor: pointer;
  position: relative;
  min-width: 40px;
  transition: height 0.2s;
}
.musicListFrame .progress-bar:hover {
  height: 6px;
}

.musicListFrame .progress-fill {
  height: 100%;
  background: #babafe;
  width: 0%;
  transition: width 0.05s linear;
  position: relative;
}
.musicListFrame .progress-fill::after {
  content: '';
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  background: #8e8ec1;
  opacity: 0;
  transition: opacity 0.2s;
}
.musicListFrame .progress-bar:hover .progress-fill::after {
  opacity: 1;
}

.musicListFrame .time-display {
  font-family: "PC-9800-Bold";
  font-size: 0.7rem;
  color: #eac1f2;
  font-variant-numeric: tabular-nums;
  min-width: 90px;
  text-align: center;
  flex-shrink: 0;
}

.musicListFrame .volume-container {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.musicListFrame .volume-icon {
  font-size: 14px;
  color: #5a6f7e;
  cursor: pointer;
}
.musicListFrame .volume-bar {
  width: 50px;
  height: 4px;
  background: black;
  cursor: pointer;
  position: relative;
  transition: height 0.2s;
}
.musicListFrame .volume-bar:hover {
  height: 6px;
}
.musicListFrame .volume-fill {
  height: 100%;
  background: #babafe;
  width: 100%;
}

.musicListFrame .now-playing {
  transform: translate(0px, 5px);
  font-family: "JMH Typewriter", "Yu Mincho";
  font-size: 17.5px;
  color: #eac1f2;
  padding: 0.2rem 1rem;
  display: inline-block;
  margin-top: 0.2rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.musicListFrame .status-text {
    font-family:'JMH Typewriter';
    position: absolute;
    display: inline-block;
    color: #eac1f2;
    font-size: 14px;
    padding: 4px 16px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    bottom: 2.5px;
}

.musicListFrame .status-text.paused {
    color: #eac1f2;
}

.musicListFrame .footnote {
  margin-top: 1rem;
  font-size: 0.65rem;
  color: #8f9eab;
  border-top: 1px solid #e9edf2;
  padding-top: 0.7rem;
  text-align: center;
}
/* #endregion */

/* #region PIANO MIDI PLAYER */
/* ===== 钢琴容器 ===== */
#pianoContainer {
    width: 100%;
    scale: 0.8;
    transform: translate(0px, 100px);
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

#pianoContainer::-webkit-scrollbar {
    width: 4px;
}

#pianoContainer::-webkit-scrollbar-thumb {
    background: #babafe76;
}

#pianoContainer::-webkit-scrollbar-thumb:hover {
    background: #babafe;
}

/* ===== 钢琴网格 ===== */
.piano-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    padding: 4px;
    width: 100%;
}

/* ===== 每行钢琴 ===== */
.piano-row {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    background: transparent;
    padding: 0;
    width: 100%;
    overflow: visible;
    position: relative;
    min-height: 33.5px;
}

/* ===== 罗马数字标签 ===== */
.piano-label {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-family: "PC-9800-Bold";
    color: #babafe;
    letter-spacing: 0.3px;
    background: transparent;
    z-index: 3;
    white-space: nowrap;
    line-height: 1.2;
    min-width: 16px;
    text-align: left;
}

/* ===== 琴键容器 ===== */
.keys-wrapper {
    display: flex;
    flex: 0 1 auto;
    overflow: visible;
    padding: 0 0 0 50px;
    gap: 1px;
    flex-wrap: nowrap;
    width: auto;
    min-width: 0;
}

/* ===== 琴键基础样式 ===== */
.white-key,
.black-key {
    flex: 0 0 auto;
    cursor: pointer;
    will-change: background, box-shadow;
    position: relative;
    border: none;
    border-top: none;
    margin-top: 0;
    border-radius: 0;
}

/* ===== 白键 ===== */
.white-key {
    width: 5.9px;
    height: 29px;
    background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
    box-shadow: 0 1px 0 #b0b0b0, 0 2px 4px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.white-key:active {
    box-shadow: 0 0px 0 #b0b0b0, 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* ===== 黑键 ===== */
.black-key {
    width: 6px;              /* ★★★ 从4.5px改到6px（变宽） ★★★ */
    height: 16px;
    background: linear-gradient(180deg, #444444 0%, #222222 100%);
    margin-left: -3px;       /* ★★★ 从-2.25px改到-3px（匹配宽度变化） ★★★ */
    margin-right: -3px;      /* ★★★ 从-2.25px改到-3px（匹配宽度变化） ★★★ */
    z-index: 2;
    box-shadow: 0 1px 0 #111111, 0 2px 4px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(100, 100, 100, 0.15);
}

.black-key:active {
    box-shadow: 0 0px 0 #111111, 0 1px 2px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(100, 100, 100, 0.1);
}

.white-key.active {
    background: linear-gradient(180deg, #babafe 0%, #babafe 100%);
    box-shadow: 0 0px 0 #babafe8f, 0 1px 4px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.black-key.active {
    background: linear-gradient(180deg, #babafe 0%, #babafe 100%);
    box-shadow: 0 0px 0 #babafe8f, 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(150, 100, 150, 0.15);
}

/* ===== MIDI播放高亮 ===== */
.white-key.midi-active {
    background: linear-gradient(180deg, #babafe 0%, #babafe 100%);
    box-shadow: 0 0px 0 #babafe8f, 0 0 8px #babafe8f, inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.black-key.midi-active {
    background: linear-gradient(180deg, #babafe 0%, #babafe 100%);
    box-shadow: 0 0px 0 #babafe8f, 0 0 8px #babafe8f, inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.keys-wrapper {
    overflow: visible;
}

.piano-row {
    overflow: visible;
}

/* ===== 滚动指示器 ===== */
.scroll-indicator {
    text-align: center;
    color: #babafe76;
    font-family: "PC-9800";
    font-size: 12px;
    padding: 4px 0;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.scroll-indicator:hover {
    opacity: 1;
}
/* #endregion */

/* #region POPUP FRAME FOR MUSIC ROOM */
/* ============================================================
   故事弹窗样式
   ============================================================ */

/* 歌曲信息 - 居中显示 */
#storyPopup .story-track-info {
    text-align: center;
    transform: none;
    margin: 10px 0;
    color: #e2e8f0;
    font-size: 14px;
}

#storyPopup .story-track-index {
    color: yellow;
}

#storyPopup .story-track-separator {
    color: #e2e8f0;
    margin: 0 6px;
}

#storyPopup .story-track-name {
    color: #93bbfc;
}

/* 故事文本 */
#storyPopup .story-text-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.1;
    max-height: 330px;
    overflow-y: auto;
    text-align: left;
    transform: none;
    margin-top: 5px;
    padding: 0 30px;
    color: #e2e8f0;
    font-size: 14px;
}

/* 滚动条美化 */
#storyPopup .story-text-content::-webkit-scrollbar {
    width: 4px;
}

#storyPopup .story-text-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 1);
}

#storyPopup .story-text-content::-webkit-scrollbar-thumb {
    background: #babafe;
}

#storyPopup .story-text-content::-webkit-scrollbar-thumb:hover {
    background: #ddddff;
}
/* #endregion*/