/* 全局样式重置和基础设置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
  padding: 20px;
}

/* 容器样式 */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

/* 表单行样式 */
.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
  padding: 5px 0;
  border-bottom: 1px solid #eee;
}

.form-row:last-child {
  border-bottom: none;
}

.form-row label {
  flex: 1;
  min-width: 120px;
  font-weight: 600;
  color: #444;
  margin-right: 15px;
}

.form-row input,
.form-row select {
  flex: 2;
  min-width: 200px;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: #4d90fe;
  box-shadow: 0 0 0 2px rgba(77, 144, 254, 0.2);
}

.form-row input[readonly] {
  background-color: #f8f9fa;
  color: #666;
}

/* 特殊输入框样式 */
input[type="number"],
input[type="text"] {
  border: 1px solid #ddd;
  width: 100%;
  padding: 12px 15px;
  border-radius: 6px;
  font-size: 16px;
}

/* 购置税区域样式 */
.tax-section {
  border: 1px solid #e1e8ed;
  border-radius: 8px;
  padding: 15px;
  margin-top: 5px;
  background-color: #fafbfc;
}

.tax-toggle {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.tax-toggle input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-right: 10px;
  accent-color: #3498db;
}

.tax-toggle label {
  font-weight: normal;
  margin-bottom: 0;
  color: #34495e;
}

/* 单选按钮容器 */
.vertical-type {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 0;
}

#downPaymentOptions {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

#downPaymentOptions label {
  display: flex;
  align-items: center;
  font-weight: normal;
  cursor: pointer;
}

#downPaymentOptions input[type="radio"] {
  margin-right: 5px;
  transform: scale(1.2);
}

/* 按钮容器 */
.button-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  width: 100%;
  margin-top: 10px;
  margin-bottom: 10px;
}

.form-row button {
  flex: 1;
  min-width: 120px;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-row button:first-child {
  background-color: #f1f1f1;
  color: #333;
}

.form-row button:first-child:hover {
  background-color: #e0e0e0;
}

.form-row button:last-child {
  background-color: #4d90fe;
  color: white;
}

.form-row button:last-child:hover {
  background-color: #3a7de0;
}

/* 分隔线 */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, #ddd, transparent);
  margin: 20px 0;
}

/* 复选框样式 */
#auto-calculate-tax {
  margin: 0 8px 0 15px;
  transform: scale(1.2);
  cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .container {
    padding: 15px;
    border-radius: 8px;
  }

  .form-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 0;
  }

  .form-row label {
    margin-bottom: 8px;
    min-width: auto;
  }

  .form-row input,
  .form-row select {
    min-width: 100%;
    width: 100%;
  }

  .vertical-type {
    flex-direction: column;
    align-items: flex-start;
  }

  #downPaymentOptions {
    margin-top: 10px;
  }

  .button-container {
    flex-direction: column;
  }

  .form-row button {
    width: 100%;
  }

  html {
    font-size: 15px;
  }
  
  .tax-section {
    padding: 12px;
    width: 100%;
  }
  
  /* 修复移动端购置税区域布局 */
  .tax-toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 15px;
  }
  
  .tax-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    margin-bottom: 10px;
    accent-color: #3498db;
  }
  
  .tax-toggle label {
    font-weight: normal;
    margin-bottom: 0;
    color: #34495e;
  }
}

@media (max-width: 480px) {
  body {
    padding: 8px;
  }
  
  .container {
    padding: 12px;
  }

  .form-row {
    margin-bottom: 15px;
  }

  .form-row input,
  .form-row select {
    padding: 10px 12px;
  }

  .form-row button {
    padding: 12px;
  }

  html {
    font-size: 14px;
  }
  
  .tax-section {
    padding: 10px;
    width: 100%;
  }
  
  /* 修复移动端购置税区域布局 */
  .tax-toggle {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 15px;
  }
  
  .tax-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    margin-bottom: 10px;
    accent-color: #3498db;
  }
  
  .tax-toggle label {
    font-weight: normal;
    margin-bottom: 0;
    color: #34495e;
  }
}

/* 只读字段样式 */
input[readonly] {
  background-color: #f8f9fa;
  cursor: not-allowed;
}

/* 必填项标记 */
.required {
  color: #e74c3c;
  margin-left: 5px;
}

/* 下拉菜单样式 */
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1em;
}

/* 聚焦效果 */
.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: #4d90fe;
  box-shadow: 0 0 0 3px rgba(77, 144, 254, 0.2);
}

/* 表单标题样式 */
.red-text {
  color: #e74c3c;
}