<template>
  <div class="settings-page">
    <div class="settings-section">
      <h4>连接设置</h4>
      <div class="setting-item">
        <label>服务器地址</label>
        <input type="text" :placeholder="serverConfig.HOST" class="setting-input">
      </div>
      <div class="setting-item">
        <label>端口号</label>
        <input type="number" :placeholder="serverConfig.PORT" class="setting-input">
      </div>
    </div>

    <div class="settings-actions">
      <BaseButton type="primary">保存配置</BaseButton>
      <BaseButton type="secondary">重置默认</BaseButton>
    </div>
  </div>
</template>

<script setup>
import { getDefaultServerConfig } from '@/config/cad'
import BaseButton from '@/components/ui/BaseButton.vue'

const serverConfig = getDefaultServerConfig()
</script>

<script>
export default {
  name: 'SettingsPage'
}
</script>

<style scoped>
.settings-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 24px;
  padding: 24px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-section h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-item label {
  font-size: 14px;
  color: var(--color-text-secondary);
}

.setting-input {
  padding: 10px 12px;
  background: var(--color-white-rgb-05);
  border: 1px solid var(--color-white-rgb-1);
  border-radius: 6px;
  color: var(--color-text-primary);
  font-size: 14px;
}

.setting-input:focus {
  outline: none;
  border-color: var(--color-border-active);
  box-shadow: 0 0 0 3px var(--color-primary-rgb);
}

.settings-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
}
</style>
