/* ════════════════════════════════════════
   公事考知识库 · NotebookLM Light
   ════════════════════════════════════════ */

:root {
  --bg:       #ffffff;
  --bg2:      #f8f9fa;
  --bg3:      #f1f3f4;
  --bg4:      #e8eaed;
  --text:     #202124;
  --text2:    #5f6368;
  --text3:    #9aa0a6;
  --blue:     #4285f4;
  --green:    #34a853;
  --border:   rgba(0,0,0,0.08);
  --border2:  rgba(0,0,0,0.14);
  --shadow-s: 0 1px 3px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-m: 0 2px 12px rgba(0,0,0,0.10), 0 4px 24px rgba(0,0,0,0.06);
  --r:        12px;
  --r-lg:     18px;
  --ease:     0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Google Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text",
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Nav ─────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 56px;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 32px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-brand {
  display: flex; align-items: baseline; gap: 0;
  font-size: 18px; letter-spacing: -0.3px;
  user-select: none;
}
@keyframes ai-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(165, 84, 255, 0.45), 0 6px 20px rgba(165, 84, 255, 0.30); }
  50% { box-shadow: 0 0 0 6px rgba(165, 84, 255, 0), 0 8px 24px rgba(165, 84, 255, 0.40); }
}
@keyframes ai-dot-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.75); }
}
.nav-ai-entry {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 18px 0 14px;
  border: 1px solid rgba(210, 108, 255, 0.30);
  border-radius: 999px;
  background: linear-gradient(135deg, #bf5fff 0%, #9b3dff 45%, #6d28d9 100%);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  animation: ai-pulse 2.6s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}
.nav-ai-entry::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 60%);
  pointer-events: none;
}
.nav-ai-entry:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 32px rgba(165, 84, 255, 0.50);
  background: linear-gradient(135deg, #cb72ff 0%, #a84dff 45%, #7c3aed 100%);
  animation: none;
}
.nav-ai-entry:active {
  transform: translateY(0) scale(0.98);
  animation: none;
}
.nav-ai-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: ai-dot-blink 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
.nav-ai-icon {
  flex-shrink: 0;
  color: rgba(255,255,255,0.92);
}
.brand-main {
  font-weight: 800; color: var(--text);
  letter-spacing: -0.5px;
}
.brand-dot {
  font-weight: 800; color: var(--text);
  font-size: 18px; margin: 0 1px;
}
.brand-sub {
  font-weight: 800; color: var(--text);
  font-size: 18px; letter-spacing: -0.5px;
}
.nav-right {
  display: flex; align-items: center; gap: 10px;
}
.nav-user {
  font-size: 13px; color: var(--text2); font-weight: 500;
  max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-link {
  font-size: 13px; color: var(--text2); text-decoration: none;
  font-weight: 500; padding: 6px 14px;
  border: 1px solid var(--border2); border-radius: 20px;
  transition: all var(--ease);
}
.nav-link:hover { background: var(--bg2); color: var(--text); }
.nav-feedback-btn {
  font-size: 13px; color: var(--text2); font-weight: 500;
  padding: 6px 14px; border: 1px solid var(--border2);
  border-radius: 20px; background: none; cursor: pointer;
  font-family: inherit; transition: all var(--ease);
}
.nav-feedback-btn:hover { background: var(--bg2); color: var(--text); }

/* ─── Hero ─────────────────────────────── */
.hero {
  min-height: calc(100svh - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 20px;  /* 上大下小 → 视觉重心下移 */
  text-align: center;
  background: var(--bg);
  transition: min-height 0.3s ease, padding 0.3s ease;
}
.hero.compact {
  min-height: unset;
  padding: 56px 24px 40px;
  justify-content: flex-start;
}
.hero-title {
  font-size: clamp(52px, 9.5vw, 104px);
  font-weight: 700;
  letter-spacing: -3px;
  line-height: 1.05;
  color: var(--text);
}
/* 把"出单"做渐变（通过 span 注入） */
.hero-title .grad {
  background: linear-gradient(90deg, var(--blue) 0%, #1a9e6a 50%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--text2);
  margin-top: 22px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
  letter-spacing: 0.2px;
}

/* ─── Search ─────────────────────────────── */
.search-wrap { width: min(44vw, 700px); margin: 64px auto 0; position: relative; }
.search-box {
  position: relative; display: flex; align-items: center;
  background: var(--bg);
  border-radius: 50px;
  border: 1.5px solid var(--border2);
  box-shadow: var(--shadow-s);
  transition: box-shadow var(--ease), border-color var(--ease);
}
.search-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(66,133,244,0.12), var(--shadow-m);
}
.search-icon {
  width: 17px; height: 17px;
  position: absolute; left: 20px;
  color: var(--text3); pointer-events: none;
}
.search-input {
  width: 100%; padding: 18px 54px 18px 54px;
  font-size: 16px; font-family: inherit;
  background: transparent; border: none; outline: none;
  color: var(--text);
}
.search-input::placeholder { color: var(--text3); }
.search-clear {
  position: absolute; right: 14px;
  background: var(--bg3); border: none; cursor: pointer;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); transition: background var(--ease);
}
.search-clear svg { width: 11px; height: 11px; }
.search-clear:hover { background: var(--bg4); }

/* ─── Content type filter ─────────────────────────────── */
.type-filter {
  display: flex; gap: 8px; justify-content: center;
  margin-top: 32px;
}
.type-btn {
  padding: 7px 20px; border-radius: 20px;
  border: 1.5px solid var(--border2);
  background: var(--bg); color: var(--text2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--ease); font-family: inherit;
  letter-spacing: 0.1px;
}
.type-btn:hover {
  border-color: rgba(66,133,244,0.5);
  color: var(--blue); background: #e8f0fe;
}
.type-btn.active {
  background: var(--text); color: #fff;
  border-color: var(--text); font-weight: 600;
}

/* ─── Suggest dropdown ─────────────────────────────── */
.suggest-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 16px;
  box-shadow: var(--shadow-m);
  overflow: hidden;
}
.suggest-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px; cursor: pointer;
  transition: background var(--ease);
  text-align: left;
}
.suggest-item:hover, .suggest-item.focused { background: var(--bg2); }
.suggest-icon { color: var(--text3); flex-shrink: 0; }
.suggest-title {
  font-size: 14px; color: var(--text);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.suggest-title mark {
  background: none; color: var(--blue); font-weight: 600; font-style: normal;
}
.suggest-usage {
  font-size: 11px; color: var(--text3);
  white-space: nowrap; flex-shrink: 0;
}
.suggest-cat {
  font-size: 11px; color: var(--text3);
  background: var(--bg3); padding: 2px 8px; border-radius: 10px;
  white-space: nowrap; flex-shrink: 0;
}
.suggest-divider {
  padding: 6px 20px 4px;
  font-size: 11px; color: var(--text3); font-weight: 600;
  letter-spacing: 0.5px;
  border-top: 1px solid var(--border);
}

/* ─── Loading ─────────────────────────────── */
.loading-state {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 64px 24px; font-size: 13px; color: var(--text3);
}
.loading-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--bg3);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Results ─────────────────────────────── */
.results-section { max-width: 800px; margin: 0 auto; padding: 24px 24px 80px; }
.results-header { margin-bottom: 18px; }
.results-meta { font-size: 12px; color: var(--text3); }
.results-meta strong { color: var(--text2); font-weight: 600; }
.results-grid { display: flex; flex-direction: column; gap: 12px; }

/* ─── Channel filter ─────────────────────────────── */
.channel-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.channel-btn {
  padding: 5px 14px; border-radius: 20px;
  border: 1px solid var(--border2); background: var(--bg);
  color: var(--text2); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all var(--ease); font-family: inherit;
}
.channel-btn:hover { color: var(--blue); border-color: rgba(66,133,244,0.4); background: #e8f0fe; }
.channel-btn.active {
  background: #e8f0fe; color: var(--blue);
  border-color: rgba(66,133,244,0.4); font-weight: 600;
}

/* ─── Cards ─────────────────────────────── */
.card-qa, .card-material {
  background: var(--bg);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-s);
  overflow: hidden;
  transition: box-shadow var(--ease), border-color var(--ease);
}
.card-qa:hover, .card-material:hover {
  box-shadow: var(--shadow-m);
  border-color: var(--border2);
}

.card-header, .material-header {
  padding: 20px 24px 14px;
  display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap;
}
.card-body { padding: 0 24px 4px; }
.card-footer {
  padding: 10px 24px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  background: var(--bg2);
}

/* ─── Badges ─────────────────────────────── */
.card-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap; flex-shrink: 0; margin-top: 1px;
  background: var(--bg3); color: var(--text2);
}
.channel-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: 20px;
  font-size: 11px; font-weight: 600; white-space: nowrap; flex-shrink: 0; margin-top: 1px;
}
.channel-phone  { background: #e6f4ea; color: #137333; }
.channel-wechat { background: #e8f0fe; color: #1967d2; }
.channel-common { background: var(--bg3); color: var(--text3); }

.card-title, .material-title {
  font-size: 16px; font-weight: 600;
  color: var(--text); line-height: 1.4; flex: 1; min-width: 120px;
}
.material-desc {
  padding: 0 24px 14px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ─── Strategy ─────────────────────────────── */
.strategy-section {
  margin-bottom: 14px; padding: 12px 16px;
  background: #e8f0fe;
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
}
.strategy-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  color: var(--blue); text-transform: uppercase; margin-bottom: 5px;
}
.strategy-text { font-size: 13px; line-height: 1.7; color: #1a4fa0; white-space: pre-wrap; }

/* ─── Script ─────────────────────────────── */
.script-section { margin-bottom: 8px; }
.script-text, .script-full {
  font-size: 14px; line-height: 1.9; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
  padding: 16px; background: var(--bg2);
  border-radius: 8px; border: 1px solid var(--border);
}
.script-preview {
  font-size: 14px; line-height: 1.9; color: var(--text2);
  padding: 14px 16px; background: var(--bg2);
  border-radius: 8px; border: 1px solid var(--border);
  white-space: pre-wrap; word-break: break-word;
}
.script-expand-btn {
  display: inline-block; margin-top: 6px; padding: 5px 14px;
  background: none; border: 1px solid var(--border2); border-radius: 20px;
  font-size: 12px; color: var(--blue); cursor: pointer;
  font-family: inherit; transition: all var(--ease);
}
.script-expand-btn:hover { background: #e8f0fe; border-color: rgba(66,133,244,0.4); }

/* 情景标签 */
.script-label {
  display: inline-block; margin: 3px 0;
  padding: 1px 8px; background: var(--bg3);
  border: 1px solid var(--border2); border-radius: 8px;
  font-size: 11px; font-weight: 600; color: var(--text3);
}

.inline-img-wrap {
  display: inline-block; position: relative;
  max-width: 100%; margin: 6px 0;
}
.inline-video-wrap {
  display: inline-block; position: relative;
  max-width: 100%; margin: 6px 0;
}
.inline-img {
  display: block; max-width: 100%; border-radius: 6px;
  cursor: pointer; border: 1px solid var(--border);
}
.inline-video {
  display: block; width: min(520px, 100%); max-height: 320px;
  border-radius: 6px; border: 1px solid var(--border);
  background: #000;
}
.inline-img:hover { opacity: 0.88; }
.img-btn-group {
  position: absolute; right: 8px; bottom: 8px;
  display: flex; gap: 6px; align-items: center; z-index: 2;
}
.inline-copy-btn, .thumb-copy-btn, .img-preview-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 6px; border: none;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 12px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.inline-copy-btn:hover, .thumb-copy-btn:hover, .img-preview-btn:hover { background: rgba(0,0,0,0.82); }

/* ─── 话术内嵌文件卡片（PDF/DOC等非图片文件）─── */
.inline-file-wrap {
  display: inline-block; position: relative;
  margin: 6px 0; max-width: 100%;
}
.inline-file-card {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg2);
  cursor: pointer; transition: background 0.15s;
  max-width: 100%;
}
.inline-file-card:hover { background: var(--bg3); }
.inline-file-icon { font-size: 20px; flex-shrink: 0; }
.inline-file-name {
  font-size: 13px; color: var(--text1); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px;
}
.inline-file-ext {
  font-size: 10px; font-weight: 700; color: var(--text3);
  background: var(--bg4); padding: 2px 6px; border-radius: 4px;
  letter-spacing: .5px; flex-shrink: 0;
}
.inline-file-wrap .img-btn-group { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.script-link { color: var(--blue); text-decoration: underline; word-break: break-all; }
.script-link:hover { opacity: 0.8; }

/* ─── Segments ─────────────────────────────── */
.script-segments { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.script-segment {
  padding: 12px 14px 8px; background: var(--bg2);
  border: 1px solid var(--border); border-left: 3px solid var(--bg4);
  border-radius: 8px; transition: border-left-color var(--ease);
}
.script-segment:hover { border-left-color: var(--blue); }
.segment-body {
  font-size: 14px; line-height: 1.85; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}
.segment-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border);
}
.img-copy-hint { display: none; }  /* 已由复制图片按钮取代 */

/* 物料缩略图右下角按钮组（叠在图片上） */
.image-thumb-wrap { position: relative; display: inline-block; max-width: 100%; }
.image-thumb { position: relative; }

.segment-copy-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; background: rgba(0,0,0,0.6);
  border: none; border-radius: 6px;
  font-size: 12px; color: #fff; cursor: pointer;
  transition: background 0.15s; font-family: inherit;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.segment-copy-btn:hover { background: rgba(0,0,0,0.82); }

/* ─── Card actions ─── */
.card-actions {
  display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap;
}
.copy-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 18px;
  background: rgba(0,0,0,0.7); color: #fff;
  border: none; border-radius: 8px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.15s; font-family: inherit;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.copy-btn:hover { background: rgba(0,0,0,0.85); }
.copy-btn svg { width: 13px; height: 13px; }

/* 反馈按钮 */
.feedback-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 9px 16px;
  background: transparent; color: var(--text2);
  border: 1px solid var(--border); border-radius: 24px;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.feedback-btn:hover { background: #fff8f0; border-color: #f97316; color: #c2410c; }
.feedback-btn-mat { margin-left: auto; }

/* 反馈面板 */
.feedback-overlay {
  display: none; position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.25);
}
.feedback-panel {
  position: fixed; bottom: -320px; left: 50%; transform: translateX(-50%);
  width: min(420px, 94vw); z-index: 601;
  background: var(--bg); border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.15);
  padding: 20px 22px 32px;
  transition: bottom 0.3s cubic-bezier(0.34,1.26,0.64,1);
}
.feedback-panel.open { bottom: 0; }
.feedback-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
  font-size: 16px; font-weight: 700; color: var(--text);
}
.feedback-panel-close {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: var(--bg2);
  color: var(--text2); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.feedback-entry-name {
  font-size: 13px; color: var(--text2);
  background: var(--bg2); border-radius: 8px;
  padding: 8px 12px; margin-bottom: 14px;
  line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.feedback-types { display: flex; gap: 8px; margin-bottom: 14px; }
.fb-type-label {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 20px;
  border: 1.5px solid var(--border); cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text1);
  transition: all 0.12s;
}
.fb-type-label input { display: none; }
.fb-type-label:has(input:checked) {
  background: #fff3e0; border-color: #f97316; color: #c2410c;
}
.feedback-comment {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; font-family: inherit;
  color: var(--text); background: var(--bg); resize: none;
  outline: none; margin-bottom: 14px;
}
.feedback-comment:focus { border-color: #f97316; }
.feedback-submit-btn {
  width: 100%; padding: 12px;
  background: var(--text); color: #fff;
  border: none; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: opacity 0.15s;
}
.feedback-submit-btn:hover { opacity: 0.85; }
.feedback-submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.feedback-result {
  margin-top: 12px; text-align: center;
  font-size: 14px; color: #16a34a; font-weight: 600;
}

/* ─── Meta ─────────────────────────────── */
.more-hint {
  text-align: center; padding: 18px; color: var(--text3); font-size: 12px;
  border: 1px dashed var(--border2); border-radius: var(--r);
}
.search-wide-hint {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
}
.wide-search-btn {
  border: 1px solid var(--border2); background: #fff; color: var(--text);
  border-radius: 6px; padding: 6px 12px; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.wide-search-btn:hover { background: var(--bg2); border-color: var(--text3); }
.ai-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.52);
  backdrop-filter: blur(6px);
  z-index: 180;
  display: none;
}
.ai-search-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(580px, 94vw);
  max-height: min(82vh, 800px);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(10, 15, 30, 0.22), 0 0 0 1px rgba(130, 60, 255, 0.10);
  z-index: 181;
  transform: translate(-50%, -48%) scale(0.94);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.24s cubic-bezier(0.34, 1.3, 0.64, 1), opacity 0.20s ease;
  display: flex;
  flex-direction: column;
}
body.ai-search-open .ai-search-overlay { display: block; opacity: 1; }
body.ai-search-open .ai-search-panel {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}
.ai-search-panel-header {
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.ai-search-panel-kicker {
  font-size: 11px;
  color: #7c3aed;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.ai-search-panel-title {
  margin-top: 5px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.6px;
  color: var(--text);
}
.ai-search-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f1f0f5;
  color: var(--text2);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.ai-search-close:hover {
  background: #e4e2ec;
}
.ai-search-panel-body {
  padding: 20px 24px 26px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.ai-search-composer {
  background: linear-gradient(180deg, #f7faff 0%, #fff 100%);
  border: 1px solid rgba(66,133,244,0.14);
  border-radius: 18px;
  padding: 14px;
}
.ai-search-textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.75;
}
.ai-search-composer-actions,
.ai-search-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.ai-search-primary,
.ai-search-secondary {
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ai-search-primary {
  border: none;
  background: linear-gradient(90deg, #1f5fd1 0%, #4285f4 100%);
  color: #fff;
}
.ai-search-secondary {
  border: 1px solid var(--border2);
  background: #fff;
  color: var(--text2);
}
.ai-search-status,
.ai-search-error {
  font-size: 13px;
  line-height: 1.6;
  padding: 12px 14px;
  border-radius: 14px;
}
.ai-search-status {
  background: #f7f9fc;
  color: var(--text2);
}
.ai-search-error {
  background: #fff1f1;
  color: #c62828;
}
.ai-search-result {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ai-search-card {
  border: 1px solid rgba(66,133,244,0.12);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}
.ai-search-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.ai-search-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef5ff;
  color: #1f5fd1;
  font-size: 12px;
  font-weight: 700;
}
.ai-search-card-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
}
.ai-search-answer {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.95;
  color: var(--text);
}
.ai-search-refs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-search-ref-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg2);
}
.ai-search-refine-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ai-search-select,
.ai-search-refine-input {
  width: 100%;
  border: 1px solid var(--border2);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font: inherit;
}
.ai-search-select {
  flex: 1;
  min-width: 220px;
  height: 42px;
  padding: 0 14px;
}
.ai-search-refine-input {
  margin-top: 10px;
  min-height: 88px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.65;
}
.ai-search-versions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ai-search-version-chip {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  background: #fff;
  color: var(--text2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.ai-search-version-chip.active {
  background: #e8f0fe;
  border-color: rgba(66,133,244,0.45);
  color: var(--blue);
}
.ai-search-ref-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.ai-search-ref-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text3);
}
.meta-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text3); }
.meta-item svg { width: 12px; height: 12px; }

/* ─── AI搜索：沟通思路区块 ─────────────────────── */
.ai-search-strategy {
  margin-bottom: 14px;
  padding: 12px 16px;
  background: #e8f0fe;
  border-left: 3px solid var(--blue);
  border-radius: 0 8px 8px 0;
}
.ai-search-strategy-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--blue);
  text-transform: uppercase;
  margin-bottom: 5px;
}
.ai-search-strategy-text {
  font-size: 13px;
  line-height: 1.7;
  color: #1a4fa0;
  white-space: pre-wrap;
}
/* 话术标签 */
.ai-search-script-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: 8px;
}
/* 通用小节标签 */
.ai-search-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text3);
  text-transform: uppercase;
  margin-bottom: 8px;
}
/* 图片区 */
.ai-search-images {
  margin-top: 14px;
  margin-bottom: 4px;
}
.ai-search-images-grid {
  padding: 0;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.ai-search-image-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ai-search-image-card .image-thumb {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--bg3);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
}
.ai-search-image-card .image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ai-search-image-actions {
  display: flex;
  gap: 6px;
}
.ai-search-image-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: #fff;
  color: var(--text2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.ai-search-image-btn:hover {
  background: #f7faff;
  border-color: rgba(66,133,244,0.4);
  color: var(--blue);
}
.ai-search-image-copy {
  background: linear-gradient(90deg, #1f5fd1 0%, #4285f4 100%);
  border-color: transparent;
  color: #fff;
}
.ai-search-image-copy:hover {
  filter: brightness(1.05);
  background: linear-gradient(90deg, #1f5fd1 0%, #4285f4 100%);
  color: #fff;
}

/* ─── 追问/补充调整卡片 ─────────────────────── */
.ai-search-followup-card {
  background: #fafbff;
}
.ai-search-followup-textarea {
  min-height: 80px;
  font-size: 14px;
  color: var(--text);
}
.ai-search-followup-status {
  font-size: 13px;
  color: var(--text2);
  margin-top: 8px;
  padding: 8px 12px;
  background: #f7f9fc;
  border-radius: 10px;
}
.ai-search-followup-error {
  margin-top: 8px;
}

/* ─── 一键入库编辑弹窗 ─────────────────────── */
.import-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.55);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: none;
}
.import-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, 95vw);
  max-height: min(90vh, 840px);
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 32px 80px rgba(10, 15, 30, 0.28), 0 0 0 1px rgba(66,133,244,0.10);
  z-index: 301;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.import-modal-header {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.import-modal-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
}
.import-modal-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #f1f0f5;
  color: var(--text2);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.import-modal-close:hover { background: #e4e2ec; }
.import-modal-body {
  padding: 18px 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.import-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.import-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text2);
}
.import-input,
.import-select {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border2);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.import-input:focus,
.import-select:focus { border-color: var(--blue); }
.import-textarea {
  padding: 12px 14px;
  border: 1px solid var(--border2);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.8;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.import-textarea:focus { border-color: var(--blue); }
.import-strategy-area { min-height: 88px; }
.import-script-area { min-height: 220px; }
.import-images-section { display: flex; flex-direction: column; gap: 8px; }
.import-images-hint { font-size: 12px; color: var(--text3); }
.import-images-grid {
  padding: 0;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.import-images-toggle { margin-top: 6px; }
.import-images-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
  cursor: pointer;
}
.import-modal-footer {
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.import-modal-error {
  margin: 0 24px 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff1f1;
  color: #c62828;
  font-size: 13px;
  flex-shrink: 0;
}

/* ─── Images grid ─────────────────────────────── */
.images-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px; padding: 0 24px 20px;
}
.image-thumb {
  border-radius: 10px; overflow: hidden; cursor: pointer;
  aspect-ratio: 4/3; background: var(--bg3);
  border: 1px solid var(--border); transition: all var(--ease); position: relative;
}
.image-thumb:hover { box-shadow: var(--shadow-m); border-color: var(--border2); }
.image-thumb img,
.image-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-thumb { cursor: default; background: #000; }
.image-thumb .img-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0); display: flex;
  align-items: center; justify-content: center; transition: background var(--ease);
}
.image-thumb:hover .img-overlay { background: rgba(0,0,0,0.2); }
.img-overlay-icon { color: #fff; opacity: 0; transition: opacity var(--ease); font-size: 26px; }
.image-thumb:hover .img-overlay-icon { opacity: 1; }
.image-thumb.img-error,
.image-thumb-wrap.img-error .image-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
}
.image-thumb.img-error::after { content: none; }
.image-thumb.img-error img,
.image-thumb.img-error video,
.image-thumb.img-error .img-overlay,
.image-thumb-wrap.img-error img,
.image-thumb-wrap.img-error video,
.image-thumb-wrap.img-error .img-overlay,
.image-thumb-wrap.img-error .img-btn-group {
  display: none;
}
.media-missing-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 10px;
  color: var(--text3);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}
.inline-img-wrap.img-error,
.inline-video-wrap.img-error {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg2);
}
.inline-img-wrap.img-error .inline-img,
.inline-video-wrap.img-error .inline-video,
.inline-img-wrap.img-error .img-btn-group {
  display: none;
}
.inline-video-wrap.img-error .img-btn-group { display: none; }
.file-thumb-name {
  max-width: 92%;
  padding: 0 6px;
  font-size: 10px;
  color: var(--text3);
  line-height: 1.25;
  word-break: break-all;
  text-align: center;
}

/* ─── Empty ─────────────────────────────── */
.empty-state { text-align: center; padding: 80px 24px; }
.empty-icon { font-size: 40px; margin-bottom: 14px; }
.empty-text { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-hint { font-size: 14px; color: var(--text2); }
.empty-hint a { color: var(--blue); text-decoration: none; }

/* ─── Lightbox ─────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(16px);
  display: none; align-items: center; justify-content: center;
  padding: 40px; cursor: zoom-out; animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox-img {
  max-width: 90vw; max-height: 85vh; border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5); cursor: default; object-fit: contain;
  /* HiDPI 高质量缩放：浏览器用更好的插值算法 */
  image-rendering: -webkit-optimize-contrast;
  image-rendering: high-quality;
}
.lightbox-close {
  position: absolute; top: 20px; right: 22px;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; width: 36px; height: 36px; border-radius: 50%;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background var(--ease);
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }
.lightbox-copy-btn {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 24px;
  background: rgba(255,255,255,0.95); color: #111;
  border: none; border-radius: 980px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: background 0.15s, transform 0.1s;
}
.lightbox-copy-btn:hover { background: #fff; }
.lightbox-copy-btn:active { transform: translateX(-50%) scale(0.97); }
.lightbox-caption {
  position: absolute; bottom: 22px; color: rgba(255,255,255,0.7);
  font-size: 13px; padding: 6px 18px; background: rgba(0,0,0,0.45); border-radius: 20px;
}

/* ─── Toast ─────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 22px; border-radius: 22px;
  font-size: 13px; font-weight: 500; opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease; z-index: 2000; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; }

/* ─── Steps ─────────────────────────────── */
.steps-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.steps-list li { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.6; color: var(--text2); }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg3); color: var(--text2);
  font-size: 10px; font-weight: 700; flex-shrink: 0; margin-top: 2px;
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 640px) {
  .hero { padding: 92px 16px 48px; }
  .hero-title { font-size: 48px; letter-spacing: -2px; }
  .hero-sub { font-size: 15px; }
  .card-header, .material-header, .card-body, .card-footer,
  .images-grid { padding-left: 16px; padding-right: 16px; }
  .images-grid { grid-template-columns: 1fr 1fr; }
  .search-input { font-size: 15px; }
  .nav-left { gap: 8px; }
  .nav-ai-entry { padding: 0 12px; height: 34px; font-size: 13px; }
  .ai-search-panel { width: 96vw; max-height: 90vh; border-radius: 18px; }
}

/* ─── Auth Gate ─────────────────────────────── */
.auth-gate {
  display: none;
  position: fixed; inset: 0; z-index: 8000;
  background: var(--bg);
  align-items: flex-start; justify-content: center;
  padding: 60px 20px 40px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.auth-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.10);
}
.auth-logo {
  display: flex; align-items: baseline; gap: 0;
  font-size: 20px; letter-spacing: -0.3px;
  user-select: none; justify-content: center;
  margin-bottom: 24px;
}
.auth-welcome {
  text-align: center; font-size: 14px; color: var(--text2);
  margin-bottom: 22px; line-height: 1.5;
}
.auth-field { margin-bottom: 16px; }
.auth-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text2); margin-bottom: 6px;
}
.auth-input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px; font-size: 16px;
  font-family: inherit; color: var(--text);
  background: var(--bg2); outline: none;
  box-sizing: border-box;
  -webkit-appearance: none; appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.12);
}
.auth-err {
  padding: 10px 14px; border-radius: 8px;
  background: rgba(255,59,48,0.08); color: #c0392b;
  border: 1px solid rgba(255,59,48,0.2);
  font-size: 13px; margin-bottom: 14px;
}
.auth-submit {
  width: 100%; padding: 13px;
  background: var(--text); color: var(--bg);
  border: none; border-radius: 10px;
  font-size: 16px; font-weight: 600;
  cursor: pointer; font-family: inherit;
  -webkit-appearance: none; appearance: none;
  transition: opacity 0.15s;
}
.auth-submit:hover:not(:disabled) { opacity: 0.85; }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 480px) {
  .auth-gate { padding: 40px 16px 40px; align-items: flex-start; }
  .auth-box { border-radius: 16px; padding: 28px 20px 24px; max-width: 100%; }
  .nav-user { max-width: 60px; font-size: 12px; }
  .nav-right { gap: 8px; }
}
