/* ===============
   基础设定
================ */
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "MS Sans Serif", "Tahoma", "VT323", "SimSun", sans-serif;
  overflow: hidden;
}

body.setup-mode {
  background-color: #008080;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===============
   桌面整体布局
================ */
.desktop-layout {
  display: flex;
  gap: 20px;
  max-width: 1000px;
  width: 95%;
  align-items: stretch; /* 让左右两侧组件栏与中间主窗体等高 */
  z-index: 10;
  justify-content: center;
}

/* ===============
   主页面窗口
================ */
.wizard-container {
  flex: 1;
  max-width: 550px;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
  z-index: 10;
  display: flex;
  flex-direction: column;
}

.window.wizard-window {
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.wizard-window .title-bar {
  background: linear-gradient(90deg, #000080, #1084d0); 
  padding: 3px 2px 3px 3px;
}

.wizard-window .title-bar-text {
  font-weight: bold;
  letter-spacing: 0.5px;
}

.wizard-window .window-body {
  margin: 0;
  padding: 0;
  background-color: #c0c0c0;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ===============
   内容区布局
================ */
.wizard-content-area {
  display: flex;
  flex: 1;
  min-height: 380px; /* 增加一点高度容纳内容 */
}

/* 左侧复古绿条 */
.wizard-sidebar {
  width: 140px;
  background-color: #008080; 
  border-right: 1px solid #808080;
  box-shadow: 1px 0px 0px #ffffff;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.sidebar-graphic .sidebar-title {
  color: #fff;
  font-weight: bold;
  font-size: 24px;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-left: 10px;
  margin-bottom: 20px;
  letter-spacing: 5px;
  text-shadow: 1px 1px 0px #000;
  font-family: inherit;
}

/* 右侧核心内容区 */
.wizard-main-content.retro-profile {
  flex: 1;
  padding: 15px 20px 20px 20px;
  display: flex;
  flex-direction: column;
}

/* ===============
   个人资料展示
================ */
/* 头像与名字区 */
.profile-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.avatar-container {
  width: 80px;
  height: 80px;
  margin-right: 15px;
  background-color: #fff;
  padding: 0; /* 移除 padding 以便图片完全填满 */
  flex-shrink: 0; /* 防止头像被挤压 */
  overflow: hidden; /* 防止出现滚动条 */
}

.retro-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 保证充满方框 */
  image-rendering: pixelated; /* 强化像素感 */
  display: block; /* 消除底部空隙 */
}

.profile-info {
  flex: 1;
  overflow: hidden; /* 防止跑马灯溢出影响布局 */
}

.profile-name {
  font-size: 20px;
  margin: 0 0 5px 0;
  font-weight: bold;
  color: #000;
}

.profile-desc {
  margin: 0 0 5px 0;
  font-size: 13px;
  color: #666;
}

/* 经典走马灯跑马灯 */
.retro-marquee {
  background: #000;
  color: #0f0;
  padding: 2px 5px;
  font-family: inherit;
  font-size: 12px;
  border: 1px inset #fff;
}

/* 带有 3d 凹陷样式的通用版块 */
.sunken-panel {
  box-sizing: border-box;
  padding: 10px;
  background: #ffffff;
  border-top: 2px solid #808080;
  border-left: 2px solid #808080;
  border-bottom: 2px solid #ffffff;
  border-right: 2px solid #ffffff;
  font-size: 13px;
  margin-bottom: 15px;
}

.profile-about p {
  margin: 5px 0;
  line-height: 1.4;
}

/* 经典的蓝链样式 */
.profile-links {
  margin-top: auto;
}

fieldset {
  border: 2px groove #fff;
  padding: 10px;
}

legend {
  color: #000;
  padding: 0 5px;
}

.retro-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.retro-list li {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.retro-list li img {
  margin-right: 8px;
}

.retro-link {
  color: #0000EE;
  text-decoration: underline;
  font-size: 14px;
}

.retro-link:visited {
  color: #551A8B;
}

.retro-link:active {
  color: #FF0000;
}

.retro-link:hover {
  background-color: #000080;
  color: #fff;
  text-decoration: none;
}

/* ===============
   动态小部件样式
================ */
.widgets-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 320px;
}

.widget-window {
  display: flex;
  flex-direction: column;
  flex: 1;
  margin: 0;
  /* 恢复 98.css 的窗口边框并叠加外部阴影 */
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #dfdfdf, inset -2px -2px grey, inset 2px 2px #fff, 2px 2px 0px rgba(0, 0, 0, 0.5) !important;
  min-height: 0; /* 允许等分空间压缩 */
}

.widget-window .window-body {
  margin: 0;
  padding: 5px;
  background-color: #c0c0c0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.widget-content {
  flex: 1;
  background-color: #fff;
  overflow-y: auto;
  padding: 8px;
  font-size: 13px;
  margin-bottom: 0;
  min-height: 0;
}

.widget-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget-content li {
  margin-bottom: 8px;
  border-bottom: 1px dashed #ccc;
  padding-bottom: 6px;
}

.widget-content li:last-child {
  border-bottom: none;
}

.widget-content li a {
  color: #0000EE;
  text-decoration: none;
  display: block;
  line-height: 1.4;
}

.widget-content li a:hover {
  text-decoration: underline;
  color: #FF0000;
}

/* 微调小部件标题栏字体大小 */
.widget-window .title-bar-text {
  font-size: 12px;
}

/* ===============
   左侧部件样式
================ */
.left-widgets-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 120px;
}

/* 网上邻居无文字的细标题栏 */
.neighborhood-bar {
  display: flex;
  justify-content: flex-end; /* X 按钮在最右岞 */
  padding: 2px 2px 2px 2px;
  min-height: unset;
}

/* 确保 controls 在最右岞 */
.neighborhood-bar .title-bar-controls {
  margin-left: auto;
}

/* 网上邻居窗口高度和主窗口一致 */
#window-neighborhood {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* 防止任何内容溢出到窗体外 */
  min-height: 0;
}

#window-neighborhood.window > .window-body,
#window-neighborhood .window-body {
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  padding: 4px !important;
  box-sizing: border-box !important;
  flex: 1 !important;
  min-height: 0 !important;
}

.badges-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  overflow: hidden; /* 不显示滚动条 */
  flex: 1;
}

.badges-container a {
  display: block;
  line-height: 0; /* 消除 img 下方因行高产生的缝隙 */
}

.badges-container img {
  width: 88px;
  height: 31px;
  image-rendering: pixelated;
  display: block;
}

/* sakis.world 的正方形徽章 (1:1 格式) */
.badge-full {
  width: 88px !important;
  height: 60px !important; /* 缩小高度防止溢出 */
  object-fit: contain;
  image-rendering: pixelated;
}

.placeholder-badge {
  width: 88px;
  height: 31px;
  box-sizing: border-box;
  flex-shrink: 0;
  background-color: #c0c0c0;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #808080;
  border-right: 2px solid #808080;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 10px;
  color: #000;
  text-align: center;
  padding: 0 2px;
}

/* emoji 飘落动画 */
.falling-emoji {
  position: absolute;
  pointer-events: none;
  font-size: 24px;
  z-index: 1; /* 改成较小的 z-index ，放在 setup-background 和桌面窗体之间 */
}

/* ===============
   头像放大弹出层
================ */
.avatar-container {
  cursor: pointer;
}

.avatar-container:active {
  border-top: 2px solid #000;
  border-left: 2px solid #000;
  border-bottom: 2px solid #dfdfdf;
  border-right: 2px solid #dfdfdf;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5); /* 半透明防误触遮罩 */
  z-index: 100;
}

.popup-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 101; /* 保证在最上层 */
  box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
  min-width: 300px;
}

.popup-window .window-body {
  background-color: #c0c0c0;
}

.enlarged-avatar {
  max-width: 80vw;
  max-height: 70vh;
  object-fit: contain;
  border: 2px inset #fff;
  border-bottom-color: #808080;
  border-right-color: #808080;
  box-sizing: border-box;
  image-rendering: pixelated; /* 保持像素风格 */
}

/* ===============
   实用类 (Utilities)
================ */
.hidden {
  display: none !important;
}
