* {
  box-sizing: border-box;
}

:root {
  /* 赛博朋克高饱和色盘 */
  --bg-base: #070314;
  --cyan: #00f0ff;
  --pink: #ff007c;
  --purple: #7000ff;
  --panel: rgba(10, 5, 25, 0.65);
  --panel-strong: rgba(15, 8, 35, 0.85);
  --ink: #ffffff;
  --muted: #a092b8;
  --ok: #00ffaa;
  --warn: #ffea00;
  --danger: #ff2a55;
}

/* ================= 核心背景与排版修复 ================= */
body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  min-height: 100vh;
  background-color: var(--bg-base);
  /* 修复跑到左边的问题，强制居中排版 */
  display: flex;
  justify-content: center;
  align-items: flex-start;
  font-family: 'Segoe UI', 'PingFang SC', sans-serif;
  overflow-x: hidden;
  position: relative;
  /* 加上两个巨大的呼吸光晕点缀背景 */
  background-image: 
    radial-gradient(circle at 15% 30%, rgba(0, 240, 255, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 85% 70%, rgba(255, 0, 124, 0.15) 0%, transparent 45%);
}

/* 极其花哨的 3D 穿梭网格地板 (这次绝对能动) */
body::before {
  content: '';
  position: fixed;
  top: 40%;
  left: -50%;
  width: 200%;
  height: 200%;
  /* 青色竖线 + 粉色横线 */
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.4) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 0, 124, 0.3) 2px, transparent 2px);
  background-size: 80px 80px;
  /* 3D 倾斜倒放 */
  transform: perspective(600px) rotateX(75deg);
  transform-origin: top center;
  /* 穿梭动画引擎 */
  animation: cyberFloor 1.5s linear infinite;
  z-index: -2;
  /* 地平线虚化过渡 */
  mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 100%);
}

/* 覆盖全屏的 CRT 扫描线 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0%,
    transparent 50%,
    rgba(0, 240, 255, 0.03) 50%,
    rgba(0, 240, 255, 0.03) 100%
  );
  background-size: 100% 6px;
}

@keyframes cyberFloor {
  0% { background-position: 0 0; }
  100% { background-position: 0 80px; }
}

/* ================= 布局控制 ================= */
.wrap {
  width: 94vw;
  max-width: 1040px; /* 限制最大宽度 */
  margin-top: 40px;
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}

/* ================= 面板：霓虹科技框 ================= */
.panel,
.card {
  background: var(--panel);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), inset 0 0 15px rgba(0, 240, 255, 0.05);
  position: relative;
  overflow: hidden;
  transition: 0.3s;
}

.panel:hover, .card:hover {
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9), inset 0 0 20px rgba(0, 240, 255, 0.15);
  transform: translateY(-2px);
}

/* 炫酷的面板边角发光点缀 */
.panel::before, .card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40px; height: 3px;
  background: var(--cyan);
  box-shadow: 0 0 15px var(--cyan);
}
.panel::after, .card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 40px; height: 3px;
  background: var(--pink);
  box-shadow: 0 0 15px var(--pink);
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 24px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
}

/* ================= 标题流光动画 ================= */
h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3.5vw, 36px);
  letter-spacing: 2px;
  text-transform: uppercase;
  /* 动态流光文字 */
  background: linear-gradient(90deg, var(--cyan), #fff, var(--pink), var(--cyan));
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  animation: textShine 3s linear infinite;
}

@keyframes textShine {
  to { background-position: 200% center; }
}

h3 {
  margin: 0;
  font-size: 16px;
  color: var(--cyan);
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 1px;
}

/* 提示框 */
.tip {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--pink);
  background: rgba(255, 0, 124, 0.1);
  padding: 12px 16px;
  border-radius: 6px;
  border-left: 4px solid var(--pink);
  box-shadow: 0 0 10px rgba(255, 0, 124, 0.2);
}

/* 状态标签 */
.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--cyan);
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  background: rgba(0, 240, 255, 0.1);
  color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3) inset;
}

.tag-ok { border-color: var(--ok); color: var(--ok); background: rgba(0, 255, 170, 0.1); box-shadow: 0 0 10px rgba(0, 255, 170, 0.2) inset; }
.tag-offline { border-color: var(--warn); color: var(--warn); background: rgba(255, 234, 0, 0.1); }
.tag-error { border-color: var(--danger); color: var(--danger); background: rgba(255, 42, 85, 0.1); }

/* ================= 导航与按钮特效 ================= */
.module-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 20px;
}

/* 顶部模块切换按钮 */
.module-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--muted);
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  transition: 0.3s;
  cursor: pointer;
}

.module-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.module-btn.active {
  border-color: var(--cyan);
  color: #fff;
  background: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4), inset 0 0 10px rgba(0, 240, 255, 0.2);
  text-shadow: 0 0 8px var(--cyan);
}

/* 功能执行按钮 (发光渐变) */
button:not(.module-btn) {
  border: none;
  border-radius: 6px;
  padding: 12px 24px;
  cursor: pointer;
  background: linear-gradient(45deg, var(--purple), var(--pink));
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 1px;
  transition: 0.3s;
  box-shadow: 0 5px 15px rgba(255, 0, 124, 0.4);
}

button:not(.module-btn):hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 0, 124, 0.7);
  background: linear-gradient(45deg, var(--pink), var(--cyan));
}

button:disabled {
  background: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none !important;
}

.btn-ghost {
  background: transparent !important;
  border: 1px solid var(--pink) !important;
  color: var(--pink) !important;
  box-shadow: inset 0 0 10px rgba(255, 0, 124, 0.2) !important;
}
.btn-ghost:hover {
  background: var(--pink) !important;
  color: #fff !important;
}

/* ================= 输入框与表单 ================= */
label {
  display: block;
  margin-bottom: 10px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
}

textarea, input, select {
  width: 100%;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 6px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: 0.3s;
}

textarea:focus, input:focus, select:focus {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.05);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.row { display: grid; gap: 14px; }
.row-2 { grid-template-columns: 1fr auto; }
.row-3 { grid-template-columns: repeat(3, auto); justify-content: flex-start; }
.top-gap { margin-top: 16px; }

.muted { color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ================= 聊天记录 ================= */
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#chatList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  max-height: 400px;
  overflow: auto;
  padding-right: 10px;
}

#chatList::-webkit-scrollbar { width: 6px; }
#chatList::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 3px; }
#chatList::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 3px; }

#chatList li {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid var(--cyan);
  border-radius: 6px;
  padding: 16px;
  white-space: pre-wrap;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-role { color: var(--cyan); font-size: 12px; font-weight: bold; letter-spacing: 1px; }
.chat-content { color: #fff; font-size: 14px; line-height: 1.7; }

/* 响应式 */
@media (max-width: 720px) {
  .head { align-items: flex-start; flex-direction: column; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  button, .module-btn { width: 100%; }
}