/* 前台样式 —— 复古表格风 */
* { box-sizing: border-box; }

body {
  margin: 0;
  position: relative; /* 作为 .page-topbar（absolute 定位）的定位基准 */
  /* 顶部留白 60px：默认值，实际由后台「顶部留白高度」配置经动态 style 覆盖 */
  padding-top: 60px;
  font-family: "Microsoft YaHei", "PingFang SC", SimSun, sans-serif;
  font-size: 14px;
  color: #2b2118;
  background: #f2ede0;
}

a { color: #8b1a1a; }
a:hover { color: #c0392b; }

.wrap { max-width: none; width: 98%; margin: 0 auto; padding: 0 8px; }

/* 页面顶部右侧入口按钮：固定悬浮在页面顶部右上角（顶部留白区域内、banner 右上方） */
.page-topbar {
  position: absolute;
  top: 18px;
  /* 右缘从内容区右缘再左移约一个按钮宽 + 间距（需求：「自主广告发布」继续左移） */
  right: calc(1% + 132px);
  z-index: 50;
}
.page-topbar a {
  display: inline-block;
  background: #f26a1b;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  padding: 8px 18px;
  border-radius: 4px;
  text-decoration: none;
}
.page-topbar a:hover {
  background: #d95a10;
  color: #fff;
  text-decoration: none;
}

/* 主体（顶部站名 header 已移除，改由信息行 topline 承载辅助信息） */
.main { padding-top: 14px; padding-bottom: 24px; }

/* 顶部信息行：左 = 滚动公告（flex:1），右 = 日期 + 节日 */
/* 置于 main 内，宽度与水平缩进由父级 .main(.wrap) 统一提供，自身不再叠加（否则 .wrap 二次生效会缩窄并与表格左缘错位） */
.topline-wrap { padding: 0 0 6px; }
.topline {
  display: flex;
  align-items: center;   /* 左右两栏垂直居中对齐 */
  gap: 12px;
  margin: 0 0 12px;
}
/* 公告条回归 topline 左栏：占满剩余宽度，去掉自身外边距 */
.topline .notice-bar {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.topline-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}
.date-line {
  color: #6e5a3f;
  font-weight: bold;
}
.festival {
  color: #c0392b;
  font-weight: bold;
  margin-left: 6px;
}
@media (max-width: 768px) {
  /* 窄屏：左右两栏纵向堆叠，右侧信息居中，避免完整日期被压成多行 */
  .topline {
    flex-direction: column;
    align-items: stretch;
  }
  .topline-right {
    justify-content: center;
    white-space: normal;
  }
  /* 窄屏顶部入口按钮：保持 absolute 右上角悬浮，仅压缩顶部间距 */
  .page-topbar {
    top: 10px;
  }
}

/* 页脚区（文档流，置于所有分区之后、main 内底部）：健康游戏忠告 + 版权文字，整体居中 */
.page-bottom {
  padding: 8px 0 20px;
  color: #6e5a3f;
  text-align: center;
}
.page-bottom .foot-notice {
  margin: 0;
  font-size: 15px;   /* 原 13px 放大 */
  font-weight: bold;
  color: #d4a017;
  text-shadow: 0 1px 2px rgba(212, 160, 23, 0.35); /* 金色微光晕高亮 */
}
.page-bottom .foot-copy {
  margin: 2px 0 0;
  font-size: 14px;   /* 原 12px 放大 */
  color: #d4a017;    /* 原 #8a7a5f 提亮为站点主题金 */
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(212, 160, 23, 0.35); /* 金色微光晕高亮 */
}
.page-bottom .beian {
  font-size: 12px;
  color: #8a7a5f;
  margin-top: 4px;
}
.page-bottom .beian a {
  color: #8a7a5f;
  text-decoration: none;
}
.page-bottom .beian a:hover {
  color: #8a7a5f;
  text-decoration: underline;
}

.section { margin-bottom: 20px; }
.sec-title {
  margin: 0 0 6px;
  font-size: 17px;
  padding: 7px 12px;
  color: #fff;
  background: #5a3d2b;
  border-left: 6px solid #d4a017;
  border-radius: 3px 3px 0 0;
}
.sec-title.qtth { background: #b8860b; }
.sec-title.qtjp { background: #a03a6b; }
.sec-title.txgd { background: #2e6e46; }
.sec-title.tx   { background: #2f5496; }

/* 表格 —— 游戏面板风格：深棕粗外框 + 内侧金色细线 + 轻微圆角 */
.tbl-wrap {
  overflow-x: auto;
  padding: 2px;
  border: 3px solid #4a3524;               /* 深棕色粗外框 */
  border-radius: 6px;                       /* 轻微圆角 */
  box-shadow: inset 0 0 0 2px #d4a017;      /* 内侧金色细线 */
}
table {
  width: 100%;
  border-collapse: collapse;
  background: #fffdf5;
}
th {
  background: #4a3524;
  color: #ffe9b8;
  border: 1px solid #33241a;
  padding: 4px 8px;
  white-space: nowrap;
}
td {
  border: 1px solid #d8c9a8;
  padding: 4px 8px;
  text-align: center;
  white-space: nowrap;
}
td.intro {
  text-align: left;
  white-space: normal;
  min-width: 180px;
}
/* 第一列（服务器名称）基准宽 180px；全局 td 的 nowrap 保证所有行恒为单行，
   行高统一；名称更长时由表格自动布局扩宽该列（行首图标始终与名称同行） */
th:first-child,
td:first-child { width: 180px; }
td a { text-decoration: none; }
td a:hover { text-decoration: underline; }
.ad-name { font-weight: bold; }

/* 「点击查看」橙色按钮（游戏主页入口），覆盖 td a:hover 下划线 */
.btn-view {
  display: inline-block;
  background: #f26a1b;
  color: #fff;
  font-weight: bold;
  padding: 4px 14px;
  border-radius: 4px;
  text-decoration: none;
}
.btn-view:hover {
  background: #d9550f;
  color: #fff;
  text-decoration: none;
}

/* 行首图标（R8+R9：套黄行=榜、精品行=火，随 render_rows 输出）
   固定在所在单元格（第一列）最左侧，不随名称文字居中移动 */
td:first-child { position: relative; }
.row-ico { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; margin: 0; }

/* 版本介绍列推荐标签：推荐=黑底白字，超级推荐=红底白字 */
.tag-rec, .tag-super { display: inline-block; margin-left: 6px; padding: 1px 8px; font-size: 12px; color: #fff; background: #1a1a1a; border-radius: 2px; vertical-align: 1px; }
.tag-super { background: #c00; }

/* 开区状态高亮：「刚开一秒」加粗加蓝（status_text 输出的 .st-open） */
.st-open { color: #1e66ff; font-weight: bold; }

/* 开区状态高亮：「等待开放」红色加粗（status_text 输出的 .st-wait） */
.st-wait { color: #e02020; font-weight: bold; }

/* 全天套黄分区版本介绍单元格加粗（仅 row-qtth 行，精品/普通分区不受影响） */
tr.row-qtth td.intro { font-weight: bold; }

.empty { color: #a99; }

/* 滚动公告（纯 CSS 单副本滚动，无任何外部资源 / JS 库）
   --notice-dur 语义：单次完整滚过（从右侧进入、完全滚出左缘）所需秒数。
   单副本循环：内容完全滚出后立即从右侧重新进入，同一时刻页面上只有一份文字。 */
.notice-bar {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  margin: 0 0 12px;
  padding: 7px 10px;
  background: #fff8e1;
  border: 1px solid #e6c874;
  border-radius: 4px;
  color: #7a4b00;
  font-weight: bold;
}
.notice-track {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;   /* 初始时内容被推到容器右缘之外，动画中从右进入 */
  animation: notice-scroll var(--notice-dur, 20s) linear infinite;
  will-change: transform;
}
.notice-bar:hover .notice-track { animation-play-state: paused; }
.notice-text { display: inline-block; padding-right: 40px; }
@keyframes notice-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }  /* 平移自身全宽（含 100% padding）→ 完全滚出左缘后从头再来 */
}

/* 顶部图片广告：块级铺满信息栏宽度，宽度 100% 等比缩放（高度自适应） */
.banner-top {
  margin: 0 0 12px;
}
.banner-top a { display: block; margin: 0 0 8px; }
.banner-top img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #d8c9a8;
  background: #fff;
}

/* 两侧悬浮图片广告（窄屏 <=1200px 隐藏） */
.banner-side {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
}
.banner-side.left  { left: 6px; }
.banner-side.right { right: 6px; }
.banner-side a { display: block; margin: 8px 0; }
.banner-side img {
  display: block;
  width: 120px;
  max-width: 120px;
  height: auto;
  border: 1px solid #d8c9a8;
  background: #fff;
}
@media (max-width: 1200px) {
  .banner-side { display: none; }
}

/* 弹窗告示（纯 vanilla JS 控制，无外部库） */
.popup-mask {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.popup-box {
  background: #fffdf5;
  border: 2px solid #4a3524;
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px #d4a017, 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 18px 20px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.popup-title {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: bold;
  color: #4a3524;
  border-bottom: 1px solid #d8c9a8;
  padding-bottom: 6px;
}
.popup-content {
  overflow-y: auto;
  font-size: 14px;
  color: #2b2118;
  line-height: 1.7;
  word-break: break-word;
}
.popup-box button {
  margin-top: 12px;
  align-self: flex-end;
  background: #f26a1b;
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 4px;
  padding: 6px 22px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.popup-box button:hover { background: #d9550f; }
