/* ====== 顶栏 ====== */
.topbar {
    height: 50px; background: var(--shenlan); color: #d4dce6;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px; position: fixed; top: 0; left: 0; right: 0; z-index: 100;
}
.topbar__btn { background: none; border: none; color: #d4dce6; cursor: pointer; padding: 6px; display: flex; }
.topbar__title { font-size: 17px; font-weight: 600; }

/* ====== 站点选择 ====== */
.zhandian-bar { position: fixed; top: 50px; left: 0; right: 0; z-index: 99; background: var(--qiaopian); border-bottom: 1px solid var(--biankuang-qian); }
.zhandian-select {
    width: 100%; padding: 8px 12px; border: none; background: var(--qiaopian);
    font-size: 14px; color: var(--wenzi-fu); cursor: pointer; outline: none;
}

/* ====== 消息区 ====== */
.chat-area {
    margin-top: 90px; margin-bottom: 60px; padding: 16px 12px;
    min-height: calc(100vh - 150px);
}
.chat-messages { max-width: 720px; margin: 0 auto; }

/* 欢迎页 */
.chat-welcome { text-align: center; padding: 60px 20px; color: var(--wenzi-dan); }
.chat-welcome__icon { font-size: 48px; margin-bottom: 12px; }
.chat-welcome__title { font-size: 20px; font-weight: 600; color: var(--wenzi); margin-bottom: 6px; }
.chat-welcome__sub { font-size: 14px; }

/* 消息气泡 */
.msg { margin-bottom: 16px; display: flex; }
.msg--user { justify-content: flex-end; }
.msg--ai { justify-content: flex-start; }
.msg__bubble {
    max-width: 85%; padding: 12px 16px; border-radius: 12px;
    font-size: 15px; line-height: 1.7; word-break: break-word;
}
.msg--user .msg__bubble { background: var(--zhuse); color: #fff; border-bottom-right-radius: 4px; }
.msg--ai .msg__bubble { background: var(--qiaopian); color: var(--wenzi); border: 1px solid var(--biankuang-qian); border-bottom-left-radius: 4px; }

/* 时间轴 */
.timeline { margin-bottom: 8px; }
.timeline-item {
    display: flex; align-items: center; gap: 8px; padding: 3px 0;
    font-size: 13px; color: var(--wenzi-dan);
}
.timeline-item.active { color: var(--zhuse); }
.timeline-item.done { color: var(--wenzi-dan); }
.timeline-item.error { color: var(--weixian); }
.timeline-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    border: 2px solid currentColor;
}
.timeline-item.active .timeline-dot { background: var(--zhuse); border-color: var(--zhuse); animation: pulse 1s infinite; }
.timeline-item.done .timeline-dot { background: var(--wenzi-dan); border-color: var(--wenzi-dan); }
.timeline-item.error .timeline-dot { background: var(--weixian); border-color: var(--weixian); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.timeline-divider { border-top: 1px solid var(--biankuang-qian); margin: 8px 0; }

/* 回答区域 */
.answer-area { font-size: 15px; line-height: 1.7; }
.answer-area .typing-cursor {
    display: inline-block; width: 2px; height: 1em; background: var(--zhuse);
    vertical-align: text-bottom; animation: blink 0.8s infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* ====== 底栏 ====== */
.input-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--qiaopian); border-top: 1px solid var(--biankuang-qian);
    padding: 8px 12px; display: flex; gap: 8px; align-items: flex-end;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}
.input-box {
    flex: 1; padding: 10px 14px; border: 1px solid var(--biankuang);
    border-radius: 20px; font-size: 15px; resize: none; outline: none;
    background: var(--beijing-qian); max-height: 120px; line-height: 1.5;
    transition: var(--guodu);
}
.input-box:focus { border-color: var(--zhuse); background: var(--qiaopian); }
.send-btn {
    padding: 10px 18px; background: var(--qiangdiao); color: #fff;
    border: none; border-radius: 20px; font-size: 14px; font-weight: 600;
    cursor: pointer; flex-shrink: 0; transition: var(--guodu);
}
.send-btn:disabled { background: var(--biankuang); color: var(--wenzi-dan); cursor: not-allowed; }

/* ====== 侧边栏 ====== */
.sidebar-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200;
    opacity: 0; visibility: hidden; transition: all 0.3s;
}
.sidebar-mask.show { opacity: 1; visibility: visible; }
.sidebar {
    position: fixed; top: 0; left: -280px; bottom: 0; width: 280px;
    background: var(--qiaopian); z-index: 201; transition: left 0.3s;
    display: flex; flex-direction: column;
}
.sidebar.show { left: 0; }
.sidebar__header {
    padding: 14px 16px; border-bottom: 1px solid var(--biankuang-qian);
    display: flex; justify-content: space-between; align-items: center;
}
.sidebar__title { font-size: 16px; font-weight: 600; }
.sidebar__close { background: none; border: none; font-size: 18px; color: var(--wenzi-dan); cursor: pointer; }
.sidebar__body { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar__item {
    padding: 12px 16px; cursor: pointer; transition: var(--guodu);
    border-bottom: 1px solid var(--biankuang-qian);
    font-size: 14px; color: var(--wenzi-fu); line-height: 1.5;
}
.sidebar__item:hover { background: var(--beijing-qian); }
.sidebar__login { padding: 40px 20px; text-align: center; }
.sidebar__login p { color: var(--wenzi-dan); font-size: 14px; margin-bottom: 16px; }
.sidebar__login .login-btn {
    padding: 10px 24px; background: var(--qiangdiao); color: #fff;
    border: none; border-radius: var(--yuanguo); font-size: 14px; cursor: pointer;
}
.sidebar__loading { text-align: center; padding: 20px; color: var(--wenzi-dan); font-size: 14px; }