/* ==========================================================
   收费站信息反馈系统 —— 公共样式
   ========================================================== */
:root {
  --primary: #195cad;
  --primary-dark: #12457f;
  --primary-soft: #e9f1fb;
  --bg: #f2f5f9;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #059669;
  --success-soft: #ecfdf5;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  padding: 24px 14px 48px;
  min-height: 100vh;
}

/* ---------------------------------------------- 布局 */
.page { max-width: 640px; margin: 0 auto; }
.page-wide { max-width: 980px; margin: 0 auto; }

.page-head { text-align: center; margin-bottom: 22px; }
.page-head h1 {
  font-size: 22px;
  color: var(--primary);
  letter-spacing: .5px;
  font-weight: 700;
}
.page-head p {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 6px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

/* ---------------------------------------------- 表单 */
.field { margin-bottom: 18px; }

.field > label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 7px;
}
.field > label .req { color: var(--danger); margin-left: 2px; }

.input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.input:hover, select:hover, textarea:hover { border-color: #9ca3af; }

.input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(25, 92, 173, .13);
}

.input.invalid, textarea.invalid, select.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .1);
}

textarea { min-height: 150px; resize: vertical; line-height: 1.65; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%236b7280' d='M1.4.5 6 5.1 10.6.5 12 1.9 6 7.9 0 1.9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}

.field-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  min-height: 18px;
}

.hint { font-size: 12.5px; color: var(--muted); }
.hint.error { color: var(--danger); }
.counter { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.over { color: var(--danger); font-weight: 600; }

/* ---------------------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s, opacity .15s;
  white-space: nowrap;
  user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid rgba(25, 92, 173, .35); outline-offset: 1px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-ghost { background: #fff; color: #374151; border-color: #d1d5db; }
.btn-ghost:hover:not(:disabled) { background: #f9fafb; border-color: #9ca3af; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-soft-danger { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.btn-soft-danger:hover:not(:disabled) { background: #fee2e2; }

.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13.5px; border-radius: 7px; }

.btn-row { display: flex; gap: 12px; margin-top: 22px; }
.btn-row .btn { flex: 1; }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------- 提示条 */
.banner {
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.5px;
  margin-bottom: 16px;
  line-height: 1.55;
  border: 1px solid transparent;
}
.banner-warn { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.banner-error { background: var(--danger-soft); color: var(--danger); border-color: #fecaca; }
.banner-info { background: var(--primary-soft); color: var(--primary-dark); border-color: #c7ddf6; }
.banner-success { background: var(--success-soft); color: var(--success); border-color: #a7f3d0; }

/* ---------------------------------------------- 提示气泡 */
.toast-box {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
  pointer-events: none;
}
.toast {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  color: #fff;
  background: #374151;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  animation: toast-in .22s ease-out;
  transition: opacity .35s, transform .35s;
  max-width: 82vw;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-out { opacity: 0; transform: translateY(8px); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------- 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 900;
  animation: fade-in .15s ease-out;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
.modal h3 { font-size: 17px; margin-bottom: 10px; }
.modal p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions .btn { flex: 1; }

/* ---------------------------------------------- 后台顶栏 */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 20px;
  margin-bottom: 16px;
}
.topbar h1 { font-size: 17px; font-weight: 700; color: var(--primary); }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------- 统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 18px;
}
.stat .num {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stat .lbl { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ---------------------------------------------- 工具栏 */
.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 16px;
  align-items: center;
}
.toolbar .input, .toolbar select { width: auto; flex: 1 1 150px; min-width: 120px; }
.toolbar .search { flex: 2 1 220px; }

/* ---------------------------------------------- 反馈列表 */
.feedback-item {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin-bottom: 12px;
  border-left: 3px solid transparent;
  transition: border-color .15s;
}
.feedback-item:hover { border-left-color: var(--primary); }

.fi-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 9px;
}
.fi-station { font-weight: 600; font-size: 14.5px; color: #111827; }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--primary-soft);
  color: var(--primary-dark);
  white-space: nowrap;
}

.fi-time { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.fi-body {
  font-size: 14.5px;
  color: #374151;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.fi-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

/* ---------------------------------------------- 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.pager .info { font-size: 13px; color: var(--muted); margin: 0 6px; }
.pager button {
  padding: 7px 13px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 7px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  color: #374151;
}
.pager button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------------------------------------------- 空态 / 骨架 */
.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--muted);
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.empty .icon { font-size: 34px; display: block; margin-bottom: 10px; opacity: .55; }
.empty p { font-size: 14px; }

.skeleton {
  background: linear-gradient(90deg, #eef1f5 25%, #f7f9fb 37%, #eef1f5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: var(--radius);
  height: 88px;
  margin-bottom: 12px;
}
@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------------------------------------------- 成功态 */
.success-view { text-align: center; padding: 26px 8px; }
.success-view .tick {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.success-view h2 { font-size: 19px; color: var(--success); margin-bottom: 8px; }
.success-view p { color: var(--muted); font-size: 14px; }

/* ---------------------------------------------- 其他 */
.foot-link {
  text-align: center;
  margin-top: 20px;
  font-size: 12.5px;
  color: #9ca3af;
}
.foot-link a { color: #9ca3af; text-decoration: none; }
.foot-link a:hover { color: var(--primary); text-decoration: underline; }

.divider { height: 1px; background: var(--line); margin: 20px 0; }

.mono {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.5px;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
}

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--text); word-break: break-all; }

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.check-row:last-child { border-bottom: none; }
.check-dot { flex: 0 0 auto; font-size: 16px; line-height: 1.4; }
.check-body { flex: 1; }
.check-body strong { display: block; font-size: 14px; }
.check-body span { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------- 响应式 */
@media (max-width: 560px) {
  body { padding: 16px 10px 36px; }
  .card { padding: 20px 16px; }
  .page-head h1 { font-size: 19px; }
  .btn-row { flex-direction: column; }
  .topbar { padding: 12px 14px; }
  .topbar h1 { font-size: 15.5px; }
  .toolbar { padding: 12px; }
  .feedback-item { padding: 14px; }
  .fi-time { margin-left: 0; width: 100%; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
