:root {
  --bg: #0d1017;
  --bg2: #111621;
  --card: #171d29;
  --card2: #1d2432;
  --line: #2a3344;
  --text: #e9eef8;
  --muted: #8b96aa;
  --accent: #e8721c;
  --accent2: #ffb35c;
  --green: #3f9d4f;
  --red: #d9453f;
  --yellow: #d99b1c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

body {
  padding-bottom: env(safe-area-inset-bottom);
}

.hidden { display: none !important; }

.screen {
  max-width: 760px;
  margin: 0 auto;
  min-height: 100vh;
}

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  background: radial-gradient(circle at 50% 0, #1c2438 0, var(--bg) 45%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

.brand {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--accent2);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}

.sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.login-card .brand,
.login-card .sub { text-align: center; }

.field { margin-top: 16px; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input, textarea {
  width: 100%;
  background: #0f141e;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
  font-family: inherit;
}

input:focus, textarea:focus { border-color: var(--accent); }

input::placeholder, textarea::placeholder {
  color: #6f7a8e;
  -webkit-text-fill-color: #6f7a8e;
}

textarea { resize: vertical; min-height: 110px; }

button {
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  color: var(--text);
  background: var(--card2);
}

button:active { transform: translateY(1px); }

.primary {
  background: linear-gradient(180deg, #f08028, #d96412);
  color: #fff;
  font-weight: 700;
  border: 1px solid #ff9a4a;
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.chip {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--card2);
  border: 1px solid var(--line);
  color: var(--text);
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent2);
  color: #fff;
  font-weight: 700;
}

.wide { width: 100%; margin-top: 12px; }

.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.code-row button { white-space: nowrap; }

.tip {
  min-height: 20px;
  color: var(--accent2);
  font-size: 13px;
  margin-top: 10px;
  text-align: center;
}

/* ---------- 顶栏 / 页面 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: rgba(13, 16, 23, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar .brand { font-size: 18px; letter-spacing: 1px; }

#user-chip {
  font-size: 12px;
  color: var(--muted);
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main {
  padding: 12px 14px calc(78px + env(safe-area-inset-bottom));
}

.page { display: none; }
.page.active { display: block; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 0 0 auto; }
.grow, .row .grow { flex: 1; min-width: 0; }

.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.center { text-align: center; }

.hero {
  background: linear-gradient(135deg, #201827, #172234 60%, #10151f);
}

.hero-title { font-size: 24px; font-weight: 800; color: var(--accent2); }

.link {
  background: transparent;
  color: var(--accent2);
  font-size: 13px;
  padding: 2px 4px;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 18px 0;
}

/* ---------- 公告 / 帖子 ---------- */
.notice-item {
  border-top: 1px dashed var(--line);
  padding: 12px 0;
}
.notice-item:first-child { border-top: none; padding-top: 0; }
.notice-title { font-weight: 700; font-size: 15px; }
.notice-body { white-space: pre-wrap; word-break: break-word; margin-top: 4px; font-size: 14px; }
.notice-time { color: var(--muted); font-size: 12px; margin-top: 4px; }

.post {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}

.post-head { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: #2a3344; object-fit: cover; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent2);
}
.post-name { font-weight: 700; font-size: 14px; }
.post-time { color: var(--muted); font-size: 12px; }
.post-body { margin-top: 8px; white-space: pre-wrap; word-break: break-word; }
.post-images { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.post-images img {
  width: calc(33.333% - 4px); aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line);
}
.post-foot { display: flex; gap: 18px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.post-foot button { background: transparent; color: var(--muted); padding: 0; font-size: 13px; }
.post-foot button.liked { color: var(--accent2); }

.comment {
  border-top: 1px dashed var(--line);
  padding: 10px 0;
}
.comment:first-child { border-top: none; }
.comment-head { display: flex; align-items: center; gap: 8px; }
.comment-head .avatar { width: 28px; height: 28px; font-size: 12px; }
.comment-body { margin-top: 5px; font-size: 14px; }

/* ---------- 状态标签 ---------- */
.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--bg2);
  white-space: nowrap;
  flex: 0 0 auto;
}
.tag.pending { color: var(--yellow); border-color: #5a4614; background: #241d0d; }
.tag.approved { color: #7ee08c; border-color: #245a2d; background: #112315; }
.tag.rejected { color: #ff8b86; border-color: #5c2421; background: #241110; }
.tag.deleted { color: #aaa; border-color: #444; background: #222; }

.uid-item {
  border-top: 1px dashed var(--line);
  padding: 12px 0;
}
.uid-item:first-child { border-top: none; padding-top: 0; }
.uid-value { font-weight: 700; font-size: 15px; word-break: normal; overflow-wrap: break-word; }
.uid-item .row-between { align-items: flex-start; }
.uid-item .uid-value { flex: 1; min-width: 0; }
.reject-reason { color: #ff8b86; font-size: 13px; margin-top: 4px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  max-width: 760px;
  margin: 0 auto;
  background: rgba(17, 22, 33, .97);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(8px);
}

.tabbar button {
  flex: 1;
  background: transparent;
  border-radius: 0;
  padding: 11px 4px 10px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tabbar button.active { color: var(--accent2); }
.tabbar .ico { font-size: 19px; line-height: 1; }
.tabbar button { white-space: nowrap; }

/* 可换行的筛选/子页签行，避免窄屏被截断 */
.chips { flex-wrap: wrap; }
.chips > * { flex: 0 0 auto; }
#admin-chip {
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 弹层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet {
  width: 100%;
  max-width: 760px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--card);
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
}

.sheet.full { height: 88vh; }

.sheet-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
}

.sheet .close {
  float: right;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  padding: 0 4px;
}

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumb { position: relative; width: 84px; height: 84px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumb button {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; padding: 0;
  border-radius: 50%; background: var(--red); color: #fff; font-size: 14px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 100;
  max-width: 86vw;
  background: rgba(0, 0, 0, .86);
  color: #fff;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 10px;
  text-align: center;
  pointer-events: none;
}

/* ---------- 个人中心 ---------- */
.profile-card { display: flex; align-items: center; gap: 14px; }
.profile-card .avatar { width: 64px; height: 64px; font-size: 22px; }
.profile-name { font-size: 19px; font-weight: 800; }

.footer-note {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 18px 0 6px;
}

@media (max-width: 380px) {
  .brand { font-size: 22px; }
  main { padding: 10px 10px calc(78px + env(safe-area-inset-bottom)); }
}

/* ---------- 管理端发放物品 ---------- */
.grant-results {
  max-height: 260px;
  overflow-y: auto;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg2);
}
.grant-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.grant-item:last-child { border-bottom: 0; }
.grant-item.active { background: rgba(232, 114, 28, .18); color: var(--accent2); }
.grant-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grant-id { color: var(--muted); font-size: 12px; flex: 0 0 auto; }

/* ---------- 管理端爆率 ---------- */
.drop-section {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.drop-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}
.drop-row {
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  margin-top: 8px;
  background: var(--bg2);
}
.drop-row-ctl {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.drop-row input[type="number"] {
  width: 72px;
  padding: 8px 10px;
  font-size: 15px;
}
.drop-row .drop-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  font-size: 13px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drop-row .drop-del {
  width: 34px;
  height: 34px;
  padding: 0;
  flex: 0 0 auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--red);
  font-size: 18px;
  line-height: 1;
}
.drop-check {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.drop-check input { width: auto; }
.drop-mini-label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.drop-list-item {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  color: var(--text);
}
.drop-list-item:active { border-color: var(--accent); }
.drop-list-title { font-weight: 700; font-size: 15px; }
.drop-list-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.drop-list-sum { color: var(--accent2); font-size: 12px; margin-top: 4px; }
.drop-zone-head {
  margin: 14px 0 8px;
  padding: 6px 10px;
  border-left: 3px solid var(--accent);
  background: var(--card2);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent2);
}
.drop-zone-head:first-child { margin-top: 0; }

/* ---------- 玩家端掉落查询 ---------- */
.drop-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg2);
  margin-bottom: 8px;
  overflow: hidden;
}
.drop-head {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 10px 12px;
}
.drop-head:active { background: rgba(232, 114, 28, .08); }
.drop-item-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg2);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.drop-item-card .drop-list-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.drop-detail {
  padding: 8px 12px 10px;
  border-top: 1px dashed var(--line);
}
.drop-detail .drop-line:first-child { padding-top: 0; }
.drop-line { font-size: 13px; padding: 3px 0; }
.drop-item-src {
  font-size: 13px;
  padding: 5px 0;
  border-top: 1px dashed var(--line);
  color: var(--text);
}
.drop-list-sub + .drop-item-src { border-top: none; padding-top: 8px; }
.drop-empty { color: var(--muted); font-size: 12px; padding: 4px 0; }
