/* GameHub 网页版 · 品牌延续小程序配色 */
:root {
  --bg: #FDFDF1;
  --card: #FFFFFF;
  --line: #F1EDE0;
  --mint: #5E93A6;
  --mint-light: #DBEDF9;
  --mint-mid: #8FBFCF;
  --peach: #C07A4E;
  --peach-light: #FCE9DC;
  --ink: #5A4A38;
  --ink-2: #A99C85;
  --danger: #C05A5A;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* hidden 属性必须始终生效：否则 .auth-form 的 display:flex 会压过它，导致登录/注册表单同时显示 */
[hidden] { display: none !important; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

/* ---------- 登录门 ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 10px 26px rgba(160, 143, 118, .15);
  padding: 32px 28px;
}
.auth-brand { text-align: center; margin-bottom: 20px; }
.auth-brand h1 { font-size: 26px; letter-spacing: 1px; color: var(--mint); }
.brand-sub { color: var(--ink-2); font-size: 13px; margin-top: 6px; }
.brand-dot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  background: var(--peach); margin-right: 8px; vertical-align: middle;
}

.tab-row { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1; padding: 10px; border: none; border-radius: 999px;
  background: var(--peach-light); color: var(--peach);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.tab.active { background: var(--mint); color: #fff; }

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.fld {
  width: 100%; height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink);
  font-size: 14px; outline: none;
}
.fld:focus { border-color: var(--mint-mid); }
.fld.slim { width: 140px; flex: none; }

.btn {
  height: 44px; border: none; border-radius: 999px;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn.primary { background: var(--mint); color: #fff; }
.btn.primary:hover { opacity: .92; }
.btn.warn { background: var(--danger); color: #fff; }
.ghost-btn {
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink-2); font-size: 13px; cursor: pointer;
}
.ghost-btn:hover { color: var(--mint); border-color: var(--mint-mid); }

.err { color: var(--danger); font-size: 13px; min-height: 18px; }
.hint { color: var(--ink-2); font-size: 12px; line-height: 1.6; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.topbar-in {
  box-sizing: border-box; height: 56px;
  max-width: 520px; margin: 0 auto; padding: 12px 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { font-size: 18px; font-weight: 700; color: var(--mint); }
.top-right { display: flex; align-items: center; gap: 10px; }
.who { color: var(--ink-2); font-size: 13px; }

/* ---------- 大厅（排版对齐小程序首页 · 手机浏览器优先） ---------- */
.main {
  max-width: 520px; margin: 0 auto;
  padding: 16px 14px 60px;
}
/* 顶部雾蓝→奶油白渐变背景（同小程序 page 背景） */
body {
  background-color: var(--bg);
  background-image:
    linear-gradient(118deg, rgba(219, 237, 249, 0.75) 0%, rgba(219, 237, 249, 0) 52%),
    linear-gradient(180deg, #E6F2F8 0%, #F3FAFC 30%, #FDFDF1 68%, #FDFDF1 100%);
  background-repeat: no-repeat;
  background-size: 100% 380px, 100% 540px;
}

/* 问候行 + 小猫队列 */
.hello-row {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 6px 3px 14px;
}
.hi-wrap { display: flex; margin-bottom: 8px; }
.hi {
  position: relative; display: inline-flex; align-items: center;
  height: 22px; padding: 0 10px; border-radius: 999px;
  background: var(--mint-light); color: var(--mint);
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  box-shadow: 0 3px 7px rgba(94, 147, 166, .18);
}
.hi::after {
  content: ""; position: absolute; left: 16px; bottom: -4px;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 5px solid var(--mint-light);
}
.hi-dot {
  width: 6px; height: 6px; margin-right: 5px; border-radius: 50%;
  background: var(--mint); opacity: .55; flex-shrink: 0;
}
.hello-title { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: 1px; }
.hello-sub { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .5px; }
.cat-crowd { display: flex; align-items: flex-end; flex-shrink: 0; }
.cat-mini { flex-shrink: 0; }
.cat-mini.m1 { width: 44px; height: 44px; margin-right: -2px; transform: rotate(-6deg); }
.cat-mini.m2 { width: 38px; height: 38px; margin-right: -1px; transform: rotate(5deg) translateY(1px); }
.cat { width: 84px; height: 84px; flex-shrink: 0; transform: rotate(3deg); }

/* 统计条 */
.stats {
  position: relative; display: flex;
  background: var(--card); border-radius: 18px; padding: 14px 5px;
  box-shadow: 0 5px 14px rgba(160, 143, 118, .14);
  margin-bottom: 18px;
}
.stats .cell { flex: 1; text-align: center; }
.stats .cell + .cell { border-left: 1px solid var(--line); }
.stats .num { font-size: 17px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.stats .unit { font-size: 10px; font-weight: 700; color: var(--ink-2); margin-left: 1px; }
.stats .lbl { margin-top: 4px; font-size: 10px; color: var(--ink-2); }

/* 分类胶囊 */
.chips {
  position: sticky; top: 56px; z-index: 35;
  display: flex; gap: 9px;
  margin: 0 -14px 15px; padding: 10px 14px 8px;
  background: rgba(252, 254, 253, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(241, 237, 224, .7);
}
.chip {
  flex: 1; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--card); border: 1px solid var(--line);
  font-size: 13px; font-weight: 700; color: #7A6A52;
  box-shadow: 0 3px 8px rgba(160, 143, 118, .1);
  cursor: pointer; transition: all .12s ease;
}
.chip.on {
  background: var(--mint); border-color: var(--mint); color: #fff;
  box-shadow: 0 4px 10px rgba(94, 147, 166, .3);
}

/* 分区标题（居中 + 两侧短饰线） */
.sec-title { display: flex; justify-content: center; align-items: center; margin: 0 3px 10px; }
.sec-title text { font-size: 14px; font-weight: 800; color: #7A6A52; letter-spacing: 1px; }
.sec-line { width: 26px; height: 1px; margin: 0 9px; border-radius: 1px; background: #E3DCCB; }

/* 游戏网格（双列海报卡，图 2:1） */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.gcard {
  background: var(--card); border-radius: 16px; overflow: hidden;
  box-shadow: 0 5px 13px rgba(160, 143, 118, .15);
  cursor: pointer; transition: transform .12s ease;
}
.gcard:active { transform: scale(.97); }
.gcard .art {
  width: 100%; aspect-ratio: 2 / 1; object-fit: cover;
  display: block; background: var(--bg);
}
.gcard .bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px 10px;
}
.gcard .name { font-size: 13px; font-weight: 800; color: var(--ink); flex-shrink: 0; }
.badge {
  font-size: 10px; font-weight: 800; padding: 3px 7px; border-radius: 999px;
  background: var(--mint-light); color: var(--mint); white-space: nowrap;
}
.badge.none { background: #F1EDE0; color: #B3A78E; }

/* ---------- 管理台 ---------- */
.admin-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px 22px; margin-bottom: 18px;
  box-shadow: 0 8px 18px rgba(160, 143, 118, .12);
}
.admin-card h3 { font-size: 16px; margin-bottom: 12px; color: var(--ink); }
.admin-row { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-row .fld { flex: 1; min-width: 160px; }
.code-result {
  margin-top: 12px; font-size: 14px; color: var(--peach); font-weight: 600;
  word-break: break-all; min-height: 20px;
}
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 13px; flex-wrap: wrap;
}
.list-item .meta { color: var(--ink-2); font-size: 12px; }
.tag {
  font-size: 11px; padding: 2px 10px; border-radius: 999px;
  background: var(--mint-light); color: var(--mint);
}
.tag.used { background: #F1EEE4; color: var(--ink-2); }
.tag.admin { background: var(--peach-light); color: var(--peach); }
.mini-btn {
  border: 1px solid var(--line); background: #fff; color: var(--danger);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer;
}

/* ---------- 底部导航（对齐小程序 tabBar：白底 + 薄荷选中） ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
/* 电脑端：导航项与 520px 内容列对齐（手机端无感知差异） */
.tabbar-in { max-width: 520px; margin: 0 auto; display: flex; }
.tabbar .tab-item {
  flex: 1; height: 54px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: none; background: none; cursor: pointer;
  font-size: 10px; font-weight: 700; color: var(--ink-2);
}
.tabbar .tab-item .tab-ic { width: 22px; height: 22px; }
.tabbar .tab-item.on { color: var(--mint); }
.tab-page { padding-bottom: 78px; } /* 给固定底部导航留位 */

/* ---------- 「我的」Tab（对齐小程序 pages/stats） ---------- */
.hero { text-align: center; padding: 10px 0 14px; }
.hero-ttl { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: 1px; }
.hero-sub { margin-top: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .5px; }

.summary {
  display: flex; align-items: center;
  background: var(--card); border-radius: 18px; padding: 14px 5px;
  box-shadow: 0 5px 14px rgba(160, 143, 118, .14);
  margin-bottom: 16px;
}
.summary .cell { flex: 1; text-align: center; }
.summary .num { font-size: 17px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.summary .num.tiny { font-size: 12px; color: var(--mint); }
.summary .unit { font-size: 10px; font-weight: 700; color: var(--ink-2); margin-left: 1px; }
.summary .lbl { margin-top: 4px; font-size: 10px; color: var(--ink-2); }
.summary .divider { width: 1px; height: 26px; background: var(--line); }

.sec-row { display: flex; align-items: baseline; justify-content: space-between; margin: 0 3px 10px; }
.sec-t { font-size: 14px; font-weight: 800; color: #7A6A52; letter-spacing: 1px; }
.sec-n { font-size: 11px; color: var(--ink-2); }

.list .mcard {
  display: flex; align-items: center; gap: 11px;
  background: var(--card); border-radius: 14px; padding: 9px 12px;
  box-shadow: 0 4px 10px rgba(160, 143, 118, .12);
  cursor: pointer; transition: transform .12s ease;
}
.list .mcard:active { transform: scale(.98); }
.list .mcard.soon { opacity: .62; }
.mcard .thumb { width: 78px; height: 40px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--bg); }
.mcard .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mcard .name { font-size: 13px; font-weight: 800; color: var(--ink); }
.mcard .desc { font-size: 11px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard .mstat { font-size: 11px; font-weight: 700; color: var(--peach); flex-shrink: 0; max-width: 42%; text-align: right; }
.mcard .mstat.empty { color: #C6BBA5; font-weight: 600; }

.btn.wide { width: 100%; margin-top: 12px; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.btn.ghost:hover { color: var(--danger); border-color: var(--danger); }
.foot { text-align: center; margin-top: 16px; font-size: 11px; color: #C6BBA5; }
