/* ========================================
   SMS CSS - 短信页面
   白底黑字统一风格 · 模拟真实短信体验
   ======================================== */

/* ---- 全屏容器 ---- */
.sms-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  z-index: var(--z-drawer);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.sms-screen.is-active {
  display: flex;
}

/* ================================================
   1. 顶部导航栏
   ================================================ */
.sms-nav {
  height: var(--status-bar-height);
  margin-top: var(--safe-area-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--spacing-lg);
  background-color: #ffffff;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sms-nav__back {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  transition: background-color var(--transition-fast);
}

.sms-nav__back:active {
  background-color: rgba(0, 0, 0, 0.05);
}

.sms-nav__back svg {
  width: 22px;
  height: 22px;
}

.sms-nav__title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: #000000;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  letter-spacing: 0.3px;
}

.sms-nav__filter {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  transition: background-color var(--transition-fast);
}

.sms-nav__filter:active {
  background-color: rgba(0, 0, 0, 0.05);
}

.sms-nav__filter svg {
  width: 20px;
  height: 20px;
}

/* ================================================
   2. 筛选标签栏
   ================================================ */
.sms-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px var(--spacing-lg) 8px;
  background: #ffffff;
  flex-shrink: 0;
}

.sms-tabs__item {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-regular);
  color: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: transparent;
  font-family: var(--font-family);
  user-select: none;
  white-space: nowrap;
}

.sms-tabs__item:active {
  background: rgba(0, 0, 0, 0.03);
}

.sms-tabs__item.is-active {
  background: #000000;
  color: #ffffff;
  font-weight: var(--font-weight-medium);
  border-color: #000000;
}

/* ================================================
   3. 短信列表区域
   ================================================ */
.sms-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
}

.sms-list {
  display: flex;
  flex-direction: column;
}

/* 单条短信项 */
.sms-item {
  display: flex;
  align-items: center;
  padding: 14px var(--spacing-lg);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  position: relative;
}

.sms-item:active {
  background-color: rgba(0, 0, 0, 0.03);
}

/* 分隔线 */
.sms-item + .sms-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 72px;
  right: var(--spacing-lg);
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
}

/* 未读状态 */
.sms-item--unread .sms-item__name {
  font-weight: var(--font-weight-semibold);
  color: #000000;
}

.sms-item--unread .sms-item__preview {
  color: rgba(0, 0, 0, 0.75);
}

/* 类型标签 */
.sms-item--spam .sms-item__tag {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.5);
}

.sms-item--unknown .sms-item__tag {
  background: rgba(0, 0, 0, 0.05);
  color: rgba(0, 0, 0, 0.45);
}

.sms-item--test .sms-item__tag {
  background: rgba(0, 0, 0, 0.07);
  color: rgba(0, 0, 0, 0.55);
}

/* ---- 头像 ---- */
.sms-item__avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.sms-item__avatar svg {
  width: 22px;
  height: 22px;
  color: rgba(0, 0, 0, 0.4);
}

.sms-item__avatar--service {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.06);
}

.sms-item__avatar--unknown {
  background: rgba(0, 0, 0, 0.04);
}

.sms-item__avatar--spam {
  background: rgba(0, 0, 0, 0.03);
}

.sms-item__avatar-text {
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  color: rgba(0, 0, 0, 0.5);
}

/* ---- 内容区 ---- */
.sms-item__body {
  flex: 1;
  margin-left: 12px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sms-item__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.sms-item__name {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}

.sms-item__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sms-item__time {
  font-size: var(--font-size-xs);
  color: rgba(0, 0, 0, 0.35);
}

.sms-item__tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: var(--font-weight-medium);
}

.sms-item__preview {
  font-size: var(--font-size-sm);
  color: rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

/* 未读圆点 */
.sms-item__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: #000000;
  flex-shrink: 0;
  margin-left: 8px;
}

/* ================================================
   4. 空状态
   ================================================ */
.sms-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: rgba(0, 0, 0, 0.3);
}

.sms-empty__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.sms-empty__text {
  font-size: var(--font-size-sm);
}

/* ================================================
   5. 短信详情/对话页
   ================================================ */
.sms-detail {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  z-index: 10;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.sms-detail.is-active {
  display: flex;
}

/* 详情导航 - iOS磨砂玻璃浮层 */
.sms-detail__nav {
  margin-top: var(--safe-area-top);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px var(--spacing-lg) 18px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(255, 255, 255, 0.25) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  flex-shrink: 0;
  border-bottom: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  min-height: 100px;
  pointer-events: none;
  border-radius: 0;
  box-shadow: none;
}

.sms-detail__nav > * {
  pointer-events: auto;
}

.sms-detail__back {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 0;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  z-index: 2;
  margin-top: 2px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.sms-detail__back:active {
  background-color: rgba(255, 255, 255, 0.75);
  transform: scale(0.94);
}

.sms-detail__back svg {
  width: 22px;
  height: 22px;
}

/* 中间头像+号码区域 */
.sms-detail__profile {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -42%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sms-detail__avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c7c7cc, #8e8e93);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sms-detail__avatar svg {
  width: 32px;
  height: 32px;
  color: #ffffff;
}

.sms-detail__name {
  font-size: 13px;
  font-weight: var(--font-weight-medium);
  color: rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  text-align: center;
  padding: 2px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sms-detail__actions {
  display: flex;
  align-items: center;
  z-index: 2;
  margin-top: 2px;
}

.sms-detail__action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 0;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.sms-detail__action-btn:active {
  background-color: rgba(255, 255, 255, 0.75);
  transform: scale(0.94);
}

.sms-detail__action-btn svg {
  width: 20px;
  height: 20px;
}

/* 对话气泡区 */
.sms-detail__messages {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px var(--spacing-lg);
  padding-top: calc(var(--safe-area-top) + 110px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 时间分隔 */
.sms-bubble-time {
  text-align: center;
  font-size: 11px;
  color: rgba(0, 0, 0, 0.3);
  padding: 8px 0;
}

/* 气泡 - 收到的消息 */
.sms-bubble--received {
  align-self: flex-start;
  max-width: 78%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 16px 16px 16px 4px;
  color: #000000;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  word-break: break-word;
}

/* 气泡 - 发送的消息 */
.sms-bubble--sent {
  align-self: flex-end;
  max-width: 78%;
  padding: 10px 14px;
  background: #000000;
  border-radius: 16px 16px 4px 16px;
  color: #ffffff;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  word-break: break-word;
}

/* 系统提示气泡 */
.sms-bubble--system {
  align-self: center;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  color: rgba(0, 0, 0, 0.4);
  font-size: 11px;
  text-align: center;
}

/* 输入栏 —— 防溢出加固 */
.sms-detail__input-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  width: auto;
  box-sizing: border-box;
  padding: 12px var(--spacing-lg);
  padding-bottom: calc(12px + var(--safe-area-bottom));
  background: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  overflow: hidden;
}

.sms-detail__input {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  width: 0;
  box-sizing: border-box;
  padding: 10px 16px;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
  color: #000000;
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  outline: none;
  transition: border-color var(--transition-fast);
}

.sms-detail__input::placeholder {
  color: rgba(0, 0, 0, 0.3);
}

.sms-detail__input:focus {
  border-color: rgba(0, 0, 0, 0.25);
}

.sms-detail__send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  box-sizing: border-box;
  border-radius: var(--radius-full);
  background: #000000;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity var(--transition-fast);
}

.sms-detail__send:active {
  opacity: 0.7;
}

.sms-detail__send svg {
  width: 18px;
  height: 18px;
  color: #ffffff;
}

/* ================================================
   6. 导航栏右侧（开关 + 生成按钮）
   ================================================ */
.sms-nav__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sms-nav__add {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  transition: background-color var(--transition-fast);
}

.sms-nav__add:active {
  background-color: rgba(0, 0, 0, 0.05);
}

.sms-nav__add svg {
  width: 20px;
  height: 20px;
}


/*---- Toggle 说明文字 ---- */
.sms-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}
.sms-toggle-label {
  font-size: 11px;
  color: rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  user-select: none;
}
/* ---- Toggle 开关 ---- */
.sms-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.sms-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.sms-toggle__slider {
  width: 36px;
  height: 20px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  position: relative;
  transition: background-color 0.25s ease;
}

.sms-toggle__slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.sms-toggle input:checked + .sms-toggle__slider {
  background: #000000;
}

.sms-toggle input:checked + .sms-toggle__slider::after {
  transform: translateX(16px);
}

/* ================================================
   7. 短信通知弹窗
   ================================================ */
.sms-notification {
  position: absolute;
  top: calc(var(--safe-area-top, 0px) + 8px);
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.06);
  z-index: 9999;
  cursor: pointer;
  transform: translateY(-120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.sms-notification.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.sms-notification__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sms-notification__icon svg {
  width: 18px;
  height: 18px;
  color: rgba(0, 0, 0, 0.5);
}

.sms-notification__body {
  flex: 1;
  min-width: 0;
}

.sms-notification__sender {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: #000000;
  margin-bottom: 2px;
}

.sms-notification__text {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================================================
   8. 打字指示器
   ================================================ */
.sms-bubble--typing {
  animation: smsTypingPulse 1.2s ease-in-out infinite;
  letter-spacing: 3px;
  font-weight: bold;
}

@keyframes smsTypingPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ================================================
   9. 猜测身份按钮
   ================================================ */
.sms-guess-btn {
  color: rgba(0, 0, 0, 0.6) !important;
}
.sms-guess-btn:active {
  background-color: rgba(0, 0, 0, 0.08) !important;
}

/* ================================================
   10. 猜测身份对话框
   ================================================ */
.sms-guess-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.sms-guess-dialog {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 320px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.sms-guess-dialog__title {
  font-size: 16px;
  font-weight: 600;
  color: #000;
  text-align: center;
  padding: 20px 16px 4px;
}

.sms-guess-dialog__hint {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.4);
  text-align: center;
  padding: 4px 16px 12px;
}

.sms-guess-dialog__list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 12px;
  max-height: 40vh;
}

.sms-guess-dialog__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background0.15s;
}

.sms-guess-dialog__item:active,
.sms-guess-dialog__item:hover {
  background: rgba(0, 0, 0, 0.04);
}

.sms-guess-dialog__item.is-selected {
  background: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 0 0 1.5px #000;
}

.sms-guess-dialog__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

.sms-guess-dialog__name {
  font-size: 14px;
  color: #000;
  font-weight: 500;
}

.sms-guess-dialog__buttons {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.sms-guess-dialog__btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
  font-family: inherit;
}

.sms-guess-dialog__btn:active {
  opacity: 0.7;
}

.sms-guess-dialog__btn--cancel {
  background: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.6);
}

.sms-guess-dialog__btn--confirm {
  background: #000;
  color: #fff;
}

.sms-guess-dialog__btn--confirm:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}


/* ================================================
   11. 气泡操作栏 + 多选 + Toast
   ================================================ */
.sms-actions-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none;
}
.sms-actions-overlay.is-active { display: block; }

.sms-actions-bar {
  position: absolute;
  z-index: 51;
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
.sms-actions-bar.is-active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}
.sms-actions-bar__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 14px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s;
}
.sms-actions-bar__btn:active { background: rgba(0,0,0,0.05); }
.sms-actions-bar__btn svg { width: 18px; height: 18px; color: #333; }
.sms-actions-bar__btn span { font-size: 11px; color: #666; }

.sms-bubble--active { opacity: 0.7; }
.sms-bubble--selected {
  outline: 2px solid #000;
  outline-offset: 2px;
  border-radius: 12px;
}

.sms-multiselect-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-bottom: calc(12px + var(--safe-area-bottom));
  background: #fff;
  border-top: 1px solid rgba(0,0,0,0.06);
  z-index: 60;
}
.sms-multiselect-bar.is-active { display: flex; }
.sms-multiselect-bar__btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.sms-multiselect-bar__btn--exit { background: rgba(0,0,0,0.06); color: #333; }
.sms-multiselect-bar__btn--del { background: #000; color: #fff; }
.sms-multiselect-bar__count { font-size: 13px; color: #666; }

.sms-multiselect-active .sms-detail__input-bar { display: none; }

.sms-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  padding: 10px 20px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.sms-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/*======== AI回复按钮 ======== */
.sms-detail__ai-reply {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  box-sizing: border-box;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  padding: 0;
}
.sms-detail__ai-reply:hover {
  background: rgba(0, 0, 0, 0.1);
}
.sms-detail__ai-reply .sms-ai-icon {
  width: 20px;
  height: 20px;
}
.sms-detail__ai-reply:active {
  transform: scale(0.92);
}

/* 大星星缓慢旋转 */
.sms-ai-icon__star-main {
  transform-origin: 12px 12px;
  animation: sms-ai-star-spin 6s linear infinite;
}
@keyframes sms-ai-star-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* 小星星1闪烁*/
.sms-ai-icon__star-sm1 {
  animation: sms-ai-twinkle1 2s ease-in-out infinite;
}
@keyframes sms-ai-twinkle1 {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 0.3; transform: scale(0.6); }
}

/* 小星星2 闪烁（错开节奏） */
.sms-ai-icon__star-sm2 {
  animation: sms-ai-twinkle2 2.5s ease-in-out 0.8s infinite;
}
@keyframes sms-ai-twinkle2 {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 0.15; transform: scale(0.5); }
}

/* ---- SMS Settings Panel ---- */
.sms-nav__settings {
  background: none;
  border: none;
  color: #555;
  width: 32px;
  height: 32px;
  padding: 4px;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sms-nav__settings svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sms-nav__settings:active {
  background: rgba(0,0,0,0.05);
}
.sms-settings-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.sms-settings-overlay.is-active {
  display: flex;
}
.sms-settings-panel {
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-height: 70%;
  overflow-y: auto;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  animation: sms-slide-up 0.25s ease;
}
@keyframes sms-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.sms-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 16px;
  font-weight: 600;
}
.sms-settings-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.sms-settings-body {
  padding: 12px 20px 24px;
}
.sms-settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #f5f5f5;
}
.sms-settings-item:last-child {
  border-bottom: none;
}
.sms-settings-item--col {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.sms-settings-item__info {
  flex: 1;
}
.sms-settings-item__title {
  font-size: 15px;
  font-weight: 500;
  color: #333;
}
.sms-settings-item__desc {
  font-size: 12px;
  color: var(--color-text-secondary, #888);
  margin-top: 2px;
}

/* 上下文记忆条数 */
.sms-settings-memory {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}
.sms-memory-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--color-border, #e0e0e0);
  border-radius: 2px;
  outline: none;
}
.sms-memory-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent, #07c160);
  cursor: pointer;
}
.sms-memory-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent, #07c160);
  background: rgba(7, 193, 96, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  min-width: 42px;
  text-align: center;
}

/* 消息折叠栏 */
.sms-fold-bar {
  display: flex;
  justify-content: center;
  padding: 8px 0 12px;
}
.sms-fold-bar__btn {
  font-size: 12px;
  color: var(--color-text-secondary, #888);
  background: var(--color-card-bg, #f5f5f5);
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: 14px;
  padding: 4px 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.sms-fold-bar__btn:active {
  background: var(--color-border, #e0e0e0);
  color: var(--color-text-primary, #333);
}
.sms-settings-freq {
  display: flex;
  gap: 8px;
  width: 100%;
}
.sms-freq-btn {
  flex: 1;
  padding: 8px 4px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.sms-freq-btn.is-active {
  background: #07c160;
  color: #fff;
  border-color: #07c160;
  font-weight: 500;
}
.sms-freq-btn:active {
  transform: scale(0.95);
}
.sms-settings-generate {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border: 1px solid #07c160;
  border-radius: 8px;
  background: #fff;
  color: #07c160;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.sms-settings-generate:active {
  background: #07c160;
  color: #fff;
}

/* ================================================
   12. 旁白剧情条
   ================================================ */
.sms-narration-card {
  align-self: center;
  max-width: 78%;
  width: fit-content;
  padding: 8px 18px;
  background: rgba(0, 0, 0, 0.025);
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.42);
  font-size: 12px;
  font-style: italic;
  line-height: 1.65;
  letter-spacing: 0.3px;
  text-align: center;
  word-break: break-word;
  user-select: text;
}

/* ================================================
   13. 拉黑消息 - 红色感叹号
   ================================================ */
.sms-bubble--blocked {
  position: relative;
  padding-right: 28px;
}
.sms-blocked-icon {
  position: absolute;
  right: -24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  line-height: 1;
  filter: none;
  opacity: 0.9;
}

/* ================================================
   13. 小屏手机响应式适配
   ================================================ */

/*
 * 移动端全屏适配
 *
 * 条件 1：max-width: 430px — 与 responsive.css 移动端断点一致。
 * 条件 2：(pointer: coarse) and (hover: none) and (max-width: 768px)
 *         检测触屏设备（无鼠标 / 无 hover 能力），覆盖 iQOO Neo 8 Pro
 *         等安卓机型在系统"显示大小"设小后逻辑视口超过 430px 的场景，
 *         同时 max-width: 768px 上限避免误伤平板横屏或小窗桌面。
 *
 * 对于桌面浏览器窗口缩到 431-768px 之间，pointer 和 hover 不匹配，
 * 不会触发 fixed 定位，SMS 页面保持 absolute 在 .phone-shell 内。
 */
@media screen and (max-width: 430px),
       screen and (pointer: coarse) and (hover: none) and (max-width: 768px) {
  .sms-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    box-sizing: border-box;
  }

  .sms-detail {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100%;
    overflow: hidden;
  }

  .sms-detail__input-bar {
    max-width: 100%;
  }
}

/* 小屏高度不足时（如 iPhone SE、小安卓机、浏览器地址栏未收起） */
@media screen and (max-height: 700px) {
  .sms-nav {
    height: 40px;
  }

  .sms-tabs {
    padding: 8px var(--spacing-lg) 6px;
  }

  .sms-tabs__item {
    padding: 5px 12px;
    font-size: 12px;
  }

  .sms-detail__nav {
    min-height: 80px;
    padding: 8px var(--spacing-lg) 12px;
  }

  .sms-detail__avatar {
    width: 48px;
    height: 48px;
  }

  .sms-detail__avatar svg {
    width: 26px;
    height: 26px;
  }

  .sms-detail__messages {
    padding-top: calc(var(--safe-area-top) + 90px);
  }

  .sms-detail__input-bar {
    padding: 8px var(--spacing-lg);
    padding-bottom: calc(8px + var(--safe-area-bottom));
    gap: 8px;
  }

  .sms-detail__input {
    padding: 8px 14px;
  }

  .sms-detail__send {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .sms-detail__ai-reply {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .sms-item {
    padding: 10px var(--spacing-lg);
  }

  .sms-item__avatar {
    width: 42px;
    height: 42px;
  }
}

/* 极窄屏幕：保住右侧发送和 AI 回复按钮完整可见 */
@media screen and (max-width: 360px) {
  .sms-detail__input-bar {
    gap: 6px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .sms-detail__input {
    padding-left: 12px;
    padding-right: 12px;
  }

  .sms-detail__send {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .sms-detail__send svg {
    width: 16px;
    height: 16px;
  }

  .sms-detail__ai-reply {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .sms-detail__ai-reply .sms-ai-icon {
    width: 18px;
    height: 18px;
  }
}

/* 极小屏幕（高度 < 600px，如横屏或超小设备） */
@media screen and (max-height: 600px) {
  .sms-nav {
    height: 36px;
    margin-top: 0;
  }

  .sms-tabs {
    padding: 6px var(--spacing-lg) 4px;
  }

  .sms-detail__nav {
    min-height: 64px;
    padding: 6px var(--spacing-lg) 8px;
  }

  .sms-detail__avatar {
    width: 40px;
    height: 40px;
  }

  .sms-detail__messages {
    padding-top: calc(var(--safe-area-top) + 70px);
  }

  .sms-detail__input-bar {
    padding: 6px var(--spacing-lg);
    padding-bottom: calc(6px + var(--safe-area-bottom));
  }

  .sms-settings-panel {
    max-height: 80%;
  }
}
