// AI Voice 样式文件
.ai-voice-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: 300px;
    min-width: 260px;
    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;
      }
    }
  }

  // 中间区域：试听 + 文案 + 常用场景 + 生成按钮
  .middle-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;

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

      .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-content {
        flex: 1;
        background: #f7f8fc;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        position: relative;
        padding: 24px;
      }

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

        .current-audio-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;
          }
        }
      }
    }

    .input-section {
      flex: 1;
      background: #fff;
      border-radius: 8px;
      padding: 20px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 16px;

      &::-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;

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

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

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

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

        .preset-item {
          flex-shrink: 0;
          padding: 6px 14px;
          cursor: pointer;
          border-radius: 6px;
          border: 1px solid #1890ff;
          background: #fff;
          color: #1890ff;
          white-space: nowrap;
          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: auto;
        padding-top: 12px;
        border-top: 1px solid #f0f0f0;
      }
    }
  }

  .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;
              }
            }
          }
        }
      }
    }
  }

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

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

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

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

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