/* ==========================================================================
   SOC行基础样式
   ========================================================================== */
.soc-row {
  position: relative;
  overflow: hidden;
}

.soc-row td {
  position: relative;
  z-index: 3;
}

/* 展开状态的样式 */
.soc-row.expanded {
  border: 1px solid #4cc9a4;
}

/* ==========================================================================
   SOC行背景效果
   ========================================================================== */
.soc-row-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.soc-row-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  transition: width 0.5s ease-out;
  z-index: 1;
}

/* ==========================================================================
   波浪动画效果
   ========================================================================== */
.wave-container {
  position: absolute;
  top: 0;
  height: 100%;
  width: 20px;
  pointer-events: none;
  z-index: 2;
}

.wave {
  content: "";
  position: absolute;
  width: 144px;
  height: 144px;
  top: 70px;
  left: 0px;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 45%;
  transform: translate(-50%, -70%) rotate(0);
  animation: rotateWave 4s linear infinite;
  animation-play-state: paused;
  transition: all 0.6s;
  z-index: 10;
}

.wave:nth-child(2) {
  border-radius: 47%;
  background-color: rgba(255, 255, 255, 0.9);
  transform: translate(-50%, -70%) rotate(0);
  animation: rotateWave 10s linear -5s infinite;
  animation-play-state: paused;
  z-index: 20;
}

.soc-row:hover .wave {
  animation-play-state: running;
}

/* 波浪动画关键帧 */
@keyframes rotateWave {
  50% {
    transform: translate(-50%, -73%) rotate(180deg);
  }

  100% {
    transform: translate(-50%, -70%) rotate(360deg);
  }
}

/* ==========================================================================
   详情行容器
   ========================================================================== */
.soc-detail-row {
  width: 100%;
  opacity: 0;
  transition: opacity 0.3s ease-in-out, max-height 0.3s ease-in-out;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.soc-detail-row.expanded {
  opacity: 1;
}

.soc-detail-container {
  padding: 0px 8px 8px 8px;
}

.soc-detail-content {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   详情行内容样式
   ========================================================================== */
/* 详情行基础布局 */
.detail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px 0;
  border-bottom: 1px dashed #eeeeff;
}

.soc-detail-item {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.4;
  min-width: 92px;
  flex: auto;
}

/* 标签和值的样式 */
.brand-info .detail-label {
  display: block;
  color: #999;
  font-weight: 500;
  margin-right: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.detail-value {
  font-size: 14px;
  color: #000;
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}

/* 链接样式 */
.detail-value.detail-link {
  text-decoration: underline;
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: auto;
}

.detail-link:hover {
  color: #3d4633;
}

/* ==========================================================================
   设备信息样式
   ========================================================================== */
.device-info-container {
  margin-top: 0px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* 当包含sub-brands-wrapper时的特殊布局 */
.device-info-container:has(.sub-brands-wrapper) {
  flex-wrap: nowrap;
}

.device-info-container:has(.sub-brands-wrapper) .device-brand {
  flex: 0 0 70px;
  align-self: flex-start;
  position: sticky;
  top: 8px;
}

.sub-brands-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.device-brand {
  flex: 0 0 70px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  padding: 8px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.3s ease;
}

.device-list {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.device-item {
  display: flex;
  flex-wrap: wrap;
  flex: none;
  justify-content: flex-start;
  height: auto; /* 垂直方向自适应 */
  align-items: flex-start;
  gap: 2px;
  padding: 8px;
  margin-bottom: 8px;
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  min-width: 0;
  position: relative;
}

.device-item::before {
  content: "";
  position: absolute;
  inset: -2px; /* 减小边框间距 */
  padding: 2px; /* 减小内边距 */
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  background: linear-gradient(
    45deg,
    rgba(var(--color1-rgb), 1),
    rgba(var(--color2-rgb), 1),
    rgba(var(--color3-rgb), 1)
  );
  animation: gradientFlowItemBox 3s infinite alternate;
  border-radius: 20px;
  animation-play-state: paused;
}

.device-item:hover::before {
  animation-play-state: running;
}

@keyframes gradientFlowItemBox {
  0% {
    filter: hue-rotate(0);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

/* 确保内容在渐变上层 */
.device-name,
.device-osName,
.device-extra-info {
  position: relative;
  z-index: 1;
}

.device-osName {
  position: absolute;
  top: -10px;
  left: -20px;
  display: block;
  background: linear-gradient(
    45deg,
    rgba(var(--color1-rgb), 0.4),
    rgba(var(--color2-rgb), 0.4),
    rgba(var(--color3-rgb), 0.4)
  );
  background-size: 300% 300%;
  padding: 2px 4px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: bold;
  backdrop-filter: blur(2px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  /* border: 1px solid rgba(0, 0, 0, 0.1); */
  transition: all 0.2s ease;
  mask-composite: exclude;
  pointer-events: none;
  animation: gradientFlow 5s ease infinite;
  animation-play-state: paused;
  color: #111;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.18),
    0 0px 1px rgba(255, 255, 255, 0.18);
}
.device-item:hover .device-osName {
  animation-play-state: running;
}
.device-osName span {
  display: block;
  mix-blend-mode: difference;
}
@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.device-name {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.device-name > span {
  color: #222;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-extra-info {
  font-size: 12px;
  color: #666;
  display: flex;
  flex-wrap: wrap;
  gap: -6px;
  min-width: 0;
  margin-top: -4px;
  display: flex;
  flex-direction: column;
}

.device-extra-info span {
  white-space: nowrap;
  margin-top: -2px;
}

.brand-info {
  display: flex;
  font-size: 12px;
  color: #222;
}

.device-item > span:last-child {
  margin-top: auto;
}

.sub-brand-container {
  margin: 0;
  padding: 0px;
  border-radius: 20px;
  position: relative;
  display: flex;
  justify-content: flex-start; /* 左对齐 */
  align-items: center; /* 垂直对齐 */
}

.sub-brand-title {
  font-size: 12px;
  font-weight: 500;
  color: #666;
  padding: 4px 12px;
  margin-right: 8px;
  border-radius: 20px;
  background-color: rgba(194, 221, 159, 0.6);
  display: block;
  flex: none;
  flex-grow: 0;
  flex-shrink: 0;
  flex-basis: auto;
  width: auto; /* 水平方向自适应 */
  height: auto; /* 垂直方向自适应 */
  z-index: 1;
}

.sub-brand-container .device-list {
  margin: 0;
}
