/* 浅色金牌教练：欢迎态与对话态共用输入框外观，只有位置与入场动画随欢迎状态切换。 */
.theme-light .app-main-shell:has(#chatContainer:not(.hidden) #welcomeScreen:not(.hidden)) {
    overflow-y: auto;
}

/* 金牌教练统一使用暖米色底，欢迎态与对话态一致，避免发送后背景跳变。 */
.theme-light main.app-main-shell:has(#chatContainer:not(.hidden)) {
    background: #F5F4ED !important;
}

.theme-light main.app-main-shell:has(#chatContainer:not(.hidden))::before,
.theme-light main.app-main-shell:has(#chatContainer:not(.hidden)) .app-algorithm-backdrop {
    display: none;
}

.theme-light #chatContainer:has(#welcomeScreen:not(.hidden)) {
    flex: 0 0 auto;
    overflow: visible;
    padding: clamp(80px, 22vh, 240px) 24px 36px;
}

.theme-light #welcomeScreen.welcome-screen {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.theme-light #welcomeScreen.welcome-screen::before {
    display: none;
}

.theme-light #welcomeScreen .welcome-title {
    margin: 0;
    font-family: 'Baloo 2', 'Segoe UI', sans-serif;
    font-size: clamp(52px, 5.4vw, 72px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.theme-light .coach-wordmark {
    display: block;
    width: 3.944em;
    height: 1.1em;
    max-width: 100%;
    margin: 0 auto;
    overflow: visible;
}

.theme-light .coach-ink-stroke {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}

/* 每笔独立延时，沿字形中心线连续书写；离开页面移除动画，切回重新落笔。 */
.theme-light #chatContainer:not(.hidden) #welcomeScreen:not(.hidden) .coach-ink-stroke {
    animation: coach-ink-write var(--ink-duration) linear var(--ink-delay) both;
}

/* Slogan 与顶栏页名 h1#pageTitle 同一宋体族，字重继承标题 600（浅色主题页名同档），保持中文标题语言统一；
   颜色继承标题，字号按标题比例缩小保持层级；左内边距抵消末字字距，保证视觉居中。 */
.theme-light #welcomeScreen .coach-slogan {
    display: block;
    margin: 0.5em auto 0;
    font-family: 'Songti SC', 'STSong', 'SimSun', 'Noto Serif CJK SC', 'Noto Serif SC', serif;
    font-size: 0.3em;
    letter-spacing: 0.18em;
    padding-left: 0.18em;
    cursor: default;
    transition: color 200ms ease, transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-light #welcomeScreen .coach-slogan:hover {
    color: var(--openstd-primary);
    transform: scale(1.045);
}

/* 入场衔接落笔收尾（末笔约 2650ms 完成）；fill 用 backwards，结束后交还 transform，悬停缩放才能生效。 */
.theme-light #chatContainer:not(.hidden) #welcomeScreen:not(.hidden) .coach-slogan {
    animation: coach-slogan-enter 420ms cubic-bezier(0.16, 1, 0.3, 1) 2400ms backwards;
}

@keyframes coach-slogan-enter {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.theme-light #chatContainer:not(.hidden):has(#welcomeScreen:not(.hidden)) ~ #chatInputArea .chat-input-dock {
    transform-origin: center top;
    animation: coach-composer-bounce 760ms 100ms both;
}

@keyframes coach-ink-write {
    0% { stroke-dashoffset: 1; opacity: 0; }
    1% { opacity: 1; }
    100% { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes coach-composer-bounce {
    0% { opacity: 0; transform: translateY(28px) scale(0.97); animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
    55% { opacity: 1; transform: translateY(-7px) scale(1.006); animation-timing-function: ease-in-out; }
    78% { transform: translateY(3px) scale(0.998); animation-timing-function: ease-out; }
    100% { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .theme-light #chatContainer:not(.hidden) #welcomeScreen:not(.hidden) .coach-ink-stroke,
    .theme-light #chatContainer:not(.hidden):has(#welcomeScreen:not(.hidden)) ~ #chatInputArea .chat-input-dock {
        animation: none;
    }

    .theme-light #welcomeScreen .coach-slogan {
        animation: none;
        transition: none;
    }

    .theme-light #welcomeScreen .coach-slogan:hover {
        transform: none;
    }
}

.theme-light #chatContainer:not(.hidden):has(#welcomeScreen:not(.hidden)) ~ #chatInputArea {
    flex: 1 0 auto;
    padding: 0 24px 36px;
}

.theme-light #chatContainer:not(.hidden) ~ #chatInputArea .chat-input-dock {
    width: min(100%, 700px);
    max-width: 700px;
}

.theme-light #chatContainer:not(.hidden) ~ #chatInputArea #userInput {
    display: block;
    min-height: 92px;
    padding: 6px 4px;
    font-size: 15px;
    line-height: 1.7;
    border: 0;
    background: transparent;
    box-shadow: none;
}

/* 统一外框与焦点，避免原有双层边框、厚阴影把提问区变成表单面板。 */
.theme-light #chatContainer:not(.hidden) ~ #chatInputArea .input-container {
    padding: 18px 20px 14px;
    border-radius: 22px;
    box-shadow: 0 4px 6px -4px rgba(46, 42, 37, 0.06), 0 16px 40px -20px rgba(46, 42, 37, 0.18);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.theme-light #chatContainer:not(.hidden) ~ #chatInputArea .input-container:focus-within {
    border-color: var(--openstd-primary);
    box-shadow: 0 0 0 3px var(--openstd-primary-soft), 0 16px 40px -20px rgba(46, 42, 37, 0.18);
}

.theme-light #chatContainer:not(.hidden) ~ #chatInputArea .chat-input-wrapper {
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.theme-light #chatContainer:not(.hidden) ~ #chatInputArea .chat-input-wrapper > .flex {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 0;
}

.theme-light #chatContainer:not(.hidden) ~ #chatInputArea .chat-mode-toggle {
    min-height: 34px;
    padding: 0 11px;
    font-weight: 500;
    box-shadow: none;
}

.theme-light #chatContainer:not(.hidden) ~ #chatInputArea .chat-mode-toggle:not(.is-knowledge) {
    border-color: var(--openstd-soft-border);
    background: transparent;
}

.theme-light #chatContainer:not(.hidden) ~ #chatInputArea .chat-input-tools .app-icon-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 8px;
    border-color: transparent;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
}

.theme-light #chatContainer:not(.hidden) ~ #chatInputArea .chat-input-tools .app-icon-button:hover {
    background: var(--openstd-primary-soft);
}

.theme-light #chatContainer:not(.hidden) ~ #chatInputArea #sendBtn {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    box-shadow: none;
}

@media (max-width: 640px) {
    .theme-light #chatContainer:has(#welcomeScreen:not(.hidden)) {
        padding: clamp(56px, 17vh, 136px) 16px 28px;
    }

    .theme-light #chatContainer:not(.hidden):has(#welcomeScreen:not(.hidden)) ~ #chatInputArea {
        padding: 0 16px 36px;
    }

    .theme-light #chatContainer:not(.hidden) ~ #chatInputArea #userInput {
        min-height: 88px;
    }

    .theme-light #chatContainer:not(.hidden) ~ #chatInputArea .input-container {
        padding: 16px 14px 12px;
        border-radius: 18px;
    }
}

@media (max-height: 600px) {
    .theme-light #chatContainer:has(#welcomeScreen:not(.hidden)) {
        padding-top: 32px;
    }
}
