/* DeepSeek个人超级助理：桌面抽屉、移动全屏、首页指挥台与客户内嵌策略 */
:root {
  --ai-ink: #10261f;
  --ai-deep: #082f28;
  --ai-green: #0e7a58;
  --ai-mint: #58d6a7;
  --ai-cyan: #7ce4da;
  --ai-paper: #f5faf7;
  --ai-line: rgba(26, 93, 72, .15);
}

.ai-copilot-root[hidden] { display: none !important; }

.ai-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 760;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 8px 18px 8px 9px;
  color: #fff;
  border: 1px solid rgba(151, 255, 217, .34);
  border-radius: 999px;
  background:
    radial-gradient(circle at 20% 20%, rgba(108, 244, 192, .3), transparent 34%),
    linear-gradient(135deg, #073d32 0%, #0b7253 66%, #0f8a62 100%);
  box-shadow: 0 20px 50px rgba(6, 58, 45, .28), inset 0 1px 0 rgba(255, 255, 255, .15);
  cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease;
}

.ai-launcher:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 60px rgba(6, 58, 45, .34), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.ai-launcher-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2);
}

.ai-launcher-orbit::before,
.ai-launcher-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(121, 238, 201, .65);
  border-radius: 50%;
  animation: aiOrbit 5s linear infinite;
}

.ai-launcher-orbit::before { width: 48px; height: 24px; transform: rotate(38deg); }
.ai-launcher-orbit::after { width: 24px; height: 48px; transform: rotate(38deg); animation-direction: reverse; }
.ai-launcher-orbit i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #b9ffe3; top: 2px; right: 4px; box-shadow: 0 0 12px #7effce; }
.ai-launcher-orbit b { position: relative; z-index: 1; font-size: 14px; letter-spacing: .08em; }

@keyframes aiOrbit {
  from { rotate: 0deg; }
  to { rotate: 360deg; }
}

.ai-launcher-copy { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.ai-launcher-copy strong { font-size: 15px; letter-spacing: .03em; }
.ai-launcher-copy small { margin-top: 4px; color: rgba(232, 255, 246, .72); font-size: 11px; }

.ai-panel-shade {
  position: fixed;
  inset: 0;
  z-index: 780;
  opacity: 0;
  pointer-events: none;
  background: rgba(5, 25, 20, .45);
  backdrop-filter: blur(4px);
  transition: opacity .25s ease;
}

.ai-panel-shade.open { opacity: 1; pointer-events: auto; }

.ai-panel {
  position: fixed;
  top: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 790;
  width: min(520px, calc(100vw - 28px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border: 1px solid rgba(112, 206, 170, .25);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(246, 252, 249, .98), rgba(242, 249, 246, .99)),
    radial-gradient(circle at 80% 0%, rgba(102, 218, 176, .18), transparent 34%);
  box-shadow: -24px 20px 80px rgba(7, 42, 33, .28);
  transform: translateX(calc(100% + 30px));
  transition: transform .3s cubic-bezier(.22, .8, .25, 1);
}

.ai-panel.open { transform: translateX(0); }

.ai-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 170px;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(11, 68, 54, .98), rgba(12, 126, 89, .93)),
    repeating-linear-gradient(90deg, transparent 0 30px, rgba(255,255,255,.05) 31px);
}

.ai-panel-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  padding: 14px 18px;
  color: #fff;
}

.ai-brand-lockup { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ai-brand-glyph {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 14px;
  color: #0a4b3b;
  background: linear-gradient(145deg, #c0ffe5, #7fe6bd);
  box-shadow: 0 10px 24px rgba(0, 24, 18, .24);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .06em;
}
.ai-brand-lockup div { min-width: 0; display: flex; flex-direction: column; }
.ai-brand-lockup strong { overflow: hidden; font-size: 18px; letter-spacing: .03em; text-overflow: ellipsis; white-space: nowrap; }
.ai-brand-lockup small { margin-top: 4px; overflow: hidden; color: rgba(235, 255, 247, .7); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.ai-provider-connected .ai-brand-lockup small { color: #b8ffdd; }

.ai-header-actions { display: flex; gap: 7px; }
.ai-header-actions button {
  min-height: 36px;
  padding: 0 11px;
  color: rgba(255, 255, 255, .88);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 11px;
  background: rgba(255, 255, 255, .08);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.ai-header-actions button:hover { background: rgba(255, 255, 255, .16); }

.ai-command-strip {
  position: relative;
  z-index: 1;
  margin: 0 12px 10px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, .62);
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 14px 35px rgba(12, 72, 55, .14);
}

.ai-command-intro { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ai-command-intro span { color: var(--ai-green); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.ai-command-intro strong { color: #28483e; font-size: 12px; }
.ai-feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.ai-feature-grid button {
  min-width: 0;
  min-height: 76px;
  padding: 9px 7px;
  text-align: left;
  border: 1px solid rgba(20, 105, 76, .1);
  border-radius: 13px;
  background: linear-gradient(160deg, #f7fbf9, #eef8f3);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.ai-feature-grid button:hover { transform: translateY(-2px); border-color: rgba(20, 126, 88, .28); background: #fff; }
.ai-feature-grid button i {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  margin-bottom: 7px;
  color: #0b7051;
  border-radius: 8px;
  background: #dff7ec;
  font-style: normal;
  font-size: 11px;
  font-weight: 900;
}
.ai-feature-grid button span { display: flex; flex-direction: column; min-width: 0; }
.ai-feature-grid button strong { overflow: hidden; color: #183c31; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.ai-feature-grid button small { display: none; }

.ai-chat-stream {
  position: relative;
  min-height: 0;
  padding: 10px 16px 18px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(14, 122, 88, .25) transparent;
}

.ai-message { display: flex; align-items: flex-start; gap: 9px; margin: 12px 0; }
.ai-message.user { justify-content: flex-end; padding-left: 48px; }
.ai-message.assistant { padding-right: 20px; }
.ai-message-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  margin-top: 3px;
  color: #fff;
  border-radius: 10px;
  background: linear-gradient(145deg, #0b7051, #11a16f);
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 7px 18px rgba(10, 96, 68, .2);
}

.ai-message-content {
  max-width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--ai-line);
  border-radius: 6px 18px 18px 18px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(12, 65, 49, .06);
}
.ai-message.user .ai-message-content {
  color: #fff;
  border: 0;
  border-radius: 18px 6px 18px 18px;
  background: linear-gradient(135deg, #0a5c45, #0e8b63);
  box-shadow: 0 10px 24px rgba(8, 91, 64, .18);
}
.ai-message-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.ai-message-meta strong { color: #173b30; font-size: 12px; }
.ai-message-meta span { padding: 2px 6px; color: #0b7655; border-radius: 6px; background: #e5f8ef; font-size: 9px; }
.ai-message.user .ai-message-meta strong,
.ai-message.user .ai-message-meta span { color: #fff; }
.ai-message.user .ai-message-meta span { background: rgba(255,255,255,.12); }
.ai-message-text { color: #29483f; font-size: 14px; line-height: 1.75; word-break: break-word; }
.ai-message-text p { margin: 0 0 9px; }
.ai-message-text p:last-child { margin-bottom: 0; }
.ai-message.user .ai-message-text { color: rgba(255,255,255,.96); }
.ai-answer-line { display: block; padding-left: 2px; }

.ai-data-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.ai-data-cards button {
  min-width: 0;
  padding: 10px;
  text-align: left;
  border: 1px solid rgba(16, 112, 78, .13);
  border-radius: 12px;
  background: linear-gradient(150deg, #f5fbf8, #edf8f3);
  cursor: pointer;
}
.ai-data-cards button:disabled { cursor: default; }
.ai-data-cards button:not(:disabled):hover { border-color: rgba(16, 112, 78, .32); background: #fff; }
.ai-data-cards span, .ai-data-cards small { display: block; overflow: hidden; color: #60786f; font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.ai-data-cards strong { display: block; margin: 3px 0; overflow: hidden; color: #133b2f; font-size: 16px; white-space: nowrap; text-overflow: ellipsis; }
.ai-provider-notice { margin-top: 10px; padding: 8px 9px; color: #7b6322; border-radius: 9px; background: #fff7dc; font-size: 10px; line-height: 1.5; }

.ai-thinking {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 16px 8px 55px;
  padding: 9px 12px;
  color: #587168;
  border-radius: 12px;
  background: rgba(224, 244, 236, .7);
  font-size: 11px;
}
.ai-thinking[hidden] { display: none; }
.ai-thinking span { width: 6px; height: 6px; border-radius: 50%; background: var(--ai-green); animation: aiThink 1.2s ease-in-out infinite; }
.ai-thinking span:nth-child(2) { animation-delay: .16s; }
.ai-thinking span:nth-child(3) { animation-delay: .32s; }
.ai-thinking b { margin-left: 4px; font-weight: 600; }
@keyframes aiThink { 0%, 100% { opacity: .3; transform: translateY(1px); } 50% { opacity: 1; transform: translateY(-2px); } }

.ai-suggestion-row {
  display: flex;
  gap: 7px;
  padding: 8px 16px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ai-suggestion-row::-webkit-scrollbar { display: none; }
.ai-suggestion-row button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 11px;
  color: #27634f;
  border: 1px solid rgba(15, 111, 77, .15);
  border-radius: 999px;
  background: #fff;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.ai-suggestion-row .ai-confirm-fill { color: #fff; border-color: #0c7554; background: #0c7554; }

.ai-composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  padding: 12px 14px 11px;
  border-top: 1px solid rgba(16, 91, 68, .1);
  background: rgba(255, 255, 255, .95);
}
.ai-composer-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  min-width: 0;
  border: 1px solid rgba(17, 105, 75, .18);
  border-radius: 15px;
  background: #f7fbf9;
  box-shadow: inset 0 1px 3px rgba(13, 64, 49, .04);
}
.ai-composer-box:focus-within { border-color: rgba(13, 126, 88, .48); box-shadow: 0 0 0 3px rgba(54, 181, 133, .1); }
.ai-composer textarea {
  width: 100%;
  min-height: 46px;
  max-height: 150px;
  padding: 12px 4px 10px 13px;
  resize: none;
  color: #183e32;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
}
.ai-composer textarea::placeholder { color: #8ba198; }
.ai-voice-button {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  margin: 0 6px 6px;
  padding: 0 8px;
  color: #25654e;
  border: 0;
  border-radius: 10px;
  background: #e7f6ef;
  cursor: pointer;
}
.ai-voice-button span {
  position: relative;
  width: 8px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 6px;
}
.ai-voice-button span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 9px;
  height: 5px;
  border-bottom: 2px solid currentColor;
  transform: translateX(-50%);
}
.ai-voice-button b { font-size: 10px; }
.ai-voice-button.listening { color: #fff; background: #d34848; animation: aiPulse 1.2s infinite; }
@keyframes aiPulse { 50% { box-shadow: 0 0 0 6px rgba(211, 72, 72, .12); } }

.ai-send-button {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 82px;
  padding: 0 15px;
  color: #fff;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(135deg, #0a6248, #0e9367);
  box-shadow: 0 10px 22px rgba(12, 112, 79, .2);
  cursor: pointer;
}
.ai-send-button:disabled { opacity: .65; cursor: wait; }
.ai-send-button span { font-weight: 800; }
.ai-send-button i { font-style: normal; font-size: 17px; }
.ai-privacy-note { grid-column: 1 / -1; margin: 0; color: #8a9d96; text-align: center; font-size: 9px; }

.ai-command-center {
  position: relative;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 24px;
  color: #fff;
  border: 1px solid rgba(118, 237, 193, .2);
  border-radius: 24px;
  background:
    linear-gradient(125deg, rgba(7, 48, 39, .98), rgba(10, 112, 80, .96)),
    repeating-linear-gradient(90deg, transparent 0 40px, rgba(255, 255, 255, .03) 41px);
  box-shadow: 0 20px 45px rgba(8, 69, 52, .16);
}
.ai-command-center::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -130px;
  width: 350px;
  height: 350px;
  border: 1px solid rgba(130, 255, 205, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 35px rgba(110, 250, 193, .03), 0 0 0 70px rgba(110, 250, 193, .025);
}
.ai-command-glow { position: absolute; width: 180px; height: 180px; left: 25%; bottom: -150px; border-radius: 50%; background: rgba(79, 255, 187, .22); filter: blur(38px); }
.ai-command-main { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(260px, 1.1fr) 1fr; gap: 24px; align-items: center; }
.ai-command-title span { color: #84e7bf; font-size: 10px; font-weight: 900; letter-spacing: .18em; }
.ai-command-title h2 { margin: 7px 0; color: #fff; font-size: clamp(20px, 2.2vw, 31px); line-height: 1.25; }
.ai-command-title p { margin: 0; color: rgba(233, 255, 246, .7); font-size: 13px; }
.ai-command-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ai-command-metrics div { min-width: 0; padding: 13px 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.065); }
.ai-command-metrics span { display: block; overflow: hidden; color: rgba(229,255,245,.6); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.ai-command-metrics strong { display: block; margin-top: 7px; overflow: hidden; color: #fff; font-size: 17px; white-space: nowrap; text-overflow: ellipsis; }
.ai-command-actions { position: relative; z-index: 1; display: flex; gap: 9px; margin-top: 17px; }
.ai-command-actions button, .ai-page-entry {
  min-height: 40px;
  padding: 0 15px;
  color: #165c45;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  background: rgba(255,255,255,.9);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.ai-command-actions button.primary { color: #073d30; background: linear-gradient(135deg, #b9f8dc, #77dda9); }
.ai-page-entry { color: #fff; border: 0; background: linear-gradient(135deg, #0b6c50, #11a170); box-shadow: 0 8px 18px rgba(12, 110, 77, .14); }

.ai-customer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 16px;
  padding: 14px 15px;
  border: 1px solid rgba(13, 121, 83, .14);
  border-radius: 16px;
  background: linear-gradient(145deg, #effaf5, #e5f6ee);
}
.ai-customer-toolbar > div:first-child { display: flex; flex-direction: column; }
.ai-customer-toolbar span { color: #0c7755; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.ai-customer-toolbar strong { margin-top: 4px; color: #1e493a; font-size: 13px; }
.ai-customer-toolbar > div:last-child, .ai-inline-tools { display: flex; flex-wrap: wrap; gap: 7px; }
.ai-customer-toolbar button, .ai-inline-tools button {
  min-height: 35px;
  padding: 0 11px;
  color: #fff;
  border: 0;
  border-radius: 10px;
  background: #0b7b57;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.ai-inline-tools { margin: 10px 0; padding: 10px; border-radius: 13px; background: #edf8f3; }
.ai-inline-tools button:last-child { color: #1b644d; border: 1px solid rgba(12, 119, 83, .18); background: #fff; }
.ai-inline-tools > span { align-self: center; color: #617a70; font-size: 11px; line-height: 1.5; }

body.ai-panel-open { overflow: hidden; }

@media (max-width: 900px) {
  .ai-command-main { grid-template-columns: 1fr; gap: 16px; }
  .ai-command-metrics { grid-template-columns: repeat(4, minmax(90px, 1fr)); overflow-x: auto; }
}

@media (max-width: 760px) {
  .ai-launcher {
    right: 14px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    min-height: 54px;
    padding: 6px 13px 6px 7px;
  }
  .ai-launcher-orbit { width: 40px; height: 40px; flex-basis: 40px; }
  .ai-launcher-copy strong { font-size: 13px; }
  .ai-launcher-copy small { display: none; }
  .ai-panel {
    inset: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
    transform: translateY(100%);
  }
  .ai-panel.open { transform: translateY(0); }
  .ai-panel-header { min-height: calc(67px + env(safe-area-inset-top)); padding: calc(10px + env(safe-area-inset-top)) 13px 10px; }
  .ai-brand-glyph { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; }
  .ai-brand-lockup strong { max-width: 178px; font-size: 16px; }
  .ai-header-actions button { min-height: 34px; padding: 0 9px; }
  .ai-command-strip { margin: 0 8px 7px; padding: 10px; border-radius: 15px; }
  .ai-command-intro { margin-bottom: 7px; }
  .ai-command-intro strong { display: none; }
  .ai-feature-grid { gap: 5px; }
  .ai-feature-grid button { min-height: 62px; padding: 7px 5px; text-align: center; }
  .ai-feature-grid button i { margin: 0 auto 5px; }
  .ai-feature-grid button strong { font-size: 10px; }
  .ai-chat-stream { padding: 8px 10px 14px; }
  .ai-message.assistant { padding-right: 4px; }
  .ai-message.user { padding-left: 34px; }
  .ai-message-content { padding: 11px 12px; }
  .ai-message-text { font-size: 13px; line-height: 1.7; }
  .ai-data-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-thinking { margin-left: 48px; }
  .ai-suggestion-row { padding: 6px 10px 8px; }
  .ai-composer { padding: 9px 9px calc(8px + env(safe-area-inset-bottom)); }
  .ai-send-button { min-width: 66px; padding: 0 11px; }
  .ai-send-button i { display: none; }
  .ai-command-center { padding: 18px; border-radius: 20px; }
  .ai-command-metrics { grid-template-columns: repeat(2, 1fr); overflow: visible; }
  .ai-command-title h2 { font-size: 22px; }
  .ai-command-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .ai-command-actions button { padding: 0 9px; }
  .ai-customer-toolbar { align-items: flex-start; flex-direction: column; gap: 10px; }
  .ai-customer-toolbar > div:last-child { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .ai-customer-toolbar button { padding: 0 6px; }
}

@media (max-width: 380px) {
  .ai-header-actions button:first-child { display: none; }
  .ai-feature-grid button:nth-child(4) { display: none; }
  .ai-feature-grid { grid-template-columns: repeat(3, 1fr); }
  .ai-data-cards { grid-template-columns: 1fr; }
  .ai-privacy-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-launcher-orbit::before,
  .ai-launcher-orbit::after,
  .ai-thinking span,
  .ai-voice-button.listening { animation: none; }
  .ai-panel, .ai-panel-shade, .ai-launcher { transition: none; }
}
