// 移动端样式
.plan-api-dialog {
  background: white;
  border-radius: 16px 16px 0 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;

  .header-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex: 1;
  }

  .header-icon {
    font-size: 24px;
    color: #1890ff;
    margin-top: 4px;
  }

  .header-content {
    flex: 1;

    h3 {
      margin: 0 0 8px 0;
      font-size: 18px;
      font-weight: 600;
      color: #333;
    }

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

  .close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #999;
    background: transparent;
    border: none;
    cursor: pointer;

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

.nav-tabs {
  display: flex;
  background: white;
  border-bottom: 1px solid #f0f0f0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;

  .nav-tab {
    flex: 1;
    min-width: 80px;
    padding: 12px 8px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;

    svg {
      font-size: 16px;
    }

    &:hover {
      color: #1890ff;
    }

    &.active {
      color: #1890ff;
      border-bottom: 2px solid #1890ff;
    }
  }
}

.dialog-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.dialog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;

  .security-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;

    svg {
      color: #52c41a;
    }
  }

  .complete-btn {
    height: 36px;
    padding: 0 24px;
    border-radius: 18px;
  }
}

// 配置内容样式
.config-content {
  .config-section {
    margin-bottom: 24px;

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

  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;

    .section-title {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 16px;
      font-weight: 600;
      color: #333;

      .section-icon {
        color: #1890ff;
      }
    }
  }

  .input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;

    .api-input {
      flex: 1;
      border-radius: 8px;
    }

    .copy-btn {
      height: 40px;
      padding: 0 16px;
      border-radius: 8px;
      display: flex;
      align-items: center;
      gap: 4px;
    }
  }

  .security-tip {
    padding: 12px;
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: 8px;
    font-size: 12px;
    color: #d46b08;
    line-height: 1.5;
  }

  .params-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
  }

  .param-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e9ecef;

    h4 {
      margin: 0 0 8px 0;
      font-size: 14px;
      font-weight: 600;
      color: #333;
    }

    .param-list {
      font-size: 12px;
      color: #666;
      line-height: 1.6;

      div {
        margin-bottom: 4px;
      }

      code {
        background: #e9ecef;
        padding: 2px 4px;
        border-radius: 4px;
        font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
        font-size: 11px;
      }
    }
  }
}

// 测试内容样式
.test-content {
  .test-section {
    h3 {
      margin: 0 0 16px 0;
      font-size: 16px;
      font-weight: 600;
      color: #333;
    }

    .test-input {
      margin-bottom: 16px;
      border-radius: 8px;
    }

    .test-buttons {
      display: flex;
      gap: 12px;

      .test-btn {
        flex: 1;
        height: 40px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
      }
    }
  }
}

// 文档内容样式
.docs-content {
  .docs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .doc-card {
    text-align: center;
    padding: 24px 16px;
    border-radius: 12px;
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;

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

    .doc-icon {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background: #f0f8ff;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 16px;
      font-size: 24px;
      color: #1890ff;
    }

    h4 {
      margin: 0 0 8px 0;
      font-size: 16px;
      font-weight: 600;
      color: #333;
    }

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

// 代码内容样式
.code-content {
  .language-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;

    .lang-tab {
      padding: 8px 16px;
      border: 1px solid #d9d9d9;
      background: white;
      border-radius: 6px;
      font-size: 14px;
      color: #666;
      cursor: pointer;
      transition: all 0.2s ease;
      white-space: nowrap;

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

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

  .code-block {
    position: relative;
    background: #f6f8fa;
    border-radius: 8px;
    border: 1px solid #e1e4e8;
    overflow: hidden;

    .code {
      margin: 0;
      padding: 16px;
      font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
      font-size: 13px;
      line-height: 1.5;
      color: #24292e;
      overflow-x: auto;
      white-space: pre-wrap;
      word-break: break-all;
    }

    .copy-code-btn {
      position: absolute;
      top: 8px;
      right: 8px;
      height: 32px;
      padding: 0 12px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 12px;
    }
  }
}

// PC端样式覆盖
.plan-api-modal {
  .plan-api-dialog {
    border-radius: 12px;
    height: auto;
    max-height: 80vh;
  }

  .nav-tabs {
    .nav-tab {
      min-width: 100px;
      padding: 16px 12px;
      font-size: 15px;

      svg {
        font-size: 18px;
      }
    }
  }

  .dialog-content {
    padding: 24px;
  }

  .params-grid {
    grid-template-columns: 1fr 1fr;
  }

  .docs-grid {
    grid-template-columns: 1fr 1fr;
  }

  .test-buttons {
    flex-direction: row;
  }
}

// 响应式设计
@media (max-width: 768px) {
  .plan-api-dialog {
    .header-content {
      h3 {
        font-size: 16px;
      }

      p {
        font-size: 13px;
      }
    }
  }

  .nav-tabs {
    .nav-tab {
      font-size: 13px;
      padding: 10px 6px;

      svg {
        font-size: 14px;
      }
    }
  }

  .dialog-content {
    padding: 16px;
  }

  .config-content {
    .params-grid {
      grid-template-columns: 1fr;
      gap: 8px;
    }
  }

  .docs-content {
    .docs-grid {
      grid-template-columns: 1fr;
      gap: 12px;
    }
  }

  .test-content {
    .test-buttons {
      flex-direction: column;
      gap: 8px;
    }
  }

  .code-content {
    .language-tabs {
      .lang-tab {
        padding: 6px 12px;
        font-size: 13px;
      }
    }

    .code-block {
      .code {
        font-size: 12px;
        padding: 12px;
      }
    }
  }
}

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

    .dialog-header {
      background: #262626;
      border-bottom-color: #434343;

      .header-content {
        h3 {
          color: #fff;
        }

        p {
          color: #a6a6a6;
        }
      }
    }

    .nav-tabs {
      background: #262626;
      border-bottom-color: #434343;

      .nav-tab {
        color: #a6a6a6;

        &:hover {
          color: #1890ff;
        }

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

    .dialog-footer {
      background: #262626;
      border-top-color: #434343;

      .security-note {
        color: #a6a6a6;
      }
    }
  }

  .config-content {
    .section-title {
      color: #fff;
    }

    .security-tip {
      background: #2a1f00;
      border-color: #d48806;
      color: #ffc53d;
    }

    .param-section {
      background: #262626;
      border-color: #434343;

      h4 {
        color: #fff;
      }

      .param-list {
        color: #a6a6a6;

        code {
          background: #434343;
        }
      }
    }
  }

  .test-content {
    h3 {
      color: #fff;
    }
  }

  .docs-content {
    .doc-card {
      background: #262626;
      border-color: #434343;

      h4 {
        color: #fff;
      }

      p {
        color: #a6a6a6;
      }
    }
  }

  .code-content {
    .code-block {
      background: #0d1117;
      border-color: #30363d;

      .code {
        color: #c9d1d9;
      }
    }
  }
}
