/* 像素风云 —— 手机优先深色主题（配色跟 App 图标一套） */

:root {
  --bg:      #12151F;
  --surface: #1C2130;
  --surface2:#232A3C;
  --line:    #2E3650;
  --text:    #E8ECF5;
  --muted:   #8A93A8;
  --gold:    #F0B429;
  --gold-dim:#8A6512;
  --purple:  #7B4CE0;
  --danger:  #E5534B;
  --ok:      #3FB950;
  --radius:  14px;
  --topbar:  54px;
  --tabbar:  58px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* ★★ 必须的：只要给某个类写了 display:flex/block，它的优先级就【压过】浏览器默认的
   [hidden]{display:none} ⇒ 带 hidden 的元素照样显示。全屏浮层就栽在这上面
   （.overlay 写了 display:flex，结果三个浮层一直盖在首页上）。这条兜住全局。 */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, "PingFang SC", "Noto Sans CJK SC",
        "Microsoft YaHei", system-ui, sans-serif;
  overscroll-behavior-y: none;
}
input, textarea, button { font-family: inherit; }

/* ============================================================ 顶栏 */

#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--topbar);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; padding-top: env(safe-area-inset-top);
  background: linear-gradient(180deg, #1A1F2E, #161A26);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: .5px; }
.logo  { color: var(--gold); font-size: 19px; }
.icon-btn {
  background: none; border: 1px solid var(--line); color: var(--muted);
  width: 34px; height: 34px; border-radius: 10px; font-size: 17px;
  cursor: pointer; line-height: 1; flex: 0 0 auto;
}
.icon-btn:active { background: var(--surface2); }

/* ============================================================ 主体 */

#main {
  padding: calc(var(--topbar) + env(safe-area-inset-top) + 10px) 12px
           calc(var(--tabbar) + env(safe-area-inset-bottom) + 14px);
  min-height: 100vh;
}
.page { animation: fade .16s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* ============================================================ 卡片 / 通用 */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.card h2 { margin: 0 0 6px; font-size: 17px; }
.card h3 { margin: 0 0 8px; font-size: 15px; color: var(--gold); }
.card.subtle { background: var(--surface2); }
.card p { margin: 6px 0; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 0; }
.row .k { color: var(--muted); font-size: 14px; }
.row .v { font-weight: 600; font-size: 14px; text-align: right; }
.muted { color: var(--muted); font-size: 13px; }
.loading { color: var(--muted); text-align: center; padding: 26px 0; font-size: 14px; }
.msg { margin-top: 10px; padding: 9px 11px; border-radius: 9px; font-size: 13.5px; }
.msg.ok  { background: rgba(63,185,80,.13); color: var(--ok); border: 1px solid rgba(63,185,80,.35); }
.msg.bad { background: rgba(229,83,75,.13); color: var(--danger); border: 1px solid rgba(229,83,75,.35); }
.plain { white-space: pre-wrap; word-break: break-word; font-size: 14.5px; line-height: 1.85; }

/* ============================================================ 表单 */

label { display: block; margin: 12px 0; font-size: 13px; color: var(--muted); }
/* 「注册必填」这种小角标 */
label .req {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px;
  font-size: 10.5px; font-weight: 600;
  background: rgba(240,180,41,.18); color: var(--gold); border: 1px solid var(--gold-dim);
}
input[type=text], input[type=password], input[type=search], textarea {
  display: block; width: 100%; margin-top: 6px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; font-size: 15px;
}
input:focus, textarea:focus { outline: none; border-color: var(--gold-dim); }

button.primary, button.ghost {
  display: block; width: 100%; margin-top: 12px;
  padding: 13px; border-radius: 11px; font-size: 15.5px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent;
}
button.primary { background: var(--gold); color: #241A02; }
button.primary:active { background: #d29c1c; }
button.primary:disabled { opacity: .5; }
button.ghost { background: none; color: var(--muted); border-color: var(--line); }
button.ghost:active { background: var(--surface2); }
button.ghost.danger { color: var(--danger); border-color: rgba(229,83,75,.4); }

/* ============================================================ 首页 · 搜索 */

.home-search { display: flex; gap: 9px; margin-bottom: 12px; }
.home-search input {
  margin: 0; flex: 1 1 auto; min-width: 0;
  border-radius: 22px; padding: 11px 16px;
  background: var(--surface);
}
.compose-btn {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
  background: var(--gold); color: #241A02; border: none;
  font-size: 18px; cursor: pointer; line-height: 1;
}
.compose-btn:active { background: #d29c1c; }

/* ============================================================ 首页 · 轮播 */

.banner {
  position: relative; border-radius: var(--radius); overflow: hidden;
  min-height: 132px; margin-bottom: 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px 16px;
  background: linear-gradient(135deg, #2A3F6E, #4A2E6E 55%, #6E2E52);
  border: 1px solid var(--line);
  background-size: cover; background-position: center;
}
.banner h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: 1px; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.banner p  { margin: 6px 0 0; font-size: 13px; color: #E4E9F5; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.banner .dots { position: absolute; bottom: 8px; right: 12px; display: flex; gap: 5px; }
.banner .dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.35); }
.banner .dot.on { background: #fff; width: 14px; border-radius: 3px; }

/* ============================================================ 首页 · 数据 + 公告 */

.stat-row { display: flex; gap: 10px; margin-bottom: 12px; align-items: stretch; }
.stat-box {
  flex: 0 0 128px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 12px;
}
.stat-line { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.stat-line .k { color: var(--muted); font-size: 12.5px; }
.stat-line .v { font-weight: 700; font-size: 16px; color: var(--gold); }
.notice {
  flex: 1 1 auto; min-width: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 12px; display: flex; align-items: center;
}
.notice span {
  font-size: 13.5px; color: #C8D0E2; white-space: nowrap;
  animation: scrollx 22s linear infinite;
}
@keyframes scrollx {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* ============================================================ 首页 · 五宫格 */

.grid5 { display: flex; gap: 4px; margin-bottom: 14px; }
.grid5 .g {
  flex: 1 1 0; min-width: 0; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 4px 0;
}
.grid5 .g:active { opacity: .6; }
.grid5 .gi {
  width: 48px; height: 48px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
  background: linear-gradient(140deg, #F0B429, #E0813A);
}
.grid5 .g:nth-child(2) .gi { background: linear-gradient(140deg, #4C8BF5, #3A5FD9); }
.grid5 .g:nth-child(3) .gi { background: linear-gradient(140deg, #9B7BF0, #6D4BD0); }
.grid5 .g:nth-child(4) .gi { background: linear-gradient(140deg, #6DB0F5, #4A7BE0); }
.grid5 .g:nth-child(5) .gi { background: linear-gradient(140deg, #4FD0A8, #2E9E7C); }
.grid5 .gl { font-size: 11.5px; color: #B9C2D6; text-align: center; line-height: 1.25; }

/* ============================================================ 首页 · 签到积分 */

.checkin {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(135deg, #3A2A5C, #26365E);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 14px;
}
.ck-label  { font-size: 12.5px; color: #B9C2D6; }
.ck-num    { font-size: 30px; font-weight: 800; color: var(--gold); line-height: 1.15; }
.ck-streak { font-size: 12px; color: #A9B2C6; margin-top: 3px; }
.ck-right  { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; flex: 0 0 auto; }
.ck-dots   { display: flex; gap: 4px; }
.ck-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.22); }
.ck-dots i.on { background: var(--gold); }
.ck-btn {
  padding: 10px 22px; border-radius: 20px; border: none; cursor: pointer;
  background: var(--gold); color: #241A02; font-size: 15px; font-weight: 700;
}
.ck-btn:active { background: #d29c1c; }
.ck-btn:disabled { background: rgba(255,255,255,.14); color: #8A93A8; }

.pt-rules { font-size: 13px; color: #B9C2D6; line-height: 1.9; }
.pt-rules b { color: var(--gold); }
.pt-log .li { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.pt-log .li:last-child { border-bottom: none; }
.pt-log .l1 { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.pt-log .w { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
             white-space: nowrap; color: #B9C2D6; }
.pt-log .t { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.pt-log .d { font-weight: 700; white-space: nowrap; }
.pt-log .d.plus  { color: var(--ok); }
.pt-log .d.minus { color: var(--danger); }

/* ============================================================ 首页 · 分类 + 帖子 */

.tabs3 { display: flex; gap: 22px; margin: 0 2px 12px; border-bottom: 1px solid var(--line); }
.tab3 {
  background: none; border: none; cursor: pointer; padding: 9px 0 11px;
  color: var(--muted); font-size: 15px; position: relative;
}
.tab3.active { color: var(--text); font-weight: 700; }
.tab3.active::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  bottom: -1px; width: 22px; height: 3px; border-radius: 2px; background: var(--gold);
}

.feed { display: flex; flex-direction: column; gap: 10px; }

.post {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px; cursor: pointer;
}
.post:active { background: var(--surface2); }
.post.pinned { border-color: var(--gold-dim); }

.p-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px;
  background: linear-gradient(140deg, var(--gold-dim), #4A2E6E);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; color: #fff;
}
.p-name { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.p-time { font-size: 12px; color: var(--muted); margin-top: 1px; }

.lvl {
  display: inline-block; padding: 1px 7px; border-radius: 5px;
  font-size: 11px; font-weight: 600;
  background: rgba(123,76,224,.22); color: #B49BF5;
  border: 1px solid rgba(123,76,224,.45);
}
.adm {
  display: inline-block; padding: 1px 7px; border-radius: 5px;
  font-size: 11px; font-weight: 600;
  background: rgba(240,180,41,.2); color: var(--gold);
  border: 1px solid var(--gold-dim);
}
.pin-tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11px;
  background: rgba(229,83,75,.18); color: #F08078; border: 1px solid rgba(229,83,75,.4);
}
/* 没绑游戏ID 的账号 —— 能发言，只是标一下 */
.unbound {
  display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11px;
  font-weight: 600; background: rgba(138,147,168,.16); color: var(--muted);
  border: 1px solid var(--line);
}

.p-title { font-size: 16px; font-weight: 700; line-height: 1.4; margin-bottom: 5px; word-break: break-word; }
.p-body {
  font-size: 14px; color: #B9C2D6; line-height: 1.6; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.p-foot {
  display: flex; gap: 18px; margin-top: 11px; padding-top: 9px;
  border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted);
}
.p-foot span { display: flex; align-items: center; gap: 4px; }
.p-foot .liked { color: var(--danger); }

/* ============================================================ 掉落表 */

.searchbar { margin-bottom: 10px; }
.searchbar input { margin: 0; }
.tabs2 { display: flex; gap: 8px; margin-bottom: 10px; }
.tab2 {
  flex: 1; padding: 9px; border-radius: 10px; font-size: 14px; cursor: pointer;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--line);
}
.tab2.active { background: rgba(240,180,41,.14); color: var(--gold); border-color: var(--gold-dim); font-weight: 600; }

.list { display: flex; flex-direction: column; gap: 9px; }
.mob { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.mob-head { display: flex; align-items: center; gap: 10px; padding: 12px 13px; cursor: pointer; }
.mob-head:active { background: var(--surface2); }
.mob-name { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; }
.mob-sub  { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; margin-top: 2px;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mob-zone { color: var(--muted); font-size: 11.5px; background: var(--bg);
            border: 1px solid var(--line); border-radius: 20px; padding: 3px 9px; white-space: nowrap; }
.mob-arrow { color: var(--muted); transition: transform .16s; font-size: 13px; }
.mob.open .mob-arrow { transform: rotate(90deg); }
.mob-body { padding: 0 13px 12px; display: none; }
.mob.open .mob-body { display: block; }

.drop { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.drop:first-child { border-top: none; }
.drop .dn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop .did { color: var(--muted); font-size: 11px; }
.drop .w { font-size: 12.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.drop .w.eq { background: rgba(240,180,41,.16); color: var(--gold); }
.drop .w.nm { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.drop .qty { color: var(--ok); font-size: 12px; font-weight: 700; }
.hint { color: var(--muted); font-size: 12.5px; padding: 8px 2px 0; line-height: 1.6; }

/* ============================================================ 更新卡片 */

.ver-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ver-num  { font-size: 26px; font-weight: 800; color: var(--gold); letter-spacing: .5px; }
.ver-date { color: var(--muted); font-size: 12.5px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px;
         font-size: 11.5px; font-weight: 700; margin-left: 8px; vertical-align: middle; }
.badge.new  { background: rgba(240,180,41,.18); color: var(--gold); border: 1px solid var(--gold-dim); }
.badge.same { background: rgba(138,147,168,.15); color: var(--muted); border: 1px solid var(--line); }

.notes {
  white-space: pre-wrap; word-break: break-word;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px; font-size: 14px; margin: 11px 0; max-height: 42vh; overflow: auto;
}
.file { display: flex; justify-content: space-between; align-items: center;
        font-size: 13px; color: var(--muted); padding: 7px 0; border-bottom: 1px dashed var(--line); }
.file:last-child { border-bottom: none; }
.file .nm { color: var(--text); }

.prog-wrap { margin-top: 12px; }
.prog-bar { height: 8px; background: var(--bg); border-radius: 5px; overflow: hidden; border: 1px solid var(--line); }
.prog-in  { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); transition: width .18s; }
.prog-txt { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ============================================================ 群聊 */

.chat-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.chat-item { display: flex; gap: 9px; }
.chat-item.mine { flex-direction: row-reverse; }
.chat-av {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 34px;
  background: linear-gradient(140deg, var(--gold-dim), #4A2E6E);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
}
.chat-main { max-width: 74%; }
.chat-top  { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.chat-item.mine .chat-top { text-align: right; }
.chat-bub {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 12px; font-size: 14.5px;
  word-break: break-word; white-space: pre-wrap;
}
.chat-item.mine .chat-bub { background: rgba(240,180,41,.13); border-color: var(--gold-dim); }

.chat-input {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
  display: flex; gap: 8px; padding: 9px 12px;
  background: linear-gradient(180deg, rgba(18,21,31,.75), var(--bg) 40%);
  border-top: 1px solid var(--line); z-index: 15;
}
.chat-input input { margin: 0; flex: 1 1 auto; min-width: 0; }
.chat-input button {
  flex: 0 0 78px; width: 78px; margin: 0; padding: 12px;
  background: var(--gold); color: #241A02; border: none;
  border-radius: 11px; font-size: 15.5px; font-weight: 600; cursor: pointer;
}
.chat-input button:active { background: #d29c1c; }
.chat-input button:disabled { opacity: .5; }

/* ============================================================ 我的 */

.profile { display: flex; align-items: center; gap: 13px; }
.profile .avatar { width: 54px; height: 54px; flex: 0 0 54px; font-size: 23px; font-weight: 800; }
.me-name { font-weight: 700; font-size: 17px; }
.me-uid  { font-size: 12.5px; }

/* ============================================================ 底栏 */

#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: #161A26;
  border-top: 1px solid var(--line); z-index: 20;
}
.tab {
  flex: 1; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 11.5px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 0; position: relative;
}
.tab .ic { font-size: 18px; line-height: 1; }
.tab.active { color: var(--gold); }
.tab.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 2.5px; background: var(--gold); border-radius: 0 0 3px 3px;
}

/* ============================================================ 全屏浮层 */

.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: var(--bg);
  display: flex; flex-direction: column;
  animation: fade .15s ease;
}
.ov-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line); background: #161A26;
}
.ov-title { flex: 1; text-align: center; font-weight: 600; font-size: 16px; }
.ov-body { flex: 1 1 auto; overflow-y: auto; padding: 14px 14px 20px; }
.ov-foot {
  flex: 0 0 auto; display: flex; gap: 8px; padding: 9px 12px;
  padding-bottom: calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: #161A26;
}
.ov-foot input { margin: 0; flex: 1 1 auto; min-width: 0; }
.ov-foot button {
  flex: 0 0 78px; width: 78px; margin: 0; padding: 12px;
  background: var(--gold); color: #241A02; border: none; border-radius: 11px;
  font-size: 15.5px; font-weight: 600; cursor: pointer;
}

.big-input {
  margin: 0 0 12px; font-size: 17px; font-weight: 600;
  padding: 13px; border-radius: 11px;
}
.big-area {
  min-height: 38vh; font-size: 15px; line-height: 1.7;
  padding: 13px; border-radius: 11px; resize: vertical;
}

/* 帖子详情里的评论 */
.cmt { display: flex; gap: 9px; padding: 11px 0; border-top: 1px solid var(--line); }
.cmt .avatar { width: 30px; height: 30px; flex: 0 0 30px; font-size: 13px; }
.cmt-main { flex: 1; min-width: 0; }
.cmt-name { font-size: 13px; font-weight: 600; }
.cmt-time { font-size: 11.5px; color: var(--muted); }
.cmt-text { font-size: 14px; margin-top: 3px; word-break: break-word; white-space: pre-wrap; }

.detail-title { font-size: 20px; font-weight: 800; line-height: 1.4; margin: 4px 0 10px; }
.detail-body  { font-size: 15.5px; line-height: 1.85; white-space: pre-wrap; word-break: break-word; }
.detail-foot {
  display: flex; gap: 20px; padding: 14px 0; margin-top: 14px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.detail-foot .lk { cursor: pointer; }
.detail-foot .lk.liked { color: var(--danger); }
.sec-label { color: var(--muted); font-size: 13px; padding: 14px 0 4px; }

/* ============================================================ 吐司 */

#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar) + 76px);
  transform: translateX(-50%);
  background: rgba(0,0,0,.88); color: #fff;
  padding: 10px 18px; border-radius: 22px; font-size: 14px;
  max-width: 84vw; text-align: center; z-index: 90;
  animation: fade .16s ease;
}
