:root {
  /* 调色板 - Pink Dream (粉色系) */
  --bg-color: #fdeff7;       /* 很浅的粉底 */
  --container-bg: #fff9fc;   /* 淡粉白 */
  
  --primary-color: #f3b5d0;  /* 主色：柔和樱花粉 */
  --secondary-color: #f8c9db;/* 次色：浅粉 */
  --secondary-dark: #d27aa5; /* 深粉，用于文字/描边 */
  --accent-color: #ffe7f2;   /* 点缀：奶油粉 */
  
  --text-color: #6a4c5c;     /* 文字：微紫灰，兼顾可读性 */
  
  --border-radius: 15px;
  --box-shadow: 3px 3px 0px rgba(160, 190, 180, 0.3);
  
  /* 新字体 */
  --font-main: 'Gaegu', cursive; /* 手写体用于正文 */
  --font-header: 'Pixelify Sans', sans-serif; /* 圆润像素用于标题 */
}

body {
  background-color: var(--bg-color);
  /* 更换平铺背景素材为蝴蝶结图案 */
  background-image: url('bg_assets/bowsbows.gif');
  background-repeat: repeat;
  background-size: auto;
  
  color: var(--text-color);
  font-family: var(--font-main);
  font-size: 20px; 
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

/* 顶部跑马灯 */
.marquee-bar {
  background: #fff;
  color: var(--secondary-color);
  padding: 6px 0;
  font-family: var(--font-header);
  font-size: 14px;
  border-bottom: 2px dashed var(--secondary-color);
  margin-bottom: 20px;
}

/* 主容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
}

/* 横幅 Banner */
.site-banner {
  display: none; /* 取消 Banner 显示 */
}

/* Banner 图片本身 */
.site-banner img {
  display: none;
}

/* 布局 Grid */
.layout-grid {
  display: grid;
  grid-template-columns: 200px 1fr 200px; 
  gap: 15px;
  /* 确保列高度一致 */
  align-items: stretch; 
}

/* 让侧边栏和主内容区占满 Grid 的高度 */
.left-sidebar, .right-sidebar, .content-area {
  display: flex;
  flex-direction: column;
  height: 100%; 
}

/* 让所有栏目（左、中、右）的最后一个盒子自动拉伸，填满高度 */
.left-sidebar .box:last-child, 
.right-sidebar .box:last-child,
.content-area .box:last-child {
  /* 改回 flex-grow: 1，让盒子本身变高 */
  flex-grow: 1;
  /* 移除 margin-top: auto，不要把盒子推到底部，而是拉伸它 */
  /* margin-top: auto; */
  
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* 内容靠上 */
  
  /* 移除底部外边距，贴合分割线 */
  margin-bottom: 0;
}

/* 确保中间主要内容的最后一个盒子也没 margin */
.content-area .box:last-child {
  margin-bottom: 0;
}

/* 盒子通用样式 - 00 年代立体风格 */
.box {
  background: linear-gradient(180deg, #ffffff 0%, #f9fdfa 100%);
  border: 3px solid var(--accent-color);
  border-radius: var(--border-radius);
  padding: 12px;
  margin-bottom: 20px;
  /* 组合投影：内发光 + 外部硬投影 */
  box-shadow: 
    inset 0 1px 0 rgba(255,255,255,1), 
    4px 4px 0px var(--accent-color);
  position: relative;
  /* 确保盒子在内容层之上 */
  z-index: 2;
}

/* --- 新增：内容背景层 (Polka Dot Layer) --- */
.content-layer {
  /* 纯色背景垫底，区分度更高 */
  background-color: #ffffff; 
  /* 波点纹理 (淡绿色波点) */
  background-image: radial-gradient(var(--secondary-dark) 15%, transparent 15%);
  background-size: 20px 20px; /* 波点稍微大一点，疏一点 */
  
  border-radius: 25px;
  padding: 30px; 
  margin-top: 0px; /* 包含 Banner，所以边距设为 0 */
  margin-bottom: 40px;
  
  /* 边框和阴影 */
  border: 4px solid var(--primary-color);
  box-shadow: 6px 6px 0px rgba(138, 198, 209, 0.4);
}

/* --- 新增：Grid 布局增强 (打破死板的三列) --- */
/* 现在的 layout-grid 定义保留，但我们可以让子元素跨列 */

/* 注意：上面第87行也有 layout-grid 定义，这里我们主要添加辅助类 */

/* 跨两列 (比如跨越中间和右边) */
.span-2-right {
  grid-column: 2 / 4;
}

/* 跨两列 (比如跨越左边和中间) */
.span-2-left {
  grid-column: 1 / 3;
}

/* 全宽 (跨越所有3列) */
.span-full {
  grid-column: 1 / -1;
}

/* 分割线 */
.divider-line {
  height: 20px;
  background-image: url('div/tumblr_5151329e2470fd8795b7159ab3e719f4_92015022_250.webp');
  background-repeat: repeat-x;
  background-position: center;
  background-size: auto 100%;
  margin: 30px 0 10px 0; /* 上下间距 */
  width: 100%;
  border: none;
}

/* Guestbook 容器 */
.guestbook-container {
  flex: 1; /* 自动占据剩余空间并填满列高 */
  margin-top: 5px; 
  padding: 0;
  text-align: center;
  border-width: 12px;
  border-style: solid;
  border-image: url("https://i.imgur.com/Kh6qtcn.png") 11 fill round; /* (c) solielios */
  background-color: rgba(255, 255, 255, 0.7); 
  border-radius: 4px; 
  line-height: 0;
  display: block;
}

.guestbook-iframe {
  width: 100%; 
  height: 600px; 
  border: none; 
  overflow: hidden;
  background-color: transparent; 
  display: block; 
}

/* 独立的电子宠物容器 */
.pet-container {
  width: 100%;
  max-width: 19.5em;
  margin-top: 5px;
  display: flex;
  justify-content: center;
}

.pet-frame {
  width: 100%;
  max-width: 19.5em;
}

/* --- 仿 iPod Nano 样式 --- */
.ipod-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.ipod-case {
  width: 180px; /* 经典比例 */
  height: 280px;
  background: linear-gradient(135deg, #e0e0e0 0%, #d0d0d0 100%);
  border-radius: 15px;
  box-shadow: 
    inset 2px 2px 5px rgba(255,255,255,0.8),
    inset -2px -2px 5px rgba(0,0,0,0.2),
    5px 5px 15px rgba(0,0,0,0.2);
  padding: 15px;
  position: relative;
  border: 1px solid #bbb;
}

/* 屏幕 */
.ipod-screen {
  width: 100%;
  height: 120px;
  background: #fff;
  border: 2px solid #333;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  font-family: Arial, sans-serif; /* iPod 字体 */
}

.screen-bar {
  background: linear-gradient(to bottom, #ddd, #ccc);
  height: 16px;
  border-bottom: 1px solid #999;
  padding: 0 4px;
  line-height: 16px;
  color: #333;
}

.cover-flow {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
  overflow: hidden;
  position: relative;
}

.cover-flow img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border: 1px solid #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* 简单的滑入滑出动画类 */
.slide-out-left { transform: translateX(-100px) scale(0.8); opacity: 0; }
.slide-in-right { animation: slideInRight 0.3s forwards; }
@keyframes slideInRight {
  from { transform: translateX(100px) scale(0.8); opacity: 0; }
  to { transform: translateX(0) scale(1); opacity: 1; }
}

.track-info {
  background: #fff;
  padding: 4px;
  text-align: center;
  height: 35px;
}

#ipod-title {
  font-weight: bold;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ipod-progress {
  height: 6px;
  background: #ddd;
  margin-top: auto;
}
.progress-fill {
  height: 100%;
  background: #5dcbf5; /* iPod 经典蓝 */
  width: 0%;
}

/* 菜单覆盖层 */
.screen-menu {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #fff;
  z-index: 10;
  display: flex;
  flex-direction: column;
}
.menu-title {
  background: linear-gradient(to bottom, #eee, #ddd);
  padding: 2px 5px;
  font-weight: bold;
  border-bottom: 1px solid #aaa;
  font-size: 12px;
  text-align: center;
}
#ipod-playlist-ul {
  list-style: none;
  padding: 0;
  margin: 0;
  overflow-y: auto;
  flex: 1;
}
#ipod-playlist-ul li {
  padding: 3px 5px;
  font-size: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
#ipod-playlist-ul li:hover, #ipod-playlist-ul li.active {
  background: #3875d7;
  color: white;
}

/* Click Wheel 转盘 */
.click-wheel {
  width: 120px;
  height: 120px;
  background: #fdfdfd;
  border-radius: 50%;
  margin: 15px auto 0 auto; /* 居中 */
  position: relative;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  border: 1px solid #ddd;
}

.center-button {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #eee 0%, #ddd 100%);
  border-radius: 50%;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid #ccc;
  cursor: pointer;
}
.center-button:active { background: #ccc; }

.wheel-btn {
  position: absolute;
  color: #aaa;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
}
.wheel-btn:hover { color: #555; }

.menu-btn { top: 10px; left: 50%; transform: translateX(-50%); }
.prev-btn { left: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; }
.next-btn { right: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; }
.play-pause-btn { bottom: 10px; left: 50%; transform: translateX(-50%); font-size: 12px; }

/* --- 底部新布局：并排容器 --- */
.bottom-section {
  display: flex;
  gap: 20px; 
  align-items: stretch; /* 顶部对齐，高度拉齐 */
  margin-top: 0;
}

.bottom-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.right-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: flex-end; /* 让内部组件贴底 */
  width: 19.5em; /* 控制右列统一宽度 */
  height: 100%;
}

.guestbook-container {
  flex: 1; /* 自动占据剩余空间并填满列高 */
  margin-top: 5px; 
  padding: 0;
  text-align: center;
  border-width: 12px;
  border-style: solid;
  border-image: url("https://i.imgur.com/Kh6qtcn.png") 11 fill round; /* (c) solielios */
  background-color: rgba(255, 255, 255, 0.7); 
  border-radius: 4px; 
  line-height: 0;
  display: block;
}

/* 盒子标题 - 00 年代流行风格 (白字黑轮廓) */
.box-header {
  background: var(--secondary-color);
  color: white;
  padding: 5px 15px;
  font-family: var(--font-header);
  font-size: 1.2em;
  text-align: center;
  border-radius: 20px;
  width: fit-content;
  margin: -25px auto 10px auto; /* 往上提，骑在边框上 */
  border: 2px solid #fff;
  
  /* 文字描边阴影效果 */
  text-shadow: 
    -1px -1px 0 #000,  
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000,
     2px 2px 0px rgba(0,0,0,0.2);
     
  box-shadow: 2px 2px 0px rgba(0,0,0,0.1);
  letter-spacing: 1px;
}

/* 导航菜单 - 核心重构 (模仿截图2/3) */
.nav-menu {
  /* 绿色系条纹背景 */
  background-image: repeating-linear-gradient(
    45deg,
    #f0fff4,
    #f0fff4 10px,
    #fff 10px,
    #fff 20px
  );
  padding: 20px 10px 10px 10px; /* 上面留多点给标题 */
}

.nav-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px; /* 按钮间距 */
}

.nav-menu a {
  /* 修改为 flex 布局，实现完美的垂直居中对齐 (解决中英文高度差异) */
  display: flex;
  align-items: center; 
  justify-content: center; /* 内容整体居中 */
  
  /* 典型的 00 年代果冻/水晶渐变 */
  background: linear-gradient(to bottom, 
    #ffffff 0%, 
    #f2f9f6 48%, 
    #d8eee6 50%, 
    #e8f6f1 100%
  );
  
  /* 胶囊形状 */
  border-radius: 20px; 
  border: 2px solid var(--primary-color);
  
  color: var(--text-color);
  padding: 5px 12px; 
  
  text-decoration: none;
  font-family: var(--font-header); 
  font-size: 1.1em;
  font-weight: bold;
  
  transition: all 0.2s;
  /* 内部高光和外部投影 */
  box-shadow: 
    inset 0 1px 1px rgba(255,255,255,1),
    2px 2px 0px rgba(156, 209, 219, 0.3);
}

/* 导航栏图标样式 */
.nav-menu a img {
  width: 20px;
  height: 20px;
  object-fit: contain; /* 保持比例 */
  margin-right: 8px; /* 图标和文字的间距 */
  /* 防止图标把行高撑得太大 */
  display: block; 
}

/* 悬停效果 - 像按下钢琴键 */
.nav-menu a:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.05); /* 微微放大 */
  box-shadow: 0px 4px 8px rgba(138, 198, 209, 0.3);
  border-color: #fff;
}

/* 中间内容区 */
.content-area {
  /* 确保有最小高度，防止内容过少时 Grid 塌陷导致对齐问题 */
  min-height: 400px; 
}

.blog-post {
  background: #fff;
  border-radius: 15px;
  padding: 15px;
  border: 1px dashed #ccc;
  margin-bottom: 20px;
}

.blog-title {
  color: var(--secondary-color);
  font-family: var(--font-header);
  font-size: 1.5em;
  margin-bottom: 5px;
}

/* 头像框 */
.avatar-frame {
  width: 100px;
  height: 100px;
  background: #fff;
  border: 3px dashed var(--secondary-color);
  border-radius: 50%;
  padding: 4px;
  margin: 5px auto;
  overflow: hidden;
}
.avatar-frame img {
  border-radius: 50%;
  width: 100%;
  height: 100%;
}

/* 右侧栏特殊样式 */
.right-sidebar .box-header {
  background: var(--primary-color);
}

/* --- 右侧猫咪卡片（替代 iframe） --- */
.hover-card-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.hover-card {
  width: 190px;
  height: 290px;
  padding: 0;
  box-sizing: border-box;
  overflow: hidden;
  border-width: 7px;
  border-style: solid;
  border-image: url("https://media.discordapp.net/attachments/826854899013648384/839700444375810078/tumblr_inline_o98n9dbCl61u2r0ws_540_1_2.png") 8 fill round;
  position: relative;
  background: #fff;
}

.hover-card * {
  transition: 0.3s ease all;
}

.hover-card-image {
  margin: 0 auto;
  width: 180px;
  height: 240px;
  object-fit: cover;
  display: block;
}

.hover-card-title {
  font-family: lovely, cursive;
  font-size: 30px;
  text-align: center;
  -webkit-text-stroke: 1px #000;
  color: #fff;
  position: absolute;
  width: 100%;
  top: 180px;
  z-index: 5;
  pointer-events: none;
}

.hover-card-text {
  padding: 10px 5px;
  height: 110px;
  overflow: hidden;
  background: #fff;
  font-size: 13px;
  font-family: "Times New Roman", Times, serif;
  font-weight: bold;
  color: #000;
  text-align: center;
}

/* 简单的显示/隐藏控制 */
.hidden { display: none !important; }
.lang-btn { cursor: pointer; margin-left: 10px; font-weight: bold; font-family: var(--font-header); font-size: 12px; }
.active-lang { text-decoration: underline wavy var(--secondary-color); color: var(--secondary-color); }

.iframe-container {
    width: 100%;
    height: 600px;
    border: none;
    overflow: hidden;
}

/* 装饰性白云滚动盒子 */
.whitecloudybox {
  height: 140px;
  width: 100%;
  border: 10px solid transparent;
  box-sizing: border-box;
  border-image: url(https://i.postimg.cc/QM9dMFhq/cloud.png) 50 round;
}

.whitecloudyfull { 
  width:100%;
  height:100%;
  overflow-y:auto;
  background:#fff;
  color:black;
  padding: 5px;
  box-sizing: border-box;
  font-size: 0.9em;
}

/* --- Win98 Window Style --- */
@font-face {
  font-family: "Pixelated MS Sans Serif";
  src: url("https://files.catbox.moe/1za99g.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}   

@font-face {
  font-family: "Magica";
  src: url("https://static.tumblr.com/p6yopnt/Qkiqnu0r5/theheart.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "lovely";
  src: url("https://dl.dropbox.com/s/xde2bkhiie1bm8r/LovelyRegular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* 额外字体（翻转卡片用） */
@font-face {
  font-family: "good-time";
  src: url("https://dl.dropbox.com/s/ijxda4xb1cyjpe4/KGAlwaysAGoodTime.ttf");
}
@font-face {
  font-family: "lovely script";
  src: url("https://dl.dropbox.com/s/ss5bqbogijw4zfj/Lovely%20Script.otf");
}
@font-face {
  font-family: "cerl";
  src: url("https://dl.dropbox.com/s/vaz4fe5yzk1uiku/CHERL___.TTF");
}

.window {
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #dfdfdf, inset -2px -2px #808080, inset 2px 2px #ffffff;
  background: #c0c0c0;
  color:#000;
  padding: 3px;
  width: 100%;
  box-sizing: border-box;
  font-family: "Pixelated MS Sans Serif", Arial;
  margin-bottom: 20px;
}

.title-bar {
  background: linear-gradient(90deg, #800080, #da70d6, #ffc0cb);
  padding: 3px 2px 3px 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title-bar-text {
  font-weight: bold;
  color: white;
  letter-spacing: 0;
  font-size: 11px;
}

.title-bar-controls {
  display: flex;
}

.title-bar-controls button {
  padding: 0;
  display: block;
  min-width: 16px;
  min-height: 14px;
  background: silver;
  box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff, inset -2px -2px grey, inset 2px 2px #dfdfdf;
  border: none;
  margin-left: 2px;
}

.title-bar-controls button[aria-label=Minimize]{
  background-image:url("https://raw.githubusercontent.com/jdan/98.css/main/icon/minimize.svg");
  background-position:bottom 3px left 4px;
  background-repeat:no-repeat
}

.title-bar-controls button[aria-label=Maximize]{
  background-image:url("https://raw.githubusercontent.com/jelan/98.css/4a2282dd9170cabf730fb5803d1153d86b2e94e3/icon/maximize.svg");
  background-position:top 2px left 3px;
  background-repeat:no-repeat;
}

.title-bar-controls button[aria-label=Close]{
  background-image:url("https://raw.githubusercontent.com/jdan/98.css/main/icon/close.svg");
  background-position:top 3px left 4px;
  background-repeat:no-repeat;
}

.window-body {
  margin: 8px;
}

.fieldset-ldh {
  border: 1px gray solid;
  box-shadow: white 1px 1px 0px inset, white 1px 1px 0px, white 0px 1px 0px, white 1px 0px 0px;
  margin: 0;
  padding: 2px;
  overflow: hidden; /* 禁止滚动 */
}

/* 像素风格香肠边框 */
.sausage-frame {
  width: 100%;
  display: block;
  box-sizing: border-box;
  margin-top: 8px;
  border-width: 10px;
  border-style: solid;
  border-image: url("https://hosting.photobucket.com/albums/bb183/phyncke_graphique/Pixel-Frames/.highres/a49U000028.gif?width=450&height=278&crop=fill") 9 fill round;
}

/* 投票框装饰边框 */
.poll-frame {
  border-width: 7px;
  border-style: solid;
  border-image: url("https://i.imgur.com/FsgoCPW.png") 7 fill round;
  box-sizing: border-box;
}

/* --- Pink Wave Text Style --- */
.pinkwave {
  font-size: 2em;
  font-weight: bold;
  font-family: Arial, sans-serif;
  color: transparent;
  background: url("https://files.catbox.moe/db8ne8.png") repeat-x #fff;
  background-clip: text;
  -webkit-background-clip: text;
  background-size: 200% 100%;
  animation: waveAnimation 4s infinite linear;
  -webkit-animation: waveAnimation 4s infinite linear;
  filter: drop-shadow(1px 1px white) drop-shadow(-1px 1px white) drop-shadow(1px -1px white) drop-shadow(-1px -1px white)
          drop-shadow(1px 1px black) drop-shadow(-1px 1px black) drop-shadow(1px -1px black) drop-shadow(-1px -1px black);
}

@keyframes waveAnimation {
  from { background-position-x: 0%; }
  to { background-position-x: 200%; }
}

@-webkit-keyframes waveAnimation {
  from { background-position-x: 0%; }
  to { background-position-x: 200%; }
}

/* --- 翻转卡片组件 (右下角) --- */
.flip-holder {
  background: #ed8c94;
  position: relative;
  height: 18.875em;
  width: 100%;
  max-width: 19.5em;
  margin: auto;
  box-shadow: rgba(50, 50, 93, 0.6) 0px 50px 100px -20px, rgba(0, 0, 0, 0.5) 0px 30px 60px -30px, rgba(10, 37, 64, 0.65) 0px -2px 6px 0px inset;
  padding: 0.625em;
  border-radius: 0.875em;
  overflow: visible; /* 允许标题/翅膀悬浮出框 */
}

.flip-figure {
  position: relative;
  height: 100%;
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black); /* 兼容标准属性 */
  display: flex;
  flex-direction: column;
  border-radius: 0.875em;
}

.flip-holder:hover {
  animation: shake 1s, image_blur 1s;
  transition: all 1s ease-in-out;
  transition-timing-function: cubic-bezier(0.1, 0.8, 0.9, 0.1);
}

.flip-holder:hover .flip-section {
  transform: translateY(-17.625em);
}

.flip-holder:hover .flip-box {
  transform: translateY(-13em);
  animation: fadeIn ease 2s;
  -webkit-animation: fadeIn ease 2s;
}

.flip-section {
  position: relative;
  background: transparent;
  width: 100%;
  height: 100%;
  transition: all 1s ease-in-out;
  transition-timing-function: cubic-bezier(0.1, 0.8, 0.9, 0.1);
  border-radius: 0.875em;
}

.flip-title {
  position: absolute;
  z-index: 99;
  font-size: 3.75em;
  left: 50%;
  transform: translateX(-50%);
}

.flip-title#flip-rainbow {
  font-family: "good-time", cursive;
  -webkit-text-stroke: 1px white;
  top: -0.6em;
}

.flip-title#flip-wobble {
  color: #fff;
  text-shadow: -1px 1px 2px black, 1px -1px 2px black, 1px 1px 2px black, -1px -1px 2px black;
  font-weight: bold;
  bottom: -0.55em;
  font-family: "lovely script", cursive;
}

.flip-box {
  position: absolute;
  z-index: 5;
  width: 80%;
  height: 50%;
  overflow: auto;
  background: rgba(237,140,148,0.65);
  color: white;
  padding: 0.5em;
  font-family: 'Lato', sans-serif;
  left: 0; right: 0;
  margin-left: auto;
  margin-right: auto;
  border-radius: 0.875em;
}

.flip-text h3 {
  z-index: 6;
  color: #000;
  text-shadow: 0 0 1px white, 0 0 2px white, 0 0 3px white, 0 0 4px white, 0 0 5px white;
  font-size: 2em;
  opacity: 0.9;
  font-family: "cerl", serif;
  position: absolute;
  left: 0; right: 0;
  margin-left: auto;
  margin-right: auto;
}

.flip-holder:hover .flip-text h3 {
  transform: translateY(-7.25em);
  animation: fadeIn ease 2s;
  -webkit-animation: fadeIn ease 2s;
}

.flip-wing {
  position: absolute;
  z-index: 10;
  bottom: -1.1em;
  height: 3.5em;
}
.flip-wing.left { left: 0.5em; }
.flip-wing.right { right: 0.5em; }

.flip-img {
  pointer-events: none;
  border-radius: 0.875em;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 响应式 */
@media (max-width: 800px) {
  /* 隐藏被标记为手机端不需要的元素 */
  .mobile-hide {
    display: none !important;
  }

  /* 修复云朵盒子高度 */
  .whitecloudybox {
    height: auto !important; /* 覆盖默认的固定高度 */
    min-height: 140px;
  }
  .whitecloudyfull {
    height: auto !important;
    overflow-y: visible !important; /* 允许内容撑开 */
  }

  /* 修复投票栏宽度 */
  .poll-frame {
    width: 100% !important; /* 占满容器 */
    max-width: 320px;       /* 但别太宽 */
    margin: 0 auto;
  }

  /* 布局容器转为 Flex 列布局 */
  .layout-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  /* 打破侧边栏的结构限制，让内部元素直接参与 Flex 排序 */
  .left-sidebar, .right-sidebar {
    display: contents;
  }

  /* 1. 导航菜单置顶 */
  .nav-menu {
    order: 1;
    margin-bottom: 0;
  }

  /* 导航菜单改为双列矩阵 */
  .nav-menu ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  
  /* 导航菜单盒子留白 */
  .nav-menu {
    padding: 15px 8px 10px 8px;
  }
  
  /* 导航按钮在小屏幕上缩小字体和图标 */
  .nav-menu a {
    font-size: 0.85em;
    padding: 4px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .nav-menu a img {
    width: 16px;
    height: 16px;
    margin-right: 4px;
  }
  
  /* 盒子标题在小屏幕上也需要调整 */
  .box-header {
    font-size: 1em;
  }

  /* 2. 主要内容区 */
  .content-area {
    order: 2;
    min-height: auto;
  }

  /* 3. iPod 播放器 */
  .ipod-container {
    order: 3;
    margin-top: 20px;
  }

  /* 4. 投票 (在 form 标签里) */
  .right-sidebar form {
    order: 4;
    margin: 0 auto; /* 居中 */
  }

  /* 5. 底部区域 */
  .divider-line {
    order: 5;
    display: none; /* 分割线在手机端可能多余 */
  }

  .bottom-section {
    order: 6;
    flex-direction: column;
    gap: 30px;
  }
  
  /* 调整底部列的宽度 */
  .bottom-col, .right-stack {
    width: 100%;
    max-width: none;
    align-items: center; /* 居中对齐 */
    display: flex;       /* 强制 Flex 布局确保 align-items 生效 */
    flex-direction: column;
  }
  
  /* 修复电子宠物容器宽度与居中 */
  .pet-container {
    max-width: 100%;
    display: flex;       /* 确保内容居中 */
    justify-content: center;
  }
  
  /* 关键修复：限制 iframe 宽度，防止其被拉伸导致内容左对齐而右侧出现空白背景 */
  .pet-frame {
    width: 314px !important; /* 强制使用 iframe 原始宽度 */
    max-width: 100%;         /* 防止在极窄屏幕溢出 */
  }

  /* 修复 Flag Counter 和装饰图居中 */
  .right-stack > div {
    display: flex;
    justify-content: center;
    width: 100%;
  }
  
  /* 限制 Flag Counter 图片大小，防止溢出 */
  .right-stack img[src*="flagcounter"] {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
  }
  
  /* 限制 Flag Counter 容器大小 */
  .right-stack a[href*="flagcounter"] {
    display: block;
    max-width: 100%;
    overflow: hidden;
  }

  /* 留言板 iframe 高度适应 */
  .guestbook-iframe {
    height: 500px;
    overflow-y: auto !important; /* 确保 CSS 允许滚动 */
  }
}

/* --- 投票栏样式 (从 HTML inline 迁移) --- */
.poll-frame {
  background-color: #E6CAD4;
  padding: 2px;
  width: 200px; /* 默认桌面宽度 */
  font-family: 'Times New Roman', serif;
  font-size: small;
  color: #000000;
  box-shadow: 0px 0px 5px #888;
  margin: 0 auto;
}

/* --- 语言切换按钮新样式 --- */
.lang-switch-container {
  flex-shrink: 0;
  padding-left: 10px;
  display: flex;
  align-items: center;
}

.lang-btn { 
  cursor: pointer; 
  font-weight: bold; 
  font-family: var(--font-header); 
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 12px;
  transition: all 0.2s;
  color: var(--secondary-dark); /* 默认深粉色 */
  border: 1px solid transparent;
}

.lang-btn:hover {
  background-color: var(--accent-color);
}

.active-lang { 
  background-color: var(--secondary-color);
  color: white !important;
  border: 1px solid var(--secondary-dark);
  text-decoration: none; /* 去掉之前的下划线 */
}

/* --- 弹窗 Modal 样式 --- */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5); /* 半透明黑背景 */
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fff;
  border: 4px solid var(--secondary-color);
  border-radius: 15px;
  padding: 20px;
  width: 80%;
  max-width: 400px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  position: relative;
  font-family: var(--font-main);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.close-btn {
  position: absolute;
  top: 5px;
  right: 10px;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: var(--secondary-dark);
}

/* 针对极小屏幕（宽度 < 400px）的额外优化 */
@media (max-width: 400px) {
  /* 导航按钮进一步缩小 */
  .nav-menu a {
    font-size: 0.75em;
    padding: 3px 5px;
  }
  
  .nav-menu a img {
    width: 14px;
    height: 14px;
    margin-right: 3px;
  }
  
  /* 盒子标题缩小 */
  .box-header {
    font-size: 1em;
    padding: 4px 12px;
  }
  
  /* 确保内容不会溢出 */
  .content-layer {
    padding: 15px;
  }
  
  /* Flag Counter 进一步限制 */
  .right-stack > div {
    padding: 0 10px;
  }
}
