:root {
  --dark: #1E1E28;
  --card: #2A2A3C;
  --gold: #ffb400;
  --gold-gradient: linear-gradient(135deg, #ff7e00 0%, #ffaa00 100%);
}

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

html, body {
  width: 100%;
  min-height: 100%;
  height: auto !important;
  overflow-x: hidden;
  overflow-y: auto !important;
  background: #0d0d14;
  color: #eee;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-overflow-scrolling: touch;
}

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

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

*, .btn, img {
  -webkit-tap-highlight-color: transparent;
}

/* 移动端主容器 */
.app-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--dark);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
  padding-top: 175px;
  padding-bottom: 70px;
  overflow: visible !important;
}

/* 页面主框架 */
.main-content {
  display: block;
  width: 100%;
}

/* 固定头部，居中对齐 */
.header-fixed {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #191923;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 180, 0, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  will-change: transform;
}

/* 跑马灯公告 */
.notice-bar {
  width: 100%;
  overflow: hidden;
  background: linear-gradient(135deg, #141424 0%, #22223a 100%);
  border-bottom: 1px solid rgba(255, 180, 0, 0.2);
  height: 32px;
  line-height: 32px;
  position: relative;
  z-index: 10;
}

.notice-bar .notice-track {
  display: flex;
  white-space: nowrap;
  animation: scrollLeft 18s linear infinite;
  width: max-content;
  will-change: transform;
  transform: translateZ(0);
}

.notice-bar .notice-track span {
  flex-shrink: 0;
  padding: 0 40px;
  font-size: 13px;
  font-weight: 500;
  color: #ffb400;
  letter-spacing: 0.3px;
}

@keyframes scrollLeft {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.notice-bar:hover .notice-track {
  animation-play-state: paused;
}

/* 顶部分类导航 */
.top-nav {
  background: var(--dark);
  padding: 6px 8px 4px 8px;
  width: 100%;
}

.top-nav ul {
  display: flex;
  justify-content: space-between;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 5px;
}

.top-nav li {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #ccc;
  padding: 6px 0;
  border-radius: 18px;
  background: rgba(255, 180, 0, 0.08);
  border: 1.5px solid rgba(255, 180, 0, 0.25);
  transition: transform 0.15s ease, background-color 0.15s ease;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.top-nav li .nav-icon {
  font-size: 14px;
}

.top-nav li.active {
  color: #fff;
  background: var(--gold-gradient);
  border-color: #ffb400;
  box-shadow: 0 2px 10px rgba(255, 126, 0, 0.35);
  transform: scale(1.02);
}

.top-nav li:active {
  transform: scale(0.94);
}

/* 搜索框 */
.search-box {
  padding: 6px 10px 4px 10px;
  background: var(--dark);
}

.search-inner {
  position: relative;
  display: flex;
  align-items: center;
}

.search-inner input {
  width: 100%;
  height: 40px;
  padding: 0 76px 0 38px;
  border: 1px solid #444;
  border-radius: 20px;
  font-size: 13px;
  background: #fff;
  color: #000;
  outline: none;
}

.search-inner input:focus {
  border-color: var(--gold);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  cursor: pointer;
}

.search-submit-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  height: 32px;
  padding: 0 14px;
  border: none;
  border-radius: 16px;
  background: var(--gold-gradient);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.search-submit-btn:active {
  transform: translateY(-50%) scale(0.94);
}

/* 在线人数标识 */
.online-count-wrap {
  margin: 4px 10px 6px 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 20px;
  border: 1px solid rgba(255, 180, 0, 0.2);
  padding: 4px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.online-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #ffe6c7;
}

.online-num {
  font-weight: 800;
  font-size: 16px;
  color: #ffb400;
  min-width: 48px;
  display: inline-block;
  text-align: center;
  font-family: monospace;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  margin-left: 2px;
  box-shadow: 0 0 6px #22c55e;
  animation: pulseLive 1.4s infinite;
}

@keyframes pulseLive {
  0% { opacity: 0.4; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1.2); }
}

/* 页面内容视图 */
.page-content {
  display: none;
  width: 100%;
}

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

.free-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px 8px;
  background: var(--dark);
}

.free-label {
  position: relative;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  padding-left: 10px;
}

.free-label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3.5px;
  height: 18px;
  background: var(--gold);
  border-radius: 2px;
}

.free-more {
  font-size: 12px;
  color: #aaa;
}

/* 二级导航按钮 */
.sub-nav {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--dark);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sub-nav button {
  flex: 1;
  padding: 8px 0;
  border: none;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: #3a3a4c;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.sub-nav button.active {
  background: var(--gold-gradient);
  box-shadow: 0 2px 8px rgba(255, 126, 0, 0.4);
}

/* 卡片网格布局 */
.video-grid {
  padding: 4px 10px 10px 10px;
  background: var(--dark);
}

.video-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}

.video-card {
  background: #252535;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease;
  will-change: transform;
}

.video-card:active {
  transform: scale(0.97);
}

.video-thumb-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #1c1c28;
  overflow: hidden;
}

.video-thumb-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.free-tag {
  position: absolute;
  top: 0;
  left: 0;
  background: linear-gradient(135deg, #ff416c 0%, #ff6b6b 100%);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 0 0 8px 0;
  z-index: 5;
}

.lock-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  font-size: 14px;
}

.bottom-icons {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  z-index: 2;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  font-size: 10px;
  color: #eee;
}

.video-info {
  padding: 6px 8px;
}

.video-info h5 {
  font-size: 12px;
  color: #fff;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.get-resource-btn, .game-download-btn {
  display: block;
  width: calc(100% - 12px);
  margin: 2px 6px 6px 6px;
  padding: 4px 0;
  border: none;
  border-radius: 16px;
  background: var(--gold-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.game-download-btn {
  background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
}

/* 分页组件 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 10px 10px 20px 10px;
  background: var(--dark);
}

.pagination a {
  min-width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  font-size: 13px;
  color: #bbb;
  background: #2a2a3c;
  border-radius: 50%;
  cursor: pointer;
  padding: 0 4px;
}

.pagination a.on {
  background: var(--gold-gradient);
  color: #fff;
  font-weight: 700;
}

.pagination .next-btn {
  border-radius: 16px;
  background: #3a3a4c;
  padding: 0 12px;
}

/* 底部固定导航栏 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: #191923;
  border-top: 1px solid rgba(255, 180, 0, 0.15);
  z-index: 1000;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
  will-change: transform;
}

.bottom-nav a {
  flex: 1;
  text-align: center;
  padding: 7px 0 5px;
  font-size: 11px;
  color: #999;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.bottom-nav a.on {
  color: var(--gold);
}

.bottom-nav-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

.icon-home .bottom-nav-icon { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23ffb400" viewBox="0 0 24 24"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>'); }
.icon-category .bottom-nav-icon { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23999999" viewBox="0 0 24 24"><path d="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"/></svg>'); }
.icon-new .bottom-nav-icon { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23999999" viewBox="0 0 24 24"><path d="M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z"/></svg>'); }
.icon-me .bottom-nav-icon { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="%23999999" viewBox="0 0 24 24"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>'); }

/* 弹窗设计 (1:1 匹配用户截图) */
.modal-overlay, .welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 16px;
}

.modal-overlay.show, .welcome-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 360px;
  max-width: 100%;
  background: #ffffff;
  border-radius: 22px;
  padding: 16px 20px 20px 20px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  transform: scale(0.95);
  transition: transform 0.25s ease;
  color: #1e1e2d;
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

.modal-top-bar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 2px;
}

.modal-close {
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
  color: #b0b0b8;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}

.modal-close:hover {
  color: #333;
}

.modal-main-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  color: #1e1e2d;
  line-height: 1.35;
  letter-spacing: 0.5px;
}

.modal-sub-title {
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  color: #1e1e2d;
  line-height: 1.35;
  margin-bottom: 18px;
  letter-spacing: 0.5px;
}

.modal-btns {
  display: flex;
  margin-bottom: 14px;
}

.modal-btns button.btn-free {
  width: 100%;
  height: 60px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #ff007f 0%, #ff0055 100%);
  box-shadow: 0 6px 20px rgba(255, 0, 127, 0.35);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}

.modal-btns button.btn-free:active {
  transform: scale(0.96);
}

.btn-main-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
}

.btn-sub-text {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.9;
  margin-top: 1px;
}

.modal-input-row {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  margin-bottom: 4px;
}

.modal-input-row input {
  flex: 1;
  height: 50px;
  padding: 0 16px;
  border: 2.5px solid #ffa000;
  border-radius: 16px;
  font-size: 16px;
  color: #111111;
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s ease;
}

.modal-input-row input::placeholder {
  color: #999999;
  font-size: 15px;
}

.modal-input-row button {
  height: 50px;
  padding: 0 24px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #5b46f6 0%, #7c3aed 100%);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(91, 70, 246, 0.3);
  transition: transform 0.15s ease;
}

.modal-input-row button:active {
  transform: scale(0.95);
}

.modal-error-tip {
  font-size: 12px;
  color: #e53935;
  text-align: center;
  margin-top: 4px;
  display: none;
}

.modal-error-tip.show {
  display: block;
}

.modal-success-msg {
  font-size: 13px;
  color: #22c55e;
  font-weight: 600;
  text-align: center;
  margin-top: 4px;
  display: none;
}

.modal-success-msg.show {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.modal-footer-count {
  font-size: 13px;
  color: #888888;
  text-align: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #e2e8f0;
  font-weight: 500;
}

/* 欢迎页 */
.welcome-content {
  width: 360px;
  max-width: 100%;
  background: #252535;
  color: #fff;
  border-radius: 20px;
  padding: 20px;
  border: 1px solid rgba(255, 180, 0, 0.2);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.welcome-title {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 12px;
}

.welcome-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.welcome-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

.welcome-btn {
  width: 100%;
  padding: 10px 0;
  border: none;
  border-radius: 20px;
  background: var(--gold-gradient);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

/* Toast 提示 */
.toast-tip {
  position: fixed;
  bottom: 40%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  padding: 8px 18px;
  border-radius: 16px;
  font-size: 12px;
  z-index: 999999;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  text-align: center;
}

.toast-tip.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.search-result-wrap {
  padding: 24px 16px;
  text-align: center;
}

.search-result-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.search-back-link {
  margin-top: 16px;
  font-size: 13px;
  color: #888;
  cursor: pointer;
}
