/* 输入区域 */
.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: 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);
    position: absolute;
    left: 50%;
    bottom: calc(100% - 2px);
    transform: translateX(-50%);
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 90%;
    max-width: 90%;
    margin: 0;
    overflow: visible;
    border: none;
    background: transparent;
    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: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 12px;
    border: none;
    border-radius: 0;
    background: var(--runtime-queue-bg);
}

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

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

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

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

.runtime-queue-item__action--danger:hover {
    color: #b91c1c;
    background: rgba(185, 28, 28, 0.12);
}

.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;
}

body[data-theme='dark'] {
    .runtime-queue-list {
        --runtime-queue-bg: #2a2a2a;
        --runtime-queue-divider: 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;
    }
}

.permission-switcher {
    position: absolute;
    left: 20px;
    bottom: -28px;
    z-index: 35;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.permission-switcher__block {
    position: relative;
}

.context-usage-switcher {
    position: absolute;
    right: 35px;
    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), rgba(127, 135, 146, 0.28) 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: var(--theme-shadow-mid);
    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: var(--theme-shadow-mid);
}

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

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

.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: #d97706;
}

@media (max-width: 768px) {
    .permission-switcher {
        left: 20px;
        bottom: -28px;
    }

    .context-usage-switcher {
        right: 25px;
        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: 24px;
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: calc(var(--stadium-radius) * 2.1);
    padding: 12px 18px;
    border-radius: var(--stadium-radius);
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.16);
    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 {
    padding-top: 16px;
    padding-bottom: 16px;
    min-height: calc(var(--stadium-radius) * 2.7);
    border-color: rgba(15, 23, 42, 0.2);
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.22);
}

.stadium-shell.is-focused,
.stadium-shell.has-text {
    border-color: var(--claude-accent);
    box-shadow:
        0 2px 22px var(--claude-highlight),
        0 0 30px var(--claude-highlight),
        0 22px 60px rgba(15, 23, 42, 0.22);
}

.stadium-shell.is-multiline.is-focused,
.stadium-shell.is-multiline.has-text {
    box-shadow:
        0 2px 28px var(--claude-highlight),
        0 0 36px var(--claude-highlight),
        0 32px 86px rgba(15, 23, 42, 0.28);
}

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

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

.image-inline-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 4px 0;
    font-size: 12px;
    color: var(--text-secondary, #7f8792);
    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, #7f8792);
    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: #d14b4b;
    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;
}

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

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

.stadium-btn {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--claude-text);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, margin-top 0.2s ease;
}

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

.stadium-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.05);
}

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

.stadium-btn.send-btn {
    background: var(--claude-accent);
    color: #fffaf0;
    box-shadow: 0 10px 20px rgba(189, 93, 58, 0.28);
}

.stadium-btn.send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    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: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid #fffaf0;
    margin-left: 5px;
}

.stadium-btn.send-btn .stop-icon {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    background-color: #fffaf0;
    display: block;
}

.stadium-btn.send-btn:disabled .send-icon {
    border-left-color: rgba(255, 255, 255, 0.4);
}

.stadium-btn.send-btn:disabled .stop-icon {
    background-color: rgba(255, 255, 255, 0.4);
}

.stadium-shell.is-multiline .stadium-btn {
    align-self: flex-end;
    margin-top: 0;
}

.file-input-hidden {
    display: none;
}

.quick-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 14px);
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 230px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--claude-border);
    border-radius: 18px;
    box-shadow: var(--claude-shadow);
    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: rgba(0, 0, 0, 0.05);
}

.menu-entry.active {
    background: rgba(118, 103, 84, 0.12);
    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: rgba(255, 255, 255, 0.98);
    box-shadow: var(--claude-shadow);
    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: 140px;
}

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

.blank-hero-overlay .icon-lg {
    width: 48px;
    height: 48px;
}

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

.composer-container.blank-hero-mode {
    transform: translateY(-38vh);
}

@media (max-width: 768px) {
    .blank-hero-text {
        font-size: 28px;
    }
    .blank-hero-overlay .icon-lg {
        width: 44px;
        height: 44px;
    }
    .composer-container.blank-hero-mode {
        transform: translateY(-32vh);
    }
    .blank-hero-overlay {
        padding-bottom: 120px;
    }
}

.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;
        padding: 0 12px;
    }
    .stadium-shell {
        width: min(900px, 98%);
    }
}

.settings-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--claude-border);
    border-radius: 12px;
    box-shadow: var(--claude-shadow);
    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: rgba(255, 255, 255, 0.96) 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: rgba(61, 57, 41, 0.78);
    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 rgba(118, 103, 84, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    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 rgba(118, 103, 84, 0.14);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    background: rgba(255, 255, 255, 0.78);
    color: var(--claude-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-btn:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
}

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

.menu-btn.compress-entry {
    background: rgba(255, 255, 255, 0.78);
    color: var(--claude-success);
}

.menu-btn.compress-entry:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.95);
}

.menu-btn.clear-entry {
    background: rgba(255, 255, 255, 0.78);
    color: #bf422b;
}

.menu-btn.clear-entry:not(:disabled):hover {
    background: rgba(255, 255, 255, 0.95);
}

.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: #fff;
        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;
    }
}
