/* 快速工单页：视觉对齐「商户上门售后」 */
.ticket-app {
  --tk-primary: #0b6bcb;
  --tk-primary-dark: #0958a8;
  --tk-success: #07c160;
  --tk-danger: #b91c1c;
  --tk-bg: #f0f4f8;
  --tk-card: #ffffff;
  --tk-text: #0f172a;
  --tk-muted: #64748b;
  --tk-border: #dbe3ee;
  --tk-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  --tk-radius: 8px;
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #e8f1fa, #f0f4f8 45%, #f5f7fb);
  color: var(--tk-text);
  line-height: 1.5;
}
.ticket-app a { color: var(--tk-primary); text-decoration: none; }
.ticket-app * { box-sizing: border-box; }

/* —— 登录页 —— */
.ticket-app.ticket-login-page {
  background: linear-gradient(135deg, #e8f2ff 0%, #f5f6f7 100%);
}
.tk-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}
.tk-login-card {
  width: 100%;
  max-width: 420px;
  background: var(--tk-card);
  border-radius: 12px;
  box-shadow: var(--tk-shadow);
  padding: 40px 28px 32px;
  text-align: center;
}
.tk-login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--tk-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}
.tk-login-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: var(--tk-text);
}
.tk-login-card .subtitle {
  margin: 0 0 24px;
  color: var(--tk-muted);
  font-size: 14px;
}
.tk-login-card .error-msg {
  margin: 0 0 16px;
  padding: 10px;
  background: #fff1f0;
  border-radius: 8px;
  color: var(--tk-danger);
  font-size: 13px;
}
.tk-scan-wrap { display: flex; flex-direction: column; gap: 16px; }
.tk-scan-item {
  padding: 16px;
  background: var(--tk-bg);
  border-radius: var(--tk-radius);
}
.tk-scan-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--tk-text);
}
.tk-scan-hint, .tk-form-hint {
  color: var(--tk-muted);
  font-size: 13px;
  margin: 0 0 14px;
}
.tk-scan-box { min-height: 100px; }
.tk-qr-wrap img { border-radius: 8px; }
.tk-qr-wrap p { margin: 8px 0 0; font-size: 13px; color: #666; }
.tk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: var(--tk-radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: background .2s;
}
.tk-btn-primary { background: var(--tk-primary); color: #fff !important; }
.tk-btn-primary:hover { background: var(--tk-primary-dark); }
.tk-btn-wechat { background: var(--tk-success); color: #fff !important; }
.tk-btn-ghost {
  background: #fff;
  color: var(--tk-muted) !important;
  border: 1px solid var(--tk-border);
}
.tk-btn-sm { width: auto; padding: 6px 12px; font-size: 13px; font-weight: 500; }
.tk-mock {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--tk-border);
}
.tk-mock-toggle {
  margin: 0;
  cursor: pointer;
  color: var(--tk-primary);
  font-weight: 500;
  font-size: 14px;
}
.tk-mock-toggle .arrow { display: inline-block; transition: transform .2s; }
.tk-mock-box { margin-top: 12px; text-align: left; }
.tk-mock-box label {
  display: block;
  font-size: 13px;
  color: var(--tk-muted);
  margin-bottom: 6px;
}
.tk-mock-box input {
  width: 100%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--tk-border);
  border-radius: var(--tk-radius);
  font-size: 14px;
}

/* —— 工单主页 —— */
/* —— 工单主页抬头（对标上门售后 as-top） —— */
.tk-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 8px;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--tk-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.tk-top-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}
.tk-top-store {
  font-size: 15px;
  font-weight: 700;
  color: var(--tk-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.tk-top-page {
  font-size: 13px;
  color: var(--tk-muted);
  font-weight: 500;
  white-space: nowrap;
}
.tk-top-logout {
  flex-shrink: 0;
  color: var(--tk-primary);
  background: none;
  border: 0;
  font-size: 14px;
  text-decoration: none;
  padding: 4px 2px;
}
.tk-duty {
  margin: 0;
  padding: 6px 16px 8px;
  font-size: 11px;
  color: var(--tk-muted);
  background: rgba(255, 255, 255, .72);
  border-bottom: 1px solid var(--tk-border);
  line-height: 1.35;
}

/* 兼容旧类名（登录页等仍可能引用） */
.tk-header { display: none; }

.tk-stats {
  display: flex;
  gap: 4px;
  padding: 12px 10px 10px;
  background: #eff4f9;
  border-bottom: 1px solid #e3ebf3;
}
.tk-stat {
  flex: 1;
  text-align: center;
  min-width: 0;
  padding: 4px 2px;
}
.tk-stat .num {
  font-size: 22px;
  font-weight: 700;
  color: var(--tk-primary);
  line-height: 1.2;
}
.tk-stat .label {
  margin-top: 4px;
  font-size: 12px;
  color: var(--tk-muted);
}
.tk-stat-link {
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  transition: background .15s, box-shadow .15s;
  cursor: pointer;
}
.tk-stat-link:active,
.tk-stat-link:hover {
  background: rgba(37, 99, 235, .08);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .18);
}
.tk-stat-link .label {
  color: var(--tk-primary);
  font-weight: 600;
  font-size: 11px;
  line-height: 1.25;
}
.tk-stat-level {
  border-left: 1px solid #d5e0ea;
  margin-left: 2px;
  padding-left: 4px;
}
.tk-stat-level .num { font-size: 16px; font-weight: 600; }

/* 我的工单弹层（最大化全屏） */
.tk-sheet {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: stretch; justify-content: stretch;
}
.tk-sheet[hidden] { display: none !important; }
.tk-sheet-mask {
  position: absolute; inset: 0; background: #fff;
}
.tk-sheet-panel {
  position: relative; z-index: 1;
  width: 100%;
  height: 100%;
  max-height: 100%;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.tk-sheet-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid #e8eef5;
  flex-shrink: 0;
}
.tk-sheet-head h3 {
  flex: 1; margin: 0; font-size: 16px; font-weight: 700; color: #0f172a;
  text-align: center;
}
.tk-sheet-back, .tk-sheet-x {
  appearance: none; border: 0; background: #f1f5f9; color: #334155;
  border-radius: 8px; padding: 6px 10px; font: inherit; cursor: pointer;
  line-height: 1.2; min-width: 64px;
}
.tk-sheet-back.is-on {
  visibility: visible !important;
  background: var(--tk-primary, #2563eb);
  color: #fff;
  font-weight: 700;
  padding: 8px 12px;
}
.tk-sheet-back:not(.is-on) {
  visibility: hidden;
  pointer-events: none;
}
.tk-sheet-x { font-size: 18px; width: 36px; min-width: 36px; }
.tk-detail-backbar {
  position: sticky; top: 0; z-index: 2;
  display: flex; gap: 8px; margin: -4px 0 12px;
  padding: 8px 0 10px; background: #fff;
  border-bottom: 1px solid #e8eef5;
}
.tk-detail-backbar button {
  appearance: none; border: 0; border-radius: 8px;
  padding: 10px 14px; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--tk-primary, #2563eb); color: #fff;
}
.tk-sheet-body {
  overflow: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 14px 28px; flex: 1;
}
.tk-empty {
  text-align: center; color: #64748b; padding: 40px 12px; font-size: 14px;
}
.tk-ticket-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tk-ticket-item {
  border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px;
  background: #f8fafc; cursor: pointer;
}
.tk-ticket-item:active { background: #eff6ff; border-color: #bfdbfe; }
.tk-ticket-no {
  font-size: 12px; color: var(--tk-primary); font-weight: 700; word-break: break-all;
}
.tk-ticket-title {
  margin-top: 6px; font-size: 15px; font-weight: 600; color: #0f172a; line-height: 1.4;
}
.tk-ticket-meta {
  margin-top: 8px; display: flex; gap: 10px; align-items: center;
  font-size: 12px; color: #64748b; flex-wrap: wrap;
}
.tk-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: #dbeafe; color: #1d4ed8; font-weight: 600;
}
.tk-detail { display: grid; gap: 10px; }
.tk-detail-row {
  display: grid; grid-template-columns: 52px 1fr; gap: 8px;
  font-size: 14px; align-items: start;
}
.tk-detail-row > span:first-child { color: #64748b; }
.tk-detail-row strong { word-break: break-word; }
.tk-detail-row em { font-style: normal; color: #1d4ed8; font-weight: 600; }
.tk-detail-block h4 {
  margin: 8px 0 8px; font-size: 14px; color: #0f172a;
}
.tk-pre {
  white-space: pre-wrap; word-break: break-word; line-height: 1.55;
  font-size: 14px; color: #1e293b; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 10px 12px;
}
.tk-muted { color: #94a3b8; font-size: 13px; }
.tk-reply {
  border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px;
  background: #fff; margin-bottom: 10px;
}
.tk-reply.is-visitor {
  border-color: #bae6fd; background: #f0f9ff;
}
.tk-reply.is-visitor header strong { color: #0369a1; }
.tk-reply header {
  display: flex; justify-content: space-between; gap: 8px;
  margin-bottom: 8px; font-size: 13px; flex-wrap: wrap;
}
.tk-reply header time { color: #94a3b8; }
.tk-append-box {
  margin-top: 4px; padding-top: 4px;
  border-top: 1px dashed #e2e8f0;
}
.tk-append-hint { margin: 0 0 10px; }
.tk-append-form { display: grid; gap: 10px; }
.tk-append-form textarea {
  width: 100%; box-sizing: border-box; min-height: 88px;
  border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 12px;
  font: inherit; font-size: 14px; resize: vertical; background: #fff;
}
.tk-append-file-label {
  display: block; padding: 10px 12px; border-radius: 10px;
  border: 1px dashed #93c5fd; background: #eff6ff; color: #1d4ed8;
  font-size: 14px; font-weight: 600; cursor: pointer; text-align: center;
}
.tk-append-file-label input { display: none; }
.tk-append-files { font-size: 12px; word-break: break-all; }
.tk-append-submit {
  appearance: none; border: 0; border-radius: 10px; padding: 12px 14px;
  background: var(--tk-primary, #2563eb); color: #fff;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.tk-append-submit:disabled { opacity: .6; cursor: wait; }
.tk-append-closed { margin: 8px 0 0; }
.tk-media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px; margin-top: 10px;
}
.tk-media-grid img, .tk-media-grid video {
  width: 100%; height: 120px; object-fit: contain;
  border-radius: 8px; border: 1px solid #e2e8f0; background: #0f172a;
}
.tk-media-grid img {
  cursor: zoom-in;
}
/* 纯净全屏：仅图片，无标题/工具栏/翻页键 */
.tk-imgview {
  position: fixed; inset: 0; z-index: 1300;
  background: #000;
  display: block;
}
.tk-imgview[hidden] { display: none !important; }
.tk-imgview-stage {
  position: absolute; inset: 0;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  background: #000;
}
.tk-imgview-stage.is-dragging { cursor: grabbing; }
.tk-imgview-stage img {
  position: absolute;
  left: 50%; top: 50%;
  max-width: none;
  max-height: none;
  width: auto; height: auto;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  will-change: transform;
}
.tk-detail-more-toggle {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin: 4px 0 2px; padding: 10px 12px;
  border: 1px dashed #cbd5e1; border-radius: 10px;
  background: #f8fafc; color: var(--tk-primary);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tk-detail-more-toggle:active { background: #eff6ff; }
.tk-detail-more[hidden] { display: none !important; }
.tk-detail-more {
  display: grid; gap: 10px;
  margin-top: 4px; padding-top: 4px;
}

/* 温馨提示（表单内，对标 aftersale as-fee-tip） */
.tk-fee-tip,
.tk-tip {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.55;
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  font-size: 13px;
}
.tk-fee-tip #ticketTipText,
.tk-tip-text { margin: 0; }

.tk-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 14px 40px;
}
.tk-section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  color: var(--tk-text);
}
.tk-form-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--tk-muted);
  line-height: 1.5;
  text-align: left;
}
.tk-empty-bind {
  margin: 24px 0 8px;
  text-align: center;
  color: var(--tk-muted);
  font-size: 14px;
}
.tk-body {
  max-width: 560px;
  margin: 0 auto;
  padding: 12px 14px 48px;
}
.tk-panel {
  background: var(--tk-card);
  border-radius: 12px;
  border: 1px solid var(--tk-border);
  box-shadow: var(--tk-shadow);
  padding: 14px 14px 18px;
  margin-bottom: 12px;
}
.tk-panel[hidden] { display: none !important; }
.tk-panel-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--tk-text);
}
.tk-bind-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--tk-muted);
  line-height: 1.45;
}
.tk-btn-unbind { display: none !important; }

.tk-form .form-group { margin-bottom: 14px; }
.tk-form .form-group > label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--tk-text);
}
.tk-form .required { color: var(--tk-danger); }
.tk-form input[type="text"],
.tk-form input[type="search"],
.tk-form input[type="tel"],
.tk-form input[type="file"],
.tk-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--tk-border);
  border-radius: var(--tk-radius);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--tk-text);
}
.tk-form textarea { min-height: 88px; resize: vertical; }
.tk-form input:focus,
.tk-form textarea:focus {
  outline: none;
  border-color: var(--tk-primary);
  box-shadow: 0 0 0 3px rgba(11, 107, 203, .12);
}
.tk-remote-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tk-or-divider {
  text-align: center;
  color: var(--tk-muted);
  font-size: 12px;
  margin: 10px 0;
  position: relative;
}
.tk-or-divider::before,
.tk-or-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 28%;
  height: 1px;
  background: var(--tk-border);
}
.tk-or-divider::before { left: 0; }
.tk-or-divider::after { right: 0; }

.tk-suggest {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--tk-border);
  border-top: none;
  border-radius: 0 0 var(--tk-radius) var(--tk-radius);
  max-height: 180px;
  overflow: auto;
  background: #fff;
}
.tk-suggest li {
  padding: 10px 12px;
  border-bottom: 1px solid var(--tk-border);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}
.tk-suggest li:last-child { border-bottom: none; }
.tk-suggest li:hover { background: #e8f2ff; }
.tk-suggest small { color: var(--tk-muted); }

.tk-store-loc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 6px;
}
.tk-store-loc-head label { margin: 0; }
.tk-map-toggle {
  appearance: none; border: 0; padding: 6px 10px; border-radius: 8px;
  background: #eff6ff; color: var(--tk-primary, #2563eb);
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.tk-map-toggle:active { background: #dbeafe; }
.tk-store-loc-summary {
  display: grid; gap: 4px;
  padding: 12px 12px;
  border: 1px solid #dbeafe; border-radius: 10px;
  background: #f8fbff;
  margin-bottom: 4px;
}
.tk-store-loc-summary strong {
  font-size: 15px; color: #0f172a; line-height: 1.35;
}
.tk-store-loc-summary .tk-muted {
  font-size: 12px; color: var(--tk-muted); line-height: 1.4;
}
.tk-store-loc.is-bound-collapsed .tk-store-loc-mapbox[hidden] {
  display: none !important;
}
.tk-store-loc-mapbox #placeSearch { margin-top: 4px; }
.tk-map {
  height: 240px;
  width: 100%;
  border-radius: var(--tk-radius);
  border: 1px solid var(--tk-border);
  margin-top: 8px;
  z-index: 1;
}
.tk-map-meta {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--tk-muted);
  line-height: 1.4;
}
.tk-bind-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--tk-muted);
}

.tk-submit {
  margin-top: 4px;
  padding: 12px 16px;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: var(--tk-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.tk-submit:hover { background: var(--tk-primary-dark); }

.tk-footer-link {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
}
.tk-footer-link a { color: var(--tk-muted); }

.ticket-app .upload-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, .55);
  display: grid; place-items: center;
}
.ticket-app .upload-mask[hidden] { display: none !important; }
.ticket-app .upload-box {
  text-align: center;
  padding: 28px 36px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--tk-shadow);
  color: var(--tk-text);
}
.ticket-app .spinner {
  width: 36px; height: 36px; margin: 0 auto 12px;
  border: 3px solid var(--tk-border);
  border-top-color: var(--tk-primary);
  border-radius: 50%;
  animation: tk-spin .8s linear infinite;
}
@keyframes tk-spin { to { transform: rotate(360deg); } }

/* 提交成功：关注公众号友好引导（可关闭，不强制） */
.tk-follow-toast {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px 16px 28px;
  background: rgba(15, 23, 42, .28);
  box-sizing: border-box;
  pointer-events: auto;
}
.tk-follow-toast[hidden] { display: none !important; }
.tk-follow-card {
  position: relative;
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 20px 18px 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, .22);
  animation: tk-follow-up .28s ease;
}
@keyframes tk-follow-up {
  from { transform: translateY(24px); opacity: .6; }
  to { transform: translateY(0); opacity: 1; }
}
.tk-follow-x {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: #f1f5f9; color: #64748b; font-size: 20px; line-height: 1; cursor: pointer;
}
.tk-follow-card h3 {
  margin: 0 28px 6px 0; font-size: 18px; color: #0f172a;
}
.tk-follow-no {
  margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--tk-primary, #2563eb);
}
.tk-follow-tip {
  margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: #475569;
}
.tk-follow-qr-wrap { text-align: center; margin: 4px 0 12px; }
.tk-follow-qr {
  width: min(180px, 56vw); height: auto;
  border-radius: 10px; border: 1px solid #e2e8f0; background: #fff;
}
.tk-follow-noqr { margin: 0 0 12px; font-size: 13px; }
.tk-follow-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.tk-follow-actions .tk-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600;
  text-decoration: none; border: 0; cursor: pointer; font: inherit;
}
.tk-follow-actions .tk-btn-primary { background: var(--tk-primary, #2563eb); color: #fff; }
.tk-follow-actions .tk-btn-ghost { background: #f1f5f9; color: #334155; }

@media (max-width: 420px) {
  .tk-remote-row { grid-template-columns: 1fr; }
  .tk-stat .num { font-size: 20px; }
  .tk-top-store { font-size: 14px; }
  .tk-top-page { font-size: 12px; }
}
