/* 首页版式：完全对齐 B 站 2009 纪念版（除商标外）
   结构：130px logo 头图 → 35px 导航 → 40px 公告/搜索 → 955px 双栏 → 页脚

   顺手留一句给读样式表的人：
   2009 年做页面，没有 grid 也没有 flex，靠的是 float 和一句“应该差不多”。
   这段注释不会影响任何像素，就像当年那些没人看的签名档一样。 */

body.index {
  background: #fff;
  color: #333;
  font-family: Tahoma, "SimSun", "宋体", Arial, sans-serif;
}

/* 纪念版所有尺寸按含边框/内边距计算，避免通栏被 padding 撑宽 */
.mkf-h2009,
.mkf-nav-top,
.mkf-nav-bottom,
.mkf-nav-bottom-inner,
.mkf-home2009,
.mkf-home-main,
.mkf-home-side,
.mkf-home-message,
.mkf-home-new,
.mkf-footer-inner,
.mkf-search-box,
.mkf-search-sel,
.mkf-search-btn {
  box-sizing: border-box;
}

/* ---------- 头部：仅保留本站 Logo ---------- */
.mkf-h2009 {
  width: 1000px;
  height: 130px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mkf-h2009 .mkf-logo2009 { display: block; }
.mkf-h2009 .mkf-logo2009 img { display: block; height: 130px; width: auto; }
.mkf-hlinks { display: flex; align-items: center; font-size: 12px; color: #999; }
.mkf-hlinks a { color: #666; text-decoration: none; margin-left: 12px; }
.mkf-hlinks a:hover { color: #1f6fd0; text-decoration: underline; }

/* 顶部登录区：未登录只有「登录」，登录后显示头像 + 用户名 */
.mkf-userbox { display: inline-flex; align-items: center; }
.mkf-userbox .mkf-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  text-decoration: none;
}
.mkf-userbox .mkf-user img {
  display: block;
  width: 26px;
  height: 26px;
  border: 1px solid #c5c5c5;
  border-radius: 3px;
  object-fit: cover;
  background: #e3ecda;
}
.mkf-userbox .mkf-user-name {
  max-width: 110px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #666;
}
.mkf-userbox .mkf-user:hover .mkf-user-name { color: #1f6fd0; text-decoration: underline; }
.mkf-userbox .mkf-admin-link {
  margin-left: 10px;
  padding: 2px 8px;
  border: 1px solid #c5ddbc;
  background: #f7fcf3;
  color: #5c8a3e;
  font-size: 12px;
  text-decoration: none;
}
.mkf-userbox .mkf-admin-link:hover { border-color: #5c8a3e; color: #2f5d1e; }

/* ---------- 导航第一行：35px ---------- */
.mkf-nav-top {
  height: 35px;
  line-height: 32px;
  background: #f5f5f5;
  border: solid 1px #dadada;
  box-shadow: 0 0 5.5px 0.5px #bfbfbf;
}
.mkf-nav-list {
  display: flex;
  width: 955px;
  margin: 0 auto;
  list-style: none;
  font-size: 15px;
}
.mkf-nav-list li { margin-right: 37px; }
.mkf-nav-list li a { color: #333; text-decoration: none; }
.mkf-nav-list li a:hover { color: #1f6fd0; }
.mkf-nav-list li.active a { color: #000; }
.mkf-nav-list li.bangumi a { animation: mkf-bangumi-color 3s linear infinite; }
@keyframes mkf-bangumi-color {
  0% { color: #333; }
  50% { color: #e07b53; }
  100% { color: #333; }
}

/* ---------- 导航第二行：公告 + 搜索，40px ---------- */
.mkf-nav-bottom {
  height: 40px;
  line-height: 40px;
  background: #f7f7f7;
  border: solid 1px #cecece;
}
.mkf-nav-bottom-inner {
  position: relative;
  width: 955px;
  margin: 0 auto;
  padding-left: 70px;
  padding-right: 420px;
  background: url(/templets/images/b2009/notice-badge.png) left center no-repeat;
  font-size: 12px;
}
.mkf-notice-text {
  margin: 0;
  color: #9a9a9a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mkf-search2009 {
  position: absolute;
  right: 0;
  top: 5px;
  display: flex;
  align-items: center;
  height: 29px;
}
.mkf-search-box {
  display: flex;
  align-items: center;
  width: 245px;
  height: 29px;
  padding: 0 8px;
  background: #fff;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
}
.mkf-search-ico {
  position: relative;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin-right: 6px;
}
.mkf-search-ico::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  border: 2px solid #2b6cb0;
  border-radius: 50%;
}
.mkf-search-ico::after {
  content: '';
  position: absolute;
  right: 1px;
  bottom: 2px;
  width: 6px;
  height: 2px;
  background: #2b6cb0;
  transform: rotate(45deg);
}
.mkf-search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: #333;
}
.mkf-search-box input::placeholder { color: #1f6fd0; font-weight: bold; }
.mkf-search-sel {
  width: 92px;
  height: 29px;
  margin-left: 6px;
  padding: 0 4px;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  color: #333;
}
.mkf-search-btn {
  width: 64px;
  height: 29px;
  margin-left: 6px;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  font-family: inherit;
}
.mkf-search-btn:hover { background: #f0f0f0; }

/* ---------- 主体双栏：955px ---------- */
.mkf-home2009 {
  width: 955px;
  margin: 15px auto 0;
  display: flex;
}
.mkf-home-main {
  flex: 0 0 678px;
  width: 678px;
  min-height: 300px;
  margin-right: 23px;
  padding-top: 48px;
  background: url(/templets/images/b2009/home-strip-pc.png) center top no-repeat;
}
.mkf-home-list {
  display: grid;
  grid-template-columns: repeat(5, 121px);
  column-gap: 18px;
  row-gap: 17px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.mkf-home-list li {
  width: 121px;
  height: auto;
  padding-left: 0;
  float: none;
  overflow: visible;
  box-sizing: border-box;
  font-size: 12px;
  line-height: 14px;
  color: #a5a5a5;
}
.mkf-home-list li a { display: block; color: #a5a5a5; text-decoration: none; }
.mkf-home-list li a:hover { color: #777; }
.mkf-home-list li i {
  position: relative;
  display: block;
  width: 100%;
  height: 75px;
  background: #ccc center / cover no-repeat;
  font-style: normal;
}
.mkf-home-list li img {
  display: block;
  width: 100%;
  height: 75px;
  object-fit: cover;
}
.mkf-home-list li p {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 15px;
  max-height: 30px;
  overflow: hidden;
}
.mkf-home-list .mkf-v {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 0 4px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 11px;
  line-height: 15px;
}

/* 分区图正下方的「换一换」：整颗按钮直接用 2009 怀旧站原版 PNG，图上自带文字 */
.mkf-feed-head {
  margin: 0 0 10px;
  text-align: right;
}
.mkf-feed-refresh {
  display: inline-block;
  width: 109.55px;
  height: 30px;
  background: url(/templets/images/b2009/pager-normal.png) center / 100% 100% no-repeat;
  border: 0;
  border-radius: 2px;
  vertical-align: top;
  cursor: pointer;
}
.mkf-feed-refresh:hover,
.mkf-feed-refresh:focus {
  background-image: url(/templets/images/b2009/pager-active.png);
}
.mkf-feed-sentinel { height: 1px; overflow: hidden; }

/* 右栏：继续观看（有本地播放记录才显示，沿用 2009 灰盒） */
.mkf-home-continue {
  margin: 0 0 9px;
  border: 1px solid #c2c2c2;
  border-radius: 0;
  background: #fff;
}
.mkf-home-continue h3 {
  margin: 0;
  padding: 0 8px;
  height: 22px;
  line-height: 22px;
  background: #e7e7e7;
  border-bottom: 1px solid #c2c2c2;
  color: #666;
  font-size: 12px;
  font-weight: bold;
}
.mkf-home-continue ul {
  list-style: none;
  margin: 0;
  padding: 6px 8px;
}
.mkf-home-continue li { margin: 0 0 7px; }
.mkf-home-continue li:last-child { margin-bottom: 0; }
.mkf-home-continue a {
  display: flex;
  gap: 7px;
  text-decoration: none;
  color: #333;
}
.mkf-home-continue i {
  position: relative;
  display: block;
  flex: none;
  width: 62px;
  height: 40px;
  border: 1px solid #c2c2c2;
  background: #f2f2f2 center / cover no-repeat;
}
.mkf-continue-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(0, 0, 0, .35);
}
.mkf-continue-bar em {
  display: block;
  height: 100%;
  background: #4dadff;
}
.mkf-continue-txt { min-width: 0; flex: 1; }
.mkf-home-continue p {
  margin: 0;
  font-size: 12px;
  line-height: 16px;
  max-height: 32px;
  overflow: hidden;
  color: #333;
}
.mkf-home-continue small { color: #999; font-size: 11px; }
.mkf-home-continue a:hover p { color: #3366CC; }

/* ---------- 数字分页：21×17 小方块（对照 2009 怀旧站） ---------- */
.mkf-home-paging {
  margin-top: 6px;
  text-align: right;
  font-size: 0;
  line-height: 0;
}
.mkf-home-paging-item {
  display: inline-block;
  width: 21px;
  height: 17px;
  margin-left: 7px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: #e7e7e7;
  color: #838383;
  font: 12px/17px Tahoma, Verdana, Arial, sans-serif;
  text-align: center;
  cursor: pointer;
}
.mkf-home-paging-item:hover { background: #dcdcdc; }
.mkf-home-paging-item.active,
.mkf-home-paging-item.active:hover { background: #4dadff; color: #fff; }
.mkf-home-paging-item:active { transform: translateY(1px); }

/* ---------- 右栏：254px ---------- */
.mkf-home-side {
  position: sticky;
  top: 12px;
  align-self: flex-start;
  flex: 0 0 254px;
  width: 254px;
}
.mkf-home-message {
  display: block;
  position: relative;
  box-sizing: border-box;
  width: 254px;
  height: 46px;
  background: linear-gradient(#fdfdfd, #ececec 55%, #e2e2e2);
  border: 1px solid #d6d6d6;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0, 0, 0, .12);
  text-decoration: none;
}
.mkf-msg-text {
  display: block;
  text-align: center;
  font: 700 17px/44px "Microsoft YaHei", "微软雅黑", Tahoma, sans-serif;
  color: #8e8e8e;
  letter-spacing: 1px;
  text-shadow: 0 1px 0 #fff, 0 0 2px #fff;
  white-space: nowrap;
}
.mkf-home-message:hover .mkf-msg-text { color: #6f6f6f; }
/* 右上角未读数 */
.mkf-msg-badge {
  position: absolute;
  right: 4px;
  top: 4px;
  display: none;
  min-width: 15px;
  height: 15px;
  padding: 0 2px;
  background: #ff0000;
  color: #fff;
  font: 700 9px/15px Arial, Tahoma, sans-serif;
  text-align: center;
  border-radius: 8px;
  box-sizing: border-box;
}
.mkf-home-new {
  margin-top: 9px;
  width: 254px;
  padding: 52px 10px 12px 11px;
  border: 1px solid #c2c2c2;
  border-radius: 0;
  background: url(/templets/images/b2009/side-new-title.png) left 15px top 15px no-repeat;
}
.mkf-home-new ul { list-style: none; margin: 0; padding: 0; }
.mkf-home-new li {
  margin: 0;
  font-size: 12px;
  line-height: 27px;
  color: #a5a5a5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mkf-home-new li a { color: #a5a5a5; text-decoration: none; }
.mkf-home-new li a:hover { color: #777; }

/* ---------- 页脚 ---------- */
.mkf-footer2009 {
  margin-top: 30px;
  border-top: 1px solid #e2e2e2;
  background: #f7f7f7;
}
.mkf-footer-inner {
  width: 1000px;
  margin: 0 auto;
  padding: 20px 0 30px;
  font-size: 12px;
  line-height: 2;
  color: #a5a5a5;
}
.mkf-footer-inner a { color: #999; text-decoration: none; }
.mkf-footer-inner a:hover { color: #4dadff; }
.mkf-footer-inner .copyright {
  margin: 0 0 2px;
  color: #7f8a79;
  letter-spacing: .3px;
}
.mkf-footer-inner .copyright #mkf-saying { cursor: pointer; }
.mkf-footer-inner .copyright #mkf-saying:hover { color: #4d7a3c; }
.mkf-footer-inner .mkf-foot-note { margin: 0 0 2px; color: #b0b0b0; }
.mkf-footer-inner .mkf-foot-links { margin: 0; }

/* 彩蛋提示条（2009 的灰盒样式） */
.mkf-egg {
  position: fixed;
  left: 50%;
  bottom: 76px;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid #c2c2c2;
  box-shadow: 2px 2px 0 #e6e6e6;
  color: #666;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
  z-index: 10060;
}
.mkf-egg b { color: #4dadff; font-weight: normal; }

/* ---------- 响应式 ---------- */
@media (max-width: 1010px) {
  .mkf-h2009,
  .mkf-nav-list,
  .mkf-nav-bottom-inner,
  .mkf-home2009,
  .mkf-footer-inner {
    width: auto;
    max-width: none;
    padding-left: 10px;
    padding-right: 10px;
    box-sizing: border-box;
  }
  .mkf-nav-bottom-inner { padding-right: 440px; }
}

/* 双栏放不下时，右栏上移到视频流前方，避免被无限下拉淹没 */
@media (max-width: 980px) {
  .mkf-home2009 { display: flex; flex-direction: column; }
  .mkf-home-main {
    width: auto;
    flex: none;
    margin-right: 0;
    padding-top: 46px;
    background-size: 680px 37px;
    background-position: left top;
  }
  .mkf-home-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 14px;
    row-gap: 16px;
  }
  .mkf-home-list li { width: auto; }
  .mkf-home-list li i { height: auto; aspect-ratio: 121 / 75; }
  .mkf-home-list li img { height: auto; aspect-ratio: 121 / 75; }
  .mkf-home-side {
    order: 1;
    position: static;
    align-self: stretch;
    width: auto;
    flex: none;
    margin: 0 0 18px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
  }
  .mkf-home-message { flex: 0 0 254px; }
  .mkf-home-new { flex: 1 1 auto; width: auto; min-width: 0; }
}

@media (max-width: 820px) {
  .mkf-h2009 { height: 92px; }
  .mkf-h2009 .mkf-logo2009 img { height: 76px; }
  .mkf-hlinks a { margin-left: 8px; }
  .mkf-nav-list { font-size: 14px; overflow-x: auto; }
  .mkf-nav-list li { margin-right: 24px; flex: 0 0 auto; }
  .mkf-nav-list li a { display: inline-block; padding: 7px 0; }
  .mkf-nav-bottom { height: auto; line-height: normal; padding: 6px 0; }
  .mkf-nav-bottom-inner { padding: 4px 10px; }
  .mkf-notice-text { white-space: normal; padding-right: 0; }
  .mkf-search2009 { position: static; height: auto; margin-top: 6px; flex-wrap: wrap; }
  .mkf-search-box { flex: 1 1 220px; width: auto; }
  .mkf-home-list { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 10px; row-gap: 14px; }
  .mkf-footer-inner a { display: inline-block; padding: 4px 0; }
}

@media (max-width: 480px) {
  .mkf-h2009 { height: 84px; }
  .mkf-h2009 .mkf-logo2009 img { height: 68px; }
  .mkf-hlinks > a { display: none; }
  .mkf-userbox .mkf-user { margin-left: 0; }
  .mkf-home-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; }
  .mkf-home-list li p { margin-top: 4px; }
  .mkf-home-side { display: block; }
  .mkf-home-message { width: 100%; margin-bottom: 12px; }
  .mkf-home-new { width: 100%; }
  .mkf-home-paging { text-align: center; margin: 12px 0 4px; }
}

/* 手机端固定底栏会挡住页脚，留出安全距离（含 iPhone 底部横条） */
@media (max-width: 768px) {
  .mkf-footer2009 { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
