:root {
  --green: #07c160;
  --green-dark: #06ad56;
  --text: #111;
  --text-2: #555;
  --text-3: #999;
  --line: #f0f0f0;
  --line-2: #e5e5e5;
  --bg: #f4f5f6;
  --danger: #e5484d;
  --blue: #3b82f6;
  --amber: #f59e0b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #fff;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ================= 前台页面 ================= */
.page {
  width: 100%;
  margin: 0;
  background: #fff;
  min-height: 100vh;
  padding-bottom: 4px;
  display: flex;
  flex-direction: column;
}

.block {
  padding: 13px 16px;
  border-bottom: 8px solid #fafafa;
}

.block:last-of-type { border-bottom: 0; }

.field-label {
  display: block;
  font-size: 14px;
  color: #666;
  margin: 0 0 8px;
  line-height: 1.4;
}

.req { color: var(--danger); }

.input-row {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  transition: border-color 0.15s;
}

.input-row:focus-within { border-color: var(--green); }

.input-row input {
  flex: 1;
  border: 0;
  outline: 0;
  height: 44px;
  font-size: 15px;
  background: transparent;
  color: var(--text);
  min-width: 0;
}

textarea {
  width: 100%;
  min-height: 88px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  outline: none;
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s;
}

textarea:focus { border-color: var(--green); }

.counter {
  text-align: right;
  font-size: 12px;
  color: #b0b0b0;
  margin-top: 6px;
}

.hint {
  display: none;
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--danger);
}

.hint.show { display: block; }

/* 第一步：选择投诉原因（参考站列表样式） */
.step[hidden] { display: none; }

.page-footer {
  padding: 22px 16px calc(26px + env(safe-area-inset-bottom));
  text-align: center;
}

.notice-link {
  border: 0;
  background: none;
  padding: 0;
  font-size: 13px;
  color: #c0c0c0;
  cursor: pointer;
}

.step-tip {
  margin: 0;
  padding: 12px 16px 8px;
  font-size: 14px;
  color: #8a8a8a;
}

.reason-list {
  border-top: 1px solid var(--line);
}

.reason-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}

.reason-item:active { background: #fafafa; }
.reason-item:last-child { border-bottom: 0; }

.reason-text { flex: 1; }

.chevron {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-right: 2px;
  border-top: 1.5px solid #bdbdbd;
  border-right: 1.5px solid #bdbdbd;
  transform: rotate(45deg);
}

/* 上传 */
.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 78px);
  gap: 8px;
}

.upload-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #f2f2f2;
}

.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.upload-thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-add {
  aspect-ratio: 1 / 1;
  border: 1px dashed #cfcfcf;
  border-radius: 10px;
  background: #fafafa;
  color: #999;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.15s;
}

.upload-add:active { background: #f2f2f2; }

.upload-plus {
  font-size: 20px;
  line-height: 1;
  font-weight: 300;
  color: #bbb;
}

/* 提交 */
.submit-bar {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  background: #fff;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  z-index: 10;
}

.btn-primary {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 24px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:active { background: var(--green-dark); }

.btn-primary:disabled {
  background: #c9c9c9;
  cursor: not-allowed;
}

.agreement {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  color: #b8b8b8;
}

/* ================= 通用：弹窗 / Toast ================= */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal-mask[hidden] { display: none; }

.modal-card {
  width: 100%;
  max-width: 340px;
  background: #fff;
  border-radius: 16px;
  padding: 26px 22px 20px;
  text-align: center;
  animation: pop 0.2s ease-out;
}

@keyframes pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.success-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(7, 193, 96, 0.12);
  color: var(--green);
  font-size: 26px;
  line-height: 52px;
  margin: 0 auto 12px;
}

.modal-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.modal-desc {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.6;
}

.ticket-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #f7f8f8;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin-bottom: 18px;
}

.ticket-box span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-box button {
  flex: 0 0 auto;
  border: 1px solid var(--green);
  color: var(--green);
  background: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.modal-notice { text-align: left; }

.modal-notice h2 {
  font-size: 17px;
  margin: 0 0 12px;
  text-align: center;
}

.notice-body {
  max-height: 52vh;
  overflow: auto;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.75;
  color: #666;
}

.notice-body p { margin: 0 0 8px; }

.notice-list {
  margin: 0 0 8px;
  padding-left: 18px;
}

.notice-list li { margin-bottom: 6px; }

.notice-footer {
  margin-top: 6px;
  font-size: 12px;
  color: #aaa;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions button {
  flex: 1;
  height: 42px;
  border-radius: 21px;
  font-size: 15px;
}

.btn-ghost {
  border: 1px solid var(--line-2);
  background: #fff;
  color: #666;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  padding: 9px 16px;
  border-radius: 8px;
  max-width: 80vw;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
