:root {
  --list-padding: 16px;
  --list-border-radius: 8px;
  --list-shadow: 0 2px 8px rgb(0 0 0 / 10%);
  --list-hover-shadow: 0 4px 12px rgb(0 0 0 / 15%);
}

.list-widget-container {
  position: relative;
  box-sizing: border-box;
  margin: 12px;
  padding: var(--list-padding);
  background-color: #fff;
  border-radius: var(--list-border-radius);
  box-shadow: var(--list-shadow);

  .list-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;

    &::after {
      content: '';
      position: absolute;
      bottom: -2px;
      left: 0;
      width: 40px;
      height: 2px;
      background: linear-gradient(90deg, #1890ff, #40a9ff);
      border-radius: 1px;
    }

    .list-title {
      margin: 0;
      color: #262626;
      font-weight: 600;
      font-size: 20px;
      position: relative;
    }
  }

  .list-content {
    .list-item {
      padding: 18px 0;
      border-bottom: 1px solid #f5f5f5;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;

      &::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: linear-gradient(180deg, #1890ff, #40a9ff);
        opacity: 0;
        transition: opacity 0.3s ease;
        border-radius: 0 2px 2px 0;
      }

      &:hover {
        background-color: #fafafa;
        border-radius: 8px;
        margin: 0 -12px;
        padding: 18px 12px;
        box-shadow: var(--list-hover-shadow);
        transform: translateX(4px);

        &::before {
          opacity: 1;
        }
      }

      &:last-child {
        border-bottom: none;
      }

      .item-image {
        width: 100%;
        height: 200px;
        margin-bottom: 16px;
        border-radius: 8px;
        overflow: hidden;
        position: relative;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          transition: transform 0.3s ease;
        }

        &:hover img {
          transform: scale(1.05);
        }
      }

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

          .item-title {
            margin: 0;
            color: #262626;
            font-weight: 500;
            line-height: 1.4;
            flex: 1;
            font-size: 16px;
          }

          .item-status {
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 11px;
            line-height: 1.2;
            font-weight: 500;

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

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

            &.status-gray {
              background-color: #f5f5f5;
              color: #8c8c8c;
              border: 1px solid #d9d9d9;
            }
          }
        }

        .item-description {
          margin-bottom: 12px;
          line-height: 1.6;
          color: #595959;
          font-size: 14px;
          display: box;
          -webkit-line-clamp: 2;
          line-clamp: 2;
          -webkit-box-orient: vertical;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        .item-meta {
          display: flex;
          justify-content: space-between;
          align-items: center;
          flex-wrap: wrap;
          gap: 8px;

          .item-meta-info {
            display: flex;
            align-items: center;
            gap: 8px;

            .meta-item {
              color: #8c8c8c;
              font-size: 12px;
            }

            .meta-separator {
              color: #8c8c8c;
              font-size: 12px;
            }
          }

          .item-tags {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;

            .tag {
              padding: 2px 6px;
              background-color: #e6f7ff;
              color: #1890ff;
              border: 1px solid #91d5ff;
              border-radius: 4px;
              font-size: 11px;
              line-height: 1.2;
            }
          }
        }
      }
    }

    // 卡片样式
    &.list-card {
      .list-item {
        margin-bottom: 12px;
        padding: 16px;
        background: #fff;
        border: 1px solid #f0f0f0;
        border-radius: var(--list-border-radius);
        box-shadow: 0 1px 3px rgb(0 0 0 / 10%);

        &:hover {
          box-shadow: var(--list-hover-shadow);
          border-color: #d9d9d9;
          transform: translateY(-2px);
        }

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

        .item-image {
          height: 180px;
          margin-bottom: 12px;
        }
      }
    }

    // 简洁样式
    &.list-simple {
      .list-item {
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;

        &:hover {
          background-color: transparent;
          box-shadow: none;
          margin: 0;
          padding: 12px 6px;
        }

        .item-image {
          height: 120px;
          margin-bottom: 8px;
        }

        .item-content {
          .item-header {
            margin-bottom: 4px;

            .item-title {
              font-size: 14px;
              font-weight: 400;
            }
          }

          .item-description {
            font-size: 12px;
            color: #8c8c8c;
            margin-bottom: 8px;
            -webkit-line-clamp: 1;
            line-clamp: 1;
          }

          .item-meta {
            .item-tags {
              .tag {
                font-size: 10px;
                padding: 1px 4px;
                line-height: 1.1;
              }
            }
          }
        }
      }
    }
  }
}

// 响应式设计
@media (max-width: 768px) {
  .list-widget-container {
    margin: 8px;
    padding: 12px;

    .list-content {
      .list-item {
        .item-content {
          .item-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 8px;

            .item-title {
              margin-right: 0;
            }
          }

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

// 暗色主题支持
@media (prefers-color-scheme: dark) {
  .list-widget-container {
    background-color: #1f1f1f;
    color: #fff;

    .list-header {
      border-bottom-color: #303030;

      .list-title {
        color: #fff;
      }
    }

    .list-content {
      .list-item {
        border-bottom-color: #303030;

        &:hover {
          background-color: #2a2a2a;
        }

        .item-content {
          .item-header {
            .item-title {
              color: #fff;
            }
          }

          .item-description {
            color: #ccc;
          }
        }
      }

      &.list-card {
        .list-item {
          background: #1f1f1f;
          border-color: #303030;
        }
      }
    }
  }
}
