/* 论文辅导表单样式 */

@import url("./thesis-tutoring-responsive.css");

:root {
  --primary-color: #3385ff;
  --secondary-color: #f8cf99;
  --text-color: #333;
  --light-text: #666;
  --border-color: #e0e0e0;
  --error-color: #fe4545;
  --success-color: #42b983;
  --bg-color: #f4f7fa;
  --white: #fff;
  --input-bg: rgba(153, 153, 153, 0.05);
  --box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
.site-header {
  margin-bottom: 0;
}
.site-content {
  padding-bottom: 0;
}

/* 基础布局 */
.flex-row {
  display: flex;
  flex-direction: row;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.justify-start {
  justify-content: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-end {
  justify-content: flex-end;
}

.justify-between {
  justify-content: space-between;
}

.align-center {
  align-items: center;
}

.align-start {
  align-items: flex-start;
}

/* 表单容器 */
.thesis-form-container {
  width: 100%;
  background-color: var(--bg-color);
}

.thesis-form-header {
  width: 100%;
  height: 120px;
  overflow: hidden;
}

.thesis-form-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thesis-form-wrapper {
  max-width: 1280px;
  margin: 0 auto;
}

.thesis-form-section {
  margin-top: 40px;
}

.thesis-form-section-title {
  width: 100%;
  height: 31px;
  margin-bottom: 36px;
}

.thesis-form-section-title img {
  height: 100%;
}

.thesis-form-content {
  background-color: var(--white);
  border-radius: 4px;
  padding: 30px;
  box-shadow: var(--box-shadow);
}

/* 表单项 */
.thesis-form-row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 25px;
}

.thesis-form-item {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  flex: 1;
  min-width: 300px;
  margin-right: 20px;
}

.thesis-form-item:last-child {
  margin-right: 0;
}

.thesis-form-label {
  width: 110px;
  min-width: 110px;
  text-align: right;
  padding-right: 10px;
  color: var(--text-color);
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  white-space: nowrap;
  flex-shrink: 0;
}

.thesis-form-required .thesis-form-label::before {
  content: "*";
  color: var(--error-color);
  margin-right: 4px;
}

.thesis-form-input-wrapper {
  flex: 1;
  position: relative;
}

.thesis-form-input {
  width: 100%;
  height: 50px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0 15px;
  font-size: 16px;
  color: var(--text-color);
  outline: none;
  transition: border-color 0.3s;
}

.thesis-form-input:focus {
  border-color: var(--primary-color);
}

.thesis-form-input::placeholder {
  color: #ccc;
}

/* 手机号输入框样式 */
.thesis-form-phone-wrapper {
  display: flex;
  align-items: center;
}

.thesis-form-phone-wrapper .thesis-form-phone-code {
  width: 120px !important;
  margin-right: 10px;
  flex-shrink: 0;
}

.thesis-form-phone-input {
  flex: 1;
}

/* 自定义下拉框样式 */
.thesis-form-dropdown {
  position: relative;
  width: 100%;
}

.thesis-form-dropdown-selected {
  width: 100%;
  height: 50px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.3s;
}

.thesis-form-dropdown-selected:hover {
  border-color: var(--primary-color);
  background-color: rgba(51, 133, 255, 0.05);
}

.thesis-form-dropdown-selected.active {
  border-color: var(--primary-color);
  background-color: rgba(51, 133, 255, 0.05);
}

.thesis-form-dropdown-selected span {
  color: #ccc;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 25px);
}

.thesis-form-dropdown-selected span.has-value {
  color: var(--text-color);
}

.thesis-form-dropdown-icon {
  width: 16px;
  height: 10px;
  transition: transform 0.3s;
  flex-shrink: 0;
}

.thesis-form-dropdown.active .thesis-form-dropdown-icon {
  transform: rotate(180deg);
}

.thesis-form-dropdown-menu {
  position: absolute;
  top: 52px;
  left: 0;
  width: 100%;
  max-height: 240px;
  background-color: var(--white);
  border-radius: 4px;
  box-shadow: var(--box-shadow);
  z-index: 100;
  overflow-y: auto;
  display: none;
}

.thesis-form-dropdown.active .thesis-form-dropdown-menu {
  display: block;
}

/* 对于特殊的手机区号下拉菜单，调整位置和宽度 */
.thesis-form-phone-code .thesis-form-dropdown-menu {
  min-width: 120px;
  max-height: 200px;
  overflow-y: auto;
}

/* 论文计划时间标签特殊处理 */
.thesis-form-label.plan-time-label {
  width: 130px;
  min-width: 130px;
}

/* 针对论文计划时间的特殊处理 */
.thesis-form-item:has(input[name="plan_time"]) .thesis-form-label {
  width: 130px;
  min-width: 130px;
}

.thesis-form-dropdown-item {
  padding: 12px 15px;
  font-size: 15px;
  color: var(--text-color);
  cursor: pointer;
  transition: background-color 0.2s;
}

.thesis-form-dropdown-item:hover {
  background-color: rgba(51, 133, 255, 0.1);
}

.thesis-form-dropdown-item.selected {
  background-color: rgba(51, 133, 255, 0.15);
  color: var(--primary-color);
}

/* 文本域样式 */
.thesis-form-textarea {
  width: 100%;
  height: 120px;
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 15px;
  font-size: 16px;
  color: var(--text-color);
  resize: none;
  outline: none;
  transition: border-color 0.3s;
}

.thesis-form-textarea:focus {
  border-color: var(--primary-color);
}

/* 复选框样式 */
.thesis-form-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.thesis-form-checkbox-wrapper {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.thesis-form-checkbox {
  position: relative;
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
  background-color: #fff;
}

.thesis-form-checkbox.checked {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.thesis-form-checkbox.checked::after {
  content: "";
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  position: absolute;
  top: 0;
}

.thesis-form-checkbox-label {
  font-size: 15px;
  color: var(--text-color);
}

.thesis-form-checkbox-wrapper:hover .thesis-form-checkbox {
  border-color: var(--primary-color);
}

.thesis-form-checkbox-wrapper:active .thesis-form-checkbox {
  background-color: rgba(51, 133, 255, 0.1);
}

/* 文件上传样式 */
.thesis-form-upload {
  display: flex;
  align-items: center;
  position: relative;
}

.thesis-form-upload-btn {
  width: 170px;
  height: 100px;
  background: rgba(51, 133, 255, 0.05);
  border: 1px dashed var(--border-color);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.3s;
  gap: 10px;
  position: relative;
}

.thesis-form-upload-btn:hover {
  border-color: var(--primary-color);
}

.thesis-form-upload-icon {
  width: 18px;
  height: 18px;
}

.thesis-form-upload-text {
  font-size: 14px;
  color: var(--light-text);
}

/* 文件名显示样式 */
.thesis-form-upload-filename {
  width: 90%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  color: var(--text-color);
  padding: 0 10px;
  max-width: 150px;
  margin: 0 auto;
}

/* 上传状态样式 */
.thesis-form-upload.has-file .thesis-form-upload-icon,
.thesis-form-upload.has-file .thesis-form-upload-text {
  display: none;
}

/* 删除按钮样式 */
.thesis-form-upload-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: red;
  font-size: 20px;
  transition: background-color 0.3s;
  z-index: 5;
}

/* 按钮样式 */
.thesis-form-actions {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 40px;
  margin-bottom: 40px;
}

.thesis-form-btn {
  height: 66px;
  padding: 20px 50px;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  outline: none;
}

.thesis-form-btn-back {
  background-color: #ffffff;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.thesis-form-btn-submit {
  background: var(--primary-color);
  color: #ffffff;
  width: 500px;
}

.thesis-form-btn-submit:hover {
  opacity: 0.9;
}
/* 对于特殊的手机区号下拉菜单，调整位置和宽度 */
.thesis-form-phone-code .thesis-form-dropdown-menu {
  min-width: 120px;
  max-height: 200px;
  overflow-y: auto;
}

/* 论文计划时间标签特殊处理 */
.thesis-form-label.plan-time-label {
  width: 130px;
  min-width: 130px;
}

/* 补充下拉框样式，确保显示正常 */
.thesis-form-dropdown-menu {
  position: absolute;
  top: 52px;
  left: 0;
  width: 100%;
  max-height: 240px;
  background-color: var(--white);
  border-radius: 4px;
  box-shadow: var(--box-shadow);
  z-index: 100;
  overflow-y: auto;
  display: none;
}

.thesis-form-dropdown.active .thesis-form-dropdown-menu {
  display: block;
}

/* 文件上传样式优化 */
.thesis-form-upload.has-file .thesis-form-upload-btn {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 1399px) {
  .thesis-form-wrapper {
    padding: 0 32px;
    box-sizing: border-box;
  }

  .thesis-form-section {
    margin-top: 32px;
  }

  .thesis-form-section-title {
    height: auto;
    margin-bottom: 28px;
  }

  .thesis-form-section-title img {
    /* width: 100%; */
    height: auto;
    object-fit: contain;
  }

  .thesis-form-content {
    padding: 28px;
  }

  .thesis-form-row {
    gap: 24px;
  }

  .thesis-form-item {
    flex: 1 1 calc(50% - 24px);
    min-width: 280px;
    margin-right: 0;
  }

  .thesis-form-checkbox-group {
    gap: 16px;
  }

  .thesis-form-btn-submit {
    width: 100%;
    max-width: 500px;
  }
}

@media (max-width: 1023px) {
  .thesis-form-wrapper {
    padding: 0 20px;
  }

  .thesis-form-content {
    padding: 24px;
  }

  .thesis-form-row {
    gap: 20px;
  }

  .thesis-form-item {
    flex: 1 1 100%;
    min-width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .thesis-form-label {
    width: 100%;
    min-width: auto;
    text-align: left;
    padding-right: 0;
  }

  .thesis-form-input,
  .thesis-form-dropdown-selected,
  .thesis-form-textarea {
    width: 100%;
  }

  .thesis-form-phone-wrapper {
    /* flex-direction: column; */
    align-items: stretch;
    gap: 10px;
  }

  .thesis-form-checkbox-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .thesis-form-upload {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .thesis-form-upload-btn {
    width: 100%;
    max-width: none;
  }

  .thesis-form-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    width: 80%;
    margin: 40px auto;
  }

  .thesis-form-btn {
    width: 100%;
  }
}

@media (max-width: 767px) {
  .thesis-form-input-wrapper {
    width: 100%;
  }
  .thesis-form-wrapper {
    padding: 0 16px;
  }

  .thesis-form-header {
    height: 90px;
  }

  .thesis-form-content {
    padding: 20px;
    border-radius: 8px;
  }

  .thesis-form-section-title {
    margin-bottom: 20px;
  }

  .thesis-form-btn {
    height: 56px;
    padding: 0 24px;
  }

  .thesis-form-btn-submit {
    max-width: none;
  }

  .thesis-form-upload-btn {
    height: 80px;
  }
}

@media (max-width: 479px) {
  .thesis-form-wrapper {
    padding: 0 12px;
  }

  .thesis-form-content {
    padding: 16px;
  }

  .thesis-form-row {
    gap: 16px;
  }

  .thesis-form-input,
  .thesis-form-textarea {
    font-size: 15px;
  }

  .thesis-form-dropdown-selected span,
  .thesis-form-checkbox-label {
    font-size: 15px;
  }

  .thesis-form-btn {
    font-size: 15px;
  }

  .thesis-form-phone-code .thesis-form-dropdown-menu {
    max-height: 160px;
  }
}
