@font-face{ 
  font-family:"WQYBitmapSong14"; 
  src:url("./fonts/wqy-bitmapsong-14.ttf") format("truetype"); 
  font-display:swap; 
}

@font-face{
  font-family:"ZLabsBitmap";
  src:url("./fonts/ZLabsBitmap.ttf") format("truetype");
  font-display:swap;
}

:root {
    --color-bg: #000000;
    --color-fg: #ffffff;
    --color-accent: #ffffff;
}

/* 在使用变量的地方添加回退 */
body {
    background-color: #000000; /* 回退值 */
    background-color: var(--color-bg);
    color: #ffffff; /* 回退值 */
    color: var(--color-fg);
}

html {
    height: 100%; /* 确保html元素占满视口高度 */
    cursor: url('cursor/cursor1.png'), auto; /* 将默认光标应用到顶层 */
}

body {
    background-image: url('images/background/TV.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: var(--color-bg);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    /* 简化字体栈，移除外部字体 */
    font-family: "ZLabsBitmap", "WQYBitmapSong14", "Courier New", monospace;
    font-size: 12px;
    line-height: 16px;
    color: var(--color-fg);
    margin: 0;
    padding: 0;
    overflow: hidden;
    min-height: 100%;
    position: relative;
}

/* 删除以下所有伪元素样式：

1. 删除扫描线效果
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 1px 3px;
    pointer-events: none;
    z-index: 100;
}

2. 删除四角装饰
body::before {
    content: "";
    position: fixed;
    pointer-events: none;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    background:
        linear-gradient(var(--color-fg), var(--color-fg)) left top / 1px 16px no-repeat,
        linear-gradient(var(--color-fg), var(--color-fg)) left top / 16px 1px no-repeat,
        linear-gradient(var(--color-fg), var(--color-fg)) right top / 1px 16px no-repeat,
        linear-gradient(var(--color-fg), var(--color-fg)) right top / 16px 1px no-repeat,
        linear-gradient(var(--color-fg), var(--color-fg)) left bottom / 1px 16px no-repeat,
        linear-gradient(var(--color-fg), var(--color-fg)) left bottom / 16px 1px no-repeat,
        linear-gradient(var(--color-fg), var(--color-fg)) right bottom / 1px 16px no-repeat,
        linear-gradient(var(--color-fg), var(--color-fg)) right bottom / 16px 1px no-repeat;
    z-index: 101;
}
*/


/* --- Loader Styles --- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    pointer-events: none; /* 添加这行，确保不捕获事件 */
}

#loader.hidden {
    display: none;
    visibility: hidden; /* 确保完全隐藏 */
}

.outer-wrapper{ 
   width:62vw;max-width:880px; 
   margin:40px auto;padding:24px; 
   background:transparent; 
   border:1px solid var(--color-fg);   /* 单根白线！ */ 
   box-sizing:border-box; 
   position: relative; /* 为伪元素定位提供基准 */
   z-index: 10; /* 确保在前景 */
 }

/* 删除内容衬底效果
.outer-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(180, 180, 180, 0.025);
    z-index: -1;
}
*/

/* .outer-wrapper::before (old border style) {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(var(--color-accent), var(--color-accent)) left top / 3px 15px no-repeat,
        linear-gradient(var(--color-accent), var(--color-accent)) left top / 15px 3px no-repeat,
        linear-gradient(var(--color-accent), var(--color-accent)) right top / 3px 15px no-repeat,
        linear-gradient(var(--color-accent), var(--color-accent)) right top / 15px 3px no-repeat,
        linear-gradient(var(--color-accent), var(--color-accent)) left bottom / 3px 15px no-repeat,
        linear-gradient(var(--color-accent), var(--color-accent)) left bottom / 15px 3px no-repeat,
        linear-gradient(var(--color-accent), var(--color-accent)) right bottom / 3px 15px no-repeat,
        linear-gradient(var(--color-accent), var(--color-accent)) right bottom / 15px 3px no-repeat;
} */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

header .logo {
    font-weight: bold;
    font-size: 22px;
}

header nav a {
    margin: 0 15px;
}

/* 新增：为导航按钮设置无边框样式 */
header nav .nav-btn { /* Changed from .btn to .nav-btn for specificity */
    border: none;
    width: auto; /* 取消按钮的100%宽度 */
    margin: 0 10px;
    font-size: 16px; /* 适当增大字体 */
    padding: 0;
    background: transparent; /* 确保背景透明 */
    display: inline-flex; /* 使用flex布局对齐图标和文字 */
    align-items: center; /* 垂直居中对齐 */
}

/* 新增：导航图标样式 */
.nav-icon {
    /* display: none; */ /* 改为使用 visibility 来控制显隐，防止文字跳动 */
    visibility: hidden; /* 默认隐藏图标，但仍占据空间 */
    width: 32px; /* 放大图标尺寸 */
    height: 32px;
    margin-right: 8px; /* 图标和文字的间距 */
    image-rendering: pixelated; /* 关键：保持像素图片的清晰边缘 */
    image-rendering: -moz-crisp-edges; /* 兼容 Firefox */
    image-rendering: crisp-edges; /* 兼容旧版浏览器 */
}

.nav-btn.active .nav-icon {
    /* display: inline-block; */
    visibility: visible; /* 显示激活状态的图标 */
}

/* 新增：为导航按钮设置悬停效果 */
header nav .nav-btn:hover {
    background: transparent; /* 保持背景透明 */
    text-decoration: underline; /* 添加下划线作为反馈 */
    color: var(--color-fg); /* 关键：覆盖通用btn的hover效果，保持文字颜色不变 */
}

main.layout { /* Changed from main, .layout */
    display: grid;
    grid-template-columns: 200px 1fr 200px; /* 左边栏 | 主内容 | 右边栏 */
    gap: 20px;
}

.sidebar-left {
    flex: 0 0 200px; /* 固定宽度 */
    box-sizing: border-box;
}

.main-area {
    flex: 1 1 auto;
    /* padding: 0 20px; */ /* 移除内边距，让内容区占满 */
    box-sizing: border-box;
}

/* 新增：移除内容区域的边框 */
.content-section {
    border: none; /* 移除边框 */
}

/* 滚动条细化 */ 
 .sidebar-right{overflow-y:auto;scrollbar-width:thin;}\n\na,.btn{ 
   color:var(--color-fg);text-decoration:none; 
   transition:color .2s; 
   cursor: url('cursor/cursor2.png'), auto; /* 为可交互元素设置悬停光标 */
 } 
 a:hover,.btn:hover{
   background:var(--color-fg);
   color:var(--color-bg);
}

.btn{ 
   border:1px solid var(--color-fg); 
   background:transparent;padding:6px 0; 
   font-family: inherit; /* Ensure button uses the body font */
   width: 100%;
   font-size: 14px;
 }

/* 移除：删除不再需要的左侧边栏按钮样式 */
/* .sidebar-left .btn {
    height: 40px;
} */

.card{ 
   margin:8px 0;padding:12px; 
   border: 1px solid var(--color-fg);
   border-radius:0;
   background:transparent;
 }

/* .card:before {
    content: "";
    display: block;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-mint));
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
} */

/* 角色图标网格 */ 
 .icon-grid{ 
   display:grid;grid-template-columns:repeat(auto-fill,64px); 
   gap:6px;justify-content:flex-start; 
 } 
 .icon-grid img{width:64px;height:64px;object-fit:cover;}

.role-btn {
    width: 100%;
    height: 50px; /* Give some height to the role buttons */
    padding: 2px; /* Adjust padding for image */
}

.role-btn img {
    width: 32px;
    height: 32px;
}

.quote-area {
    border-top: 1px solid var(--color-fg);
    padding-top: 10px;
    margin-top: 10px;
    min-height: 40px;
}

/* --- Styles for Character Display Area --- */
.character-display-area {
    border: 1px solid var(--color-fg);
    margin-bottom: 20px;
    min-height: 300px; /* Give it some height */
    display: flex;
    flex-direction: column;
    position: relative; /* For placeholder positioning */
}

.character-image-container {
    width: 100%; /* 或者一个你希望的固定宽度，例如 300px */
    height: 200px; /* 设置一个固定的高度 */
    background-color: #000; /* 黑色背景 */
    border: 2px solid var(--border-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* 隐藏超出容器的部分 */
}

.character-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 保持图片比例，完整显示在容器内 */
}

.character-info-container {
    background-color: var(--card-bg-color);
    border-top: 1px solid var(--color-fg);
    padding: 15px;
    background-color: #111; /* Slightly different background */
    min-height: 100px;
}

.character-info-container h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: var(--color-accent);
}

.character-info-container p {
    margin: 0;
    line-height: 1.5;
}

.character-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: var(--color-fg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 2; /* Make sure it's on top */
}

.icon-grid .role-btn {
    border: 1px solid var(--color-fg);
    background-color: transparent;
    padding: 5px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.icon-grid .role-btn:hover,
.icon-grid .role-btn.selected {
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 8px var(--color-accent);
}

.icon-grid .role-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.quote-area {
    display: none; /* Hide the old quote area */
}

/* --- End of Character Display Styles --- */

.checkin-btn:disabled {
    background-color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
}

.checkin-status {
    margin-top: 10px;
}

.bar {
    width: 100%;
    height: 18px;
    background-color: var(--color-bg);
    border: 1px solid var(--color-main);
    margin-top: 5px;
}

.bar span {
    display: block;
    height: 100%;
    background-color: var(--color-fg);
}

.card-update h3 {
    margin-top: 0;
    font-size: 16px;
    border-bottom: 1px solid var(--color-fg);
    padding-bottom: 5px;
}

.card-update ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.card-update ul li {
    margin-bottom: 8px;
}

/* --- New Styles for Left Sidebar --- */

.card-profile {
    text-align: center;
}

.profile-avatar-container {
    width: 100px;
    height: 100px;
    border: 1px solid var(--color-fg);
    padding: 4px;
    margin: 0 auto 10px auto;
    box-sizing: border-box;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.profile-name {
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
}

.dialog-box {
    border: 1px solid var(--color-fg);
    padding: 8px;
    min-height: 60px; /* 保证初始高度 */
    max-height: 120px; /* 限制最大高度 */
    overflow-y: auto; /* 内容超出时显示滚动条 */
    margin-bottom: 10px;
    line-height: 1.4; /* 调整行间距 */
}

.dialog-box p {
    margin: 0 0 4px; /* 段落间距 */
    word-break: break-all; /* 长单词自动换行 */
}

.dialog-box p:last-child {
    margin-bottom: 0;
}

/* Custom Scrollbar for Dialog Box */
.dialog-box::-webkit-scrollbar {
    width: 8px; /* 滚动条宽度 */
}

.dialog-box::-webkit-scrollbar-track {
    background: var(--color-bg); /* 轨道背景色 */
    border-left: 1px solid var(--color-fg); /* 左边框 */
}

.dialog-box::-webkit-scrollbar-thumb {
    background: var(--color-fg); /* 滑块颜色 */
    border: 1px solid var(--color-fg); /* 滑块边框 */
}

.dialog-box::-webkit-scrollbar-thumb:hover {
    background: #000000; /* 鼠标悬停时滑块颜色变深 */
}


.scrolling-text-container {
    width: 100%;
    overflow: hidden;
    height: 24px;
    border: 1px solid var(--color-fg);
    overflow: hidden;
    position: relative;
    background: #111;
}


.scrolling-text {
    position: absolute;
    white-space: nowrap;
    animation: scroll-left 20s linear infinite;
}

@keyframes scroll-left {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* --- End of New Styles --- */

/* Update Log 样式 */ 
 .update-log li{position:relative;padding-left:14px;margin:4px 0;}

.update-log li:before {
    content: "◆";
    position: absolute;
    left: 0;
    color: var(--color-accent);
}

#characters-content {
    display: none;
}

.card-fortune {
    text-align: center;
}

#fortune-result-container {
    padding: 10px 0;
    min-height: 120px; /* 设置一个最小高度以容纳图片和文字 */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#fortune-image {
    max-width: 80px; /* Adjust size as needed */
    max-height: 80px; /* 增加最大高度限制 */
    object-fit: contain; /* 确保图片等比缩放 */
    height: auto;
    margin-bottom: 10px;
}

#fortune-text {
    font-size: 16px;
    font-weight: bold;
}
  .card-title {
    margin: -12px -12px 12px -12px;
    padding: 6px 12px;
    background: var(--color-bg);
    color: var(--color-fg);
    font-family: inherit;
    font-size: 14px;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--color-fg);
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 0;
  }

  .card-title::before {
    content: '◆';
  }

 .card-title::before{content:"◆";}     /* 白色小钻石 */

 /* 移除旧的自定义光标样式 */
 /*
 body#page-body {
     cursor: none; 
 }

 #custom-cursor {
     position: fixed;
     left: 0;
     top: 0;
     pointer-events: none; 
     font-size: 24px;
     color: white;
     text-shadow: 0 0 5px white, 0 0 10px white; 
     z-index: 9999;
     display: none; 
 }
*/

 .trail-char {
     position: absolute;
     color: white;
     font-family: 'Courier New', Courier, monospace;
     font-size: 10px;
     user-select: none;
     pointer-events: none;
     will-change: top, left, transform;
     transform: translate(-50%, -50%); /* 关键：将文字的视觉中心对准鼠标点 */
     text-shadow:
         0 0 7px rgb(255, 255, 255),
         0 0 10px rgba(255, 255, 255, 0.4),
         0 0 15px rgba(180, 180, 255, 0.3);
     z-index: 9998;
 }

 /* 移除旧的隐藏系统光标的样式 */
 /*
 body {
     cursor: none; 
 }
 */

  .welcome-figure{ 
      float:right;             
      width:160px;            
      margin:0 0 0 16px;      
      border: 1px solid var(--color-fg);
      padding: 4px;
      box-sizing: border-box;
      } /* 确保正确闭合 */
  
      /* 5. 粒子效果画布 */
      #particle-canvas {
          position: fixed;
          top: 0;
          left: 0;
          width: 100vw;
          height: 100vh;
          z-index: 1;
          pointer-events: none;
          display: block;
      }
