/* ============================================
   安羽莱AI小鸟问诊 - 白色清新主题
   大草原背景 + 毛玻璃效果
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #2ecc71;
    --primary-glow: rgba(46, 204, 113, 0.4);
    --primary-dark: #27ae60;
    --neon-pink: #e74c3c;
    --neon-blue: #3498db;
    --neon-purple: #9b59b6;
    --neon-yellow: #f1c40f;
    --neon-orange: #e67e22;
    --brand-gold: #d4a017;
    --brand-warm: #c8952e;
    --bg: #ffffff;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-glass: rgba(255, 255, 255, 0.72);
    --text: #1a1a2e;
    --text-secondary: #555570;
    --text-muted: #8888aa;
    --border: rgba(0, 0, 0, 0.08);
    --border-glow: rgba(46, 204, 113, 0.2);
    --shadow-neon: 0 4px 24px rgba(46, 204, 113, 0.12);
    --shadow-pink: 0 4px 24px rgba(231, 76, 60, 0.12);
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --sidebar-width: 300px;
    --header-height: 60px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { font-size: 16px; }

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    cursor: default;
}

/* ---------- 大草原动画背景 ---------- */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -3;
}

/* 草原画布 */
#grassCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -2;
    pointer-events: none;
}

#app {
    display: flex;
    height: 100%;
    height: 100dvh;
    position: relative;
    z-index: 1;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(46, 204, 113, 0.4); }

/* ============================================
   侧边栏
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    transition: transform var(--transition);
    z-index: 100;
    position: relative;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--neon-blue), var(--brand-gold), var(--primary-dark));
    background-size: 300% 100%;
    animation: gradientSlide 4s linear infinite;
}

@keyframes gradientSlide {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.sidebar-header {
    padding: 20px 16px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

@keyframes brandPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px var(--primary-glow)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 16px var(--primary)); }
}

.sidebar-brand h2 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    text-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.btn-new {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    box-shadow: 0 0 10px var(--primary-glow);
    position: relative;
    overflow: hidden;
}

.btn-new::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary);
    opacity: 0;
    transition: opacity var(--transition);
}

.btn-new:hover {
    color: white;
    box-shadow: 0 0 20px var(--primary), 0 0 40px var(--primary-glow);
    transform: scale(1.1) rotate(90deg);
}

.btn-new:hover::before { opacity: 1; }
.btn-new svg { position: relative; z-index: 1; }

/* History list */
.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.empty-history {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
    animation: emptyFloat 3s ease-in-out infinite;
}

@keyframes emptyFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.empty-history p { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.empty-history span { font-size: 12px; }

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-bottom: 2px;
    transition: all var(--transition);
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid transparent;
    background: none;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.history-item:hover {
    background: rgba(46, 204, 113, 0.06);
    border-color: rgba(46, 204, 113, 0.12);
    color: var(--text);
}

.history-item.active {
    background: rgba(46, 204, 113, 0.1);
    border-color: rgba(46, 204, 113, 0.25);
    color: var(--primary-dark);
    box-shadow: inset 0 0 20px rgba(46, 204, 113, 0.03);
}

.history-item .conv-icon { flex-shrink: 0; font-size: 16px; }
.history-item .conv-title { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.history-item .conv-delete {
    opacity: 0;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid rgba(255, 45, 149, 0.3);
    background: transparent;
    color: var(--neon-pink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all var(--transition);
}

.history-item:hover .conv-delete { opacity: 1; }
.history-item .conv-delete:hover {
    background: rgba(231, 76, 60, 0.15);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.2);
}

.history-item .conv-time {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ---------- 侧边栏信息板块 ---------- */
.sidebar-info {
    border-top: 1px solid var(--border);
    padding: 8px;
}

.info-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
}

.info-toggle:hover {
    background: rgba(46, 204, 113, 0.06);
    color: var(--text);
}

.info-toggle .info-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.info-toggle .info-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform var(--transition);
    color: var(--text-muted);
}

.info-toggle.open .info-arrow {
    transform: rotate(180deg);
}

.info-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 12px;
}

.info-panel.open {
    max-height: 400px;
    padding: 8px 12px 12px;
}

.info-panel p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 6px;
}

.info-panel .info-label {
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 12px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.info-panel .info-value {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.info-panel .info-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--neon-blue);
    text-decoration: none;
    font-size: 12px;
    transition: color var(--transition);
}

.info-panel .info-link:hover {
    color: var(--primary);
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.btn-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-clear:hover {
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    background: rgba(231, 76, 60, 0.08);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.1);
}

/* ============================================
   主内容区
   ============================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: transparent;
    position: relative;
}

/* 背景光晕（白色主题减弱版） */
.main-content::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 15% 10%, rgba(46, 204, 113, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 90%, rgba(155, 89, 182, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(52, 152, 219, 0.02) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ---------- Header ---------- */
.main-header {
    height: var(--header-height);
    padding: 0 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-glow), transparent);
}

.header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 6px;
}

@keyframes headerBirdFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-4px) rotate(5deg); }
    75% { transform: translateY(2px) rotate(-3deg); }
}

.main-header h1 {
    font-size: 17px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand-gold), var(--primary), var(--neon-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
    text-shadow: none;
}

.subtitle {
    font-size: 12px;
    color: var(--brand-gold);
    background: rgba(212, 160, 23, 0.08);
    border: 1px solid rgba(212, 160, 23, 0.15);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 500;
    letter-spacing: 1px;
}

.header-decoration {
    margin-left: auto;
    display: flex;
    gap: 6px;
    opacity: 0.4;
}

.deco-bird {
    font-size: 18px;
    animation: float 4s ease-in-out infinite;
}

.deco-bird-2 { animation-delay: -2s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-4px) rotate(3deg); }
    75% { transform: translateY(2px) rotate(-2deg); }
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: background var(--transition);
}

.menu-toggle:hover { background: rgba(255,255,255,0.05); }

/* ============================================
   聊天区域
   ============================================ */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    scroll-behavior: smooth;
    position: relative;
    z-index: 1;
}

.messages {
    max-width: 780px;
    margin: 0 auto;
}

/* ---------- 欢迎页 ---------- */
.welcome-message {
    text-align: center;
    padding: 40px 16px 20px;
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-visual {
    position: relative;
    display: inline-block;
    margin-bottom: 24px;
    width: 100px;
    height: 100px;
}

.welcome-ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--primary);
    border-right-color: var(--neon-blue);
    animation: spin 2s linear infinite;
    position: absolute;
    top: 0; left: 0;
    box-shadow: 0 0 15px var(--primary-glow), inset 0 0 15px rgba(46, 204, 113, 0.05);
}

.welcome-ring.ring-2 {
    width: 80px;
    height: 80px;
    top: 10px; left: 10px;
    border-top-color: var(--neon-pink);
    border-right-color: var(--neon-purple);
    animation: spin 3s linear infinite reverse;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.15), inset 0 0 10px rgba(231, 76, 60, 0.05);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.welcome-icon {
    font-size: 42px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 0 12px rgba(255,255,255,0.2));
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.08); }
}

.welcome-message h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
    background: linear-gradient(135deg, var(--brand-gold), var(--primary), var(--neon-blue), var(--neon-purple));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: textGradient 4s ease infinite;
    letter-spacing: 2px;
    color: var(--text);
}

@keyframes textGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.welcome-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.welcome-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: var(--brand-gold);
    margin-bottom: 8px;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(212, 160, 23, 0.2);
}

.welcome-features {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-full);
    transition: all var(--transition);
}

.feature-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
    transform: translateY(-2px);
    background: rgba(46, 204, 113, 0.06);
}

.feature-item span { font-size: 16px; }

.section-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
    font-weight: 500;
}

/* Quick prompts */
.quick-prompts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
    max-width: 740px;
    margin: 0 auto;
}

.quick-prompt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.quick-prompt::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.08), rgba(52, 152, 219, 0.06));
    opacity: 0;
    transition: opacity 0.3s;
}

.quick-prompt:hover {
    border-color: var(--primary);
    color: var(--text);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 20px var(--primary-glow), 0 8px 25px rgba(0,0,0,0.08);
    background: var(--bg-glass);
}

.quick-prompt:hover::before { opacity: 1; }

.qp-icon {
    font-size: 20px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.quick-prompt span:last-child {
    position: relative;
    z-index: 1;
}

/* ====== 双对话框面板 ====== */
.dual-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    max-width: 740px;
    margin: 24px auto 0;
}

.qa-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
}

.qa-panel:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px var(--primary-glow);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.08), rgba(52, 152, 219, 0.06));
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.panel-icon {
    font-size: 18px;
}

.panel-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.panel-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    text-align: left;
    font-family: inherit;
}

.panel-item:hover {
    background: rgba(46, 204, 113, 0.08);
    color: var(--primary-dark);
    transform: translateX(4px);
}

.panel-item:active {
    transform: scale(0.98);
}

/* ---------- 消息气泡 ---------- */
.message {
    margin-bottom: 20px;
    animation: msgIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes msgIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.message.user { display: flex; justify-content: flex-end; }
.message.ai { display: flex; justify-content: flex-start; }

.message-wrapper {
    max-width: 82%;
    display: flex;
    flex-direction: column;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    padding: 0 4px;
}

.message.user .message-header { justify-content: flex-end; }

.msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message.user .msg-avatar {
    background: linear-gradient(135deg, var(--neon-blue), #0088ff);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.message.ai .msg-avatar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 0 10px var(--primary-glow);
}

.msg-name { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.msg-time { font-size: 11px; color: var(--text-muted); }

.message-bubble {
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    line-height: 1.75;
    word-break: break-word;
    position: relative;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.12), rgba(41, 128, 185, 0.08));
    border: 1px solid rgba(52, 152, 219, 0.2);
    color: var(--text);
    border-bottom-right-radius: 6px;
    box-shadow: 0 2px 12px rgba(52, 152, 219, 0.06);
}

.message.ai .message-bubble {
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-bottom-left-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    color: var(--text);
}

/* AI 消息中的标题/列表样式 */
.message.ai .message-bubble h3,
.message.ai .message-bubble h4 {
    margin: 8px 0 4px;
    font-size: 14px;
    color: var(--primary-dark);
}

.message.ai .message-bubble ul,
.message.ai .message-bubble ol {
    padding-left: 18px;
    margin: 4px 0;
}

.message.ai .message-bubble li { margin: 2px 0; }

/* 媒体 */
.message-media {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.message-media img,
.message-media video {
    max-width: 240px;
    max-height: 180px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid var(--border);
}

.message-media img:hover,
.message-media video:hover {
    transform: scale(1.03);
    box-shadow: 0 0 20px var(--primary-glow);
}

/* ---------- 打字指示器 ---------- */
.typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
}

.typing-indicator { display: inline-flex; gap: 5px; }

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s ease-in-out infinite;
    box-shadow: 0 0 8px var(--primary-glow);
}

.typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing {
    0%, 60%, 100% { transform: scale(0.6); opacity: 0.3; box-shadow: none; }
    30% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px var(--primary); }
}

.typing-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 4px;
}

/* ============================================
   输入区域
   ============================================ */
.input-area {
    padding: 0 20px 16px;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.input-wrapper { max-width: 780px; margin: 0 auto; }

/* 症状标签 */
.symptom-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    padding: 0 4px;
}

.symptom-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    backdrop-filter: blur(8px);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.symptom-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(46, 204, 113, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 0 12px var(--primary-glow);
}

/* 媒体预览 */
.media-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    padding: 12px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border: 1px dashed rgba(255,255,255,0.1);
    border-radius: var(--radius);
    animation: fadeUp 0.3s ease;
}

.media-preview-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}

.media-preview-item img,
.media-preview-item video {
    width: 110px;
    height: 82px;
    object-fit: cover;
    display: block;
}

.media-preview-item .media-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2px 6px;
    background: rgba(0,0,0,0.7);
    color: white;
    font-size: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-preview-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    color: white;
    border: 1px solid rgba(255, 45, 149, 0.3);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    backdrop-filter: blur(4px);
}

.media-preview-item .remove-btn:hover {
    background: var(--neon-pink);
    border-color: var(--neon-pink);
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.4);
}

/* 输入框 */
.input-box {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px 10px 8px 6px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow), 0 0 60px rgba(46, 204, 113, 0.05);
}

.input-actions { display: flex; gap: 2px; flex-shrink: 0; }

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all var(--transition);
}

.action-btn:hover {
    background: rgba(46, 204, 113, 0.08);
    color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.input-box textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 14px;
    line-height: 1.6;
    background: transparent;
    font-family: inherit;
    max-height: 120px;
    color: var(--text);
    padding: 6px 4px;
    cursor: text;
}

.input-box textarea::placeholder { color: var(--text-muted); }

.btn-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0,0,0,0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    flex-shrink: 0;
}

.btn-send:not(:disabled) {
    background: linear-gradient(135deg, var(--primary), var(--neon-blue));
    border-color: transparent;
    color: white;
    box-shadow: 0 0 15px var(--primary-glow), 0 0 30px rgba(46, 204, 113, 0.1);
}

.btn-send:not(:disabled):hover {
    transform: scale(1.15);
    box-shadow: 0 0 25px var(--primary), 0 0 50px var(--primary-glow);
}

.btn-send:disabled { cursor: not-allowed; }

.btn-send.sending {
    animation: sendPulse 0.6s ease-in-out;
}

@keyframes sendPulse {
    0% { transform: scale(1); }
    30% { transform: scale(0.8); }
    60% { transform: scale(1.3); box-shadow: 0 0 40px var(--primary), 0 0 80px var(--primary-glow); }
    100% { transform: scale(1); }
}

.input-hint {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ============================================
   遮罩
   ============================================ */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 90;
    animation: fadeIn 0.2s ease;
}

.overlay.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hidden { display: none !important; }

/* ============================================
   图片放大模态框
   ============================================ */
.media-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: fadeIn 0.2s ease;
    cursor: zoom-out;
}

.media-modal img,
.media-modal video {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: var(--radius);
    box-shadow: 0 0 40px rgba(0,0,0,0.15);
    border: 1px solid var(--border);
}

.media-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.media-modal-close:hover {
    background: var(--neon-pink);
    border-color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 45, 149, 0.4);
}

/* ============================================
   全屏震动效果
   ============================================ */
.app-shake {
    animation: appShake 0.5s ease-in-out;
}

@keyframes appShake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    5% { transform: translate(-4px, -2px) rotate(-0.5deg); }
    10% { transform: translate(4px, 2px) rotate(0.5deg); }
    15% { transform: translate(-3px, 1px) rotate(-0.3deg); }
    20% { transform: translate(3px, -1px) rotate(0.3deg); }
    25% { transform: translate(-2px, 1px) rotate(-0.2deg); }
    30% { transform: translate(2px, -1px) rotate(0.2deg); }
    35% { transform: translate(-1px, 0) rotate(0deg); }
    40% { transform: translate(1px, 0) rotate(0deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

/* ============================================
   霓虹闪烁标题（欢迎页彩蛋）
   ============================================ */
.welcome-message h2:hover {
    animation: neonFlicker 0.15s ease-in-out 3;
}

@keyframes neonFlicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0; top: 0; bottom: 0;
        transform: translateX(-100%);
        box-shadow: 5px 0 30px rgba(0,0,0,0.15);
    }

    .sidebar.open { transform: translateX(0); }

    .menu-toggle { display: flex; }

    .subtitle,
    .header-decoration { display: none; }

    .chat-container { padding: 16px 12px; }
    .message-wrapper { max-width: 90%; }
    .input-area { padding: 0 8px 8px; }
    .symptom-tags { gap: 4px; }

    .symptom-tag {
        padding: 6px 12px;
        font-size: 12px;
        min-height: 32px;
        -webkit-tap-highlight-color: transparent;
    }

    .welcome-message { padding: 24px 8px 16px; }
    .welcome-icon { font-size: 36px; }
    .welcome-message h2 { font-size: 20px; }
    .welcome-subtitle { font-size: 12px; letter-spacing: 1px; }
    .welcome-features { gap: 10px; }

    .feature-item {
        font-size: 12px;
        padding: 6px 12px;
    }

    .quick-prompts {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .quick-prompt {
        padding: 12px 12px;
        font-size: 12px;
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
    }

    /* 双面板移动端 */
    .dual-panels {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .panel-item {
        min-height: 40px;
        -webkit-tap-highlight-color: transparent;
    }

    body { cursor: auto; }
    .input-box textarea { cursor: auto; }

    /* 移动端输入框优化 */
    .input-box {
        padding: 6px 8px 6px 4px;
    }

    .input-box textarea {
        font-size: 16px; /* 防止iOS缩放 */
        padding: 8px 4px;
    }

    .action-btn {
        width: 40px;
        height: 40px;
        min-width: 40px;
        -webkit-tap-highlight-color: transparent;
    }

    .btn-send {
        width: 42px;
        height: 42px;
        min-width: 42px;
        -webkit-tap-highlight-color: transparent;
    }

    /* 触摸反馈 */
    .quick-prompt:active,
    .symptom-tag:active,
    .action-btn:active,
    .btn-send:active {
        transform: scale(0.95);
        opacity: 0.8;
    }

    /* 输入区域固定在底部，不随键盘弹出而变形 */
    .input-area {
        position: sticky;
        bottom: 0;
        background: rgba(255,255,255,0.6);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    .input-wrapper {
        background: transparent;
    }

    /* 症状标签可横向滚动 */
    .symptom-tags {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .symptom-tags::-webkit-scrollbar { display: none; }

    .symptom-tag {
        flex-shrink: 0;
    }

    /* 历史列表项点击区域 */
    .history-item {
        min-height: 44px;
        -webkit-tap-highlight-color: transparent;
    }

    .history-item .conv-delete {
        opacity: 1;
        width: 28px;
        height: 28px;
    }

    /* 消息气泡 */
    .message-bubble {
        font-size: 14px;
        padding: 12px 14px;
    }

    .message-media img,
    .message-media video {
        max-width: 180px;
        max-height: 140px;
    }

    /* 信息面板移动端 */
    .info-toggle {
        min-height: 40px;
        -webkit-tap-highlight-color: transparent;
    }
}

@media (max-width: 480px) {
    :root { --header-height: 52px; }

    .main-header h1 { font-size: 15px; }

    .quick-prompts {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }

    .quick-prompt {
        padding: 8px 10px;
        font-size: 11px;
        gap: 4px;
    }

    .qp-icon { font-size: 16px; }

    .welcome-features {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .welcome-subtitle { font-size: 11px; }

    .msg-avatar { width: 24px; height: 24px; font-size: 12px; }
    .message-bubble { font-size: 13px; padding: 10px 14px; }

    .media-preview-item img,
    .media-preview-item video {
        width: 90px;
        height: 68px;
    }
}

/* ---------- Toast ---------- */
.toast-msg {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

/* ============================================
   飞翔鹦鹉（已禁用）
   ============================================ */
.flying-parrot {
    display: none;
}

.parrot-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.parrot-emoji {
    font-size: 36px;
    display: block;
    animation: parrotGlow 2s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

@keyframes parrotGlow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(255, 200, 0, 0.5)) brightness(1);
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 18px rgba(255, 200, 0, 0.9)) drop-shadow(0 0 30px rgba(0, 255, 136, 0.5)) brightness(1.15);
        transform: scale(1.08);
    }
}

.parrot-wings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 40px;
    z-index: 1;
}

.wing {
    position: absolute;
    font-size: 18px;
    opacity: 0.7;
    filter: drop-shadow(0 0 4px rgba(0, 255, 136, 0.4));
}

.wing-left {
    left: -8px;
    top: 2px;
    transform-origin: right center;
    animation: wingFlapLeft 0.3s ease-in-out infinite;
}

.wing-right {
    right: -8px;
    top: 2px;
    transform-origin: left center;
    animation: wingFlapRight 0.3s ease-in-out infinite;
}

@keyframes wingFlapLeft {
    0%, 100% { transform: rotate(0deg) scaleX(-1); }
    50% { transform: rotate(-35deg) scaleX(-1); }
}

@keyframes wingFlapRight {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(35deg); }
}

/* 静止状态：翅膀慢速扇动 */
.flying-parrot.idle .wing-left {
    animation: wingIdleLeft 1.2s ease-in-out infinite;
}
.flying-parrot.idle .wing-right {
    animation: wingIdleRight 1.2s ease-in-out infinite;
}

@keyframes wingIdleLeft {
    0%, 100% { transform: rotate(0deg) scaleX(-1); }
    50% { transform: rotate(-10deg) scaleX(-1); }
}
@keyframes wingIdleRight {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(10deg); }
}

/* 到达目标后的摇摆 */
.flying-parrot.arrived .parrot-emoji {
    animation: parrotSway 0.8s ease-in-out 2;
}

@keyframes parrotSway {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(8deg) scale(1.05); }
    75% { transform: rotate(-8deg) scale(1.05); }
}

/* 飞行粒子尾巴 */
.parrot-trail {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    pointer-events: none;
}

/* 鹦鹉点击互动区域（桌面端） */
.flying-parrot.interactive {
    pointer-events: auto;
    cursor: pointer;
}

.flying-parrot.interactive:hover .parrot-emoji {
    animation: parrotBounce 0.4s ease-in-out;
}

@keyframes parrotBounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.3) rotate(-10deg); }
    60% { transform: scale(1.15) rotate(5deg); }
}

/* 粒子特效 */
.parrot-sparkle {
    position: fixed;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9997;
    animation: sparkleOut 0.6s ease-out forwards;
}

@keyframes sparkleOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0) translate(var(--dx), var(--dy));
    }
}

/* ---------- 减弱动画（无障碍） ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    .flying-parrot { display: none; }
}
