:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --border: #e8e8e8;
  --accent: #c9a227;
  --accent-soft: rgba(201, 162, 39, 0.12);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: 80px;
}

.carousel-wrap {
  position: relative;
  background: var(--surface);
  overflow: hidden;
  width: 100%;
  padding-top: 64px;
}

.carousel {
  display: flex;
  overflow: hidden;
  transition: transform 0.45s ease;
  touch-action: pan-y;
}

.carousel-slide {
  flex-shrink: 0;
  width: 100%;
}

.carousel-slide img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 16px;
  background: var(--surface);
  margin-top: 8px;
}

.carousel-dots button {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: #d0d0d0;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.carousel-dots button[aria-current="true"] {
  background: var(--accent);
  transform: scale(1.15);
}

.site-header {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 12px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.site-header-logo {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  line-height: 0;
  background: #f5f5f5;
}

.site-header-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.site-header-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header-sub {
  font-size: 12px;
  color: #c9a227;
  font-weight: 600;
}

.site-share-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
  background: rgba(255,255,255,0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: background 0.2s, color 0.2s;
}

.site-share-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.marquee-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  margin: 0 0 12px;
}

.marquee-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.marquee-track {
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-inner {
  display: inline-block;
  white-space: nowrap;
  animation: marquee 22s linear infinite;
  font-size: 13px;
  color: var(--text-muted);
}

.marquee-inner:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.tabs {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.tab {
  flex: 1;
  padding: 10px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.tab:hover {
  border-color: #ccc;
  color: var(--text);
}

.tab.is-active {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}

.nav-grid {
  list-style: none;
  padding: 0 14px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nav-card:hover {
  border-color: #ddd;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.nav-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f0f0f0;
}

.nav-card-body {
  width: 100%;
  text-align: center;
  margin-top: 8px;
}

.nav-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.nav-card-sub {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-card-arrow {
  display: none;
}

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

.tab-view {
  display: block;
}
.tab-view.hidden {
  display: none;
}

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -1px 8px rgba(0,0,0,0.05);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 10px;
  padding: 4px 16px;
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.2s;
}

.bottom-nav-item:hover,
.bottom-nav-item.is-active {
  color: var(--accent);
}

.bottom-nav-item svg {
  display: block;
}

.sim-title-wrap {
  text-align: center;
  padding: 18px 16px 4px;
}

.sim-title-rainbow {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(
    90deg,
    #ff4d4d, #ff9a00, #ffe600, #00d26a, #00a2ff, #6a00ff, #ff4d9d
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbow-slide 3s linear infinite;
  display: inline-block;
}

@keyframes rainbow-slide {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.sim-list {
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sim-card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.15s;
  position: relative;
}

.sim-card:active {
  transform: scale(0.99);
  box-shadow: none;
}

.sim-card img {
  width: 100%;
  height: auto;
  display: block;
}

.sim-card-rainbow::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255,77,77,0.18),
    rgba(255,154,0,0.18),
    rgba(255,230,0,0.18),
    rgba(0,210,106,0.18),
    rgba(0,162,255,0.18),
    rgba(106,0,255,0.18),
    rgba(255,77,157,0.18)
  );
  background-size: 400% 400%;
  animation: rainbow-slide 4s linear infinite;
  pointer-events: none;
  border-radius: inherit;
}
.cs-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 18px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.cs-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cs-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cs-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.cs-status {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.cs-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #52c41a;
  flex-shrink: 0;
  display: inline-block;
}

.cs-list {
  padding: 0 0 12px;
}

.cs-list-title {
  font-size: 12px;
  color: var(--text-muted);
  padding: 14px 18px 8px;
}

.cs-link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.15s;
}

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

.cs-link-item:hover {
  background: #fafafa;
}

.cs-link-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.cs-link-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cs-link-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.cs-link-val {
  font-size: 12px;
  color: var(--text-muted);
}

.find-cover {
  height: 160px;
  background-color: #1a1a2e;
  background-image: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
}

.find-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.12) 0%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
}

.find-profile {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 0 16px;
  margin-top: -36px;
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}

.find-avatar {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 3px solid var(--surface);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  flex-shrink: 0;
  background: var(--surface);
}

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

.find-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 6px;
}

.feeds-loading,
.feeds-empty {
  text-align: center;
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 14px;
}

.feed-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.feed-user {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.feed-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface);
}

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

.feed-meta {
  padding-top: 2px;
  flex: 1;
}

.feed-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.feed-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.feed-content {
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
  padding: 0 0 10px;
  word-break: break-all;
}

.feed-images {
  margin-top: 4px;
}

.feed-img-wrap {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.feed-img {
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #f0f0f0;
  cursor: pointer;
  background: #f0f0f0;
}

.feed-img-1 .feed-img {
  max-width: 200px;
  max-height: 200px;
  width: auto;
  height: auto;
}

.feed-img-grid .feed-img {
  width: 100px;
  height: 100px;
}

.cs-copy-btn {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cs-copy-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.cs-copy-btn.copied {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.lottery-section {
  padding: 0 16px 16px;
  user-select: none;
}

.lottery-title {
  text-align: center;
  padding: 16px 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.lottery-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 16px 16px;
  box-shadow: var(--shadow);
}

.lottery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  height: min(52vw, 280px);
  width: 100%;
}

.lottery-cell {
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  padding: 4px;
  line-height: 1.3;
  background: #f5f5f5;
  border: 2px solid transparent;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  position: relative;
  overflow: hidden;
}

.lottery-cell:nth-child(1) { grid-column: 1; grid-row: 1; }
.lottery-cell:nth-child(2) { grid-column: 2; grid-row: 1; }
.lottery-cell:nth-child(3) { grid-column: 3; grid-row: 1; }
.lottery-cell:nth-child(4) { grid-column: 1; grid-row: 2; }
.lottery-center-btn:nth-child(5) { grid-column: 2; grid-row: 2; }
.lottery-cell:nth-child(6) { grid-column: 3; grid-row: 2; }
.lottery-cell:nth-child(7) { grid-column: 1; grid-row: 3; }
.lottery-cell:nth-child(8) { grid-column: 2; grid-row: 3; }
.lottery-cell:nth-child(9) { grid-column: 3; grid-row: 3; }

.lottery-cell .lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.lottery-cell.highlight {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-soft), 0 0 16px rgba(201,162,39,0.35);
  animation: cell-glow 0.4s ease-in-out;
}

.lottery-cell.lucky {
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
  border-color: #ffc107;
  box-shadow: 0 0 0 2px rgba(255,193,7,0.25), 0 0 20px rgba(255,193,7,0.4);
  animation: lucky-glow 0.6s ease-in-out infinite alternate;
}

@keyframes cell-glow {
  0%   { transform: scale(0.88); opacity: 0.7; }
  60%  { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes lucky-glow {
  0%   { box-shadow: 0 0 0 2px rgba(255,193,7,0.2), 0 0 16px rgba(255,193,7,0.3); }
  100% { box-shadow: 0 0 0 3px rgba(255,193,7,0.35), 0 0 28px rgba(255,193,7,0.55); }
}

.lottery-center-btn {
  place-self: center;
  width: min(78%, 92px);
  height: min(78%, 92px);
  min-width: 56px;
  min-height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a227, #e8c547);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(201,162,39,0.45);
  z-index: 10;
  position: relative;
  padding: 0;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: btn-idle 2.5s ease-in-out infinite;
}

@keyframes btn-idle {
  0%, 100% { box-shadow: 0 4px 16px rgba(201,162,39,0.45); }
  50%       { box-shadow: 0 4px 24px rgba(201,162,39,0.65), 0 0 8px rgba(232,197,71,0.4); }
}

.lottery-center-btn:active {
  transform: scale(0.93);
  box-shadow: 0 2px 8px rgba(201,162,39,0.3);
  animation: none;
}

.lottery-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.lottery-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.lottery-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.lottery-modal {
  background: var(--surface);
  border-radius: 20px;
  padding: 36px 28px 28px;
  width: 300px;
  text-align: center;
  transform: scale(0.85) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.lottery-overlay.show .lottery-modal {
  transform: scale(1) translateY(0);
}

.lottery-modal-icon {
  font-size: 52px;
  margin-bottom: 12px;
  line-height: 1;
}

.lottery-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.lottery-modal-msg {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.lottery-modal-btn {
  padding: 11px 32px;
  background: linear-gradient(135deg, #c9a227, #e8c547);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(201,162,39,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}

.lottery-modal-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(201,162,39,0.3);
}

.lottery-modal.no-win .lottery-modal-title {
  font-size: 16px;
}

.lottery-modal.win-high .lottery-modal-title {
  background: linear-gradient(90deg, #ff4d4d, #ff9a00, #ffe600, #00d26a, #00a2ff, #6a00ff, #ff4d9d);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: rainbow-slide 2s linear infinite;
}

/* prize amounts */
.prize-8   { color: #ff6b6b; }
.prize-18  { color: #ff9a00; }
.prize-28  { color: #52c41a; }
.prize-38  { color: #00a2ff; }
.prize-88  { color: #6a00ff; }
.prize-168 { color: #c9a227; font-size: 13px; }
.prize-888 { color: #ff4d9d; font-size: 13px; }
.prize-noluck { color: #999; }

/* ===== 页面加载动画 ===== */
#pageLoader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 16px;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}
#pageLoader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e8e8e8;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loader-text {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== 骨架屏 ===== */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
}

.carousel-skeleton {
  display: none;
}
.carousel-skeleton.active {
  display: block;
}

.skeleton-banner {
  width: 100%;
  padding-top: 56.25%;
  border-radius: 0;
  position: relative;
}
.skeleton-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 0;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 0 16px;
}
.skeleton-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
#navSkeleton {
  list-style: none;
  padding: 0 14px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.skeleton-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  gap: 8px;
}
.skeleton-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}
.skeleton-text {
  width: 60%;
  height: 12px;
}
