@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;900&family=ZCOOL+KuaiLe&display=swap");

:root {
  --blue: #1a3a8f;
  --blue-deep: #0f2460;
  --blue-soft: #e8eefc;
  --red: #d61f26;
  --yellow: #f5c518;
  --ink: #1a1a1a;
  --muted: #6b7280;
  --line: #d8dee9;
  --paper: #f3f5f9;
  --card: #ffffff;
  --radius: 6px;
  --shadow: 0 1px 0 rgba(15, 36, 96, 0.06), 0 8px 24px rgba(15, 36, 96, 0.06);
  --font: "Noto Sans SC", "PingFang SC", sans-serif;
  --brand: "ZCOOL KuaiLe", "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 420px at 10% -10%, rgba(245, 197, 24, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(26, 58, 143, 0.16), transparent 50%),
    linear-gradient(180deg, #e9eef8 0%, var(--paper) 40%, #eef1f7 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 48px;
}

/* ---------- banner + category tabs ---------- */
.banner {
  background: linear-gradient(180deg, #6b1d24 0%, #8b2430 55%, #5c151c 100%);
  color: #fff;
  border-radius: 12px 12px 0 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 18px;
  min-height: 88px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: linear-gradient(180deg, #17368a, var(--blue-deep));
  color: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.cate-tabs {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 4px;
  margin-top: -10px;
  padding: 14px 8px 0;
  background: #fff;
  border: 1px solid #e6e8ee;
  border-top: none;
  border-radius: 14px 14px 0 0;
  position: relative;
  z-index: 2;
}

.cate-tabs::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  width: 36px;
  height: 3px;
  border-radius: 99px;
  background: #e5e7eb;
  transform: translateX(-50%);
}

.cate-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 14px 8px 12px;
  margin: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #222;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.cate-tab.is-active {
  color: #111;
  font-weight: 800;
}

.cate-tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 22px;
  height: 3px;
  border-radius: 99px;
  background: #e54d42;
  transform: translateX(-50%);
}

.cate-tabs-two {
  justify-content: space-evenly;
}

.cate-tabs-two .cate-tab {
  flex: 1;
  font-size: 16px;
  padding: 16px 12px 14px;
}

.cate-tabs-two .cate-tab.is-active::after {
  width: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  border: 2px solid rgba(245, 197, 24, 0.85);
  background: #0b1d4d;
  object-fit: cover;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-name {
  font-family: var(--brand);
  font-size: 28px;
  line-height: 1;
  letter-spacing: 1px;
}

.brand-sub {
  font-size: 12px;
  opacity: 0.82;
}

.top-actions .btn {
  min-height: 36px;
  box-shadow: none;
}

.top-actions .btn-checkin {
  background: var(--yellow);
  color: #5a3d00;
  border-color: #e0b400;
}

.top-actions .btn-login {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  min-width: auto;
}

.home-grid {
  margin-top: 0;
}

.home-grid .zone-panel {
  border-radius: 0 0 10px 10px;
}

/* ---------- utility row ---------- */
.util-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 14px;
  align-items: stretch;
}

.util-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.notice,
.btn,
.login-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  min-height: 48px;
}

.notice-tag {
  flex: none;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.notice-text {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 18px;
  min-height: 48px;
  cursor: pointer;
  font-weight: 700;
  border: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.btn-checkin {
  background: linear-gradient(180deg, #ffe56a, var(--yellow));
  color: #5a3d00;
  border: 1px solid #e0b400;
}

.btn-login {
  background: linear-gradient(180deg, #2b4fb0, var(--blue));
  color: #fff;
  border: 1px solid var(--blue-deep);
  min-width: 96px;
}

.btn-ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-red {
  background: linear-gradient(180deg, #ef3b42, var(--red));
  color: #fff;
  border: 1px solid #b5151b;
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 4px;
}

/* ---------- panels ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #f7f9fd, #eef2fb);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}

.panel-hd .more {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.panel-bd {
  padding: 8px 0;
}

/* ---------- home feed ---------- */
.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 0;
  background: #fff;
  border: 1px solid #e6e8ee;
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 8px 12px 12px;
}

.topic-item {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px 16px;
  border-bottom: 1px dashed var(--line);
  transition: background 0.15s ease;
}

.topic-item:last-child {
  border-bottom: none;
}

.topic-item:hover {
  background: var(--blue-soft);
}

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background:
    linear-gradient(145deg, #2d4ea8, #132768);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}

.topic-main {
  min-width: 0;
}

.topic-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
}

.topic-meta {
  font-size: 12px;
  color: var(--muted);
}

.topic-stats {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 4px;
}

/* ---------- Tieba feed cards ---------- */
.zone-panel {
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.zone-panel .panel-hd {
  border: 1px solid var(--line);
  border-radius: 10px 10px 0 0;
  margin-bottom: 0;
}

.feed {
  display: grid;
  gap: 10px;
  padding: 10px 0 0;
}

.tb-card {
  display: block;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e6e8ee;
  box-shadow: 0 2px 10px rgba(20, 30, 60, 0.05);
  padding: 14px 14px 10px;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tb-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(20, 30, 60, 0.08);
}

.tb-detail {
  margin-top: 0;
}

.tb-comment {
  margin-top: 10px;
  box-shadow: none;
  background: #fafbff;
}

.tb-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.tb-user {
  min-width: 0;
  flex: 1;
}

.tb-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tb-name {
  font-size: 15px;
  font-weight: 700;
  color: #222;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.badge.lv {
  background: linear-gradient(180deg, #6db3ff, #3b82f6);
}

.badge.title {
  background: linear-gradient(180deg, #5b8cff, #2952d9);
  border-radius: 10px;
}

.tb-time {
  margin-top: 3px;
  font-size: 12px;
  color: #9aa0a6;
}

.tb-content {
  margin-top: 10px;
}

.tb-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: #1f1f1f;
  word-break: break-word;
}

.tb-text.sub {
  margin-top: 6px;
  font-size: 15px;
  color: #333;
}

.tb-media {
  margin-top: 10px;
  border-radius: 10px;
  min-height: 180px;
  background:
    linear-gradient(145deg, #1a3a8f 0%, #2d5fd4 45%, #0f2460 100%);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--brand);
  font-size: 28px;
  overflow: hidden;
}

.tb-media.ticket {
  min-height: 220px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 40%),
    repeating-linear-gradient(
      0deg,
      #f7f2e6 0 28px,
      #efe6d2 28px 29px
    ),
    linear-gradient(180deg, #fffaf0, #f3ebe0);
  color: #8a7a55;
  border: 1px solid #e4d8bc;
  position: relative;
}

.tb-media.video {
  min-height: 180px;
  background: linear-gradient(145deg, #111827, #374151 50%, #111827);
  color: #fff;
  font-family: var(--font);
  font-size: 18px;
  font-weight: 700;
}

.feed-empty {
  padding: 40px 16px;
  text-align: center;
  color: #9aa0a6;
  font-size: 14px;
  background: #fff;
  border-radius: 12px;
}

.tb-media.ticket::before {
  content: "体彩任选九 · 晒单示意";
  position: absolute;
  top: 14px;
  left: 14px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  color: #1a3a8f;
}

.tb-foot {
  display: flex;
  justify-content: space-around;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #f0f1f4;
  color: #8a9199;
  font-size: 13px;
}

.fab {
  position: fixed;
  right: 18px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: none;
  cursor: pointer;
  z-index: 40;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  text-decoration: none;
}

.fab-refresh {
  bottom: 92px;
  background: #fff;
  color: #555;
  font-size: 22px;
}

.fab-add {
  bottom: 32px;
  background: var(--red);
  color: #fff;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

/* ---------- post page ---------- */
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--blue);
  font-weight: 600;
}

.post-card,
.user-card,
.auth-card {
  padding: 18px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.post-author .info strong {
  display: block;
  font-size: 16px;
}

.post-author .info span {
  color: var(--muted);
  font-size: 13px;
}

.post-title {
  margin: 14px 0 10px;
  font-size: 22px;
  line-height: 1.35;
}

.post-body {
  color: #333;
  line-height: 1.7;
  font-size: 15px;
}

.post-figure {
  margin: 14px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, #12306f, #1d4bb3 55%, #0d204d);
  min-height: 220px;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  position: relative;
}

.post-figure::after {
  content: "图片";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--brand);
  font-size: 42px;
  letter-spacing: 4px;
  opacity: 0.35;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.reply-box {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.reply-box textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fafbff;
}

.reply-box .row {
  display: flex;
  justify-content: flex-end;
}

.section-title {
  margin: 18px 0 8px;
  font-size: 16px;
  font-weight: 800;
}

.comment {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.comment:last-child {
  border-bottom: none;
}

.comment .name {
  font-weight: 700;
  font-size: 14px;
}

.comment .text {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.55;
}

.comment .ops {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---------- user page ---------- */
.user-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.user-head .left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar.lg {
  width: 64px;
  height: 64px;
  font-size: 18px;
}

.user-id {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px;
}

.user-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.user-stats b {
  color: var(--ink);
  font-size: 16px;
  margin-right: 4px;
}

.user-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 14px;
  margin-top: 16px;
}

.side-box {
  padding: 14px;
  background: var(--blue-soft);
  border-radius: 8px;
  border: 1px solid #d5dff5;
}

.side-box h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.side-box p,
.side-box li {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.side-box ul {
  margin: 0;
  padding-left: 18px;
}

/* ---------- register ---------- */
.auth-wrap {
  width: min(520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.auth-card h1 {
  margin: 0 0 6px;
  font-family: var(--brand);
  font-size: 32px;
  color: var(--blue-deep);
}

.auth-card .desc {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.auth-switch {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.auth-switch a {
  color: var(--blue);
  font-weight: 700;
}

.bind-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff8e8;
  border: 1px solid #f0d789;
  font-size: 13px;
  color: #5c4a16;
}

.bind-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e54d42;
}

.bind-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--blue-soft);
  border: 1px solid #d5dff5;
}

.bind-card-title {
  font-size: 14px;
  font-weight: 800;
}

.bind-card-desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
}

.field input {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.rules {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: #fff8e8;
  border: 1px solid #f0d789;
}

.rules h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.rules ol {
  margin: 0;
  padding-left: 20px;
  color: #5c4a16;
  font-size: 13px;
  line-height: 1.7;
}

.site-foot {
  margin-top: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.demo-note {
  margin-top: 10px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.demo-note a {
  color: var(--blue);
  font-weight: 600;
}

/* ---------- mobile (贴吧式竖排) ---------- */
@media (max-width: 860px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    background: #eceff4;
  }

  .wrap,
  .auth-wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 calc(88px + env(safe-area-inset-bottom));
  }

  .banner {
    border-radius: 0;
    margin: 0;
  }

  .banner-top {
    padding: 10px 12px 20px;
    padding-top: calc(10px + env(safe-area-inset-top));
    min-height: 76px;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .brand-name {
    font-size: 22px;
  }

  .top-actions {
    display: flex;
    gap: 8px;
  }

  .top-actions .btn {
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }

  .cate-tabs {
    margin-top: -12px;
    border-left: 0;
    border-right: 0;
    border-radius: 16px 16px 0 0;
    padding: 16px 4px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: space-between;
  }

  .cate-tab {
    flex: 1 0 auto;
    font-size: 15px;
    padding: 12px 6px 12px;
  }

  .home-grid,
  .user-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0;
    background: #fff;
    padding: 8px 10px 0;
  }

  .zone-panel .panel-hd {
    border-radius: 10px;
    margin-bottom: 8px;
    padding: 10px 12px;
  }

  .feed {
    gap: 8px;
    padding-top: 0;
  }

  .tb-card {
    border-radius: 12px;
    padding: 12px;
  }

  .tb-detail {
    margin: 0 10px;
  }

  .avatar {
    width: 40px;
    height: 40px;
    font-size: 13px;
  }

  .tb-text {
    font-size: 15px;
  }

  .tb-media,
  .tb-media.ticket {
    min-height: 190px;
  }

  .page-back {
    display: block;
    margin: 0;
    padding: 12px 14px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .user-card,
  .auth-card {
    margin: 0;
    padding: 14px 14px 20px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }

  .post-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
  }

  .post-actions .btn {
    width: 100%;
    min-height: 40px;
  }

  .reply-box textarea {
    min-height: 88px;
    font-size: 16px;
  }

  .user-head {
    flex-direction: column;
    align-items: stretch;
  }

  .user-head .btn {
    width: 100%;
  }

  .auth-wrap {
    padding-top: 0;
  }

  .auth-card h1 {
    font-size: 26px;
  }

  .field input {
    height: 46px;
    font-size: 16px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .field-row .btn {
    min-height: 44px;
  }

  .fab-refresh {
    bottom: calc(84px + env(safe-area-inset-bottom));
    right: 14px;
  }

  .fab-add {
    bottom: calc(24px + env(safe-area-inset-bottom));
    right: 14px;
  }

  .demo-note,
  .site-foot {
    padding: 0 12px;
  }
}
