/* ============================================================
   public.css - 彩缘汇 Shared Styles (all pages)
   Design system: warm brown/orange palette from index.css
   ============================================================ */

:root {
  --blue-deep: #54211d;
  --blue-bright: #b4534b;
  --blue-light: #f5ece6;
  --blue-mid: #78331e;
  --orange-rich: #b4534b;
  --orange-warm: #f47a55;
  --orange-light: #fdf5ef;
  --orange-pale: #f0e6d6;
  --primary-deep: #54211d;
  --primary-bright: #b4534b;
  --primary-warm: #f47a55;
  --primary-light: #fdf5ef;
  --white: #ffffff;
  --gray-50: #faf7f3;
  --gray-100: #f0ebe3;
  --gray-200: #e2dcd2;
  --gray-300: #c9c0b3;
  --gray-400: #a89d8e;
  --gray-500: #7d7264;
  --gray-600: #5c4f42;
  --gray-700: #3d3228;
  --gray-800: #2a2018;
  --nav-gradient: linear-gradient(135deg, #78331e 0%, #b4534b 35%, #f47a55 70%, #b4534b 100%);
  --nav-accent: #d5c59f;
  --nav-accent-glow: rgba(213, 197, 159, 0.15);
  --separator-gradient: linear-gradient(90deg, #d5c59f, #b4534b, #f47a55, #d5c59f);
  --card-shadow: 0 2px 8px rgba(84, 33, 29, 0.08);
  --card-shadow-hover: 0 8px 25px rgba(180, 83, 75, 0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 50px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --green-deep: #367459;
  --green-light: #e8f5ee;
  --gold: #d5c59f;
  --gold-light: #f5f0e4;
  --gold-dark: #b8a67e;
  --red: #e74c3c;
  --red-dark: #c0392b;
  --green: #27ae60;
  --blue: #3182ce;
}

/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-700);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body > main {
  flex: 1 0 auto;
  width: 100%;
}

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

ul,
ol {
  list-style: none;
}

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

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

/* ========== GRADIENT SEPARATOR ========== */
.gradient-separator {
  height: 4px;
  background: var(--separator-gradient);
  border: none;
  margin: 0;
}

/* ========== MAIN NAV ========== */
.main-nav {
  background: var(--nav-gradient);
  height: 72px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(180, 83, 75, 0.35);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.logo-icon::before {
  content: '汇';
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.logo-text {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 3px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.logo-text span {
  font-size: 11px;
  font-weight: 400;
  display: block;
  letter-spacing: 1px;
  opacity: 0.85;
  margin-top: -3px;
}

.nav-links {
  display: flex;
  gap: 6px;
  margin-left: 16px;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  transition: var(--transition);
  position: relative;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: #f47a55;
  border-radius: 2px;
}

.nav-search {
  flex: 1;
  max-width: 320px;
  margin-left: auto;
  position: relative;
}

.nav-search input {
  width: 100%;
  height: 38px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0 40px 0 16px;
  color: #fff;
  font-size: 14px;
  transition: var(--transition);
}

.nav-search input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.nav-search input:focus {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.nav-search .search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.nav-search .search-icon:hover {
  color: #fff;
}

.nav-auth {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
  margin-left: auto;
}

.btn-ghost {
  padding: 7px 20px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

.btn-solid {
  padding: 7px 20px;
  border-radius: var(--radius-pill);
  background: #f47a55;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(244, 122, 85, 0.3);
}

.btn-solid:hover {
  background: #e06840;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(244, 122, 85, 0.4);
}

/* ========== LOTTERY PILLS BAR ========== */
.lottery-pills-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 72px;
  z-index: 999;
}

.pills-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  padding: 12px 24px;
  gap: 10px;
  overflow-x: auto;
}

.pills-inner::-webkit-scrollbar {
  height: 0;
}

.pill-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-500);
  white-space: nowrap;
  margin-right: 4px;
}

.lottery-pill {
  padding: 7px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  border: 2px solid transparent;
  background: var(--gray-100);
  color: var(--gray-600);
}

.lottery-pill:hover {
  background: var(--orange-light);
  color: var(--orange-warm);
  border-color: var(--orange-warm);
}

.lottery-pill.active {
  background: linear-gradient(135deg, var(--orange-warm), var(--orange-rich));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 12px rgba(244, 122, 85, 0.3);
}

/* ========== BALL STYLES ========== */
.ball {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  transition: var(--transition);
}

.ball.kl8-ball {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.ball.red {
  background: linear-gradient(135deg, #b4534b, #8a3a34);
  box-shadow: 0 2px 6px rgba(180, 83, 75, 0.3);
}

.ball.blue {
  background: linear-gradient(135deg, var(--primary-bright), var(--primary-warm));
  box-shadow: 0 2px 6px rgba(180, 83, 75, 0.3);
}

.ball.orange {
  background: linear-gradient(135deg, var(--orange-warm), #d45e3a);
  box-shadow: 0 2px 6px rgba(244, 122, 85, 0.3);
}

.ball.green {
  background: linear-gradient(135deg, #367459, #54211d);
  box-shadow: 0 2px 6px rgba(54, 116, 89, 0.3);
}

/* ========== SECTION HEADER ========== */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.section-header .accent-bar {
  width: 5px;
  height: 26px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--primary-deep), var(--orange-rich));
  flex-shrink: 0;
}

.section-header h2 {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary-deep);
  letter-spacing: 0.5px;
}

.section-header .more {
  margin-left: auto;
  font-size: 13px;
  color: var(--gray-400);
  cursor: pointer;
  transition: var(--transition);
}

.section-header .more:hover {
  color: var(--orange-rich);
}

/* ========== CARD BASE ========== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

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

.card-header {
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-deep);
  border-bottom: 2px solid;
  border-image: var(--separator-gradient) 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* ========== SIDEBAR CARD ========== */
.sidebar-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: var(--transition);
}

.sidebar-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.sidebar-card-header {
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-deep);
  border-bottom: 2px solid;
  border-image: var(--separator-gradient) 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-card-body {
  padding: 12px 16px;
}

/* ========== QUICK LINK ========== */
.quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--gray-200);
  font-size: 14px;
  color: var(--gray-600);
  transition: var(--transition);
  cursor: pointer;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-link:last-child {
  border-bottom: none;
}

.quick-link:hover {
  color: var(--orange-rich);
  padding-left: 6px;
}

.quick-link .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange-warm);
  flex-shrink: 0;
}

.quick-link-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== TOOL ITEM ========== */
.tool-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  margin-bottom: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.tool-item:last-child {
  margin-bottom: 0;
}

.tool-item:hover {
  background: var(--orange-light);
  box-shadow: 0 2px 8px rgba(221, 107, 32, 0.1);
}

.tool-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.tool-icon.blue {
  background: var(--primary-light);
}

.tool-icon.orange {
  background: var(--orange-pale);
}

.tool-item-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.tool-item-desc {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
}

/* ========== CONTACT ITEM ========== */
.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--gray-600);
}

.contact-item .ci-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* ========== SITE FOOTER ========== */
.site-footer {
  background: var(--nav-gradient);
  color: rgba(255, 255, 255, 0.85);
  padding: 48px 0 0;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 36px;
}

.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.8;
  opacity: 0.7;
}

.footer-col h4 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  position: relative;
  padding-bottom: 10px;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 24px;
  height: 2px;
  background: #f47a55;
  border-radius: 1px;
}

.footer-col a {
  display: block;
  font-size: 13px;
  opacity: 0.7;
  padding: 5px 0;
  transition: var(--transition);
}

.footer-col a:hover {
  opacity: 1;
  color: #f47a55;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 20px 0;
  text-align: center;
  font-size: 12px;
  opacity: 0.6;
}

/* ========== FRIEND LINKS ========== */
.friend-links {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 16px;
  margin-bottom: 24px;
}

.friend-links-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-deep);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.friend-links-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--orange-rich);
  border-radius: 2px;
}

.friend-links-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.friend-link {
  padding: 5px 14px;
  background: var(--gray-100);
  border-radius: var(--radius-pill);
  font-size: 13px;
  color: var(--gray-500);
  transition: var(--transition);
  cursor: pointer;
}

.friend-link:hover {
  background: var(--primary-light);
  color: var(--primary-bright);
}

/* ========== PAGE LAYOUT ========== */
.page-layout {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  gap: 24px;
  padding: 24px;
  min-height: 800px;
}

.page-layout-full {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  min-height: 800px;
}

/* ========== SIDEBAR LEFT & RIGHT ========== */
.sidebar-left {
  position: sticky;
  top: 128px;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-right {
  position: sticky;
  top: 128px;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ========== CENTER COLUMN ========== */
.center-col {
  min-width: 0;
}

/* ========== ANNOUNCE ITEM ========== */
.announce-item {
  padding: 12px 0;
  border-bottom: 1px dashed var(--gray-200);
  cursor: pointer;
  transition: var(--transition);
}

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

.announce-item:hover {
  padding-left: 4px;
}

.announce-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 6px;
}

.announce-tag.hot {
  background: #fff5f5;
  color: #e53e3e;
}

.announce-tag.new {
  background: var(--primary-light);
  color: var(--primary-bright);
}

.announce-tag.tip {
  background: var(--orange-pale);
  color: var(--orange-rich);
}

.announce-text {
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 500;
  display: inline;
}

.announce-date {
  font-size: 11px;
  color: var(--gray-400);
  display: block;
  margin-top: 4px;
}

/* ========== QR CARD ========== */
.qr-card {
  background: linear-gradient(135deg, var(--primary-deep), var(--primary-warm));
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: #fff;
  box-shadow: 0 6px 20px rgba(26, 54, 93, 0.25);
}

.qr-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}

.qr-card p {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 16px;
}

.qr-placeholder {
  width: 140px;
  height: 140px;
  margin: 0 auto 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 2px dashed rgba(255, 255, 255, 0.3);
}

.qr-placeholder-inner {
  font-size: 14px;
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-placeholder-inner img,
.qr-placeholder-inner canvas {
  display: block !important;
  opacity: 1 !important;
}

.qr-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
}

/* ========== AD CARD ========== */
.ad-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.ad-card-img {
  height: 140px;
  background: linear-gradient(135deg, var(--orange-light), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--gray-400);
  border: 1px dashed var(--gray-300);
  margin: 12px;
  border-radius: var(--radius-sm);
}

.ad-card-label {
  padding: 0 16px 14px;
  font-size: 12px;
  color: var(--gray-400);
  text-align: center;
}

/* ========== AD BANNER ========== */
.ad-banner {
  background: linear-gradient(135deg, var(--orange-light), var(--primary-light));
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  min-height: 60px;
  border: 1px solid rgba(221, 107, 32, 0.1);
}

.ad-slot {
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--gray-400);
  padding: 12px;
  transition: var(--transition);
  cursor: pointer;
  border: 1px dashed var(--gray-300);
}

.ad-slot:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--orange-warm);
  color: var(--orange-rich);
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
  padding: 12px 0;
  font-size: 14px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--gray-500);
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--primary-deep);
}

.breadcrumb .sep {
  color: var(--gray-300);
  margin: 0 2px;
}

/* ========== DATA TABLE ========== */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: var(--gray-100);
}

.data-table th {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--gray-200);
}

.data-table td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
}

.data-table tbody tr {
  transition: background 0.2s;
}

.data-table tbody tr:hover {
  background: var(--gray-50);
}

/* ========== PAGINATION ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 0;
}

.pagination .page-btn {
  min-width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.pagination .page-btn:hover {
  border-color: var(--orange-warm);
  color: var(--orange-warm);
}

.pagination .page-btn.active {
  background: linear-gradient(135deg, var(--orange-warm), var(--orange-rich));
  color: #fff;
  border-color: transparent;
}

.pagination .page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========== TABS ========== */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab-bar::-webkit-scrollbar {
  height: 0;
}

.tab-item {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

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

.tab-item.active {
  background: var(--white);
  color: var(--primary-deep);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ========== FORM STYLES ========== */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--gray-700);
  background: var(--gray-50);
  transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
  outline: none;
}

.form-input::placeholder {
  color: var(--gray-400);
  font-weight: 400;
}

.form-input:focus {
  border-color: var(--primary-deep);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(84, 33, 29, 0.1);
}

.form-input:hover:not(:focus) {
  border-color: var(--gray-300);
}

.form-input:disabled {
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
  opacity: 0.7;
}

.form-group.error .form-input {
  border-color: var(--red);
  background: #fff5f5;
}

.error-message {
  display: none;
  font-size: 12px;
  color: var(--red);
  margin-top: 6px;
  padding-left: 4px;
  line-height: 1.4;
}

.form-group.error .error-message {
  display: block;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-deep), var(--primary-bright));
  color: #fff;
  box-shadow: 0 4px 12px rgba(84, 33, 29, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(84, 33, 29, 0.4);
  transform: translateY(-1px);
}

.btn-warm {
  background: linear-gradient(135deg, var(--orange-warm), var(--orange-rich));
  color: #fff;
  box-shadow: 0 4px 12px rgba(244, 122, 85, 0.3);
}

.btn-warm:hover {
  box-shadow: 0 6px 18px rgba(244, 122, 85, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--gray-200);
  color: var(--gray-600);
}

.btn-outline:hover {
  border-color: var(--orange-warm);
  color: var(--orange-warm);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

/* ========== LOADING ========== */
.loading-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}

.loading-overlay.show {
  display: flex;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(84, 33, 29, 0.15);
  border-top-color: var(--primary-deep);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ========== ANIMATIONS ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.5s ease forwards;
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(84, 33, 29, 0.2);
  border-radius: 999px;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(84, 33, 29, 0.2) var(--gray-100);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-left,
  .sidebar-right {
    position: static;
  }
}

@media (max-width: 768px) {
  .nav-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 12px;
    gap: 8px;
  }

  .nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 4px;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .nav-links a {
    padding: 6px 14px;
    font-size: 13px;
  }

  .nav-search {
    display: none;
  }

  .page-layout,
  .page-layout-full {
    padding: 12px;
  }

  .section-header h2 {
    font-size: 18px;
  }

  .lottery-pills-bar .pills-inner {
    padding: 10px 12px;
    gap: 6px;
  }

  .lottery-pill {
    padding: 6px 16px;
    font-size: 13px;
  }

  .ball {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 8px;
    font-size: 13px;
  }
}

/* ========== TOPBAR STYLES (参考caixiansheng) ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #78331e 0%, #b4534b 35%, #f47a55 70%, #b4534b 100%);
  box-shadow: 0 4px 20px rgba(180, 83, 75, 0.35);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(213, 197, 159, 0.95), transparent);
}

.topbar__inner {
  max-width: 1400px;
  margin: 0 auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar__brand .logo-icon {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.topbar__brand .logo-icon::before {
  content: '汇';
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.topbar__brand .logo-text {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 3px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.topbar__brand .logo-text span {
  font-size: 11px;
  font-weight: 400;
  display: block;
  letter-spacing: 1px;
  opacity: 0.85;
  margin-top: -3px;
}

.topbar__nav {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
}

.topbar__nav::-webkit-scrollbar {
  height: 0;
}

.topbar__nav-link {
  position: relative;
  padding: 6px 14px;
  border-radius: 50px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar__nav-link:hover,
.topbar__nav-link.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.topbar__nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 20px;
  height: 3px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: #f47a55;
}

.topbar__user,
.topbar__guest,
.topbar__logged {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar__profile {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 50px;
  padding: 4px 8px;
  transition: 0.24s ease;
  cursor: pointer;
}

.topbar__profile:hover {
  background: rgba(255, 255, 255, 0.1);
}

.topbar__btn {
  border: none;
  border-radius: 50px;
  padding: 7px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.topbar__btn--ghost {
  color: #fff;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
}

.topbar__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #fff;
}

.topbar__btn--primary {
  color: #fff;
  font-weight: 700;
  background: #f47a55;
  box-shadow: 0 2px 8px rgba(244, 122, 85, 0.3);
}

.topbar__btn--primary:hover {
  background: #e06840;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(244, 122, 85, 0.4);
}

.topbar__btn--logout {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 12px;
  padding: 5px 14px;
}

.topbar__btn--logout:hover {
  background: rgba(255, 255, 255, 0.2);
}

.topbar__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  object-fit: cover;
}

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

.topbar__uname {
  color: #fff;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__ubadge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
}

/* ========== UNIFIED SITE FOOTER ========== */
.site-footer {
  background: linear-gradient(135deg, #78331e 0%, #b4534b 35%, #f47a55 70%, #b4534b 100%);
  width: 100%;
  padding: 0;
  margin-top: auto;
  flex-shrink: 0;
}

.site-footer[data-unified-footer="true"] {
  padding: 0;
}

body > footer.site-footer {
  margin-top: auto;
  flex-shrink: 0;
}

.site-footer__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 36px 24px 32px;
}

.site-footer__layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.9fr) minmax(470px, 1.8fr) minmax(300px, 1fr);
  gap: 44px;
  align-items: start;
}

.site-footer__brand {
  min-width: 0;
}

.footer-logo-link {
  display: flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 14px;
}

.footer-logo-img {
  display: block;
  width: auto;
  max-width: 190px;
  height: 48px;
  object-fit: contain;
}

.site-footer__inner p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  line-height: 1.8;
  margin: 8px 0 0;
}

.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
}

.site-footer__meta a {
  color: rgba(255, 255, 255, 0.62);
}

.site-footer__meta a:hover {
  color: #fff;
}

.site-footer__copyright {
  color: rgba(255, 255, 255, 0.84) !important;
}

.site-footer__desc {
  color: rgba(255, 255, 255, 0.62) !important;
}

.site-footer__links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.site-footer__link-group h4 {
  position: relative;
  margin: 0 0 14px;
  padding-bottom: 9px;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.site-footer__link-group h4::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 24px;
  height: 2px;
  border-radius: 1px;
  background: #f8d8bd;
  content: '';
}

.site-footer__link-group a {
  display: flex;
  width: fit-content;
  padding: 4px 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  transition: var(--transition);
}

.site-footer__link-group a:hover {
  color: #fff;
  transform: translateX(2px);
}

.site-footer__contact {
  min-width: 0;
  padding-left: 28px;
  border-left: 1px solid rgba(255, 255, 255, 0.24);
}

.site-footer__contact-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 15px;
}

.site-footer__contact-kicker {
  color: #f8d8bd;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  line-height: 1;
  text-transform: uppercase;
}

.site-footer__contact-head strong {
  color: #fff;
  font-size: 21px;
  line-height: 1.3;
}

.site-footer__contact-head span:not(.site-footer__contact-kicker) {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
}

.site-footer__qr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.site-footer__qr-card {
  padding: 8px 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(84, 33, 29, 0.16);
  text-align: center;
}

.site-footer__qr-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  object-fit: cover;
}

.site-footer__qr-card span {
  display: block;
  margin-top: 6px;
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

@media (max-width: 1100px) {
  .site-footer__layout {
    grid-template-columns: minmax(220px, 0.85fr) minmax(420px, 1.65fr);
  }

  .site-footer__contact {
    grid-column: 1 / -1;
    width: min(360px, 100%);
    padding-top: 22px;
    padding-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.24);
    border-left: 0;
  }
}

@media (max-width: 700px) {
  .site-footer__inner {
    padding: 28px 16px;
  }

  .site-footer__layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .site-footer__links {
    gap: 20px 14px;
  }

  .site-footer__contact {
    grid-column: auto;
    width: 100%;
  }
}

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

  .site-footer__qr-grid {
    max-width: 320px;
  }
}

/* ========== BACK TO TOP ========== */
.gotop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange-warm), var(--orange-rich));
  color: var(--white);
  border: none;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: 0 4px 16px rgba(244, 122, 85, 0.3);
  z-index: 999;
}

.gotop.is-visible {
  opacity: 1;
  visibility: visible;
}

.gotop:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(244, 122, 85, 0.4);
}

/* ========== PAGE MAIN ========== */
.page-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  min-height: calc(100vh - 400px);
}

/* ========== UNIFIED EMPTY / LOADING STATES ========== */
.state-box,
.state-cell .state-box,
.expert-empty .state-box,
.notice-empty .state-box,
.combo-empty .state-box,
.uc-empty .state-box {
  min-height: 172px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px;
  padding: 28px 18px;
  border: 1px dashed var(--gray-200);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, var(--gray-50));
  color: var(--gray-500);
  text-align: center;
}

.state-cell {
  padding: 0 !important;
  background: #fff;
}

.state-mark {
  min-width: 58px;
  height: 58px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-deep), var(--orange-rich));
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(84, 33, 29, 0.16);
}

.state-box--loading .state-mark {
  position: relative;
  color: transparent;
}

.state-box--loading .state-mark::after {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  animation: state-spin 0.8s linear infinite;
}

.state-box--error .state-mark {
  background: linear-gradient(135deg, #9f2424, #dc3a3a);
}

.state-title {
  color: var(--gray-700);
  font-size: 16px;
  font-weight: 900;
}

.state-desc {
  max-width: 360px;
  color: var(--gray-400);
  font-size: 13px;
  line-height: 1.7;
}

.state-inline {
  min-height: 84px;
  margin: 0;
  padding: 18px 12px;
  border-radius: 8px;
}

.state-inline .state-mark {
  min-width: 44px;
  height: 44px;
  font-size: 12px;
}

.expert-empty,
.notice-empty,
.combo-empty,
.uc-empty {
  color: inherit;
  text-align: center;
}

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

/* ========== 全局购买弹窗 ========== */
.global-pay-mask {
  position: fixed;
  inset: 0;
  z-index: 1998;
  display: none;
  background: rgba(31, 22, 18, 0.46);
  backdrop-filter: blur(6px);
}

.global-pay-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1999;
  display: none;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  transform: translate(-50%, -50%);
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(84, 33, 29, 0.28);
  padding-bottom: 76px;
}

.global-pay-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--gray-100);
}

.global-pay-title {
  color: var(--primary-deep);
  font-size: 20px;
  font-weight: 900;
}

.global-pay-subtitle {
  margin-top: 6px;
  color: var(--gray-400);
  font-size: 13px;
}

.global-pay-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: var(--gray-50);
  color: var(--primary);
  cursor: pointer;
  font-size: 20px;
}

.global-pay-price {
  padding: 18px 24px 8px;
  color: var(--primary-deep);
  font-size: 34px;
  font-weight: 900;
}

.global-pay-price em {
  margin-left: 6px;
  color: var(--gray-400);
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
}

.global-pay-label {
  padding: 0 24px 10px;
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 700;
}

.global-pay-options {
  display: grid;
  gap: 10px;
  padding: 0 24px;
}

.global-pay-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: #fff;
  color: var(--gray-700);
  cursor: pointer;
  text-align: left;
}

.global-pay-option.is-active {
  border-color: var(--primary);
  background: linear-gradient(180deg, #fff8f4, #fff);
  box-shadow: 0 8px 20px rgba(180, 83, 75, 0.12);
}

.global-pay-option span {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.global-pay-option b {
  color: var(--primary-deep);
  font-size: 15px;
}

.global-pay-option em {
  color: var(--gray-400);
  font-size: 12px;
  font-style: normal;
}

.global-pay-option strong {
  white-space: nowrap;
  color: var(--primary);
  font-size: 14px;
}

.global-pay-point {
  margin: 14px 24px 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px dashed var(--gray-200);
  border-radius: 8px;
  color: var(--gray-700);
  font-size: 14px;
}

.global-pay-point small {
  margin-left: auto;
  color: var(--gray-400);
}

.global-pay-summary {
  margin: 12px 24px 0;
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--gray-50);
  color: var(--gray-500);
  font-size: 13px;
}

.global-pay-summary em {
  color: var(--primary);
  font-style: normal;
  font-weight: 800;
}

.global-pay-confirm {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  width: auto;
  height: 44px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #8f3a2d, #f47a55);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(143, 58, 45, 0.22);
}

.global-pay-confirm:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

/* Trend pages: reference-style periods, CaiYuanHui red/blue numbers */
.trend-open-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  white-space: nowrap;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.trend-open-code__sep {
  display: inline-flex;
  justify-content: center;
  min-width: 12px;
  color: var(--gray-400);
  font-weight: 600;
}

.trend-open-code__num {
  display: inline-flex;
  justify-content: center;
  min-width: 17px;
  text-align: center;
}

.trend-open-code__num--red {
  color: var(--red-dark);
}

.trend-open-code__num--blue {
  color: #2563eb;
}

.trend-table tbody tr.trend-period-separator td {
  border-top: 2px solid var(--orange-warm) !important;
}

.trend-table .hit-red,
.trend-table .hit-hundred,
.trend-table .hit-unit,
.trend-table .hit-main,
.trend-table .hit-pos1,
.trend-table .hit-pos3,
.trend-table .hit-pos5,
.trend-table .hit-p1,
.trend-table .hit-p3,
.trend-table .hit-p5,
.trend-table .hit-p7,
.trend-table .hit-num {
  background: linear-gradient(135deg, var(--orange-warm), var(--orange-rich)) !important;
  box-shadow: 0 2px 6px rgba(180, 83, 75, 0.34) !important;
}

.trend-table .hit-blue,
.trend-table .hit-ten,
.trend-table .hit-special,
.trend-table .hit-pos2,
.trend-table .hit-pos4,
.trend-table .hit-p2,
.trend-table .hit-p4,
.trend-table .hit-p6,
.trend-table .hit-num.g2 {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.32) !important;
}
