/* ===== 首页公共样式 ===== */

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

body {
  font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}


/* ===== 星空背景 - 图片替代方案 ===== */
.stars-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background-image: url('https://img1.baidu.com/it/u=4234669967,2491977082&fm=253&fmt=auto&app=138&f=JPEG?w=666&h=500');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.star { display: none; }

@keyframes twinkle {
  0%, 100% { opacity: var(--opacity); transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); box-shadow: 0 0 6px var(--accent-color); }
}


/* ===== 玻璃拟态卡片 ===== */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ===== 光遇风格按钮 ===== */
.sky-btn {
  position: relative;
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-glow));
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.4);
}

.sky-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 240, 255, 0.6);
}

.sky-btn:active {
  transform: translateY(0);
}

.sky-btn.secondary {
  background: transparent;
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
}

.sky-btn.secondary:hover {
  background: rgba(0, 240, 255, 0.1);
}

.sky-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== 输入框 ===== */
.sky-input {
  width: 100%;
  padding: 14px 20px;
  border: 2px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(10, 14, 39, 0.6);
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  transition: all 0.3s;
}

.sky-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

.sky-input::placeholder {
  color: rgba(232, 234, 246, 0.4);
}

/* ===== 主页布局 - 居中光遇风格 - 不是 flex 左右分栏 ===== */
.page-container {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 40px 24px;
  min-height: 100vh;
}

/* ===== 标题区域 ===== */
.hero-section {
  text-align: center;
  padding: 60px 20px;
}

.hero-title {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-color), #3b82f6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
  text-shadow: 0 0 40px rgba(0, 240, 255, 0.3);
}

.hero-subtitle {
  font-size: 18px;
  color: rgba(232, 234, 246, 0.7);
  margin-bottom: 40px;
}

/* ===== 房间卡片 ===== */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.room-card {
  padding: 28px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.room-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.room-card:hover::after {
  opacity: 1;
}

.room-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-color);
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.15);
}

.room-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--accent-color);
}

.room-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: rgba(232, 234, 246, 0.6);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-gold);
  animation: pulse 2s infinite;
}

.status-dot.full {
  background: var(--status-full);
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== 创建房间弹窗 ===== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 13, 26, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  width: 90%;
  max-width: 440px;
  padding: 36px;
  transform: scale(0.9) translateY(20px);
  transition: all 0.3s;
}

.modal-overlay.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-title {
  font-size: 24px;
  margin-bottom: 24px;
  text-align: center;
  color: var(--accent-color);
}

.modal-actions {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.modal-actions .sky-btn {
  flex: 1;
}

/* ===== 昵称弹窗样式 ===== */
.nickname-card {
  max-width: 380px;
  padding: 32px 28px;
}

.nickname-header {
  text-align: center;
  margin-bottom: 24px;
}

.avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gradient-avatar);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.nickname-hint {
  color: var(--text-hint);
  font-size: 14px;
  margin-top: 8px;
}

.nickname-input-wrap {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.nickname-input {
  flex: 1;
  text-align: center;
  font-size: 16px;
  letter-spacing: 1px;
}

.dice-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: var(--gradient-text);
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dice-btn:hover {
  transform: rotate(180deg) scale(1.1);
}

.nickname-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}

.nickname-tags .tag {
  padding: 6px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-tag);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.nickname-tags .tag:hover {
  background: rgba(102, 126, 234, 0.2);
  border-color: var(--link-color);
  color: var(--text-tag-hover);
  transform: translateY(-2px);
}

/* 当前昵称显示条 */
.current-nickname-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--text-hint);
}

.current-nickname-bar b {
  color: var(--text-tag-hover);
  font-weight: 600;
}

.current-nickname-bar a {
  color: var(--link-color);
  text-decoration: none;
  font-size: 13px;
}

.current-nickname-bar a:hover {
  text-decoration: underline;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .hero-title { font-size: 28px; }
  .hero-subtitle { font-size: 15px; }
  .page-container { padding: 24px 16px 180px 16px; }
  .rooms-grid { grid-template-columns: 1fr; gap: 16px; }
  .hero-section { padding: 30px 10px; }
  .create-room-btn { width: 100%; }
  
  /* 弹窗适配 */
  .modal-content {
    margin: 20px auto !important;
    width: calc(100% - 32px) !important;
    max-width: 400px !important;
    padding: 24px 20px !important;
  }
  .modal-actions {
    flex-direction: column-reverse;
    gap: 12px;
  }
  .modal-actions button {
    width: 100%;
    justify-content: center;
  }
  .nickname-tags {
    justify-content: center;
  }
}

@media (min-width: 641px) and (max-width: 768px) {
  .hero-title { font-size: 36px; }
  .rooms-grid { grid-template-columns: repeat(2, 1fr); }
}

.status-dot.hot {
  background-color: var(--status-hot);
  box-shadow: 0 0 6px var(--status-hot);
}

/* 主题切换按钮 */
.theme-toggle-btn:hover {
  background: rgba(255,255,255,0.12) !important;
  color: rgba(255,255,255,0.9) !important;
  border-color: rgba(255,255,255,0.25) !important;
}