﻿:root {
  --bg: #f5f6f8;
  --card: #fff;
  --primary: #1a6fb5;
  --primary-light: #e8f2fa;
  --text: #1a1a1a;
  --muted: #8a8f98;
  --border: #e8eaed;
  --success: #2d8a5e;
  --danger: #c43d3d;
  --warn: #c45c26;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
}
#app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}
.page {
  display: none !important;
  position: absolute;
  inset: 0;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
  z-index: 1;
  padding-bottom: calc(56px + var(--safe-bottom));
}
.page.active {
  display: flex !important;
  z-index: 2;
}
.nav-bar {
  height: 48px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  flex-shrink: 0;
  position: relative;
}
.nav-bar .back { color: var(--primary); font-size: 28px; width: 40px; cursor: pointer; line-height: 1; }
.nav-bar .title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; margin-right: 40px; }
.nav-upload-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  border: none; background: var(--primary); color: #fff; font-size: 14px;
  padding: 6px 14px; border-radius: 16px; cursor: pointer; font-weight: 600;
}
.nav-upload-btn:active { opacity: 0.85; }
.content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: calc(56px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 1000;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.tab-bar.tab-bar--hidden { display: none !important; }
nav#tabBar.tab-bar--dedao {
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.tab-bar .tab {
  flex: 1;
  border: none;
  background: none;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding-top: 6px;
}
.tab-bar .tab.active { color: var(--primary); font-weight: 600; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 14px 20px;
  font-size: 16px;
  width: 100%;
  cursor: pointer;
}
.btn-primary:disabled { opacity: 0.6; }
.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 24px;
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
}
.input {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  margin-bottom: 12px;
}
textarea.input { min-height: 160px; resize: vertical; font-family: inherit; }
.login-page { padding: 48px 24px; text-align: center; }
.login-page .logo { font-size: 56px; margin-bottom: 16px; }
.login-page h1 { font-size: 22px; margin-bottom: 8px; }
.login-page .sub { color: var(--muted); font-size: 14px; margin-bottom: 32px; line-height: 1.6; }
.case-card {
  margin: 12px;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
}
.case-card .thumb {
  height: 100px;
  background: linear-gradient(135deg, #d4e8f7, #b8d4eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  position: relative;
}
.case-card .badge {
  position: absolute;
  left: 8px; top: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
}
.case-card .body { padding: 12px; }
.case-card h3 { font-size: 16px; line-height: 1.4; margin-bottom: 6px; }
.case-card .meta { font-size: 12px; color: var(--muted); }
.tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 6px;
  margin-top: 6px;
}
.sales-letter { margin: 12px; padding: 16px; background: var(--card); border-radius: 12px; font-size: 15px; line-height: 1.75; }
.sales-letter h4 { color: var(--primary); font-size: 14px; margin: 14px 0 6px; }
.sales-letter h4:first-child { margin-top: 0; }
.bottom-bar {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.bottom-bar .btn-outline { flex: 0 0 auto; }
.bottom-bar .btn-primary { flex: 1; }
.menu-list { margin: 12px; background: var(--card); border-radius: 12px; overflow: hidden; }
.menu-item {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
}
.mine-header { padding: 24px 16px; background: var(--card); display: flex; gap: 14px; align-items: center; }
.mine-header .avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; overflow: hidden; flex-shrink: 0;
}
.mine-header .avatar.has-img img,
.mine-header .avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.card-nick-label { text-align: center; font-weight: 600; font-size: 16px; margin: 8px 0 0; }
.step { display: flex; gap: 12px; align-items: center; margin: 10px 16px; font-size: 14px; }
.step .dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: #ddd; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0;
}
.step.done .dot { background: var(--success); color: #fff; }
.step.active .dot { background: var(--primary); color: #fff; }
.callout { margin: 12px; padding: 12px; background: #fef8e8; border-radius: 8px; font-size: 13px; color: #8a6d3b; line-height: 1.5; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; }
.err { color: var(--danger); font-size: 12px; padding: 0 12px 12px; }
.compliance { text-align: center; font-size: 11px; color: var(--muted); padding: 12px; }
#toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,.78); color: #fff; padding: 10px 18px; border-radius: 20px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
  max-width: 90%; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.upload-types { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.upload-type {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 28px 12px; text-align: center; cursor: pointer; text-decoration: none; color: inherit;
}
.upload-type.wide { grid-column: 1 / -1; }
.upload-type .icon { font-size: 32px; margin-bottom: 8px; }
.form-section { padding: 16px; }
.checkbox { font-size: 14px; display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; }

.tag-pill.tag-select { cursor: pointer; }
.tag-pill.tag-select.active { background: var(--primary); color: #fff; }
.search-box { margin: 12px; background: var(--card); border-radius: 20px; padding: 10px 14px; color: var(--muted); font-size: 14px; cursor: pointer; border: 1px solid var(--border); }
.plan-card { margin: 12px; padding: 16px; background: var(--card); border-radius: 12px; border: 2px solid var(--primary); }
.plan-card.muted { border-color: var(--border); opacity: .9; }
.plan-card h3 { font-size: 16px; }

.file-picker {
  display: block;
  padding: 20px 16px;
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 8px;
}
.file-picker input { display: none; }
.file-picker span { color: var(--primary); font-size: 15px; }
.media-preview-wrap { margin: 8px 0 12px; background: #000; border-radius: 12px; overflow: hidden; }
.media-preview, .detail-player { width: 100%; max-height: 280px; display: block; background: #000; object-fit: contain; }
.detail-media { background: var(--card); padding: 0; }
.upload-progress { margin-top: 12px; }
.upload-progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.upload-progress-bar div { height: 100%; width: 0; background: var(--primary); transition: width 0.2s; }

.record-lang-row { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.record-lang-row label { font-size:13px; color:var(--muted); white-space:nowrap; }
.record-mode-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.record-mode-card {
  background:var(--card); border:2px solid var(--border); border-radius:12px;
  padding:16px 12px; text-align:center; cursor:pointer;
}
.record-mode-card.disabled { opacity:0.55; cursor:not-allowed; }
.record-mode-card:not(.disabled):active { border-color:var(--primary); background:var(--primary-light); }
.record-mode-card .rm-icon { font-size:28px; margin-bottom:6px; }
.record-mode-card .rm-title { font-weight:600; font-size:14px; }
.record-mode-card .rm-desc { font-size:11px; color:var(--muted); margin-top:4px; }
.record-gen-grid { display:grid; grid-template-columns:1fr; gap:8px; margin-bottom:4px; }
.record-gen-card {
  border:1px solid var(--border); border-radius:12px; padding:10px 12px; background:#fff;
  cursor:pointer; transition:border-color .15s, background .15s;
}
.record-gen-card.active { border-color:var(--primary); background:var(--primary-light); }
.record-gen-title { font-weight:600; font-size:14px; }
.record-gen-desc { font-size:11px; color:var(--muted); margin-top:2px; }

.detail-refine-wrap { padding:20px 16px 8px; }
.detail-refine-hint { font-size:13px; color:var(--muted); text-align:center; margin:0 0 16px; line-height:1.5; }
.detail-refine-grid { display:grid; grid-template-columns:1fr; gap:10px; }
.detail-refine-card {
  display:flex; flex-direction:column; align-items:flex-start; gap:4px;
  width:100%; padding:14px 16px; border:1px solid var(--border); border-radius:12px;
  background:var(--color-card); text-align:left; cursor:pointer;
}
.detail-refine-card:active { border-color:var(--primary); background:var(--primary-light); }
.detail-refine-title { font-weight:600; font-size:15px; color:var(--color-text); }
.detail-refine-desc { font-size:12px; color:var(--muted); }
.record-live-body { display:flex; flex-direction:column; align-items:stretch; padding:8px 12px 24px; width:100%; box-sizing:border-box; min-height:calc(100vh - 56px); }
.record-timer { font-size:40px; font-weight:300; letter-spacing:2px; margin:8px 0 4px; font-variant-numeric:tabular-nums; text-align:center; }
.record-timer-compact { font-size:15px; font-weight:500; letter-spacing:1px; margin:10px 0 0; color:var(--muted); }
.record-limit-compact { text-align:center; margin:2px 0 0 !important; font-size:11px; }
.record-status-compact { text-align:center; min-height:16px; margin:4px 0 0 !important; font-size:12px; }
.record-transcript-wrap {
  width:100%; max-width:none; flex:1; margin:8px 0 10px; border:none; border-radius:0;
  background:transparent; overflow:hidden; display:flex; flex-direction:column;
}
.record-transcript-main .record-transcript { flex:1; max-height:none; background:#fff; border-radius:12px; border:1px solid var(--border); }
.record-transcript-head {
  display:flex; justify-content:space-between; align-items:center; padding:8px 12px;
  font-size:12px; color:var(--muted); border-bottom:1px solid var(--border); background:#fff;
}
.record-asr-badge { font-size:11px; padding:2px 8px; border-radius:10px; background:var(--primary-light); color:var(--primary); }
.record-asr-badge.live { background:#e8f5e9; color:#2e7d32; }
.record-asr-badge.wait { background:#fff3e0; color:#ef6c00; }
.record-transcript {
  min-height:180px; max-height:52vh; overflow-y:auto; padding:14px 16px; font-size:17px; line-height:1.75;
  text-align:left; word-break:break-word;
}
.record-transcript-placeholder { color:var(--muted); font-size:14px; margin:0; }
.record-transcript .line-final { margin:0; }
.record-transcript .record-flow-text { font-size:17px; line-height:1.75; color:#1a1a1a; white-space:pre-wrap; word-break:break-word; }
.record-transcript .line-interim { color:#9aa0a6; }
.record-transcript .record-cursor { display:inline-block; color:var(--primary); animation:record-cursor-blink 1s step-end infinite; margin-left:1px; }
@keyframes record-cursor-blink { 50% { opacity:0; } }
.note-gen-banner {
  text-align:center; padding:10px 12px; margin-bottom:12px; font-size:13px; color:#ef6c00;
  background:#fff8f0; border-radius:8px;
}
.record-wave { display:flex; gap:6px; height:40px; align-items:flex-end; margin:16px 0; opacity:0.35; }
.record-wave span { width:6px; background:var(--primary); border-radius:3px; height:12px; }
.record-wave.active span { animation:wave 0.8s ease-in-out infinite; }
.record-wave.active span:nth-child(2){ animation-delay:0.1s; }
.record-wave.active span:nth-child(3){ animation-delay:0.2s; }
.record-wave.active span:nth-child(4){ animation-delay:0.3s; }
.record-wave.active span:nth-child(5){ animation-delay:0.4s; }
@keyframes wave { 0%,100%{height:12px} 50%{height:36px} }
.btn-record-stop {
  width:72px; height:72px; border-radius:50%; border:none;
  background:#e53935; color:#fff; font-size:22px; cursor:pointer;
  box-shadow:0 4px 16px rgba(229,57,53,0.45);
}
.btn-record-stop:disabled { opacity:0.5; }

.filter-row { padding: 8px 16px; display: flex; gap: 8px; background: var(--card); border-bottom: 1px solid var(--border); }
.filter-chip { border: 1px solid var(--border); background: #fff; padding: 6px 14px; border-radius: 16px; font-size: 13px; cursor: pointer; }
.filter-chip.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.due-badge { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; background: #ffebee; color: var(--danger); padding: 2px 8px; border-radius: 10px; }
.customer-card { margin: 12px 16px; padding: 14px; background: var(--card); border-radius: 12px; border: 1px solid var(--border); cursor: pointer; }
.customer-card.due { border-color: #ffcdd2; background: #fff8f8; }
.customer-card .cc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.customer-card .cc-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--primary-light); color: var(--primary); }
.log-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.log-item p { margin-top: 4px; font-size: 14px; }
.card-preview-wrap { margin-bottom: 16px; }
.card-preview-inner, .public-card { background: linear-gradient(180deg, var(--primary-light) 0%, #fff 40%); border-radius: 16px; padding: 20px; border: 1px solid var(--border); }
.cp-avatar { width: 64px; height: 64px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto 12px; }
.cp-headline { text-align: center; color: var(--primary); font-weight: 600; margin: 8px 0; }
.cp-bio { font-size: 14px; line-height: 1.6; color: var(--text); margin: 12px 0; }
.tag-chip { display: inline-block; font-size: 11px; padding: 4px 10px; margin: 2px 4px 2px 0; border-radius: 12px; background: var(--primary-light); color: var(--primary); }
.cp-case { padding: 10px 12px; background: #fff; border-radius: 8px; margin-top: 8px; border: 1px solid var(--border); font-size: 14px; }
.cp-case.link { cursor: pointer; color: var(--primary); }
.case-pick-list label { display: block; padding: 8px 0; font-size: 14px; }
.case-pick-list input { margin-right: 8px; }

.case-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.case-card .thumb.thumb-text { flex-direction: column; gap: 6px; padding: 12px; font-size: 14px; }
.case-card .thumb .text-excerpt { font-size: 13px; color: var(--text); line-height: 1.4; max-height: 40px; overflow: hidden; }
.case-card .thumb.thumb-text-card {
  display: flex; align-items: stretch; padding: 0; background: #fffaf0; min-height: 100px;
}
.case-card .thumb-text-side {
  width: 72px; background: linear-gradient(180deg, #ffe0b2, #ffcc80);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; font-size: 11px; color: #e65100; flex-shrink: 0;
}
.case-card .thumb-text-side .text-icon-lg { font-size: 26px; }
.case-card .thumb-text-body {
  flex: 1; padding: 12px 14px; display: flex; align-items: center; background: #fff;
}
.case-card .thumb-excerpt {
  margin: 0; font-size: 13px; line-height: 1.55; color: #333;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.case-card .thumb.thumb-video-fallback {
  background: linear-gradient(135deg, #1a237e, #3949ab); color: #fff;
  flex-direction: column; gap: 6px; padding: 12px;
}
.case-card .thumb.thumb-image-fallback {
  background: linear-gradient(135deg, #e8f5e9, #a5d6a7); color: #2e7d32;
  flex-direction: column; gap: 6px; padding: 12px;
}
.case-card .thumb .play-icon-lg {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.case-card .thumb .thumb-fallback-icon { font-size: 32px; }
.case-card .thumb .thumb-fallback-label { font-size: 12px; opacity: .9; }
.case-card .thumb .thumb-fallback-title {
  margin: 0; font-size: 14px; font-weight: 600; text-align: center; max-width: 90%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mine-avatar-pick { cursor: pointer; }
.mine-avatar-pick:active { opacity: 0.85; }
.case-card .thumb .play-icon {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 28px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.55);
  color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; padding-left: 2px;
}
.case-card .body-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.case-card .body-row .body-main { flex: 1; min-width: 0; }
.btn-share-case {
  flex-shrink: 0; border: none; background: none; color: var(--primary); font-size: 13px;
  padding: 4px 0; cursor: pointer; white-space: nowrap;
}

.customer-today-banner {
  background: #FF4D4F; color: #fff; height: 44px; line-height: 44px; text-align: center;
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.customer-card .cc-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #FF4D4F; flex-shrink: 0; margin-right: 10px; margin-top: 6px;
}
.customer-card .cc-row { display: flex; align-items: flex-start; }
.cust-tags-group { display: flex; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
.cust-tags-group .tag-check { font-size: 14px; display: flex; align-items: center; gap: 4px; }

.avatar-upload-wrap { display: flex; flex-direction: column; align-items: center; margin-bottom: 12px; }
.avatar-upload {
  width: 80px; height: 80px; border-radius: 50%; background: #f0f0f0; border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; position: relative;
}
.avatar-upload img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload span { font-size: 11px; color: var(--muted); text-align: center; padding: 8px; line-height: 1.3; }
.cp-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.page-p-with-bar .public-card-scroll { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
.card-contact-bar {
  position: fixed; left: 0; right: 0; bottom: 0; background: #fff;
  border-top: 0.5px solid #E2E8F0; display: flex; gap: 10px; align-items: center;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 100;
  max-width: 480px; margin: 0 auto; box-sizing: border-box;
}
.btn-card-msg {
  flex: 2; height: 48px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, #2563EB, #1E40AF); color: #fff;
  font-size: 15px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-card-wechat {
  flex: 1.2; height: 48px; border: 1px solid #BFDBFE; border-radius: 14px;
  background: #EFF6FF; color: #2563EB;
  font-size: 14px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 4px;
}
.btn-card-phone {
  flex: 0 0 48px; width: 48px; min-width: 48px; height: 48px;
  border: 1px solid #E2E8F0; border-radius: 14px; background: #F8FAFC; color: #475569;
  font-size: 15px; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
.btn-card-msg:disabled, .btn-card-wechat:disabled, .btn-card-phone:disabled { opacity: 0.45; cursor: not-allowed; }

.cp-case-card {
  display: flex; gap: 12px; align-items: center; padding: 10px 12px; background: #fff;
  border-radius: 10px; margin-top: 8px; border: 1px solid var(--border); cursor: pointer;
}
.cp-case-card .cp-case-cover {
  width: 40px; height: 40px; border-radius: 8px; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; font-size: 18px;
}
.cp-case-card .cp-case-cover img { width: 100%; height: 100%; object-fit: cover; }
.cp-case-card .cp-case-info { flex: 1; min-width: 0; }
.cp-case-card .cp-case-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-case-card .cp-case-views { font-size: 12px; color: var(--muted); margin-top: 2px; }

.mine-name-editable { cursor: pointer; }
.mine-name-editable:active { opacity: 0.7; }
.card-nick-editable { cursor: pointer; }
.card-nick-editable:active { opacity: 0.7; }
