/* ==========================================================================
   商标挂售委托页（sell.html）
   依赖 style.css 的设计令牌；全部类名用 sg- 前缀，
   避免和首页同名类互相覆盖（服务页踩过一次 .svc-card 的坑）。
   ========================================================================== */

/* ---------------- 头图 ---------------- */

.sg-hero {
  padding-bottom: 46px;
}

.sg-hero h1 {
  font-size: 34px;
  line-height: 1.3;
  /* 长标题在窄屏会只剩一个「卖」字掉到第二行，balance 让它折得均匀些 */
  text-wrap: balance;
}

/* 标题里的后半句整体换行，不要被拆成「挂上 / 来」 */
.sg-hero h1 .nb {
  display: inline-block;
}

.sg-hero p {
  max-width: 720px;
}

/* ---------------- 布局 ---------------- */

.sg-main {
  background: var(--bg-gray);
  padding: 30px 0 64px;
}

.sg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.sg-form-col {
  min-width: 0;
}

.sg-banner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 16px;
  margin-bottom: 14px;
  border: 1px solid #f8d7d7;
  background: #fff6f6;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #a1382f;
  line-height: 1.6;
}

.sg-banner b {
  flex: none;
}

/* 作者样式里的 display:flex 会盖掉浏览器默认的 [hidden]，必须显式声明。
   否则 hidden 属性设了、屏幕上还在显示 —— 只能靠肉眼发现的坑。 */
.sg-banner[hidden],
.sg-done[hidden],
.sg-card[hidden] {
  display: none;
}

.sg-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 26px 26px;
  box-shadow: var(--shadow-sm);
}

.sg-block {
  padding: 24px 0;
  border-bottom: 1px dashed var(--line);
}

.sg-block:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.sg-bt {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.sg-bt h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.sg-bt h3 i {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--brand-light);
  color: var(--brand-deep);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg-bt span {
  font-size: 12px;
  color: var(--text-3);
}

/* ---------------- 字段 ---------------- */

.sg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sg-span2 {
  grid-column: span 2;
}

.sg-field {
  min-width: 0;
}

.sg-field > label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}

.sg-field > label em {
  font-style: normal;
  color: var(--red);
  margin-left: 2px;
}

.sg-field input,
.sg-field select,
.sg-field textarea {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.sg-field textarea {
  height: auto;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}

.sg-field input:focus,
.sg-field select:focus,
.sg-field textarea:focus {
  background: #fff;
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.12);
}

.sg-field input::placeholder,
.sg-field textarea::placeholder {
  color: #a9b6b0;
}

.sg-field .err {
  font-size: 12px;
  color: var(--red);
  line-height: 1.5;
  margin-top: 4px;
  min-height: 0;
}

.sg-field.invalid input,
.sg-field.invalid select {
  border-color: #f0a9a9;
  background: #fffafa;
}

.sg-hint {
  font-size: 12px;
  color: var(--text-3);
  margin: 6px 0 10px;
  line-height: 1.6;
}

/* ---------------- 身份选择 ---------------- */

.sg-chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sg-chip {
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-2);
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 19px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.sg-chip:hover {
  border-color: var(--brand-line);
  color: var(--brand-deep);
}

.sg-chip.on {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand-deep);
  font-weight: 600;
}

/* ---------------- 报价 ---------------- */

.sg-price {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--brand-line);
  background: linear-gradient(180deg, #f6fefa, #ffffff);
  border-radius: var(--radius);
}

.sg-price-in > label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}

.sg-price-in > label em {
  font-style: normal;
  color: var(--red);
}

.sg-money {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  height: 48px;
  max-width: 280px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.sg-money:focus-within {
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.12);
}

.sg-money span {
  font-size: 16px;
  color: var(--text-3);
}

.sg-money input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 0;
  background: transparent;
  font-size: 20px;
  font-weight: 700;
  color: var(--price);
  outline: none;
  font-family: inherit;
  letter-spacing: 0.3px;
}

.sg-money input::-webkit-outer-spin-button,
.sg-money input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.sg-price-out {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.sg-price-out > div {
  background: #fff;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.sg-price-out span {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 2px;
}

.sg-price-out b {
  font-size: 17px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.sg-price-out .hl {
  border-color: var(--brand-line);
  background: var(--brand-light);
}

.sg-price-out .hl b {
  color: var(--price);
}

.sg-price-note {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-2);
}

.sg-price-note b {
  color: var(--brand-deep);
}

/* ---------------- 上传 ---------------- */

.sg-up-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.sg-up {
  border: 1px dashed #cfded6;
  border-radius: var(--radius);
  padding: 16px;
  background: #fbfdfc;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.sg-up:hover {
  border-color: var(--brand-line);
  background: #fff;
}

.sg-up.invalid {
  border-color: #f0a9a9;
  background: #fffafa;
}

.sg-up-head b {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.sg-up-head b em {
  font-style: normal;
  color: var(--red);
}

.sg-up-head span {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.6;
}

.sg-up-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 0;
}

.sg-up-list:empty {
  margin: 0;
}

.sg-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: #fff;
  border: 1px solid var(--line-light);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-2);
}

.sg-file .nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sg-file .sz {
  flex: none;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.sg-file .st {
  flex: none;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--brand-light);
  color: var(--brand-deep);
}

.sg-file .st.up {
  background: #eef4ff;
  color: #2f6bd8;
}

.sg-file .st.bad {
  background: #fff1f1;
  color: var(--red);
}

.sg-file .del {
  flex: none;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.sg-file .del:hover {
  background: #fff1f1;
  color: var(--red);
}

.sg-up-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
  font-family: inherit;
  color: var(--brand-deep);
  background: #fff;
  border: 1px solid var(--brand-line);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.sg-up-btn:hover {
  background: var(--brand-light);
}

.sg-up-btn .ico {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.sg-up .err {
  font-size: 12px;
  color: var(--red);
  margin-top: 6px;
}

.sg-up-wide {
  margin-top: 14px;
}

/* ---------------- 协议与提交 ---------------- */

.sg-agree {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 18px 0 16px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
  cursor: pointer;
}

.sg-agree input {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--brand);
}

.sg-agree.invalid span {
  color: var(--red);
}

.sg-submit {
  height: 48px;
  font-size: 15px;
  letter-spacing: 0.5px;
}

.sg-submit[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.sg-submit-tip {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 10px;
}

/* 提交失败不能只靠 toast：3 秒后就消失了，客户回头找不到原因 */
.sg-submit-err {
  font-size: 12.5px;
  color: var(--red);
  line-height: 1.6;
  margin-top: 8px;
  text-align: center;
}

.sg-submit-err:empty {
  display: none;
}

/* ---------------- 提交成功 ---------------- */

.sg-done {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 30px 32px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  /* 顶部导航是 sticky 的，scrollIntoView 会把面板滚到导航下面挡住勾选图标 */
  scroll-margin-top: 88px;
}

.sg-done-ico {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg-done-ico svg {
  width: 26px;
  height: 26px;
  stroke: var(--brand);
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sg-done h2 {
  font-size: 21px;
  color: var(--text);
}

.sg-done-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 6px;
}

.sg-done-card {
  max-width: 420px;
  margin: 20px auto 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-align: left;
}

.sg-done-card .row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--line-light);
}

.sg-done-card .row:last-child {
  border-bottom: 0;
}

.sg-done-card .row span {
  color: var(--text-3);
}

.sg-done-card .row b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.sg-done-card .row b.price {
  color: var(--price);
}

.sg-done-next {
  max-width: 520px;
  margin: 22px auto 0;
  text-align: left;
}

.sg-done-next h4 {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
}

.sg-done-next ol {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.9;
}

.sg-done-next ol b {
  color: var(--text);
}

.sg-done-act {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ---------------- 侧栏 ---------------- */

.sg-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 16px;
}

.sg-side-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.sg-side-card h4 {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 10px;
}

.sg-side-card ul {
  list-style: none;
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.9;
}

.sg-side-card ul li {
  padding-left: 14px;
  position: relative;
}

.sg-side-card ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-line);
}

.sg-side-price {
  border-color: var(--brand-line);
  background: linear-gradient(180deg, #f4fdf8, #ffffff);
}

.sg-side-price p {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.7;
  margin-top: 10px;
}

.sg-fml {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-2);
}

.sg-fml b {
  color: var(--brand-deep);
}

.sg-side-card ul b {
  color: var(--brand-deep);
}

.sg-check li::before {
  background: var(--brand);
}

.sg-tel {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--price);
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

.sg-side-help p {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.7;
  margin-top: 6px;
}

/* ---------------- 我的委托 ---------------- */

.sg-my {
  padding: 52px 0 64px;
}

.sg-my-q {
  display: flex;
  gap: 10px;
  max-width: 480px;
}

.sg-my-q input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
}

.sg-my-q input:focus {
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px rgba(18, 183, 106, 0.12);
}

.sg-my-hint {
  font-size: 12.5px;
  color: var(--text-3);
  margin-top: 10px;
}

.sg-my-hint.bad {
  color: var(--red);
}

.sg-my-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.sg-mc {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.sg-mc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.sg-mc-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.sg-badge {
  flex: none;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-gray);
  color: var(--text-2);
}

.sg-badge.ok {
  background: var(--brand-light);
  color: var(--brand-deep);
}

.sg-badge.ing {
  background: #eef4ff;
  color: #2f6bd8;
}

.sg-badge.bad {
  background: #fff1f1;
  color: var(--red);
}

.sg-badge.mute {
  background: #f4f6f5;
  color: var(--text-3);
}

.sg-mc-meta {
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.8;
}

.sg-mc-money {
  display: flex;
  gap: 18px;
  margin: 10px 0;
  padding: 10px 0;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.sg-mc-money div span {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
}

.sg-mc-money div b {
  font-size: 15px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.sg-mc-money div:first-child b {
  color: var(--price);
}

.sg-mc-next {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.7;
}

.sg-mc-note {
  margin-top: 8px;
  padding: 8px 10px;
  background: #fff8f2;
  border-radius: 6px;
  font-size: 12px;
  color: #a9682f;
  line-height: 1.6;
}

.sg-mc-no {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* ---------------- toast ---------------- */

#toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%) translateY(12px);
  max-width: 84vw;
  padding: 10px 18px;
  background: rgba(23, 38, 32, 0.92);
  color: #fff;
  font-size: 13px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999;
  line-height: 1.5;
}

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

/* ---------------- 响应式 ---------------- */

@media (max-width: 1080px) {
  .sg-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .sg-side {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .sg-side-help {
    grid-column: span 2;
  }
}

@media (max-width: 860px) {
  .sg-hero {
    padding: 18px 0 26px;
  }

  .sg-hero h1 {
    font-size: 23px;
  }

  .sg-hero p {
    font-size: 13px;
  }

  .sg-main {
    padding: 16px 0 40px;
  }

  .sg-card {
    padding: 2px 16px 18px;
    border-radius: var(--radius-sm);
  }

  .sg-block {
    padding: 18px 0;
  }

  .sg-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .sg-span2 {
    grid-column: auto;
  }

  .sg-price-out {
    grid-template-columns: 1fr 1fr;
  }

  .sg-price-out .hl {
    grid-column: span 2;
  }

  .sg-up-grid {
    grid-template-columns: 1fr;
  }

  .sg-side {
    grid-template-columns: 1fr;
  }

  .sg-side-help {
    grid-column: auto;
  }

  .sg-my {
    padding: 32px 0 40px;
  }

  .sg-my-list {
    grid-template-columns: 1fr;
  }

  .sg-done {
    padding: 30px 18px 24px;
  }

  .sg-bt {
    margin-bottom: 14px;
  }

  .sg-bt span {
    display: none;
  }

  /* 有底部 tab 时浮动条会让位（tabbar.js 会给 body 加 has-tb） */
  body.has-tb .float-bar {
    display: none;
  }

  #toast {
    bottom: 88px;
  }
}
