:root {
  --bg: #0b1220;
  --bg2: #121a2b;
  --card: #152036;
  --border: #2a3a55;
  --text: #e8eef8;
  --muted: #8fa0b8;
  --accent: #3d8bfd;
  --accent2: #1f6feb;
  --danger: #e5534b;
  --ok: #3fb950;
  --warn: #d4a72c;
  --brown: #c27a2e;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(61, 139, 253, 0.18), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(194, 122, 46, 0.12), transparent 50%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
}

.hidden { display: none !important; }

/* ---- Form fields ---- */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="date"],
input:not([type]),
textarea,
select {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: var(--text);
  background: linear-gradient(180deg, #121c30 0%, #0d1524 100%);
  border: 1px solid rgba(58, 78, 112, 0.85);
  border-radius: 11px;
  padding: 12px 14px;
  line-height: 1.35;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 1px 2px rgba(0, 0, 0, 0.18);
}
select {
  padding-right: 36px;
  background-image:
    linear-gradient(45deg, transparent 50%, #8fa0b8 50%),
    linear-gradient(135deg, #8fa0b8 50%, transparent 50%),
    linear-gradient(180deg, #121c30 0%, #0d1524 100%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px),
    0 0;
  background-size: 5px 5px, 5px 5px, 100% 100%;
  background-repeat: no-repeat;
  cursor: pointer;
}
input[type="text"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="date"]:hover,
textarea:hover,
select:hover {
  border-color: #4d6690;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  border-color: #5aa0ff;
  box-shadow:
    0 0 0 3px rgba(61, 139, 253, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  background: #101a2c;
}
select:focus {
  background-image:
    linear-gradient(45deg, transparent 50%, #8bdcff 50%),
    linear-gradient(135deg, #8bdcff 50%, transparent 50%),
    linear-gradient(180deg, #101a2c 0%, #101a2c 100%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px),
    0 0;
  background-size: 5px 5px, 5px 5px, 100% 100%;
  background-repeat: no-repeat;
}
input::placeholder,
textarea::placeholder {
  color: #6d7f99;
}
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.field {
  position: relative;
  width: 100%;
  margin-bottom: 12px;
}
.field-input {
  width: 100%;
  padding-right: 48px !important;
}
.pwd-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 0;
}
.pwd-toggle:hover,
.pwd-toggle:focus-visible {
  color: var(--accent);
  background: rgba(61, 139, 253, 0.1);
  outline: none;
}
.pwd-toggle[aria-pressed="true"] {
  color: var(--accent);
}

.field-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hidden { display: none !important; }

.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg);
  color: var(--muted);
}

.boot-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: boot-spin 0.8s linear infinite;
}

.boot-text {
  margin: 0;
  font-size: 13px;
}

@keyframes boot-spin {
  to { transform: rotate(360deg); }
}

/* ---- Auth ---- */
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-box {
  width: min(400px, 100%);
  background: rgba(21, 32, 54, 0.92);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}
.auth-brand {
  text-align: center;
  margin-bottom: 20px;
}
.auth-brand .logo-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #3d8bfd, #1a4f9c);
  font-weight: 800;
  margin-bottom: 10px;
}
.auth-brand h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.04em;
}
.auth-brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  background: #0d1526;
  padding: 4px;
  border-radius: 12px;
}
.auth-tab {
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}
.auth-tab.active {
  background: var(--accent);
  color: #fff;
}
.auth-form .field {
  margin-bottom: 12px;
}
.auth-form > input {
  width: 100%;
  margin-bottom: 12px;
}
.auth-form .btn-primary {
  margin-top: 4px;
}
.auth-error {
  color: var(--danger);
  font-size: 13px;
  margin: 8px 0 0;
  text-align: center;
}

/* ---- Buttons ---- */
.btn-primary, .btn-ghost, .btn-danger {
  padding: 12px 16px;
  border-radius: 11px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary {
  background: linear-gradient(180deg, #4d96ff 0%, var(--accent) 42%, var(--accent2) 100%);
  color: #fff;
  border: 1px solid rgba(143, 188, 255, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 6px 14px rgba(31, 111, 235, 0.28);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active {
  transform: translateY(1px);
  filter: brightness(0.98);
}
.btn-ghost {
  background: linear-gradient(180deg, #22314a 0%, #1a2740 100%);
  color: var(--text);
  border: 1px solid rgba(70, 92, 128, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.btn-ghost:hover {
  border-color: #5a749c;
  background: linear-gradient(180deg, #283854 0%, #1e2e4a 100%);
}
.btn-danger {
  background: linear-gradient(180deg, #ef6b63 0%, var(--danger) 100%);
  color: #fff;
  border: 1px solid rgba(255, 170, 164, 0.28);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}
.btn-danger:hover { filter: brightness(1.04); }
.btn-block { width: 100%; display: block; }
.auth-form .btn-primary,
.admin-login-card .btn-primary,
.panel-card > .btn-primary:not(.btn-sm),
.panel-card > .form-grid ~ .btn-primary,
.panel-card > label ~ .btn-primary {
  width: 100%;
}
.inline-form .btn-primary,
.admin-toolbar .btn-primary,
.admin-form-row .btn-primary,
.admin-field-action {
  width: auto;
}
.invite-box { background: #0d1526; border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.invite-code-row, .invite-link-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.invite-label { color: var(--muted); font-size: 12px; min-width: 48px; }
#myInviteLink { flex: 1; min-width: 160px; font-size: 12px; padding: 10px 12px; }
#myInviteCode { font-size: 18px; letter-spacing: 1px; color: var(--accent); }
.btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 9px; }

/* ---- Home / App shell (mobile) ---- */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}
.app-pages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.app-page { padding-bottom: 16px; }
.page-header {
  padding: 16px 16px 8px;
}
.page-kicker {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.page-title {
  margin: 4px 0 0;
  font-size: 22px;
}

.mine-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 16px 10px;
}
.mine-avatar-wrap {
  flex-shrink: 0;
}
.mine-avatar-btn {
  position: relative;
  display: block;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}
.mine-avatar-btn:disabled,
.mine-avatar-btn.is-cooldown {
  cursor: not-allowed;
  opacity: 0.85;
}
.mine-avatar-edit {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.mine-avatar-hint {
  margin: 4px 0 0;
  font-size: 11px;
}
.user-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: #0d1526;
  object-fit: cover;
  flex-shrink: 0;
}
.mine-hero-text h2 { margin: 0; font-size: 22px; }
.mine-name-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.user-id-tag {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(61, 139, 253, 0.12);
  border: 1px solid rgba(61, 139, 253, 0.28);
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.4;
}
.mine-actions { padding: 8px 16px 24px; }
.mine-menu {
  margin: 0 16px 14px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: transparent;
  border: none;
  overflow: visible;
}
.mine-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 76px;
  padding: 10px 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}
.mine-menu-item:active {
  background: rgba(61, 139, 253, 0.1);
  border-color: rgba(61, 139, 253, 0.35);
}
.mine-menu-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(61, 139, 253, 0.12);
  color: var(--accent);
}
.mine-menu-icon svg {
  width: 18px;
  height: 18px;
}
.mine-menu-label {
  line-height: 1.2;
  font-size: 11px;
}
.mine-menu-logout {
  color: var(--danger);
}
.mine-menu-logout .mine-menu-icon {
  background: rgba(231, 76, 60, 0.12);
  color: var(--danger);
}
.mine-menu-logout:active {
  background: rgba(231, 76, 60, 0.08);
  border-color: rgba(231, 76, 60, 0.28);
}
.transfer-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.transfer-form .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}
.transfer-user-preview {
  margin: -2px 0 2px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  background: rgba(61, 139, 253, 0.08);
  border: 1px solid rgba(61, 139, 253, 0.2);
  color: var(--muted);
}
.transfer-user-preview.ok {
  color: var(--accent);
  border-color: rgba(61, 139, 253, 0.35);
}
.transfer-user-preview.err {
  color: var(--danger);
  background: rgba(231, 76, 60, 0.08);
  border-color: rgba(231, 76, 60, 0.28);
}

.tab-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(480px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: rgba(18, 26, 43, 0.96);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  backdrop-filter: blur(10px);
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 10px;
}
.tab-item .tab-icon { font-size: 18px; line-height: 1.2; }
.tab-item.active {
  color: var(--accent);
  background: rgba(61, 139, 253, 0.12);
}

.home-screen { padding: 0 0 40px; max-width: 720px; margin: 0 auto; }
.home-top {
  padding: 18px 16px 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.home-top h2 { margin: 0; font-size: 22px; }
.home-meta { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.stat-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 0 16px 16px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}
.stat-card .k { font-size: 11px; color: var(--muted); }
.stat-card .v { font-size: 18px; font-weight: 700; margin-top: 4px; }
.module-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 12px;
}
.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 8px;
}
.module-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  min-height: 88px;
  padding: 18px 16px;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.module-stack .module-card {
  width: 100%;
}
.module-play { background: linear-gradient(160deg, #1a3f6e 0%, #122038 70%); }
.module-play.play-entry-muted {
  opacity: 0.72;
  filter: grayscale(0.35);
}
.module-jv { background: linear-gradient(160deg, #5a3a18 0%, #1c150c 70%); border-color: #6d4a22; }
.module-icon { font-size: 32px; line-height: 1; flex-shrink: 0; }
.module-text { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.module-title { font-weight: 700; font-size: 18px; }
.module-desc { font-size: 13px; color: rgba(232,238,248,0.72); }
.module-arrow {
  color: rgba(232,238,248,0.45);
  font-size: 22px;
  font-weight: 300;
  flex-shrink: 0;
}

.sub-page {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: min(480px, 100%);
  height: 100%;
  height: 100dvh;
  background: var(--bg);
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sub-page-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 12px 4px;
  border-bottom: 1px solid var(--border);
  background: rgba(18, 26, 43, 0.96);
  flex-shrink: 0;
}
.sub-page-hd h2 { margin: 0; font-size: 17px; }
.sub-back {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.sub-page-bd {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}
.ledger-list-full {
  max-height: none;
  font-size: 13px;
}

.section {
  margin: 12px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.section-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(13, 21, 38, 0.45);
}
.section-hd h3 { margin: 0; font-size: 14px; }
.card-buy-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: 68%;
}
.card-buy-btn {
  border: 1px solid rgba(61, 139, 253, 0.35);
  background: rgba(61, 139, 253, 0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  white-space: nowrap;
}
.card-buy-btn:active {
  background: rgba(61, 139, 253, 0.22);
}
.card-buy-btn.wx {
  border-color: rgba(7, 193, 96, 0.4);
  background: rgba(7, 193, 96, 0.12);
}
.section-bd { padding: 14px; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0 0 10px; }

.inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.inline-form input,
.inline-form select,
.section-bd input,
.section-bd select,
.section-bd textarea {
  flex: 1;
  min-width: 100px;
}
.inline-form .btn-ghost,
.inline-form .btn-primary,
.inline-form .btn-danger {
  flex-shrink: 0;
}
.section-bd .field {
  margin-bottom: 12px;
}
.sub-page-bd .field {
  margin-bottom: 12px;
}
.sub-page-bd .btn-primary {
  margin-top: 4px;
  width: 100%;
}
.section-bd > .btn-primary {
  width: 100%;
}

.ledger-list { font-size: 12px; max-height: 240px; overflow-y: auto; }
.ledger-row { padding: 8px 0; border-bottom: 1px solid var(--border); }

.bot-process-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  font-size: 12px;
}
.bot-process-empty {
  padding: 16px 0;
  text-align: center;
  color: var(--muted);
}
.bot-process-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0d1526;
  padding: 10px 12px;
}
.bot-process-card.bot-status-run {
  border-color: rgba(63, 185, 80, 0.35);
}
.bot-process-card.bot-status-stop {
  border-color: rgba(143, 160, 184, 0.25);
  opacity: 0.88;
}
.bot-card-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.bot-status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.bot-status-badge.bot-status-run {
  background: rgba(63, 185, 80, 0.18);
  color: var(--ok);
}
.bot-status-badge.bot-status-stop {
  background: rgba(143, 160, 184, 0.15);
  color: var(--muted);
}
.bot-status-badge.bot-status-idle {
  background: rgba(143, 160, 184, 0.1);
  color: var(--muted);
}
.heart-warn {
  color: #f0b429;
  font-weight: 700;
}
.bot-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.bot-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(88, 166, 255, 0.12);
  color: #8cb4ff;
}
.bot-tag.muted {
  background: rgba(143, 160, 184, 0.12);
  color: var(--muted);
}
.bot-card-stats {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
  gap: 8px;
  margin-bottom: 8px;
}
.bot-stat {
  min-width: 0;
}
.bot-stat-label {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
}
.bot-stat-value {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bot-stat-pnl .bot-stat-value {
  font-size: 18px;
  line-height: 1.2;
}
.bot-pnl-win { color: var(--ok); }
.bot-pnl-loss { color: #f85149; }
.bot-pnl-flat { color: var(--muted); }
.bot-card-bet-label {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 4px;
}
.bot-card-bet {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 8px;
  font-size: 12px;
}
.bot-card-bet.empty,
.bot-card-bet.pending {
  background: rgba(88, 166, 255, 0.06);
}
.bet-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}
.bet-tag.win {
  background: rgba(63, 185, 80, 0.2);
  color: var(--ok);
}
.bet-tag.loss {
  background: rgba(248, 81, 73, 0.18);
  color: #f85149;
}
.bet-tag.tie {
  background: rgba(143, 160, 184, 0.18);
  color: var(--muted);
}
.bet-tag.pending {
  background: rgba(88, 166, 255, 0.2);
  color: #8cb4ff;
}
.bet-countdown {
  color: #8cb4ff;
  font-weight: 600;
}
.bot-card-ft {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 6px;
}
@media (max-width: 480px) {
  .bot-card-stats {
    grid-template-columns: 1fr 1fr;
  }
  .bot-stat-pnl {
    grid-column: 1 / -1;
  }
}

.binding-list { display: flex; flex-direction: column; gap: 10px; }
.binding-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0d1526;
}
.binding-row.muted { opacity: 0.75; }
.binding-account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}
.tag-ok, .tag-off, .tag-soon, .tag-role {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}
.tag-ok { background: rgba(63,185,80,0.2); color: var(--ok); }
.tag-off { background: rgba(143,160,184,0.2); color: var(--muted); }

input.input-invalid,
select.input-invalid,
textarea.input-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 1px rgba(229, 83, 75, 0.35);
}
.field-hint-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
  display: block;
}
.tag-soon { background: rgba(61,139,253,0.15); color: var(--accent); }
.tag-role { background: rgba(212,167,44,0.2); color: var(--warn); }

/* ---- Sub pages ---- */
.sub-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(21, 32, 54, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}
.sub-header h1 { margin: 0; font-size: 18px; font-weight: 700; }
.sub-header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.admin-version-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 167, 44, 0.35);
  background: rgba(212, 167, 44, 0.08);
}
.admin-version-label {
  font-size: 12px;
  color: var(--muted);
}
.admin-version-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--warn);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
  cursor: default;
}
.back-link { color: var(--accent); text-decoration: none; }

.jv-main, .admin-main { padding: 16px; max-width: 960px; margin: 0 auto; }

.admin-login-shell {
  min-height: calc(100vh - 58px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0 40px;
}
.admin-login-card {
  width: 100%;
  max-width: 420px;
  margin: 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}
.admin-login-brand h2 {
  margin: 0 0 8px;
  font-size: 20px;
}
.admin-login-brand .hint {
  margin: 0 0 4px;
  line-height: 1.5;
}
.admin-login-fields {
  margin: 18px 0 12px;
}
.admin-login-card .field-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.admin-login-card .field-label input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0d1526;
  color: var(--text);
  font-size: 15px;
  box-sizing: border-box;
}
.admin-login-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 16px;
  font-size: 13px;
}
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--muted);
  user-select: none;
}
.check-inline input {
  accent-color: var(--accent);
  cursor: pointer;
}
.admin-login-card .btn-primary {
  margin-top: 4px;
}
body.admin-logged-in .admin-main {
  padding-top: 16px;
}
#staffTitle {
  margin-left: auto;
}
.panel-card {
  background: linear-gradient(180deg, rgba(21, 32, 54, 0.95) 0%, rgba(17, 26, 43, 0.98) 100%);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.panel-card h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}
.panel-card > .hint {
  margin-bottom: 14px;
}
.panel-card .field-stack { margin-bottom: 12px; }
.panel-card > input,
.panel-card > select,
.panel-card > textarea {
  width: 100%;
  margin-bottom: 10px;
}
.panel-card > .field-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.panel-card > .field-label select,
.panel-card > .field-label input {
  width: 100%;
  margin-top: 4px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.form-grid label { font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
}

.jv-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: #0d1526;
  margin-bottom: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
}
.jv-item:hover { border-color: var(--accent); }

.jv-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.jv-item-top strong {
  font-size: 14px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jv-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #1a2438;
  color: var(--muted);
}
.jv-status.ok { color: #3fb950; background: rgba(63, 185, 80, 0.14); }
.jv-status.warn { color: #e3b341; background: rgba(210, 153, 34, 0.14); }
.jv-status.off { color: #f85149; background: rgba(248, 81, 73, 0.12); }
.jv-status.muted { color: var(--muted); }
.jv-item-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jv-item-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* 众筹页紧凑布局 */
.jv-main {
  padding: 10px 12px 24px;
  max-width: 720px;
}
.jv-top-hint {
  margin: 0 0 8px;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  background: rgba(21, 32, 54, 0.65);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.jv-main .jv-card {
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 12px;
}
.jv-main .jv-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
}
.jv-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.jv-card-head h3 { margin: 0; }
.jv-chip {
  flex-shrink: 0;
  font-size: 11px;
  color: #8bdcff;
  background: rgba(56, 139, 253, 0.12);
  border: 1px solid rgba(56, 139, 253, 0.28);
  border-radius: 999px;
  padding: 2px 8px;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jv-compact-hint {
  margin: 0 0 8px !important;
  font-size: 11px;
  line-height: 1.4;
}
.jv-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.jv-main .field-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #a8b7cd;
  letter-spacing: 0.01em;
}
.jv-main .field-label > input,
.jv-main .field-label > select,
.jv-main .field-label > textarea {
  width: 100%;
  margin-top: 0;
  padding: 11px 12px;
  border-radius: 11px;
  font-size: 14px;
  box-sizing: border-box;
}
.jv-main .field-label > select {
  padding-right: 36px;
}
.jv-main .field-label > textarea {
  resize: vertical;
  min-height: 64px;
  line-height: 1.45;
}
.jv-main .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}
.jv-main .form-grid .field-label {
  margin: 0;
}
.jv-main .field-hint {
  margin: 2px 0 0;
  font-size: 11px;
  min-height: 0;
  font-weight: 400;
}
.jv-main #btnJvCreate {
  margin-top: 6px;
  padding: 13px 16px;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.jv-main .inline-form input {
  padding: 11px 12px;
  border-radius: 11px;
  font-size: 14px;
}
.jv-main .jv-inline .btn-primary,
.jv-main .jv-inline .btn-ghost,
.jv-main .jv-inline .btn-danger {
  padding: 11px 14px;
}
.jv-main .jv-detail-actions .btn-primary,
.jv-main .jv-detail-actions .btn-danger {
  padding: 12px 14px;
  border-radius: 11px;
}
.jv-list { margin-top: 2px; }
.jv-detail-meta { margin: 4px 0 8px; }
.jv-strategy-box {
  margin: 8px 0 10px;
  padding: 10px 12px;
  background: #0d1526;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.jv-strategy-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.jv-strategy-display .k {
  font-size: 12px;
  color: var(--muted);
}
.jv-strategy-display .v {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.jv-strategy-box .jv-inline {
  margin-top: 8px;
}
.jv-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-bottom: 6px;
}
.jv-meta-grid > div {
  background: #0d1526;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  min-width: 0;
}
.jv-meta-grid .k {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 2px;
}
.jv-meta-grid .v {
  display: block;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jv-parts {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.jv-inline {
  margin: 0 0 6px !important;
  gap: 6px !important;
}
.jv-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0;
}
.jv-detail-actions .btn-primary,
.jv-detail-actions .btn-danger {
  text-align: center;
  text-decoration: none;
  padding: 10px 12px;
}
.jv-subhd {
  margin: 8px 0 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.jv-settle { margin-top: 8px; }

@media (max-width: 420px) {
  .jv-main .form-grid.jv-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ---- Admin ---- */
.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  padding: 4px;
  background: rgba(13, 21, 38, 0.55);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.admin-log-view {
  margin: 0;
  max-height: 62vh;
  overflow: auto;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0a1220;
  color: #c9d4e8;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.admin-tab {
  position: relative;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.admin-tab-unread-badge {
  display: inline-block;
  margin-left: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f85149;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  vertical-align: middle;
}
.admin-tab-unread-badge.hidden {
  display: none;
}
.admin-support-room.has-unread {
  border-color: rgba(248, 81, 73, 0.45);
  background: rgba(248, 81, 73, 0.08);
}
.admin-support-room .chat-unread-badge {
  margin-left: auto;
}
.pwd-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pwd-modal.hidden {
  display: none;
}
.pwd-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.pwd-modal-card {
  position: relative;
  width: min(360px, 100%);
  padding: 20px 18px 16px;
  border-radius: 14px;
  background: var(--card, #1a2332);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}
.pwd-modal-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}
.pwd-modal-card .hint {
  margin: 0 0 12px;
}
.pwd-modal-card input {
  width: 100%;
  margin-bottom: 14px;
}
.pwd-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.admin-tab:hover {
  color: var(--text);
  background: rgba(61, 139, 253, 0.08);
}
.admin-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(61, 139, 253, 0.28);
}
.admin-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}
.admin-toolbar input,
.admin-toolbar select {
  flex: 1;
  min-width: 140px;
  padding: 10px 12px;
  border-radius: 10px;
}
.admin-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.admin-form-row--boxed {
  padding: 12px;
  background: rgba(13, 21, 38, 0.65);
  border: 1px dashed rgba(61, 139, 253, 0.22);
  border-radius: 12px;
}
.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 160px;
}
.admin-field--compact {
  flex: 0 1 220px;
  max-width: 260px;
}
.admin-field-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.admin-field input,
.admin-field select {
  width: 100%;
}
.admin-field-action {
  flex-shrink: 0;
  min-width: 96px;
}

.user-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(13, 21, 38, 0.45);
}
.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.user-table th, .user-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(42, 58, 85, 0.65);
  white-space: nowrap;
}
.user-table th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(13, 21, 38, 0.85);
  position: sticky;
  top: 0;
  z-index: 1;
}
.user-table tbody tr:last-child td {
  border-bottom: none;
}
.user-table tbody tr:hover td {
  background: rgba(61, 139, 253, 0.06);
}
.user-table .user-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.user-table tr[data-id] {
  cursor: default;
}
.user-table tbody tr:empty,
.user-table td[colspan] {
  text-align: center;
  color: var(--muted);
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.detail-grid .cell {
  background: #0d1526;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}
.detail-grid .cell .k { font-size: 11px; color: var(--muted); }
.detail-grid .cell .v { margin-top: 4px; font-weight: 600; word-break: break-all; }

/* 挂机详情：紧凑键值网格 */
.detail-kv-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #0d1526;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.detail-kv-grid .kv {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
}
.detail-kv-grid .kv .k {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11px;
}
.detail-kv-grid .kv .k::after {
  content: "：";
}
.detail-kv-grid .kv .v {
  font-weight: 600;
  word-break: break-all;
  min-width: 0;
}
.detail-kv-grid .kv.pnl-pos .v { color: #4ade80; }
.detail-kv-grid .kv.pnl-neg .v { color: #f87171; }
.detail-kv-grid .kv.detail-balance .v {
  color: var(--warn);
  font-size: 16px;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.detail-kv-grid.detail-stats .kv .v { font-size: 14px; }
.detail-kv-grid .sid-mini {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  word-break: break-all;
}
.bot-detail-panel .detail-section-title {
  margin: 10px 0 6px;
  font-size: 13px;
}
.bot-detail-panel .detail-section-title:first-of-type {
  margin-top: 0;
}
@media (max-width: 1100px) {
  .detail-kv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .detail-kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .detail-kv-grid { grid-template-columns: 1fr; }
}
.detail-section-title {
  margin: 14px 0 8px;
  font-size: 14px;
  color: var(--text);
}
.detail-section-title:first-of-type { margin-top: 0; }
.detail-stats .cell { border-color: rgba(56, 189, 248, 0.35); }
.detail-stats .cell .v { font-size: 16px; }
.detail-stats .cell.pnl-pos .v { color: #4ade80; }
.detail-stats .cell.pnl-neg .v { color: #f87171; }
.bot-settle-table th,
.bot-settle-table td { font-size: 12px; }
.bot-settle-table td.pnl-pos { color: #4ade80; font-weight: 600; }
.bot-settle-table td.pnl-neg { color: #f87171; font-weight: 600; }
.bot-settle-table td.bot-settle-time {
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.user-table td.pnl-pos { color: #4ade80; font-weight: 600; }
.user-table td.pnl-neg { color: #f87171; font-weight: 600; }
.bot-settle-table td:nth-child(3) { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .detail-grid { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
}

.toast {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: #1b273d;
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: 10px;
  z-index: 200;
  box-shadow: var(--shadow);
}
.toast.show { display: block; }

/* 聊天 — 收件箱式布局 */
.chat-page-header {
  margin-bottom: 4px;
}
.chat-hub {
  padding: 0 16px 20px;
}
.chat-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(13, 21, 38, 0.85);
  border: 1px solid rgba(58, 78, 112, 0.55);
}
.chat-tab {
  min-height: 42px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.chat-tab.active {
  background: linear-gradient(180deg, #4d96ff 0%, var(--accent) 55%, var(--accent2) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(31, 111, 235, 0.35);
}
.chat-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.chat-tab:not(.active) .chat-tab-badge {
  background: rgba(61, 139, 253, 0.18);
  color: #9ec5ff;
}
.chat-panel {
  display: none;
}
.chat-panel.active {
  display: block;
}
.chat-panel-toolbar {
  margin-bottom: 12px;
}
.chat-panel-toolbar .chat-quick-pill {
  width: 100%;
}
.chat-quick-join-full {
  width: 100%;
}
.chat-quick-bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 12px;
}
.chat-quick-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #4ea0ff 0%, #1f6feb 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(31, 111, 235, 0.35);
  flex-shrink: 0;
}
.chat-quick-pill:active {
  transform: scale(0.98);
  opacity: 0.94;
}
.chat-quick-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.chat-quick-join {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(21, 32, 54, 0.92);
  border: 1px solid rgba(58, 78, 112, 0.65);
}
.chat-quick-join input {
  flex: 1;
  min-width: 0;
  margin: 0;
  min-height: 38px;
  padding: 0 12px;
  border: none;
  background: transparent;
  box-shadow: none;
  font-size: 14px;
}
.chat-quick-join input:focus {
  box-shadow: none;
}
.chat-quick-join-btn {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  background: rgba(61, 139, 253, 0.18);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.chat-quick-join-btn:active {
  background: rgba(61, 139, 253, 0.28);
}
.chat-create-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(21, 32, 54, 0.55);
  border: 1px dashed rgba(61, 139, 253, 0.35);
}
.chat-create-bar input {
  flex: 1;
  min-width: 120px;
  margin: 0;
  min-height: 40px;
}
.chat-create-hint {
  width: 100%;
  margin: 0;
  font-size: 11px;
}
.chat-inbox {
  background: linear-gradient(180deg, rgba(21, 32, 54, 0.98) 0%, rgba(15, 24, 40, 0.98) 100%);
  border: 1px solid rgba(58, 78, 112, 0.55);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.chat-inbox-block {
  border-bottom: 1px solid rgba(58, 78, 112, 0.35);
}
.chat-inbox-block:last-child {
  border-bottom: none;
}
.chat-inbox-block.hidden {
  display: none;
}
.chat-inbox-label {
  padding: 10px 16px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.chat-inbox-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: default;
  box-sizing: border-box;
}
.chat-inbox-block.is-collapsible .chat-inbox-toggle {
  cursor: pointer;
}
.chat-inbox-block.is-collapsible .chat-inbox-toggle:active {
  background: rgba(61, 139, 253, 0.06);
}
.chat-inbox-toggle-text {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.chat-inbox-toggle-count {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(61, 139, 253, 0.14);
  color: #9ec5ff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.chat-inbox-toggle-chevron {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  margin-top: -3px;
  opacity: 0;
}
.chat-inbox-block.is-collapsible .chat-inbox-toggle-chevron {
  opacity: 0.75;
}
.chat-inbox-block.is-collapsed .chat-inbox-toggle-chevron {
  transform: rotate(-45deg);
  margin-top: 2px;
}
.chat-inbox-block.is-collapsed .chat-inbox-body {
  display: none;
}
.chat-inbox-body .chat-thread-list > .chat-thread-row:first-child,
.chat-inbox-body .chat-thread-list > .chat-thread-row-wrap:first-child {
  border-top: none;
}
.chat-thread-list {
  display: flex;
  flex-direction: column;
}
.chat-thread-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px 12px 16px;
  border: none;
  border-top: 1px solid rgba(58, 78, 112, 0.22);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
  box-sizing: border-box;
}
.chat-thread-list > .chat-thread-row:first-child,
.chat-thread-list > .chat-thread-row:first-of-type {
  border-top: none;
}
.chat-thread-row:active,
.chat-thread-row:hover {
  background: rgba(61, 139, 253, 0.08);
}
.chat-thread-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.chat-thread-avatar.is-support {
  background: linear-gradient(145deg, rgba(61, 139, 253, 0.35), rgba(31, 111, 235, 0.2));
  color: #9ec5ff;
  border: 1px solid rgba(61, 139, 253, 0.35);
}
.chat-thread-avatar.is-official {
  background: linear-gradient(145deg, rgba(212, 167, 44, 0.28), rgba(194, 122, 46, 0.18));
  color: #f0c96a;
  border: 1px solid rgba(212, 167, 44, 0.35);
}
.chat-thread-avatar.is-group {
  background: linear-gradient(145deg, rgba(63, 185, 80, 0.22), rgba(46, 160, 67, 0.12));
  color: #7ee787;
  border: 1px solid rgba(63, 185, 80, 0.3);
}
.chat-thread-avatar.is-owned {
  background: linear-gradient(145deg, rgba(163, 113, 247, 0.28), rgba(137, 87, 229, 0.15));
  color: #d2a8ff;
  border: 1px solid rgba(163, 113, 247, 0.35);
}
.chat-thread-main {
  flex: 1;
  min-width: 0;
}
.chat-thread-title {
  display: block;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-thread-preview {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-thread-badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(61, 139, 253, 0.15);
  color: #9ec5ff;
  border: 1px solid rgba(61, 139, 253, 0.25);
}
.chat-thread-badge.is-join {
  background: rgba(63, 185, 80, 0.14);
  color: #7ee787;
  border-color: rgba(63, 185, 80, 0.28);
}
.chat-unread-badge {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f85149;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(248, 81, 73, 0.35);
}
.tab-item {
  position: relative;
}
.tab-unread-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 22px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #f85149;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}
.chat-thread-chevron {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  opacity: 0.55;
}
.chat-thread-row-wrap {
  display: flex;
  align-items: stretch;
  border-top: 1px solid rgba(58, 78, 112, 0.22);
}
.chat-thread-list > .chat-thread-row-wrap:first-child {
  border-top: none;
}
.chat-thread-row-wrap .chat-thread-row {
  border-top: none;
  flex: 1;
}
.chat-thread-remove {
  flex-shrink: 0;
  align-self: center;
  margin-right: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: rgba(229, 83, 75, 0.1);
  color: #ff8a84;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.chat-thread-remove:active {
  background: rgba(229, 83, 75, 0.22);
}
.chat-thread-empty,
.chat-thread-loading {
  padding: 18px 16px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.chat-thread-empty::before {
  content: "💬";
  display: block;
  font-size: 22px;
  margin-bottom: 6px;
  opacity: 0.65;
}
@media (max-width: 380px) {
  .chat-quick-pill { padding: 0 12px; font-size: 13px; }
  .chat-quick-join-btn { padding: 0 10px; }
  .chat-thread-avatar { width: 40px; height: 40px; font-size: 14px; }
}

/* 兼容旧类名（管理端等） */
.chat-actions { padding: 0 16px 8px; }
.chat-action-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.chat-action-row input {
  flex: 1;
  min-width: 0;
  margin: 0;
  min-height: 44px;
  font-size: 14px;
}
.chat-join-btn {
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 12px;
  white-space: nowrap;
  font-weight: 650;
}
.chat-support-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 14px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #4ea0ff, #1f6feb);
  color: #fff;
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow:
    0 4px 14px rgba(31, 111, 235, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.chat-support-btn svg {
  flex-shrink: 0;
}
.chat-support-btn:active {
  transform: scale(0.97);
  opacity: 0.92;
}
.chat-room-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(13, 21, 38, 0.55);
  color: inherit;
  text-align: left;
  box-sizing: border-box;
}
.chat-card-body {
  flex: 1;
  min-width: 0;
}
.chat-card-body strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-card-body .hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.chat-card-actions .btn-sm {
  flex-shrink: 0;
  white-space: nowrap;
}
.chat-room-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.admin-support-room.chat-room-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
  padding: 12px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.admin-support-room.chat-room-item strong {
  grid-column: 1;
  grid-row: 1;
}
.admin-support-room.chat-room-item .hint {
  grid-column: 1;
  grid-row: 2;
  margin-top: 0;
}
.admin-support-room.chat-room-item .chat-unread-badge {
  grid-column: 2;
  grid-row: 1 / span 2;
}
.chat-room-item strong { display: block; font-size: 15px; }
.chat-room-item .hint { font-size: 12px; margin-top: 4px; }
.chat-thread-hd { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; }
.chat-thread-title-wrap { flex: 1; min-width: 0; }
.chat-thread-hd h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  word-break: break-word;
}
.chat-thread-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}
.chat-share-btn { flex-shrink: 0; margin-top: 2px; white-space: nowrap; }
.chat-thread-bd {
  display: flex;
  flex-direction: column;
  position: relative;
  height: calc(100vh - 72px);
  max-height: calc(100dvh - 72px);
  padding-bottom: 0 !important;
  overflow: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chat-thread-bd::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.chat-new-msg-hint {
  position: absolute;
  left: 50%;
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 3;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(61, 139, 253, 0.45);
  background: rgba(28, 52, 88, 0.96);
  color: #9ecbff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  white-space: nowrap;
}
.chat-new-msg-hint:active {
  background: rgba(38, 68, 112, 0.98);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background:
    radial-gradient(ellipse at top, rgba(61, 139, 253, 0.06), transparent 55%),
    linear-gradient(180deg, #0e1628 0%, #0b1220 100%);
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.chat-messages::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.chat-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: 100%;
}
.chat-row.mine {
  flex-direction: row-reverse;
}
.chat-row-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #1a2740;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.chat-row-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: calc(100% - 52px);
  min-width: 0;
}
.chat-row.mine .chat-row-main {
  align-items: flex-end;
}
.chat-row-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 2px 4px;
  max-width: 100%;
}
.chat-row.mine .chat-row-meta {
  flex-direction: row-reverse;
}
.chat-read-status {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
  opacity: 0.85;
  user-select: none;
}
.chat-read-status.is-read {
  color: #7d8da6;
}
.chat-read-status.is-unread {
  color: #c98945;
}
.chat-row-name {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.chat-row-time {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.75);
  flex-shrink: 0;
}
.chat-bubble {
  position: relative;
  max-width: min(280px, 72vw);
  padding: 9px 12px;
  border-radius: 4px 12px 12px 12px;
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.chat-bubble.mine {
  align-self: auto;
  background: linear-gradient(180deg, #9af071 0%, #7ed957 100%);
  color: #14301a;
  border: none;
  border-radius: 12px 4px 12px 12px;
}
.chat-bubble.theirs {
  align-self: auto;
  background: #1e2c45;
  color: var(--text, #e8eef8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px 12px 12px 12px;
}
.chat-bubble.theirs::before,
.chat-bubble.mine::before {
  content: "";
  position: absolute;
  top: 10px;
  width: 0;
  height: 0;
  border-style: solid;
}
.chat-bubble.theirs::before {
  left: -6px;
  border-width: 5px 6px 5px 0;
  border-color: transparent #1e2c45 transparent transparent;
}
.chat-bubble.mine::before {
  right: -6px;
  border-width: 5px 0 5px 6px;
  border-color: transparent transparent transparent #7ed957;
}
.chat-bubble .chat-meta {
  display: none;
}
.chat-compose {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: rgba(18, 26, 43, 0.98);
  flex-shrink: 0;
}
.chat-compose input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
}
.chat-compose .btn-chat-send,
.chat-compose .btn-primary {
  flex: 0 0 auto;
  width: auto;
  min-width: 56px;
  padding: 10px 14px;
  white-space: nowrap;
}
.chat-points-toggle-row {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}
.chat-points-toggle-row .btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}
.chat-points-bar {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(18, 26, 43, 0.55);
}
.chat-points-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.chat-points-head .hint {
  margin-left: auto;
}
.chat-points-form input[type="number"] {
  width: 96px;
  min-width: 80px;
}
.chat-points-form input[type="text"] {
  flex: 1 1 140px;
  min-width: 120px;
}
.btn-chat-tool {
  flex: 0 0 auto;
  min-width: 40px;
  padding: 8px 6px;
  font-size: 18px;
  line-height: 1;
}
.chat-emoji-panel {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  background: rgba(18, 26, 43, 0.98);
  max-height: 160px;
  overflow-y: auto;
  flex-shrink: 0;
}
.chat-emoji-btn {
  border: none;
  background: transparent;
  font-size: 22px;
  line-height: 1.2;
  padding: 6px 0;
  border-radius: 8px;
  cursor: pointer;
}
.chat-emoji-btn:active,
.chat-emoji-btn:hover {
  background: rgba(61, 139, 253, 0.18);
}
.chat-bubble-emoji {
  font-size: 28px;
  line-height: 1.2;
  padding: 8px 10px;
  background: transparent !important;
  box-shadow: none;
}
.chat-bubble-emoji::before {
  display: none;
}
.chat-emoji {
  font-size: 32px;
  line-height: 1.2;
}
.chat-bubble-media {
  padding: 4px;
  background: transparent !important;
  border: none;
  box-shadow: none;
}
.chat-bubble-media::before {
  display: none;
}
.chat-bubble-media.mine {
  background: transparent;
  border: none;
}
.chat-img-link {
  display: block;
  max-width: min(240px, 70vw);
}
.chat-img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* 活动面板（后台） */
.activity-panel {
  border-color: rgba(61, 139, 253, 0.28);
  background:
    linear-gradient(145deg, rgba(61, 139, 253, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(21, 32, 54, 0.98) 0%, rgba(14, 22, 38, 0.98) 100%);
}
.activity-panel-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.activity-panel-title h3 {
  margin: 0 0 6px;
}
.activity-panel-title .hint {
  margin: 0;
  line-height: 1.5;
}
.activity-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.activity-badge.is-off {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.22);
}
.activity-badge.is-wait {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.28);
}
.activity-badge.is-live {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.14);
  border-color: rgba(74, 222, 128, 0.3);
}
.activity-panel-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 14px;
}
.activity-switch {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(61, 139, 253, 0.22);
  background: rgba(11, 18, 32, 0.55);
  cursor: pointer;
  user-select: none;
}
.activity-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.activity-switch-ui {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  margin-top: 2px;
  border-radius: 999px;
  background: #334155;
  transition: background 0.2s ease;
}
.activity-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}
.activity-switch input:checked + .activity-switch-ui {
  background: var(--accent, #3d8bfd);
}
.activity-switch input:checked + .activity-switch-ui::after {
  transform: translateX(18px);
}
.activity-switch-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.activity-switch-text strong {
  font-size: 14px;
  color: var(--text, #e8eef8);
}
.activity-switch-text small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.activity-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.activity-time-grid .field-label {
  margin: 0;
}
.activity-time-grid input {
  width: 100%;
  margin-top: 4px;
}
.activity-status-line {
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
}
@media (max-width: 640px) {
  .activity-time-grid {
    grid-template-columns: 1fr;
  }
  .activity-panel-hd {
    flex-direction: column;
  }
}

/* 前端活动滚动公告 */
.activity-marquee {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 12px 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.16), rgba(61, 139, 253, 0.12));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
  overflow: hidden;
}
.activity-marquee-icon {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}
.activity-marquee-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.activity-marquee-track {
  display: block;
  width: max-content;
  max-width: none;
}
.activity-marquee-text {
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  color: #fde68a;
  letter-spacing: 0.02em;
  animation: activity-marquee-scroll 18s linear infinite;
}
.activity-marquee-text span {
  white-space: nowrap;
  padding-right: 48px;
}
@keyframes activity-marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* 排行榜 */
.rank-toolbar {
  margin: 0 16px 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: 16px;
  border: 1px solid rgba(61, 139, 253, 0.22);
  background:
    linear-gradient(165deg, rgba(61, 139, 253, 0.1), transparent 42%),
    linear-gradient(180deg, #182438 0%, #121c2e 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}
.rank-field,
.rank-date-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rank-field-label {
  font-size: 12px;
  color: #a8b8d0;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.rank-select-wrap {
  position: relative;
}
.rank-select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #d7e3f7;
  border-bottom: 2px solid #d7e3f7;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}
.rank-select,
.rank-date-input {
  width: 100%;
  min-height: 46px;
  padding: 11px 40px 11px 14px;
  font-size: 15px;
  font-weight: 650;
  color: #f2f6fc !important;
  color-scheme: dark;
  border: 1px solid rgba(120, 160, 220, 0.45) !important;
  border-radius: 12px !important;
  background:
    linear-gradient(180deg, #243552 0%, #1a2740 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.18) !important;
}
.rank-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  cursor: pointer;
}
.rank-select option {
  color: #0b1220;
  background: #f5f8fc;
  font-weight: 600;
}
.rank-select:hover,
.rank-date-input:hover {
  border-color: rgba(61, 139, 253, 0.75) !important;
}
.rank-select:focus,
.rank-date-input:focus {
  border-color: var(--accent) !important;
  box-shadow:
    0 0 0 3px rgba(61, 139, 253, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}
.rank-date-input {
  padding-right: 12px;
}
.rank-board-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(8, 14, 26, 0.55);
  border: 1px solid rgba(42, 58, 85, 0.9);
}
.rank-board-tab {
  padding: 10px 8px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #9aadc6;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.rank-board-tab.active {
  color: #fff;
  background: linear-gradient(180deg, #3d8bfd, #1f6feb);
  box-shadow: 0 4px 12px rgba(31, 111, 235, 0.35);
}
.rank-date-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.rank-refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(120, 160, 220, 0.4);
  background: linear-gradient(180deg, #2a3d5c, #1c2b44);
  color: #e8eef8;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.rank-refresh-btn:active { opacity: 0.85; transform: scale(0.98); }
.rank-mode-hint {
  margin: 0;
  padding: 0;
  color: #8fa0b8;
  font-size: 12px;
}
.rank-section {
  overflow: hidden;
}
.rank-section-hd {
  align-items: center;
  background: linear-gradient(90deg, rgba(61, 139, 253, 0.12), transparent);
}
.rank-section .section-bd {
  background:
    radial-gradient(520px 180px at 50% 0%, rgba(245, 197, 66, 0.07), transparent 55%),
    var(--card);
}

.rank-podium {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 10px;
  align-items: end;
  padding: 12px 2px 20px;
  min-height: 220px;
}
.podium-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}
.podium-user {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  width: 100%;
}
.rank-crown { display: block; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)); }
.podium-avatar,
.rank-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #1b273d;
  border: 2px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}
.podium-1 .podium-avatar {
  width: 68px;
  height: 68px;
  border-width: 3px;
  border-color: #f5c542;
  box-shadow: 0 0 0 3px rgba(245, 197, 66, 0.22), 0 8px 18px rgba(245, 197, 66, 0.25);
}
.podium-2 .podium-avatar {
  border-color: #c5ceda;
  box-shadow: 0 0 0 2px rgba(197, 206, 218, 0.2), 0 6px 14px rgba(0, 0, 0, 0.25);
}
.podium-3 .podium-avatar {
  border-color: #d4925a;
  box-shadow: 0 0 0 2px rgba(212, 146, 90, 0.22), 0 6px 14px rgba(0, 0, 0, 0.25);
}
.podium-name {
  font-size: 13px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-1 .podium-name { color: #ffe7a0; font-size: 14px; }
.podium-2 .podium-name { color: #e4ebf5; }
.podium-3 .podium-name { color: #f0c9a4; }
.podium-pnl {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.podium-pnl.pos { color: #4ade80; }
.podium-pnl.neg { color: #f87171; }
.podium-base {
  width: 100%;
  border-radius: 14px 14px 10px 10px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 6px 16px rgba(0, 0, 0, 0.25);
}
.podium-1 .podium-base {
  height: 96px;
  background: linear-gradient(180deg, #f6d76a 0%, #d4a017 48%, #9a6f08 100%);
  color: #3a2a00;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}
.podium-2 .podium-base {
  height: 72px;
  background: linear-gradient(180deg, #e8eef8 0%, #aeb8c8 48%, #7d8798 100%);
  color: #1c2430;
}
.podium-3 .podium-base {
  height: 56px;
  background: linear-gradient(180deg, #e8b07a 0%, #c0783c 48%, #8a5024 100%);
  color: #2e1808;
}
.podium-empty .podium-base { opacity: 0.4; filter: grayscale(0.35); }
.podium-empty.podium-1 .podium-base,
.podium-empty.podium-2 .podium-base,
.podium-empty.podium-3 .podium-base {
  color: rgba(255, 255, 255, 0.7);
}

.rank-list { padding: 0 2px; }
.rank-row {
  display: grid;
  grid-template-columns: 36px 40px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 11px 8px;
  margin-bottom: 6px;
  border: 1px solid rgba(42, 58, 85, 0.85);
  border-radius: 12px;
  background: rgba(11, 18, 32, 0.35);
}
.rank-row .rank-no {
  font-size: 15px;
  font-weight: 800;
  color: #8fa0b8;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.rank-avatar {
  width: 40px;
  height: 40px;
  border-width: 2px;
}
.rank-meta { min-width: 0; }
.rank-row .rank-user {
  font-weight: 650;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-row .hint {
  margin-top: 2px;
  font-size: 11px;
}
.rank-row .rank-pnl {
  font-weight: 800;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.rank-row .rank-pnl.pos { color: #4ade80; }
.rank-row .rank-pnl.neg { color: #f87171; }
.rank-list > .hint {
  text-align: center;
  padding: 24px 8px;
}
