/* 云台手机端原型 */

:root {
  --brand-blue: #1677ff;
  --brand-red: #e60012;
  --text: #1f1f1f;
  --text-2: #8c8c8c;
  --border: #f0f0f0;
  --bg: #fff;
  --bg-gray: #f5f5f5;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --phone-home-inset: 28px;
  --tab-h: 72px;
  --phone-w: 390px;
  --phone-h: 844px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: "PingFang SC", "SF Pro Text", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  background: #dfe3ea;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  border: none;
  background: none;
  color: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

/* ===== 手机外框（桌面预览） ===== */
.phone-shell {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.phone-frame {
  width: min(100vw, var(--phone-w));
  height: min(100dvh - 32px, var(--phone-h));
  background: var(--bg);
  border-radius: 28px;
  box-shadow:
    0 0 0 10px #1a1a1a,
    0 0 0 12px #333,
    0 24px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (max-width: 430px) {
  .phone-shell {
    padding: 0;
    background: var(--bg);
  }

  .phone-frame {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ===== 状态栏 ===== */
.status-bar {
  height: 44px;
  padding: 14px 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: #fff;
  z-index: 5;
}

.status-time {
  font-size: 15px;
  font-weight: 600;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-signal,
.status-wifi {
  width: 16px;
  height: 10px;
  background: #111;
  border-radius: 1px;
  opacity: 0.85;
}

.status-wifi {
  width: 14px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.status-battery {
  font-size: 12px;
  font-weight: 600;
  padding: 1px 5px;
  border: 1.5px solid #111;
  border-radius: 4px;
}

/* ===== 页面容器 ===== */
.page {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  background: #fff;
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom));
}

.page.is-active {
  display: flex;
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #333;
}

.icon-btn:active {
  background: rgba(0, 0, 0, 0.05);
}

/* ===== 消息页 ===== */
.msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px 8px 16px;
  flex-shrink: 0;
}

.org-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 16px;
  font-weight: 600;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-header-actions {
  display: flex;
  gap: 2px;
}

.msg-search-row {
  padding: 0 16px 10px;
  flex-shrink: 0;
}

.msg-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 14px;
  background: var(--bg-gray);
  border-radius: 18px;
}

.msg-search input {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  outline: none;
  background: transparent;
}

.msg-search input::placeholder {
  color: #bbb;
}

.msg-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px 8px 12px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}

.msg-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  position: relative;
  flex-shrink: 0;
  padding: 8px 10px;
  font-size: 13px;
  color: #666;
  white-space: nowrap;
}

.filter-chip.is-active {
  color: var(--brand-blue);
  font-weight: 600;
}

.filter-chip.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 24px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--brand-blue);
}

.filter-chip.has-dot::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-red);
}

.filter-trash {
  margin-left: auto;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
}

.msg-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.msg-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  align-items: flex-start;
}

.msg-item:active {
  background: #fafafa;
}

.msg-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  background: #91caff;
}

.msg-avatar.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: #eee;
  padding: 1px;
}

.msg-avatar.grid span {
  background: #adc6ff;
  font-size: 0;
}

.msg-avatar.notice {
  background: linear-gradient(145deg, #ffd666, #faad14);
  font-size: 18px;
}

.msg-avatar.system {
  background: linear-gradient(145deg, #69b1ff, #1677ff);
}

.msg-body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.msg-row1 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.msg-name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.msg-tag {
  flex-shrink: 0;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #f0f0f0;
  color: #888;
}

.msg-tag.dept {
  background: #f6ffed;
  color: #52c41a;
}

.msg-time {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 12px;
  color: #bbb;
}

.msg-row2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.msg-preview {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-unread {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--brand-red);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

/* ===== AI专家页 ===== */
.page-yxk {
  background: #fff;
  position: relative;
}

.yxk-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 4px;
  flex-shrink: 0;
  border-bottom: 1px solid transparent;
}

.yxk-nav-left,
.yxk-nav-right {
  display: flex;
  align-items: center;
  width: 80px;
  flex-shrink: 0;
}

.yxk-nav-right {
  justify-content: flex-end;
}

.yxk-nav-center {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.yxk-title-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 8px;
}

.yxk-title-switch:active {
  background: #f5f5f5;
}

.yxk-nav-title {
  font-size: 17px;
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.yxk-nav-caret {
  flex-shrink: 0;
  color: #8c8c8c;
  transition: transform 0.2s ease, color 0.2s ease;
}

.yxk-title-switch[aria-expanded="true"] .yxk-nav-title,
.page-yxk.agent-switcher-open .yxk-nav-title {
  color: var(--brand-red);
}

.yxk-title-switch[aria-expanded="true"] .yxk-nav-caret,
.page-yxk.agent-switcher-open .yxk-nav-caret {
  color: var(--brand-red);
  transform: rotate(180deg);
}

.yxk-agent-switcher {
  flex-shrink: 0;
  max-height: 42%;
  overflow-y: auto;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  -webkit-overflow-scrolling: touch;
}

.yxk-agent-switcher.hidden {
  display: none !important;
}

.yxk-agent-switcher-item {
  display: block;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  background: transparent;
  color: #1f1f1f;
  font-size: 15px;
  text-align: left;
  font-family: inherit;
}

.yxk-agent-switcher-item:last-child {
  border-bottom: none;
}

.yxk-agent-switcher-item:active {
  background: #fafafa;
}

.yxk-agent-switcher-item.is-active {
  color: var(--brand-red);
  font-weight: 600;
}

.page-yxk.agent-switcher-open .yxk-body,
.page-yxk.agent-switcher-open .yxk-composer,
.page-yxk.agent-switcher-open .yxk-toolbar {
  display: none;
}

.yxk-toolbar {
  display: flex;
  justify-content: space-between;
  padding: 4px 10px;
  flex-shrink: 0;
}

.yxk-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 20px 12px;
  -webkit-overflow-scrolling: touch;
}

.yxk-welcome {
  padding-top: 28px;
}

.yxk-hi {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand-red);
  line-height: 1.35;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.yxk-hi-word {
  position: relative;
  margin-right: 4px;
}

.yxk-hi-spark {
  font-size: 12px;
  color: #ff85a2;
  margin: 0 2px 10px 0;
  align-self: flex-start;
}

.yxk-ask {
  margin-top: 6px;
  font-size: 14px;
  color: #666;
}

.yxk-try {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.yxk-try-label {
  font-size: 13px;
  color: #999;
}

.yxk-refresh {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #999;
}

.yxk-suggests {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.yxk-suggest {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fafafa;
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}

.yxk-suggest:active {
  background: #fff1f0;
  border-color: #ffccc7;
  color: var(--brand-red);
}

.yxk-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0;
}

.yxk-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.yxk-bubble.user {
  align-self: flex-end;
  background: #fff1f0;
  color: var(--text);
  border-bottom-right-radius: 4px;
}

.yxk-bubble.ai {
  align-self: flex-start;
  background: #f5f5f5;
  border-bottom-left-radius: 4px;
}

.yxk-composer {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 12px calc(10px + var(--phone-home-inset));
  flex-shrink: 0;
  background: #f5f6f8;
}

.yxk-expert-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  min-width: 0;
  background: transparent;
}

.yxk-expert-more {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #8c8c8c;
}

.yxk-expert-more:active {
  background: rgba(0, 0, 0, 0.04);
}

.yxk-expert-scroller {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 1px 2px 1px 0;
  background: transparent;
}

.yxk-expert-scroller::-webkit-scrollbar {
  display: none;
}

.yxk-expert-chip {
  flex-shrink: 0;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: transparent;
  color: #595959;
  font-size: 12px;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  max-width: 148px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yxk-expert-chip:active {
  background: rgba(0, 0, 0, 0.03);
}

.yxk-expert-chip.is-active {
  border-color: #91caff;
  color: #1677ff;
  background: #f0f7ff;
}

.yxk-composer-extras {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.yxk-composer-extras.hidden {
  display: none;
}

.yxk-attach-row,
.yxk-skill-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.yxk-attach-row.hidden,
.yxk-skill-row.hidden {
  display: none;
}

.yxk-attach-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f0f0f0;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.yxk-attach-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yxk-attach-file {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 180px;
  min-height: 40px;
  padding: 6px 28px 6px 8px;
  border-radius: 10px;
  background: #f5f6f8;
  border: 1px solid #ebebeb;
}

.yxk-attach-file-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #1677ff;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
}

.yxk-attach-file-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.yxk-attach-file-name {
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.yxk-attach-file-size {
  font-size: 11px;
  color: #999;
}

.yxk-attach-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.yxk-attach-file .yxk-attach-remove {
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.08);
  color: #8c8c8c;
}

.yxk-skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 28px;
  padding: 0 6px 0 8px;
  border-radius: 8px;
  background: #f3f0ff;
  border: 1px solid #d3adf7;
  color: #722ed1;
  font-size: 12px;
  line-height: 1;
  min-width: 0;
}

.yxk-skill-chip-icon {
  flex-shrink: 0;
  font-size: 12px;
  line-height: 1;
}

.yxk-skill-chip-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yxk-skill-chip-remove {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #9254de;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.yxk-skill-chip-remove:active {
  background: rgba(114, 46, 209, 0.12);
}

.yxk-composer-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 4px 8px 4px 6px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: border-radius 0.2s ease, padding 0.2s ease;
}

.yxk-composer-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 15px;
  line-height: 34px;
  color: var(--text);
  padding: 0 4px;
  margin: 0;
  overflow: hidden;
  overflow-y: hidden;
  white-space: nowrap;
  font-family: inherit;
  field-sizing: fixed;
}

.yxk-composer-input::placeholder {
  color: #b0b0b0;
  line-height: 34px;
}

.yxk-composer-toolbar {
  display: contents;
}

.yxk-plus-wrap {
  position: relative;
  flex-shrink: 0;
}

.yxk-composer-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8c8c8c;
  border-radius: 50%;
  flex-shrink: 0;
}

.yxk-composer-icon:active {
  background: rgba(0, 0, 0, 0.04);
}

.yxk-model-select,
.yxk-toolbar-spacer,
.yxk-send-btn,
.yxk-keyboard-btn,
.yxk-hold-speak {
  display: none;
}

.yxk-keyboard-btn[hidden],
.yxk-hold-speak[hidden] {
  display: none !important;
}

/* 语音按住说话模式 */
.yxk-composer.is-voice-mode {
  padding-bottom: calc(10px + var(--phone-home-inset));
}

.yxk-composer.is-voice-mode .yxk-composer-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: minmax(72px, auto) auto;
  align-items: center;
  column-gap: 4px;
  row-gap: 4px;
  border-radius: 18px;
  padding: 16px 12px 8px;
  min-height: 120px;
}

.yxk-composer.is-voice-mode .yxk-voice-btn,
.yxk-composer.is-voice-mode .yxk-composer-input,
.yxk-composer.is-voice-mode .yxk-send-btn {
  display: none !important;
}

.yxk-composer.is-voice-mode .yxk-hold-speak {
  display: flex !important;
  grid-column: 1 / -1;
  grid-row: 1;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 64px;
  border: none;
  background: transparent;
  color: #262626;
  font-size: 22px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.04em;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.yxk-composer.is-voice-mode .yxk-keyboard-btn {
  display: inline-flex !important;
  grid-column: 1;
  grid-row: 2;
}

.yxk-composer.is-voice-mode .yxk-composer-toolbar {
  display: contents;
}

.yxk-composer.is-voice-mode .yxk-plus-wrap {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
}

/* 录音遮罩 */
.yxk-voice-overlay {
  position: absolute;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.yxk-voice-overlay[hidden] {
  display: none !important;
}

.yxk-voice-overlay.is-open {
  pointer-events: none;
}

.yxk-voice-glow {
  position: absolute;
  left: -20%;
  right: -20%;
  bottom: -8%;
  height: 48%;
  background:
    radial-gradient(ellipse 70% 55% at 50% 100%, rgba(64, 196, 196, 0.55) 0%, rgba(64, 196, 196, 0.22) 42%, transparent 72%);
  filter: blur(2px);
  transition: background 0.2s ease, opacity 0.2s ease;
}

.yxk-voice-overlay.is-cancel .yxk-voice-glow {
  background:
    radial-gradient(ellipse 70% 55% at 50% 100%, rgba(255, 120, 117, 0.5) 0%, rgba(255, 120, 117, 0.2) 42%, transparent 72%);
}

.yxk-voice-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 24px calc(96px + var(--phone-home-inset));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.yxk-voice-tip {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #1f1f1f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.yxk-voice-overlay.is-cancel .yxk-voice-tip {
  color: #cf1322;
}

.yxk-voice-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 36px;
}

.yxk-voice-wave span {
  width: 3px;
  height: 10px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.55);
  animation: yxk-wave 0.9s ease-in-out infinite;
}

.yxk-voice-wave span:nth-child(odd) { animation-duration: 0.75s; }
.yxk-voice-wave span:nth-child(3n) { animation-duration: 1.05s; }
.yxk-voice-wave span:nth-child(1) { animation-delay: 0s; }
.yxk-voice-wave span:nth-child(2) { animation-delay: 0.05s; }
.yxk-voice-wave span:nth-child(3) { animation-delay: 0.1s; }
.yxk-voice-wave span:nth-child(4) { animation-delay: 0.15s; }
.yxk-voice-wave span:nth-child(5) { animation-delay: 0.08s; }
.yxk-voice-wave span:nth-child(6) { animation-delay: 0.2s; }
.yxk-voice-wave span:nth-child(7) { animation-delay: 0.12s; }
.yxk-voice-wave span:nth-child(8) { animation-delay: 0.18s; }
.yxk-voice-wave span:nth-child(9) { animation-delay: 0.04s; }
.yxk-voice-wave span:nth-child(10) { animation-delay: 0.22s; }
.yxk-voice-wave span:nth-child(11) { animation-delay: 0.09s; }
.yxk-voice-wave span:nth-child(12) { animation-delay: 0.16s; }
.yxk-voice-wave span:nth-child(13) { animation-delay: 0.03s; }
.yxk-voice-wave span:nth-child(14) { animation-delay: 0.19s; }
.yxk-voice-wave span:nth-child(15) { animation-delay: 0.07s; }
.yxk-voice-wave span:nth-child(16) { animation-delay: 0.14s; }
.yxk-voice-wave span:nth-child(17) { animation-delay: 0.02s; }
.yxk-voice-wave span:nth-child(18) { animation-delay: 0.21s; }
.yxk-voice-wave span:nth-child(19) { animation-delay: 0.11s; }
.yxk-voice-wave span:nth-child(20) { animation-delay: 0.06s; }

.yxk-voice-overlay.is-cancel .yxk-voice-wave span {
  background: #fff1f0;
  animation-play-state: paused;
  height: 8px !important;
}

@keyframes yxk-wave {
  0%, 100% { height: 8px; opacity: 0.75; }
  50% { height: 28px; opacity: 1; }
}

/* 输入态 / 有附件或技能：保持单行输入，附件/技能在上方 */
.yxk-composer.is-focused,
.yxk-composer.has-text,
.yxk-composer.has-extras {
  padding-bottom: 8px;
}

.yxk-composer.is-focused .yxk-composer-card,
.yxk-composer.has-text .yxk-composer-card,
.yxk-composer.has-extras .yxk-composer-card {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 4px 8px 4px 6px;
  min-height: 44px;
}

.yxk-composer.has-extras .yxk-composer-card {
  border-radius: 18px;
  padding: 8px 10px 6px;
}

.yxk-composer.has-extras .yxk-composer-extras {
  flex: 1 0 100%;
  order: -1;
}

.yxk-composer.is-focused .yxk-composer-input,
.yxk-composer.has-text .yxk-composer-input,
.yxk-composer.has-extras .yxk-composer-input {
  flex: 1;
  min-width: 0;
  width: auto;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  line-height: 34px;
  padding: 0 4px;
  overflow: hidden;
  overflow-y: hidden;
  white-space: nowrap;
  word-break: normal;
}

.yxk-composer.is-focused .yxk-voice-btn,
.yxk-composer.has-text .yxk-voice-btn,
.yxk-composer.has-extras .yxk-voice-btn {
  flex-shrink: 0;
}

.yxk-composer.is-focused .yxk-composer-toolbar,
.yxk-composer.has-text .yxk-composer-toolbar,
.yxk-composer.has-extras .yxk-composer-toolbar {
  display: contents;
}

.yxk-composer.is-focused .yxk-plus-wrap,
.yxk-composer.has-text .yxk-plus-wrap,
.yxk-composer.has-extras .yxk-plus-wrap {
  flex-shrink: 0;
}

.yxk-composer.is-focused .yxk-send-btn,
.yxk-composer.has-text .yxk-send-btn,
.yxk-composer.has-extras .yxk-send-btn {
  display: inline-flex;
  flex-shrink: 0;
}

.yxk-model-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 8px 0 4px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #595959;
  font-size: 13px;
  font-family: inherit;
  max-width: 140px;
}

.yxk-model-trigger[aria-expanded="true"] {
  background: #eef5ff;
  color: var(--brand-blue);
}

.yxk-mode-badge {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #1677ff;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.yxk-model-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.yxk-model-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  min-width: 132px;
  padding: 6px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 40;
}

.yxk-model-option {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  color: #333;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.yxk-model-option.is-active,
.yxk-model-option:active {
  background: #f5f5f5;
  color: var(--brand-blue);
}

.yxk-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e8e8e8;
  color: #fff;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.yxk-send-btn.has-text {
  background: var(--brand-blue);
}

.yxk-send-btn:disabled {
  opacity: 0.7;
}

/* 模拟系统键盘 */
.yxk-keyboard {
  flex-shrink: 0;
  background: #d1d3d9;
  border-top: 1px solid #c5c7cc;
  padding: 6px 4px calc(8px + max(var(--safe-bottom), var(--phone-home-inset)));
}

.yxk-keyboard[hidden] {
  display: none !important;
}

.yxk-keyboard-candidates {
  display: flex;
  gap: 2px;
  padding: 4px 8px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.yxk-keyboard-candidates span {
  flex-shrink: 0;
  min-width: 32px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #333;
  background: #fff;
  border-radius: 6px;
  padding: 0 8px;
}

.yxk-keyboard-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.yxk-keyboard-row {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 0 3px;
}

.yxk-key {
  flex: 1;
  max-width: 34px;
  height: 42px;
  border: none;
  border-radius: 6px;
  background: #fff;
  color: #111;
  font-size: 15px;
  font-family: inherit;
  box-shadow: 0 1px 0 #8e8e93;
}

.yxk-key:active {
  background: #bdbfc5;
}

.yxk-key-wide {
  max-width: 46px;
  flex: 1.3;
  font-size: 14px;
}

.yxk-key-fn {
  max-width: 52px;
  flex: 1.4;
  font-size: 13px;
  background: #abb0ba;
}

.yxk-key-space {
  max-width: none;
  flex: 4;
  font-size: 14px;
  color: #333;
}

.yxk-sheet-panel[data-skill-enabled="false"] .yxk-sheet-list-item[data-tool="skill"] {
  opacity: 0.42;
  color: #8c8c8c;
}

.yxk-sheet-panel[data-skill-enabled="false"] .yxk-sheet-list-item[data-tool="skill"] .yxk-sheet-list-label::after {
  content: "（办公任务可用）";
  margin-left: 6px;
  font-size: 12px;
  color: #bfbfbf;
}

#yxkPlusBtn.is-open {
  color: var(--brand-blue);
  background: #eef5ff;
}

#yxkPlusBtn.is-open svg {
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

#yxkPlusBtn svg {
  transition: transform 0.2s ease;
}

/* ===== 历史对话侧栏 ===== */
.yxk-history-drawer {
  position: absolute;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}

.yxk-history-drawer:not([hidden]) {
  pointer-events: auto;
}

.yxk-history-mask {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.38);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.yxk-history-drawer.is-open .yxk-history-mask {
  opacity: 1;
}

.yxk-history-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(82%, 320px);
  background: #fff;
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
  padding-top: 44px;
}

.yxk-history-drawer.is-open .yxk-history-panel {
  transform: translateX(0);
}

.yxk-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px 8px 16px;
  flex-shrink: 0;
}

.yxk-history-title {
  font-size: 17px;
  font-weight: 600;
  color: #262626;
}

.yxk-history-head-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.yxk-history-search-wrap {
  padding: 0 12px 10px;
  flex-shrink: 0;
}

.yxk-history-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: #f5f6f8;
}

.yxk-history-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
}

.yxk-history-search input::placeholder {
  color: #b0b0b0;
}

.yxk-history-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 4px 8px 16px;
  -webkit-overflow-scrolling: touch;
}

.yxk-history-group-title {
  margin: 8px 8px 6px;
  font-size: 12px;
  color: #8c8c8c;
  font-weight: 500;
}

.yxk-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  border: none;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  font-family: inherit;
  color: inherit;
}

.yxk-history-item:active {
  background: #f5f6f8;
}

.yxk-history-item.is-active {
  background: #eef5ff;
}

.yxk-history-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f5f6f8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.yxk-history-item.is-active .yxk-history-item-icon {
  background: #fff;
}

.yxk-history-item-body {
  flex: 1;
  min-width: 0;
}

.yxk-history-item-title {
  font-size: 14px;
  font-weight: 500;
  color: #262626;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yxk-history-item-preview {
  margin-top: 2px;
  font-size: 12px;
  color: #8c8c8c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yxk-history-item-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.yxk-history-action {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #bfbfbf;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.yxk-history-action.pinned {
  color: #faad14;
}

.yxk-history-action:active {
  background: #f0f0f0;
}

.yxk-history-empty {
  margin: 48px 16px;
  text-align: center;
  color: #8c8c8c;
  font-size: 14px;
}

.yxk-sheet {
  position: absolute;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.yxk-sheet:not([hidden]) {
  pointer-events: auto;
}

.yxk-sheet-mask {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(0, 0, 0, 0.38);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.yxk-sheet.is-open .yxk-sheet-mask {
  opacity: 1;
}

.yxk-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateY(105%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
  max-height: min(72%, 520px);
  overflow-y: auto;
}

.yxk-sheet.is-open .yxk-sheet-panel {
  transform: translateY(0);
}

.yxk-sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: #d9d9d9;
  margin: 4px auto 14px;
}

.yxk-sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}

.yxk-sheet-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 12px;
  border: none;
  border-radius: 14px;
  background: #f5f6f8;
  color: #262626;
  font-size: 12px;
  font-family: inherit;
  line-height: 1.2;
}

.yxk-sheet-grid-item:active {
  background: #ebebeb;
}

.yxk-sheet-grid-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff;
  color: #595959;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.yxk-sheet-list {
  margin-top: 4px;
}

.yxk-sheet-list-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 12px 4px;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  background: transparent;
  color: #262626;
  font-size: 15px;
  font-family: inherit;
  text-align: left;
}

.yxk-sheet-list-item:last-child {
  border-bottom: none;
}

.yxk-sheet-list-item:active {
  background: #fafafa;
}

.yxk-sheet-list-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f5f6f8;
  color: #595959;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.yxk-sheet-list-label {
  flex: 1;
  min-width: 0;
}

.yxk-sheet-tag {
  flex-shrink: 0;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f6ffed;
  color: #389e0d;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
}

.yxk-sheet-tool-icons {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding-right: 2px;
}

.yxk-sheet-tool-icons:empty {
  display: none;
}

.yxk-sheet-tool-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1.5px solid #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  margin-left: -8px;
}

.yxk-sheet-tool-icons .yxk-sheet-tool-icon:first-child {
  margin-left: 0;
}

.yxk-sheet-tool-more {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1.5px solid #fff;
  margin-left: -8px;
  background: #f5f6f8;
  color: #8c8c8c;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.yxk-sheet-meta {
  flex-shrink: 0;
  color: #8c8c8c;
  font-size: 13px;
}

.yxk-sheet-chevron {
  flex-shrink: 0;
  color: #bfbfbf;
  display: inline-flex;
  align-items: center;
}

.yxk-sheet-view[hidden] {
  display: none;
}

.yxk-sheet-back {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  margin: 0 0 4px;
  padding: 0 2px;
  border: none;
  background: transparent;
  color: #262626;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
}

.yxk-sheet-back:active {
  opacity: 0.7;
}

.yxk-sheet-mode-list .yxk-sheet-list-item .yxk-sheet-check,
.yxk-sheet-model-list .yxk-sheet-list-item .yxk-sheet-check {
  flex-shrink: 0;
  color: var(--brand-blue, #1677ff);
  opacity: 0;
  display: inline-flex;
  align-items: center;
}

.yxk-sheet-mode-list .yxk-sheet-list-item.is-active .yxk-sheet-check,
.yxk-sheet-model-list .yxk-sheet-list-item.is-active .yxk-sheet-check {
  opacity: 1;
}

.yxk-sheet-mode-list .yxk-sheet-list-item.is-active,
.yxk-sheet-model-list .yxk-sheet-list-item.is-active {
  color: var(--brand-blue, #1677ff);
}

/* ===== 占位页 ===== */
.page-placeholder .placeholder-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-2);
  padding: 24px;
  text-align: center;
}

.placeholder-title {
  font-size: 18px;
  font-weight: 600;
  color: #666;
}

.placeholder-desc {
  font-size: 13px;
}

.phone-frame.yxk-open .tab-bar,
.phone-frame.experts-open .tab-bar,
.phone-frame.picker-open .tab-bar {
  display: none;
}

.phone-frame.yxk-open .page-yxk {
  padding-bottom: 0;
}

.phone-frame.experts-open .page-experts,
.phone-frame.picker-open .page-tool-picker {
  padding-bottom: var(--safe-bottom);
}

/* ===== 专家列表页 ===== */
.page-experts {
  background: #f5f6f8;
}

.experts-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 8px;
  flex-shrink: 0;
  background: #fff;
}

.experts-nav-title {
  font-size: 17px;
  font-weight: 600;
}

.experts-nav-spacer {
  width: 36px;
}

.experts-search-wrap {
  padding: 0 16px 10px;
  background: #fff;
  flex-shrink: 0;
}

.experts-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: #f5f6f8;
}

.experts-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
}

.experts-search input::placeholder {
  color: #b0b0b0;
}

.experts-cats {
  display: flex;
  gap: 8px;
  padding: 8px 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  background: #fff;
  flex-shrink: 0;
  border-bottom: 1px solid #f0f0f0;
}

.experts-cats::-webkit-scrollbar {
  display: none;
}

.experts-cat {
  flex-shrink: 0;
  height: 30px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f5f6f8;
  color: #595959;
  font-size: 13px;
  font-family: inherit;
}

.experts-cat.is-active {
  background: #fff;
  border-color: #e8e8e8;
  color: #262626;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.experts-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}

.expert-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: #fff;
  text-align: left;
  font-family: inherit;
  color: inherit;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.expert-card:active {
  background: #fafafa;
}

.expert-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.expert-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  font-weight: 600;
}

.expert-card-meta {
  min-width: 0;
  flex: 1;
}

.expert-card-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #262626;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expert-card-name {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #8c8c8c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expert-card-desc {
  margin: 0;
  font-size: 11px;
  line-height: 1.45;
  color: #8c8c8c;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
}

.expert-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.expert-card-tag {
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  background: #f5f6f8;
  color: #8c8c8c;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
}

.experts-empty {
  grid-column: 1 / -1;
  margin: 48px 0;
  text-align: center;
  color: #8c8c8c;
  font-size: 14px;
}

/* ===== 技能 / 智库 / 工具 ===== */
.page-tool-picker {
  background: #f5f6f8;
}

.tp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 8px;
  flex-shrink: 0;
  background: #fff;
}

.tp-nav-title {
  font-size: 17px;
  font-weight: 600;
}

.tp-done-btn {
  min-width: 48px;
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #1677ff;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
}

.tp-done-btn:active {
  opacity: 0.7;
}

.tp-search-wrap {
  padding: 0 16px 10px;
  background: #fff;
  flex-shrink: 0;
}

.tp-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: #f5f6f8;
}

.tp-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
}

.tp-search input::placeholder {
  color: #b0b0b0;
}

.tp-cats {
  display: flex;
  gap: 8px;
  padding: 8px 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  background: #fff;
  flex-shrink: 0;
  border-bottom: 1px solid #f0f0f0;
}

.tp-cats::-webkit-scrollbar {
  display: none;
}

.tp-cat {
  flex-shrink: 0;
  height: 30px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f5f6f8;
  color: #595959;
  font-size: 13px;
  font-family: inherit;
}

.tp-cat.is-active {
  background: #fff;
  border-color: #e8e8e8;
  color: #262626;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px 0;
  flex-shrink: 0;
}

.tp-count {
  font-size: 12px;
  color: #8c8c8c;
}

.tp-create-btn {
  border: none;
  background: transparent;
  color: #1677ff;
  font-size: 13px;
  font-family: inherit;
  padding: 0;
}

.tp-create-btn.hidden {
  display: none;
}

.tp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 0;
  flex-shrink: 0;
}

.tp-tags[hidden] {
  display: none;
}

.tp-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  height: 28px;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  background: #eef5ff;
  color: #1677ff;
  font-size: 12px;
}

.tp-tag-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.tp-tag-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

.tp-tag-remove {
  border: none;
  background: transparent;
  color: #69b1ff;
  font-size: 16px;
  line-height: 1;
  padding: 0 0 0 2px;
  cursor: pointer;
}

.tp-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.tp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: #fff;
  text-align: left;
  font-family: inherit;
  color: inherit;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.tp-item:active {
  background: #fafafa;
}

.tp-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.tp-item-body {
  flex: 1;
  min-width: 0;
}

.tp-item-title {
  font-size: 15px;
  font-weight: 500;
  color: #262626;
  line-height: 1.3;
}

.tp-item-desc {
  margin-top: 4px;
  font-size: 12px;
  color: #8c8c8c;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tp-item-action {
  flex-shrink: 0;
  min-width: 52px;
  display: flex;
  justify-content: flex-end;
}

.tp-item-check {
  color: #1677ff;
  display: inline-flex;
}

.tp-item-add {
  height: 28px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  background: #fff;
  color: #595959;
  font-size: 12px;
  font-family: inherit;
}

.tp-item-badge {
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f6ffed;
  color: #389e0d;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
}

.tp-empty {
  margin: 48px 0;
  text-align: center;
  color: #8c8c8c;
  font-size: 14px;
}

.tab-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding: 10px 12px calc(8px + var(--safe-bottom));
  display: flex;
  align-items: flex-end;
  gap: 12px;
  background: linear-gradient(
    to top,
    rgba(245, 246, 248, 0.98) 0%,
    rgba(245, 246, 248, 0.92) 55%,
    rgba(245, 246, 248, 0) 100%
  );
  border-top: none;
  z-index: 20;
  pointer-events: none;
}

.tab-bar > * {
  pointer-events: auto;
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #999;
  min-width: 0;
  padding: 4px 0 2px;
}

.tab-item.is-active {
  color: var(--brand-blue);
}

/* 独立 AI专家入口（左侧分离圆形） */
.tab-item-ai {
  flex: 0 0 auto;
  width: 58px;
  gap: 4px;
  padding: 0 0 2px;
  color: var(--brand-blue);
}

.tab-item-ai .tab-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-blue);
  letter-spacing: -0.02em;
  white-space: nowrap;
  line-height: 1;
}

.tab-item-ai.is-active .tab-label {
  color: var(--brand-blue);
}

.tab-icon {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-item-ai .tab-icon-yxk {
  width: 52px;
  height: 52px;
  margin-top: -18px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 3px #fff,
    0 4px 14px rgba(22, 119, 255, 0.22),
    0 2px 6px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.tab-icon-yxk img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.tab-item-ai.is-active .tab-icon-yxk {
  box-shadow:
    0 0 0 3px #fff,
    0 0 0 5px rgba(22, 119, 255, 0.28),
    0 4px 16px rgba(22, 119, 255, 0.28);
}

/* 其余 Tab 胶囊容器 */
.tab-bar-group {
  flex: 1;
  min-width: 0;
  height: 54px;
  display: flex;
  align-items: stretch;
  background: #fff;
  border-radius: 999px;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.1),
    0 0 0 0.5px rgba(0, 0, 0, 0.06);
  padding: 0 6px;
}

.tab-bar-group .tab-item {
  border-radius: 999px;
}

.tab-badge {
  position: absolute;
  top: -4px;
  right: -12px;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--brand-red);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.tab-label {
  font-size: 10px;
  line-height: 1.2;
}

.tab-item.is-active .tab-label {
  font-weight: 600;
}
