/* 输入区域 */
.input-area {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 32px;
  background: transparent;
  padding: 0 24px;
  flex-shrink: 0;
  pointer-events: none;
  z-index: 30;
}

.compact-input-area {
  display: flex;
  justify-content: center;
  padding-bottom: 0;
  pointer-events: none;
}

.stadium-input-wrapper {
  position: relative;
  width: var(--chat-rail-width, min(900px, 94%));
  pointer-events: auto;
}

.runtime-queue-list {
  --runtime-queue-bg: var(--theme-surface-soft);
  --runtime-queue-divider: rgba(15, 23, 42, 0.12);
  --runtime-queue-border: rgba(15, 23, 42, 0.12);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 1px);
  transform: translateX(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 90%;
  max-width: 90%;
  margin: 0;
  overflow: visible;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  pointer-events: auto;
}

.runtime-queue-list--empty {
  height: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  margin: 0;
  overflow: visible;
  pointer-events: none;
}

.runtime-queue-item {
  position: relative;
  z-index: var(--runtime-queue-z, 1);
  min-height: 34px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 12px;
  border-left: 1px solid var(--runtime-queue-border);
  border-right: 1px solid var(--runtime-queue-border);
  border-top: 1px solid var(--runtime-queue-border);
  border-bottom: none;
  border-radius: 0;
  background: var(--runtime-queue-bg);
  overflow: hidden;
}

.runtime-queue-item--top {
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.runtime-queue-item__text {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  font-size: 13px;
  line-height: 1.3;
  color: var(--claude-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.runtime-queue-item__action {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--claude-text-secondary);
  font-size: 12px;
  line-height: 1.2;
  padding: 3px 4px;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.runtime-queue-item__action:hover {
  background: var(--theme-chip-bg);
  color: var(--claude-text);
}

.runtime-queue-item__action--danger:hover {
  color: var(--state-danger-strong);
  background: color-mix(in srgb, var(--state-danger) 12%, transparent);
}

.runtime-queue-item + .runtime-queue-item::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--runtime-queue-divider);
  pointer-events: none;
}

.skill-slash-menu-wrapper {
  --skill-slash-row-height: 28px;
  --skill-slash-gap: 3px;
  --skill-slash-radius: 9px;
  --skill-slash-pad-x: 4px;
  --skill-slash-motion-duration: 300ms;
  --skill-slash-motion-easing: cubic-bezier(0.25, 0.8, 0.25, 1);
  --skill-slash-visible-rows: 7;
  position: absolute;
  left: 50%;
  bottom: calc(100% - 1px);
  transform: translateX(-50%);
  z-index: 1;
  width: 90%;
  max-width: 90%;
  box-sizing: border-box;
  max-height: calc(
    (var(--skill-slash-row-height) * var(--skill-slash-visible-rows)) +
      (var(--skill-slash-gap) * (var(--skill-slash-visible-rows) + 1)) + 2px + 2px - 2px
  );
  border: 1px solid var(--claude-border);
  border-top-left-radius: var(--skill-slash-radius);
  border-top-right-radius: var(--skill-slash-radius);
  background: var(--surface-soft);
  box-shadow: none;
  pointer-events: auto;
}

.skill-slash-menu-motion-enter-active,
.skill-slash-menu-motion-leave-active {
  transition:
    transform var(--skill-slash-motion-duration, 300ms)
      var(--skill-slash-motion-easing, cubic-bezier(0.25, 0.8, 0.25, 1)),
    clip-path var(--skill-slash-motion-duration, 300ms)
      var(--skill-slash-motion-easing, cubic-bezier(0.25, 0.8, 0.25, 1));
  transform-origin: bottom center;
  will-change: transform, clip-path;
}

.skill-slash-menu-motion-enter-active,
.skill-slash-menu-motion-leave-active {
  z-index: 1;
}

.skill-slash-menu-motion-enter-from,
.skill-slash-menu-motion-leave-to {
  transform: translateX(-50%) translateY(100%);
  clip-path: inset(0 0 100% 0 round 12px 12px 0 0);
}

.skill-slash-menu-motion-enter-to,
.skill-slash-menu-motion-leave-from {
  transform: translateX(-50%) translateY(0);
  clip-path: inset(0 0 0 0 round 12px 12px 0 0);
}

.skill-slash-menu {
  height: 100%;
  max-height: inherit;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 4px var(--skill-slash-pad-x) 6px;
  display: flex;
  flex-direction: column;
  gap: var(--skill-slash-gap);
}

.skill-slash-menu::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.skill-slash-menu__highlight {
  position: absolute;
  left: var(--skill-slash-pad-x);
  right: var(--skill-slash-pad-x);
  top: var(--skill-slash-gap);
  height: var(--skill-slash-row-height);
  border-radius: 7px;
  background: var(--hover-bg);
  box-shadow: 0 1px 2px var(--shadow-color);
  pointer-events: none;
  z-index: 1;
}

.skill-slash-item {
  width: 100%;
  height: var(--skill-slash-row-height);
  min-height: var(--skill-slash-row-height);
  flex: 0 0 var(--skill-slash-row-height);
  display: flex;
  align-items: center;
  gap: 7px;
  border: none;
  border-radius: 7px;
  padding: 3px 9px;
  background: transparent;
  color: var(--claude-text);
  text-align: left;
  cursor: pointer;
}

.skill-slash-item:first-child {
  border-top-left-radius: calc(var(--skill-slash-radius) - var(--skill-slash-gap));
  border-top-right-radius: calc(var(--skill-slash-radius) - var(--skill-slash-gap));
}

.skill-slash-item:hover {
  background: var(--hover-bg);
  box-shadow: 0 1px 2px var(--shadow-color);
}

.skill-slash-item--active {
  background: transparent;
  box-shadow: none;
}

.skill-slash-item--active:hover {
  background: transparent;
  box-shadow: none;
}

.skill-slash-item--disabled,
.skill-slash-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.skill-slash-item--disabled:hover,
.skill-slash-item:disabled:hover {
  background: transparent;
  box-shadow: none;
}

.skill-slash-item__name {
  flex: 0 0 auto;
  max-width: 160px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-slash-item__description {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--claude-text-secondary);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-slash-empty {
  height: var(--skill-slash-row-height);
  min-height: var(--skill-slash-row-height);
  flex: 0 0 var(--skill-slash-row-height);
  display: flex;
  align-items: center;
  padding: 3px 9px;
  color: var(--claude-text-secondary);
  font-size: 11px;
}

body[data-theme='dark'] {
  .runtime-queue-list {
    --runtime-queue-bg: var(--badge-bg);
    --runtime-queue-divider: rgba(255, 255, 255, 0.12);
    --runtime-queue-border: rgba(255, 255, 255, 0.12);
    background: transparent;
  }

  .runtime-queue-item {
    background: var(--runtime-queue-bg);
  }

  .runtime-queue-list.runtime-queue-list--empty {
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .skill-slash-menu-wrapper {
    background: var(--badge-bg);
    border-color: var(--claude-border);
  }

  .skill-slash-item__name {
    color: var(--state-info);
  }

  .skill-slash-item:hover {
    background: var(--hover-bg);
    box-shadow: 0 1px 2px var(--shadow-color);
  }

  .skill-slash-item--active {
    background: transparent;
    box-shadow: none;
  }

  .skill-slash-item--active:hover {
    background: transparent;
    box-shadow: none;
  }

  .stadium-input-editor .skill-md-link,
  .stadium-input-highlight .skill-md-link {
    color: var(--state-info);
  }
}

body[data-theme='light'] {
  .skill-slash-item__name {
    color: var(--state-info);
  }

  .stadium-input-editor .skill-md-link,
  .stadium-input-highlight .skill-md-link {
    color: var(--state-info);
  }
}

.permission-switcher {
  --composer-side-control-offset: 20px;
  position: absolute;
  left: var(--composer-side-control-offset);
  bottom: -28px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.permission-switcher__block {
  position: relative;
}

.context-usage-switcher {
  --composer-side-control-offset: 20px;
  --context-ring-visual-inset: 5px;
  position: absolute;
  right: calc(var(--composer-side-control-offset) - var(--context-ring-visual-inset));
  bottom: -28px;
  z-index: 35;
}

.context-usage-switcher__btn {
  border: none;
  background: transparent;
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
}

.context-usage-switcher__btn:hover:not(:disabled) {
  background: var(--theme-chip-bg);
}

.context-usage-switcher__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.context-usage-ring {
  --context-progress: 0%;
  --context-ring-color: var(--claude-accent);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: conic-gradient(
    var(--context-ring-color) var(--context-progress),
    var(--progress-track) 0
  );
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.context-usage-ring__inner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--theme-surface-soft);
  border: 1px solid var(--theme-control-border);
}

.context-usage-switcher__tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  min-width: 94px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--theme-control-border);
  background: var(--theme-surface-soft);
  box-shadow: none;
  color: var(--claude-text);
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

.context-usage-switcher:hover .context-usage-switcher__tooltip {
  opacity: 1;
  transform: translateY(0);
}

.permission-switcher__btn {
  border: none;
  background: transparent;
  color: var(--claude-text);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.permission-switcher__btn:hover:not(:disabled) {
  color: var(--claude-text);
  text-decoration: none;
  background: var(--theme-chip-bg);
  box-shadow: none;
}

.permission-switcher__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.permission-switcher__menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--theme-control-border);
  border-radius: 14px;
  background: var(--theme-surface-soft);
  box-shadow: none;
}

.permission-switcher__menu--split {
  width: 560px;
  max-width: min(560px, calc(100vw - 40px));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;

  > :first-child.permission-switcher__group {
    grid-row: span 2;
  }
}

.permission-switcher__group {
  display: flex;
  flex-direction: column;
  gap: 6px;

  &--disabled {
    opacity: 0.35;
    pointer-events: none;
  }
}

.permission-switcher__group-title {
  font-size: 12px;
  color: var(--claude-text-secondary);
  font-weight: 600;
  padding: 2px 4px;
}

.permission-switcher__caret {
  font-size: 14px;
  color: var(--claude-text-secondary);
  transform: rotate(90deg);
  transition: transform 0.18s ease;
}

.permission-switcher__caret.open {
  transform: rotate(270deg);
}

.permission-switcher__item {
  border: none;
  background: transparent;
  text-align: left;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--claude-text);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.permission-switcher__item:hover {
  background: var(--theme-chip-bg);
}

.permission-switcher__item.active {
  background: var(--theme-tab-active);
}

.permission-switcher__item-label {
  font-size: 13px;
  font-weight: 600;
}

.permission-switcher__item-desc {
  font-size: 11px;
  color: var(--claude-text-secondary);
  line-height: 1.35;
}

.permission-switcher__item-label--warn {
  color: var(--state-warning);
}

@media (max-width: 768px) {
  .permission-switcher {
    left: var(--composer-side-control-offset);
    bottom: -28px;
  }

  .context-usage-switcher {
    right: calc(var(--composer-side-control-offset) - var(--context-ring-visual-inset));
    bottom: -28px;
  }

  /* 权限菜单在手机端自适应位置，避免跑出屏幕 */
  .permission-switcher__menu {
    left: auto;
    right: 0;
    width: min(250px, calc(100vw - 40px));
    max-width: 250px;
  }
  .permission-switcher__menu--split {
    width: min(560px, calc(100vw - 40px));
    max-width: min(560px, calc(100vw - 40px));
    grid-template-columns: 1fr;
  }
}

.stadium-shell {
  --stadium-radius: 18px;
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 10px;
  border-radius: var(--stadium-radius);
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  box-shadow: none;
  display: flex;
  gap: 12px;
  transition:
    box-shadow 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.stadium-shell.is-multiline {
  border-color: var(--border-strong);
  box-shadow: none;
}

.stadium-shell.is-focused,
.stadium-shell.has-text {
  border-color: var(--border-default);
  box-shadow: none;
}

.stadium-shell.is-multiline.is-focused,
.stadium-shell.is-multiline.has-text {
  border-color: var(--border-strong);
  box-shadow: none;
}

.input-stack {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 6px;
}

.input-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.input-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.stadium-input-rich {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  padding: 2px 0 0 6px;
}

.stadium-input-rich .stadium-input {
  grid-area: 1 / 1;
}

.stadium-input-editor .skill-md-link,
.stadium-input-editor .file-md-link {
  color: var(--accent);
  font-weight: inherit;
  border-radius: 4px;
  padding: 0 1px;
  white-space: nowrap;
  cursor: pointer;
}

.stadium-input-editor .file-md-link {
  color: var(--state-info);
}

.stadium-input-editor p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  color: var(--claude-text-tertiary);
  float: left;
  height: 0;
  pointer-events: none;
}

.image-inline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 4px 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.image-name {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.image-remove-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1;
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}
.image-remove-btn:hover {
  color: var(--state-danger);
  transform: scale(1.05);
}

.stadium-input {
  flex: 1 1 auto;
  width: 100%;
  border: none;
  resize: none;
  background: transparent;
  font-size: 14px;
  line-height: 1.4;
  font-family: inherit;
  color: var(--claude-text);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: normal;
  padding: 0;
  min-height: 20px;
  outline: none;
  overflow-y: auto;
  scrollbar-width: none;
  transition: none;
  position: relative;
  z-index: 1;
}

.stadium-input-tiptap {
  display: block;
}

.stadium-input-tiptap.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stadium-input-editor {
  cursor: text;
  min-height: 20px;
  outline: none;
  overflow-y: auto;
  scrollbar-width: none;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: normal;
}

.stadium-input-editor p {
  margin: 0;
}

.stadium-input-editor::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.stadium-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stadium-input::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.stadium-btn {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--claude-text);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 140ms ease,
    color 140ms ease;
}

.stadium-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.stadium-btn:hover:not(:disabled) {
  background: var(--hover-bg);
}

.add-btn {
  font-size: 20px;
}

.stadium-btn.send-btn {
  background: var(--claude-accent);
  color: var(--on-accent);
  box-shadow: none;
}

.stadium-btn.send-btn:hover:not(:disabled) {
  background: var(--claude-button-hover);
}

.stadium-btn.send-btn:disabled {
  opacity: 0.4;
  box-shadow: none;
}

.stadium-btn.send-btn span {
  position: relative;
  top: 0px;
}

.stadium-btn.send-btn .send-icon {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 9px solid var(--on-accent);
  margin-left: 4px;
}

.stadium-btn.send-btn .stop-icon {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background-color: var(--on-accent);
  display: block;
}

.stadium-btn.send-btn:disabled .send-icon {
  border-left-color: color-mix(in srgb, var(--on-accent) 40%, transparent);
}

.stadium-btn.send-btn:disabled .stop-icon {
  background-color: color-mix(in srgb, var(--on-accent) 40%, transparent);
}

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

/* 语音输入按钮 */
.voice-btn {
  color: var(--text-primary);
}

:root[data-theme='classic'] .voice-btn,
:root:not([data-theme]) .voice-btn {
  color: var(--accent);
}

.voice-btn:hover:not(:disabled) {
  background: var(--hover-bg);
}

.voice-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.voice-btn .mic-icon {
  display: block;
  flex-shrink: 0;
}

/* 声纹动画 */
.voice-btn--recording {
  background: var(--hover-bg) !important;
}

.voice-btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: var(--text-secondary);
}

.voice-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  height: 18px;
}

.voice-wave-bar {
  display: inline-block;
  width: 2.5px;
  height: 16px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
  animation: voice-wave-pulse 0.9s ease-in-out infinite;
}

.voice-wave-bar:nth-child(1) {
  animation-delay: 0s;
  animation-duration: 0.75s;
}

.voice-wave-bar:nth-child(2) {
  animation-delay: 0.15s;
  animation-duration: 0.9s;
}

.voice-wave-bar:nth-child(3) {
  animation-delay: 0.3s;
  animation-duration: 1.05s;
}

.voice-wave-bar:nth-child(4) {
  animation-delay: 0.1s;
  animation-duration: 0.85s;
}

@keyframes voice-wave-pulse {
  0%,
  100% {
    transform: scaleY(0.25);
    opacity: 0.6;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.file-input-hidden {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.quick-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 14px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 230px;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--claude-border);
  border-radius: 18px;
  box-shadow: none;
  z-index: 30;
  pointer-events: auto;
}

.menu-entry {
  border: none;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  text-align: left;
  color: var(--claude-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.15s ease;
  min-height: 44px;
}

.menu-entry:focus,
.menu-entry:focus-visible {
  outline: none;
}

.menu-entry:hover:not(:disabled) {
  background: var(--hover-bg);
}

.menu-entry.active {
  background: var(--chip-bg);
  color: var(--claude-text);
  font-weight: 600;
}

.menu-entry:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.menu-entry.has-submenu .entry-arrow {
  margin-left: 10px;
  color: var(--claude-text-secondary);
}

.quick-submenu {
  position: absolute;
  top: 0;
  left: calc(100% + 12px);
  width: 230px;
  min-width: 0;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--claude-border);
  background: var(--surface-soft);
  box-shadow: none;
  z-index: 31;
}

.submenu-status,
.submenu-empty {
  font-size: 13px;
  color: var(--claude-text-secondary);
}

.submenu-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Blank conversation hero */
.chat-container {
  position: relative;
}

.blank-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  pointer-events: none;
  z-index: 1;
  gap: 10px;
  padding-bottom: 160px;
  color: var(--text-primary);
}

.blank-hero-text {
  font-size: 32px;
  color: var(--text-primary);
  font-weight: 600;
  margin: 0;
  max-width: min(88vw, 680px);
  text-align: center;
  line-height: 1.3;
  text-wrap: balance;
}

.composer-container {
  position: relative;
  height: var(--composer-base-height, calc(90px + var(--app-bottom-inset)));
  flex: 0 0 var(--composer-base-height, calc(90px + var(--app-bottom-inset)));
  transition: transform 0.3s ease;
  z-index: 2;
}

.composer-container.blank-hero-mode {
  // 新对话居中态：当输入栏上方出现 git 状态栏或输入变多行时，整体可视高度会向上增长，
  // 顶到欢迎文字。用已计算好的 --composer-growth-height 把输入栏整体下移同样的距离，
  // 让栈顶回到「裸单行输入」时的位置，从而保证不遮挡欢迎文字。
  transform: translateY(calc(-38vh + var(--composer-growth-height, 0px)));
}

@media (max-width: 768px) {
  .input-area {
    padding: 0 12px;
  }

  .blank-hero-text {
    font-size: 28px;
  }
  .blank-hero-overlay .icon-lg {
    width: 44px;
    height: 44px;
  }
  .composer-container.blank-hero-mode {
    transform: translateY(calc(-38vh + var(--composer-growth-height, 0px)));
  }
  .blank-hero-overlay {
    padding-bottom: 160px;
  }
}

.quick-submenu.tool-submenu {
  top: auto;
  bottom: 0;
}

.quick-submenu.settings-submenu {
  top: auto;
  bottom: 0;
}

.menu-entry.submenu-entry {
  width: 100%;
  justify-content: space-between;
}

.menu-entry.submenu-entry .entry-arrow {
  color: var(--claude-text-secondary);
}

.tool-submenu-list {
  // 显示约 5 条工具项，其余通过滚动查看
  max-height: calc(44px * 5 + 6px * 4);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tool-submenu-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.menu-entry.disabled {
  opacity: 0.5;
}

.quick-menu-enter-active,
.quick-menu-leave-active {
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.quick-menu-enter-from,
.quick-menu-leave-to {
  opacity: 0;
  transform: translateY(8px);
}

.submenu-slide-enter-active,
.submenu-slide-leave-active {
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.submenu-slide-enter-from,
.submenu-slide-leave-to {
  opacity: 0;
  transform: translateX(10px);
}

/* 适应折叠屏/矮屏幕，保证输入区完整可见 */
@media (max-height: 900px) {
  .input-area {
    bottom: 12px;
  }
}

.settings-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  background: var(--surface-soft);
  border: 1px solid var(--claude-border);
  border-radius: 12px;
  box-shadow: none;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 150px;
  z-index: 40;
}

.settings-menu::before {
  content: '';
  position: absolute;
  bottom: -10px;
  right: 20px;
  border-width: 10px 10px 0 10px;
  border-style: solid;
  border-color: var(--surface-soft) transparent transparent transparent;
  filter: drop-shadow(0 3px 4px rgba(61, 57, 41, 0.12));
}

.settings-menu.tool-menu {
  right: auto;
  left: 0;
  min-width: 520px;
  max-width: 580px;
  padding: 16px 20px;
}

.settings-menu.tool-menu::before {
  left: 32px;
  right: auto;
}

.tool-menu .tool-menu-status,
.tool-menu .tool-menu-empty {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: left;
}

.tool-menu .tool-menu-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 12px;
}

.tool-menu .tool-category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 14px 10px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 13px;
  aspect-ratio: 1 / 1;
  min-height: 0;
  justify-content: space-between;
}

.tool-menu .tool-category-item.disabled {
  opacity: 0.55;
}

.tool-menu .tool-category-label {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--claude-text);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  white-space: nowrap;
  line-height: 1.4;
}

.tool-category-icon {
  font-size: 20px;
}

.tool-menu .tool-category-toggle {
  width: 100% !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  text-align: center;
  white-space: nowrap;
  margin-top: auto;
}

.menu-btn {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  background: var(--surface-soft);
  color: var(--claude-text);
  cursor: pointer;
  transition: all 0.2s ease;
}

.menu-btn:not(:disabled):hover {
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.menu-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.menu-btn.compress-entry {
  background: var(--surface-soft);
  color: var(--claude-success);
}

.menu-btn.compress-entry:not(:disabled):hover {
  background: var(--surface-soft);
}

.menu-btn.clear-entry {
  background: var(--surface-soft);
  color: var(--state-danger);
}

.menu-btn.clear-entry:not(:disabled):hover {
  background: var(--surface-soft);
}

.settings-menu-enter-active,
.settings-menu-leave-active {
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.settings-menu-enter-from,
.settings-menu-leave-to {
  opacity: 0;
  transform: translateY(6px);
}

/* 手机端审批面板样式 - 与电脑端保持一致 */
.mobile-approval-overlay {
  pointer-events: auto;
  justify-content: center !important;
}

.mobile-approval-overlay .mobile-panel-sheet--approval {
  pointer-events: auto;
  background: var(--claude-panel);
}

/* 手机端审批面板按钮样式 - 与电脑端一致 */
@media (max-width: 768px) {
  .mobile-panel-sheet--approval .approval-btn {
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
  }

  .mobile-panel-sheet--approval .approval-btn--approve {
    background: var(--claude-accent);
    color: var(--on-accent);
    border-color: var(--claude-accent);
  }

  .mobile-panel-sheet--approval .approval-btn--reject {
    background: transparent;
    border-color: var(--theme-control-border-strong);
  }

  .mobile-panel-sheet--approval .approval-btn--switch {
    background: transparent;
    border-color: var(--claude-accent);
    color: var(--claude-accent);
  }

  /* 审批卡片样式保持一致 */
  .mobile-panel-sheet--approval .approval-card {
    border-color: var(--theme-control-border);
    background: var(--theme-surface-soft);
  }

  /* 审批面板样式 - 移除背景色让内容顶头 */
  .mobile-panel-sheet--approval .sidebar.right-sidebar {
    background: transparent !important;
  }

  .mobile-panel-sheet--approval .sidebar-header,
  .mobile-panel-sheet--approval .sidebar .sidebar-header {
    background: transparent !important;
    border-color: var(--claude-border);
    padding: 0 16px !important;
  }

  /* 移动端审批面板关闭按钮 - 移除圆形外框 */
  .mobile-panel-sheet--approval .approval-close-btn {
    background: transparent !important;
    border-radius: 0 !important;
    width: auto !important;
    height: auto !important;
    padding: 4px !important;
    font-size: 24px !important;
  }
}

.user-question-mini-dot {
  position: absolute;
  right: 22px;
  bottom: calc(100% + 6px);
  z-index: 12;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1.5px solid var(--theme-surface-strong);
  border-radius: 999px;
  background: var(--mac-close);
  color: var(--on-accent);
  cursor: pointer;
  font-size: 11px;
  line-height: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
