* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #fff;
    position: relative;
}

.page {
    display: none;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* ========== 欢迎页 ========== */
.welcome-container {
    padding: 60px 30px 40px;
    text-align: center;
}

.logo {
    font-size: 64px;
    margin-bottom: 20px;
}

.title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 40px;
}

.features {
    text-align: left;
    margin-bottom: 30px;
}

.feature {
    display: flex;
    align-items: center;
    padding: 12px 0;
    font-size: 15px;
    color: #444;
}

.feature-icon {
    font-size: 20px;
    margin-right: 12px;
}

.description {
    font-size: 14px;
    color: #888;
    margin-bottom: 40px;
    line-height: 1.8;
}

.primary-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    width: 100%;
    padding: 14px;
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 12px;
}

.secondary-btn:hover {
    background: #f5f5f5;
}

.tip {
    margin-top: 20px;
    font-size: 12px;
    color: #aaa;
}

/* ========== 信息采集页 ========== */
.info-container {
    padding: 40px 30px;
}

.info-container h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #1a1a2e;
}

.info-subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    background: #fafafa;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* ========== 对话页 ========== */
.chat-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 10;
}

.back-btn, .reset-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn:hover, .reset-btn:hover {
    background: #f0f0f0;
}

.chat-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.chat-messages {
    padding: 20px 16px;
    min-height: calc(100vh - 140px);
    overflow-y: auto;
}

.message {
    margin-bottom: 16px;
    display: flex;
}

.message.user {
    justify-content: flex-end;
}

.message.assistant {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.7;
    word-wrap: break-word;
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background: #f0f2f5;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message.assistant .message-bubble h3,
.message.assistant .message-bubble h4 {
    margin: 12px 0 6px;
    font-size: 15px;
    color: #1a1a2e;
}

.message.assistant .message-bubble p {
    margin-bottom: 8px;
}

.message.assistant .message-bubble ul,
.message.assistant .message-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message.assistant .message-bubble li {
    margin-bottom: 4px;
}

.message.assistant .message-bubble strong {
    color: #667eea;
}

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #f0f2f5;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-8px); opacity: 1; }
}

.chat-input-area {
    display: flex;
    align-items: flex-end;
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #eee;
    position: sticky;
    bottom: 0;
}

#chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    background: #fafafa;
}

#chat-input:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
}

.send-btn {
    margin-left: 10px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== 响应式 ========== */
@media (max-width: 375px) {
    .welcome-container {
        padding: 40px 20px 30px;
    }
    
    .title {
        font-size: 24px;
    }
    
    .info-container {
        padding: 30px 20px;
    }
}
