:root {
  --bg-image: url('');
  --bg-color: #f4f4f4;
  --primary-color: #ff9500;
  --dark-color: #333;
  --hover-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  --card-bg: rgba(255, 255, 255, 0.98);
}

body {
  margin: 0;
  background: var(--bg-image), var(--bg-color);
  background-size: cover;
  background-attachment: fixed;
  color: var(--dark-color);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

.retro-page {
  width: min(600px, calc(100% - 24px));
  margin: 12px auto 0;
}
.banner-carousel {
  overflow: hidden;
  border-radius: 14px;
  background: var(--card-bg);
}
.banner-img {
  display: block;
  width: 100%;
  height: auto;
}

/* 导航栏 */
.nav-bar {
  display: flex;
  justify-content: space-around;
  padding: 15px 5px;
  background: #fff;
  margin-top: 12px;
  border-radius: 14px;
  box-shadow: var(--hover-shadow);
}
.nav-item {
  flex: 1;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-img {
  width: 45px;
  height: 45px;
  object-fit: contain;
}
.nav-item-text {
  display: block;
  font-size: 11px;
  margin-top: 5px;
  font-weight: 600;
  color: #666;
}
.nav-item.active .nav-item-text {
  color: var(--primary-color);
}

/* 搜索栏 */
.search-bar {
  display: flex;
  justify-content: center;
  margin: 12px 0;
}
.search-input {
  padding: 10px 12px;
  font-size: 14px;
  border: 2px solid #333;
  border-radius: 8px 0 0 8px;
  outline: none;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  box-sizing: border-box;
}
.search-button {
  background: #333;
  color: #fff;
  border: none;
  padding: 0 15px;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

/* 列表项 */
.game-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.recommendations-title {
  margin: 24px 0 12px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}
.game-item {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border-radius: 12px;
  margin-bottom: 8px;
  padding: 10px;
  box-shadow: var(--hover-shadow);
  transition: transform 0.2s ease;
}

.logo-wrapper {
  position: relative;
  width: 50px;
  height: 50px;
  margin-right: 12px;
  flex-shrink: 0;
}
.game-logo {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}
.game-number {
  position: absolute;
  top: -4px;
  left: -4px;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: #ff4757;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  z-index: 2;
  padding: 0 2px;
  box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.game-info { flex: 1; overflow: hidden; }
.game-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-details {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
}
.pure-tag {
  background: #ffa502;
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}
.domain-tag {
  color: #ff4757;
  font-size: 11px;
  background: rgba(255, 71, 87, 0.1);
  padding: 1px 5px;
  border: 1px solid rgba(255, 71, 87, 0.2);
  border-radius: 4px;
  white-space: nowrap;
}
.update-time {
  font-size: 11px;
  color: #777;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.05);
  padding: 1px 5px;
  border-radius: 4px;
}

/* 网友分享头像模块 */
.share-user-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: #aaa;
  margin-top: 6px;
  border-top: 1px dashed #eee;
  padding-top: 4px;
}
.share-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  background: #f0f0f0;
}

.game-button {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 8px;
}

/* 状态提示 */
.loading, .no-more {
  text-align: center;
  padding: 20px;
  color: #999;
  display: none;
  font-size: 14px;
}
.loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
}

/* 底部声明 */
.footer-disclaimer {
  text-align: center;
  padding: 25px 15px;
  font-size: 11px;
  color: #bbb;
  border-top: 1px solid rgba(0,0,0,0.05);
}

/* 悬浮按钮 */
#poster-float-btn {
  position: fixed;
  bottom: 200px;
  right: 20px;
  z-index: 500;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50px;
  padding: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(5px);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
#poster-float-btn:hover {
  transform: translateY(-5px);
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
#poster-float-btn .nav-img {
  width: 35px;
  height: 35px;
  object-fit: contain;
  margin: 0;
}

/* 弹窗通用基础 */
.video-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}
.modal-content {
  position: relative;
  width: 80%;
  max-width: 350px;
}

/* 个人中心弹窗专用样式 */
.profile-content {
  background: #fff;
  padding: 24px 20px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.profile-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 15px;
  margin-bottom: 15px;
}
.profile-header .avatar {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 15px;
  border: 2px solid var(--primary-color);
  padding: 2px;
  background: #f9f9f9;
}
.user-info h3 {
  margin: 0 0 4px 0;
  font-size: 16px;
  color: #333;
}
.user-info p {
  margin: 0;
  font-size: 12px;
  color: #888;
  font-family: monospace;
}
.profile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #555;
  margin-bottom: 8px;
}
.vip-status-tag {
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

/* 倒计时样式 */
.vip-countdown-text {
  font-family: monospace;
  font-size: 15px;
  color: #ff4757;
  font-weight: bold;
  letter-spacing: 1px;
}
.profile-row-tip {
  font-size: 11px;
  color: #aaa;
  text-align: right;
  margin-bottom: 15px;
}

/* 详细免责声明样式 */
.profile-disclaimer {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed #eee;
  text-align: left;
}
.profile-disclaimer h4 {
  font-size: 13px;
  color: #333;
  margin: 0 0 8px 0;
  font-weight: 600;
}
.profile-disclaimer p {
  font-size: 11px;
  color: #888;
  margin: 0 0 6px 0;
  line-height: 1.6;
}

.video-container {
  width: 100%;
  aspect-ratio: 9/16;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}
.video-player { width: 100%; height: 100%; object-fit: contain; }
.close-button {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 32px;
  height: 32px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  z-index: 1001;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.clear-span {
  background: #000;
  color: #fff;
  padding: 2px 8px;
  border-radius: 8px;
  margin: 0 5px;
  animation: shake 0.6s infinite;
  display: inline-block;
  cursor: pointer;
}


/* ========================================= */
/* 首页个人中心：专属多规格套餐UI样式        */
/* ========================================= */
.profile-plan-box {
  margin: 15px 0 20px 0;
  text-align: center;
}
.profile-plan-title {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
  text-align: left;
  font-weight: bold;
}
.profile-plan-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.profile-plan-item {
  flex: 1;
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 12px 5px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  background: #fafafa;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.profile-plan-item input[type="radio"] { 
  display: none; 
}
.profile-plan-item.active {
  border-color: var(--primary-color);
  background: #fff8eb;
  box-shadow: 0 4px 12px rgba(255, 149, 0, 0.15);
  transform: translateY(-2px);
}
.profile-plan-item.active::after { 
  content: '✓'; 
  position: absolute; 
  top: -8px; 
  right: -8px; 
  background: var(--primary-color); 
  color: #fff; 
  width: 18px; 
  height: 18px; 
  border-radius: 50%; 
  font-size: 11px; 
  line-height: 18px; 
  font-weight: bold; 
}
.p-plan-name { 
  font-size: 13px; 
  color: #333; 
  font-weight: bold; 
  margin-bottom: 4px; 
}
.p-plan-price { 
  font-size: 18px; 
  color: #e64340; 
  font-weight: 900; 
}

.profile-pay-btn {
  background: linear-gradient(135deg, #ff9500, #ff5e00);
  color: #fff;
  border: none;
  padding: 13px 24px;
  border-radius: 25px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
  width: 100%;
  transition: transform 0.2s;
}
.profile-pay-btn:active { 
  transform: scale(0.96); 
}
.profile-pay-btn:disabled { 
  background: #ccc; 
  box-shadow: none; 
  cursor: not-allowed; 
}

html,body{touch-action:manipulation}
#poster-float-btn[hidden]{display:none}
.recommendation-more,.recommendation-retry{display:block;margin:10px auto 14px;min-height:44px}
.portal-qr-dialog{box-sizing:border-box;width:min(92vw,400px);max-height:88dvh;border:1px solid #ffffffca;border-radius:24px;padding:24px;text-align:center;color:#172332;background:#f5fbf9f5;box-shadow:0 20px 68px #0c211c54}
.portal-qr-dialog::backdrop{background:#182520aa}
@supports (backdrop-filter:blur(12px)){
  .portal-qr-dialog{background:linear-gradient(145deg,#ffffffed,#edf8f2df);backdrop-filter:blur(20px) saturate(140%)}
  .portal-qr-dialog::backdrop{backdrop-filter:blur(7px)}
}
.portal-qr-dialog p{margin:12px 0;line-height:1.5}
.portal-qr-image img{display:block;width:min(58vw,220px);height:auto;margin:14px auto;padding:8px;box-sizing:content-box;background:#fff;border:1px solid #d2e6db;border-radius:12px;image-rendering:pixelated}
.portal-qr-dialog .portal-qr-price{color:#075b35;font-size:18px;font-weight:750}
.portal-qr-dialog .portal-qr-status{background:#f6fbf8;border:1px solid #d8e9df;border-radius:12px;padding:11px 12px;color:#315649}
.portal-toast{position:fixed;bottom:max(20px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);z-index:100005;box-sizing:border-box;max-width:calc(100vw - 24px);width:max-content;padding:11px 16px;border:1px solid #40594d;border-radius:12px;color:#fff;background:#263b34f5;box-shadow:0 10px 32px #0f242544;backdrop-filter:blur(10px);font:600 14px/1.4 system-ui,sans-serif;pointer-events:none}
.portal-toast--success::before{content:'✓';display:inline-grid;place-items:center;width:20px;height:20px;margin-right:7px;border-radius:50%;background:#b3f1cf;color:#0a482a}
.portal-copy-status:not(:empty),#reviewProfileMessage:not(:empty),.queue-modal .gate-status:not(:empty){border:1px solid #eddbb9;border-radius:10px;background:#fff7e9;color:#67410f;padding:8px 10px;line-height:1.45}
#reviewProfileMessage:empty{display:none}
.portal-qr-button,.portal-qr-dialog button{min-height:44px;padding:0 14px;margin:4px;border:1px solid #08763c;border-radius:10px;background:white;color:#086535;font:inherit;cursor:pointer}
.portal-qr-dialog button:disabled{opacity:.55;cursor:wait}
.portal-account{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;margin-top:4px;user-select:text}
.portal-account .portal-qr-button{min-height:34px;margin:0;padding:0 10px}
.queue-benefits{margin:8px 0 0;padding:10px 14px;border:1px solid #f4dbb4;border-radius:12px;background:#fff8ec;color:#563914;text-align:left;list-style:none;font-size:13px;line-height:1.55}
.queue-benefits li+li{margin-top:3px}
.queue-benefits strong{display:block;margin-bottom:4px;color:#ad4d00;font-size:15px}
.queue-estimate{margin-top:8px;color:#805215;font-size:14px;line-height:1.5}
.queue-disclosure{margin-top:8px;color:#626972;font-size:12px;line-height:1.5}
.portal-qr-dialog{font-size:16px;padding:22px;overflow-y:auto}
.portal-qr-dialog h2{font-size:21px;margin:0 0 12px}
.portal-qr-dialog p{font-size:15px;overflow-wrap:anywhere}
.portal-home-guide{width:min(94vw,480px);padding:12px;max-height:94dvh}
.portal-home-guide button{margin:10px 0 0;min-width:100px}
.portal-qr-dialog.portal-home-guide.portal-guide-fullscreen {
  position:fixed; inset:0; margin:0; padding:0; width:100%; max-width:none;
  height:100vh; height:100dvh; max-height:none; overflow:hidden;
  background:transparent; border:0; border-radius:0; box-shadow:none;
  -webkit-backdrop-filter:none; backdrop-filter:none;
}
.portal-guide-fullscreen::backdrop { background:transparent; -webkit-backdrop-filter:none; backdrop-filter:none }
.portal-guide-fullscreen[open] { display:flex; flex-direction:column; align-items:center; gap:10px }
.portal-guide-fullscreen .portal-guide-content { width:100%; display:flex; justify-content:flex-end }
.portal-guide-fullscreen img {
  display:block; width:auto; height:auto; max-width:100%;
  max-height:calc(100vh - 72px);
  max-height:calc(100dvh - 72px - env(safe-area-inset-bottom,0px));
}
.portal-guide-fullscreen .portal-guide-close {
  flex:none; margin:0; min-width:132px; min-height:52px; padding:0 24px;
  border:0; border-radius:26px; background:rgba(0,0,0,.74); color:white;
  font-size:18px; font-weight:650;
}
@media (max-height:650px){
  .portal-qr-dialog{padding:14px}
  .portal-qr-dialog h2{margin-bottom:6px}
  .portal-qr-dialog p{margin:8px 0;font-size:14px}
  .portal-qr-image img{width:min(52vw,190px,30dvh);margin:8px auto}
}

body{font-family:system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',sans-serif}
.profile-plan-item:focus-within{outline:2px solid #b25500;outline-offset:2px}
.profile-plan-item input[type="radio"]{display:block;position:absolute;opacity:0;width:1px;height:1px}
.profile-plan-item:has(input:disabled){opacity:.5;cursor:not-allowed}
button:focus-visible,.nav-item:focus-visible{outline:3px solid #855200;outline-offset:2px}
#profileCardKeyInput{font-size:16px!important;min-height:48px}
body { overflow-x:visible; overflow-x:clip }
.lobby-tools { position:sticky; top:0; z-index:20; margin-top:12px; padding-top:env(safe-area-inset-top,0px); padding-bottom:1px; background:var(--bg-color) }
.lobby-tools .nav-bar { margin-top:0 }
#lobby-back-to-top {
  position:fixed; right:max(20px,env(safe-area-inset-right)); bottom:max(18px,env(safe-area-inset-bottom));
  z-index:501; width:44px; height:44px; display:grid; place-items:center;
  padding:0; border:1px solid #d4e4db; border-radius:50%; background:#f7fcf9;
  color:#146343; box-shadow:0 4px 15px #173a2429; cursor:pointer;
}
#lobby-back-to-top[hidden] { display:none }
#lobby-back-to-top::before { content:''; width:10px; height:10px; border-top:2px solid; border-left:2px solid; transform:translateY(2px) rotate(45deg) }
#poster-float-btn { transition:transform .3s ease, background .3s ease, box-shadow .3s ease }
#nav-home-guide { border:0; border-radius:10px; padding:0; background:transparent; color:inherit; font:inherit }
#nav-home-guide[hidden] { display:none }
.nav-guide-icon { position:relative; display:inline-grid; place-items:center; color:#147253 }
.nav-guide-icon::before { content:''; position:absolute; width:24px; height:33px; border:2px solid currentColor; border-radius:7px; background:#e9f7ee }
.nav-guide-icon::after { content:'+'; position:relative; font:700 23px/1 system-ui,sans-serif }
@media (hover:hover) { #nav-home-guide:hover { background:#eef8f1 } }
@media (max-width: 767px), (hover: none) and (pointer: coarse) and (max-width: 1440px) {
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { font-size: 16px; }
  .retro-page {
    width: auto;
    min-width: 0;
    margin-left: max(8px, env(safe-area-inset-left, 0px));
    margin-right: max(8px, env(safe-area-inset-right, 0px));
  }
  .banner-carousel, .nav-bar, .search-bar, .game-list, .search-recommendations { box-sizing: border-box; width: 100%; min-width: 0; }
  .nav-bar { padding: 12px 4px; }
  .nav-item { min-width: 0; min-height: 68px; }
  .nav-img { width: 42px; height: 42px; }
  .nav-item-text { font-size: 14px; line-height: 1.5; margin-top: 4px; }
  #nav-home-guide .nav-item-text { font-size:clamp(11px, 3.5vw, 14px); white-space:nowrap }
  .search-input { font-size: 16px; min-height: 48px; }
  .search-button { min-width: 64px; min-height: 48px; font-size: 15px; padding: 0 12px; }
  .game-item { padding: 7px 9px; margin-bottom: 8px; min-height: 76px; box-sizing: border-box; }
  .logo-wrapper { width: 50px; height: 50px; margin-right: 9px; }
  .game-info { min-width: 0; }
  .game-title { font-size: 17px; line-height: 1.24; margin-bottom: 3px; white-space: normal; overflow-wrap: anywhere; }
  .game-details { flex-wrap: wrap; gap: 4px; overflow: visible; }
  .pure-tag, .domain-tag, .update-time { font-size: 12px; line-height: 1.5; padding: 1px 4px; max-width: 100%; box-sizing: border-box; }
  .domain-tag { overflow: hidden; text-overflow: ellipsis; }
  .share-user-box { flex-wrap: wrap; gap: 3px; font-size: 12px; color: #70757d; line-height: 1.3; margin-top: 3px; padding-top: 2px; }
  .share-avatar { width: 15px; height: 15px; }
  .game-number { font-size: 11px; height: 18px; min-width: 18px; }
  .game-button { flex: 0 0 auto; min-width: 58px; min-height: 44px; padding: 0 10px; font-size: 15px; margin-left: 8px; border-radius: 9px; }
  .footer-disclaimer { font-size: 12px; color: #747980; padding: 24px 8px 84px; overflow-wrap: anywhere; }
  #poster-float-btn { bottom: max(14px,env(safe-area-inset-bottom)); right: max(10px,env(safe-area-inset-right)); padding: 8px; }
  #lobby-back-to-top { right:max(10px,env(safe-area-inset-right)); bottom:max(14px,env(safe-area-inset-bottom)) }
  #lobby-back-to-top:not([hidden]) + #poster-float-btn { bottom:calc(max(14px,env(safe-area-inset-bottom)) + 54px) }
  #poster-float-btn .nav-img { width: 28px; height: 28px; }
  #profileModal .profile-content { width: calc(100% - 24px); max-width: 420px; padding: 20px 16px; box-sizing: border-box; }
  #profileModal .profile-header { padding-right: 32px; }
  #profileModal .user-info { min-width: 0; overflow-wrap: anywhere; }
  #profileModal .user-info h3 { font-size: 18px; }
  #profileModal .user-info p, .vip-status-tag, .p-plan-name { font-size: 14px; }
  .profile-row { font-size: 15px; flex-wrap: wrap; gap: 6px; }
  .profile-row-tip, .profile-plan-title { font-size: 13px; }
  .profile-plan-selector { gap: 6px; }
  .profile-plan-item { min-width: 0; }
  .profile-disclaimer p { font-size: 12px; }
  #profileModal .close-button { width: 44px; height: 44px; top: 8px; right: 8px; }
}
