/* 房贷计算器样式 */
.fd-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 20px;
}

.fd-input-panel,
.fd-result-panel {
  flex: 1;
  min-width: 360px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.fd-title {
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #1890ff;
  font-size: 20px;
  color: #333;
}

/* 表单行 */
.fd-form-row {
  margin-bottom: 16px;
}

.fd-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

/* 单选按钮组 */
.fd-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.fd-radio-label {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  transition: all 0.2s;
}

.fd-radio-label:hover {
  border-color: #1890ff;
  color: #1890ff;
}

.fd-radio-label input[type="radio"] {
  margin-right: 6px;
}

.fd-radio-label input[type="radio"]:checked + span,
.fd-radio-label:has(input:checked) {
  border-color: #1890ff;
  background-color: #e6f7ff;
  color: #1890ff;
}

/* 输入框 */
.fd-input-with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fd-input {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 14px;
  color: #333;
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}

.fd-input::-webkit-outer-spin-button,
.fd-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.fd-input:focus {
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.fd-select {
  flex: 1;
  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='%23999' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 32px;
}

.fd-unit {
  font-size: 14px;
  color: #888;
  white-space: nowrap;
}

/* 利率快捷按钮 */
.fd-rate-shortcuts {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fd-rate-btn {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  color: #1890ff;
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.fd-rate-btn:hover {
  background: #1890ff;
  color: #fff;
  text-decoration: none;
}

/* 组合贷款分区 */
.fd-comb-section {
  padding: 12px;
  margin-bottom: 12px;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
}

.fd-comb-title {
  margin: 0 0 12px 0;
  font-size: 15px;
  color: #1890ff;
  font-weight: 600;
}

/* 按钮组 */
.fd-btn-row {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.fd-btn {
  flex: 1;
  height: 40px;
  font-size: 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.fd-btn-primary {
  background: #1890ff;
  color: #fff;
}

.fd-btn-primary:hover {
  background: #40a9ff;
}

.fd-btn-primary:active {
  background: #096dd9;
}

.fd-btn-default {
  background: #fff;
  color: #666;
  border: 1px solid #d9d9d9;
}

.fd-btn-default:hover {
  color: #1890ff;
  border-color: #1890ff;
}

/* 结果概览 */
.fd-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.fd-summary-item {
  padding: 16px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
  border-radius: 6px;
  text-align: center;
}

.fd-summary-value {
  font-size: 24px;
  font-weight: 600;
  color: #1890ff;
  margin-bottom: 6px;
  font-family: Arial, sans-serif;
}

.fd-summary-label {
  font-size: 13px;
  color: #888;
}

/* 还款明细 */
.fd-detail-section {
  margin-top: 20px;
  border-top: 1px solid #f0f0f0;
  padding-top: 16px;
}

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

.fd-detail-header h4 {
  margin: 0;
  font-size: 15px;
  color: #333;
}

.fd-detail-tabs {
  display: flex;
  gap: 4px;
}

.fd-tab-btn {
  padding: 4px 12px;
  font-size: 13px;
  color: #666;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.fd-tab-btn:hover {
  color: #1890ff;
  border-color: #1890ff;
}

.fd-tab-btn.active {
  color: #fff;
  background: #1890ff;
  border-color: #1890ff;
}

/* 表格 */
.fd-table-wrapper {
  max-height: 480px;
  overflow-y: auto;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
}

.fd-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fd-result-table thead {
  position: sticky;
  top: 0;
  background: #fafafa;
  z-index: 1;
}

.fd-result-table th {
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  color: #555;
  border-bottom: 1px solid #e8e8e8;
}

.fd-result-table td {
  padding: 8px;
  text-align: center;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}

.fd-result-table tbody tr:hover {
  background: #f5f9ff;
}

.fd-result-table tbody tr:last-child td {
  border-bottom: none;
}

/* 响应式 */
@media (max-width: 768px) {
  .fd-container {
    flex-direction: column;
  }
  
  .fd-input-panel,
  .fd-result-panel {
    min-width: auto;
  }
  
  .fd-summary {
    grid-template-columns: 1fr 1fr;
  }
  
  .fd-summary-value {
    font-size: 20px;
  }
  
  .fd-radio-group {
    gap: 8px;
  }
  
  .fd-radio-label {
    padding: 4px 8px;
    font-size: 13px;
  }
  
  .fd-table-wrapper {
    overflow-x: auto;
  }
  
  .fd-result-table {
    min-width: 500px;
  }
}
