/*
 * LinsGeek ERP —— TikTok「售后处理」页面样式（配合 67-tk-aftersale.js）
 * 外观和 TikTok「买家聊天」（66-tk-chat.css）一致；所有样式名用 lg-tka- 前缀，不依赖其他页面的样式。
 * 电脑：每个售后单一张卡片，左边商品、右边信息；手机：上下排列，按钮占满一行。
 * 回滚：删除 67-tk-aftersale.css + 67-tk-aftersale.js。
 */
#lg-tka {
  --k-brand: #0d7b6d; --k-bright: #13b8a6; --k-soft: #e7f2f0; --k-ink: #0f1a18; --k-muted: #6b7a77; --k-line: rgba(15, 35, 30, .08); --k-red: #d64545;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--k-ink); padding: 4px 0 24px; max-width: 1280px; min-width: 0;
}
#lg-tka *, #lg-tka *::before, #lg-tka *::after { box-sizing: border-box; }
#lg-tka svg { width: 16px; height: 16px; flex: 0 0 auto; }
#lg-tka .lg-tka-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
#lg-tka .lg-tka-title h1 { margin: 0; font-size: 24px; font-weight: 700; }
#lg-tka .lg-tka-title p { margin: 4px 0 0; color: var(--k-muted); font-size: 13.5px; max-width: 720px; line-height: 1.5; }
#lg-tka .lg-tka-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- 按钮 / 小标签（页面里和弹窗里都用） ---------- */
.lg-tka-btn {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: 12px; font-size: 14px; font-weight: 600; white-space: nowrap; font-family: inherit; transition: background .12s;
}
.lg-tka-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.lg-tka-btn.sm { height: 34px; padding: 0 14px; font-size: 13px; }
.lg-tka-btn.primary { background: #0d7b6d; color: #fff; box-shadow: 0 8px 18px -12px rgba(13,123,109,.7); }
.lg-tka-btn.primary:hover { background: #0a6257; }
.lg-tka-btn.ghost { background: #e7f2f0; color: #0d7b6d; }
.lg-tka-btn.ghost:hover { background: #d7ebe7; }
.lg-tka-btn.danger { background: #fdecec; color: #c23636; }
.lg-tka-btn.danger:hover { background: #fadada; }
.lg-tka-btn.danger.solid { background: #d64545; color: #fff; }
.lg-tka-btn.danger.solid:hover { background: #bd3434; }
.lg-tka-btn:focus-visible, .lg-tka-chip:focus-visible, .lg-tka-x:focus-visible { outline: 2px solid #13b8a6; outline-offset: 2px; }
.lg-tka-btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
/* 弹窗里的确认按钮：平时不显示图标，请求进行中显示转圈 */
.lg-tka-dialog-foot .lg-tka-btn svg { display: none; }
.lg-tka-dialog-foot .lg-tka-btn.spin svg { display: block; }
.lg-tka-btn.spin svg { animation: lg-tka-spin .8s linear infinite; }
@keyframes lg-tka-spin { to { transform: rotate(360deg); } }
.lg-tka-spinner { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid #d7ebe7; border-top-color: #0d7b6d; animation: lg-tka-spin .8s linear infinite; flex: 0 0 auto; }

/* ---------- 筛选区 ---------- */
#lg-tka .lg-tka-field { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid #dfe6e4; border-radius: 12px; background: #fff; color: var(--k-muted); min-width: 0; }
#lg-tka .lg-tka-field:focus-within { border-color: #13b8a6; box-shadow: 0 0 0 3px rgba(19,184,166,.15); }
#lg-tka .lg-tka-field input, #lg-tka .lg-tka-field select { all: unset; flex: 1; min-width: 0; height: 100%; font-size: 14px; color: var(--k-ink); font-family: inherit; }
#lg-tka .lg-tka-field input::placeholder { color: #9aa7a4; }
#lg-tka .lg-tka-field select { cursor: pointer; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7a77' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>") right center / 16px no-repeat; padding-right: 20px; line-height: 36px; }
#lg-tka .lg-tka-field.shop { width: 220px; }
#lg-tka .lg-tka-field.kw { width: 300px; max-width: 100%; margin: 8px 0; }
#lg-tka .lg-tka-panel { background: #fff; border: 1px solid var(--k-line); border-radius: 20px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 18px 40px -32px rgba(13,123,109,.45); overflow: hidden; }
#lg-tka .lg-tka-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 16px; border-bottom: 1px solid var(--k-line); }
#lg-tka .lg-tka-tabs { display: flex; gap: 6px; align-self: stretch; }
#lg-tka .lg-tka-tab { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; min-height: 54px; font-size: 14.5px; color: #4b5a57; border-bottom: 2px solid transparent; white-space: nowrap; font-family: inherit; }
#lg-tka .lg-tka-tab b { font-size: 11.5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #eef2f1; display: inline-flex; align-items: center; justify-content: center; }
#lg-tka .lg-tka-tab.hot b { background: #fdecec; color: #d64545; }
#lg-tka .lg-tka-tab.on { color: #0d7b6d; font-weight: 700; border-bottom-color: #0d7b6d; }
#lg-tka .lg-tka-tab.on b { background: #0d7b6d; color: #fff; }
#lg-tka .lg-tka-tab.on.hot b { background: #d64545; color: #fff; }
#lg-tka .lg-tka-tab:focus-visible { outline: 2px solid #13b8a6; outline-offset: -2px; }
#lg-tka .lg-tka-kinds { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px 4px; }
.lg-tka-chip { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #4b5a57; background: #f1f4f3; font-family: inherit; white-space: nowrap; }
.lg-tka-chip:hover { background: #e7f2f0; }
.lg-tka-chip i { font-style: normal; font-size: 12px; font-weight: 700; opacity: .7; font-variant-numeric: tabular-nums; }
.lg-tka-chip.on { background: #0d7b6d; color: #fff; }

/* ---------- 列表 / 卡片 ---------- */
#lg-tka .lg-tka-list { display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 16px; min-height: 280px; transition: opacity .15s; }
#lg-tka .lg-tka-list.dim { opacity: .55; pointer-events: none; }
#lg-tka .lg-tka-card { border: 1px solid #e3eae8; border-radius: 16px; background: #fff; overflow: hidden; }
#lg-tka .lg-tka-card.pending { border-color: #cfe5e2; }
#lg-tka .lg-tka-card.busy { opacity: .7; }
#lg-tka .lg-tka-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; background: #f7faf9; border-bottom: 1px solid var(--k-line); }
#lg-tka .lg-tka-type { font-size: 14.5px; font-weight: 700; }
.lg-tka-pill { font-style: normal; display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 1px 9px; border-radius: 999px; background: #eef2f1; color: #4b5a57; font-size: 12px; font-weight: 600; white-space: nowrap; }
.lg-tka-pill.warn { background: #fff4df; color: #9a6410; }
.lg-tka-pill.ok { background: #e3f5ec; color: #17794a; }
.lg-tka-pill.bad { background: #fdecec; color: #c23636; }
.lg-tka-pill.kind.ret { background: #e7f2f0; color: #0d7b6d; }
.lg-tka-pill.kind.can { background: #ecebfb; color: #4a43b5; }
/* 截止时间：醒目，放在卡片头部右边 */
#lg-tka .lg-tka-due { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: #fff4df; color: #9a6410; font-size: 13px; white-space: nowrap; }
#lg-tka .lg-tka-due b { font-weight: 700; font-variant-numeric: tabular-nums; }
#lg-tka .lg-tka-due small { font-size: 12px; opacity: .8; }
#lg-tka .lg-tka-due.red { background: #fdecec; color: #c23636; }
#lg-tka .lg-tka-due.over { background: #d64545; color: #fff; }
#lg-tka .lg-tka-card-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; padding: 14px 16px; }
#lg-tka .lg-tka-goods { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
#lg-tka .lg-tka-good { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
#lg-tka .lg-tka-good > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#lg-tka .lg-tka-good b { font-size: 13.5px; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
#lg-tka .lg-tka-good span { font-size: 12.5px; color: var(--k-muted); overflow-wrap: anywhere; }
#lg-tka .lg-tka-good em { font-style: normal; font-size: 13px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lg-tka-thumb { width: 56px; height: 56px; flex: 0 0 auto; border-radius: 12px; overflow: hidden; background: #f1f4f3; border: 1px solid rgba(15,35,30,.06); display: inline-flex; align-items: center; justify-content: center; color: #9db3af; }
.lg-tka-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lg-tka-thumb svg { width: 24px !important; height: 24px !important; }
#lg-tka .lg-tka-facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; align-content: start; min-width: 0; }
#lg-tka .lg-tka-facts > div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
#lg-tka .lg-tka-facts > div.wide, #lg-tka .lg-tka-facts > div.amt { grid-column: 1 / -1; }
#lg-tka .lg-tka-facts dt { font-size: 12px; color: var(--k-muted); }
#lg-tka .lg-tka-facts dd { margin: 0; font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
#lg-tka .lg-tka-facts .id dd { font-variant-numeric: tabular-nums; user-select: all; }
#lg-tka .lg-tka-facts .amt dd { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
#lg-tka .lg-tka-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--k-line); }
#lg-tka .lg-tka-next { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #9a6410; min-width: 0; }
#lg-tka .lg-tka-next.ext { color: #4b5a57; }
#lg-tka .lg-tka-next.done { color: #17794a; font-weight: 500; }
#lg-tka .lg-tka-next.done.rej { color: #6b7a77; }
#lg-tka .lg-tka-ops { display: flex; gap: 8px; margin-left: auto; }
#lg-tka .lg-tka-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 0 16px 14px; font-size: 13px; color: var(--k-muted); }
#lg-tka .lg-tka-foot:empty { display: none; }
#lg-tka .lg-tka-pager { display: flex; align-items: center; gap: 10px; }

/* 空状态 / 加载 / 出错 */
.lg-tka-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 48px 16px; text-align: center; color: #6b7a77; font-size: 13.5px; }
.lg-tka-empty > svg { width: 44px !important; height: 44px !important; color: #13b8a6; }
.lg-tka-empty b { color: #0f1a18; font-size: 15px; }
.lg-tka-empty.err > svg { color: #d64545; }
.lg-tka-empty.err b { font-weight: 600; max-width: 520px; overflow-wrap: anywhere; }
.lg-tka-empty .lg-tka-btn { margin-top: 6px; }

/* ---------- 弹窗与提示 ---------- */
.lg-tka-modal { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 30, 26, .45); font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif; }
.lg-tka-modal *, .lg-tka-modal *::before, .lg-tka-modal *::after { box-sizing: border-box; }
.lg-tka-dialog { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 20px; padding: 20px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.35); color: #0f1a18; }
.lg-tka-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.lg-tka-dialog-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.lg-tka-x { all: unset; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #6b7a77; flex: 0 0 auto; }
.lg-tka-x:hover { background: #eef2f1; }
.lg-tka-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.lg-tka-sum { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #f7faf9; border: 1px solid rgba(15,35,30,.06); }
.lg-tka-sum > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lg-tka-sum > div:not(.amt) { flex: 1; }
.lg-tka-sum b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-tka-sum span, .lg-tka-sum small { font-size: 12.5px; color: #6b7a77; overflow-wrap: anywhere; }
.lg-tka-sum .amt { text-align: right; flex: 0 0 auto; }
.lg-tka-sum .amt em { font-style: normal; font-size: 18px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lg-tka-what { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; font-size: 14px; line-height: 1.6; color: #2b3533; }
.lg-tka-what.pay { padding: 10px 12px; border-radius: 12px; background: #fff8e6; border: 1px solid #f2d48a; color: #6b4e00; }
.lg-tka-what svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; color: #b7791f; }
.lg-tka-check { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid #dfe6e4; cursor: pointer; font-size: 14px; font-weight: 600; }
.lg-tka-check:hover { background: #f7faf9; }
.lg-tka-check input, .lg-tka-reason input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: #0d7b6d; cursor: pointer; }
.lg-tka-label { margin: 14px 0 8px; font-size: 13.5px; font-weight: 600; }
.lg-tka-reasons { display: flex; flex-direction: column; gap: 6px; }
.lg-tka-reason { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid #dfe6e4; cursor: pointer; font-size: 14px; line-height: 1.45; }
.lg-tka-reason:hover { background: #f7faf9; }
.lg-tka-reason:has(input:checked) { border-color: #0d7b6d; background: #e7f2f0; }
.lg-tka-reason:has(input:focus-visible) { outline: 2px solid #13b8a6; outline-offset: 2px; }
.lg-tka-reason input { margin-top: 1px; }
.lg-tka-reasons-msg { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 12px; border-radius: 12px; background: #f7faf9; color: #6b7a77; font-size: 13.5px; line-height: 1.5; }
.lg-tka-reasons-msg span { flex: 1; min-width: 160px; overflow-wrap: anywhere; }
.lg-tka-reasons-msg.err { background: #fdecec; color: #a12d2d; }
.lg-tka-reasons-msg svg { width: 18px; height: 18px; flex: 0 0 auto; }
.lg-tka-comment { display: block; width: 100%; margin-top: 12px; font: inherit; font-size: 14px; line-height: 1.5; padding: 10px 12px; border-radius: 12px; border: 1px solid #dfe6e4; outline: none; resize: vertical; color: #0f1a18; background: #fff; }
.lg-tka-comment:focus { border-color: #13b8a6; box-shadow: 0 0 0 3px rgba(19,184,166,.15); }
.lg-tka-count { margin-top: 4px; text-align: right; font-size: 12px; color: #6b7a77; font-variant-numeric: tabular-nums; }
.lg-tka-count.near { color: #d64545; font-weight: 700; }
.lg-tka-toast { position: fixed; left: 50%; top: 72px; z-index: 3100; transform: translateX(-50%); padding: 10px 18px; border-radius: 18px; background: #0d7b6d; color: #fff; font-size: 14px; font-weight: 600; line-height: 1.45; box-shadow: 0 12px 30px -12px rgba(0,0,0,.4); max-width: min(560px, calc(100vw - 32px)); overflow-wrap: anywhere; font-family: 'Noto Sans SC', sans-serif; transition: opacity .3s, transform .3s; }
.lg-tka-toast.bad { background: #d64545; }
.lg-tka-toast.out { opacity: 0; transform: translate(-50%, -8px); }

/* ---------- 菜单 ---------- */
aside [data-lg-tka-menu] a, .el-popper [data-lg-tka-head], .el-popper [data-lg-tka-head] a { cursor: pointer; }
aside [data-lg-tka-menu] .lg-tka-active { background: #e8f8f6 !important; color: #0d7b6d !important; }
/* 复制菜单项时可能带过来原菜单的高亮：不在本页时去掉；在本页时别的菜单项不高亮 */
aside [data-lg-tka-menu] .\!bg-\[\#E8F8F6\]:not(.lg-tka-active) { background: transparent !important; }
body.lg-tka-on aside li:not([data-lg-tka-menu]) .\!bg-\[\#E8F8F6\] { background: transparent !important; }
.lg-tka-badge { font-style: normal; margin-left: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #d64545; color: #fff; font-size: 11px; font-weight: 700; line-height: 1; display: inline-flex; align-items: center; justify-content: center; align-self: center; vertical-align: middle; }
.lg-tka-badge[hidden] { display: none; }

/* ---------- 平板 / 手机 ---------- */
@media (max-width: 1023px) {
  #lg-tka .lg-tka-card-body { grid-template-columns: minmax(0, 1fr); gap: 14px; }
}
@media (max-width: 767px) {
  #lg-tka { padding: 0 0 12px; }
  #lg-tka .lg-tka-title h1 { font-size: 20px; }
  #lg-tka .lg-tka-head-actions { width: 100%; }
  #lg-tka .lg-tka-field.shop { flex: 1; width: auto; }
  #lg-tka .lg-tka-panel { border-radius: 16px; }
  #lg-tka .lg-tka-bar { padding: 0 12px; }
  #lg-tka .lg-tka-tab { min-height: 46px; }
  #lg-tka .lg-tka-field.kw { width: 100%; margin: 0 0 10px; }
  #lg-tka .lg-tka-kinds { padding: 10px 12px 2px; }
  #lg-tka .lg-tka-list { padding: 10px 12px 12px; }
  #lg-tka .lg-tka-card-head, #lg-tka .lg-tka-card-body, #lg-tka .lg-tka-card-foot { padding-left: 12px; padding-right: 12px; }
  #lg-tka .lg-tka-due { margin-left: 0; width: 100%; justify-content: center; }
  #lg-tka .lg-tka-ops { width: 100%; }
  #lg-tka .lg-tka-ops .lg-tka-btn { flex: 1; height: 40px; }
  #lg-tka .lg-tka-foot { padding: 0 12px 12px; }
  .lg-tka-sum { flex-wrap: wrap; }
  .lg-tka-dialog-foot .lg-tka-btn { flex: 1; }
}
