/* ==================================================
   Kalshi Clone - Global Styles
   Chinese Prediction Market Platform
   ================================================== */

/* ---- CSS Variables ---- */
:root {
  --primary: #00b67a;
  --primary-dark: #009664;
  --primary-light: #e6f8f1;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --text-primary: #1a1a1a;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1200px;
  --header-height: 64px;
  --subnav-height: 48px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-primary);
  line-height: 1.5;
  min-height: 100vh;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

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

input, textarea, select {
  font-family: inherit;
  outline: none;
}

ul, ol {
  list-style: none;
}

/* ---- Layout Utilities ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none !important; }

/* ---- Header ---- */
.main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 6px 0;
  position: relative;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--primary);
}

.header-nav a .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  margin-left: 4px;
  line-height: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}

.search-box input {
  width: 200px;
  height: 38px;
  padding: 0 14px 0 36px;
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  font-size: 14px;
  background: var(--bg-secondary);
  transition: all 0.2s;
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary);
  background: var(--bg-primary);
  box-shadow: 0 0 0 3px rgba(0,182,122,0.1);
}

.search-box input:focus + .search-btn {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,182,122,0.1);
}

.search-box .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  z-index: 2;
}

.search-btn {
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--border-color);
  border-left: none;
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.search-btn:hover {
  background: var(--primary-dark);
}

.search-btn:active {
  opacity: 0.9;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 18px;
  height: 38px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-xl);
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
}

.btn-lg {
  height: 48px;
  padding: 0 28px;
  font-size: 16px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  border-color: var(--text-secondary);
  background: var(--bg-secondary);
}

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

.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background: #dc2626;
}

/* ---- Sub Navigation ---- */
.sub-nav {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  height: var(--subnav-height);
  position: sticky;
  top: var(--header-height);
  z-index: 999;
}

.sub-nav-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sub-nav-inner::-webkit-scrollbar {
  display: none;
}

.sub-nav-inner a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  white-space: nowrap;
  transition: all 0.2s;
}

.sub-nav-inner a:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sub-nav-inner a.active {
  color: var(--primary);
  background: var(--primary-light);
}

.sub-nav-inner a .nav-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-weight: 700;
}

/* ---- Main Layout ---- */
.main-layout {
  display: flex;
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px;
}

.main-content {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: 320px;
  flex-shrink: 0;
}

@media (max-width: 992px) {
  .sidebar {
    display: none;
  }
}

/* ---- Cards ---- */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-color);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-title a {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

.card-title a:hover {
  color: var(--primary);
}

.card-title .arrow {
  font-size: 14px;
  color: var(--text-muted);
}

.card-body {
  padding: 16px 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
}

/* ---- Featured Market Card ---- */
.featured-market {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

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

.featured-category {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

.featured-category img,
.featured-category .cat-icon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.featured-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.featured-nav button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s;
}

.featured-nav button:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

.featured-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.market-meta {
  display: flex;
  gap: 24px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

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

.market-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.market-row:last-child {
  border-bottom: none;
}

.market-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.market-avatar-sm {
  width: 28px;
  height: 28px;
}

.market-info {
  flex: 1;
  min-width: 0;
}

.market-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-payout {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.market-odds {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.odds-value {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.probability-btn {
  min-width: 56px;
  padding: 6px 12px;
  border-radius: var(--radius-xl);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.probability-btn.yes {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(0,182,122,0.2);
}

.probability-btn.yes:hover {
  background: var(--primary);
  color: white;
}

.probability-btn.no {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(239,68,68,0.2);
}

.probability-btn.no:hover {
  background: var(--danger);
  color: white;
}

.market-volume {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.market-tags {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.market-tag {
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

/* ---- News snippet ---- */
.news-snippet {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}

.news-snippet .news-label {
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

.news-snippet .news-text {
  color: var(--text-secondary);
}

/* ---- Info Banners ---- */
.info-banners {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .info-banners {
    grid-template-columns: 1fr;
  }
    /* Hide non-World Cup content on mobile homepage */
    .mobile-hide {
        display: none !important;
    }

    /* Hide sub-nav (category navigation) on mobile */
    .sub-nav {
        display: none;
    }

    /* Hide hamburger menu button on mobile */
    .mobile-menu-btn {
        display: none !important;
    }

}

.info-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  transition: all 0.2s;
}

.info-banner:hover {
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}

.info-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.info-banner-icon.green {
  background: var(--primary-light);
  color: var(--primary);
}

.info-banner-icon.blue {
  background: #eff6ff;
  color: #3b82f6;
}

.info-banner-icon.orange {
  background: var(--warning-light);
  color: var(--warning);
}

.info-banner-content h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.info-banner-content p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.info-banner-arrow {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 14px;
}

/* ---- Section ---- */
.section {
  margin-bottom: 32px;
}

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

.section-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title a:hover {
  color: var(--primary);
}

.section-title .arrow {
  font-size: 14px;
  color: var(--primary);
}

/* ---- Market Grid ---- */
.market-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .market-grid {
    grid-template-columns: 1fr;
  }
}

.market-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: box-shadow 0.2s;
}

.market-card:hover {
  box-shadow: var(--shadow-md);
}

.market-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.market-card-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.market-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
  transition: color 0.2s;
  white-space: nowrap; /* 防止文本换行 */
  overflow: hidden; /* 隐藏溢出的内容 */
  text-overflow: ellipsis; /* 显示省略符号来代表被修剪的文本 */
  width:200px;
}
.market-card-title a {
  transition: color 0.2s;
}
.market-card-title a:hover {
  color: var(--primary) !important;
}

/* Title row with join button */
.title-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.title-with-action .market-card-title {
  margin-bottom: 0;
  flex: 1;
}

.market-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
}

.market-list-title:hover {
    color: var(--primary);
    cursor: pointer;
}

/* Small join button for title area */
.join-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 8px;
  border-radius: var(--radius-xl);
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: white;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.join-btn-sm:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,182,122,0.3);
}
.market-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.market-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.market-option-label {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}

.market-option-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.market-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- Sidebar Widgets ---- */
.widget {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
}

.widget-title {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-title .icon {
  font-size: 18px;
}

.widget-body {
  padding: 8px 0;
}

.widget-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  transition: background 0.15s;
}

.widget-list-item:hover {
  background: var(--bg-secondary);
}

.widget-list-rank {
  width: 18px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}

.widget-list-content {
  flex: 1;
  min-width: 0;
}

.widget-list-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-list-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.widget-list-value {
  text-align: right;
  flex-shrink: 0;
}

.widget-list-percent {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.widget-list-delta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  font-size: 11px;
  margin-top: 2px;
}

.delta-up {
  color: var(--primary);
}

.delta-down {
  color: var(--danger);
}

.delta-neutral {
  color: var(--text-muted);
}

/* ---- Sidebar Link Cards ---- */
.sidebar-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  transition: all 0.2s;
}

.sidebar-link-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-color);
}

.sidebar-link-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-link-icon {
  font-size: 22px;
}

.sidebar-link-text {
  font-size: 14px;
  font-weight: 700;
}

.sidebar-link-arrow {
  color: var(--text-muted);
  font-size: 14px;
}

/* ---- Footer ---- */
.main-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 48px 0 24px;
  margin-top: 48px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 769px) {
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.footer-column h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-column ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-column a {
  font-size: 13px;
  color: var(--text-secondary);
  transition: color 0.2s;
}

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

.footer-bottom {
  max-width: var(--max-width);
  margin: 32px auto 0;
  padding: 24px 16px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer-bottom p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.footer-copyright {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ==================================================
   Auth Pages (Login, Register, Forgot Password)
   ================================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
}

.auth-page .main-header {
  background: var(--bg-primary);
}

.auth-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.auth-box {
  width: 100%;
  max-width: 420px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  box-shadow: var(--shadow-lg);
}

.auth-box-lg {
  max-width: 480px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.auth-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
}

.form-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--bg-primary);
  transition: all 0.2s;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,182,122,0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

textarea.form-input {
  height: auto;
  padding: 10px 14px;
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  display: none;
}

.form-error.show {
  display: block;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
  cursor: pointer;
}

.checkbox-group label {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  cursor: pointer;
}

.checkbox-group label a {
  color: var(--primary);
  text-decoration: underline;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.form-footer a {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

.form-footer a:hover {
  text-decoration: underline;
}

.auth-submit {
  width: 100%;
  margin-bottom: 16px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.social-login {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-btn {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.2s;
}

.social-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--text-muted);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
}

.auth-footer a:hover {
  text-decoration: underline;
}


/* ===== World Cup Section ===== */
.world-cup-banner {
  background: var(--primary);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.world-cup-banner-title {
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.world-cup-section-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.match-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 768px) {
  .match-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.match-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}
.match-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.match-group {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap; /* 防止文本换行 */
  overflow: hidden; /* 隐藏溢出的内容 */
  text-overflow: ellipsis; /* 显示省略符号来代表被修剪的文本 */
  width:200px;
}
.match-status {
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 10px;
  border-radius: var(--radius-xl);
  font-weight: 600;
}
.match-vs-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 12px;
}
.match-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.match-team-flag {
  font-size: 36px;
  line-height: 1;
}
.match-team-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.match-vs-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.match-progress {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  margin-bottom: 10px;
  overflow: hidden;
}
.match-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s;
}

.match-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-muted);
}
.match-stats-left { text-align: left; }
.match-stats-center { text-align: center; font-weight: 600; }
.match-stats-right { text-align: right; }
.match-stats strong { color: var(--text-primary); font-weight: 700; }

.match-buttons {
  display: flex;
  gap: 10px;
}
.match-btn {
  flex: 1;
  padding: 10px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.match-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.match-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

/* ==================================================
   Profile Page
   ================================================== */
.profile-page {
  background: var(--bg-secondary);
  min-height: calc(100vh - var(--header-height) - var(--subnav-height));
}

.profile-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  padding: 32px 0;
}

.profile-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--primary);
  flex-shrink: 0;
  border: 3px solid var(--bg-primary);
  box-shadow: var(--shadow-md);
}

.profile-info h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

.profile-info p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.profile-stats {
  display: flex;
  gap: 24px;
}

.profile-stat {
  text-align: center;
}

.profile-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
}

.profile-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.profile-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
}

.profile-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  gap: 24px;
}

.profile-sidebar {
  width: 240px;
  flex-shrink: 0;
}

.profile-menu {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s;
  border-left: 3px solid transparent;
}

.profile-menu-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.profile-menu-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.profile-menu-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.profile-content {
  flex: 1;
  min-width: 0;
}

.profile-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
}

.profile-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.profile-section-title {
  font-size: 16px;
  font-weight: 700;
}

.profile-section-body {
  padding: 20px;
}

.info-row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  width: 120px;
  font-size: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.info-value {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.info-value .badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
}

/* ==================================================
   Content Pages (About, Help)
   ================================================== */
.content-page {
  background: var(--bg-secondary);
  min-height: calc(100vh - var(--header-height) - var(--subnav-height));
}

.content-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 16px;
}

.content-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 40px;
}

.content-card h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
}

.content-card h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.content-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 24px 0 12px;
}

.content-card p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.content-card ul {
  list-style: disc;
  margin: 16px 0 16px 24px;
}

.content-card ul li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.content-card a {
  color: var(--primary);
  text-decoration: underline;
}

.help-search {
  margin-bottom: 32px;
}

.help-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .help-categories {
    grid-template-columns: 1fr;
  }
}

.help-category-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.help-category-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.help-category-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.help-category-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}

.help-category-desc {
  font-size: 13px;
  color: var(--text-muted);
}

.faq-item {
  border-bottom: 1px solid var(--border-light);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s;
}

.faq-question:hover {
  color: var(--primary);
}

.faq-toggle {
  font-size: 18px;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.faq-item.open .faq-toggle {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-answer-inner {
  padding: 0 0 16px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* ==================================================
   Help Center Two-Column Layout
   ================================================== */
.help-two-col {
  display: flex;
  gap: 24px;
}

.help-sidebar {
  width: 200px;
  flex-shrink: 0;
}

.help-nav {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.help-nav-item {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-left: 3px solid transparent;
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none;
}

.help-nav-item:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.help-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 700;
}

.help-main {
  flex: 1;
  min-width: 0;
}

.help-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.help-list-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.help-list-item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}

.help-list-item a {
  display: block;
  color: var(--text-primary);
  text-decoration: none;
}

.help-list-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.4;
}

.help-list-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.help-list-arrow {
  float: right;
  font-size: 18px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==================================================
   Help Detail Page
   ================================================== */
.help-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.help-detail-meta .tag {
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
}

.help-detail-body {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.help-detail-body p {
  margin-bottom: 16px;
}

.help-detail-body ol,
.help-detail-body ul {
  margin: 16px 0 16px 24px;
}

.help-detail-body li {
  margin-bottom: 8px;
}

.help-detail-related {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.help-detail-related h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .help-two-col {
    flex-direction: column;
  }

  .help-sidebar {
    width: 100%;
  }

  .help-nav {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .help-nav::-webkit-scrollbar {
    display: none;
  }

  .help-nav-item {
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .help-nav-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--primary);
  }
}

/* ==================================================
   Points Shop
   ================================================== */
.shop-page {
  background: var(--bg-secondary);
  min-height: calc(100vh - var(--header-height) - var(--subnav-height));
}

.shop-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 48px 0;
  text-align: center;
}

.shop-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.shop-header p {
  font-size: 16px;
  opacity: 0.9;
}

.points-badge-large {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 24px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-xl);
  font-size: 18px;
  font-weight: 700;
}

.shop-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 16px;
}

.shop-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: var(--radius-xl);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .shop-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .shop-grid {
    grid-template-columns: 1fr;
  }
}

.shop-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s;
}

.shop-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.shop-item-image {
  width: 100%;
  height: 180px;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}

.shop-item-body {
  padding: 16px;
}

.shop-item-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.4;
}

.shop-item-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.shop-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shop-item-points {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--warning);
}

.shop-item-points .points-icon {
  font-size: 18px;
}

/* ==================================================
   Points Detail Page
   ================================================== */
.detail-page {
  background: var(--bg-secondary);
  min-height: calc(100vh - var(--header-height) - var(--subnav-height));
}

.detail-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 16px;
  display: flex;
  gap: 24px;
}

.detail-main {
  flex: 1;
  min-width: 0;
}

.detail-sidebar {
  width: 320px;
  flex-shrink: 0;
}

.detail-gallery {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 40px;
  text-align: center;
  margin-bottom: 24px;
}

.detail-gallery-icon {
  font-size: 120px;
  margin-bottom: 16px;
}

.detail-info {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
}

.detail-info h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}

.detail-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.detail-desc {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.detail-points-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
}

.detail-points-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.detail-points-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--warning);
}

.detail-actions {
  display: flex;
  gap: 12px;
}

.detail-actions .btn {
  flex: 1;
}

.sidebar-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}

.sidebar-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.sidebar-card ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-card li {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-card li .icon {
  color: var(--primary);
}

/* ==================================================
   Toast / Notification
   ================================================== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  min-width: 280px;
  animation: toastSlide 0.3s ease-out;
}

.toast.success {
  border-left: 4px solid var(--primary);
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.warning {
  border-left: 4px solid var(--warning);
}

@keyframes toastSlide {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==================================================
   Mobile Menu
   ================================================== */
.mobile-menu-btn {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover {
  background: var(--bg-secondary);
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--bg-primary);
  z-index: 1001;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}

.mobile-drawer.open {
  transform: translateX(0);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.drawer-close {
  font-size: 24px;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-nav {
  padding: 16px;
}

.drawer-nav a {
  display: block;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
  transition: color 0.2s;
}

.drawer-nav a:hover {
  color: var(--primary);
}

/* ==================================================
   Responsive
   ================================================== */
@media (max-width: 992px) {
  .header-nav {
    display: none;
  }

  .search-box {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .profile-body {
    flex-direction: column;
  }

  .profile-sidebar {
    width: 100%;
  }

  .profile-menu {
    display: flex;
    overflow-x: auto;
    gap: 0;
  }

  .profile-menu-item {
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .profile-menu-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--primary);
  }

  .detail-container {
    flex-direction: column;
  }

  .detail-sidebar {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .header-right .btn {
    display: none;
  }

  .info-banners {
    grid-template-columns: 1fr;
  }

  .market-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .auth-box {
    padding: 32px 20px;
  }

  .profile-header-inner {
    flex-direction: column;
    text-align: center;
  }

  .profile-stats {
    justify-content: center;
  }

  .profile-actions {
    margin-left: 0;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-card {
    padding: 24px 16px;
  }
}

/* ==================================================
   Utility classes for jQuery interactions
   ================================================== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================================================
   NEW: Carousel, Chart, Modal, Horizontal Scroll
   ================================================== */

/* ---- Carousel ---- */
.carousel-wrapper {
  position: relative;
  overflow: hidden;
}

.carousel-slides {
  display: flex;
  transition: transform 0.4s ease;
}

.carousel-slide {
  min-width: 100%;
  opacity: 0.5;
  transition: opacity 0.3s;
}

.carousel-slide.active {
  opacity: 1;
}

/* ---- Price Chart SVG ---- */
.price-chart {
  width: 100%;
  min-height: 200px;
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  scrollbar-width: none;
  -ms-overflow-style: none;
  user-select: none;
}

.price-chart::-webkit-scrollbar {
  display: none;
}

.price-chart:active {
  cursor: grabbing;
}

.price-chart > svg {
  height: 100%;
  display: block;
  width: auto;
}

.chart-line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: rgba(0,182,122,0.08);
  stroke: none;
}

.chart-grid {
  stroke: var(--border-light);
  stroke-width: 1;
  stroke-dasharray: 2,4;
}

/* Crosshair Tooltip Panel */
.chart-crosshair-tooltip {
  position: absolute;
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  min-width: 140px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  pointer-events: none;
  z-index: 100;
  font-family: sans-serif;
}

.chart-tooltip-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  font-size: 12px;
  white-space: nowrap;
}

.chart-tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.chart-tooltip-name {
  flex: 1;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-tooltip-value {
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.chart-labels {
  font-size: 10px;
  fill: var(--text-muted);
}

/* ---- Trade Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.25s;
}

.modal-overlay.open .modal-box {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header-info {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.modal-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.modal-title-group h3 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 4px;
}

.modal-title-group p {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

.modal-close {
  font-size: 24px;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
  flex-shrink: 0;
}

.modal-close:hover {
  background: var(--bg-secondary);
}

.modal-body {
  padding: 20px 24px;
}

/* Payment Method Selector */
.pay-method-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pay-method-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg-primary);
  position: relative;
}

.pay-method-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.pay-method-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.pay-method-option .pay-method-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.pay-method-option .pay-method-icon.wechat {
  background: #e8f5e9;
  color: #07c160;
}

.pay-method-option .pay-method-icon.alipay {
  background: #e3f2fd;
  color: #1677ff;
}

.pay-method-name {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
}

.pay-method-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  transition: all 0.15s;
  flex-shrink: 0;
}

.pay-method-option.selected .pay-method-check {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.pay-method-option:not(.selected) .pay-method-check {
  color: transparent !important;
}

/* ---- Check-in Modal ---- */
.checkin-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}

.checkin-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 2px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 2px solid transparent;
  transition: all 0.2s;
}

.checkin-day.completed {
  background: var(--primary-light);
  border-color: var(--primary);
}

.checkin-day.active {
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,182,122,0.2);
}

.checkin-day-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.checkin-day.completed .checkin-day-icon,
.checkin-day.active .checkin-day-icon {
  background: var(--primary);
  color: white;
}

.checkin-day-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.checkin-day.completed .checkin-day-label,
.checkin-day.active .checkin-day-label {
  color: var(--primary);
  font-weight: 700;
}

.checkin-status {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.checkin-status p {
  margin: 2px 0;
}

/* Exchange row clickable */
.exchange-row {
  cursor: pointer;
  transition: background 0.15s;
}

.exchange-row:hover {
  background: var(--primary-light);
}

/* Exchange Detail Modal Content */
.exchange-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.exchange-detail-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.exchange-detail-info h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.exchange-detail-info p {
  font-size: 13px;
  color: var(--text-muted);
}

.exchange-detail-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
}

.exchange-detail-section h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.exchange-code-box {
  background: var(--bg-primary);
  border: 1px dashed var(--primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-family: monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  text-align: center;
  letter-spacing: 1px;
  user-select: all;
}

.exchange-code-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

.exchange-tracking-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.exchange-tracking-row:last-child {
  border-bottom: none;
}

.exchange-tracking-label {
  color: var(--text-secondary);
}

.exchange-tracking-value {
  font-weight: 600;
  color: var(--text-primary);
}

.exchange-status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
}

.exchange-status-badge.sent {
  background: var(--primary-light);
  color: var(--primary);
}

.exchange-status-badge.delivered {
  background: #e8f5e9;
  color: #2e7d32;
}

/* ---- Leaderboard ---- */
.leaderboard-section {
  padding: 0 4px;
}

.leaderboard-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  transition: background 0.1s;
  border-radius: var(--radius-sm);
  padding-left: 4px;
  padding-right: 4px;
}

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

.leaderboard-item:hover {
  background: var(--bg-tertiary);
}

.leaderboard-rank {
  width: 18px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.rank-1 .leaderboard-rank { color: #f59e0b; font-size: 13px; }
.rank-2 .leaderboard-rank { color: #9ca3af; font-size: 13px; }
.rank-3 .leaderboard-rank { color: #cd7f32; font-size: 13px; }

.leaderboard-rank.bottom {
  color: var(--danger);
}

.leaderboard-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.leaderboard-name {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-profit {
  font-weight: 700;
  font-size: 12px;
  color: var(--primary);
  flex-shrink: 0;
  text-align: right;
}

.leaderboard-loss {
  font-weight: 700;
  font-size: 12px;
  color: var(--danger);
  flex-shrink: 0;
  text-align: right;
}

/* ---- Leaderboard Full Page ---- */
.leaderboard-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0;
}

.leaderboard-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all 0.15s;
}

.leaderboard-tab:hover {
  color: var(--text-primary);
}

.leaderboard-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.leaderboard-full-panel {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.leaderboard-full-header {
  display: grid;
  grid-template-columns: 60px 40px 1fr 80px 80px 100px;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-light);
}

.leaderboard-full-row {
  display: grid;
  grid-template-columns: 60px 40px 1fr 80px 80px 100px;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  transition: background 0.1s;
}

.leaderboard-full-row:hover {
  background: var(--bg-tertiary);
}

.leaderboard-full-row:last-child {
  border-bottom: none;
}

.lb-col-rank {
  text-align: center;
}

.lb-col-avatar {
  text-align: center;
}

.lb-col-name strong {
  font-weight: 600;
  color: var(--text-primary);
}

.lb-col-accuracy,
.lb-col-count {
  text-align: center;
  font-size: 13px;
}

.lb-col-profit {
  text-align: right;
  font-size: 13px;
  font-weight: 700;
}

.lb-rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-tertiary);
}

.lb-rank-badge.lb-gold {
  background: #fff8e1;
  color: #f59e0b;
}

.lb-rank-badge.lb-silver {
  background: #f5f5f5;
  color: #9ca3af;
}

.lb-rank-badge.lb-bronze {
  background: #fdf2e9;
  color: #cd7f32;
}

.lb-rank-badge.lb-danger {
  background: var(--danger-light);
  color: var(--danger);
}

.lb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.lb-profit {
  color: var(--primary);
}

.lb-loss {
  color: var(--danger);
}

@media (max-width: 768px) {
  .leaderboard-full-header {
    grid-template-columns: 50px 32px 1fr 60px 60px 80px;
    padding: 10px 12px;
    font-size: 11px;
  }
  .leaderboard-full-row {
    grid-template-columns: 50px 32px 1fr 60px 60px 80px;
    padding: 8px 12px;
    font-size: 13px;
  }
  .lb-avatar {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }
  .lb-rank-badge {
    width: 24px;
    height: 24px;
    font-size: 11px;
  }
}

/* Select Option Labels for Publish Prediction */
.select-option-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.15s;
  background: var(--bg-primary);
}

.select-option-label:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.select-option-label input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.select-option-label.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.trade-options-list {
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding-right: 4px;
}

/* Load More Pagination */
.load-more-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.load-more-info {
  font-size: 13px;
  color: var(--text-muted);
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.load-more-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.load-more-btn:disabled,
.load-more-btn.no-more {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: var(--border-color);
  color: var(--text-muted);
  background: var(--bg-secondary);
}

.trade-options-list::-webkit-scrollbar {
  width: 4px;
}

.trade-options-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.trade-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.trade-option-row:hover {
  border-color: var(--text-muted);
  background: var(--bg-secondary);
}

.trade-option-row.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.trade-option-row.active .trade-option-name {
  color: var(--primary);
  font-weight: 700;
}

.trade-option-row.active .trade-option-prob {
  background: var(--primary);
  color: white;
}

.trade-option-name {
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trade-option-prob {
  flex-shrink: 0;
  min-width: 52px;
  padding: 5px 12px;
  border-radius: var(--radius-xl);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  transition: all 0.2s;
}

.trade-option-check {
  font-size: 16px;
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
  margin-left: 4px;
}

.trade-option-row.active .trade-option-check {
  opacity: 1;
}

.trade-amount-group {
  margin-bottom: 16px;
}

.trade-amount-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.trade-amount-label span:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

.trade-amount-label span:last-child {
  color: var(--text-muted);
}

.trade-amount-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.trade-amount-input-wrap input {
  flex: 1;
  height: 48px;
  padding: 0 14px;
  border: none;
  font-size: 16px;
  font-weight: 700;
}

.trade-amount-input-wrap .currency {
  padding: 0 14px;
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
}

.trade-summary {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
}

.trade-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
}

.trade-summary-row .label {
  color: var(--text-secondary);
}

.trade-summary-row .value {
  font-weight: 600;
  color: var(--text-primary);
}

.trade-summary-row .value.highlight {
  color: var(--primary);
}

.modal-submit {
  width: 100%;
  height: 48px;
  font-size: 16px;
  font-weight: 700;
}

/* ---- Exchange Modal ---- */
.exchange-modal-body {
  padding: 20px 24px;
}

.exchange-info {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.exchange-info-icon {
  font-size: 48px;
  flex-shrink: 0;
}

.exchange-info-text h4 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.exchange-info-text p {
  font-size: 13px;
  color: var(--text-secondary);
}

.exchange-info-points {
  font-size: 18px;
  font-weight: 700;
  color: var(--warning);
  margin-top: 4px;
}

.shipping-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shipping-form h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: -4px;
}

/* ---- Horizontal Scroll with Drag ---- */
.sub-nav-inner {
  -webkit-overflow-scrolling: touch;
  overflow-x: scroll;
  overflow-y: hidden;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.sub-nav-inner:active,
.sub-nav-inner.is-dragging {
  cursor: grabbing;
}

.sub-nav-inner::-webkit-scrollbar {
  display: none;
}

.shop-filters {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 4px;
}

.shop-filters::-webkit-scrollbar {
  display: none;
}

/* ---- Market List Page ---- */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.list-header h1 {
  font-size: 24px;
  font-weight: 700;
}

.list-sort {
  display: flex;
  gap: 8px;
}

.sort-btn {
  padding: 6px 14px;
  border-radius: var(--radius-xl);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  transition: all 0.2s;
}

.sort-btn.active,
.sort-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

@media (max-width: 768px) {
  .sort-btn {
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
  }
  .sort-btn.active,
  .sort-btn:hover {
    background: transparent;
    color: var(--primary);
    border: none;
    font-weight: 700;
  }
}

.market-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.market-list-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: box-shadow 0.2s;
}

.market-list-item:hover {
  box-shadow: var(--shadow-md);
}

.market-list-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.market-list-category {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.market-list-status {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.market-list-status.open {
  background: var(--primary-light);
  color: var(--primary);
}

.market-list-status.closed {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.market-list-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.4;
}

.market-list-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.market-list-option-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.market-list-option-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.market-list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-muted);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
}

.pagination-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.pagination-btn:hover,
.pagination-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ---- Profile Extended ---- */
.profile-tabs {
  display: flex;
  gap: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.profile-tabs::-webkit-scrollbar {
  display: none;
}

.profile-tab {
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  background: none;
}

.profile-tab:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.profile-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-light);
}

.profile-panel.hidden {
  display: none;
}

.prediction-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  background: var(--bg-primary);
}

.prediction-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.prediction-card-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.prediction-card-tag.published {
  background: var(--primary-light);
  color: var(--primary);
}

.prediction-card-tag.participated {
  background: #eff6ff;
  color: #3b82f6;
}

.prediction-card-tag.ended {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.prediction-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
}

.prediction-card-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.points-charge-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
}

.points-charge-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.points-charge-card p {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 16px;
}

.charge-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.charge-option {
  background: rgba(255,255,255,0.15);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.charge-option:hover,
.charge-option.selected {
  border-color: white;
  background: rgba(255,255,255,0.25);
}

.charge-option .amount {
  font-size: 18px;
  font-weight: 700;
}

.charge-option .points {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 4px;
}

.charge-btn {
  width: 100%;
  margin-top: 16px;
  height: 44px;
  background: white;
  color: var(--primary);
  font-weight: 700;
  border-radius: var(--radius-md);
}

.record-table {
  width: 100%;
  border-collapse: collapse;
}

.record-table th,
.record-table td {
  text-align: left;
  padding: 12px 10px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}

.record-table th {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 13px;
}

.record-table td {
  color: var(--text-primary);
}

.record-type-in {
  color: var(--primary);
  font-weight: 600;
}

.record-type-out {
  color: var(--danger);
  font-weight: 600;
}

.record-type-neutral {
  color: var(--text-muted);
  font-weight: 600;
}

.publish-form textarea {
  min-height: 80px;
}

.publish-options .option-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.publish-options .option-row input {
  flex: 1;
}

.publish-options .option-row button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  color: var(--danger);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.add-option-btn {
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

/* ---- Stats Grid (About page) ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.stat-card {
  text-align: center;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

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

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 16px 10px;
  }

  .stat-value {
    font-size: 22px;
  }

  .stat-label {
    font-size: 12px;
  }
}
@media (max-width: 768px) {
  .charge-options {
    grid-template-columns: repeat(2, 1fr);
  }

  .list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .list-sort {
    width: 100%;
    flex-wrap: wrap;
  }

  .sort-btn {
    flex: 1;
    min-width: 70px;
    text-align: center;
  }

  .record-table {
    display: block;
  }

  .record-table thead {
    display: none;
  }

  .record-table tbody,
  .record-table tr,
  .record-table td {
    display: block;
    width: 100%;
  }

  .record-table tr {
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
  }

  .record-table td {
    border: none;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
  }

  .record-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 13px;
  }
}

/* ==================================================
   Profile FAB & Bottom Sheet (Mobile)
   ================================================== */

.profile-fab {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0,182,122,0.4);
  align-items: center;
  justify-content: center;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.profile-fab:active {
  transform: scale(0.92);
}

.profile-fab.open {
  background: var(--danger);
  transform: rotate(45deg);
}

.profile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s;
}

.profile-nav-overlay.open {
  display: block;
  opacity: 1;
}

.profile-nav-sheet {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--bg-primary);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  max-height: 75vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
}

.profile-nav-sheet.open {
  display: block;
  transform: translateY(0);
}

.profile-nav-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 2;
}

.profile-nav-sheet-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.profile-nav-sheet-close {
  font-size: 22px;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-nav-sheet-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px;
}

.profile-nav-sheet-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 16px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background 0.15s;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  text-align: center;
}

.profile-nav-sheet-item.danger {
  color: var(--danger);
}

.profile-nav-sheet-item:hover,
.profile-nav-sheet-item:active {
  background: var(--bg-secondary);
}

.profile-nav-sheet-item.active {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary);
}

.profile-nav-sheet-item .nav-icon {
  font-size: 24px;
  width: auto;
  text-align: center;
}

.profile-nav-sheet-item.danger {
  color: var(--danger);
}

@media (max-width: 992px) {
  .profile-fab {
    display: flex;
  }

  .profile-sidebar {
    display: none;
  }

  .profile-body {
    padding-bottom: 80px;
  }
}



/* ===== Mobile Bottom Tab Bar ===== */
.bottom-tab-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: 100%;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
    cursor: pointer;
    border: none;
    background: none;
}

    .bottom-tab-item .tab-icon {
        font-size: 20px;
        line-height: 1;
    }

    .bottom-tab-item.active {
        color: var(--primary);
        font-weight: 700;
    }

    .bottom-tab-item:hover {
        color: var(--primary);
    }

@media (max-width: 768px) {
    .bottom-tab-bar {
        display: flex;
    }

    /* Add bottom padding to main content to avoid tab bar overlap */
    .main-footer {
        padding-bottom: 60px;
    }
}

/* Desktop-only: show user avatar in header */
.desktop-user {
    display: flex;
    align-items: center;
    gap: 6px;
}
