* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #1a1a1a;
  color: #ffffff;
  padding-bottom: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 页面切换 */
.page {
  display: none;
  min-height: calc(100vh - 70px);
  padding-top: 5px;
  padding-bottom: 80px; /* 为底部导航栏留出空间 */
}

.page.active {
  display: block;
}

/* Banner区域 */
.banner {
  position: relative;
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.banner-content {
  text-align: center;
  z-index: 1;
}

.banner-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.banner-subtitle {
  font-size: 14px;
  opacity: 0.9;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 统计区域 */
.stats-section {
  background: #2a2a2a;
  padding: 20px;
  margin: 10px;
  border-radius: 10px;
}

.stats-grid {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-bottom: 15px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.stat-value {
  font-size: 18px;
  font-weight: bold;
  color: #ff6b35;
  margin-bottom: 5px;
}

#remainingVotes {
  color: #4caf50; /* 绿色突出显示剩余票数 */
}

.stat-label {
  font-size: 10px;
  color: #cccccc;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: #444;
}

.countdown-section {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 15px 0;
  font-size: 14px;
}

.countdown-icon {
  margin-right: 8px;
  font-size: 18px;
}

.countdown-time {
  color: #ff6b35;
  font-weight: bold;
  margin-left: 5px;
}

.now_view_btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 15px 0;
  cursor: pointer;
  transition: opacity 0.3s;
}

.now_view_btn:active {
  opacity: 0.7;
}

.now_view_btn p {
  margin: 0;
  font-size: 14px;
  color: #ffffff;
}

.now_view_btn span {
  flex-shrink: 0;
  font-size: 14px;
  color: #ff6b35;
  text-decoration: underline;
}

.signup-btn {
  width: 100%;
  padding: 12px;
  background: #3a3a3a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  margin-top: 15px;
  transition: background 0.3s;
}

.signup-btn:active {
  background: #4a4a4a;
}

/* 搜索区域 */
.search-section {
  position: relative;
  margin: 10px;
  margin-bottom: 15px;
}

.search-input {
  width: 100%;
  padding: 12px 40px 12px 15px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
}

.search-input::placeholder {
  color: #888;
}

.search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #888;
}

/* 分类导航（已移除） */

/* 投票区域 */
.voting-section {
  padding: 0 10px;
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 15px;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.vote-card {
  background: #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  transition: transform 0.2s;
  width: 100%;
  min-width: 0; /* 防止grid item溢出 */
}

.vote-card:active {
  transform: scale(0.98);
}

.vote_description {
  text-align: center;
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 15px;
}

.card-number {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  z-index: 1;
}

.card-share {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
  font-size: 14px;
}

.card-image {
  width: 100%;
  /* height: 150px; 4:2比例 */
  height: calc(100% * 2 / 4);
  object-fit: cover;
  background: #3a3a3a;
}

.card-content {
  padding: 12px;
}

.card-name {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 6px;
  color: #ffffff;
}

.card-description {
  font-size: 12px;
  color: #cccccc;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-votes {
  font-size: 14px;
  color: #ff6b35;
  margin-bottom: 10px;
  font-weight: bold;
}

.vote-btn {
  width: 100%;
  padding: 8px;
  background: #3a3a3a;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.3s;
}

.vote-btn:active {
  background: #4a4a4a;
}

.vote-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 排行榜 */
.ranking-section {
  padding: 20px 10px;
}

.ranking-header {
  text-align: center;
  font-size: 20px;
  margin-bottom: 20px;
  color: #ffffff;
}

/* 排行榜筛选（已移除） */

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 50px;
}

.ranking-item {
  background: #f5f5f5;
  border-radius: 10px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  position: relative;
}

.ranking-item.rank-1 {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
}

.ranking-item.rank-2 {
  background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.ranking-item.rank-3 {
  background: linear-gradient(135deg, #cd7f32 0%, #e6a85c 100%);
}

/* 用户自己的排行榜项 - 呼吸效果 */
.ranking-item.my-ranking-item {
  animation: breathing-border 2s ease-in-out infinite;
  position: relative;
  z-index: 1;
}

/* 确保呼吸效果在前三名项目上也能显示 */
.ranking-item.my-ranking-item.rank-1,
.ranking-item.my-ranking-item.rank-2,
.ranking-item.my-ranking-item.rank-3 {
  animation: breathing-border 2s ease-in-out infinite;
}

@keyframes breathing-border {
  0% {
    box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.9),
      /* 超亮霓虹绿起始 */ 0 0 0 0 rgba(57, 255, 20, 0.7),
      0 0 0 0 rgba(57, 255, 20, 0.5), 0 0 20px rgba(57, 255, 20, 0.8);
    border: 4px solid rgba(57, 255, 20, 0.8);
  }
  50% {
    box-shadow: 0 0 0 40px rgba(57, 255, 20, 0),
      /* 大范围扩散 */ 0 0 0 25px rgba(57, 255, 20, 0),
      0 0 0 15px rgba(57, 255, 20, 0), 0 0 40px rgba(57, 255, 20, 0.6); /* 外层强辉光 */
    border: 4px solid rgba(57, 255, 20, 1); /* 最亮时边框全实 */
  }
  100% {
    box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.9), 0 0 0 0 rgba(57, 255, 20, 0.7),
      0 0 0 0 rgba(57, 255, 20, 0.5), 0 0 20px rgba(57, 255, 20, 0.8);
    border: 4px solid rgba(57, 255, 20, 0.8);
  }
}

.rank-icon {
  font-size: 32px;
  min-width: 40px;
  text-align: center;
}

.rank-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #888;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
}

.rank-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  background: #ddd;
}

.rank-info {
  flex: 1;
}

.rank-name {
  flex: 1;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  white-space: nowrap;
}

.rank-votes {
  flex-shrink: 0;
  font-size: 18px;
  font-weight: bold;
  color: #ff0000;
}

/* 奖励页面 */
.reward-section {
  padding: 20px 10px;
}

.reward-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.reward-item {
  background: #2a2a2a;
  border-radius: 10px;
  padding: 20px;
  border-left: 4px solid #ff6b35;
}

.reward-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.reward-info {
  flex: 1;
}

.reward-rank {
  font-size: 20px;
  font-weight: bold;
  color: #ff6b35;
  margin-bottom: 10px;
}

.reward-description {
  font-size: 14px;
  color: #cccccc;
  line-height: 1.6;
}

.reward-image-wrapper {
  flex-shrink: 0;
}

.reward-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  background: #3a3a3a;
}

/* 奖励页脚 */
.reward-footer {
  padding: 20px 10px;
  margin-top: 20px;
}

.claim-reward-btn {
  width: 100%;
  padding: 14px;
  background: #ff6b35;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
  margin-bottom: 20px;
}

.claim-reward-btn:active {
  background: #e55a2b;
}

/* 奖励规则 */
.reward-rules {
  margin-top: 20px;
}

.reward-rule-item {
  font-size: 12px;
  color: #cccccc;
  line-height: 1.8;
  margin-bottom: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #3a3a3a;
}

.reward-rule-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* 领奖弹窗内容 */
.claim-reward-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.claim-reward-image {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  overflow: hidden;
  background: #3a3a3a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.claim-reward-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.claim-reward-info {
  width: 100%;
}

.claim-reward-info h4 {
  font-size: 18px;
  font-weight: bold;
  color: #ff6b35;
  margin-bottom: 15px;
}

.claim-reward-info p {
  font-size: 14px;
  color: #cccccc;
  line-height: 1.6;
  margin: 0;
}

/* 弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #2a2a2a;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #3a3a3a;
}

.modal-header h3 {
  font-size: 18px;
  color: #ffffff;
}

.modal-close {
  font-size: 28px;
  color: #888;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 14px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 12px;
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.image-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.image-preview {
  width: 100%;
  height: 150px;
  background: #1a1a1a;
  border: 2px dashed #3a3a3a;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 14px;
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-btn {
  padding: 10px;
  background: #3a3a3a;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 20px;
  border-top: 1px solid #3a3a3a;
}

.btn-cancel,
.btn-confirm {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.3s;
}

.btn-cancel {
  background: #3a3a3a;
  color: #ffffff;
}

.btn-confirm {
  background: #ff6b35;
  color: #ffffff;
}

.btn-cancel:active,
.btn-confirm:active {
  opacity: 0.8;
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #2a2a2a;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  border-top: 1px solid #3a3a3a;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 5px 15px;
  transition: color 0.3s;
}

.nav-item.active {
  color: #ff6b35;
}

.nav-icon {
  font-size: 20px;
}

.nav-label {
  font-size: 12px;
}

/* 悬浮邀请按钮 */
.floating-invite-btn {
  position: fixed;
  right: 20px;
  bottom: 90px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ff6b35;
  color: #ffffff;
  border: none;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.floating-invite-btn:active {
  transform: scale(0.95);
}

/* 悬浮参加活动按钮 */
.floating-activity-btn {
  position: fixed;
  right: 20px;
  bottom: 160px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #ff9800;
  color: #ffffff;
  border: none;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s, box-shadow 0.3s;
  padding: 0;
  text-align: center;
  line-height: 1.2;
}

.floating-activity-btn:active {
  transform: scale(0.95);
}

/* 活动计时器样式 */
.activity-timer {
  text-align: center;
  margin-top: 20px;
  padding: 15px;
  background: rgba(255, 152, 0, 0.1);
  border-radius: 8px;
}

.activity-timer #activityTimeDisplay {
  display: block;
  font-size: 32px;
  font-weight: bold;
  color: #ff9800;
  margin-top: 10px;
}

/* 投票动画 */
.vote-animation {
  position: fixed;
  pointer-events: none;
  z-index: 2000;
  font-size: 24px;
  font-weight: bold;
  color: #ff6b35;
  opacity: 0;
}

.vote-animation.show {
  animation: voteFloat 1s ease-out forwards;
}

@keyframes voteFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(-30px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-60px) scale(0.8);
  }
}

/* 响应式 */
@media (max-width: 320px) {
  .voting-section {
    grid-template-columns: 1fr;
  }

  .banner-title {
    font-size: 20px;
  }

  .banner-subtitle {
    font-size: 12px;
  }
}
