/* 标讯雷达 H5 预览 — 复刻小程序主界面，手机宽模拟 */
:root {
  --primary: #1a56db;
  --bg: #f5f6f8;
  --text: #1f2329;
  --muted: #8a8f99;
  --warn: #d97706;
  --danger: #dc2626;
  --success: #059669;
  --phone-w: 390px;
  --nav-h: 48px;
  --tab-h: 56px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: #1e293b;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 12px 24px;
  min-height: 100%;
}

.preview-banner {
  width: min(var(--phone-w), 100%);
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
  margin-bottom: 10px;
}
.preview-banner strong { color: #e2e8f0; }

.phone {
  width: min(var(--phone-w), 100%);
  height: min(780px, calc(100vh - 60px));
  background: var(--bg);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  position: relative;
  border: 3px solid #0f172a;
}

.nav-bar {
  height: var(--nav-h);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}
.nav-bar .back {
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  display: none;
  align-items: center;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  padding: 0 8px;
  background: none;
  border: none;
}
.nav-bar.show-back .back { display: flex; }

.main {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.view {
  display: none;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.view.active { display: block; }

.tab-bar {
  height: var(--tab-h);
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-shrink: 0;
  z-index: 20;
}
.tab-bar.hidden { display: none; }
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 0;
}
.tab-item .icon { font-size: 18px; line-height: 1; }
.tab-item.on { color: var(--primary); font-weight: 500; }

/* cards & utils */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 6px rgba(31, 35, 41, 0.04);
}
.container { padding: 12px; padding-bottom: 24px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 12px; }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; color: var(--text); }

.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.4;
  margin-right: 6px;
  margin-bottom: 4px;
}
.tag-blue { background: #eff6ff; color: var(--primary); }
.tag-orange { background: #fff7ed; color: #c2410c; }
.tag-green { background: #ecfdf5; color: #047857; }
.tag-gray { background: #f3f4f6; color: #6b7280; }
.tag-red { background: #fef2f2; color: var(--danger); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  line-height: 1.4;
}
.btn-primary:active { opacity: 0.9; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-sm { font-size: 13px; padding: 6px 12px; }

.empty-wrap {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-wrap .emoji { font-size: 36px; margin-bottom: 12px; }

/* filter bar */
.filter-bar {
  background: #fff;
  padding: 10px 12px 6px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.search-row { display: flex; align-items: center; gap: 8px; }
.search-input {
  flex: 1;
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  border: none;
  outline: none;
  height: 36px;
}
.search-btn {
  background: var(--primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.chips {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  margin-top: 8px;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-block;
  padding: 5px 11px;
  background: var(--bg);
  border-radius: 16px;
  font-size: 12px;
  color: #4b5563;
  flex-shrink: 0;
  cursor: pointer;
  border: none;
}
.chip.active { background: #eff6ff; color: var(--primary); }

.list-header { padding: 8px 12px 0; }

/* bid card */
.bid-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 6px rgba(31, 35, 41, 0.04);
  cursor: pointer;
}
.bid-card:active { background: #fafbfc; }
.bid-card .title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.bid-card .tags { margin-top: 8px; }
.bid-card .meta {
  display: flex;
  margin-top: 10px;
  gap: 20px;
}
.bid-card .meta .label { font-size: 11px; color: var(--muted); margin-right: 4px; }
.bid-card .meta .value { font-size: 13px; color: var(--text); font-weight: 500; }
.bid-card .footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #eef0f3;
  font-size: 12px;
  color: var(--muted);
}

/* detail */
.detail-page { padding: 12px; padding-bottom: 80px; }
.hero .title {
  font-size: 17px;
  font-weight: 600;
  margin-top: 8px;
  line-height: 1.45;
}
.hero .summary { margin-top: 8px; font-size: 13px; }
.field {
  display: flex;
  padding: 7px 0;
  border-bottom: 1px solid #eef0f3;
}
.field:last-child { border-bottom: none; }
.field-label {
  width: 80px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 13px;
}
.field-value {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
}
.field-value.link { color: var(--primary); cursor: pointer; }
.body-text { font-size: 14px; color: #374151; line-height: 1.6; }
.bottom-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  z-index: 15;
}
.btn-fav {
  background: var(--bg);
  color: #4b5563;
  border-radius: 8px;
  font-size: 14px;
  padding: 0 16px;
  height: 40px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-fav.on { background: #fff7ed; color: #c2410c; }
.bottom-bar .btn-primary { flex: 1; height: 40px; }

/* subscribe */
.sub-page { padding: 12px; padding-bottom: 24px; }
.tips { border-left: 3px solid var(--primary); }
.tip-item {
  display: flex;
  align-items: flex-start;
  padding: 6px 0;
  cursor: pointer;
}
.tip-dot { color: var(--primary); margin-right: 6px; font-size: 10px; margin-top: 4px; }
.tip-text { flex: 1; font-size: 13px; color: #374151; }
.sub-header { margin: 8px 0 10px; }
.sub-name { font-size: 15px; font-weight: 600; }
.sub-meta { margin-top: 5px; font-size: 12px; color: var(--muted); }
.actions {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #eef0f3;
  display: flex;
  gap: 16px;
}
.action { color: var(--primary); font-size: 13px; cursor: pointer; background: none; border: none; padding: 0; }
.action.danger { color: var(--danger); }
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  transition: background 0.2s;
  flex-shrink: 0;
}
.switch.on { background: var(--primary); }
.switch::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch.on::after { left: 22px; }

/* workspace */
.status-tabs {
  display: flex;
  overflow-x: auto;
  background: #fff;
  padding: 8px 12px;
  margin-bottom: 4px;
  gap: 6px;
  -webkit-overflow-scrolling: touch;
}
.status-tabs::-webkit-scrollbar { display: none; }
.status-tab {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 16px;
  background: var(--bg);
  font-size: 12px;
  color: #6b7280;
  flex-shrink: 0;
  border: none;
  cursor: pointer;
}
.status-tab.on {
  background: #eff6ff;
  color: var(--primary);
  font-weight: 500;
}
.work-list { padding: 8px 12px; }
.work-card .title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}
.work-card .meta { margin-top: 5px; }
.work-row {
  display: flex;
  align-items: center;
  margin-top: 10px;
}
.work-row .label {
  width: 70px;
  color: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
}
.picker-chip {
  background: #eff6ff;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  border: none;
  cursor: pointer;
}
.note-input {
  flex: 1;
  background: var(--bg);
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  border: none;
  outline: none;
}

/* mine */
.mine-page { padding: 12px; }
.profile {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile .info { display: flex; flex-direction: column; gap: 4px; }
.profile .name { font-size: 17px; font-weight: 600; }
.badge {
  display: inline-block;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  width: fit-content;
}
.quota-bar {
  height: 8px;
  background: #eef0f3;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.quota-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  width: 30%;
}
.quota-text {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #eef0f3;
  font-size: 14px;
  cursor: pointer;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  text-align: left;
  color: inherit;
}
.menu-item:last-child { border-bottom: none; }
.arrow { color: #c0c4cc; font-size: 18px; }
.mine-footer {
  text-align: center;
  margin-top: 24px;
  padding-bottom: 20px;
  font-size: 12px;
  color: var(--muted);
}

/* modal / sheet */
.overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 50;
  align-items: flex-end;
  justify-content: center;
}
.overlay.show { display: flex; }
.sheet {
  background: #fff;
  width: 100%;
  border-radius: 16px 16px 0 0;
  padding: 8px 0 20px;
  max-height: 70%;
  overflow-y: auto;
}
.sheet-title {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 8px 16px 12px;
}
.sheet-item {
  display: block;
  width: 100%;
  padding: 14px 20px;
  text-align: center;
  font-size: 15px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text);
  border-top: 1px solid #f3f4f6;
}
.sheet-item:active { background: #f5f6f8; }
.sheet-cancel {
  margin-top: 8px;
  border-top: 8px solid var(--bg);
  font-weight: 500;
}

.toast {
  display: none;
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 100;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show { display: block; }

.modal-box {
  display: none;
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: 80%;
  z-index: 60;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.modal-box.show { display: block; }
.modal-box h3 { font-size: 16px; margin-bottom: 10px; }
.modal-box p { font-size: 13px; color: #4b5563; line-height: 1.5; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.modal-actions button {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  cursor: pointer;
}
.modal-cancel { background: var(--bg); color: #4b5563; }

/* form edit */
.form-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #eef0f3;
}
.form-item:last-child { border-bottom: none; }
.form-item .label {
  width: 90px;
  flex-shrink: 0;
  font-size: 14px;
  color: var(--text);
}
.form-item input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
}
.form-item .picker-val {
  flex: 1;
  font-size: 14px;
  color: #4b5563;
  text-align: right;
  cursor: pointer;
}

@media (max-width: 420px) {
  body { padding: 0; background: var(--bg); }
  .preview-banner { display: none; }
  .phone {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}
