:root {
  --bg: #0b0a1c;
  --bg2: #131027;
  --panel: rgba(255, 255, 255, 0.045);
  --panel2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border2: rgba(255, 255, 255, 0.14);
  --indigo: #6366f1;
  --violet: #a855f7;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 52%, #a855f7 100%);
  --grad-soft: linear-gradient(135deg, rgba(99,102,241,.22), rgba(168,85,247,.22));
  --text: #ececf6;
  --sub: #9b98bd;
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[v-cloak] { display: none; }

html, body { height: 100%; }
body {
  font-family: "Inter", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

.bg-blob {
  position: fixed; border-radius: 50%;
  filter: blur(110px); opacity: .35; z-index: 0; pointer-events: none;
  animation: drift 22s ease-in-out infinite alternate;
}
.b1 { width: 300px; height: 300px; background: #4338ca; top: -100px; left: -80px; }
.b2 { width: 280px; height: 280px; background: #7c3aed; bottom: -120px; right: -80px; animation-delay: -8s; }
.b3 { display: none; }
@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, -35px) scale(1.12); }
}

#app { position: relative; z-index: 1; height: 100dvh; display: flex; flex-direction: column; }

.login-mask { display: none; }
.login-card { display: none; }

.topbar {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-top, 0px));
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(11, 10, 28, 0.6);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.logo {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--grad);
  font-size: 15px; color: #fff;
  box-shadow: 0 3px 12px rgba(139, 92, 246, 0.4);
}
.brand-txt h1 { font-size: 15px; font-weight: 700; letter-spacing: .3px; }
.brand-txt p { font-size: 10px; color: var(--sub); margin-top: 1px; }
.status {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: #a7f3d0;
  border: 1px solid rgba(52, 211, 153, 0.3); border-radius: 999px;
  padding: 5px 10px; background: var(--panel);
  flex-shrink: 0;
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d39988; }

.layout {
  flex: 1; min-height: 0;
  display: block;
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding: 8px 10px 0;
  position: relative;
}

.chat { display: flex; flex-direction: column; min-height: 0; height: 100%; }

.messages {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  padding: 2px 2px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: rgba(139,92,246,.4) transparent;
}
.messages::-webkit-scrollbar { width: 3px; }
.messages::-webkit-scrollbar-thumb { background: rgba(139,92,246,.35); border-radius: 99px; }

.hero { margin: auto; text-align: center; max-width: 420px; padding: 12px 8px; animation: rise .5s ease both; }
.hero-icon {
  width: 52px; height: 52px; margin: 0 auto 10px;
  display: grid; place-items: center;
  font-size: 26px; border-radius: 16px;
  background: var(--grad-soft);
  border: 1px solid rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 32px rgba(139, 92, 246, 0.2);
}
.hero h2 { font-size: 15.5px; line-height: 1.45; background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin-top: 6px; font-size: 11px; color: var(--sub); line-height: 1.6; }
.tips { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.tips button {
  font-size: 11.5px; color: #c7c3f5; cursor: pointer;
  border: 1px solid rgba(139, 92, 246, 0.35); border-radius: 999px;
  padding: 7px 12px; background: rgba(139, 92, 246, 0.08);
  transition: all .2s;
}
.tips button:hover { background: rgba(139, 92, 246, 0.2); border-color: rgba(139, 92, 246, 0.6); }

.msg { display: flex; flex-direction: column; animation: rise .3s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.msg.user { align-items: flex-end; }
.msg.user .bubble {
  max-width: 84%;
  background: var(--grad);
  color: #fff;
  padding: 9px 13px;
  border-radius: 12px 12px 3px 12px;
  font-size: 16px; line-height: 1.55;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
  white-space: pre-wrap; word-break: break-word;
}
.msg.user .imgs { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; justify-content: flex-end; }
.msg.user .imgs img,
.pending img {
  width: 84px; height: 84px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border2);
}

.msg.ai { align-items: flex-start; }
.msg.ai .bubble {
  max-width: 94%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 2px solid;
  border-image: var(--grad) 1;
  border-radius: 3px 12px 12px 12px;
  padding: 10px 13px;
  font-size: 15.5px; line-height: 1.6;
  backdrop-filter: blur(12px);
  word-break: break-word;
}
.bubble.md :first-child { margin-top: 0; }
.bubble.md :last-child { margin-bottom: 0; }
.bubble.md h1, .bubble.md h2, .bubble.md h3 { font-size: 15.5px; margin: 10px 0 5px; color: #d6d2ff; }
.bubble.md p { margin: 5px 0; }
.bubble.md ul, .bubble.md ol { margin: 5px 0; padding-left: 18px; }
.bubble.md li { margin: 2px 0; }
.bubble.md table { border-collapse: collapse; margin: 6px 0; max-width: 100%; display: block; overflow-x: auto; }
.bubble.md th, .bubble.md td { border: 1px solid var(--border2); padding: 5px 8px; font-size: 14px; }
.bubble.md th { background: rgba(139, 92, 246, 0.15); }
.bubble.md code { background: rgba(139, 92, 246, 0.18); border-radius: 4px; padding: 1px 5px; font-size: 14px; }
.bubble.md pre { background: rgba(0,0,0,.35); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; overflow-x: auto; margin: 6px 0; }
.bubble.md pre code { background: none; padding: 0; }
.bubble.md blockquote { border-left: 3px solid rgba(139,92,246,.5); padding-left: 10px; color: var(--sub); margin: 6px 0; }
.bubble.md a { color: #a5b4fc; }

.progress { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; max-width: 94%; }
.p-line {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--sub);
  animation: rise .25s ease both;
}
.p-dot {
  flex-shrink: 0;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.8);
}

.typing { display: flex; gap: 4px; padding: 10px 12px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; width: fit-content; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #8b5cf6;
  animation: blink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }

.result-peek {
  display: flex; flex-direction: column; gap: 5px;
  margin-top: 6px; cursor: pointer;
  background: var(--grad-soft);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 10px; padding: 10px 12px;
  max-width: 94%;
  transition: all .2s;
}
.rp-title { font-size: 11px; font-weight: 700; color: #c7d2fe; letter-spacing: 1px; }
.rp-code { font-size: 16px; font-weight: 800; color: #e0e7ff; letter-spacing: 1px; font-family: Consolas, Monaco, monospace; }
.rp-spec {
  font-family: Consolas, Monaco, monospace; font-size: 12.5px; color: rgba(238,240,255,.92);
  word-break: break-all; line-height: 1.6;
}
.rp-result { font-size: 11.5px; color: rgba(238,240,255,.55); line-height: 1.5; }
.result-peek:active { transform: scale(.98); }
.result-peek code {
  font-size: 16px; font-weight: 700; letter-spacing: 1px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.result-peek span { font-size: 12px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.q-card {
  max-width: 94%;
  background: linear-gradient(180deg, rgba(99,102,241,.12), rgba(168,85,247,.08));
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 6px 22px rgba(124, 58, 237, 0.15);
}
.q-title { font-size: 13px; font-weight: 700; color: #c4b5fd; margin-bottom: 9px; }
.q-item { margin-bottom: 10px; }
.q-item label { display: block; font-size: 13.5px; margin-bottom: 5px; color: #d6d2ff; }
.q-item input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border2);
  border-radius: 9px; padding: 10px 12px;
  color: var(--text); font-size: 16px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.q-item input:focus { border-color: var(--indigo); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-opt {
  font-size: 13.5px; color: #c7c3f5; cursor: pointer;
  border: 1px solid var(--border2); border-radius: 999px;
  padding: 8px 13px; background: rgba(0, 0, 0, 0.2);
  transition: all .15s;
}
.chip-opt.on {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: 0 2px 9px rgba(139, 92, 246, 0.4);
}
.submit {
  width: 100%; margin-top: 3px;
  background: var(--grad); color: #fff; font-size: 15px; font-weight: 600;
  border: none; border-radius: 10px; padding: 11px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(124, 58, 237, 0.35);
  transition: transform .15s;
}
.submit:active { transform: scale(.98); }

.error {
  margin-top: 5px; max-width: 94%;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fda4af; font-size: 12.5px;
  border-radius: 9px; padding: 8px 11px;
}

.composer {
  display: flex; flex-direction: column;
  height: 25vh; min-height: 150px; max-height: 300px;
  background: rgba(19, 16, 39, 0.92);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  margin: 8px auto;
  max-width: 100%; width: 100%; box-sizing: border-box;
  transition: border-color .2s, box-shadow .2s;
}
.composer:focus-within { border-color: rgba(139, 92, 246, 0.6); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1); }
.composer.drag { border-color: var(--violet); border-style: dashed; }
.drag-hint { position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(19, 16, 39, 0.85); border-radius: 14px 14px 0 0;
  color: #c4b5fd; font-size: 13.5px; font-weight: 600; pointer-events: none; }

.pending { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 7px; }
.chip { position: relative; }
.chip button {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  border: none; background: #f43f5e; color: #fff;
  font-size: 11px; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

.row { display: flex; align-items: flex-end; gap: 7px; }
.icon-btn {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 10px; border: 1px solid var(--border2);
  background: var(--panel2); font-size: 16px; cursor: pointer;
  transition: all .2s;
}
.icon-btn:active { background: rgba(139, 92, 246, 0.2); }
.icon-btn.mic { touch-action: none; -webkit-user-select: none; user-select: none; }
.icon-btn.mic.holding {
  background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: 0 0 0 5px rgba(139, 92, 246, 0.18);
  animation: pulse 1.4s ease-in-out infinite;
}
.icon-btn.mic.cancel {
  background: linear-gradient(135deg, #f43f5e, #fb7185); border-color: transparent; color: #fff;
  box-shadow: 0 0 0 5px rgba(244, 63, 94, 0.18);
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.18); }
  50% { box-shadow: 0 0 0 9px rgba(139, 92, 246, 0.07); }
}

.rec-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
  background: rgba(5, 4, 15, 0.25);
  pointer-events: none;
}
.rec-pill {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(19, 16, 39, 0.95);
  border: 1px solid rgba(139, 92, 246, 0.5);
  color: #c4b5fd; font-size: 12.5px;
  box-shadow: 0 10px 34px rgba(76, 29, 149, 0.45);
  animation: rise .18s ease both;
}
.rec-pill.cancel { border-color: rgba(244, 63, 94, 0.6); color: #fda4af; }
.rec-wave { display: flex; align-items: center; gap: 3px; height: 14px; }
.rec-wave i {
  width: 3px; border-radius: 2px; background: #8b5cf6;
  animation: wave 1s ease-in-out infinite;
}
.rec-pill.cancel .rec-wave i { background: #fb7185; }
.rec-wave i:nth-child(1) { height: 6px; animation-delay: 0s; }
.rec-wave i:nth-child(2) { height: 12px; animation-delay: .12s; }
.rec-wave i:nth-child(3) { height: 8px; animation-delay: .24s; }
.rec-wave i:nth-child(4) { height: 13px; animation-delay: .36s; }
.rec-wave i:nth-child(5) { height: 7px; animation-delay: .48s; }
@keyframes wave {
  0%, 100% { transform: scaleY(.5); opacity: .6; }
  50% { transform: scaleY(1.4); opacity: 1; }
}

textarea {
  flex: 1; resize: none;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border2);
  border-radius: 10px;
  outline: none;
  color: var(--text); font-size: 16px; line-height: 1.45;
  font-family: inherit;
  max-height: 100px;
  padding: 8px 10px;
  transition: border-color .2s;
}
textarea:focus { border-color: rgba(139, 92, 246, 0.55); }
textarea::placeholder { color: #6f6b93; }

.send {
  flex-shrink: 0;
  border: none; border-radius: 10px;
  background: var(--grad); color: #fff;
  font-size: 13.5px; font-weight: 600;
  padding: 9px 15px; cursor: pointer;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.4);
  transition: transform .15s, filter .15s;
}
.send:active { transform: scale(.96); }
.send:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.send.stop { background: linear-gradient(135deg, #f43f5e, #fb7185); box-shadow: 0 4px 16px rgba(244, 63, 94, 0.4); }

.result {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; flex-direction: column;
  max-height: 70dvh;
  border-radius: 14px 14px 0 0;
  background: rgba(19, 16, 39, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border2); border-bottom: none;
  transform: translateY(105%);
  transition: transform .28s cubic-bezier(.32,.72,.35,1);
  box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.5);
}
.result.open { transform: translateY(0); }
.r-head {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  border-radius: 14px 14px 0 0;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(99,102,241,.14), rgba(168,85,247,.08));
}
.r-head h3 { font-size: 14px; }
.r-head .close {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%; border: 1px solid var(--border2);
  background: var(--panel2); color: var(--sub);
  font-size: 15px; line-height: 1; cursor: pointer;
}
.r-body { overflow-y: auto; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); scrollbar-width: thin; }

.hs-code { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.hs-code .code {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 24px; font-weight: 800; letter-spacing: 1.5px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  word-break: break-all;
}
.copy {
  flex-shrink: 0;
  border: 1px solid rgba(139, 92, 246, 0.45); border-radius: 9px;
  background: rgba(139, 92, 246, 0.12); color: #c4b5fd;
  font-size: 12.5px; padding: 7px 12px; cursor: pointer;
  transition: all .2s;
}
.copy:active { background: rgba(139, 92, 246, 0.3); color: #fff; }

.elements { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.elements td { border: 1px solid var(--border); padding: 8px 10px; font-size: 13.5px; }
.elements .k { color: var(--sub); width: 40%; background: rgba(255, 255, 255, 0.03); }

.excluded h4 { font-size: 12.5px; color: var(--sub); font-weight: 600; margin-bottom: 6px; }
.ex-item {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12.5px; color: var(--sub);
  margin-bottom: 5px;
}
.ex-item code {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px;
  color: #8f8ab0; font-size: 12px;
  text-decoration: line-through;
}

.remark {
  font-size: 13px; color: var(--sub); line-height: 1.65;
  border-top: 1px dashed var(--border2);
  padding-top: 10px;
}

.r-empty { margin: auto; text-align: center; color: var(--sub); padding: 24px 0; }
.r-empty-icon { font-size: 28px; margin-bottom: 8px; opacity: .6; }
.r-empty p { font-size: 13px; line-height: 1.7; }

.sheet-toggle {
  position: fixed; z-index: 20;
  right: 12px; bottom: calc(64px + env(safe-area-inset-bottom));
  background: var(--grad); color: #fff;
  border: none; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  padding: 10px 18px; cursor: pointer;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.5);
}
.sheet-mask {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(5, 4, 15, 0.55); backdrop-filter: blur(2px);
}

@media (min-width: 900px) {
  .bg-blob.b1 { width: 480px; height: 480px; top: -140px; left: -120px; }
  .bg-blob.b2 { width: 420px; height: 420px; bottom: -160px; right: -100px; }
  .bg-blob.b3 {
    display: block; width: 300px; height: 300px;
    background: #312e81; top: 40%; left: 45%; animation-delay: -14s;
  }

  .login-card { padding: 34px 32px; }

  .topbar { padding: 14px 28px; }
  .brand { gap: 12px; }
  .logo { width: 42px; height: 42px; border-radius: 13px; font-size: 20px; }
  .brand-txt h1 { font-size: 17px; }
  .brand-txt p { font-size: 12px; }
  .user-chip { font-size: 12.5px; padding: 7px 14px; }

  .layout { display: grid; grid-template-columns: 1fr 340px; gap: 22px; padding: 22px 28px 26px; }

  .hero { padding: 40px 20px; }
  .hero-icon { width: 88px; height: 88px; font-size: 42px; border-radius: 28px; margin-bottom: 22px; }
  .hero h2 { font-size: 21px; }
  .hero p { font-size: 13px; }
  .tips button { font-size: 12.5px; padding: 9px 16px; }
  .tips button:hover { background: rgba(139, 92, 246, 0.2); border-color: rgba(139, 92, 246, 0.6); }

  .msg.user .bubble, .msg.ai .bubble, .q-card, .result-peek, .error, .progress { max-width: 80%; }
  .msg.user .imgs img, .pending img { width: 96px; height: 96px; border-radius: 12px; }

  .q-item input { font-size: 14px; }
  .submit:hover { filter: brightness(1.1); }

  .composer {
    position: static;
    border-radius: 20px;
    border-bottom: 1px solid var(--border2);
    margin: 14px 0 0;
    padding: 12px;
  }
  .drag-hint { border-radius: 20px; }

  .icon-btn { width: 40px; height: 40px; font-size: 17px; }
  .icon-btn:hover:not(:disabled) { border-color: rgba(139, 92, 246, 0.6); background: rgba(139, 92, 246, 0.15); }
  .icon-btn:disabled { opacity: .4; cursor: not-allowed; }
  textarea { font-size: 14.5px; padding: 10px; max-height: 140px; }
  .send { padding: 10px 18px; font-size: 14px; }
  .send:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.1); }

  .result {
    position: static; max-height: none;
    border: 1px solid var(--border); border-bottom: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    transform: none; transition: none;
    box-shadow: none;
    min-height: 0; overflow: hidden;
  }
  .r-head { border-radius: 0; padding: 16px 18px; }
  .r-head .close { display: none; }
  .r-body { padding: 18px; }
  .hs-code .code { font-size: 25px; }
  .copy:hover { background: rgba(139, 92, 246, 0.3); color: #fff; }
  .sheet-toggle, .sheet-mask { display: none !important; }
}

/* ---- 闂傚倸鍊风粈渚€骞夐敓鐘虫櫔婵犵妲呴崑鍛淬€冩径鎰﹂柟鐗堟緲闁卞洭鏌￠崶鈺佷户妞ゆ柨鎳樺娲嚍閵夊喚浜棟闁告鍋愰弨锕傛煕閺囥劌浜愭俊鎻掔墦閺岀喖鎮欓鈧埢鏇熴亜鎼淬埄娈橀柍褜鍓氶鏍窗濞戞瑦鍙忛柕鍫濐槹閺咁剟鏌涢幇闈涙灈闂佸崬娲﹂妵鍕箳閹存績鍋撴繝姣稿洭鏁?0261103a闂?--- */
.top-actions { display: flex; align-items: center; gap: 12px; }
.hist-btn { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff;
  border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: .2s; }
.hist-btn:hover { background: rgba(255,255,255,.18); }
.hist-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 60; }
.hist-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw);
  background: #fff; z-index: 61; box-shadow: -12px 0 40px rgba(15,23,42,.18);
  transform: translateX(105%); transition: transform .25s; display: flex; flex-direction: column; }
.hist-drawer.open { transform: translateX(0); }
.hist-drawer .r-head { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid #eef0f4; }
.hist-drawer .r-head h3 { margin: 0; font-size: 15px; color: #1f2937; }
.hist-drawer .close { border: 0; background: none; font-size: 20px; cursor: pointer; color: #94a3b8; }
.hist-body { flex: 1; overflow: auto; padding: 10px 14px; }
.hist-empty { text-align: center; color: #94a3b8; padding: 40px 10px; font-size: 13px; line-height: 2; }
.hist-item { border: 1px solid #eef0f4; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
  cursor: pointer; transition: .15s; background: #fafbfd; }
.hist-item:hover { border-color: #6366f1; background: #f5f6ff; }
.hi-main { display: flex; align-items: center; gap: 8px; }
.hi-main code { background: #eef2ff; color: #4338ca; border-radius: 6px; padding: 2px 7px;
  font-size: 12px; font-weight: 600; }
.hi-main code.dim { background: #f1f5f9; color: #94a3b8; }
.hi-name { font-size: 13px; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hi-meta { display: flex; gap: 10px; margin-top: 6px; font-size: 11px; color: #94a3b8; align-items: center; }
.fb-ok { color: #16a34a; font-weight: 700; }
.fb-no { color: #dc2626; font-weight: 700; }
.fb-row { display: flex; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed #e2e8f0; }
.fb-btn { flex: 1; border-radius: 10px; padding: 8px 0; font-size: 13px; cursor: pointer; border: 1px solid; transition: .15s; }
.fb-btn.ok { color: #16a34a; border-color: #bbf7d0; background: #f0fdf4; }
.fb-btn.ok:hover { background: #dcfce7; }
.fb-btn.no { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.fb-btn.no:hover { background: #fee2e2; }
.fb-btn:disabled { opacity: .5; cursor: default; }
.fb-done { flex: 1; text-align: center; font-size: 13px; padding: 8px 0; }
.fb-done.ok { color: #16a34a; }
.fb-done.no { color: #dc2626; }
.fb-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 70;
  display: flex; align-items: center; justify-content: center; }
.fb-dialog { background: #fff; border-radius: 16px; padding: 20px; width: min(420px, 92vw);
  box-shadow: 0 24px 60px rgba(15,23,42,.25); }
.fb-dialog h4 { margin: 0 0 12px; font-size: 15px; color: #1f2937; }
.fb-dialog textarea { width: 100%; box-sizing: border-box; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 10px; font-size: 13px; resize: vertical; font-family: inherit; }
.fb-dialog textarea:focus { outline: none; border-color: #6366f1; }
.fb-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.fb-actions button { border-radius: 9px; padding: 7px 18px; font-size: 13px; cursor: pointer;
  border: 1px solid #e2e8f0; background: #fff; color: #475569; }
.fb-actions button.primary { background: #6366f1; border-color: #6366f1; color: #fff; }
.fb-actions button.primary:disabled { opacity: .5; }

/* ---- HS 快查抽屉内容样式（白底，与历史模块 hist-drawer 同款外壳）---- */
.hist-drawer .hl-search {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  background: #f1f5f9; border: 1px solid #e2e8f0;
  border-radius: 999px; padding: 6px 10px 6px 14px;
}
.hist-drawer .hl-search:focus-within { border-color: #6366f1; }
.hist-drawer .hl-search .hl-icon { font-size: 14px; opacity: .6; }
.hist-drawer .hl-search input {
  flex: 1; border: 0; background: transparent; outline: none; color: #1f2937;
  font-size: 13px; min-width: 0;
}
.hist-drawer .hl-search input::placeholder { color: #94a3b8; }
.hist-drawer .hl-go {
  border: 0; border-radius: 999px; padding: 6px 14px; font-size: 12px; cursor: pointer;
  background: linear-gradient(135deg,#6366f1,#a855f7); color: #fff; font-weight: 600; flex: none;
}
.hist-drawer .hl-go:disabled { opacity: .5; }
.hist-drawer .hl-empty { text-align: center; color: #94a3b8; font-size: 13px; padding: 18px 10px; line-height: 1.8; }
.hist-drawer .hl-cache { text-align: right; font-size: 10px; color: #cbd5e1; padding: 2px 4px 10px; }
.hist-drawer .hl-sec { margin-bottom: 12px; }
.hist-drawer .hl-sec-t { font-size: 13px; font-weight: 700; color: #4338ca; margin: 10px 4px 8px; display: flex; justify-content: space-between; align-items: center; }
.hist-drawer .hl-sec-t .hl-hint { font-size: 10px; font-weight: 400; color: #94a3b8; }
.hist-drawer .hl-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  cursor: pointer; transition: background .15s; background: #fafbfd;
  border: 1px solid #eef0f4; margin-bottom: 4px;
}
.hist-drawer .hl-item:hover { background: #f5f6ff; border-color: #c7d2fe; }
.hist-drawer .hl-item code, .hist-drawer .hl-cand-head code, .hist-drawer .hl-cand-code code {
  background: #eef2ff; color: #4338ca; border-radius: 6px; padding: 2px 7px;
  font-size: 12px; font-weight: 600; flex: none;
}
.hist-drawer .hl-item span, .hist-drawer .hl-cand-code span { font-size: 13px; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-drawer .hl-ai { margin-top: 18px; border-top: 1px dashed #e2e8f0; padding-top: 14px; }
.hist-drawer .hl-ai-title { font-size: 14px; font-weight: 700; color: #4338ca; margin-bottom: 12px; }
.hist-drawer .hl-cand { margin-bottom: 16px; border: 1px solid #c7d2fe; border-radius: 12px; overflow: hidden; background: #fafbff; }
.hist-drawer .hl-cand-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: #eef2ff; border-bottom: 1px solid #c7d2fe;
}
.hist-drawer .hl-cand-head b { font-size: 14px; color: #1f2937; }
.hist-drawer .hl-cand-cnt { margin-left: auto; font-size: 11px; color: #94a3b8; }
.hist-drawer .hl-cand-code {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; transition: background .15s;
  border-bottom: 1px solid #f1f5f9;
}
.hist-drawer .hl-cand-code:last-child { border-bottom: 0; }
.hist-drawer .hl-cand-code:hover { background: #f5f6ff; }
/* ---- AI 闁稿﹥鐟╅埀顒€顦幖褔鎯勯鑽ょ憮闁瑰嘲顦伴、瀣晬閸繍鍤犻悹鍥ㄧ箖閻ㄩ潧鈻旈垾鍐叉暥闁?--- */
.cand-groups { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.cg-group { border: 1px solid rgba(255,255,255,.12); border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.04); }
.cg-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer;
  background: rgba(99,102,241,.1); border-bottom: 1px solid rgba(99,102,241,.18); transition: background .15s;
}
.cg-head:hover { background: rgba(99,102,241,.18); }
.cg-chev { font-size: 12px; color: rgba(238,240,255,.5); transition: transform .2s; flex: none; }
.cg-chev.on { transform: rotate(90deg); }
.cg-head code { background: rgba(99,102,241,.22); color: #c7d2fe; border-radius: 6px; padding: 2px 7px; font-size: 12px; font-weight: 600; flex: none; }
.cg-head b { font-size: 13px; color: #eef0ff; }
.cg-cnt { margin-left: auto; font-size: 11px; color: rgba(238,240,255,.4); flex: none; }
.cg-list { display: flex; flex-direction: column; }
.cg-code {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.05); transition: background .15s;
}
.cg-code:last-child { border-bottom: 0; }
.cg-code:hover { background: rgba(99,102,241,.14); }
.cg-code code { background: rgba(255,255,255,.06); color: #c7d2fe; border-radius: 5px; padding: 1px 6px; font-size: 12px; flex: none; }
.cg-code span { font-size: 12.5px; color: rgba(238,240,255,.85); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-code em { font-size: 11px; color: rgba(168,85,247,.7); font-style: normal; flex: none; opacity: 0; transition: opacity .15s; }
.cg-code:hover em { opacity: 1; }
/* ---- composer 新布局：输入框在上，下方左图片右(语音+发送) ---- */
.composer-input {
  flex: 1; min-height: 0; resize: none;
  border: 0; background: transparent; outline: none;
  color: var(--text, #eef0ff); font-size: 14px; line-height: 1.6;
  font-family: inherit; padding: 4px 2px;
  -webkit-appearance: none;
}
.composer-input::placeholder { color: rgba(238,240,255,.4); }
.composer-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 6px; flex: none;
}
.composer-right { display: flex; align-items: center; gap: 8px; }
.composer .row { display: none; }   /* 旧 .row 不再使用 */
/* 语音按钮防长按复制/选菜 */
.icon-btn.mic {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}