// AI Video 页面样式
.ai-video-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 16px;
  background-color: #f0f2f5;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;

  .page-header {
    margin-bottom: 16px;
    background: #fff;
    padding: 16px 24px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;

    .title {
      font-size: 20px;
      font-weight: 600;
      color: #1f2329;
    }

    .subtitle {
      color: #8f959e;
      font-size: 14px;
    }
  }

  .content-wrapper {
    flex: 1;
    display: flex;
    gap: 16px;
    overflow: hidden;
  }

  .control-panel {
    width: 380px;
    min-width: 320px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;

    .form-container {
      flex: 1;
      overflow-y: auto;
      padding-right: 4px;

      &::-webkit-scrollbar {
        width: 4px;
      }
      &::-webkit-scrollbar-track {
        background: transparent;
      }
      &::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 2px;
      }

      .form-item-group {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 16px;

        .form-label {
          font-size: 14px;
          font-weight: 500;
          color: #1f2329;
        }

        :deep(.ant-input-textarea) {
          font-size: 13px;
        }
      }

      .preset-group {
        margin-bottom: 2px;
        .preset-label {
          font-size: 13px;
          color: #8f959e;
          margin-bottom: 8px;
          display: block;
        }

        .preset-items {
          display: flex;
          flex-wrap: wrap;
          gap: 8px;
        }

        .preset-item {
          padding: 6px 14px;
          cursor: pointer;
          border-radius: 6px;
          border: 1px solid #1890ff;
          background: #fff;
          color: #1890ff;
          text-align: center;
          font-size: 12px;
          font-weight: 500;
          transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
          user-select: none;

          &:hover {
            background: #1890ff;
            color: #fff;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
          }

          &:active {
            transform: translateY(0);
          }
        }
      }
    }

    .action-btn-group {
      margin-top: 16px;
      padding-top: 16px;
      border-top: 1px solid #f0f0f0;
    }
  }

  .panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #1f2329;
    margin-bottom: 16px;
    padding-left: 8px;
    border-left: 4px solid #1890ff;
    line-height: 1;
  }

  .preview-panel {
    flex: 1;
    background: #fff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;

    .preview-content {
      flex: 1;
      background: #f7f8fc;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      position: relative;
      padding: 24px;
    }

    .video-info-section {
      padding: 12px 0;
      border-top: 1px solid #f0f0f0;
      margin-top: 12px;

      .current-video-info {
        display: flex;
        align-items: flex-start;
        gap: 8px;

        .info-label {
          font-size: 13px;
          color: #8f959e;
          flex-shrink: 0;
          font-weight: 500;
        }

        .info-text {
          font-size: 13px;
          color: #1f2329;
          flex: 1;
          word-break: break-word;
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          line-height: 1.4;
        }
      }
    }
  }

  .history-panel {
    width: 400px;
    min-width: 280px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;

    .history-list-wrapper {
      flex: 1;
      overflow-y: auto;
      display: flex;
      flex-direction: column;

      &::-webkit-scrollbar {
        width: 4px;
      }
      &::-webkit-scrollbar-track {
        background: transparent;
      }
      &::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 2px;
      }
    }

    .empty-history {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 100%;
      color: #b2b8c6;

      p {
        margin: 0;
      }
    }

    .history-list {
      display: flex;
      flex-direction: column;
      gap: 8px;

      .history-item {
        padding: 12px;
        border: 1px solid #f0f0f0;
        border-radius: 6px;
        background: #fafbfc;
        transition: all 0.3s;

        &:hover {
          background: #f5f9ff;
          border-color: #d9e8f7;
          box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
        }

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

          .item-title {
            flex: 1;
            font-size: 12px;
            color: #1f2329;
            font-weight: 500;
            word-break: break-word;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            line-height: 1.4;
          }

          .item-time {
            font-size: 10px;
            color: #b2b8c6;
            white-space: nowrap;
            flex-shrink: 0;
          }
        }

        .item-actions {
          display: flex;
          gap: 4px;
          justify-content: flex-end;

          :deep(.ant-btn) {
            padding: 0 4px;
            height: auto;
            min-width: auto;
            font-size: 12px;

            &.ant-btn-text {
              color: #1890ff;

              &:hover {
                color: #40a9ff;
              }
            }

            &.ant-btn-dangerous.ant-btn-text {
              color: #ff4d4f;

              &:hover {
                color: #ff7875;
              }
            }
          }
        }
      }
    }
  }

  .empty-state {
    text-align: center;
    color: #8f959e;

    p {
      margin-top: 12px;
      margin-bottom: 0;
    }

    .tip {
      font-size: 12px;
      color: #b2b8c6;
    }
  }

  .loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;

    .loading-text {
      text-align: center;
      color: #595959;

      p {
        margin: 4px 0;
      }

      .elapsed-time {
        font-size: 20px;
        font-weight: 600;
        color: #1890ff;
      }

      .status-text {
        font-size: 13px;
        color: #8c8c8c;
      }
    }
  }

  .video-player-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;

    .video-control {
      max-width: 100%;
      max-height: 100%;
      width: auto;
      height: auto;
      border-radius: 4px;
    }
  }
}
