/* ===== 基础 ===== */
:root {
  --green: #07c160;
  --green-dark: #06ad56;
  --text: #1a1a1a;
  --text-sub: #666;
  --text-placeholder: #b2b2b2;
  --line: #ededed;
  --bg-gray: #f5f5f5;
  --link: #576b95;
  --danger: #f0483e;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  background: #fff;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ===== 通用按钮 ===== */
.btn-primary {
  display: block;
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 4px;
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: background-color .15s;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:active { background: #059c4e; }
.btn-primary:disabled { background: #9ee0b8; cursor: not-allowed; }

/* ===================================================================
   页面 1：投诉原因选择页
   =================================================================== */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-header {
  padding: 12px 20px;
  background: var(--bg-gray);
  border-bottom: 1px solid #e5e5e5;
  color: var(--text-sub);
  font-size: 13px;
}

.reason-list {
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
}

.reason-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: background-color .12s;
}
.reason-item:hover { background: #fafafa; }
.reason-item:active { background: #f2f2f2; }

.arrow {
  width: 16px;
  height: 16px;
  flex: none;
  color: #c8c8c8;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-body {
  flex: 1;
  min-height: 340px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 84px;
  background: var(--bg-gray);
}

.notice-link {
  color: var(--link);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ===================================================================
   弹窗
   =================================================================== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-mask[hidden] { display: none; }

.modal {
  width: 320px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
  animation: modal-in .18s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.modal-body { padding: 18px 18px 6px; }

.notice-list {
  margin: 0;
  padding-left: 18px;
  color: #333;
  font-size: 13px;
  line-height: 1.7;
}
.notice-list li { margin-bottom: 4px; }

.modal-footer {
  padding: 12px 14px 14px;
}
.modal-footer .btn-primary {
  height: 40px;
  font-size: 14px;
  border-radius: 4px;
}

/* ===================================================================
   页面 2：投诉填写表单页
   =================================================================== */
.form-page {
  min-height: 100vh;
  background: var(--bg-gray);
  display: flex;
  flex-direction: column;
}

.form-header {
  padding: 12px 20px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  color: var(--text-sub);
  font-size: 13px;
}
.form-header .reason-text { color: var(--text); }

.form-wrap {
  flex: 1;
  background: #fff;
  padding-bottom: 24px;
}

.form-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.form-item:last-of-type { border-bottom: 1px solid var(--line); }

.form-label {
  display: block;
  color: var(--text-sub);
  font-size: 13px;
  margin-bottom: 6px;
}

.form-input,
.form-textarea {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  padding: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-placeholder); }

.form-textarea {
  min-height: 96px;
  resize: vertical;
}

.form-item.has-error .form-input { color: var(--danger); }
.form-error {
  display: none;
  margin-top: 6px;
  color: var(--danger);
  font-size: 12px;
}
.form-item.has-error .form-error { display: block; }

/* 图片上传 */
.uploader {
  border: 1px dashed #c4ccd6;
  border-radius: 6px;
  background: #fafbfc;
}

.upload-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 100px;
  cursor: pointer;
  /* 原来用 --text-placeholder(#b2b2b2)，与白底对比度仅约 2:1，中老年用户看不清 */
  color: #555;
  font-size: 14px;
  font-weight: 500;
}
.upload-trigger:hover { background: #f1f6f3; }

.upload-plus {
  width: 30px;
  height: 30px;
  border: 2px solid #93a3b3;
  border-radius: 50%;
  position: relative;
}
.upload-plus::before,
.upload-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #93a3b3;
  transform: translate(-50%, -50%);
}
.upload-plus::before { width: 13px; height: 2px; }
.upload-plus::after  { width: 2px;  height: 13px; }

.thumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 12px 12px;
}
.thumb-list:empty { padding: 0; }

.thumb {
  position: relative;
  width: 88px;
  height: 88px;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: #fafafa;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.thumb-remove:hover { background: rgba(0, 0, 0, .75); }

.form-footer {
  padding: 18px 20px 8px;
  background: var(--bg-gray);
}
.form-footer .btn-primary { border-radius: 4px; }

/* ===================================================================
   Toast
   =================================================================== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 460px;
  padding: 12px 24px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  z-index: 999;
  animation: toast-in .2s ease-out;
}
.toast.is-error { background: rgba(216, 58, 48, .92); }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.94); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ===================================================================
   移动端适配（≤ 768px 生效，PC 端样式完全不受影响）
   =================================================================== */
@media (max-width: 768px) {
  /* 页面 1：投诉原因选择页 */
  .page-header {
    padding: 12px 16px;
    font-size: 14px;
  }

  .reason-item {
    padding: 16px;
    font-size: 16px;
  }
  .arrow {
    width: 18px;
    height: 18px;
  }

  .page-body {
    min-height: 260px;
    padding: 56px 16px 40px;
  }
  .notice-link { font-size: 14px; }

  /* 页面 2：投诉填写表单页 */
  .form-header {
    padding: 12px 16px;
    font-size: 14px;
  }
  .form-item { padding: 14px 16px; }
  .form-label {
    font-size: 14px;
    margin-bottom: 8px;
  }
  .form-input,
  .form-textarea {
    /* 16px：避免 iOS 聚焦输入框时自动放大整个页面 */
    font-size: 16px;
  }
  .form-textarea { min-height: 120px; }
  .form-error { font-size: 13px; }
  .form-footer {
    padding: 16px 16px 10px;
    /* 适配 iPhone 底部横条，避免提交按钮被遮挡 */
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .btn-primary {
    height: 48px;
    font-size: 16px;
  }

  /* 图片上传：加大字号与加号图标、加深文字，便于中老年用户辨认 */
  .uploader { border-width: 1.5px; }
  .upload-trigger {
    min-height: 124px;
    font-size: 17px;
    color: #333;
  }
  .upload-plus {
    width: 40px;
    height: 40px;
    border-width: 2.5px;
    border-color: var(--green-dark);
  }
  .upload-plus::before { width: 18px; height: 2.5px; background: var(--green-dark); }
  .upload-plus::after  { width: 2.5px;  height: 18px; background: var(--green-dark); }
  .thumb-list {
    gap: 8px;
    padding: 0 10px 10px;
  }
  .thumb {
    width: 80px;
    height: 80px;
  }

  /* 弹窗 */
  .modal {
    width: calc(100vw - 48px);
    max-width: 340px;
  }
  .notice-list {
    font-size: 14px;
    line-height: 1.8;
  }
  .modal-footer .btn-primary {
    height: 44px;
    font-size: 15px;
  }

  /* Toast：手机上放大字号与内边距，保证一眼看清 */
  .toast {
    max-width: calc(100vw - 40px);
    padding: 15px 26px;
    font-size: 17px;
  }
}
