/* 
***********************************************************************
[A] 页面整体与标题排版
***********************************************************************
*/
body {
  margin: 0;
  padding: 0;
  font-family: "Microsoft YaHei", "宋体", sans-serif;
  background: #f7f7f7;
  padding-bottom: 65px;
}

/* 认证容器样式 */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-box {
  background: #fff;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  width: 400px;
}

.auth-box h2 {
  text-align: center;
  margin-bottom: 30px;
  color: #333;
}

.auth-box input[type="text"],
.auth-box input[type="password"] {
  width: 100%;
  padding: 12px;
  margin: 8px 0;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-sizing: border-box;
}

.auth-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
}

.auth-buttons button {
  padding: 12px 30px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
}

.auth-buttons button[type="submit"] {
  background: #667eea;
  color: white;
}

.auth-buttons button[type="submit"]:hover {
  background: #5a67d8;
}

.auth-buttons button[type="button"] {
  background: #f7f7f7;
  color: #333;
}

.auth-buttons button[type="button"]:hover {
  background: #e2e2e2;
}

.auth-message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 5px;
  text-align: center;
}

.auth-message.error {
  background: #fee;
  color: #c33;
}

.auth-message.success {
  background: #efe;
  color: #3c3;
}

/* 顶部工具栏 */
.top-toolbar {
  background: #333;
  color: white;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.top-toolbar button {
  background: #666;
  color: white;
  border: none;
  padding: 5px 15px;
  border-radius: 3px;
  cursor: pointer;
}

.top-toolbar button:hover {
  background: #888;
}

/* 标题样式 */
.title-line1 {
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  margin-top: 30px;
}

.title-line2 {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 30px;
}

/* 通用按钮样式 */
button {
  cursor: pointer;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  transition: background 0.3s, color 0.3s;
}

button:hover {
  background: #409eff;
  color: #fff;
}

/*
***********************************************************************
[B] fieldset 与 legend 的全局美化
***********************************************************************
*/
fieldset {
  width: 50%;
  margin: 20px auto;
  padding: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

@media screen and (max-width: 1000px) {
  fieldset {
    width: 90%;
    margin: 15px auto;
    padding: 12px;
  }
}

legend {
  font-weight: bold;
  font-size: 16px;
  text-align: left;
  padding: 0 6px;
  margin-bottom: 8px;
  color: #333;
}

/*
***********************************************************************
[C] 通用 label + 输入框样式
***********************************************************************
*/
label {
  display: inline-block;
  width: 150px;
  vertical-align: top;
  margin: 4px 0;
}

input[type="text"], input[type="number"], input[type="date"], textarea, select {
  width: 300px;
  max-width: 100%;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #409eff;
}

p {
  line-height: 1.6;
  margin: 8px 0;
}

/*
***********************************************************************
[D] 分组、按钮、对齐等局部样式
***********************************************************************
*/
.radio-group, .checkbox-group {
  margin-bottom: 8px;
}

.address-input-wrapper {
  position: relative;
  display: inline-block;
  width: 300px;
}

.address-icon, .search-icon {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-weight: bold;
  display: none;
  color: #333;
}

.address-input-wrapper:hover .address-icon,
.address-input-wrapper:hover .search-icon {
  display: inline;
}

button + button {
  margin-left: 10px;
}

/*
***********************************************************************
[E] 当事人容器
***********************************************************************
*/
.party-container {
  border: 1px dashed #ccc;
  margin: 10px 0;
  padding: 10px;
  border-radius: 4px;
  background: #fafafa;
}

.remove-btn {
  margin-left: 150px;
  margin-bottom: 10px;
  background: #ffeeee;
  border-color: #ffcccc;
  color: #d33;
}

.remove-btn:hover {
  background: #ffcccc;
  color: #fff;
}

.individual-fields, .org-fields {
  display: none;
}

.guoyou-sub {
  display: none;
  margin-left: 10px;
}

.guoyou-sub label {
  margin-right: 15px;
}

/*
***********************************************************************
[F] 代理人容器
***********************************************************************
*/
.agent-container {
  border: 1px dashed #ccc;
  margin: 10px 0;
  padding: 10px;
  border-radius: 4px;
  background: #fafafa;
}

.agent-details {
  display: none;
}

/*
***********************************************************************
[G] 模态框样式
***********************************************************************
*/
.modal-overlay {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
}

.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  z-index: 999;
  min-width: 400px;
  max-width: 80%;
  max-height: 80vh;
  overflow: auto;
}

.modal h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: #333;
}

.modal-content table {
  width: 100%;
  border-collapse: collapse;
}

.modal-content th,
.modal-content td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

.modal-content th {
  background: #f7f7f7;
  font-weight: bold;
}

/*
***********************************************************************
[H] 特殊字段显示控制
***********************************************************************
*/
#electronicFields,
#terminateDateFields,
#prePreservationDetail,
#arbitrationDetail,
#guaranteeFields,
#costFields,
#accelerationDetail,
#recycleDetail,
#terminateClauseDetail,
#flawDetail12,
#mortgageDetail15,
#maxMortgageDetail17,
#registerMortgageDetail18,
#guaranteeDetail19,
#otherGuaranteeDetail21,
#installmentFields {
  display: none;
}

.electronic-group {
  display: inline-block;
  margin-right: 15px;
}

.electronic-group .detail-input {
  display: none;
  margin-left: 5px;
}

.electronic-group label {
  width: auto;
  margin: 0 3px 0 0;
  vertical-align: middle;
}

.payment-group {
  display: inline-block;
  margin-right: 15px;
  vertical-align: middle;
}

.payment-group .detail-input {
  display: none;
  margin-left: 5px;
}

.payment-group label {
  width: auto;
  margin: 0 3px 0 0;
  vertical-align: middle;
}

/*
***********************************************************************
[I] 文件上传样式
***********************************************************************
*/
.upload-box {
  position: relative;
  display: inline-block;
  padding: 8px 12px;
  color: #666;
  background-color: #fff;
  border: 2px dashed #ccc;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s;
  text-align: center;
  font-size: 14px;
  width: 310px;
  max-width: 100%;
}

.upload-box:hover {
  background-color: #f0f8ff;
  border-color: #409eff;
}

.upload-box input[type="file"] {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-box .upload-text {
  display: inline-block;
  vertical-align: middle;
  line-height: 1.4;
  pointer-events: none;
}

/*
***********************************************************************
[J] 底部固定按钮栏
***********************************************************************
*/
.bottom-fixed-fieldset {
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 -1px 4px rgba(0,0,0,0.15);
  position: fixed;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  width: 50%;
  height: 20px;
  z-index: 998;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media screen and (max-width:1000px) {
  .bottom-fixed-fieldset {
    width: 100%;
    bottom: 0px;
  }
}

.bottom-fixed-fieldset button {
  margin: 0 10px;
}

/* 担保责任输入框 */
.guarantee-input-wrapper {
  position: relative;
  width: 50%;
  display: inline-block;
}

.guarantee-input-wrapper textarea {
  width: 100%;
}

.guarantee-input-wrapper #insertGuaranteeBtn {
  position: absolute;
  top: -10px;
  right: -20px;
  font-size: 1em;
  cursor: pointer;
  display: none;
}

.guarantee-input-wrapper:hover #insertGuaranteeBtn {
  display: inline;
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 消息提示 */
.message {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

.message.success {
  background: #52c41a;
  color: white;
}

.message.error {
  background: #f5222d;
  color: white;
}

.message.info {
  background: #1890ff;
  color: white;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}