/* 我要写信页面样式 */

.writeletter-container {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  margin-bottom: 20px;
  background-color: #ffffff;
  justify-content: center;
}

.writeletter-main {
  flex: 1;
  max-width: 913px;
}

.form-wrapper {
  width: 100%;
  border: 1px solid #51b9ff;
  background: #fff;
}

.form-header {
  height: 52px;
  line-height: 52px;
  background-color: #eeeeee;
  padding-left: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-title {
  font-size: 16px;
  color: #333333;
  font-weight: normal;
}

.form-content {
  padding: 5px 0;
}

/* 表单行布局 */
.form-row {
  display: table;
  width: 100%;
  margin: 0 auto 2px;
  border-collapse: collapse;
}

/* 两列布局的表单行 */
.form-row .form-label:nth-child(3) {
  width: 12%;
}

.form-row .form-input:nth-child(4) {
  width: 43%;
}

.form-label {
  display: table-cell;
  width: 13%;
  min-width: 100px;
  text-align: center;
  background-color: #95d5ff;
  color: #333;
  font-size: 14px;
  padding: 10px 5px;
  vertical-align: middle;
}

.form-input {
  display: table-cell;
  padding: 10px 15px;
  vertical-align: middle;
  background-color: #ffffff;
  text-align: left;
}

.form-input input[type="text"] {
  width: auto;
  max-width: 300px;
  width: 200px;
  height: 28px;
  line-height: 28px;
  padding: 0 8px;
  border: 1px solid #ccc;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
#address,
#title {
  width: 604px;
  max-width: 650px;
}
.form-input input[type="text"]:focus {
  border-color: #51b9ff;
}

.form-input input[readonly] {
  background-color: #f5f5f5;
}

.form-input textarea {
  width: 604px;
  height: auto;
  padding: 8px;
  border: 1px solid #ccc;
  font-size: 14px;
  font-family: "Microsoft YaHei", "SimSun", sans-serif;
  resize: vertical;
  outline: none;
  color: #666666;
  box-sizing: border-box;
}

.form-input textarea:focus {
  border-color: #51b9ff;
}

/* 信件类别 */
.category-group {
  display: flex;
  gap: 0;
  align-items: center;
  flex-wrap: wrap;
}

.category-item {
  display: inline-block;
  cursor: pointer;
  margin-right: 0;
  position: relative;
}

.category-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.category-item img {
  display: block;
  width: 50px;
  height: 20px;
  opacity: 0.6;
  transition: opacity 0.2s;
  vertical-align: middle;
}

.category-item input[type="radio"]:checked ~ img {
  opacity: 1;
}

.category-item:hover img {
  opacity: 0.9;
}

/* 信件类别（从接口动态加载的样式） */
#letterTypeContainer input[type="radio"] {
  margin-right: 5px;
  vertical-align: middle;
}

#letterTypeContainer label {
  margin-right: 15px;
  cursor: pointer;
  display: inline-block;
}

#letterTypeContainer label span {
  vertical-align: middle;
}

/* 按钮样式 */
.btn-send-code {
  margin-left: 10px;
  padding: 6px 12px;
  background-color: #fff;
  color: #333;
  border: 1px solid #ccc;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.btn-send-code:hover {
  background-color: #51b9ff;
  color: #fff;
  border-color: #51b9ff;
}

.btn-send-code:disabled {
  background-color: #f5f5f5;
  color: #999;
  cursor: not-allowed;
}

.verify-tip {
  margin-left: 10px;
  color: #666;
  font-size: 13px;
}

/* 表单操作按钮 */
.form-actions {
  width: 96%;
  margin: 20px auto 0;
  text-align: center;
  padding: 20px 0 10px;
}

.form-actions hr {
  margin-bottom: 20px;
  border: none;
  border-top: 1px solid #e0e0e0;
}

.btn-primary,
.btn-secondary {
  width: 110px;
  height: 38px;
  margin: 0 10px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background-color: #51b9ff;
  color: #fff;
}

.btn-primary:hover {
  background-color: #3fa0e8;
}

.btn-secondary {
  background-color: #fff;
  color: #333;
  border: 1px solid #ccc;
}

.btn-secondary:hover {
  background-color: #f5f5f5;
}

/* 写信须知侧边栏 */
.writeletter-sidebar {
  width: 287px;
  background-color: #eeeeee;
  padding: 0;
}

.notice-box {
  padding: 15px;
}

.notice-box h3 {
  font-size: 14px;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
}

.notice-box hr {
  margin-bottom: 15px;
  border: none;
  border-top: 1px solid #ccc;
}

.notice-content {
  line-height: 200%;
  font-size: 14px;
  color: #333;
}

.notice-content p {
  margin-bottom: 10px;
  text-align: justify;
}

.notice-content .highlight {
  color: #ff0000;
}

/* 办理流程图 */
.process-banner {
  width: 100%;
  background: #fff;
  padding: 5px;
  border: 1px solid #51b9ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.process-icon {
  width: 50px;
  height: 117px;
  flex-shrink: 0;
}

.process-image {
  max-width: 1070px;
  height: auto;
  flex: 1;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .writeletter-container {
    flex-direction: column;
  }

  .writeletter-main {
    max-width: 100%;
  }

  .writeletter-sidebar {
    width: 100%;
  }

  .form-input input[type="text"] {
    width: 100%;
    max-width: 500px;
  }

  .form-input textarea {
    width: 100%;
    max-width: 700px;
  }
}

@media (max-width: 768px) {
  .layui-layer {
    top: 350px !important;
  }
  .p-content {
    width: 100% !important;
    padding: 0 10px;
    box-sizing: border-box;
  }

  .m-location {
    font-size: 12px;
    padding: 10px 5px;
    overflow-x: auto;
    white-space: nowrap;
  }

  .writeletter-container {
    gap: 15px;
    margin-top: 10px;
    margin-bottom: 10px;
  }

  .form-wrapper {
    border: 1px solid #51b9ff;
  }

  .form-header {
    height: 45px;
    line-height: 45px;
    padding-left: 15px;
  }

  .form-header img {
    width: 28px;
    height: 20px;
  }

  .form-title {
    font-size: 15px;
  }

  .form-content {
    padding: 0;
  }

  .form-row {
    display: block;
    margin-bottom: 0;
  }

  /* 重置两列布局为单列 */
  .form-row .form-label:nth-child(3),
  .form-row .form-input:nth-child(4) {
    width: 100%;
  }

  .form-label {
    display: block;
    width: 100% !important;
    text-align: left;
    padding: 10px 15px;
    min-width: auto;
    font-size: 13px;
  }

  .form-input {
    display: block;
    width: 100% !important;
    padding: 10px 15px;
    box-sizing: border-box;
  }

  .form-input input[type="text"] {
    width: 100% !important;
    max-width: 100% !important;
    height: 36px;
    line-height: 36px;
    font-size: 14px;
  }

  .form-input textarea {
    width: 100%;
    max-width: 100%;
    min-height: 150px;
    font-size: 14px;
  }

  #letterTypeContainer {
    display: block;
  }

  #letterTypeContainer label {
    display: block;
    margin-bottom: 10px;
    margin-right: 0;
  }

  .category-group {
    flex-wrap: wrap;
    gap: 10px;
  }

  .category-item {
    margin-bottom: 10px;
  }

  .btn-send-code {
    margin-left: 0;
    margin-top: 10px;
    width: 100%;
    padding: 8px 12px;
    height: 36px;
  }

  .verify-tip {
    display: block;
    margin-left: 0;
    margin-top: 8px;
    font-size: 12px;
  }

  #randImage {
    display: block;
    margin: 10px 0 !important;
    width: 120px;
    height: 40px !important;
  }

  .form-actions {
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
  }

  .btn-primary,
  .btn-secondary {
    width: 100%;
    max-width: 150px;
    height: 40px;
    margin: 5px;
    font-size: 15px;
  }

  .notice-box {
    padding: 15px;
  }

  .notice-box h3 {
    font-size: 15px;
  }

  .notice-content {
    font-size: 13px;
    line-height: 180%;
  }

  .process-banner {
    flex-direction: column;
    gap: 10px;
    padding: 10px;
  }

  .process-icon {
    width: 40px;
    height: auto;
  }

  .process-image {
    width: 100%;
    max-width: 100%;
  }
}
