/* ===== V2.0 新增功能样式 ===== */

/* 通用面板遮罩 */
.panel-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 1000;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.panel-overlay.show { display: flex; }

/* ===== 登录面板 ===== */
.login-panel {
  background: linear-gradient(180deg, #f0f6fb 0%, #d8e8f5 100%);
  border-radius: 20px; padding: 30px; width: 90%; max-width: 360px;
  box-shadow: 0 20px 60px rgba(40,80,120,0.3);
  text-align: center;
}
.login-title { font-size: 22px; font-weight: bold; color: #2a4a6a; margin-bottom: 8px; }
.login-sub { font-size: 13px; color: #6a8aaa; margin-bottom: 20px; }
.login-tabs { display: flex; margin-bottom: 20px; background: #e0ecf5; border-radius: 10px; padding: 4px; }
.login-tab { flex: 1; padding: 10px; border: none; background: transparent; border-radius: 8px; font-size: 14px; color: #6a8aaa; cursor: pointer; transition: all 0.3s; }
.login-tab.active { background: #fff; color: #2a4a6a; font-weight: bold; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.login-form input {
  width: 100%; padding: 14px; border: 2px solid #c8dcf0; border-radius: 12px;
  font-size: 15px; margin-bottom: 12px; box-sizing: border-box; outline: none;
  transition: border-color 0.3s;
}
.login-form input:focus { border-color: #5aa0d0; }
.avatar-options { display: flex; gap: 8px; margin: 8px 0 16px; justify-content: center; }
.avatar-opt { font-size: 28px; padding: 6px; border-radius: 10px; cursor: pointer; border: 2px solid transparent; transition: all 0.3s; }
.avatar-opt.active { border-color: #5aa0d0; background: #fff; }
.login-btn {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, #5aa0d0, #3a7ab0); color: #fff;
  font-size: 16px; font-weight: bold; cursor: pointer; transition: all 0.3s;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(90,160,208,0.4); }
.login-msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.login-tip { font-size: 11px; color: #9ab0c5; margin-top: 16px; }

/* ===== 顶部用户信息 ===== */
.top-user-info {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.9); padding: 6px 14px; border-radius: 20px;
  cursor: pointer; font-size: 13px; color: #2a4a6a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1); transition: all 0.3s;
}
.top-user-info:hover { background: #fff; transform: translateY(-1px); }
.user-avatar { font-size: 18px; }
.user-name { font-weight: 500; }
.user-coins { color: #f5a623; font-weight: bold; }
.login-prompt { color: #5aa0d0; }

/* ===== 广告面板 ===== */
.ad-panel {
  background: #1a1a2e; border-radius: 16px; width: 90%; max-width: 340px;
  overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.ad-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: rgba(255,255,255,0.1);
}
.ad-label { font-size: 12px; color: rgba(255,255,255,0.6); }
.ad-countdown { font-size: 14px; color: #fff; font-weight: bold; }
.ad-content { padding: 30px 20px; }
.ad-mock-video {
  background: linear-gradient(135deg, #16213e, #0f3460);
  border-radius: 12px; padding: 40px 20px; text-align: center;
}
.ad-mock-icon { font-size: 48px; margin-bottom: 12px; }
.ad-mock-text { color: #fff; font-size: 16px; font-weight: bold; margin-bottom: 6px; }
.ad-mock-sub { color: rgba(255,255,255,0.5); font-size: 11px; margin-bottom: 20px; }
.ad-loading-bar { width: 100%; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; overflow: hidden; }
.ad-loading-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #5aa0d0, #7ac0e8); transition: width 1s linear; }
.ad-reward-info { padding: 12px 20px; text-align: center; color: #ffd700; font-size: 13px; }
.ad-close-btn {
  width: 100%; padding: 14px; border: none; background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.4); font-size: 15px; cursor: not-allowed; transition: all 0.3s;
}
.ad-close-btn.ready { background: linear-gradient(135deg, #4caf50, #2e7d32); color: #fff; cursor: pointer; font-weight: bold; }

/* ===== 关卡选择面板 ===== */
.level-panel {
  background: linear-gradient(180deg, #f0f6fb 0%, #d8e8f5 100%);
  border-radius: 20px; width: 92%; max-width: 420px; max-height: 85vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(40,80,120,0.3);
}
.level-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; background: rgba(255,255,255,0.5);
}
.level-back-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: #fff; font-size: 18px; cursor: pointer; color: #2a4a6a; }
.level-title { font-size: 18px; font-weight: bold; color: #2a4a6a; }
.level-stats { font-size: 12px; color: #6a8aaa; }
.level-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  padding: 20px; overflow-y: auto; flex: 1;
}
.level-card {
  background: #fff; border-radius: 14px; padding: 14px 10px; text-align: center;
  cursor: pointer; position: relative; transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.level-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.level-card.locked { opacity: 0.5; cursor: not-allowed; }
.level-card.locked:hover { transform: none; }
.level-num { font-size: 24px; font-weight: bold; color: #5aa0d0; }
.level-name { font-size: 12px; color: #2a4a6a; margin: 4px 0; font-weight: 500; }
.level-difficulty { font-size: 10px; margin-bottom: 4px; }
.level-stars { font-size: 14px; color: #ddd; }
.level-star.filled { color: #ffd700; }
.level-lock { position: absolute; top: 8px; right: 8px; font-size: 16px; }
.level-best { font-size: 10px; color: #9ab0c5; margin-top: 4px; }
.level-footer { padding: 12px 20px; background: rgba(255,255,255,0.5); text-align: center; }
.level-tip { font-size: 11px; color: #6a8aaa; }

/* ===== 关卡目标面板 ===== */
.level-goal-panel {
  background: linear-gradient(180deg, #fff 0%, #f0f6fb 100%);
  border-radius: 20px; padding: 30px; width: 85%; max-width: 320px;
  text-align: center; box-shadow: 0 20px 60px rgba(40,80,120,0.3);
  animation: goalPop 0.4s ease-out;
}
@keyframes goalPop { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.level-goal-title { font-size: 20px; font-weight: bold; color: #2a4a6a; margin-bottom: 20px; }
.level-goal-list { margin-bottom: 20px; }
.level-goal-item { display: flex; align-items: center; gap: 10px; padding: 10px; background: #f8fafc; border-radius: 10px; margin-bottom: 8px; font-size: 14px; color: #2a4a6a; }
.goal-icon { font-size: 20px; }
.level-goal-reward { font-size: 14px; color: #f5a623; font-weight: bold; margin-bottom: 12px; }
.level-goal-countdown { font-size: 13px; color: #5aa0d0; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ===== 关卡结算面板 ===== */
.level-result-panel {
  background: linear-gradient(180deg, #fff 0%, #f0f6fb 100%);
  border-radius: 20px; padding: 30px; width: 85%; max-width: 340px;
  text-align: center; box-shadow: 0 20px 60px rgba(40,80,120,0.3);
}
.result-title { font-size: 22px; font-weight: bold; color: #2a4a6a; margin-bottom: 16px; }
.result-stars { font-size: 36px; color: #ddd; margin-bottom: 16px; }
.result-star.filled { color: #ffd700; animation: starPop 0.5s ease-out; }
@keyframes starPop { 0% { transform: scale(0); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
.result-score { font-size: 16px; color: #2a4a6a; margin-bottom: 16px; }
.result-score b { color: #5aa0d0; font-size: 22px; }
.result-conditions { margin-bottom: 16px; }
.result-condition { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 8px; margin-bottom: 6px; font-size: 13px; }
.result-condition.pass { background: #e8f5e9; color: #2e7d32; }
.result-condition.fail { background: #ffebee; color: #c62828; }
.result-reward { background: #fff8e1; padding: 10px; border-radius: 10px; color: #f57c00; font-size: 14px; font-weight: bold; margin-bottom: 16px; }
.result-actions { display: flex; gap: 10px; }
.result-btn { flex: 1; padding: 12px; border: none; border-radius: 10px; background: #e0ecf5; color: #2a4a6a; font-size: 14px; cursor: pointer; transition: all 0.3s; }
.result-btn.primary { background: linear-gradient(135deg, #5aa0d0, #3a7ab0); color: #fff; }
.result-btn:hover { transform: translateY(-2px); }

/* ===== 皮肤商店面板 ===== */
.skin-panel {
  background: linear-gradient(180deg, #f0f6fb 0%, #d8e8f5 100%);
  border-radius: 20px; width: 92%; max-width: 420px; max-height: 85vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(40,80,120,0.3);
}
.skin-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: rgba(255,255,255,0.5); }
.skin-back-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: #fff; font-size: 18px; cursor: pointer; color: #2a4a6a; }
.skin-title { font-size: 18px; font-weight: bold; color: #2a4a6a; }
.skin-coins { font-size: 14px; color: #f5a623; font-weight: bold; background: #fff; padding: 6px 12px; border-radius: 12px; }
.skin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 20px; overflow-y: auto; flex: 1; }
.skin-card { background: #fff; border-radius: 14px; padding: 14px; text-align: center; position: relative; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.skin-preview { width: 100%; height: 80px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.skin-icon { font-size: 40px; }
.skin-name { font-size: 14px; font-weight: bold; color: #2a4a6a; margin-bottom: 4px; }
.skin-desc { font-size: 11px; color: #9ab0c5; margin-bottom: 10px; min-height: 28px; }
.skin-trial-badge { position: absolute; top: 8px; left: 8px; background: #9c27b0; color: #fff; font-size: 10px; padding: 3px 8px; border-radius: 8px; }
.skin-action-btn { width: 100%; padding: 8px; border: none; border-radius: 8px; font-size: 12px; cursor: pointer; transition: all 0.3s; }
.skin-action-btn.current { background: #e8f5e9; color: #2e7d32; cursor: default; }
.skin-equip-btn { background: linear-gradient(135deg, #5aa0d0, #3a7ab0); color: #fff; }
.skin-buy-btn { background: #fff8e1; color: #f57c00; border: 1px solid #ffe082; }
.skin-ad-btn { background: #f3e5f5; color: #7b1fa2; }
.skin-footer { padding: 12px 20px; background: rgba(255,255,255,0.5); text-align: center; }
.skin-tip { font-size: 11px; color: #6a8aaa; }

/* ===== 排行榜面板 ===== */
.rank-panel {
  background: linear-gradient(180deg, #f0f6fb 0%, #d8e8f5 100%);
  border-radius: 20px; width: 90%; max-width: 380px; max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(40,80,120,0.3);
}
.rank-header { padding: 16px 20px; background: rgba(255,255,255,0.5); }
.rank-header > div:first-child { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.rank-back-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: #fff; font-size: 18px; cursor: pointer; color: #2a4a6a; }
.rank-title { font-size: 18px; font-weight: bold; color: #2a4a6a; }
.rank-tabs { display: flex; gap: 8px; }
.rank-tab { flex: 1; padding: 8px; border: none; background: #e0ecf5; border-radius: 8px; font-size: 13px; color: #6a8aaa; cursor: pointer; }
.rank-tab.active { background: #fff; color: #2a4a6a; font-weight: bold; }
.rank-list { padding: 12px 16px; overflow-y: auto; flex: 1; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; margin-bottom: 6px; background: #fff; }
.rank-item.me { background: #fff8e1; border: 1px solid #ffe082; }
.rank-num { width: 28px; text-align: center; font-size: 14px; font-weight: bold; color: #6a8aaa; }
.rank-avatar { font-size: 22px; }
.rank-name { flex: 1; font-size: 14px; color: #2a4a6a; }
.rank-score { font-size: 14px; font-weight: bold; color: #5aa0d0; }
.rank-empty { text-align: center; color: #9ab0c5; padding: 40px 0; font-size: 14px; }
.rank-footer { padding: 12px 16px; background: rgba(255,255,255,0.5); }
.rank-mine { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #fff8e1; }
.rank-mine-num { width: 28px; text-align: center; font-size: 14px; font-weight: bold; color: #f5a623; }
.rank-mine-avatar { font-size: 22px; }
.rank-mine-name { flex: 1; font-size: 14px; color: #2a4a6a; font-weight: 500; }
.rank-mine-score { font-size: 14px; font-weight: bold; color: #5aa0d0; }
.rank-mine-empty { text-align: center; color: #9ab0c5; font-size: 13px; padding: 8px; }

/* ===== 好友面板 ===== */
.friend-panel {
  background: linear-gradient(180deg, #f0f6fb 0%, #d8e8f5 100%);
  border-radius: 20px; width: 90%; max-width: 380px; max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 60px rgba(40,80,120,0.3);
}
.friend-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: rgba(255,255,255,0.5); }
.friend-back-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: #fff; font-size: 18px; cursor: pointer; color: #2a4a6a; }
.friend-title { font-size: 18px; font-weight: bold; color: #2a4a6a; }
.friend-search { display: flex; gap: 8px; padding: 12px 16px; }
.friend-search input { flex: 1; padding: 10px 14px; border: 2px solid #c8dcf0; border-radius: 10px; font-size: 13px; outline: none; }
.friend-search input:focus { border-color: #5aa0d0; }
.friend-search button { padding: 10px 16px; border: none; border-radius: 10px; background: linear-gradient(135deg, #5aa0d0, #3a7ab0); color: #fff; font-size: 13px; cursor: pointer; }
.friend-search-results { padding: 0 16px; max-height: 150px; overflow-y: auto; }
.search-results-title { font-size: 12px; color: #6a8aaa; margin-bottom: 8px; }
.search-result-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border-radius: 8px; margin-bottom: 6px; }
.search-avatar { font-size: 20px; }
.search-name { flex: 1; font-size: 13px; color: #2a4a6a; }
.search-score { font-size: 11px; color: #9ab0c5; }
.search-add-btn { padding: 5px 12px; border: none; border-radius: 6px; background: #4caf50; color: #fff; font-size: 12px; cursor: pointer; }
.search-empty { text-align: center; color: #9ab0c5; font-size: 13px; padding: 12px; }
.friend-list { padding: 12px 16px; overflow-y: auto; flex: 1; }
.friend-item { display: flex; align-items: center; gap: 10px; padding: 12px; background: #fff; border-radius: 12px; margin-bottom: 8px; }
.friend-avatar { font-size: 28px; }
.friend-info { flex: 1; }
.friend-name { display: block; font-size: 14px; color: #2a4a6a; font-weight: 500; }
.friend-status { font-size: 11px; color: #9ab0c5; }
.friend-score { font-size: 12px; color: #5aa0d0; font-weight: bold; }
.friend-challenge-btn { padding: 6px 14px; border: none; border-radius: 8px; background: linear-gradient(135deg, #ff9a9a, #ff6b6b); color: #fff; font-size: 12px; cursor: pointer; }
.friend-empty { text-align: center; color: #9ab0c5; padding: 40px 0; font-size: 14px; }

/* ===== Toast提示 ===== */
.game-toast {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8); color: #fff; padding: 12px 24px; border-radius: 10px;
  font-size: 14px; z-index: 9999; animation: toastIn 0.3s ease-out;
  pointer-events: none;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

/* ===== 游戏内广告复活按钮 ===== */
.ad-revive-btn {
  display: block; width: 100%; padding: 12px; margin-top: 8px;
  border: none; border-radius: 10px; background: linear-gradient(135deg, #9c27b0, #7b1fa2);
  color: #fff; font-size: 14px; cursor: pointer; font-weight: bold;
}
.ad-double-btn {
  display: block; width: 100%; padding: 12px; margin-top: 8px;
  border: none; border-radius: 10px; background: linear-gradient(135deg, #ff9800, #f57c00);
  color: #fff; font-size: 14px; cursor: pointer; font-weight: bold;
}
