.home-enhancement {
    position: relative;
    z-index: 8;
    width: min(760px, calc(100vw - 48px));
    margin: 0 auto 24px;
    pointer-events: none;
}

button, a {
    -webkit-tap-highlight-color: transparent;
}

/* 下载入口移至导航菜单 */
main .action-card {
    display: none !important;
}

/* 为聊天框预留首屏高度 */
.main {
    min-height: clamp(500px, calc(100vh - 100px), 760px);
}

/* 减少页脚空白，避免顶部过早覆盖 */
.app-footer {
    padding-top: 40px !important;
    padding-bottom: 24px !important;
}

.app-footer .footer-content {
    margin-bottom: 24px;
}

.home-chat-composer {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 112px;
    padding: 14px 14px 10px;
    border: 1px solid rgba(148, 163, 184, .32);
    border-radius: 18px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 16px 42px rgba(52, 78, 130, .12), inset 0 1px 0 rgba(255, 255, 255, .85);
    backdrop-filter: blur(18px);
    pointer-events: auto;
}

.home-chat-input {
    display: block;
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 42px;
    max-height: 180px;
    align-self: stretch;
    padding: 3px 0 5px;
    border: 0;
    outline: 0;
    resize: none;
    background: transparent;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;
}

.home-chat-input::placeholder {
    color: #64748b;
}

.home-chat-send {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    align-self: flex-end;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #3f76e8;
    color: #fff;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    transition: transform .15s ease, background-color .15s ease, opacity .15s ease;
}

.home-send-icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding-bottom: 2px;
    font-family: Arial, sans-serif;
    line-height: 1;
}

.home-chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 8px;
}

.home-chat-send:hover {
    background: #2f63d1;
    transform: translateY(-1px);
}

.home-chat-send:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.home-chat-quick-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 104px;
    height: 32px;
    margin: 0;
    padding: 0 15px;
    border: 1px solid rgba(63, 118, 232, .32);
    border-radius: 18px;
    background: rgba(255, 255, 255, .86);
    color: #315fc5;
    font: inherit;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 6px 18px rgba(52, 78, 130, .08);
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.home-chat-quick-action:hover {
    background: #3f76e8;
    color: #fff;
    transform: translateY(-1px);
}

.home-chat-hint {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 12px;
    text-align: center;
}

.home-download-menu {
    position: relative;
    display: inline-flex;
}

.home-auth-entry {
    display: inline-flex;
    align-items: center;
}

.home-login-entry {
    appearance: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    color: #666;
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
}

.home-login-entry:hover {
    color: #4051b5;
}

.home-account-slot {
    display: inline-flex;
    align-items: center;
}

.home-account-slot[hidden] {
    display: none !important;
}

.home-download-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: #666;
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
    box-shadow: none;
    transition: color .2s ease;
}

.home-download-trigger:hover,
.home-download-menu.is-open .home-download-trigger {
    color: #4051b5;
}

.home-download-sep {
    display: inline-block;
    flex: 0 0 1px;
    width: 1px;
    height: 14px;
    background: #eee;
}

.home-download-chevron {
    font-size: 11px;
    transition: transform .15s ease;
}

.home-download-menu.is-open .home-download-chevron {
    transform: rotate(180deg);
}

.home-download-options {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    min-width: 174px;
    padding: 6px;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
}

.home-download-menu.is-open .home-download-options {
    display: grid;
    gap: 2px;
}

.home-download-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #1f2937;
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.home-download-option:hover {
    background: #eef4ff;
    color: #2868cf;
}

.home-download-status {
    color: #94a3b8;
    font-size: 11px;
}

@media (max-width: 640px) {
    /* 顶部导航：单行不换行，隐藏与"下载"重复的"获取手机App"入口 */
    .nav-right {
        min-width: 0;
        overflow: visible;
        scrollbar-width: none;
    }

    .nav-right .user-menu {
        position: fixed;
        top: 52px;
        right: 12px;
    }

    button:focus-visible,
    a:focus-visible {
        outline: none;
        box-shadow: none;
    }

    .nav-right::-webkit-scrollbar {
        display: none;
    }

    .brand {
        flex-shrink: 0;
    }

    .brand-name {
        white-space: nowrap;
    }

    .nav-right .nav-item,
    .home-download-trigger,
    .home-auth-entry {
        flex-shrink: 0;
        white-space: nowrap;
    }

    .nav-right .nav-item,
    .home-download-trigger {
        font-size: 13px;
    }

    /* 隐藏"获取手机App"及其前方分隔线，其余分隔线保留，间距保持一致 */
    .home-app-entry,
    .home-app-sep {
        display: none;
    }

    .home-enhancement {
        width: calc(100vw - 28px);
        margin-bottom: 20px;
    }

    .main {
        min-height: 520px;
    }

    .home-chat-composer {
        min-height: 108px;
        padding: 12px 11px 9px;
        border-radius: 16px;
    }

    .home-chat-input {
        min-height: 40px;
        font-size: 14px;
    }

    .home-chat-quick-action {
        height: 30px;
        min-width: 96px;
        padding: 0 13px;
    }

    .home-download-options {
        right: 0;
        min-width: 160px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-chat-send,
    .home-chat-quick-action,
    .home-download-chevron {
        transition: none;
    }
}
