/* ==========================================================
   闲鱼订单 · 接单管理
   视觉参数来自原截图逐像素测量：
   内容宽 545 / 栅格间距 13 / 控件高 32 / 圆角 5
   ========================================================== */

:root {
  /* 文字 */
  --c-title: #24334a;
  --c-text: #263752;
  --c-label: #374151;
  --c-sub: #718096;
  --c-tip: #718096;
  --c-placeholder: #757575;
  --c-muted: #6b7280;

  /* 线条与填充 */
  --c-border: #d9e1ee;
  --c-border-hover: #c3cddd;
  --c-fill: #f1f5f9;
  --c-line: #eef1f6;

  /* 主色 */
  --c-primary: #4267c8;
  --c-primary-hover: #3757ad;
  --c-slate: #64748b;
  --c-slate-hover: #556277;
  --c-red: #e11d48;
  --c-green: #16a34a;

  --radius: 5px;
  --ctrl-h: 32px;
  --gap: 13px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; background: #eef1f6; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-text);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------------------------------------------------------- 外壳 */

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 607px;
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .07);
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 31px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--c-line);
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }

.brand-logo {
  display: grid;
  place-items: center;
  width: 29px; height: 29px;
  flex: 0 0 29px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffd666, #ffb020);
  color: #7a4b00;
  font-size: 14px;
  font-weight: 700;
}

.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-text b { font-size: 14px; letter-spacing: .2px; color: var(--c-title); }
.brand-text small {
  font-size: 11px;
  color: var(--c-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.appbar-actions { display: flex; align-items: center; gap: 4px; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--c-slate);
  cursor: pointer;
  transition: background .15s;
}
.icon-btn:hover { background: var(--c-fill); }

/* ---------------------------------------------------------- 视图 */

.views { flex: 1 1 auto; padding: 0 31px 92px; }

.view { display: none; }
.view.is-active { display: block; animation: fade .16s ease; }

@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.form-title {
  margin: 22px 0 11px;
  font-size: 16px;
  font-weight: 700;
  color: var(--c-title);
  letter-spacing: .2px;
}

/* ---------------------------------------------------------- 表单 */

.field { margin-bottom: 10px; min-width: 0; }

.label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  line-height: 1.15;
  color: var(--c-label);
}

.req { color: var(--c-red); margin-left: 3px; font-weight: 400; }

.input,
.select,
.textarea {
  width: 100%;
  height: var(--ctrl-h);
  padding: 0 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--c-text);
  font-size: 13px;
  line-height: calc(var(--ctrl-h) - 2px);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .16s, box-shadow .16s;
}

.input::placeholder,
.textarea::placeholder { color: var(--c-placeholder); opacity: 1; }

.input:hover, .select:hover, .textarea:hover { border-color: var(--c-border-hover); }

.input:focus, .select:focus, .textarea:focus {
  border-color: var(--c-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(66, 103, 200, .12);
}

.input.is-invalid,
.select.is-invalid { border-color: var(--c-red); box-shadow: 0 0 0 3px rgba(225, 29, 72, .1); }

.input--no { max-width: 153px; }

.textarea {
  display: block;
  height: auto;
  min-height: 31px;
  padding: 5px 10px;
  line-height: 1.45;
  resize: vertical;
}

.grid { display: grid; column-gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.row { display: flex; align-items: center; gap: 9px; }
.row > .cal-wrap { flex: 1 1 auto; min-width: 0; }
.select--hour { flex: 0 0 104px; width: 104px; }
.select--half { width: 48%; max-width: 260px; }
.field--last { margin-bottom: 0; }

/* 追加打手 */
.backup-box { margin-top: 8px; }
.backup-rows { display: flex; flex-direction: column; gap: 8px; }
.bk-row { display: flex; align-items: center; gap: 8px; }
.bk-row .input { flex: 1 1 auto; min-width: 0; }
.bk-row .bk-commission { flex: 0 0 96px; }
.bk-row .bk-del {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: #fff;
  color: var(--c-sub);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.bk-row .bk-del:hover { border-color: var(--c-red); color: var(--c-red); background: #fff1f5; }
.bk-tag {
  flex: 0 0 auto;
  font-size: 10.5px;
  color: var(--c-sub);
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--c-fill);
  border: 1px solid var(--c-line);
}
.backup-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.tip--inline { margin: 0; }

.select {
  padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
}

/* 可输入 + 可选历史（带下拉箭头） */
.input--combo {
  padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
}
.input--combo::-webkit-calendar-picker-indicator { display: none; }

.textarea--fixed { resize: none; }

/* 日期 */
.cal-wrap { position: relative; display: block; }
.cal-wrap input[type="date"] { padding-right: 30px; }
.cal-wrap input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0; padding: 0;
  opacity: 0;
  cursor: pointer;
}
.cal-icon {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: #a8b3c4;
  pointer-events: none;
}

/* 只读收益 */
.readonly {
  display: flex;
  align-items: center;
  height: var(--ctrl-h);
  padding: 0 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-fill);
  color: var(--c-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.tip {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--c-tip);
}
.tip--tight { margin: 0 0 10px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--ctrl-h);
  padding: 0 12px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--c-label);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: all .16s;
}
.btn:hover { border-color: var(--c-border-hover); background: var(--c-fill); }
.btn:active { transform: translateY(.5px); }

.btn--primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}
.btn--primary:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); color: #fff; }

.btn--cancel {
  background: var(--c-slate);
  border-color: var(--c-slate);
  color: #fff;
}
.btn--cancel:hover { background: var(--c-slate-hover); border-color: var(--c-slate-hover); color: #fff; }

.btn--ghost { border-color: transparent; color: var(--c-sub); background: transparent; }
.btn--ghost:hover { background: var(--c-fill); color: var(--c-label); border-color: transparent; }

.btn--danger { color: var(--c-red); border-color: #fbcfe0; background: #fff1f5; }
.btn--danger:hover { background: #ffe4ec; border-color: var(--c-red); color: var(--c-red); }

.btn--sm { height: 26px; padding: 0 10px; border-radius: 6px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 9px; }

.form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--gap);
  padding: 12px 0 26px;
}
.form-actions .btn { height: 28px; min-width: 42px; padding: 0 10px; }

/* ---------------------------------------------------------- 订单列表 */

.summary { display: flex; gap: 9px; margin-bottom: 12px; }

.sum-item {
  flex: 1;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--c-fill);
  border: 1px solid var(--c-border);
}
.sum-item b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--c-title); }
.sum-item span { font-size: 11px; color: var(--c-sub); }

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--ctrl-h);
  padding: 0 10px;
  margin-bottom: 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: #fff;
}
.searchbar:focus-within { border-color: var(--c-primary); }
.search-input {
  flex: 1; min-width: 0; height: 28px;
  border: none; outline: none; background: transparent;
  font-size: 13px; color: var(--c-text);
}
.search-input::placeholder { color: var(--c-placeholder); }

.chips {
  display: flex; gap: 7px; margin-bottom: 12px;
  overflow-x: auto; padding-bottom: 2px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  height: 26px;
  padding: 0 11px;
  border: 1px solid var(--c-border);
  border-radius: 13px;
  background: #fff;
  color: var(--c-label);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.chip.is-on { background: #eef2fb; border-color: #b9c7ea; color: var(--c-primary); }

.order-list { display: flex; flex-direction: column; gap: 10px; }

.order-card {
  padding: 12px 13px;
  border: 1px solid var(--c-border);
  border-radius: 9px;
  background: #fff;
  transition: border-color .16s, box-shadow .16s;
}
.order-card:hover { border-color: #b9c7ea; box-shadow: 0 6px 16px rgba(66, 103, 200, .08); }

.oc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.oc-no { font-size: 11px; color: var(--c-sub); font-variant-numeric: tabular-nums; letter-spacing: .2px; }

.status {
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: 9px;
  font-size: 10.5px;
  line-height: 16px;
  border: 1px solid transparent;
}
.st-进行中 { color: #4267c8; background: #eef2fb; border-color: #dde5f7; }
.st-待付款 { color: #b45309; background: #fdf6ec; border-color: #f6e3c5; }
.st-已完成 { color: #15803d; background: #f0f9eb; border-color: #dcf0d3; }
.st-售后中 { color: #be123c; background: #fff1f5; border-color: #fbd0e0; }
.st-已取消 { color: #64748b; background: #f4f5f7; border-color: #e6e8ec; }

.oc-main { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.oc-title { font-size: 14px; font-weight: 600; color: var(--c-title); }
.oc-sub { font-size: 11.5px; color: var(--c-sub); }

.oc-meta {
  display: flex; flex-wrap: wrap; gap: 3px 13px;
  font-size: 11.5px; color: var(--c-label); margin-bottom: 9px;
}
.oc-meta b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--c-text); }
.oc-meta .money { color: #be123c; }
.oc-meta .profit { color: var(--c-green); }

.oc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.oc-time { font-size: 10.5px; color: #a3adbd; font-variant-numeric: tabular-nums; }
.oc-actions { display: flex; gap: 6px; }

.empty { padding: 52px 0 58px; text-align: center; color: var(--c-sub); }
.empty svg { opacity: .3; margin-bottom: 10px; }
.empty p { margin: 0; font-size: 12.5px; }

.fab {
  position: fixed;
  right: max(18px, calc(50vw - 285px));
  bottom: 82px;
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 8px 22px rgba(66, 103, 200, .38);
  cursor: pointer;
  z-index: 15;
  transition: transform .16s, background .16s;
}
.fab:hover { background: var(--c-primary-hover); transform: scale(1.05); }

/* ---------------------------------------------------------- 卡片 */

.card {
  padding: 15px;
  margin-bottom: 12px;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: #fff;
}
.card:last-of-type { margin-bottom: 22px; }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.card-title { font-size: 13.5px; font-weight: 600; color: var(--c-title); margin-bottom: 9px; }
.card-head .card-title { margin-bottom: 2px; }
.card-sub { font-size: 11.5px; color: var(--c-sub); line-height: 1.45; }

.badge {
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: 9px;
  font-size: 10.5px;
  line-height: 16px;
  background: #f0f9eb;
  color: #15803d;
  border: 1px solid #dcf0d3;
}
.badge--off { background: #f4f5f7; color: #64748b; border-color: #e6e8ec; }

.preview {
  margin-top: 11px;
  padding: 11px;
  border: 1px dashed #b9c7ea;
  border-radius: 9px;
  background: #f7f9fe;
}
.preview .pv-title { font-size: 11.5px; color: var(--c-primary); margin-bottom: 8px; font-weight: 600; }
.pv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.pv-item { display: flex; align-items: baseline; gap: 6px; font-size: 11.5px; min-width: 0; }
.pv-item span { flex: 0 0 42px; color: var(--c-sub); }
.pv-item b { color: var(--c-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-item b.miss { color: #c3c9d4; font-weight: 400; }

.scripts { display: flex; flex-direction: column; gap: 7px; }

.script {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--c-line);
  border-radius: 8px;
  background: #fcfdff;
  cursor: pointer;
  transition: all .15s;
}
.script:hover { border-color: #b9c7ea; background: #f7f9fe; }
.script-txt { flex: 1; min-width: 0; }
.script-name { font-size: 11.5px; font-weight: 600; color: var(--c-title); margin-bottom: 2px; }
.script-body {
  font-size: 11.5px; color: var(--c-label); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.script-copy { flex: 0 0 auto; font-size: 10.5px; color: var(--c-primary); padding-top: 1px; }

.mini-list { display: flex; flex-direction: column; }
.mini-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 0; border-bottom: 1px dashed var(--c-line); font-size: 11.5px;
}
.mini-item:last-child { border-bottom: none; }
.mini-item .mi-l { color: var(--c-text); font-weight: 500; }
.mini-item .mi-r { color: var(--c-sub); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- 统计 */

.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 12px; }

.kpi {
  padding: 12px 13px;
  border-radius: 10px;
  background: #f7f9fe;
  border: 1px solid #e3e9f7;
}
.kpi b { display: block; font-size: 19px; font-weight: 700; color: #33518f; font-variant-numeric: tabular-nums; letter-spacing: .3px; }
.kpi span { font-size: 10.5px; color: var(--c-sub); }
.kpi--green { background: #f5fcf2; border-color: #dcf0d3; }
.kpi--green b { color: #15803d; }

.chart { display: flex; align-items: flex-end; gap: 8px; height: 116px; padding-top: 6px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.chart-bar {
  width: 100%; max-width: 32px; min-height: 3px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #8fa5e0, var(--c-primary));
  transition: height .4s ease;
}
.chart-bar.is-zero { background: #eef1f6; }
.chart-label { font-size: 10px; color: var(--c-sub); }

.rank { display: flex; flex-direction: column; gap: 9px; }
.rank-row { display: flex; align-items: center; gap: 9px; font-size: 11.5px; }
.rank-idx {
  flex: 0 0 17px; height: 17px; border-radius: 5px;
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
  background: var(--c-fill); color: var(--c-sub);
}
.rank-row:nth-child(1) .rank-idx { background: #fff4e0; color: #b45309; }
.rank-row:nth-child(2) .rank-idx { background: #eef1f6; color: #556277; }
.rank-row:nth-child(3) .rank-idx { background: #fbeee6; color: #a15c31; }
.rank-name { flex: 0 0 auto; max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-text); }
.rank-track { flex: 1; height: 6px; border-radius: 3px; background: #eef1f6; overflow: hidden; }
.rank-fill { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #8fa5e0, var(--c-primary)); }
.rank-val { flex: 0 0 auto; color: var(--c-label); font-variant-numeric: tabular-nums; }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: flex; align-items: center; gap: 9px; font-size: 11.5px; }
.bar-name { flex: 0 0 56px; color: var(--c-label); }
.bar-track { flex: 1; height: 7px; border-radius: 4px; background: #eef1f6; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #9ed48a, var(--c-green)); }
.bar-val { flex: 0 0 auto; color: var(--c-sub); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- 底部导航 */

.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  padding: 5px 4px calc(5px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .97);
  backdrop-filter: saturate(180%) blur(12px);
  border-top: 1px solid var(--c-line);
}

.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 0;
  border: none; background: transparent;
  color: #9aa4b2; font-size: 10px;
  cursor: pointer; transition: color .15s;
}
.tab.is-on { color: var(--c-primary); }
.tab.is-on svg { transform: translateY(-1px); }
.tab svg { transition: transform .15s; }

/* ---------------------------------------------------------- Toast */

.toast {
  position: fixed;
  left: 50%; bottom: 86px; top: auto;
  z-index: 999;
  transform: translate(-50%, 10px);
  max-width: 80vw;
  padding: 8px 15px;
  border-radius: 7px;
  background: rgba(36, 51, 74, .92);
  color: #fff; font-size: 12.5px; line-height: 1.4;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-err { background: rgba(190, 18, 60, .95); }
.toast.is-ok { background: rgba(66, 103, 200, .96); }

/* ---------------------------------------------------------- 小屏 */

@media (max-width: 560px) {
  .appbar { padding: 10px 16px; }
  .views { padding: 0 16px 88px; }
  .app { box-shadow: none; }

  /* 手机端保持和电脑一样的列结构（三列就是三列），只收紧间距 */
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 8px; }
  .grid-3 > .field:nth-child(3) { grid-column: auto; }
  .grid-2 { column-gap: 8px; }
  .input--no { max-width: none; }
  .select--hour { flex-basis: 92px; width: 92px; }
  .row { gap: 8px; }
  .label { font-size: 11.5px; }
  .input, .select, .readonly { font-size: 12.5px; padding: 0 8px; }
  .select { padding-right: 24px; background-position: right 7px center; }
  .fab { right: 16px; bottom: 76px; }
  .kpi b { font-size: 17px; }
  .pv-grid { grid-template-columns: 1fr; }
}

@media (max-width: 340px) {
  .grid-3 { column-gap: 6px; }
  .grid-2 { column-gap: 6px; }
  .input, .select { padding: 0 6px; font-size: 12px; }
}

/* ---------------------------------------------------------- 客服桥 / 剪贴板 */

.bridge-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 10.5px;
  color: var(--c-slate);
  background: var(--c-fill);
  border: 1px solid var(--c-line);
  cursor: default;
  white-space: nowrap;
}
.bridge-chip .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #c3c9d4;
}
.bridge-chip[hidden] { display: none; }
.bridge-chip.is-on {
  color: #15803d;
  background: #f0f9eb;
  border-color: #dcf0d3;
}
.bridge-chip.is-on .dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .16);
}
.bridge-chip.is-off { color: #b45309; background: #fdf6ec; border-color: #f6e3c5; }
.bridge-chip.is-off .dot { background: #f59e0b; }

.clip-sheet {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  width: min(556px, calc(100vw - 32px));
  z-index: 60;
  padding: 12px 13px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #c9dbfb;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .18);
  animation: clipIn .2s ease;
}
.clip-sheet[hidden] { display: none; }

@keyframes clipIn {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.clip-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--c-title);
  margin-bottom: 8px;
}
.clip-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .16);
}
.clip-x {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--c-sub);
  font-size: 17px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}
.clip-x:hover { color: var(--c-text); }

.clip-body {
  font-size: 12px;
  line-height: 1.5;
  color: var(--c-label);
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--c-fill);
  max-height: 74px;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-all;
}
.clip-hint { margin-top: 7px; font-size: 11px; color: var(--c-primary); }
.clip-hint:empty { display: none; }
.clip-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 10px; }

/* 客服页里的开关 */
.opts { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--c-line); }
.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
  color: var(--c-label);
  cursor: pointer;
  user-select: none;
}
.switch-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--c-primary);
  cursor: pointer;
}

/* ---------------------------------------------------------- 口令门 */

.login-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef1f6;
  padding: 24px;
}
.login-gate[hidden] { display: none; }
.lg-box {
  width: 340px;
  max-width: 100%;
  padding: 24px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .10);
}
.lg-box h3 { margin: 0 0 4px; font-size: 18px; color: var(--c-title); }
.lg-box p { margin: 0 0 16px; font-size: 12px; color: var(--c-sub); }
.lg-box input {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--c-border);
  border-radius: 7px;
  font-size: 14px;
  color: var(--c-text);
  font-family: inherit;
}
.lg-box input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(66,103,200,.12); }
.lg-box .btn { width: 100%; height: 36px; margin-top: 10px; font-size: 14px; border-radius: 8px; }
.lg-err { min-height: 16px; margin-top: 8px; font-size: 12px; color: var(--c-red); }
.lg-tip { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--c-line); font-size: 11px; color: var(--c-sub); line-height: 1.6; }

/* ---------------------------------------------------------- 闲鱼新订单提示条 */

.detect-bar {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(556px, calc(100vw - 24px));
  padding: 9px 12px;
  border-radius: 10px;
  background: #fffbe8;
  border: 1px solid #f6e3a8;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .14);
  font-size: 12.5px;
  animation: clipIn .2s ease;
}
.detect-bar[hidden] { display: none; }
.detect-bar .db-dot {
  flex: 0 0 auto;
  width: 7px; height: 7px; border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .18);
}
.detect-bar .db-label { flex: 0 0 auto; color: #b45309; font-weight: 600; }
.detect-bar b {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Consolas, "Courier New", monospace;
  color: #24334a;
  font-size: 12.5px;
}
.detect-bar .db-acts { flex: 0 0 auto; display: flex; gap: 6px; }

@media (max-width: 560px) {
  .detect-bar { top: 52px; }
  .detect-bar .db-label { display: none; }
}

/* 话术：编辑区 + 操作按钮 */
.script-editor {
  padding: 11px;
  margin-bottom: 10px;
  border: 1px dashed #b9c7ea;
  border-radius: 10px;
  background: #f7f9fe;
}
.script-editor[hidden] { display: none; }
.script-editor .field:last-of-type { margin-bottom: 8px; }
.script-ops {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding-top: 1px;
  font-size: 10.5px;
}
.script-ops .op { color: var(--c-primary); cursor: pointer; }
.script-ops .op:hover { text-decoration: underline; }
.script-ops .op--del { color: var(--c-red); }
.script-copy { display: none; }

/* ---------------------------------------------------------- 桌面宽屏自适应（不影响手机） */
/* 手机端（≤560px）的规则完全不变，这里只放大桌面用的尺寸 */

@media (min-width: 900px) {
  .app {
    max-width: 1120px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .10);
  }
  .appbar { padding: 13px 40px; }
  .views { padding: 0 40px 100px; }
  .form-title { font-size: 20px; margin: 26px 0 16px; }

  .label { font-size: 13px; margin-bottom: 5px; }
  .input, .select, .readonly { height: 36px; font-size: 14px; line-height: 34px; }
  .textarea { min-height: 36px; padding: 6px 11px; font-size: 14px; }
  .tip { font-size: 12px; }

  .grid-3 { column-gap: 18px; }
  .grid-2 { column-gap: 18px; }
  .row { gap: 12px; }
  .select--hour { flex-basis: 120px; width: 120px; }
  .select--half { width: 40%; max-width: 300px; }
  .input--no { max-width: 220px; }

  .form-actions .btn { height: 32px; min-width: 56px; font-size: 13px; }
  .form-actions { padding: 14px 0 30px; }

  /* 订单列表：宽屏两列 */
  .order-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .order-card { margin: 0; }

  /* 统计四列 */
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .tab { font-size: 11px; }
  .tab svg { width: 22px; height: 22px; }

  .detect-bar { width: min(880px, calc(100vw - 80px)); top: 64px; }

  .fab {
    right: calc(max(0px, (100vw - 1120px) / 2) + 20px);
    bottom: 96px;
    width: 52px; height: 52px;
  }
}

@media (min-width: 1400px) {
  .app { max-width: 1240px; }
  .views { padding: 0 48px 100px; }
  .appbar { padding: 14px 48px; }
}

/* ---------------------------------------------------------- 订单图片 */
.img-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.img-strip:empty { display: none; }
.img-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--c-border);
  background: var(--c-fill);
  cursor: pointer;
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb .img-del {
  position: absolute;
  top: 2px; right: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(36, 51, 74, .75);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
}
.img-thumb .img-del:hover { background: var(--c-red); }
.img-loading {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 8px;
  border: 1px dashed var(--c-border);
  color: var(--c-sub);
  font-size: 10px;
}

/* 订单卡片里的缩略图 */
.oc-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 9px; }
.oc-imgs img {
  width: 46px; height: 46px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--c-border);
  cursor: pointer;
}

/* ---------------------------------------------------------- 打手填名字（和主界面同风格） */
.name-gate {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 20px 20px;
  background: #eef1f6;
  overflow: auto;
}
.name-gate[hidden] { display: none; }
.ng-box {
  width: 100%;
  max-width: 400px;
  padding: 26px 22px 22px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .10);
  text-align: left;
}
.ng-logo {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffd666, #ffb020);
  color: #7a4b00;
  font-weight: 700;
  margin-bottom: 12px;
}
.ng-box h3 { margin: 0 0 6px; font-size: 19px; color: var(--c-title); }
.ng-box p { margin: 0 0 18px; font-size: 12.5px; color: var(--c-sub); line-height: 1.6; }
.ng-box .input { height: 42px; font-size: 15px; }
.ng-box .btn { width: 100%; height: 42px; margin-top: 12px; font-size: 15px; border-radius: 9px; }
.ng-err { min-height: 16px; margin-top: 8px; font-size: 12px; color: var(--c-red); }
.ng-tip { margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--c-line); font-size: 11px; color: var(--c-sub); line-height: 1.6; }

/* ==========================================================
   自有风格（品牌化）—— 覆盖在上面的基础样式之上
   思路：深蓝墨色 + 闲鱼黄点缀，订单卡按状态出彩条
   ========================================================== */

:root {
  --c-primary: #2f5fd0;
  --c-primary-hover: #2750b4;
  --c-primary-dark: #1f3f8f;
  --c-title: #17233d;
  --c-text: #22314f;
  --brand: #ffb020;
  --brand-soft: #fff5e0;
  --shadow-card: 0 1px 2px rgba(23, 35, 61, .04), 0 10px 26px rgba(23, 35, 61, .06);
  --bg-page: #f4f6fb;
}

body { background: var(--bg-page); }

/* 顶栏：底部一条渐变亮线，作为品牌记号 */
.appbar { border-bottom: none; }
.appbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand) 0 22%, var(--c-primary) 22% 100%);
  opacity: .85;
}
.appbar { position: sticky; }

.brand-logo {
  background: linear-gradient(135deg, #ffce4a, #ff9f1a);
  box-shadow: 0 3px 10px rgba(255, 159, 26, .35);
}

/* 页面标题：左侧一根小竖条 */
.form-title {
  position: relative;
  padding-left: 13px;
}
.form-title::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 4px; height: 17px;
  border-radius: 2px;
  background: linear-gradient(180deg, #ffce4a, var(--brand));
}

/* 输入框：更柔和的边框，聚焦时蓝环 */
.input, .select, .textarea, .readonly {
  border-color: #e2e7f2;
  background: #fbfcfe;
}
.input:hover, .select:hover, .textarea:hover { border-color: #c8d3e8; }
.input:focus, .select:focus, .textarea:focus {
  background: #fff;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(47, 95, 208, .12);
}

/* 金额是这一页的主角 */
#f-amount {
  font-size: 16px;
  font-weight: 650;
  color: var(--c-primary-dark);
  letter-spacing: .3px;
}

/* 主按钮：渐变 + 投影 */
.btn--primary {
  background: linear-gradient(135deg, #4a78e0, var(--c-primary));
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(47, 95, 208, .28);
}
.btn--primary:hover {
  background: linear-gradient(135deg, #3f6cd6, var(--c-primary-hover));
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(47, 95, 208, .34);
}
.btn--cancel {
  background: linear-gradient(135deg, #7c8aa3, #64748b);
  border-color: transparent;
}

/* 订单卡：左侧状态色条 + 悬停浮起 */
.order-card {
  position: relative;
  border-left: 3px solid #e3e9f4;
  border-radius: 12px;
}
.order-card:has(.st-进行中) { border-left-color: #2f5fd0; }
.order-card:has(.st-已完成) { border-left-color: #16a34a; }
.order-card:has(.st-待付款) { border-left-color: #f59e0b; }
.order-card:has(.st-售后中) { border-left-color: #e11d48; }
.order-card:has(.st-已取消) { border-left-color: #9aa6b8; }
.order-card:hover {
  border-color: #cfdcf5;
  border-left-color: inherit;
  box-shadow: 0 10px 26px rgba(23, 35, 61, .09);
  transform: translateY(-1px);
}

.oc-title { font-size: 15px; letter-spacing: .2px; }
.oc-meta .money {
  color: var(--c-primary-dark);
  font-size: 13px;
  font-weight: 700;
}
.oc-no { font-family: Consolas, "Courier New", monospace; }

/* 汇总三格：渐变底 */
.sum-item {
  background: linear-gradient(160deg, #ffffff, #f3f7ff);
  border-color: #e3eaf8;
}
.sum-item b { color: var(--c-primary-dark); }
.sum-item:nth-child(3) {
  background: linear-gradient(160deg, #ffffff, #f2fbf3);
  border-color: #ddf0dd;
}

/* 底部导航：选中项加浅色药丸 */
.tab.is-on svg {
  background: #eef3ff;
  border-radius: 9px;
  padding: 2px;
  box-sizing: content-box;
}
.tab.is-on span { font-weight: 600; }

/* 统计卡 */
.kpi {
  background: linear-gradient(155deg, #f9fbff, #eef4ff);
  border-color: #e0e9fb;
}
.kpi b { color: var(--c-primary-dark); }

/* 空状态插图淡一点 */
.empty svg { opacity: .22; }

/* 顶栏退出按钮 */
.logout-btn {
  height: 24px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--c-border);
  background: #fff;
  color: var(--c-sub);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  transition: .15s;
}
.logout-btn:hover { border-color: #f2b8c6; color: var(--c-red); background: #fff5f8; }
