/* ============================================
   灵体对话 · AgentWish Apple 风格
   ============================================ */

/* 全局 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
    background: #ffffff;
    color: #1d1d1f;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* 顶部导航 */
.lingtai-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 52px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}
.lingtai-navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #1d1d1f;
    font-weight: 600;
    font-size: 17px;
}
.lingtai-navbar-logo {
    width: 28px;
    height: 28px;
    background: #0071e3;
    border-radius: 6px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}
.lingtai-navbar-home {
    color: #0071e3;
    text-decoration: none;
    font-size: 14px;
}
.lingtai-navbar-home:hover { text-decoration: underline; }

/* 标题区 */
.lingtai-header {
    text-align: center;
    padding: 48px 24px 32px;
}
.lingtai-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.lingtai-header p {
    font-size: 15px;
    color: #6e6e73;
}

/* 圣人选择器 */
.sage-selector {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 0 24px 24px;
    flex-wrap: wrap;
}
.sage-card {
    background: #f5f5f7;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-width: 120px;
    user-select: none;
}
.sage-card:hover {
    background: #ececef;
}
.sage-card.active {
    border-color: #0071e3;
    background: white;
    box-shadow: 0 2px 12px rgba(0,113,227,0.15);
}
.sage-card .sage-name {
    font-size: 16px;
    font-weight: 600;
    color: #1d1d1f;
}
.sage-card .sage-desc {
    font-size: 12px;
    color: #6e6e73;
    margin-top: 4px;
}

/* 快速问题 */
.quick-questions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 24px 16px;
    max-width: 800px;
    margin: 0 auto;
}
.quick-questions-label {
    font-size: 13px;
    color: #6e6e73;
    align-self: center;
}
.quick-btn {
    background: white;
    border: 1px solid #d2d2d7;
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 13px;
    color: #0071e3;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.quick-btn:hover {
    background: #f5f5f7;
    border-color: #0071e3;
}

/* 对话区域 */
.chat-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px 120px;
}
.chat-area { min-height: 200px; }

.message {
    display: flex;
    margin-bottom: 16px;
    gap: 12px;
    animation: lingtaiFadeIn 0.4s ease;
}
.message.user {
    flex-direction: row-reverse;
}
.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}
.message.sage .message-avatar {
    background: #f5f5f7;
    color: #1d1d1f;
}
.message.user .message-avatar {
    background: #0071e3;
    color: white;
}
.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
    word-break: break-word;
}
.message.sage .message-bubble {
    background: #f5f5f7;
    color: #1d1d1f;
    border-bottom-left-radius: 4px;
}
.message.user .message-bubble {
    background: #0071e3;
    color: white;
    border-bottom-right-radius: 4px;
}
.sage-name-tag {
    font-size: 12px;
    font-weight: 600;
    color: #6e6e73;
    margin-bottom: 4px;
}
.bubble-text { white-space: pre-wrap; }

/* 打字指示器 */
.typing-indicator {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 2px 0;
}
.typing-dot {
    width: 7px;
    height: 7px;
    background: #86868b;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
    opacity: 0.5;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-6px); opacity: 1; }
}
@keyframes lingtaiFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 输入区 */
.input-area {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(0,0,0,0.1);
    padding: 12px 24px;
    z-index: 100;
}
.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
}
.input-wrapper textarea {
    flex: 1;
    border: 1px solid #d2d2d7;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    height: 44px;
    max-height: 120px;
    outline: none;
    transition: border-color 0.2s;
    background: white;
    color: #1d1d1f;
    line-height: 1.5;
}
.input-wrapper textarea:focus {
    border-color: #0071e3;
}
.input-wrapper textarea::placeholder {
    color: #86868b;
}
.send-btn {
    background: #0071e3;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
    white-space: nowrap;
}
.send-btn:hover {
    background: #005bb5;
}
.send-btn:disabled {
    background: #d2d2d7;
    cursor: not-allowed;
}

/* 页脚 */
.lingtai-footer {
    text-align: center;
    padding: 24px 0 0;
    color: #86868b;
    font-size: 12px;
    border-top: 1px solid rgba(0,0,0,0.08);
    margin-top: 40px;
}

/* 响应式 */
@media (max-width: 640px) {
    .lingtai-header { padding: 32px 24px 24px; }
    .lingtai-header h1 { font-size: 24px; }
    .sage-card { min-width: 100px; padding: 12px 16px; }
    .sage-card .sage-name { font-size: 14px; }
    .message-bubble { max-width: 80%; }
    .lingtai-navbar { padding: 0 16px; }
    .chat-container { padding: 0 16px 120px; }
    .quick-questions { padding: 0 16px 16px; }
    .input-area { padding: 12px 16px; }
    .send-btn { padding: 0 16px; }
}
