/* 重置和基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow-x: hidden; /* 允许垂直滚动，隐藏水平滚动条 */
  font-size: 16px; /* 设置基础字体大小 */
}

body {
  font-family: 'Rajdhani', sans-serif;
  background: #0a0a0a;
  color: #ffffff;
  min-height: 100vh;
  line-height: 1.5;
}

/* 动态背景 */
.background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: scale(1.05); /* 略微放大背景，确保覆盖所有边缘，防止黑条 */
  transform-origin: center center; /* 从中心放大 */
  z-index: -1;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
}

.stars {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(2px 2px at 20px 30px, #eee, transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1px 1px at 90px 40px, #fff, transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(2px 2px at 160px 30px, #ddd, transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: sparkle 20s linear infinite;
}

.nebula {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at 20% 50%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(ellipse at 40% 80%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
  animation: nebula-drift 30s ease-in-out infinite alternate;
}

#particleCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* 主容器 */
.container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 1.25rem;
  max-width: 1200px; /* 减小最大宽度 */
  margin: 0 auto;
  width: 100%;
}

/* 头部样式 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.logo {
  display: flex;
  align-items: center;
}

.logo-image {
  height: 3.5rem; /* 减小logo大小 */
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
  animation: pulse-glow 2s ease-in-out infinite alternate;
}

.header-stats {
  display: flex;
  gap: 1.5rem;
}

.stat-item {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #00ff88;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.stat-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 主要内容区域 */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 快速操作按钮 */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 减小最小宽度 */
  gap: 1rem;
  margin-bottom: 1rem;
}

.action-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  font-family: inherit;
  color: inherit;
}

.action-btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

.action-btn:hover .btn-glow {
  opacity: 1;
}

.btn-icon {
  font-size: 2rem;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.btn-text {
  flex: 1;
}

.btn-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.btn-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.btn-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.promotions-btn:hover {
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: 0 20px 40px rgba(255, 215, 0, 0.2);
}

.customer-service-btn:hover {
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 20px 40px rgba(0, 212, 255, 0.2);
}

.download-app-btn:hover {
  border-color: rgba(0, 255, 136, 0.5);
  box-shadow: 0 20px 40px rgba(0, 255, 136, 0.2);
}

.register-btn:hover {
  border-color: rgba(255, 0, 212, 0.5);
  box-shadow: 0 20px 40px rgba(255, 0, 212, 0.2);
}

/* 域名容器 */
.domains-container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  border-radius: 1.25rem;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-header h2 {
  font-family: 'Orbitron', monospace;
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(45deg, #00d4ff, #00ff88);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 15px;
  color: #00ff88;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  font-size: 0.9rem;
}

.refresh-btn:hover {
  background: rgba(0, 255, 136, 0.2);
  transform: translateY(-2px);
}

.refresh-btn:active .refresh-icon {
  animation: spin 0.5s ease-in-out;
}

.refresh-icon {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
}

/* 域名网格 */
.domains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* 减小最小宽度 */
  gap: 1rem;
}

.domain-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: all 0.3s ease;
  overflow: hidden;
}

.domain-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 15px 35px rgba(0, 212, 255, 0.2);
}

.domain-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #00d4ff, #00ff88, #ff00d4);
  background-size: 200% 100%;
  animation: gradient-shift 3s ease infinite;
}

.domain-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.domain-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
}

.domain-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.online {
  background: #00ff88;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.status-dot.offline {
  background: #ff4757;
  box-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
}

.status-dot.testing {
  background: #ffa502;
  box-shadow: 0 0 10px rgba(255, 165, 2, 0.5);
}

.domain-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.speed-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.speed-value {
  font-size: 1rem;
  font-weight: 600;
  color: #00ff88;
}

.speed-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.domain-actions {
  display: flex;
  gap: 0.5rem;
}

.domain-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.75rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.primary-btn {
  background: linear-gradient(45deg, #00d4ff, #00ff88);
  color: #000;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 212, 255, 0.4);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* 公告区域 */
.announcement {
  background: rgba(255, 165, 2, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 165, 2, 0.3);
  border-radius: 20px;
  padding: 25px;
  margin-top: 20px;
}

.announcement-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.announcement-icon {
  font-size: 1.5rem;
}

.announcement-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffa502;
}

.announcement-content p {
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
}

/* 底部 */
.footer {
  margin-top: 50px;
  padding: 30px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #00d4ff;
}

/* 加载动画 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
}

.spinner-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top: 3px solid #00d4ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
  width: 60px;
  height: 60px;
  top: 10px;
  left: 10px;
  border-top-color: #00ff88;
  animation-duration: 1.5s;
  animation-direction: reverse;
}

.spinner-ring:nth-child(3) {
  width: 40px;
  height: 40px;
  top: 20px;
  left: 20px;
  border-top-color: #ff00d4;
  animation-duration: 2s;
}

/* 动画定义 */
@keyframes sparkle {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-200px);
  }
}

@keyframes nebula-drift {
  0% {
    transform: translateX(-20px) translateY(-10px);
  }
  100% {
    transform: translateX(20px) translateY(10px);
  }
}

@keyframes gradient-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulse-glow {
  0% {
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
  }
  100% {
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 1));
  }
}

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

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

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    margin-bottom: 25px;
  }

  .logo-image {
    height: 48px;
  }

  .header-stats {
    gap: 20px;
  }

  .stat-value {
    font-size: 1.6rem;
  }

  .stat-label {
    font-size: 0.75rem;
  }

  .main-content {
    gap: 20px;
  }

  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
  }

  .action-btn {
    padding: 15px;
    gap: 15px;
  }

  .btn-icon {
    font-size: 2rem;
  }

  .btn-title {
    font-size: 1.1rem;
  }

  .btn-subtitle {
    font-size: 0.8rem;
  }

  .domains-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .domains-container {
    padding: 20px;
  }

  .domain-card {
    padding: 15px;
  }

  .domain-header {
    margin-bottom: 10px;
  }

  .domain-name {
    font-size: 1.2rem;
  }

  .domain-status {
    font-size: 0.8rem;
  }

  .domain-info {
    margin-bottom: 15px;
  }

  .speed-info {
    gap: 8px;
  }

  .speed-value {
    font-size: 1.1rem;
  }

  .speed-label {
    font-size: 0.7rem;
  }

  .domain-description {
    font-size: 0.75rem;
  }

  .domain-actions {
    flex-direction: row;
    gap: 8px;
  }

  .domain-btn {
    padding: 10px 15px;
    font-size: 0.8rem;
  }

  .section-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    gap: 10px;
  }

  .section-header h2 {
    font-size: 1.4rem;
  }

  .refresh-btn {
    padding: 8px 15px;
    font-size: 0.85rem;
  }

  .announcement {
    padding: 15px;
    margin-top: 15px;
  }

  .announcement-title {
    font-size: 1rem;
  }

  .announcement-content p {
    font-size: 0.85rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 15px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px;
  }

  .header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    margin-bottom: 15px;
  }

  .logo-image {
    height: 48px;
  }

  .header-stats {
    gap: 10px;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .stat-label {
    font-size: 0.6rem;
  }

  .main-content {
    gap: 15px;
  }

  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
  }

  .action-btn {
    padding: 10px;
    gap: 10px;
  }

  .btn-icon {
    font-size: 1.8rem;
    min-width: 24px;
  }

  .btn-text {
    min-width: 0;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .btn-title {
    font-size: 0.9rem;
  }

  .btn-subtitle {
    font-size: 0.7rem;
  }

  .domains-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .domains-container {
    padding: 15px;
  }

  .domain-card {
    padding: 12px;
  }

  .domain-header {
    margin-bottom: 8px;
  }

  .domain-name {
    font-size: 1rem;
  }

  .domain-status {
    font-size: 0.7rem;
  }

  .domain-info {
    margin-bottom: 12px;
  }

  .speed-info {
    gap: 6px;
  }

  .speed-value {
    font-size: 0.9rem;
  }

  .speed-label {
    font-size: 0.6rem;
  }

  .domain-description {
    font-size: 0.7rem;
  }

  .domain-actions {
    flex-direction: row;
    gap: 6px;
  }

  .domain-btn {
    padding: 8px 12px;
    font-size: 0.75rem;
  }

  .section-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    gap: 8px;
  }

  .section-header h2 {
    font-size: 1.3rem;
  }

  .refresh-btn {
    padding: 7px 12px;
    font-size: 0.75rem;
  }

  .announcement {
    padding: 12px;
    margin-top: 12px;
  }

  .announcement-title {
    font-size: 0.9rem;
  }

  .announcement-content p {
    font-size: 0.75rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 10px;
  }
}
