/* Milkgrey Games 站点样式 —— 贴纸风：奶白底、墨黑粗边、硬投影、柠檬黄强调。游戏外壳样式在 kit.js。 */
:root {
  --milk: #fffdf7;
  --ink: #1f1b24;
  --grey: #6e7380;
  --grey-2: #a9aeb9;
  --lemon: #ffd23f;
  --pink: #ff8fa3;
  --sky: #8fd3ff;
  --mint: #7ee0b5;
  --line: 3px solid var(--ink);
  --pop: 5px 5px 0 var(--ink);
  --head: "Fredoka", "ZCOOL KuaiLe", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--milk); }
body {
  margin: 0; color: var(--ink); font: 16px/1.6 var(--body);
  background-color: var(--milk);
  background-image: radial-gradient(#ece6d6 2.2px, transparent 2.6px);
  background-size: 26px 26px;
}
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3, .head { font-family: var(--head); font-weight: 700; }

/* 贴纸通用 */
.sticker { background: #fff; border: var(--line); border-radius: 18px; box-shadow: var(--pop); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 18px; font: 700 1rem/1 var(--head); color: var(--ink);
  background: var(--lemon); border: var(--line); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink); text-decoration: none; cursor: pointer; transition: transform .08s, box-shadow .08s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.plain { background: #fff; }
.btn svg { width: 18px; height: 18px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: #fff; border: var(--line); border-radius: 12px; }
.seg button { padding: 5px 11px; font: 700 .9rem/1.2 var(--head); color: var(--ink); background: none; border: 0; border-radius: 8px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--lemon); }
.tape { display: inline-block; margin: 0 0 14px; padding: 4px 14px; font: 700 1rem/1.3 var(--head); background: var(--sky); border: var(--line); border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink); transform: rotate(-1.5deg); }
.tape.pink { background: var(--pink); }
.tape.mint { background: var(--mint); }
.tape.lemon { background: var(--lemon); }

/* 导航 */
.nav { padding: 14px 0; }
.nav .wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font: 700 1.3rem/1 var(--head); text-decoration: none; }
.brand img { width: 44px; height: 44px; border-radius: 50%; border: var(--line); }
.brand .g { color: var(--grey); }
.brand small { font: 700 .85rem/1 "ZCOOL KuaiLe", var(--head); color: var(--grey); }
.nav .sp { flex: 1; }
.nav .links { display: flex; gap: 6px; }
.nav .links a { padding: 6px 10px; font: 700 .95rem/1 var(--head); text-decoration: none; border-radius: 10px; }
.nav .links a:hover, .nav .links a[aria-current="page"] { background: var(--lemon); outline: var(--line); }
@media (max-width: 480px) {
  .nav .wrap { gap: 6px; flex-wrap: nowrap; }
  .brand { font-size: 1.1rem; gap: 6px; }
  .brand img { width: 38px; height: 38px; }
  .brand small { display: none; }
  .nav .links a { padding: 6px 6px; font-size: .88rem; }
  .seg button { padding: 5px 8px; }
}

/* 首页横幅 */
.hero { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: clamp(16px, 4vw, 36px); margin: 10px 0 34px;
  padding: clamp(18px, 4vw, 34px); background: var(--lemon); border: var(--line); border-radius: 28px; box-shadow: 8px 8px 0 var(--ink); }
.hero img { width: clamp(100px, 24vw, 190px); aspect-ratio: 1; border-radius: 50%; border: var(--line); box-shadow: 4px 4px 0 var(--ink); transform: rotate(-4deg); background: #fff; }
.hero h1 { margin: 0 0 6px; font-size: clamp(1.45rem, 5.6vw, 2.7rem); line-height: 1.15; }
.hero p { margin: 0 0 14px; font-size: clamp(.92rem, 3.4vw, 1.12rem); }
.hero .stat { display: inline-block; padding: 3px 10px; font: 700 .9rem/1.4 var(--head); background: #fff; border: 2px solid var(--ink); border-radius: 99px; }

/* 最新大卡片 */
.feature { display: grid; grid-template-columns: minmax(120px, min(40%, 330px)) 1fr; gap: clamp(14px, 3vw, 28px); align-items: center; padding: 12px; margin-bottom: 36px; text-decoration: none; }
.feature img { width: 100%; aspect-ratio: 1; object-fit: cover; border: var(--line); border-radius: 14px; }
.feature h2 { margin: 0 0 4px; font-size: clamp(1.3rem, 4.8vw, 2.1rem); line-height: 1.15; }
.feature p { margin: 0 0 14px; font-size: clamp(.86rem, 3.2vw, 1.05rem); color: #3b3642; }

/* 书架 */
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.tools .sp { flex: 1; }
.shelf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (min-width: 720px) { .shelf { grid-template-columns: repeat(3, 1fr); } }
.cols .shelf { grid-template-columns: repeat(2, 1fr); }
.shelf > li:nth-child(3n+1) .card { transform: rotate(-.8deg); }
.shelf > li:nth-child(3n+2) .card { transform: rotate(.6deg); }
.card { display: block; height: 100%; padding: 8px 8px 12px; text-decoration: none; transition: transform .12s; }
.card:hover { transform: translate(-2px, -2px) rotate(0) !important; box-shadow: 7px 7px 0 var(--ink); }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 2px solid var(--ink); border-radius: 12px; }
.card h3 { margin: 10px 4px 2px; font-size: 1.08rem; line-height: 1.25; }
.card p { margin: 0 4px; font-size: .8rem; line-height: 1.45; color: #4a4552; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 4px 0; font: 700 .72rem/1.6 var(--head); }
.chip { padding: 0 8px; border: 2px solid var(--ink); border-radius: 99px; background: #fff; }
.chip.new { background: var(--pink); }
.chip.hot { background: var(--lemon); }
.soon { display: grid; place-items: center; min-height: 160px; height: 100%; padding: 18px; text-align: center; font: 700 .95rem/1.5 var(--head); color: var(--grey);
  border: 3px dashed var(--grey-2); border-radius: 18px; }

/* 最近玩过 */
.recent { display: flex; gap: 10px; overflow-x: auto; margin: 0 0 30px; padding: 2px 6px 8px 2px; list-style: none; }
.recent a { display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; white-space: nowrap; text-decoration: none; font: 700 .9rem/1 var(--head);
  background: #fff; border: var(--line); border-radius: 99px; box-shadow: 3px 3px 0 var(--ink); }
.recent img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ink); }

/* 首页两栏：书架 + 排行 */
.cols { display: grid; gap: 30px; }
@media (min-width: 900px) { .cols { grid-template-columns: 1fr 300px; align-items: start; } }

/* 排行榜表 */
.board { padding: 12px 14px; }
.board ol { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.board li { counter-increment: r; display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 2px dashed #e7e1d4; font-weight: 600; }
.board li:last-child { border-bottom: 0; }
.board li::before { content: counter(r); flex: none; width: 28px; height: 28px; display: grid; place-items: center; font: 700 .9rem/1 var(--head);
  border: 2px solid var(--ink); border-radius: 50%; background: #fff; }
.board li:nth-child(1)::before { background: var(--lemon); }
.board li:nth-child(2)::before { background: #e8e8ee; }
.board li:nth-child(3)::before { background: #f2c9a5; }
.board li.me { background: #fff6cc; border-radius: 10px; }
.board .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .v { font: 700 1rem/1 var(--head); }
.board .empty, .board .off { padding: 14px 4px; color: var(--grey); text-align: center; font-weight: 600; }
.board .more { display: inline-block; margin-top: 8px; font: 700 .9rem/1 var(--head); }

/* 广告位 */
.ad-home { display: flex; justify-content: center; margin: 0 0 30px; }
.ad-home:empty { display: none; }
.mg-ad { box-sizing: border-box; width: min(100%, 728px); padding: 4px 8px 8px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; }
.mg-ad small { display: block; font: 11px/1.5 system-ui, sans-serif; color: #889; }
.mg-ad-ph { background: repeating-linear-gradient(45deg, #f1f1f1 0 8px, #e4e4ea 8px 16px); }
.mg-ad:has(ins[data-ad-status="unfilled"]) { display: none; }

/* 个人战绩 */
.me-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px; margin-bottom: 26px; }
.me-head img { width: 72px; height: 72px; border-radius: 50%; border: var(--line); }
.me-head .who { flex: 1; min-width: 180px; }
.me-head h1 { margin: 0 0 6px; font-size: 1.6rem; }
.me-head input { width: min(100%, 220px); height: 38px; padding: 0 10px; font: 600 1rem var(--body); border: var(--line); border-radius: 10px; }
.nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin-bottom: 30px; }
.num { padding: 12px 14px; }
.num b { display: block; font: 700 1.8rem/1.1 var(--head); }
.num span { font-size: .85rem; color: var(--grey); font-weight: 600; }
.mine { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mine li { display: grid; grid-template-columns: 56px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; }
.mine img { width: 56px; height: 56px; border-radius: 10px; border: 2px solid var(--ink); }
.mine h3 { margin: 0; font-size: 1.05rem; }
.mine a { text-decoration: none; }
.mine small { color: var(--grey); font-weight: 600; }
.mine .best { text-align: right; font: 700 1.2rem/1.2 var(--head); }

/* 排行榜页 */
.rank-tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.rank-tools select { height: 40px; padding: 0 10px; font: 700 .95rem var(--head); color: var(--ink); border: var(--line); border-radius: 12px; background: #fff; box-shadow: 3px 3px 0 var(--ink); }

/* 页脚 */
.foot { margin-top: 64px; padding: 22px 0 44px; border-top: var(--line); background: var(--milk); font: 600 .9rem/1.6 var(--body); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.foot nav { display: flex; gap: 14px; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* 文字页 */
.doc { max-width: 720px; margin: 16px auto; padding: clamp(18px, 5vw, 40px); }
.doc h1 { margin-top: 0; font-size: 1.7rem; }
.doc h1 small { display: block; font-size: .55em; color: var(--grey); }
.doc h2 { margin-top: 1.8em; font-size: 1.15rem; }
.mine li:has(.soon) { display: block; padding: 0; }
