.test-responsive-wrapper {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;

  .test-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;

    h1 {
      color: #1890ff;
      margin-bottom: 10px;
      font-size: 28px;
    }

    p {
      color: #666;
      font-size: 16px;
      margin-bottom: 20px;
    }

    .status-info {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      margin-top: 20px;

      .status-item, .data-summary {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        border-radius: 6px;
        font-size: 14px;

        .status-label, .summary-label {
          font-weight: 500;
        }
      }

      .status-item {
        &.loading {
          background: #fff7e6;
          border: 1px solid #ffd591;
          color: #fa8c16;
        }

        &.loaded {
          background: #f6ffed;
          border: 1px solid #b7eb8f;
          color: #52c41a;
        }
      }

      .data-summary {
        background: #f0f5ff;
        border: 1px solid #adc6ff;
        color: #2f54eb;
        font-size: 13px;
        text-align: center;
        max-width: 100%;

        .summary-value {
          font-family: monospace;
          font-size: 12px;
        }
      }

      .error-message {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 16px;
        background: #fff2f0;
        border: 1px solid #ffccc7;
        border-radius: 6px;
        color: #ff4d4f;
        font-size: 14px;

        .retry-button {
          padding: 4px 8px;
          border: 1px solid #ff4d4f;
          background: white;
          color: #ff4d4f;
          border-radius: 4px;
          cursor: pointer;
          transition: all 0.3s ease;

          &:hover {
            background: #ff4d4f;
            color: white;
          }
        }
      }
    }
  }

  .test-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;

    h3 {
      margin: 0 0 10px 0;
      color: #333;
      font-size: 16px;
    }

    .preset-selector, .device-simulator, .data-controls, .pagination-controls, .height-controls, .scroll-direction-controls {
      .preset-buttons, .device-buttons, .data-buttons, .pagination-buttons, .height-buttons, .scroll-direction-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
      }

      .preset-button, .device-button, .refresh-button, .toggle-button, .pagination-button, .height-button, .scroll-direction-button {
        padding: 8px 16px;
        border: 1px solid #d9d9d9;
        border-radius: 6px;
        background: white;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 14px;
        position: relative;

        &:hover {
          border-color: #1890ff;
          color: #1890ff;
        }

        &.active {
          background: #1890ff;
          color: white;
          border-color: #1890ff;
        }

        &:disabled {
          opacity: 0.6;
          cursor: not-allowed;

          &:hover {
            border-color: #d9d9d9;
            color: inherit;
          }
        }
      }

      .refresh-button {
        &:hover {
          background: #f0f0f0;
        }
      }

      .toggle-button {
        &.active {
          background: #52c41a;
          border-color: #52c41a;
        }

        &.active:hover {
          background: #73d13d;
          border-color: #73d13d;
        }
      }

      .pagination-button {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 90px;
        justify-content: center;

        &.active {
          background: #722ed1;
          border-color: #722ed1;
        }

        &.active:hover {
          background: #9254de;
          border-color: #9254de;
        }

        .warning-badge {
          font-size: 12px;
          animation: pulse 2s infinite;
          position: relative;

          &::after {
            content: '数据量过大，可能影响性能';
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 10px;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease;
            margin-bottom: 5px;
          }

          &:hover::after {
            opacity: 1;
          }
        }
      }

      .pagination-description, .height-description {
        margin-top: 8px;
        padding: 8px 12px;
        background: #f9f9f9;
        border-radius: 4px;
        border-left: 3px solid #722ed1;

        small {
          color: #666;
          font-size: 12px;
          line-height: 1.4;

          strong {
            color: #333;
          }

          .performance-warning {
            color: #ff4d4f;
            font-weight: 600;
          }
        }
      }

      .height-button {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 80px;
        justify-content: center;

        &.active {
          background: #13c2c2;
          border-color: #13c2c2;
        }

        &.active:hover {
          background: #36cfc9;
          border-color: #36cfc9;
        }
      }

      .height-description {
        border-left-color: #13c2c2;
      }

      // 滚动方向按钮样式
      .scroll-direction-button {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 120px;
        justify-content: flex-start;
        padding: 10px 16px;

        &.active {
          background: #fa8c16;
          border-color: #fa8c16;
        }

        &.active:hover {
          background: #ffa940;
          border-color: #ffa940;
        }

        .direction-icon {
          font-size: 16px;
          min-width: 20px;
          text-align: center;
        }

        .recommend-badge {
          margin-left: auto;
          font-size: 12px;
          color: #52c41a;
          font-weight: 600;
        }
      }

      .scroll-direction-description {
        margin-top: 8px;
        padding: 10px 12px;
        background: #fff7e6;
        border-radius: 4px;
        border-left: 3px solid #fa8c16;

        small {
          color: #666;
          font-size: 12px;
          line-height: 1.5;

          strong {
            color: #333;
          }

          .direction-tips {
            color: #fa8c16;
            font-style: italic;
            margin-top: 4px;
            display: block;
          }
        }
      }
    }
  }

  // 动态配置编辑器
  .dynamic-config-panel {
    margin-bottom: 30px;
    padding: 20px;
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;

    h3 {
      margin: 0 0 20px 0;
      color: #1890ff;
      font-size: 18px;
    }

    .config-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 20px;
    }

    .config-section {
      background: white;
      padding: 16px;
      border-radius: 6px;
      border: 1px solid #e8e8e8;

      h4 {
        margin: 0 0 12px 0;
        color: #333;
        font-size: 14px;
        font-weight: 600;
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 8px;
      }

      .config-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
        font-size: 13px;

        &:last-child {
          margin-bottom: 0;
        }

        label {
          color: #666;
          flex: 0 0 auto;
          margin-right: 12px;
          display: flex;
          align-items: center;
          gap: 6px;

          input[type="checkbox"] {
            margin: 0;
          }
        }

        input, select {
          flex: 1;
          max-width: 80px;
          padding: 4px 8px;
          border: 1px solid #d9d9d9;
          border-radius: 4px;
          font-size: 12px;

          &:focus {
            outline: none;
            border-color: #1890ff;
            box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
          }
        }

        select {
          max-width: 120px;
        }
      }
    }
  }

  .config-info {
    margin-bottom: 30px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;

    h3 {
      color: #1890ff;
      margin: 0 0 10px 0;
      font-size: 18px;
      display: flex;
      align-items: center;
      gap: 10px;

      .config-mode-indicator {
        font-size: 12px;
        color: #666;
        background: #f0f0f0;
        padding: 2px 8px;
        border-radius: 12px;
        font-weight: normal;
      }
    }

    p {
      color: #666;
      margin: 0 0 15px 0;
      line-height: 1.6;
    }

    details {
      summary {
        cursor: pointer;
        color: #1890ff;
        font-size: 14px;
        padding: 5px 0;
        user-select: none;

        &:hover {
          text-decoration: underline;
        }
      }

      .config-details {
        background: #f5f5f5;
        padding: 15px;
        border-radius: 4px;
        font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
        font-size: 12px;
        line-height: 1.4;
        color: #333;
        margin-top: 10px;
        overflow-x: auto;
        max-height: 400px;
        overflow-y: auto;
      }
    }
  }

  .test-container {
    margin-bottom: 30px;
    min-height: 400px;
    position: relative;

    // 设备模拟样式
    &.simulate-mobile {
      max-width: 375px;
      margin-left: auto;
      margin-right: auto;
    }

    &.simulate-pad {
      max-width: 768px;
      margin-left: auto;
      margin-right: auto;
    }

    &.simulate-pc {
      max-width: 100%;
    }

    .test-responsive-wrapper-instance {
      min-height: 300px;

      // 滚动条样式 - 垂直滚动
      &.scroll-vertical {
        &::-webkit-scrollbar {
          width: 8px;
          height: 8px;
        }

        &::-webkit-scrollbar-track {
          background: #f1f1f1;
          border-radius: 4px;
        }

        &::-webkit-scrollbar-thumb {
          background: #c1c1c1;
          border-radius: 4px;

          &:hover {
            background: #a8a8a8;
          }
        }
      }

      // 滚动条样式 - 水平滚动
      &.scroll-horizontal {
        white-space: nowrap;

        &::-webkit-scrollbar {
          width: 8px;
          height: 8px;
        }

        &::-webkit-scrollbar-track {
          background: #fff7e6;
          border-radius: 4px;
        }

        &::-webkit-scrollbar-thumb {
          background: #fa8c16;
          border-radius: 4px;

          &:hover {
            background: #ffa940;
          }
        }

        // 水平滚动时的子元素布局
        .list-content {
          display: inline-flex;
          align-items: flex-start;
        }
      }
    }

    // 指示器样式
    .height-indicator {
      position: absolute;
      bottom: -25px;
      right: 0;
      background: rgba(19, 194, 194, 0.1);
      border: 1px solid #13c2c2;
      border-radius: 4px;
      padding: 2px 8px;

      small {
        color: #13c2c2;
        font-size: 11px;
        font-weight: 500;
      }
    }

    .scroll-direction-indicator {
      position: absolute;
      bottom: -25px;
      left: 0;
      background: rgba(250, 140, 22, 0.1);
      border: 1px solid #fa8c16;
      border-radius: 4px;
      padding: 2px 8px;

      small {
        color: #fa8c16;
        font-size: 11px;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 4px;
      }
    }

    // 加载遮罩
    .loading-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(255, 255, 255, 0.8);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 10;
      border-radius: 8px;

      .loading-spinner {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 20px;
        background: white;
        border-radius: 6px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        color: #1890ff;
        font-weight: 500;

        &::before {
          content: '';
          width: 16px;
          height: 16px;
          border: 2px solid #e6f7ff;
          border-top-color: #1890ff;
          border-radius: 50%;
          animation: spin 1s linear infinite;
        }
      }
    }
  }

  .test-instructions {
    padding: 20px;
    background: #e6f7ff;
    border-left: 4px solid #1890ff;
    border-radius: 0 8px 8px 0;

    h3 {
      color: #1890ff;
      margin: 0 0 15px 0;
      font-size: 16px;
    }

    ul {
      margin: 0 0 20px 0;
      padding-left: 20px;
      color: #555;

      li {
        margin-bottom: 8px;
        line-height: 1.6;
      }
    }

    .performance-tips {
      margin-top: 20px;
      padding: 15px;
      background: rgba(255, 255, 255, 0.8);
      border-radius: 6px;
      border: 1px solid #d6e4ff;

      h4 {
        color: #1890ff;
        margin: 0 0 10px 0;
        font-size: 14px;
      }

      p {
        margin: 5px 0;
        color: #666;
        font-size: 13px;
        line-height: 1.5;

        &::before {
          content: '💡 ';
          margin-right: 4px;
        }
      }
    }
  }
}

// 动画关键帧
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

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

// 测试项目样式
.test-item {
  padding: 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;

  &:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
  }

  // 状态相关样式
  &.active {
    border-color: #52c41a;
    background: linear-gradient(135deg, #ffffff 0%, #f6ffed 100%);
  }

  &.inactive {
    border-color: #ff4d4f;
    background: linear-gradient(135deg, #ffffff 0%, #fff2f0 100%);
    opacity: 0.8;
  }

  &.pending {
    border-color: #faad14;
    background: linear-gradient(135deg, #ffffff 0%, #fffbe6 100%);
  }

  .item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;

    h4 {
      margin: 0;
      color: #333;
      font-size: 16px;
      font-weight: 600;
      line-height: 1.3;
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }

    .status-badge {
      flex-shrink: 0;
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 11px;
      font-weight: 500;
      text-align: center;

      &.active {
        background: #f6ffed;
        color: #52c41a;
        border: 1px solid #b7eb8f;
      }

      &.inactive {
        background: #fff2f0;
        color: #ff4d4f;
        border: 1px solid #ffccc7;
      }

      &.pending {
        background: #fffbe6;
        color: #faad14;
        border: 1px solid #ffe58f;
      }
    }
  }

  .item-description {
    margin: 0 0 12px 0;
    color: #666;
    line-height: 1.5;
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    font-size: 14px;
  }

  .item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;

    .category {
      background: #f0f0f0;
      color: #666;
      padding: 2px 8px;
      border-radius: 12px;
      font-size: 12px;
    }

    .price {
      color: #ff4d4f;
      font-weight: 600;
      font-size: 14px;
    }
  }

  .item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    font-size: 12px;
    color: #999;

    .item-id {
      font-family: monospace;
      background: #f5f5f5;
      padding: 1px 4px;
      border-radius: 2px;
    }

    .created-time {
      font-style: italic;
    }
  }

  .height-info {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-family: monospace;
  }
}


// 响应式样式
@media (max-width: 768px) {
  .test-responsive-wrapper {
    padding: 15px;
    max-width: 100%;

    .test-controls {
      padding: 15px;

      .preset-buttons, .device-buttons, .data-buttons, .pagination-buttons, .height-buttons, .scroll-direction-buttons {
        flex-direction: column;
        align-items: stretch;

        .preset-button, .device-button, .refresh-button, .toggle-button, .pagination-button, .height-button, .scroll-direction-button {
          text-align: center;
        }

        .scroll-direction-button {
          justify-content: center;
        }
      }

      .pagination-description, .height-description, .scroll-direction-description {
        margin-top: 12px;
        text-align: center;

        .direction-tips {
          text-align: center;
        }
      }
    }

    .test-container {
      .height-indicator, .scroll-direction-indicator {
        position: static;
        margin-top: 10px;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        display: inline-block;
      }

      .scroll-direction-indicator {
        margin-left: 10px;
      }
    }

    .dynamic-config-panel {
      .config-grid {
        grid-template-columns: 1fr;
      }
    }

    .test-header h1 {
      font-size: 24px;
    }

    .test-item {
      padding: 12px;

      .item-header h4 {
        font-size: 15px;
      }

      .item-description {
        font-size: 13px;
      }
    }

    .status-info {
      .data-summary {
        .summary-value {
          font-size: 11px;
          line-height: 1.4;
        }
      }
    }
  }
}

@media (max-width: 480px) {
  .test-responsive-wrapper {
    padding: 10px;

    .test-header h1 {
      font-size: 20px;
    }

    .config-info, .test-controls, .test-instructions, .dynamic-config-panel {
      padding: 15px;
    }

    .dynamic-config-panel {
      .config-section {
        padding: 12px;

        .config-row {
          flex-direction: column;
          align-items: stretch;
          gap: 6px;

          label {
            margin-right: 0;
          }

          input, select {
            max-width: 100%;
          }
        }
      }
    }

    .test-item {
      padding: 10px;

      .item-header {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;

        .status-badge {
          align-self: flex-start;
        }
      }

      .item-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
      }
    }
  }
}
