:root {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #060931;
  color: #f3f4f6;
  --slide-unlock-text: '滑动解锁';
  --unlock-success-text: '解锁成功';
}

body {
  margin: 0;
  background: #060931;
  color: #f3f4f6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

.auth-mode main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 40px);
  padding: 2rem 1rem;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #070f3e, #062860);
  border-bottom: 1px solid #34a1e0;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 10px 25px rgba(52, 161, 224, 0.2);
}

.top-bar h1 {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
}

nav button {
  margin-left: 0.5rem;
}

main {
  padding: 2rem;
  flex: 1;
  width: 100%;
}

.panel.hidden {
  display: none;
}

.panel.visible {
  display: block;
}

.auth-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* 上下：顶部对齐 */
  align-items: center;
  padding: 2rem;
  padding-top: 2rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* 登录页 ICP：排在登录卡片下方，仅电脑端中文显示（排版：标题 → 登录框 → ICP） */
.auth-wrapper .icp-footer {
  margin-top: 1.5rem;
  color: #c8d7ff;
  width: 100%;
  max-width: 640px;
  text-align: center;
}

/* 英文界面隐藏登录页 ICP */
.lang-en .auth-wrapper .icp-footer {
  display: none !important;
}

.auth-center {
  text-align: center;
  max-width: 640px;
  width: 100%;
}

.hero-title {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  letter-spacing: 0.12em;
}

.hero-subtitle {
  color: #9ca3af;
  margin-bottom: 2rem;
}

.auth-forms {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-card form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  align-items: center;
}

.register-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.auth-forms form {
  width: 100%;
}

.form-card {
  background: linear-gradient(135deg, #070f3e, #062860);
  padding: 1.5rem;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  border: 1px solid #34a1e0;
  box-shadow: 0 0 25px rgba(52, 161, 224, 0.35), inset 0 0 20px rgba(52, 161, 224, 0.25);
}

.form-card.hidden {
  display: none;
}

label {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  width: 100%;
  color: #c8d7ff;
}

#login-form label {
  width: auto; /* 不设置固定宽度，由内容决定 */
}

#login-form {
  display: flex;
  flex-direction: column;
  align-items: center; /* 整个表单居中对齐 */
}

#login-form .login-label-horizontal {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  width: auto; /* 由内容决定宽度 */
  margin-left: auto;
  margin-right: auto; /* 在卡片中水平居中 */
}

#login-form .login-label-horizontal span {
  min-width: 80px;
  font-size: 1.1rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0; /* 标签不收缩 */
}

#login-form .login-label-horizontal input {
  flex: 0 0 201px; /* 输入框固定宽度201px，不收缩不扩展 */
  font-size: 1.1rem;
  width: 201px; /* 缩短70像素：271 - 70 = 201 */
  max-width: 201px;
}

.login-slider-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end; /* 右对齐，与输入框对齐 */
  width: auto; /* 由内容决定宽度，与账号+输入框行一致 */
  margin-bottom: 1rem;
  margin-left: auto;
  margin-right: auto; /* 在卡片中水平居中，与账号+输入框对齐 */
}

.login-slider-wrapper .slider-container {
  display: flex;
  justify-content: flex-start;
  flex: 0 0 201px; /* 滑动条容器固定宽度201px，与输入框宽度一致 */
  width: 201px;
}

.login-slider-wrapper .slider-track {
  width: 201px; /* 滑动条宽度与输入框一致 */
  max-width: 201px;
}

.login-buttons-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 201px; /* 与输入框宽度一致 */
  gap: 1rem;
  flex-wrap: nowrap; /* 防止按钮换行 */
}

.login-buttons-row .login-btn,
.login-buttons-row .lang-btn {
  flex: 1;
  width: auto;
  white-space: nowrap; /* 防止按钮文字换行 */
  min-width: 0; /* 允许flex收缩 */
  display: flex; /* 使用flex布局 */
  align-items: center; /* 垂直居中 */
  justify-content: center; /* 水平居中 */
  text-align: center; /* 文字居中 */
}

/* 按钮样式定义 */
.btn-primary {
  background: #3b82f6;
  color: white;
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
  background: #3b82f6; /* 使用与登录按钮相同的背景色 */
  color: white; /* 使用与登录按钮相同的文字颜色 */
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3); /* 使用与登录按钮相同的阴影 */
}

.btn-primary:hover,
.btn-secondary:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(59, 130, 246, 0.4);
}

#register-form label {
  width: 423px;
  margin-left: auto;
  margin-right: auto;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: linear-gradient(135deg, #070f3e, #062860);
  border-radius: 20px;
  padding: 2rem;
  width: min(480px, 92vw);
  border: 1px solid #34a1e0;
  box-shadow: 0 0 35px rgba(52, 161, 224, 0.45), inset 0 0 25px rgba(52, 161, 224, 0.25);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.user-info-modal-content {
  width: min(500px, 92vw);
  max-width: 500px;
}

.user-info-title {
  text-align: center;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  margin-top: 0.5rem;
}

.user-info-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.user-info-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(52, 161, 224, 0.2);
}

.user-info-item:last-of-type {
  border-bottom: none;
}

.user-info-label {
  color: #9ca3af;
  font-size: 0.95rem;
  font-weight: 500;
  min-width: 90px;
  flex-shrink: 0;
}

.user-info-value {
  color: #fff;
  font-size: 0.95rem;
  flex: 1;
  word-break: break-word;
}

.user-info-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 1.4rem;
  cursor: pointer;
}

#login-form input,
#login-form select {
  width: 201px; /* 缩短70像素：271 - 70 = 201 */
}

#register-form input,
#register-form select {
  width: 423px;
}

input,
select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid #264d7a;
  background: rgba(6, 9, 49, 0.75);
  color: #f3f4f6;
  box-shadow: inset 0 0 10px rgba(52, 161, 224, 0.2);
}

button {
  cursor: pointer;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.primary-btn {
  background: #3b82f6;
  color: white;
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.ghost-btn {
  background: transparent;
  border: 1px solid #3b82f6;
  color: #3b82f6;
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px);
}

.form-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
  justify-content: center;
  width: 100%;
}

.slider-verify {
  margin-top: 0.5rem;
  width: 100%;
}

.login-slider,
.register-slider {
  display: flex;
  justify-content: center;
}

/* 注意：.login-slider-wrapper .slider-track 的宽度已在上面设置为100%，这里不再设置固定宽度 */
.login-slider .slider-track {
  width: 176px; /* 缩短70像素：246 - 70 = 176 */
}

/* 登录表单中的滑动条使用100%宽度，与输入框右对齐 */
#login-form .slider-track {
  width: 100%; /* 与输入框宽度一致，右对齐 */
}

.register-slider .slider-track {
  width: 423px;
}

.slider-track {
  position: relative;
  width: 100%;
  background: rgba(6, 9, 49, 0.85);
  border-radius: 999px;
  border: 1px solid #264d7a;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9fd5ff;
  user-select: none;
  overflow: hidden;
  box-shadow: inset 0 0 15px rgba(52, 161, 224, 0.2), 0 0 10px rgba(52, 161, 224, 0.15);
}

/* 在滑动条轨道上添加提示文字 */
.slider-track::before {
  content: var(--slide-unlock-text);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff; /* 白色字体 */
  font-size: 0.85rem;
  white-space: nowrap;
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* 当滑动条被激活或验证时，隐藏提示文字 */
.slider-track.active::before,
.slider-verify.verified .slider-track::before {
  opacity: 0;
}

.slider-track.active {
  border-color: #3b82f6;
}

.slider-handle {
  position: absolute;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  background: #1f91ff;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 10px 25px rgba(31, 145, 255, 0.45);
}

.slider-handle::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background-image: url('../icons/double-right.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: brightness(0) invert(1); /* 将图标变为白色 */
  z-index: 1;
}

/* 圆点上不再显示箭头图标 */

.slider-handle .unlock-icon {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-verify.verified .slider-track,
[data-slider].verified .slider-track {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.slider-verify.verified .slider-handle,
[data-slider].verified .slider-handle {
  background: #10b981;
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.slider-verify.verified .slider-handle::before,
[data-slider].verified .slider-handle::before {
  filter: brightness(0) invert(1); /* 将图标变为白色 */
}

/* 滑动成功后显示"解锁成功"文字 */
[data-slider].verified .slider-track::after {
  content: var(--unlock-success-text);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff; /* 白色字体 */
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  z-index: 2;
  pointer-events: none;
}

/* 滑动成功后隐藏"向右滑动"提示 */
[data-slider].verified .slider-track::before {
  opacity: 0;
}

.grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
}

.card {
  background: linear-gradient(135deg, #070f3e, #062860);
  border-radius: 16px;
  padding: 1.25rem;
  border: 1px solid #34a1e0;
  box-shadow: 0 0 25px rgba(52, 161, 224, 0.35), inset 0 0 20px rgba(52, 161, 224, 0.2);
}

.sidebar p {
  font-size: 0.9rem;
  color: #d1d5db;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.meta {
  color: #9ca3af;
  font-size: 0.85rem;
}


.scene-row {
  border-top: 1px solid #2f2f2f;
  padding-top: 1rem;
  margin-top: 1rem;
}

.scene-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.scene-btn {
  width: 120px;
  background: #3b82f6;
  color: #fff;
  border-radius: 12px;
  height: 52px;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}

.indicator {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.indicator.gray {
  background: #4b5563;
}

.indicator.green {
  background: #10b981;
}

.indicator.red {
  background: #ef4444;
}

.scene-edit {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.6rem;
}

.scene-edit input {
  flex: 1;
}

.scene-edit button {
  width: 100px;
}

.feedback {
  font-size: 0.8rem;
  color: #9ca3af;
  min-height: 1rem;
}

.toast {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  background: rgba(30, 41, 59, 0.95);
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  z-index: 9999; /* 确保在最上层，不被其他元素遮挡 */
  color: #ffffff;
  font-size: 0.9rem;
  white-space: nowrap;
}

.toast.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.25);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ripple:active::after {
  opacity: 1;
  transition: opacity 0s;
}

@media (max-width: 960px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .auth-center {
    max-width: 100%;
  }
}

/* 新布局样式 */
#dashboard {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.page-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #070f3e, #062860);
  border-bottom: 1px solid #34a1e0;
  box-shadow: 0 10px 25px rgba(52, 161, 224, 0.2);
  position: relative;
  z-index: 1000; /* 页眉应该在菜单栏之上 */
}

.header-row {
  display: contents;
}

.header-row-1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-row-2 {
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-left {
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.platform-icon {
  font-size: 1.4rem;
  display: inline-block;
  color: #34a1e0;
  font-weight: 300;
  letter-spacing: 0;
  line-height: 1;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.platform-icon:hover {
  opacity: 1;
}

/* PC端隐藏圆点图标 */
@media screen and (min-width: 1025px) {
  .platform-icon {
    display: none !important;
  }
}

.platform-title {
  font-size: 1.6rem;
  font-weight: 600;
  color: #34a1e0;
  text-shadow: 0 0 10px rgba(52, 161, 224, 0.5);
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.date-display {
  font-size: 1.1rem;
  color: #c8d7ff;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-icon-btn {
  background: transparent;
  border: 1px solid #34a1e0;
  color: #34a1e0;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  height: 38px; /* 与用户按钮高度一致 */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  box-sizing: border-box;
}

.header-icon-btn:hover {
  background: rgba(52, 161, 224, 0.2);
  border-color: #60a5fa;
  color: #60a5fa;
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(52, 161, 224, 0.4);
}

.header-icon-btn .icon-star,
.header-icon-btn .icon-fullscreen {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
}

.user-menu {
  position: relative;
}

.user-btn {
  background: transparent;
  border: 1px solid #34a1e0;
  color: #34a1e0;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  height: 38px; /* 与全屏按钮高度一致 */
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  background: linear-gradient(135deg, #070f3e, #062860);
  border: 1px solid #34a1e0;
  border-radius: 8px;
  min-width: 150px;
  box-shadow: 0 10px 25px rgba(52, 161, 224, 0.3);
  z-index: 2000; /* 用户菜单应该最高 */
}

.user-dropdown a {
  display: block;
  padding: 0.75rem 1rem;
  color: #c8d7ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(52, 161, 224, 0.2);
}

.user-dropdown a:last-child {
  border-bottom: none;
}

.user-dropdown a:hover {
  background: rgba(52, 161, 224, 0.2);
}

.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: auto; /* 主容器使用默认z-index */
}

.sidebar-nav {
  width: 220px;
  background: linear-gradient(180deg, #070f3e, #062860);
  border-right: 1px solid #34a1e0;
  overflow-y: auto;
  box-shadow: 2px 0 15px rgba(52, 161, 224, 0.2);
}

.nav-menu {
  padding: 1rem 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.5rem;
  color: #fff;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s;
  font-size: 0.875rem; /* 小一号：从1rem改为0.875rem */
  font-weight: 600;
}

.nav-icon {
  font-size: 0.875rem; /* 小一号：从1rem改为0.875rem */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: currentColor; /* 继承父元素的文字颜色 */
  font-weight: 300;
  transition: color 0.3s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  color: #34a1e0;
  transform: translateX(2px);
}

.nav-item:hover,
.nav-item.active {
  background: rgba(52, 161, 224, 0.2);
  border-left-color: #34a1e0;
  color: #34a1e0;
  font-weight: 600;
}

.nav-group-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.5rem;
  color: #fff;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all 0.2s;
  font-size: 0.875rem; /* 小一号：从1rem改为0.875rem */
  font-weight: 600;
  cursor: pointer;
}

.nav-group-title .nav-icon {
  font-size: 0.875rem; /* 小一号：从1rem改为0.875rem */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: currentColor; /* 继承父元素的文字颜色 */
  font-weight: 300;
  transition: color 0.3s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.nav-group-title .nav-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.nav-group-title:hover .nav-icon,
.nav-group-title.active .nav-icon {
  color: #34a1e0;
  transform: translateX(2px);
}

.nav-group-title > span:not(.nav-icon):not(.nav-arrow) {
  flex: 1;
}

.nav-arrow {
  font-size: 1rem; /* 小一号：从1.2rem改为1rem */
  color: #fff;
  font-weight: bold;
  margin-left: auto;
  transition: transform 0.3s ease, color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* PC端：当菜单展开时，箭头向下旋转90度 */
@media screen and (min-width: 1025px) {
  .nav-group-title.active .nav-arrow {
    transform: rotate(90deg);
  }
}

.nav-arrow svg {
  width: 100%;
  height: 100%;
  display: block;
}

.nav-group-title:hover .nav-arrow,
.nav-group-title.active .nav-arrow {
  color: #34a1e0;
  transform: translateX(3px);
}

.nav-group-title:hover,
.nav-group-title.active {
  background: rgba(52, 161, 224, 0.2);
  border-left-color: #34a1e0;
  color: #34a1e0;
  font-weight: 600;
}

/* PC端：一级菜单突出显示 */
@media screen and (min-width: 1025px) {
  .nav-group-title {
    font-weight: 700; /* 更粗的字体 */
    font-size: 0.95rem; /* 稍大一点的字体 */
  }
  
  .nav-group-title:hover,
  .nav-group-title.active {
    background: rgba(52, 161, 224, 0.25); /* 更明显的背景色 */
    box-shadow: 0 2px 8px rgba(52, 161, 224, 0.2); /* 添加阴影突出显示 */
  }
}

.nav-submenu {
  padding-left: 0;
  position: static;
  display: none; /* 默认隐藏，通过 .active 类控制显示 */
  overflow: hidden;
}

/* PC端：子菜单的折叠/展开动画 */
@media screen and (min-width: 1025px) {
  .nav-submenu {
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
  }
  
  /* PC端：当一级菜单激活时，显示子菜单 */
  .nav-group-title.active + .nav-submenu {
    display: block;
    max-height: 500px; /* 足够大的值以容纳子菜单 */
    opacity: 1;
  }
}

.nav-sub-item {
  padding: 0.7rem 1.5rem;
  font-size: 0.875rem; /* 小一号：从1rem改为0.875rem */
  padding-left: 2.5rem; /* PC端：增加左侧缩进，从1.5rem改为2.5rem */
  display: flex;
  align-items: center; /* 垂直居中对齐 */
  gap: 0.75rem; /* 图标和文字之间的间距 */
}

/* PC端：二级菜单缩进更明显 */
@media screen and (min-width: 1025px) {
  .nav-sub-item {
    padding-left: 3rem; /* PC端：进一步增加缩进 */
    font-size: 0.85rem; /* 稍小一点的字体，与一级菜单区分 */
    font-weight: 500; /* 稍轻的字体粗细 */
  }
}

.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem;
  background: #060931;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 1; /* 内容区域应该在最下层 */
}

.page-content {
  display: none;
}

.page-content.active {
  display: block;
}

.page-footer {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #070f3e, #062860);
  border-top: 1px solid #34a1e0;
  display: none; /* 默认隐藏，只在PC端显示 */
  justify-content: center;
  align-items: center;
  color: #c8d7ff;
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  text-align: center;
  white-space: nowrap;
  flex-wrap: wrap;
}

.footer-content span {
  color: #c8d7ff;
  font-size: 0.9rem;
}

.footer-link {
  color: #34a1e0;
  text-decoration: none;
  transition: all 0.3s ease;
}

.footer-link:hover {
  color: #60a5fa;
  text-decoration: underline;
  text-shadow: 0 0 8px rgba(52, 161, 224, 0.5);
}

/* ICP 备案号：仅电脑端显示 */
.icp-footer {
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  margin-top: auto; /* 仅页脚内 ICP 使用；登录页 ICP 由 .auth-wrapper .icp-footer 覆盖 */
}
.icp-footer a {
  color: #34a1e0;
  text-decoration: none;
}
.icp-footer a:hover {
  color: #60a5fa;
  text-decoration: underline;
}

/* 英文界面不显示 ICP 备案信息（登录后页脚 + 登录页） */
.lang-en .page-footer .icp-footer {
  display: none !important;
}

/* 首页头部 */
.home-header {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.home-network-test-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.home-network-test-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

.home-network-test-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 首页项目卡片 */
#home-project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.home-project-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.home-project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(52, 161, 224, 0.4);
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.device-status {
  font-weight: 500;
  position: relative;
  padding-left: 1.2em; /* 为图标留出空间 */
}

/* 状态图标：使用 ::before 伪元素 */
.device-status.status-online::before {
  content: '🟢';
  position: absolute;
  left: 0;
  font-size: 0.9em;
}

.device-status.status-offline::before {
  content: '🟡';
  position: absolute;
  left: 0;
  font-size: 0.9em;
  filter: hue-rotate(15deg) saturate(1.2); /* 调整为金黄色 */
}

.device-status.status-no-feedback::before {
  content: '⚪';
  position: absolute;
  left: 0;
  font-size: 0.9em;
}

.device-status.status-online {
  color: #10b981;
}

.device-status.status-offline {
  color: #f59e0b; /* 金黄色，表示离线/未设置心跳包 */
}

.device-status.status-offline::before {
  filter: hue-rotate(15deg) saturate(1.2) brightness(1.1); /* 调整为更明显的金黄色 */
}

.device-status.status-no-feedback {
  color: #9ca3af; /* 灰色，表示未知状态 */
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* .meta-item-status-row 在移动端会被隐藏，见媒体查询 */

.meta-label {
  color: #9ca3af;
  font-size: 0.85rem;
  min-width: 70px;
  flex-shrink: 0;
}

.home-card-network-test-btn {
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  border: none;
  background: #3b82f6;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.home-card-network-test-btn:hover {
  background: #2563eb;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.home-card-network-test-btn:active {
  transform: scale(0.95);
}

/* 高亮显示设备IP */
.device-ip {
  color: #34a1e0;
  font-weight: 600;
  font-size: 0.95rem;
  text-shadow: 0 0 8px rgba(52, 161, 224, 0.5);
}

/* 高亮显示状态 */
.status-chip {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.status-chip.online {
  background: rgba(16, 185, 129, 0.25);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.5);
  text-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.status-chip.offline {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.5);
  text-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

/* 高亮显示场景数量 */
.scene-count {
  color: #60a5fa;
  font-weight: 600;
  font-size: 1rem;
  text-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

/* 高亮显示最后场景 */
.last-scene {
  color: #10b981;
  font-weight: 600;
  font-size: 0.95rem;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* 高亮显示刷新时间 */
.refresh-time {
  color: #f59e0b;
  font-weight: 600;
  font-size: 0.95rem;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

/* 高亮显示延时时间 */
.delay-time {
  color: #8b5cf6;
  font-weight: 600;
  font-size: 0.95rem;
  text-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

/* 项目详情页 */
.project-detail-card {
  width: 100%;
  max-width: 1024px; /* 最大宽度限制为1024像素 */
  margin: 0; /* 左对齐 */
  border: 1px solid #34a1e0;
  box-shadow: 0 0 25px rgba(52, 161, 224, 0.35), inset 0 0 20px rgba(52, 161, 224, 0.25);
  box-sizing: border-box;
}

.detail-header-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(52, 161, 224, 0.3);
  background: rgba(7, 15, 62, 0.5);
}

.detail-header-info-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.detail-header-info-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.detail-project-name {
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
}

.detail-device-ip,
.detail-device-serial,
.detail-actual-serial {
  font-size: 1rem;
  color: #c8d7ff;
}

.detail-device-serial-label {
  font-size: 1rem;
  color: #9ca3af;
  margin-right: 0.25rem;
}

.detail-serial-separator {
  font-size: 1rem;
  color: #6b7280;
  margin: 0 0.5rem;
}

.detail-trigger-type {
  font-size: 0.9rem;
  color: #9ca3af;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: rgba(156, 163, 175, 0.1);
}

.detail-trigger-type.trigger-manual {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.detail-trigger-type.trigger-network {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

/* 首页卡片触发方式样式 */
.home-trigger-type {
  font-size: 0.9rem;
  color: #9ca3af;
}

.home-trigger-type.trigger-manual {
  color: #3b82f6;
}

.home-trigger-type.trigger-network {
  color: #10b981;
}

/* 首页实时日志卡片样式 */
.home-realtime-log-card {
  width: 100%;
  max-width: 1024px; /* 与项目配置卡片宽度一致 */
  margin-top: 1.5rem;
  border: 1px solid #34a1e0;
  box-shadow: 0 0 25px rgba(52, 161, 224, 0.35), inset 0 0 20px rgba(52, 161, 224, 0.25);
  box-sizing: border-box;
  min-height: 400px; /* 与首页项目卡片高度一致 */
}

.realtime-log-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(52, 161, 224, 0.3);
}

.realtime-log-content {
  height: calc(400px - 3rem); /* 减去标题和padding的高度 */
  overflow-y: auto;
  overflow-x: hidden;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #c8d7ff;
  background: rgba(7, 15, 62, 0.3);
  padding: 1rem;
  border-radius: 8px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.realtime-log-content::-webkit-scrollbar {
  width: 8px;
}

.realtime-log-content::-webkit-scrollbar-track {
  background: rgba(52, 161, 224, 0.1);
  border-radius: 4px;
}

.realtime-log-content::-webkit-scrollbar-thumb {
  background: rgba(52, 161, 224, 0.5);
  border-radius: 4px;
}

.realtime-log-content::-webkit-scrollbar-thumb:hover {
  background: rgba(52, 161, 224, 0.7);
}

/* 大屏用户多选下拉框样式 */
.config-screen-users-item {
  width: 100%;
  margin-top: 1rem;
}

.config-project-screen-users {
  width: 100%;
  min-height: 80px;
  padding: 0.5rem;
  border: 1px solid #4b5563;
  border-radius: 4px;
  background: #1f2937;
  color: #fff;
  font-size: 0.9rem;
}

.config-project-screen-users option {
  padding: 0.5rem;
  background: #1f2937;
  color: #fff;
}

.config-project-screen-users option:checked {
  background: #3b82f6;
  color: #fff;
}

.detail-network-test-btn {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  border: none;
  background: #3b82f6;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.detail-network-test-btn:hover {
  background: #2563eb;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
  transform: translateY(-1px);
}

.detail-network-test-btn:active {
  transform: translateY(0);
}

.detail-network-status {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.detail-network-status.network-normal {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.detail-network-status.network-abnormal {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.detail-ping-delay {
  font-size: 0.85rem;
  color: #c8d7ff;
  margin-left: 0.5rem;
}

.detail-scenes {
  padding: 1.5rem;
}

.detail-scenes-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.scene-control-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.scene-number {
  display: none;
}

.scene-control-btn {
  width: 100%;
  height: 60px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #34a1e0;
  background: #3b82f6;
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  /* 移除 transition，避免hover时的动画效果 */
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  box-sizing: border-box;
}

.scene-control-btn:hover:not(.active) {
  background: #2563eb;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
  /* 移除所有动画效果，只有非active状态的按钮才有hover效果 */
}

.scene-control-btn.active {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

/* 完全移除active按钮的hover效果，避免闪烁 */
.scene-control-btn.active:hover {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
}

.scene-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.scene-control-item .scene-indicator.gray {
  background: #4b5563;
}

.scene-control-item .scene-indicator.green {
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* 配置页 */
.config-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.config-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
}

.config-action-btn .btn-icon {
  font-size: 1.2rem;
  font-weight: bold;
}

.config-action-btn.add-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.config-action-btn.add-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

.config-action-btn.read-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.config-action-btn.read-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

.config-action-btn.update-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.config-action-btn.update-btn:hover {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
  transform: translateY(-2px);
}

.project-user-filter {
  width: 120px;
  padding: 0.75rem 1rem;
  padding-right: 40px; /* 右侧留出空间给下拉箭头图标 */
  border-radius: 8px;
  border: 1px solid #34a1e0;
  background: rgba(6, 9, 49, 0.75);
  color: #f3f4f6;
  font-size: 0.95rem;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.3s ease;
  appearance: none; /* 移除默认下拉箭头 */
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
}

.project-user-filter::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url('../icons/down.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: brightness(0) invert(1); /* 将图标变为白色 */
  pointer-events: none;
  z-index: 1;
}

.project-user-filter:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.project-user-filter:hover {
  border-color: #60a5fa;
  background: rgba(6, 9, 49, 0.85);
}

.config-project-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.config-project-card {
  width: 100%;
  max-width: 1024px; /* 最大宽度限制为1024像素 */
  margin: 0; /* 左对齐 */
  border: 1px solid #34a1e0;
  box-shadow: 0 0 25px rgba(52, 161, 224, 0.35), inset 0 0 20px rgba(52, 161, 224, 0.25);
  box-sizing: border-box;
}

.config-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(52, 161, 224, 0.3);
  background: rgba(7, 15, 62, 0.5);
}

.config-card-header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.config-project-users {
  color: #c8d7ff;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
}

.config-company-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.config-project-company {
  background: rgba(6, 9, 49, 0.8);
  border: 1px solid rgba(200, 215, 255, 0.3);
  border-radius: 4px;
  color: #fff;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  min-width: 120px;
}

.config-project-company:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.config-project-company option {
  background: rgba(6, 9, 49, 0.95);
  color: #fff;
  padding: 0.5rem;
}

.config-project-company option:checked {
  background: #3b82f6;
  color: #fff;
}

.config-card-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  white-space: nowrap; /* 文字不换行 */
  text-align: left; /* 左对齐 */
}

.config-field-user-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.config-user-selects {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
}

.config-user-select-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.config-user-select-item label {
  font-size: 0.75rem;
  color: #c8d7ff;
  text-align: center;
}

.config-user-select-item select {
  width: 120px;
  padding: 0.5rem;
  padding-right: 35px; /* 右侧留出空间给下拉箭头图标 */
  border-radius: 6px;
  border: 1px solid #34a1e0;
  background: rgba(6, 9, 49, 0.75);
  color: #f3f4f6;
  font-size: 0.85rem;
  cursor: pointer;
  box-sizing: border-box;
  text-align: center;
  text-align-last: center;
  appearance: none; /* 移除默认下拉箭头 */
  -webkit-appearance: none;
  -moz-appearance: none;
  position: relative;
}

.config-user-select-item {
  position: relative;
}

.config-user-select-item::after {
  content: '';
  position: absolute;
  right: 12px;
  bottom: 8px;
  width: 16px;
  height: 16px;
  background-image: url('../icons/down.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: brightness(0) invert(1); /* 将图标变为白色 */
  pointer-events: none;
  z-index: 1;
}

.config-user-select-item select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.config-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.network-status {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.network-status.network-normal {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.network-status.network-abnormal {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.config-ping-delay {
  font-size: 0.85rem;
  color: #c8d7ff;
  margin-left: 0.5rem;
}

.config-card-btn {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.config-card-btn.read-config-btn {
  background: #3b82f6;
  color: #fff;
}

.config-card-btn.read-config-btn:hover {
  background: #2563eb;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.config-card-btn.update-config-btn,
.config-card-btn.write-config-btn {
  background: #10b981;
  color: #fff;
}

.config-card-btn.update-config-btn:hover,
.config-card-btn.write-config-btn:hover {
  background: #059669;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.config-card-btn.network-test-btn {
  background: #3b82f6;
  color: #fff;
}

.config-card-btn.network-test-btn:hover {
  background: #2563eb;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.config-card-btn.delete-project-btn {
  background: #ef4444;
  color: #fff;
}

.config-card-btn.delete-project-btn:hover {
  background: #dc2626;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.config-card-btn.config-user-settings-btn {
  background: #3b82f6;
  color: #fff;
}

.config-card-btn.config-user-settings-btn:hover {
  background: #2563eb;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

/* 用户设置对话框中的下拉框样式 */
.project-user-settings-select {
  width: 100%;
  padding: 0.5rem;
  background: rgba(6, 9, 49, 0.8);
  border: 1px solid rgba(200, 215, 255, 0.3);
  border-radius: 4px;
  color: #fff;
  font-size: 0.9rem;
}

.project-user-settings-select-multiple {
  min-height: 120px;
}

.project-user-settings-select option {
  background: rgba(6, 9, 49, 0.95);
  color: #fff;
  padding: 0.5rem;
}

.project-user-settings-select option:checked {
  background: #3b82f6;
  color: #fff;
}

/* 用户设置对话框中的复选框列表样式 */
.project-user-checkbox-list {
  background: rgba(6, 9, 49, 0.8);
  border: 1px solid rgba(200, 215, 255, 0.3);
  border-radius: 4px;
  padding: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden; /* 禁止横向滚动 */
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  align-content: start;
}

.project-user-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  cursor: pointer;
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
  white-space: nowrap; /* 防止文字换行 */
  width: fit-content; /* 宽度自适应内容 */
}

.project-user-checkbox-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.project-user-checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #3b82f6;
  flex-shrink: 0; /* 防止复选框被压缩 */
}

.project-user-checkbox-item span {
  user-select: none;
  white-space: nowrap; /* 防止文字换行 */
}

.project-user-checkbox-empty {
  color: #9ca3af;
  text-align: center;
  padding: 1rem;
  font-style: italic;
  grid-column: 1 / -1; /* 占满整行 */
}

.config-card-body {
  padding: 1.5rem;
}

.config-main-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: nowrap;
}

.config-field {
  display: flex;
  flex-direction: column;
  gap: 2px; /* 压缩间距：标题与输入框之间保留2像素 */
  flex-shrink: 0;
  align-items: center; /* 左右居中对齐 */
  position: relative; /* 为伪元素定位 */
}

.config-field-sequence {
  width: auto; /* 宽度自适应内容 */
  min-width: fit-content;
}

.config-field-sequence .spinner-control-horizontal {
  margin: 0 10px; /* 左右各10像素空间，总共20像素 */
}

.config-field-sequence .spinner-control-horizontal input.config-position {
  width: 50px !important; /* 序号文本框宽度50像素 */
  flex: 0 0 50px;
  min-width: 50px;
  max-width: 50px;
  /* 隐藏number输入框内部的上下箭头 */
  -moz-appearance: textfield;
  appearance: textfield;
}

.config-field-sequence .spinner-control-horizontal input.config-position::-webkit-inner-spin-button,
.config-field-sequence .spinner-control-horizontal input.config-position::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.config-field-user {
  width: auto;
  min-width: fit-content;
}

.config-field-name {
  width: auto;
  min-width: fit-content;
}

.config-field-controller {
  width: auto;
  min-width: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative; /* 确保伪元素可以相对于此定位 */
}

.config-field-ip,
.config-field-serial {
  width: auto;
  min-width: fit-content;
}

.config-field-scene-count {
  width: auto;
  min-width: fit-content;
}

.config-field-scene-count .spinner-control-horizontal {
  margin: 0 10px; /* 左右各10像素空间，总共20像素 */
}

.config-field-scene-count .spinner-control-horizontal input[type="number"].config-scene-count {
  width: 50px !important; /* 场景数量文本框宽度50像素 */
  flex: 0 0 50px;
  min-width: 50px;
  max-width: 50px;
  /* 隐藏number输入框内部的上下箭头 */
  -moz-appearance: textfield;
  appearance: textfield;
}

.config-field-scene-count .spinner-control-horizontal input[type="number"].config-scene-count::-webkit-inner-spin-button,
.config-field-scene-count .spinner-control-horizontal input[type="number"].config-scene-count::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* 场景数量按钮使用序号按钮的图标 */
.config-field-scene-count .scene-count-down {
  color: transparent; /* 隐藏文本 */
  position: relative;
}

.config-field-scene-count .scene-count-down::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background-image: url('../icons/down-s.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: brightness(0) invert(1); /* 将图标变为白色 */
  z-index: 1;
}

.config-field-scene-count .scene-count-up {
  color: transparent; /* 隐藏文本 */
  position: relative;
}

.config-field-scene-count .scene-count-up::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background-image: url('../icons/up-s.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: brightness(0) invert(1); /* 将图标变为白色 */
  z-index: 1;
}

.config-field label {
  color: #c8d7ff;
  font-weight: 500;
  font-size: 0.9rem;
}

.config-field label .required-mark {
  color: #ff6b6b;
  margin-left: 2px;
  margin: 0; /* 移除默认margin */
  padding: 0; /* 移除默认padding */
  line-height: 1; /* 减小行高，压缩间距 */
  text-align: center; /* 文字居中对齐 */
  width: 100%; /* 确保宽度一致 */
}

.config-field input[type="text"] {
  width: auto; /* 宽度自适应内容 */
  min-width: fit-content;
  padding: 0.6rem 20px; /* 左右各20像素空间 */
  border-radius: 6px;
  border: 1px solid #34a1e0;
  background: rgba(6, 9, 49, 0.75);
  color: #f3f4f6;
  font-size: 0.95rem;
  box-sizing: border-box;
  text-align: center; /* 输入框文字居中对齐 */
}

.config-field-ip input.config-device-ip,
.config-field-serial input.config-device-serial {
  width: 128px !important; /* IP地址文本框宽度128像素 */
  min-width: 128px;
  max-width: 128px;
  padding: 0.6rem 10px; /* 左右各10像素空间 */
}

.config-field-name input.config-project-name {
  width: 160px !important; /* 项目名称文本框宽度160像素 */
  min-width: 160px;
  max-width: 160px;
  padding: 0.6rem 20px; /* 左右各20像素空间 */
}

.spinner-control-horizontal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.spinner-control-horizontal {
  width: auto; /* 宽度自适应内容 */
  min-width: fit-content;
  margin: 0 20px; /* 左右各20像素空间 */
}

.spinner-control-horizontal input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem;
  text-align: center; /* 输入框文字居中对齐 */
  border-radius: 6px;
  border: 1px solid #34a1e0;
  background: rgba(6, 9, 49, 0.75);
  color: #f3f4f6;
  font-size: 0.95rem;
  box-sizing: border-box;
}

.spinner-btn-horizontal {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.3s ease;
}

/* 序号按钮使用SVG图标 */
.config-field-sequence .spinner-left {
  color: transparent; /* 隐藏文本 */
  position: relative;
}

.config-field-sequence .spinner-left::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background-image: url('../icons/down-s.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: brightness(0) invert(1); /* 将图标变为白色 */
  z-index: 1;
}

.config-field-sequence .spinner-right {
  color: transparent; /* 隐藏文本 */
  position: relative;
}

.config-field-sequence .spinner-right::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background-image: url('../icons/up-s.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: brightness(0) invert(1); /* 将图标变为白色 */
  z-index: 1;
}

.spinner-btn-horizontal:hover {
  background: #2563eb;
  transform: scale(1.1);
}

.config-field select {
  width: auto; /* 宽度自适应内容 */
  min-width: fit-content;
  padding: 0.6rem 20px; /* 左右各20像素空间 */
  padding-right: 40px; /* 右侧留出空间给下拉箭头图标 */
  border-radius: 6px;
  border: 1px solid #34a1e0;
  background: rgba(6, 9, 49, 0.75);
  color: #f3f4f6;
  font-size: 0.95rem;
  cursor: pointer;
  box-sizing: border-box;
  text-align: center; /* 下拉框文字居中对齐 */
  text-align-last: center; /* 下拉框选中项居中对齐 */
  appearance: none; /* 移除默认下拉箭头 */
  -webkit-appearance: none;
  -moz-appearance: none;
  line-height: 1.5; /* 确保行高一致，有助于垂直对齐 */
  height: auto; /* 让高度自适应内容 */
  vertical-align: middle; /* 垂直居中对齐 */
  display: inline-block; /* 确保可以正确计算高度 */
}

/* 所有下拉框统一使用白色 down.svg 图标 */
/* 控制器类型下拉框的白色图标 */
.config-field-controller {
  position: relative;
}

.config-field-controller::after {
  content: '';
  position: absolute;
  right: 10px;
  /* 优先使用JavaScript动态计算的位置，如果没有则使用CSS calc */
  top: var(--arrow-top, calc(1.08rem + 0.125rem + 0.6rem + 0.7125rem));
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url('../icons/down.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: brightness(0) invert(1); /* 将图标变为白色 */
  pointer-events: none;
  z-index: 1;
  /* 确保箭头垂直居中 */
  display: block;
}

.config-field select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.config-scenes {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(52, 161, 224, 0.3);
}

.scenes-input-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.scene-input-field {
  display: flex;
  flex-direction: column;
  gap: 2px; /* 压缩间距：场景序号与输入框之间保留2像素 */
  align-items: center; /* 左右居中对齐 */
}

.scene-input-label {
  color: #c8d7ff;
  font-weight: 500;
  font-size: 0.9rem;
  margin: 0; /* 移除默认margin */
  padding: 0; /* 移除默认padding */
  line-height: 1; /* 减小行高，压缩间距 */
  text-align: center; /* 文字居中对齐 */
  width: 100%; /* 确保宽度一致 */
}

.config-scene-name-input {
  width: 160px !important; /* 场景按钮名称文本框宽度160像素 */
  min-width: 160px;
  max-width: 160px;
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #34a1e0;
  background: rgba(6, 9, 49, 0.75);
  color: #f3f4f6;
  font-size: 0.95rem;
  box-sizing: border-box;
  text-align: center; /* 输入框文字居中对齐 */
}

.config-scene-name-input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

.scene-button-item .scene-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-block;
}

.scene-button-item .scene-indicator.gray {
  background: #4b5563;
}

.scene-button-item .scene-indicator.green {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.scene-control-item .scene-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-block;
}

.scene-control-item .scene-indicator.gray {
  background: #4b5563;
}

.scene-control-item .scene-indicator.green {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* 用户管理页面 */
.user-management-card {
  width: 100%;
  max-width: 1024px; /* 最大宽度限制为1024像素 */
  margin: 0; /* 左对齐 */
  border: 1px solid #34a1e0;
  box-shadow: 0 0 25px rgba(52, 161, 224, 0.35), inset 0 0 20px rgba(52, 161, 224, 0.25);
  overflow-x: auto;
  box-sizing: border-box;
}

.user-management-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: auto; /* 列宽自动调整 */
}

.user-management-table thead {
  background: rgba(7, 15, 62, 0.8);
  border-bottom: 2px solid #34a1e0;
}

.user-management-table th {
  padding: 0.75rem 0.5rem;
  text-align: left;
  color: #c8d7ff;
  font-weight: 600;
  white-space: nowrap;
  border-right: 1px solid rgba(52, 161, 224, 0.3);
}

.user-management-table th:last-child {
  border-right: none;
}

.user-management-table tbody tr {
  border-bottom: 1px solid rgba(52, 161, 224, 0.2);
  transition: background 0.2s;
}

.user-management-table tbody tr:hover {
  background: rgba(52, 161, 224, 0.1);
}

.user-management-table td {
  padding: 0.6rem 0.5rem;
  color: #e5e7eb;
  border-right: 1px solid rgba(52, 161, 224, 0.2);
}

.user-management-table td:last-child {
  border-right: none;
}

.user-management-table input[type="text"] {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid #34a1e0;
  border-radius: 4px;
  background: rgba(6, 9, 49, 0.75);
  color: #f3f4f6;
  font-size: 0.85rem;
  box-sizing: border-box;
}

.user-management-table input[type="text"]:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.3);
}

/* 用户管理表格 - 公司名输入框自适应宽度 */
.user-management-table .user-company-input {
  width: 100%;
  min-width: 80px;
}

.user-management-table select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid #34a1e0;
  border-radius: 4px;
  background: rgba(6, 9, 49, 0.75);
  color: #f3f4f6;
  font-size: 0.85rem;
  cursor: pointer;
  box-sizing: border-box;
}

.user-management-table select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.3);
}

.user-approve-btn,
.user-enable-btn,
.user-delete-btn {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.user-approve-btn {
  background: #3b82f6;
  color: #fff;
}

.user-approve-btn:hover {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.user-approve-btn.pending {
  background: #ef4444;
  color: #fff;
}

.user-approve-btn.pending:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.user-approved-status {
  color: #10b981;
  font-weight: 500;
}

/* 系统备份页面 */
.backup-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.backup-card {
  width: 100%;
  max-width: 600px; /* 限制最大宽度，使卡片更紧凑 */
  margin: 0; /* 左对齐 */
  border: 1px solid #34a1e0;
  box-shadow: 0 0 25px rgba(52, 161, 224, 0.35), inset 0 0 20px rgba(52, 161, 224, 0.25);
  padding: 1.5rem; /* 减小内边距：从2rem改为1.5rem */
  box-sizing: border-box;
}

.backup-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem; /* 减小间距：从1.5rem改为1rem */
}

.backup-stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem; /* 减小内边距：从1rem改为0.75rem */
  background: rgba(7, 15, 62, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(52, 161, 224, 0.3);
}

.backup-stat-label {
  color: #c8d7ff;
  font-size: 1rem;
  font-weight: 500;
}

.backup-stat-value {
  color: #34a1e0;
  font-size: 1.1rem;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(52, 161, 224, 0.5);
}

/* 系统日志页面 */
.log-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.log-card {
  width: 100%;
  max-width: 1024px; /* 与项目信息框宽度一致 */
  margin: 0; /* 左对齐 */
  border: 1px solid #34a1e0;
  box-shadow: 0 0 25px rgba(52, 161, 224, 0.35), inset 0 0 20px rgba(52, 161, 224, 0.25);
  padding: 1.5rem;
  box-sizing: border-box;
}

.log-display-container {
  margin-top: 1.5rem;
  width: 100%;
}

.log-display {
  width: 100%;
  height: 1024px; /* 高度等于宽度 */
  max-height: 1024px;
  background: rgba(6, 9, 49, 0.8);
  border: 1px solid rgba(52, 161, 224, 0.3);
  border-radius: 8px;
  padding: 1rem;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #c8d7ff;
  white-space: pre-wrap;
  word-wrap: break-word;
  box-sizing: border-box;
}

.log-display::-webkit-scrollbar {
  width: 8px;
}

.log-display::-webkit-scrollbar-track {
  background: rgba(6, 9, 49, 0.5);
  border-radius: 4px;
}

.log-display::-webkit-scrollbar-thumb {
  background: rgba(52, 161, 224, 0.5);
  border-radius: 4px;
}

.log-display::-webkit-scrollbar-thumb:hover {
  background: rgba(52, 161, 224, 0.7);
}

.status-card {
  width: 100%;
  max-width: 600px;
  margin: 0;
  border: 1px solid #34a1e0;
  box-shadow: 0 0 25px rgba(52, 161, 224, 0.35), inset 0 0 20px rgba(52, 161, 224, 0.25);
  padding: 1.5rem;
  box-sizing: border-box;
}

.status-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
}

.status-section {
  margin-bottom: 2rem;
}

.status-section-title {
  color: #c8d7ff;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(52, 161, 224, 0.3);
  padding-bottom: 0.5rem;
}

.status-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.status-label {
  color: #c8d7ff;
  font-weight: 500;
  min-width: 80px;
}

.status-indicator {
  font-size: 1.2rem;
  font-weight: bold;
  margin-right: 0.5rem;
}

.status-indicator.status-online {
  color: #10b981;
}

.status-indicator.status-offline {
  color: #ef4444;
}

.status-indicator.status-error {
  color: #f59e0b;
}

.status-text {
  color: #f3f4f6;
  font-weight: 500;
}

.status-value {
  color: #60a5fa;
  font-family: 'Courier New', monospace;
}

.status-message {
  color: #c8d7ff;
  font-size: 0.9rem;
  flex: 1;
  min-width: 200px;
}

.status-message.status-success {
  color: #10b981;
}

.status-message.status-error {
  color: #ef4444;
}

.status-tips {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(52, 161, 224, 0.3);
}

.status-tips h4 {
  color: #c8d7ff;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.status-tips ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  color: #9ca3af;
  font-size: 0.9rem;
  line-height: 1.6;
}

.status-tips li {
  margin-bottom: 0.5rem;
}

.log-info {
  color: #c8d7ff;
  font-size: 0.95rem;
  line-height: 1.6;
}

.user-change-password-btn {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
  background: #3b82f6;
  color: #fff;
}

.user-change-password-btn:hover {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.user-enable-btn.enabled {
  background: #10b981;
  color: #fff;
}

.user-enable-btn.enabled:hover {
  background: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.user-enable-btn.disabled {
  background: #ef4444;
  color: #fff;
}

.user-enable-btn.disabled:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.user-delete-btn {
  background: #ef4444;
  color: #fff;
}

.user-delete-btn:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.user-edit-btn {
  padding: 0.4rem 0.8rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
  background: #3b82f6;
  color: #fff;
}

.user-edit-btn:hover {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* 用户修改模态框样式 */
.user-edit-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem 0;
}

.user-edit-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-edit-info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-edit-label {
  font-weight: 500;
  color: #c8d7ff;
  min-width: 80px;
}

.user-edit-value {
  color: #f3f4f6;
  font-weight: 400;
}

.user-edit-actions {
  display: flex;
  flex-direction: row; /* 水平排列，按钮在一行显示 */
  gap: 0.75rem;
  align-items: flex-start; /* 按钮左对齐 */
  flex-wrap: wrap; /* 如果空间不足，允许换行 */
}

.user-edit-action-btn {
  width: auto; /* 宽度自适应文字内容 */
  padding: 0.75rem 20px; /* 左右各20像素空间 */
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap; /* 防止文字换行 */
}

.user-edit-action-btn.hidden {
  display: none;
}

/* ============================================
   响应式设计 - 移动端适配
   ============================================ */

/* 移动端和窄屏设备（宽度小于768px） */
@media screen and (max-width: 768px) {
  /* 页眉改为单行布局：平台名称在左上角，用户名按钮在右上角 */
  .page-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    position: relative;
    z-index: 1000; /* 页眉应该在菜单栏之上 */
  }

  .header-row {
    display: flex;
    width: 100%;
    padding: 0;
  }

  .header-row-1 {
    justify-content: space-between;
    align-items: center;
    display: flex;
  }

  .header-row-2 {
    display: none !important; /* 隐藏日期和星期 */
  }

  .header-row-3 {
    display: none !important; /* 移动端不需要第三行 */
  }

  .header-left {
    min-width: auto;
    justify-content: flex-start;
    width: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .platform-title {
    font-size: 1.2rem;
  }

  /* 隐藏平台图标 */
  .platform-icon {
    display: none !important;
  }

  .date-display {
    font-size: 0.9rem;
  }

  .header-right {
    width: auto;
    justify-content: flex-end;
    gap: 0.5rem;
    display: flex;
    align-items: center;
  }

  /* 隐藏全屏按钮 */
  .header-actions {
    display: none !important;
  }

  .header-icon-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .user-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  /* 主容器改为垂直布局 */
  .main-container {
    flex-direction: column;
    position: relative;
    z-index: 1; /* 主容器应该在最下层 */
  }

  /* 侧边栏改为横向导航 */
  .sidebar-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #34a1e0;
    overflow-x: auto;
    overflow-y: visible; /* 允许下拉菜单显示 */
    overflow: visible; /* 覆盖上面的设置，确保子菜单不被裁剪 */
    position: relative; /* 确保定位上下文 */
    z-index: 900; /* 菜单栏应该在内容区域之上，但在页眉之下 */
    background: linear-gradient(180deg, #070f3e, #062860); /* 确保背景不透明 */
  }

  /* 移动端：为导航菜单创建一个滚动容器，但不影响子菜单 */
  .sidebar-nav::before {
    content: '';
    display: none; /* 不使用伪元素 */
  }

  .nav-menu {
    display: flex;
    flex-direction: row;
    padding: 0.5rem;
    gap: 0.5rem;
    white-space: nowrap;
    position: relative; /* 确保定位上下文 */
    align-items: flex-start; /* 确保下拉菜单可以显示 */
    overflow: visible; /* 确保子菜单不被裁剪 */
  }

  .nav-item {
    padding: 0.6rem 1rem;
    border-left: none;
    border-bottom: 3px solid transparent;
    min-width: fit-content;
    flex-shrink: 0;
  }

  .nav-item:hover,
  .nav-item.active {
    border-left-color: transparent;
    border-bottom-color: #34a1e0;
  }

  /* 移动端：导航组包装器 */
  .nav-group-wrapper {
    position: relative;
    flex-shrink: 0;
  }

  /* 移动端：导航组标题和子菜单需要作为一个整体 */
  .nav-group-title {
    padding: 0.6rem 1rem;
    border-left: none;
    border-bottom: 3px solid transparent;
    min-width: fit-content;
    flex-shrink: 0;
    position: relative; /* 为下拉菜单提供定位基准 */
  }

  .nav-group-title:hover,
  .nav-group-title.active {
    border-left-color: transparent;
    border-bottom-color: #34a1e0;
  }

  /* 移动端：导航组包装器需要相对定位 */
  .nav-group-wrapper {
    position: relative;
  }

  /* 移动端：子菜单定位在父菜单下方 */
  .nav-group-wrapper .nav-submenu {
    display: none;
    position: fixed; /* 使用fixed定位，避免被父容器裁剪 */
    top: auto; /* 由JavaScript动态设置 */
    left: auto; /* 由JavaScript动态设置 */
    background: linear-gradient(180deg, #070f3e, #062860);
    border: 1px solid #34a1e0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(52, 161, 224, 0.3);
    z-index: 2000; /* 提高到与用户菜单相同的层级，确保显示 */
    min-width: 200px;
    max-width: calc(100vw - 20px); /* 确保不超出视口 */
    padding: 0.5rem 0;
    margin-top: 0;
    overflow-y: auto; /* 如果内容过多，允许滚动 */
    max-height: calc(100vh - 200px); /* 限制最大高度，避免超出视口 */
  }

  /* 移动端：当一级菜单激活时，显示子菜单（使用fixed定位） */
  .nav-group-wrapper .nav-group-title.active + .nav-submenu {
    display: block !important; /* 使用!important确保显示优先级 */
    visibility: visible !important; /* 确保可见性 */
    opacity: 1 !important; /* 确保不透明 */
    max-height: none !important; /* 移动端不需要max-height限制 */
  }

  .nav-sub-item {
    padding: 0.7rem 1.5rem;
    padding-left: 1.5rem;
    display: flex;
    align-items: center; /* 垂直居中对齐 */
    gap: 0.75rem; /* 图标和文字之间的间距 */
  }

  .nav-arrow {
    display: none;
  }

  /* 内容区域调整 - 应该在最下层 */
  .content-area {
    padding: 1rem;
    position: relative;
    z-index: 1 !important; /* 内容区域（包括iframe）应该在最下层，使用!important确保优先级 */
  }
  
  /* 确保内容区域内的所有元素都在最下层 */
  .content-area *,
  .content-area *::before,
  .content-area *::after {
    position: relative;
    z-index: auto !important;
  }
  
  /* 如果内容区域内有iframe，确保它在最下层 */
  .content-area iframe {
    z-index: 1 !important;
    position: relative;
  }
  
  /* 确保页面内容也在最下层 */
  .page-content {
    position: relative;
    z-index: auto !important;
  }
  
  /* 确保内容区域内的卡片等元素也在最下层 */
  .content-area .card,
  .content-area .home-project-card,
  .content-area .project-detail-card,
  .content-area .config-project-card,
  .content-area .user-management-card,
  .content-area article,
  .content-area div,
  .content-area section {
    position: relative;
    z-index: auto !important;
  }

  /* 首页项目卡片网格调整 */
  #home-project-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* 移动端：IP和状态在同一行显示 */
  /* 隐藏独立的状态行 */
  .meta-item-status-row {
    display: none;
  }

  /* 在IP行显示状态 */
  .meta-item:has(.device-ip) {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.4rem;
  }

  .meta-item:has(.device-ip) .meta-label {
    min-width: 60px;
    flex-shrink: 0;
  }

  .meta-item:has(.device-ip) .device-ip {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* 将状态芯片添加到IP行 */
  .meta-item:has(.device-ip) .status-chip {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    margin-left: auto;
  }

  /* 项目详情页调整 */
  .detail-header-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
  }

  .detail-header-info-right {
    display: flex;
    flex-direction: row; /* 保持横向排列 */
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    flex-wrap: wrap; /* 允许换行，如果空间不足 */
  }

  .detail-scenes-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .detail-scenes {
    padding: 1rem;
  }

  /* 配置页调整 */
  .config-header {
    flex-direction: row; /* 横向排列 */
    gap: 0.75rem;
    align-items: center; /* 垂直居中 */
    flex-wrap: wrap; /* 允许换行 */
  }
  
  /* 项目配置页面：筛选器显示在按钮右边 */
  .project-user-filter {
    margin-left: auto; /* 推到右边 */
  }
  
  /* 用户管理页面：3个按钮横向排列 */
  #page-user-management .config-header {
    flex-direction: row;
    flex-wrap: wrap; /* 放满后换行 */
    gap: 0.75rem;
  }

  /* 系统配置按钮 - 与首页网络测试按钮保持一致 */
  /* 系统配置按钮 - 与首页网络测试按钮保持一致，文字两边各保持20像素的空间 */
  .config-action-btn {
    width: auto !important; /* 宽度自适应内容 */
    justify-content: center;
    padding: 0.75rem 20px !important; /* 上下0.75rem，左右20px */
    font-size: 1rem !important;
    font-weight: 500 !important;
    white-space: nowrap;
    min-height: 44px; /* 确保按钮有足够的高度，方便点击 */
    border-radius: 8px !important;
  }
  
  /* 首页网络测试按钮在移动端的样式 - 与系统配置按钮保持一致 */
  .home-network-test-btn {
    padding: 0.75rem 20px !important; /* 上下0.75rem，左右20px */
    font-size: 1rem !important;
    font-weight: 500 !important;
    white-space: nowrap;
    min-height: 44px;
    width: auto !important; /* 宽度自适应内容 */
  }

  .config-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
  }

  .config-card-actions {
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }

  .config-card-btn {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }

  .config-main-row {
    flex-direction: row; /* 横向排列 */
    flex-wrap: wrap; /* 允许换行 */
    gap: 0.75rem; /* 减小间距 */
    align-items: flex-start;
  }

  .config-field {
    width: auto !important; /* 宽度自适应内容 */
    min-width: fit-content;
    flex-shrink: 0;
  }
  
  /* 移动端：序号和名称可以放在同一行 */
  .config-field-sequence,
  .config-field-name {
    flex: 0 0 auto;
  }

  .scenes-input-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  /* 用户管理表格调整 */
  .user-management-table {
    font-size: 0.75rem;
  }

  .user-management-table th,
  .user-management-table td {
    padding: 0.4rem 0.3rem;
  }

  /* 移动端隐藏页脚 */
  .page-footer {
    display: none !important;
  }

  /* 移动端隐藏所有 ICP（登录页 + 登录后页脚） */
  .page-footer .icp-footer,
  .auth-wrapper .icp-footer {
    display: none !important;
  }

  /* 移动端：登录表单调整 */
  .auth-wrapper {
    padding: 1rem;
  }

  .form-card {
    padding: 1rem;
    max-width: 100%;
    box-sizing: border-box;
  }

  #login-form .login-label-horizontal {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  #login-form .login-label-horizontal input {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  #login-form input,
  #login-form select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .login-slider-wrapper {
    width: 100%;
    max-width: 100%;
    justify-content: flex-end;
  }

  .login-slider-wrapper .slider-container {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .login-slider-wrapper .slider-track {
    width: 100%;
    max-width: 100%;
  }

  .login-buttons-row {
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .login-buttons-row .login-btn,
  .login-buttons-row .lang-btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* 中等屏幕（768px - 1024px） */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .content-area {
    padding: 1.5rem;
  }

  .detail-scenes-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .scenes-input-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  #home-project-list {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 中等屏幕显示页脚 */
  .page-footer {
    display: flex !important;
  }
}

/* 大屏幕（1024px以上）保持原有布局 */
@media screen and (min-width: 1025px) {
  .header-row {
    display: contents;
  }

  .page-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: relative;
  }

  .header-row-1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
    z-index: 1;
  }

  .header-row-2 {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 0;
  }

  .header-row-2 .header-center {
    pointer-events: auto;
  }

  .header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }

  .header-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
  }

  .header-center {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* PC端显示页脚 */
  .page-footer {
    display: flex !important;
  }

  /* PC端：导航组包装器不影响布局 */
  .nav-group-wrapper {
    position: static;
  }

  /* PC端子菜单保持原有样式 */
  .nav-submenu {
    position: static;
    display: block;
  }

  #system-config-submenu {
    position: static;
  }
}

