:root {
  --bg: #0f1419;
  --bg2: #1a222d;
  --card: #232d3b;
  --line: #2f3b4c;
  --text: #e8eef6;
  --muted: #8b9bb0;
  --accent: #3dd6c6;
  --accent2: #5b8cff;
  --danger: #ff6b7a;
  --ok: #6bcf7f;
  --radius: 14px;
  --tab-h: 58px;
  font-family: "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
button, input, textarea { font: inherit; }
a { color: var(--accent); text-decoration: none; }
#app {
  min-height: 100%;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(255,255,255,.04);
}

.screen { min-height: 100vh; display: flex; flex-direction: column; }
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(61,214,198,.18), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(91,140,255,.16), transparent 55%),
    var(--bg);
}
.auth-card {
  width: min(420px, 100%);
  background: rgba(26,34,45,.92);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px;
  backdrop-filter: blur(10px);
}
.brand { font-size: 26px; font-weight: 700; letter-spacing: .02em; line-height: 1.3; }
.brand span { color: var(--accent); }
.sub { color: var(--muted); margin: 8px 0 22px; font-size: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 12px;
  outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border: 0; border-radius: 10px; padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #041018; font-weight: 700; cursor: pointer; width: 100%;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 500; }
.btn.sm { width: auto; padding: 8px 12px; font-size: 13px; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 8px 0; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button {
  flex: 1; background: var(--bg); border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 8px; cursor: pointer;
}
.tabs button.on { color: var(--text); border-color: var(--accent); }

.top {
  position: sticky; top: 0; z-index: 5;
  background: rgba(15,20,25,.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
.top h1 { font-size: 18px; margin: 0; flex: 1; }
.region-filter { position: relative; flex: 0 0 auto; }
.region-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: transparent; color: var(--text);
  font-size: 15px; font-weight: 500; cursor: pointer; padding: 4px 2px;
}
.region-btn.active { color: var(--accent); }
.region-caret { font-size: 12px; color: var(--muted); line-height: 1; transform: translateY(-1px); }
.expire-banner {
  margin: 10px 16px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(61,214,198,.16), rgba(61,214,198,.06));
  border: 1px solid rgba(61,214,198,.35);
  color: var(--text);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.expire-banner strong {
  color: var(--accent, #3dd6c6);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.region-filter.open .region-caret { transform: rotate(180deg) translateY(1px); }
.region-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  width: min(220px, 72vw);
  background: #fff; color: #1c1917;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,.28);
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: manipulation;
}
.region-search {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid #ece7e1;
}
.region-search-ico { color: #a8a29e; font-size: 15px; line-height: 1; }
.region-search input {
  flex: 1; border: 0; outline: none; background: transparent;
  color: #1c1917; font-size: 14px; min-width: 0;
}
.region-search input::placeholder { color: #a8a29e; }
.region-list {
  max-height: min(280px, 50vh);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 4px 0;
}
/* 打开地区下拉时锁住背后列表，避免滚动穿透 */
html.region-open,
html.region-open body {
  overflow: hidden !important;
  overscroll-behavior: none;
  height: 100%;
}
html.region-open body {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  /* 不在 body 上设 touch-action:none，以免个别 WebView 连带禁掉下拉内滚动 */
}
.region-opt {
  display: block; width: 100%; text-align: left;
  border: 0; background: transparent; color: #292524;
  padding: 11px 16px; font-size: 15px; cursor: pointer;
}
.region-opt:hover, .region-opt:active { background: #f5f5f4; }
.region-opt.on { color: #0f766e; font-weight: 600; background: #f0fdfa; }
.region-empty { padding: 16px; text-align: center; color: #a8a29e; font-size: 13px; }
.search {
  margin: 12px 16px 0;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; display: flex; gap: 8px;
}
.search input { flex: 1; background: transparent; border: 0; color: var(--text); outline: none; }
.list {
  padding: 12px 16px calc(var(--tab-h) + 20px);
  display: grid;
  gap: 12px;
}
.list.grid-2 {
  grid-template-columns: 1fr 1fr;
  gap: 14px 10px;
  align-items: start;
}
.list.grid-2 .empty { grid-column: 1 / -1; }
.list:has(+ .pager) { padding-bottom: 8px; }
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 28px;
  padding: 14px 12px calc(var(--tab-h) + 16px);
  color: var(--muted);
  font-size: 12px;
}
.pager-nums {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.pager-num.on {
  background: var(--accent);
  color: #0b1218;
  border-color: var(--accent);
  opacity: 1 !important;
  cursor: default;
}
.pager-ellipsis { opacity: .7; padding: 0 2px; }
.pager-info { text-align: center; }
.pager-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pager-jump input {
  width: 3.6em;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
}
.pager .btn {
  width: auto;
  min-width: 2.4em;
  padding: 8px 10px;
}
.pager .btn[disabled]:not(.on) {
  opacity: .45;
  cursor: not-allowed;
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(139, 155, 176, .28);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.card-wrap.card-enter {
  animation: cardIn .38s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.card-wrap {
  position: relative;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.card {
  background: transparent; border: 0; border-radius: 0;
  padding: 0; cursor: pointer;
}
.card .thumb {
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #0a0e13;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card .thumb-empty {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: var(--muted); font-size: 12px;
  background: linear-gradient(160deg, #1a222d, #0f1419);
}
.card .title {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .listed {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail .sum {
  color: var(--muted); font-size: 14px; margin-top: 10px; line-height: 1.55; white-space: pre-line;
}
.detail .body-text {
  margin-top: 12px; white-space: pre-wrap; line-height: 1.6;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: #182230; color: var(--accent); border: 1px solid #2a3a4d; cursor: pointer; }
.tag:active { opacity: .8; }

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  height: var(--tab-h);
  box-sizing: border-box;
  background: rgba(15,20,25,.96);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: stretch;
  backdrop-filter: blur(12px);
  padding: 0;
  margin: 0;
  z-index: 20;
}
.tabbar button {
  flex: 1 1 0%;
  min-width: 0;
  margin: 0;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 0 8px;
  text-align: center;
}
.tabbar button.on { color: var(--accent); }
.tabbar .ico { font-size: 18px; line-height: 1; }

.detail { padding: 16px 16px calc(var(--tab-h) + 24px); }
.detail .hero {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
}
.detail .hero h2 {
  margin: 6px 0 0; font-size: 20px; font-weight: 600; line-height: 1.35; color: var(--text);
}
.detail .hero .meta { color: var(--muted); font-size: 12px; }
.detail img, .detail video { width: 100%; border-radius: 12px; margin-top: 12px; background: #000; }
.exclusive-lock {
  margin-top: 20px;
  padding: 36px 18px 32px;
  border-radius: 16px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 28%, rgba(240, 180, 50, .14), transparent 55%),
    linear-gradient(165deg, #2a1f3d 0%, #1a1228 45%, #120e1c 100%);
  border: 1px solid rgba(240, 193, 77, .18);
}
.exclusive-lock-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 14px rgba(240, 180, 50, .45));
}
.exclusive-lock-title {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 10px;
}
.exclusive-lock-sub {
  color: #c8bfd8;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 22px;
}
.exclusive-lock-cta {
  color: #9a90ad;
  font-size: 12px;
}
.exclusive-open {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.exclusive-open-title {
  font-size: 15px;
  font-weight: 600;
  color: #f0c14d;
  margin-bottom: 8px;
}
.exclusive-open-text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  margin-bottom: 4px;
}
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }

.chat-list .card .title { font-size: 15px; }
.chat-room { display: flex; flex-direction: column; height: calc(100vh - var(--tab-h)); }
.msgs { flex: 1; overflow: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble {
  max-width: 78%; padding: 10px 12px; border-radius: 14px; line-height: 1.45; font-size: 14px;
  background: var(--card); border: 1px solid var(--line);
}
.bubble.me { align-self: flex-end; background: #1b3a3a; border-color: #2d5552; }
.composer {
  display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--bg2);
}
.composer input { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 10px 12px; }
.composer button { width: auto; }

.profile { padding: 16px; }
.profile .box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
