:root {
  --page-bg: #f7f7f7;
  --page-bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-accent: #fdf5f2;
  --text: #111827;
  --muted: #6b7280;
  --border: rgba(17, 24, 39, 0.04);
  --border-strong: rgba(17, 24, 39, 0.18);
  --primary: #F0642F;
  --primary-strong: #d04b1a;
  --primary-soft: #fdf5f2;
  --danger: #bf3f34;
  --danger-soft: #f7d5d0;
  --link: #F0642F;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: #f7f7f7;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  position: relative;
  padding: 0;
}

.page-app {
  max-width: none;
  margin: 0;
  display: flex;
}

/* ── Sidebar ── */
#sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 192px;
  background: rgba(255, 255, 255, 0.96);
  border-right: 1px solid var(--border);
  padding: 1rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
}

#sidebar .logo {
  display: flex;
  align-items: center;
  height: 56px;
  margin-bottom: 8px;
}

#sidebar .logo img {
  height: 32px;
  width: auto;
}

#sidebar .nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#sidebar .nav-group + .nav-group {
  margin-top: 20px;
}

#sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 16px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

#sidebar .nav-link .nav-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#sidebar .nav-link:hover {
  background: #f9fafb;
}

#sidebar .nav-link.active {
  color: var(--primary);
}

#sidebar .nav-link.inactive {
  color: #4b5563;
}

#sidebar .nav-link.inactive:hover {
  color: var(--primary);
}

#sidebar .user-area {
  margin-top: auto;
  padding-top: 8px;
}

#sidebar .user-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 8px;
  margin-left: -8px;
  margin-right: -8px;
  margin-top: -4px;
  margin-bottom: 8px;
  transition: background 0.15s;
}

#sidebar .user-trigger:hover {
  background: #f3f4f6;
}

#sidebar .user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
}

#sidebar .user-avatar.has-image,
.upload-bar-left .user-avatar-lg.has-image {
  background: transparent;
}

#sidebar .user-avatar img,
.upload-bar-left .user-avatar-lg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#sidebar .user-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#sidebar .user-ellipsis {
  color: #9ca3af;
  font-size: 0.75rem;
  margin-left: auto;
}

#sidebar .sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  padding-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#sidebar .sidebar-footer .copyright {
  font-size: 10px;
  color: #9ca3af;
}

#sidebar .sidebar-footer a {
  font-size: 10px;
  color: #9ca3af;
  text-decoration: none;
  display: block;
  transition: color 0.15s;
}

#sidebar .sidebar-footer a:hover {
  color: var(--primary);
}

/* ── Content Area ── */
#content {
  margin-left: 192px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Upload Section ── */
.upload-section {
  background: #fff;
  padding: 0.75rem 1.5rem;
}

.upload-section .result,
.upload-section .error {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  margin-top: 10px;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 0.84rem;
}

.upload-bar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.upload-bar-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.upload-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.upload-bar-left .user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
}

.upload-bar-left .user-avatar-lg {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.upload-bar-left .user-meta {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.upload-meta-bars {
  display: none;
}

.upload-bar-left .token-info {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  text-align: left;
}

.upload-bar-left .token-info .token-value {
  font-weight: bold;
}

.token-unit {
  font-size: 0.75rem;
  color: var(--muted);
}

.upload-bar-left .storage-label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 2px;
}

.upload-bar-left .storage-label > span {
  font-size: 0.75rem;
  width: auto;
  text-align: right;
}

.upload-bar-left .storage-bar {
  display: none;
}

.upload-bar-left .storage-fill {
  display: none;
}

.upload-bar-left .user-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.upload-bar-left .user-meta-top .username {
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
}

.upload-bar-left .user-meta-top .plan-badge {
  font-family: sans-serif;
  font-size: 10px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: var(--primary);
  border: 1px solid #fed7aa;
  font-weight: 500;
}

.btn-outline {
  background: #fff;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.625rem 1.5rem;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 40px;
  transition: background 0.15s;
  font-family: inherit;
  box-shadow: none;
}

.btn-outline:hover {
  background: #fff7ed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 0.625rem 1.5rem;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  min-height: 40px;
  transition: opacity 0.15s;
  font-family: inherit;
  box-shadow: none;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:disabled {
  cursor: default;
  opacity: 0.4;
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  width: 100%;
  padding: 0 2rem 3rem 2rem;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
}

.page-forum {
  max-width: 1180px;
  margin: 0 auto;
}

.page-auth {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.arena-main {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 112px 24px 64px;
}

.arena-title-block {
  margin-bottom: 30px;
}

.arena-title-block h1 {
  margin: 0 0 8px;
  color: #111827;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.arena-title-block p {
  margin: 0;
  color: #4b5563;
  font-size: 1.08rem;
  line-height: 1.6;
}

.arena-toolbar {
  margin: 0 -24px 32px;
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
}

.arena-toolbar::-webkit-scrollbar {
  display: none;
}

.arena-category-chips {
  display: flex;
  gap: 8px;
  min-width: max-content;
}

.arena-chip {
  min-height: 38px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  box-shadow: none;
  font-size: 0.9rem;
  font-weight: 650;
}

.arena-chip:hover {
  transform: none;
  background: #ffedd5;
  color: #f0642f;
}

.arena-chip.is-active {
  background: #f0642f;
  color: #fff;
  box-shadow: none;
}

.arena-masonry {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.arena-card {
  overflow: hidden;
  border: 1px solid #f3f4f6;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.36s ease, transform 0.36s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.arena-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.arena-card:hover {
  border-color: #fed7aa;
  box-shadow: 0 18px 38px rgba(17, 24, 39, 0.1);
}

.arena-card-preview {
  --gh-angle: -45deg;
  --gh-duration: 320ms;
  --gh-size: 240%;
  --gh-rgba: rgba(255, 255, 255, 0.5);
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f3f4f6;
  box-shadow: none;
  color: inherit;
  cursor: pointer;
  isolation: isolate;
}

.arena-card-preview:hover {
  transform: none;
}

.arena-card-preview::before,
.arena-card-preview::after {
  content: "";
  position: absolute;
  z-index: 2;
  pointer-events: none;
  inset: 0;
}

.arena-card-preview::before {
  background: linear-gradient(
    var(--gh-angle),
    hsla(0, 0%, 0%, 0) 58%,
    var(--gh-rgba) 68%,
    hsla(0, 0%, 0%, 0) 78%,
    hsla(0, 0%, 0%, 0) 100%
  );
  transition: background-position var(--gh-duration) ease;
  background-size: var(--gh-size) var(--gh-size), 100% 100%;
  background-repeat: no-repeat;
  background-position: -100% -100%, 0 0;
  mix-blend-mode: screen;
}

.arena-card-preview::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 26%, rgba(255, 255, 255, 0.03));
  z-index: 1;
}

.arena-card-img {
  object-position: top;
}

.arena-card-preview .thumb-screenshot,
.arena-card-preview .thumb-placeholder {
  transition: transform 220ms ease, filter 220ms ease;
}

.arena-card-preview:hover .thumb-screenshot,
.arena-card-preview:hover .thumb-placeholder {
  transform: scale(1.018);
  filter: saturate(1.04);
}

.arena-card-preview:hover::before {
  background-position: 100% 100%, 0 0;
}

.arena-card-placeholder {
  background: linear-gradient(180deg, #faf7f2 0%, #f3ede4 100%);
}

.arena-card-body {
  display: grid;
  gap: 11px;
  padding: 16px;
}

.arena-card-meta,
.arena-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.arena-card-meta {
  gap: 7px;
  color: #6b7280;
  font-size: 0.78rem;
}

.arena-card-title {
  margin: 0;
  overflow: hidden;
  color: #111827;
  font-size: 0.96rem;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arena-author-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  flex: 0 0 auto;
  overflow: hidden;
}

.arena-author-name {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arena-author-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.arena-action {
  gap: 5px;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6b7280;
  box-shadow: none;
  font-size: 0.78rem;
  font-weight: 500;
}

.arena-action.is-active {
  background: transparent;
  color: #f0642f;
}

.arena-action:hover {
  transform: none;
  color: #f0642f;
}

.arena-state {
  min-height: 36px;
  padding: 100px 0 28px;
  text-align: center;
  color: #4b5563;
  font-size: 0.9rem;
}

.arena-sentinel {
  width: 100%;
  height: 2px;
}

@media (max-width: 1100px) {
  .arena-masonry {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .arena-masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .arena-card-preview::before,
  .arena-card-preview::after,
  .arena-card-preview .thumb-screenshot,
  .arena-card-preview .thumb-placeholder {
    transition: none;
  }

  .arena-card-preview:hover .thumb-screenshot,
  .arena-card-preview:hover .thumb-placeholder {
    transform: none;
    filter: none;
  }

  .arena-card-preview:hover::before {
    background-position: -100% -100%, 0 0;
  }
}

@media (max-width: 560px) {
  .arena-main {
    padding-inline: 18px;
  }

  .arena-masonry {
    grid-template-columns: 1fr;
  }
}

.site-home {
  width: min(1120px, 100%);
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  margin: auto 0;
}

.site-home-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.site-home-entry-btn {
  min-height: 44px;
  padding: 0 20px;
}

.auth-shell {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(380px, 480px);
  gap: 26px;
  align-items: stretch;
  flex: 1 0 auto;
  margin: auto 0;
}

.auth-shell-login {
  grid-template-columns: minmax(380px, 480px);
  justify-content: center;
}

.auth-aside {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 20px 10px 20px 6px;
}

.site-home-aside {
  max-width: 620px;
  padding-top: 0;
  padding-bottom: 0;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 14%, rgba(243, 190, 107, 0.22), transparent 34%),
    radial-gradient(circle at 82% 16%, rgba(80, 141, 153, 0.18), transparent 32%),
    radial-gradient(circle at 48% 88%, rgba(208, 107, 47, 0.14), transparent 28%),
    linear-gradient(180deg, #fffaf2 0%, #f4efe6 52%, #efe5d7 100%);
  z-index: -1;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 0.96;
}

h2 {
  font-size: 1.2rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--primary-strong);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.card {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 248, 238, 0.88));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.auth-card {
  width: 100%;
  min-height: 100%;
  padding: 32px 30px 28px;
}

.auth-card-login {
  min-height: 0;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #f1c88f, #5f9ea0);
}

.auth-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.auth-card-title {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.auth-lead {
  max-width: 520px;
  font-size: 1rem;
}

.auth-visual {
  position: relative;
  min-height: 250px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.75), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(244, 227, 204, 0.74));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.auth-grid {
  position: absolute;
  inset: 24px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 12px;
}

.auth-grid span {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(123, 92, 61, 0.08);
}

.auth-orbit {
  position: absolute;
  border-radius: 999px;
  border: 1px dashed rgba(208, 107, 47, 0.36);
}

.auth-orbit-a {
  width: 220px;
  height: 220px;
  left: -20px;
  top: 12px;
}

.auth-orbit-b {
  width: 180px;
  height: 180px;
  right: 24px;
  bottom: -18px;
  border-color: rgba(24, 90, 114, 0.28);
}

.auth-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.auth-chip-a {
  left: 28px;
  top: 28px;
}

.auth-chip-b {
  right: 34px;
  top: 68px;
}

.auth-chip-c {
  left: 96px;
  bottom: 34px;
}

.auth-points {
  display: grid;
  gap: 12px;
}

.auth-point {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.52);
}

.auth-point strong {
  font-size: 0.95rem;
}

.auth-point span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ── Upload Bar (legacy card wrapper kept for forum) ── */

.user-menu {
  position: relative;
  display: inline-flex;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  min-width: 168px;
  padding: 0 16px 0 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
  font-size: 0.88rem;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease, transform 140ms ease;
}

.user-menu-trigger {
  min-width: 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.user-menu-trigger,
.user-menu-trigger * {
  cursor: pointer;
}

.user-menu-trigger::-webkit-details-marker {
  display: none;
}

.user-menu-trigger:hover,
.user-menu-trigger:focus-visible,
.user-menu[open] .user-menu-trigger {
  border-color: rgba(24, 90, 114, 0.28);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 28px rgba(120, 84, 48, 0.14);
}

.user-menu-trigger:focus-visible {
  outline: none;
}

.user-menu-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  opacity: 0.9;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23786757' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 16.2a6.2 6.2 0 0 0-12 0'/%3E%3Ccircle cx='10' cy='6.6' r='3.1'/%3E%3C/svg%3E");
}

.user-menu-arrow {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.88;
  transition: transform 0.15s ease;
}

.user-menu[open] .user-menu-arrow {
  transform: rotate(225deg) translateY(-1px);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: max(100%, 192px);
  min-width: 0;
  overflow: hidden;
  padding: 6px 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: var(--shadow-soft);
  z-index: 18;
}

.user-menu-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.user-menu-list-item {
  margin: 0;
}

.user-menu-item {
  width: 100%;
  min-height: 44px;
  padding: 0 16px 0 18px;
  border: 1px solid transparent;
  border-radius: 0;
  justify-content: flex-start;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
  background: transparent;
  box-shadow: none;
}

.user-menu-item:hover {
  transform: none;
  background: rgba(24, 90, 114, 0.08);
  border-color: transparent;
}

.panel-heading,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.panel-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0 20px;
}

.mode-btn {
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: none;
}

.mode-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: #fffaf2;
}

.mode-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.mode-btn-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}

.auth-mode-note {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.auth-wechat-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 22px;
}

.auth-wechat-entry::before,
.auth-wechat-entry::after {
  content: "";
  flex: 1 1 auto;
  min-width: 0;
  border-top: 1px solid rgba(123, 92, 61, 0.16);
}

.auth-wechat-btn {
  position: relative;
  width: 40px;
  height: 40px;
  min-height: 0;
  margin: 0 auto;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(123, 92, 61, 0.18);
  background: #fff;
  color: #07c160;
  box-shadow: 0 2px 6px rgba(120, 84, 48, 0.04);
}

.auth-wechat-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(45, 36, 29, 0.94);
  color: #fffaf2;
  font-size: 0.76rem;
  line-height: 1;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.auth-wechat-btn:hover:not(:disabled) {
  border-color: rgba(123, 92, 61, 0.28);
  background: #fff;
  box-shadow: 0 6px 14px rgba(120, 84, 48, 0.08);
}

.auth-wechat-btn:hover::after,
.auth-wechat-btn:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.auth-wechat-btn.is-unconfigured {
  color: var(--muted);
  border-color: var(--border);
  opacity: 0.82;
}

.auth-wechat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.auth-wechat-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}


.content-section {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.section-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
}

.section-tab {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  background: #f3f4f6;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  min-height: 0;
  box-shadow: none;
  letter-spacing: 0;
}

.section-tab:hover {
  background: var(--primary-soft);
  color: var(--text);
}

.section-tab.active {
  background: var(--primary);
  color: #fff;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ── Arena Card (for likes/favorites list) ── */
.arena-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e3e3e3;
  overflow: hidden;
  opacity: 1;
  transform: none;
}

.arena-card:hover {
}

.arena-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border: none;
  outline: none;
  border-radius: 8px;
}

.arena-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #f5f5f0, #e5e5e0);
  background-size: cover;
  background-position: center;
}

.arena-card-info {
  padding: 12px 14px;
}

.arena-card-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arena-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.arena-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.arena-card-meta i {
  font-size: 11px;
}

.loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
}

.billing-section {
  display: grid;
  gap: 18px;
}

#rechargeSection {
  gap: 0;
}

#rechargeSection .recharge-wrapper {
  max-width: 520px;
}

#rechargeSection .recharge-title {
  margin: 0 0 1.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

#rechargeSection .amount-label,
#rechargeSection .payment-label {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

#rechargeSection .amount-grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

#rechargeSection .amount-btn {
  min-width: 0;
  height: 38px;
  padding: 0 0.625rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: #f9fafb;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  white-space: nowrap;
  flex: 1 1 0;
}

#rechargeSection .amount-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--text);
}

#rechargeSection .amount-btn.selected,
#rechargeSection .amount-btn.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

#rechargeSection .custom-input-row {
  margin-bottom: 1.5rem;
}

#rechargeSection .custom-input-row[hidden] {
  display: none !important;
}

#rechargeSection .custom-input-row.show {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#rechargeSection .custom-input-wrapper {
  position: relative;
}

#rechargeSection .custom-input-prefix {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  color: var(--muted);
  pointer-events: none;
}

#rechargeSection .custom-input {
  width: 100%;
  height: 38px;
  padding: 0.5rem 0.75rem 0.5rem 1.75rem;
  font-size: 0.875rem;
  color: var(--text);
  border: 1.5px solid var(--border-strong);
  border-radius: 10px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
  background: transparent;
  appearance: textfield;
  -moz-appearance: textfield;
  -webkit-appearance: none;
  box-shadow: none;
}

#rechargeSection .custom-input:focus {
  border-color: var(--primary);
}

#rechargeSection .custom-input::-webkit-outer-spin-button,
#rechargeSection .custom-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#rechargeSection .custom-input-feedback {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.8;
}

#rechargeSection .payment-cards {
  display: flex;
  gap: 12px;
  margin-bottom: 1.5rem;
}

#rechargeSection .payment-card {
  flex: 1;
  max-width: 280px;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.15s, background 0.15s;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

#rechargeSection .payment-card:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

#rechargeSection .payment-card.selected,
#rechargeSection .payment-card.is-active {
  border-color: var(--primary);
}

#rechargeSection .payment-card .pc-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#rechargeSection .payment-card .pc-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

#rechargeSection .payment-card .pc-icon.alipay {
  color: #1677FF;
}

#rechargeSection .payment-card .pc-icon.wechat {
  color: #22AC38;
}

#rechargeSection .payment-card .pc-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

#rechargeSection .payment-card .pc-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

#rechargeSection .payment-card.selected .pc-check,
#rechargeSection .payment-card.is-active .pc-check {
  border-color: var(--primary);
  background: var(--primary);
}

#rechargeSection .payment-card.selected .pc-check::after,
#rechargeSection .payment-card.is-active .pc-check::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -1px;
}

#rechargeSection .pay-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  margin-bottom: 0.75rem;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
}

#rechargeSection .pay-btn.active {
  background: var(--primary);
  color: #fff;
}

#rechargeSection .pay-btn.active:hover:not(:disabled) {
  opacity: 0.9;
}

#rechargeSection .pay-btn:disabled,
#rechargeSection .pay-btn.disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: default;
}

#rechargeSection .pay-account {
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 1.5rem;
}

#rechargeSection .wallet-inline-result,
#rechargeSection .error {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

#rechargeSection .wallet-inline-result {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.8125rem;
}

#rechargeSection .recharge-tips {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-strong);
}

#rechargeSection .recharge-tips strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--text);
}

#rechargeSection .recharge-tips > span {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.8;
}

.page-wallet {
  background: #f6f6f6;
}

.wallet-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.wallet-brand {
  display: inline-flex;
  align-items: center;
}

.wallet-brand img {
  height: 30px;
  width: auto;
  display: block;
}

.wallet-topbar-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 98px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 14px;
  background: #fff;
  color: #4b5563;
  text-decoration: none;
  font-size: 15px;
}

.wallet-topbar-actions {
  margin-left: auto;
}

.wallet-shell {
  display: flex;
  min-height: calc(100vh - 72px);
}

.wallet-sidebar {
  width: 276px;
  padding: 40px 18px 32px;
  border-right: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.wallet-sidebar-logo {
  margin-bottom: 40px;
}

.wallet-sidebar-logo img {
  display: block;
  width: 148px;
  max-width: 100%;
}

.wallet-sidebar-nav {
  display: grid;
  gap: 28px;
}

.wallet-sidebar-group {
  display: grid;
  gap: 8px;
}

.wallet-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #4b5563;
  text-decoration: none;
  font-size: 17px;
  transition: color 0.15s, background 0.15s;
}

.wallet-sidebar-link .nav-icon {
  width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wallet-sidebar-link:hover {
  background: #fff;
  color: var(--primary);
}

.wallet-sidebar-link.is-active {
  color: var(--primary);
  background: transparent;
}

.wallet-sidebar-link.is-disabled {
  opacity: 0.8;
  cursor: default;
}

.wallet-sidebar-link.is-disabled:hover {
  background: transparent;
  color: #4b5563;
}

.wallet-main {
  flex: 1;
  padding: 40px 34px 72px;
}

.wallet-summary-card {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 32px 36px;
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

.wallet-summary-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.wallet-summary-body {
  display: grid;
  gap: 16px;
  min-width: 0;
  flex: 1;
}

.wallet-summary-name {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
}

.wallet-summary-metrics {
  display: flex;
  align-items: center;
  gap: 52px;
  flex-wrap: wrap;
}

.wallet-summary-metric {
  min-width: 260px;
  display: grid;
  gap: 10px;
}

.wallet-summary-metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  font-size: 15px;
}

.wallet-summary-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wallet-summary-progress-icon {
  color: var(--primary);
  width: 18px;
  text-align: center;
}

.wallet-summary-progress-bar {
  width: 260px;
  max-width: 100%;
  height: 12px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.wallet-summary-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f97316 0%, #f0642f 100%);
  transition: width 0.2s ease;
}

.wallet-panel {
  margin-top: 24px;
}

.wallet-card {
  max-width: 860px;
  padding: 38px 48px 44px;
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

.wallet-page-title {
  margin: 0 0 34px;
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

.wallet-form-section {
  margin-bottom: 26px;
}

.wallet-form-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 600;
  color: #111827;
}

.wallet-amount-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.wallet-amount-btn {
  min-width: 0;
  height: 52px;
  padding: 0 10px;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: #fff;
  color: #6b7280;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex: 1 1 0;
}

.wallet-amount-btn:hover,
.wallet-amount-btn.is-active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.wallet-custom-input-wrap {
  position: relative;
  margin-top: 14px;
  width: 220px;
}

.wallet-custom-input {
  width: 100%;
  height: 52px;
  padding: 0 44px 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: #fff;
  font-size: 16px;
  color: #111827;
}

.wallet-custom-input-unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
}

.wallet-payment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.wallet-payment-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 0 24px;
  border-radius: 18px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wallet-payment-btn:hover,
.wallet-payment-btn.is-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(240, 100, 47, 0.08);
}

.wallet-payment-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.wallet-payment-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.wallet-payment-badge-alipay {
  background: #1677ff;
}

.wallet-payment-badge-wechat {
  background: #22c55e;
}

.wallet-payment-check {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.15s ease;
}

.wallet-payment-btn.is-active .wallet-payment-check {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.wallet-pay-btn {
  width: 100%;
  height: 64px;
  margin-top: 18px;
  border: none;
  border-radius: 18px;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.wallet-pay-btn:hover:not(:disabled) {
  background: var(--primary-strong);
}

.wallet-pay-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.wallet-account-tip {
  margin: 18px 0 0;
  text-align: center;
  color: #6b7280;
  font-size: 16px;
}

.wallet-inline-result {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff7ed;
  color: #9a3412;
  line-height: 1.6;
}

.wallet-inline-result:empty {
  display: none;
}

.wallet-divider {
  height: 1px;
  margin: 34px 0 32px;
  background: rgba(17, 24, 39, 0.08);
}

.wallet-notes-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.wallet-note-list {
  margin: 0;
  padding-left: 24px;
  display: grid;
  gap: 10px;
  color: #6b7280;
  font-size: 15px;
  line-height: 1.8;
}

.wallet-orders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.wallet-orders-header .wallet-page-title {
  margin: 0;
}

.wallet-refresh-btn,
.wallet-order-query-btn {
  height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 12px;
  background: #fff;
  color: #374151;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.wallet-refresh-btn:hover,
.wallet-order-query-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.wallet-order-query {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.wallet-order-query-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 12px;
  background: #fff;
  color: #111827;
  font-size: 15px;
}

.wallet-bill-table-wrap {
  margin-top: 18px;
}

.wallet-table-empty {
  text-align: center;
  color: #6b7280;
  padding: 28px 12px;
}

.wallet-status-success {
  color: #16a34a;
}

.wallet-status-pending {
  color: #d97706;
}

.wallet-status-failed {
  color: #dc2626;
}

@media (max-width: 1100px) {
  .wallet-shell {
    flex-direction: column;
  }

  .wallet-sidebar {
    width: auto;
    padding: 20px 18px;
    border-right: none;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  }

  .wallet-sidebar-nav {
    gap: 18px;
  }

  .wallet-sidebar-group {
    gap: 4px;
  }

  .wallet-main {
    padding: 24px 18px 48px;
  }

  .wallet-card {
    max-width: none;
    padding: 28px 20px 32px;
  }

  .wallet-summary-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 20px;
  }

  .wallet-summary-metrics {
    gap: 24px;
  }

  .wallet-payment-grid,
  .wallet-order-query {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .wallet-topbar {
    padding: 0 16px;
  }
}

@media (max-width: 720px) {
  #rechargeSection .payment-cards {
    flex-direction: column;
  }

  #rechargeSection .payment-card {
    max-width: none;
  }

  #rechargeSection .amount-grid {
    justify-content: flex-start;
  }
}

.billing-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.billing-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.billing-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bill-refund-btn {
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  min-height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  box-shadow: none;
}

.bill-refund-btn:hover {
  background: #f3f4f6;
  color: var(--text);
  transform: none;
  box-shadow: none;
}

.billing-inline-result {
  margin-top: 0;
}

.billing-inline-result:empty {
  display: none;
}

.bill-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  background: #fff;
}

.bill-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.bill-table th {
  text-align: left;
  padding: 0.625rem 0.75rem;
  background: #fff;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.bill-table td {
  padding: 0.625rem 0.75rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.bill-table tr:last-child td {
  border-bottom: none;
}

.bill-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--muted);
}

.billing-table-code {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #667085;
}

.bill-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8125rem;
}

.bill-status .bs-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.bill-status.success {
  color: #16a34a;
}

.bill-status.success .bs-dot {
  background: #16a34a;
}

.bill-status.failed {
  color: #dc2626;
}

.bill-status.failed .bs-dot {
  background: #dc2626;
}

.bill-status.pending {
  color: #d97706;
}

.bill-status.pending .bs-dot {
  background: #d97706;
}

.bill-status.closed {
  color: #9ca3af;
}

.bill-help-link {
  color: inherit;
  opacity: 0.55;
  margin-left: 4px;
  text-decoration: none;
  font-size: 0.9em;
}

.bill-help-link:hover {
  opacity: 1;
}

.bill-status.closed .bs-dot {
  background: #9ca3af;
}

#refund-modal,
#redeem-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
}

#refund-modal.open,
#redeem-modal.open {
  display: block;
}

#refund-modal .modal-backdrop,
#redeem-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#refund-modal .modal-center,
#redeem-modal .modal-center {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.mhr-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.refund-dialog,
.redeem-dialog {
  position: relative;
  width: calc(100vw - 32px);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 18px 56px rgba(17, 24, 39, 0.16);
  padding: 24px 28px 28px;
}

.refund-dialog {
  max-width: 588px;
}

.redeem-dialog {
  max-width: 426px;
}

.refund-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.refund-tips {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.refund-tips li {
  position: relative;
  padding-left: 28px;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--muted);
}

.refund-tips li::before {
  content: attr(data-num);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  font-weight: 600;
}

.refund-amount-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.refund-amount-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.refund-amount-desc {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.refund-reason label,
.redeem-modal-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.refund-reason textarea,
.redeem-modal-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  font-family: inherit;
}

.refund-reason textarea {
  resize: vertical;
  min-height: 72px;
}

.refund-reason textarea:focus,
.redeem-modal-input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(240, 100, 47, 0.12);
}

.refund-submit-wrap {
  margin-top: 16px;
}

.refund-submit-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.9375rem;
}

.redeem-modal-body {
  margin-top: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.modal-btn {
  min-height: 36px;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  box-shadow: none;
}

.modal-btn:hover,
.refund-submit-btn:hover,
.refund-close-btn:hover,
.redeem-close-btn:hover {
  transform: none;
  box-shadow: none;
}

.refund-close-btn,
.redeem-close-btn {
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 1.125rem;
  box-shadow: none !important;
}

.refund-close-btn:hover,
.redeem-close-btn:hover {
  color: var(--text);
  background: transparent;
}

.refund-submit-btn {
  box-shadow: none;
}

.billing-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(240, 100, 47, 0.4);
  border-radius: 999px;
  font-size: 10px;
  color: var(--primary);
  background: rgba(240, 100, 47, 0.08);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.billing-amount {
  font-weight: 500;
  color: #111827;
}

.bill-sign {
  display: inline-block;
  width: 0.6em;
  text-align: center;
}

.billing-table-empty {
  text-align: center !important;
  color: var(--muted);
}

.form,
.form-stack {
  display: grid;
  gap: 14px;
}

.turnstile-slot {
  width: 100%;
  min-height: 68px;
}

.turnstile-slot[hidden] {
  display: none;
}

.setup-header {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(244, 227, 204, 0.45);
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea,
select,
input[type="file"] {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

input[type="file"] {
  padding: 11px 14px;
}

textarea {
  min-height: 140px;
  padding: 14px;
  resize: vertical;
}

select {
  padding: 0 14px;
}

input:focus {
  outline: none;
  border-color: rgba(208, 107, 47, 0.5);
  box-shadow: 0 0 0 4px rgba(208, 107, 47, 0.12);
}

textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(208, 107, 47, 0.5);
  box-shadow: 0 0 0 4px rgba(208, 107, 47, 0.12);
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.code-input-wrap {
  min-width: 0;
}

button,
a.link-button {
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff8f1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease, border-color 140ms ease;
  box-shadow: 0 10px 22px rgba(208, 107, 47, 0.24);
}

button:hover,
a.link-button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

button.ghost,
a.link-button.ghost {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--border);
  color: var(--text);
  box-shadow: none;
}

button.danger {
  background: #c05a4f;
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(170, 75, 65, 0.2);
}

button.danger:hover {
  background: #ab4a40;
}

.error,
.result,
.tip {
  min-height: 20px;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

.error:empty,
.result:empty,
.tip:empty {
  display: none;
}

.error {
  color: #9d2f25;
  background: rgba(247, 213, 208, 0.72);
}

.result {
  color: #185a72;
  background: rgba(208, 234, 240, 0.68);
}

.tip {
  margin-top: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.52);
}

/* ── Card Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 2rem;
  justify-content: space-between;
  min-width: 0;
  contain: layout style;
}

/* ── Skeleton Card ── */
@keyframes skeleton-shimmer {
  0% { background-position: -300% 0; }
  100% { background-position: 300% 0; }
}

.skeleton-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 248, 238, 0.88));
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.skeleton-card .card-thumbnail {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
}

.skeleton-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(90deg, rgba(120,103,87,0.06) 25%, rgba(120,103,87,0.1) 50%, rgba(120,103,87,0.06) 75%);
  background-size: 300% 100%;
  animation: skeleton-shimmer 1.8s ease-in-out infinite;
}

.skeleton-card .card-body {
  flex-shrink: 0;
  min-width: 0;
  padding: 10px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
}

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

.skeleton-name {
  width: 55%;
  height: 16px;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(120,103,87,0.08) 25%, rgba(120,103,87,0.14) 50%, rgba(120,103,87,0.08) 75%);
  background-size: 300% 100%;
  animation: skeleton-shimmer 1.8s ease-in-out infinite;
}

.skeleton-badge {
  width: 42px;
  height: 18px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(120,103,87,0.06) 25%, rgba(120,103,87,0.1) 50%, rgba(120,103,87,0.06) 75%);
  background-size: 300% 100%;
  animation: skeleton-shimmer 1.8s ease-in-out infinite;
}

.skeleton-meta {
  height: 12px;
  width: 40%;
  border-radius: 4px;
  background:
    linear-gradient(90deg, rgba(120,103,87,0.06) 25%, rgba(120,103,87,0.1) 50%, rgba(120,103,87,0.06) 75%);
  background-size: 300% 100%;
  animation: skeleton-shimmer 1.8s ease-in-out infinite;
}

.skeleton-more {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(120,103,87,0.06) 25%, rgba(120,103,87,0.1) 50%, rgba(120,103,87,0.06) 75%);
  background-size: 300% 100%;
  animation: skeleton-shimmer 1.8s ease-in-out infinite;
}

.card-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 16px;
  text-align: center;
  grid-column: 1 / -1;
  color: var(--muted);
}

.card-empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.35;
}

.card-empty-text {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #9ca3af;
}

.card-empty-hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: #c9cdd1;
}

/* ── Trash / Recycle Bin ── */
.view-panel {
  width: 100%;
}

.trash-header {
  margin-bottom: 1.5rem;
}

.trash-header h2 {
  margin: 0 0 0.375rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.trash-header p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.6;
}

.trash-card .card-name-trigger {
  cursor: default;
}

.dropdown-permanent-delete {
  color: #ef4444 !important;
}

.dropdown-permanent-delete:hover {
  background: #fef2f2 !important;
}


/* ── Prototype Card ── */
.prototype-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 248, 238, 0.88));
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  position: relative;
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: auto 16rem;
}

.prototype-card.dropdown-open {
  z-index: 40;
  content-visibility: visible;
  contain: layout style;
}

/* ── Card Thumbnail ── */
.card-thumbnail {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}

.thumb-screenshot {
  display: none;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: top;
}

.thumb-placeholder {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: none;
  background: linear-gradient(180deg, #faf7f2 0%, #f3ede4 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
  display: flex;
  flex-direction: column;
}

.thumb-wireframe {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 20px;
}

.wf-block {
  display: block;
  border-radius: 4px;
  background: rgba(120, 103, 87, 0.08);
}

.wf-header {
  height: 12px;
  width: 55%;
}

.wf-hero {
  flex: 1;
  min-height: 36px;
  background:
    linear-gradient(135deg, rgba(120,103,87,0.07) 0%, rgba(120,103,87,0.03) 100%);
  border-radius: 6px;
  border: 1px dashed rgba(120, 103, 87, 0.1);
}

.wf-row {
  display: flex;
  gap: 8px;
}

.wf-card {
  flex: 1;
  height: 24px;
  border-radius: 4px;
  background: rgba(120, 103, 87, 0.06);
}

/* ── Card Stats Overlay ── */
.card-stats-overlay {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  pointer-events: none;
  z-index: 3;
}

.card-views-overlay,
.card-like-overlay,
.card-favorite-overlay {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  color: #8a6d3b;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
}

.card-published-icon {
  display: none;
  color: #f0642f;
  font-size: 0.8rem;
}

.prototype-card.published .card-published-icon {
  display: inline;
}

.card-stat-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  flex: 0 0 auto;
}

.card-stat-icon-like {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a6d3b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 20-1.45-1.32C5.4 14.03 2 10.97 2 7.5 2 4.42 4.42 2 7.5 2c1.74 0 3.41.81 4.5 2.09A6 6 0 0 1 16.5 2C19.58 2 22 4.42 22 7.5c0 3.47-3.4 6.53-8.55 11.18Z'/%3E%3C/svg%3E");
}

.card-stat-icon-favorite {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a6d3b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3.5 2.63 5.34 5.9.86-4.26 4.15 1 5.87L12 16.95l-5.27 2.77 1-5.87L3.47 9.7l5.9-.86L12 3.5Z'/%3E%3C/svg%3E");
}

.card-views-overlay i,
.card-like-overlay i,
.card-favorite-overlay i {
  font-size: 0.8rem;
  line-height: 1;
  color: #8a6d3b;
}

.card-views-unit {
  line-height: 1;
}

.card-stat-value {
  line-height: 1;
  vertical-align: middle;
}

/* ── Card Body ── */
.card-body {
  flex-shrink: 0;
  min-width: 0;
  padding: 10px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fff;
  border-radius: 0 0 8px 8px;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.card-row-top {
  min-height: 22px;
}

.card-row-bottom {
  min-height: 18px;
}

.card-name-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: default;
  flex: 1;
  overflow: hidden;
}

.card-name {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* ── Card Time ── */
.card-time {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Card Review Status ── */
.card-review-status {
  font-size: 0.75rem;
  line-height: 1.4;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 4px;
  cursor: default;
}

.card-review-status:empty {
  display: none;
}

.card-review-status.is-pending {
  color: #d97706;
}

.card-review-status.is-rejected {
  color: #dc2626;
}

.card-review-status.is-failed {
  color: #dc2626;
}

/* ── Card Access Info ── */
.card-access-info {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  line-height: 1;
}

.card-access-info .tip-trigger {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.card-access-info .tip-trigger i {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.card-access-text {
  color: #9ca3af;
  font-size: 12px;
}

/* ── Card Action Row ── */
.card-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  order: 1;
  margin-top: auto;
}

.card-action-right {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 6px;
  transition: background 0.15s;
}

.card-action-right:hover {
  background: rgba(0, 0, 0, 0.06);
}

.card-action-toggle-wrapper {
  position: relative;
  margin-left: auto;
}

.card-action-toggle {
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #d06b2f;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: none;
  font-size: 0.75rem;
}

.card-action-toggle:hover {
  background: rgba(0,0,0,0.05);
}

.card-action-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 150px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 50;
  overflow: hidden;
}

.card-action-dropdown.hidden {
  display: none;
}

.card-action-dropdown button {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 8px 14px;
  border: none;
  background: transparent;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: none;
  border-radius: 0;
  letter-spacing: 0;
}

.card-action-dropdown button:hover {
  background: #f5f5f5;
}

.card-action-dropdown .dropdown-delete {
  color: #a0403b;
}

/* ── Card Link ── */
.card-link {
  display: none;
}

/* ── Card Actions (hidden, replaced by more menu) ── */
.card-actions {
  display: none;
}

/* ── Rename Form (shared) ── */
.retry-review-btn {
  display: inline;
  margin-left: 6px;
  padding: 1px 8px;
  border: 1px solid rgba(208, 107, 47, 0.3);
  border-radius: 10px;
  background: rgba(208, 107, 47, 0.08);
  color: #d06b2f;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  vertical-align: baseline;
  min-height: 0;
  box-shadow: none;
}
.retry-review-btn:hover {
  background: rgba(208, 107, 47, 0.16);
  border-color: rgba(208, 107, 47, 0.5);
}
.retry-review-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.forum-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 6px 4px 4px;
}

.forum-hero-actions-only {
  justify-content: flex-end;
  align-items: center;
}

.forum-hero-copy {
  display: grid;
  gap: 14px;
  max-width: 720px;
}

.forum-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.forum-shell {
  margin-top: 26px;
  flex: 1 0 auto;
}

.forum-panel {
  position: relative;
  overflow: hidden;
}

.forum-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #f1c88f, #5f9ea0);
}

.forum-panel-inner {
  display: grid;
  gap: 18px;
}

.forum-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
}

.forum-tabs {
  display: inline-flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.forum-toolbar-compose {
  justify-self: end;
}

.forum-tab {
  min-width: 116px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: none;
}

.forum-tab.active {
  background: var(--text);
  border-color: var(--text);
  color: #fffaf2;
}

.forum-compose-modal-open {
  overflow: hidden;
}

.forum-compose-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 24px;
}

.forum-compose-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(20, 17, 13, 0.42);
}

.forum-compose-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 760px);
}

.forum-composer {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 252, 247, 0.98);
  box-shadow: 0 24px 64px rgba(58, 42, 24, 0.18);
}

.forum-composer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.forum-composer-head h2 {
  margin-bottom: 6px;
}

.forum-composer-media {
  display: grid;
  gap: 12px;
}

.forum-composer-media-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.forum-composer-media-hint {
  font-size: 0.84rem;
}

.forum-composer-image-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.forum-composer-image-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.forum-composer-image-preview {
  width: 92px;
  height: 92px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(120, 103, 87, 0.08);
}

.forum-composer-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.forum-composer-image-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.forum-composer-image-meta strong,
.forum-composer-image-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.forum-composer-image-status {
  font-size: 0.82rem;
  font-weight: 600;
}

.forum-composer-image-status.is-uploading {
  color: var(--primary-strong);
}

.forum-composer-image-status.is-ready {
  color: #1f7a52;
}

.forum-composer-image-status.is-error {
  color: #c13f4d;
}

.forum-composer-image-remove {
  min-width: 78px;
}

.forum-composer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.forum-list {
  display: grid;
  gap: 16px;
}

.forum-empty {
  padding: 28px 8px;
  text-align: center;
}

.forum-post-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 16px;
  align-items: start;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.forum-post-card:hover,
.forum-post-card:focus-visible {
  border-color: rgba(214, 153, 71, 0.36);
  box-shadow: 0 18px 44px rgba(70, 49, 22, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.forum-post-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.forum-post-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.forum-post-pin,
.forum-post-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.forum-post-pin {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.forum-post-status {
  background: rgba(120, 103, 87, 0.12);
  color: var(--muted);
}

.forum-post-title {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.4;
}

.forum-post-title-link {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
  font-weight: 700;
}

.forum-post-title-link:hover {
  color: var(--primary-strong);
}

.forum-post-meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.forum-post-content {
  --forum-post-content-line-height: 1.72;
  color: var(--text);
  font-size: 0.95rem;
  line-height: var(--forum-post-content-line-height);
  display: block;
  display: -webkit-box;
  overflow: hidden;
  max-height: calc(1em * var(--forum-post-content-line-height) * 2);
  line-clamp: 2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  word-break: break-word;
}

.forum-post-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, 84px);
  gap: 10px;
}

.forum-post-image {
  display: block;
  width: 84px;
  height: 84px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
  cursor: zoom-in;
}

.forum-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.18s ease;
}

.forum-post-image:hover img {
  transform: scale(1.02);
}

body.forum-image-preview-open {
  overflow: hidden;
}

.forum-image-preview {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.forum-image-preview-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(15, 15, 15, 0.72);
  cursor: zoom-out;
}

.forum-image-preview-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 1080px);
  max-height: 92vh;
  display: grid;
  justify-items: center;
  gap: 12px;
}

.forum-image-preview-close {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(20, 20, 20, 0.72);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  box-shadow: none;
}

.forum-image-preview-img {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}

.forum-detail-shell {
  display: grid;
  gap: 28px;
}

.forum-detail-card,
.forum-replies-card,
.forum-reply-composer-card {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
}

.forum-detail-card::before,
.forum-replies-card::before,
.forum-reply-composer-card::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), #f1c88f, #5f9ea0);
}

.forum-detail-inner,
.forum-replies-card,
.forum-reply-composer-card {
  padding: 28px 30px;
}

.forum-reply-composer-card {
  display: grid;
  gap: 22px;
}

.forum-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
}

.forum-detail-title-wrap {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.forum-detail-heading {
  gap: 10px;
}

.forum-detail-title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.5rem);
  line-height: 1.2;
}

.forum-detail-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.forum-detail-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.forum-detail-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
}

.forum-detail-actions button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.forum-detail-actions button:hover {
  color: var(--primary-strong);
}

.forum-detail-reply-count {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  padding-top: 8px;
}

.forum-detail-divider {
  margin: 18px 0 22px;
  border-top: 1px solid rgba(120, 103, 87, 0.18);
}

.forum-detail-content {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.86;
  white-space: pre-wrap;
  word-break: break-word;
}

.forum-detail-images {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 420px));
  gap: 18px;
}

.forum-detail-image {
  display: block;
  width: 100%;
  max-width: 420px;
  padding: 0;
  border: 1px solid rgba(120, 103, 87, 0.18);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  cursor: zoom-in;
  box-shadow: var(--shadow-soft);
}

.forum-detail-image img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.18s ease;
}

.forum-detail-image:hover img {
  transform: scale(1.02);
}

.forum-replies-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.forum-replies-head h3,
.forum-reply-composer-card h3 {
  margin: 0;
  font-size: 1.9rem;
}

.forum-replies-count {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.forum-replies-list {
  display: grid;
  gap: 20px;
}

.forum-replies-empty {
  padding: 18px 4px 8px;
}

.forum-reply-item {
  padding: 24px;
  border: 1px solid rgba(240, 194, 164, 0.78);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.62);
  display: grid;
  gap: 18px;
}

.forum-reply-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.forum-reply-author {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.forum-reply-author strong {
  font-size: 1rem;
}

.forum-reply-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(190, 145, 102, 0.52);
  background: rgba(241, 228, 213, 0.9);
  color: #9c6335;
  font-size: 0.92rem;
  font-weight: 700;
}

.forum-reply-sequence {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.forum-reply-content {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.forum-reply-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 240px));
  gap: 12px;
}

.forum-reply-image {
  display: block;
  width: 100%;
  max-width: 240px;
  padding: 0;
  border: 1px solid rgba(120, 103, 87, 0.18);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  cursor: zoom-in;
  box-shadow: var(--shadow-soft);
}

.forum-reply-image img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.18s ease;
}

.forum-reply-image:hover img {
  transform: scale(1.02);
}

.forum-reply-time {
  color: var(--muted);
  font-size: 0.95rem;
}

.forum-reply-notice {
  margin: 16px 0 22px;
  padding: 18px 22px;
  border: 1px solid rgba(244, 166, 154, 0.72);
  border-radius: 22px;
  background: rgba(251, 229, 226, 0.92);
  color: #9f3228;
  font-size: 0.95rem;
  font-weight: 700;
}

.forum-reply-form {
  display: grid;
  gap: 20px;
}

.forum-reply-input {
  min-height: 220px;
  resize: vertical;
}

.forum-reply-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.forum-reply-counter {
  color: var(--muted);
  font-size: 0.95rem;
}

.forum-post-side {
  display: grid;
  gap: 12px;
  justify-items: end;
  width: max-content;
  max-width: 100%;
}

.forum-reply-summary {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.forum-post-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  width: auto;
  max-width: 100%;
  justify-content: flex-end;
}

.forum-post-actions button {
  width: auto;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 14px;
  font-size: 0.84rem;
  white-space: nowrap;
  justify-content: center;
}

.forum-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.forum-pagination-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.forum-footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
  padding: 18px 16px 28px;
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 760px) {
  .page {
    padding: 20px 16px 34px;
  }

  .site-home-topbar {
    margin-bottom: 18px;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .auth-aside {
    padding: 0;
  }

  .site-home-entry-btn {
    width: auto;
  }

  .forum-hero,
  .forum-hero-actions,
  .section-title {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-bar-content {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-bar-right {
    flex-direction: column;
    align-items: stretch;
  }

  .upload-bar-right button {
    width: 100%;
  }

  .forum-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .section-actions,
  .forum-composer-head,
  .forum-composer-actions,
  .forum-post-actions {
    justify-content: stretch;
  }

  .forum-composer-media-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .forum-composer-image-item {
    grid-template-columns: 1fr;
  }

  .user-badge,
  .topbar-actions .user-menu,
  .forum-hero-actions .user-menu,
  .topbar-actions button,
  .topbar-actions .link-button,
  .forum-hero-actions button,
  .forum-hero-actions .link-button,
  .forum-post-actions button,
  .card-actions button {
    width: 100%;
  }

  .user-menu-dropdown {
    left: 0;
    right: 0;
    width: auto;
  }

  .forum-toolbar-compose {
    margin-left: 0;
  }

  .forum-post-actions button {
    width: auto;
  }

  .mode-switch,
  .code-row {
    grid-template-columns: 1fr;
  }

  .forum-post-card {
    grid-template-columns: 1fr;
  }

  .forum-detail-head,
  .forum-replies-head,
  .forum-reply-form-footer {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .forum-post-side {
    justify-items: stretch;
  }

  .forum-reply-summary {
    width: 100%;
    text-align: right;
  }

  .forum-post-images {
    grid-template-columns: repeat(auto-fit, 72px);
  }

  .forum-post-image {
    width: 72px;
    height: 72px;
  }

  .forum-detail-inner,
  .forum-replies-card,
  .forum-reply-composer-card {
    padding: 24px 18px;
  }

  .forum-detail-images {
    grid-template-columns: 1fr;
  }

  .forum-detail-image {
    max-width: none;
  }

  .forum-reply-images {
    grid-template-columns: 1fr;
  }

  .forum-reply-image {
    max-width: none;
  }

  .forum-reply-item {
    padding: 18px;
  }

  .forum-pagination,
  .forum-pagination-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-card {
    padding: 24px 18px 20px;
  }
}

/* ── Tip Trigger ── */
.tip-trigger {
  position: relative;
  cursor: help;
  display: inline-flex;
}

.tip-trigger .tip-text {
  display: none;
}

/* ── Floating Tooltip ── */
.tooltip-float {
  position: fixed;
  padding: 8px 12px;
  border-radius: 8px;
  background: #1f2937;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
  max-width: 280px;
  width: max-content;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tooltip-float.visible {
  opacity: 1;
}

/* ── Profile Modal ── */
#profile-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
}

#profile-modal.open {
  display: block;
}

#profile-modal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#profile-modal .modal-center {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
}

#profile-modal .modal-dialog {
  background: #fff;
  border-radius: 16px;
  width: 400px;
  max-height: 90vh;
  overflow-y: auto;
}

#profile-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem 0.75rem;
}

#profile-modal .modal-header h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

#profile-modal .modal-close-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 1.125rem;
  padding: 0;
  transition: color 0.15s;
  box-shadow: none;
  min-height: 0;
}

#profile-modal .modal-close-btn:hover {
  color: var(--text);
}

#profile-modal .modal-body {
  padding: 0 1.25rem 1.25rem;
}

#profile-modal .profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0.5rem 0.25rem;
}

#profile-modal .profile-label {
  font-size: 0.875rem;
  color: #6b7280;
}

#profile-modal .profile-value {
  font-size: 0.875rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}

#profile-modal .divider {
  height: 1px;
  background: #f3f4f6;
  margin: 0;
}

#profile-modal .logout-btn {
  font-size: 0.875rem;
  color: #f87171;
  border: 1px solid #f87171;
  background: transparent;
  padding: 0.375rem 0.875rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
  box-shadow: none;
  min-height: 0;
}

#profile-modal .logout-btn:hover {
  background: #fef2f2;
}

@media (max-width: 760px) {
  .billing-section-header {
    flex-direction: column;
    align-items: stretch;
  }

  .billing-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .upload-bar-left {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* ── QR Code ── */
.wallet-qrcode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px;
  margin-top: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(120, 103, 87, 0.14);
}
.wallet-qrcode canvas,
.wallet-qrcode img {
  display: block;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
.wallet-qrcode-hint {
  font-size: 0.88rem;
  color: #786757;
  text-align: center;
  line-height: 1.5;
}
.wallet-qrcode-expire {
  font-size: 0.78rem;
  color: #a09380;
}
#qrCodePollStatus {
  font-size: 0.84rem;
  color: #786757;
  text-align: center;
}
