/* ========================================
   components.css — 各区块组件样式
   (背景动效 / hero / 信息网格 / 模组列表 /
    规则 / 连接 / toast / loading)
   ======================================== */

/* ===== 背景动效 ===== */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index:-1;
  overflow: hidden;
}
.bg-layer::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(126, 231, 135, 0.08) 0%, transparent 70%);
  top:-200px;
  left:-100px;
  animation: float1 20s ease-in-out infinite;
}
.bg-layer::after {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(88, 166, 255, 0.06) 0%, transparent 70%);
  bottom:-150px;
  right:-100px;
  animation: float2 25s ease-in-out infinite;
}
.bg-particle {
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 120, 80, 0.05) 0%, transparent 70%);
  top: 40%;
  left: 50%;
  animation: float3 18s ease-in-out infinite;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(80px, 60px) scale(1.1); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(-60px, -80px) scale(0.9); }
}
@keyframes float3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(-40px, 50px) scale(1.2); }
  66%      { transform: translate(50px, -30px) scale(0.8); }
}

/* ===== Hero ===== */
.hero-card {
  background: linear-gradient(135deg, rgba(30, 30, 45, 0.5), rgba(20, 20, 35, 0.4));
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
}
.hero-card::before {
  content: "";
  position: absolute;
  top:-50%;
  right:-20%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(126, 231, 135, 0.1) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-card h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
}
.hero-card .subtitle {
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.7;
  position: relative;
}

/* ===== 状态指示 ===== */
.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  position: relative;
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
.status-dot.offline {
  background: #f85149;
  box-shadow: 0 0 12px #f85149;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(0.85); }
}
.status-text { font-size: 14px; font-weight: 500; }
.status-text.online  { color: var(--accent); }
.status-text.offline { color: #f85149; }

/* ===== 信息网格 ===== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.info-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 18px 20px;
  transition: background 0.2s ease;
}
.info-item:hover { background: rgba(255, 255, 255, 0.06); }
.info-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.info-value { font-size: 18px; font-weight: 600; color: var(--text); }
.info-value .unit {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 400;
  margin-left: 4px;
}

/* ===== Mod 控件 ===== */
.mod-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.mod-search {
  flex: 1;
  min-width: 200px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease;
}
.mod-search:focus { border-color: rgba(126, 231, 135, 0.3); }
.mod-search::placeholder { color: var(--text-dim); }

.mod-filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 10px 18px;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}
.mod-filter-btn:hover,
.mod-filter-btn.active {
  background: rgba(126, 231, 135, 0.1);
  color: var(--accent);
  border-color: rgba(126, 231, 135, 0.2);
}

/* ===== Mod 列表 ===== */
.mod-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  max-height: 500px;
  overflow-y: auto;
  padding-right: 4px;
}
.mod-list::-webkit-scrollbar { width: 4px; }
.mod-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.mod-tag {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}
.mod-tag:hover {
  background: rgba(126, 231, 135, 0.06);
  border-color: rgba(126, 231, 135, 0.12);
}
.mod-tag .mod-icon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-dim);
  flex-shrink: 0;
}
.mod-tag .mod-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mod-tag .mod-ver {
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.mod-category-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 10px;
  padding-left: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mod-category-title .count {
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 400;
}

/* ===== 规则列表 ===== */
.rule-list { list-style: none; counter-reset: rule-counter; }
.rule-list li {
  counter-increment: rule-counter;
  padding: 12px 0;
  padding-left: 40px;
  position: relative;
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.rule-list li:last-child { border-bottom: none; }
.rule-list li::before {
  content: counter(rule-counter);
  position: absolute;
  left: 0;
  top: 12px;
  width: 24px;
  height: 24px;
  background: rgba(126, 231, 135, 0.1);
  color: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* ===== 连接信息 ===== */
.connect-box {
  background: rgba(126, 231, 135, 0.05);
  border: 1px dashed rgba(126, 231, 135, 0.2);
  border-radius: 12px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.connect-info { font-size: 15px; }
.connect-info strong {
  color: var(--accent);
  font-size: 17px;
  letter-spacing: 0.5px;
}
.copy-btn {
  background: rgba(126, 231, 135, 0.12);
  border: 1px solid rgba(126, 231, 135, 0.25);
  color: var(--accent);
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}
.copy-btn:hover { background: rgba(126, 231, 135, 0.2); }

/* ===== Toast 提示 ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(126, 231, 135, 0.15);
  border: 1px solid rgba(126, 231, 135, 0.3);
  color: var(--accent);
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 14px;
  backdrop-filter: blur(16px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 999;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-dim);
  font-size: 14px;
}
.loading::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--text-dim);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
