* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    background: #f2f3fa;
    color: #5d6675;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.app-container {
    display: flex;
    max-width: 1400px;
    width: 100%;
    height: 90vh;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(108, 115, 153, 0.15);
    overflow: hidden;
}

/* 左侧侧边栏 */
.sidebar {
    width: 418px;
    background-color: white;
    border-right: 1px solid #e6e9ed;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 24px 15px 24px 25px;
}

.sidebar-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f2f3fa;
    padding-left: 10px;
}

.sidebar-title {
    font-size: 24px;
    font-weight: 600;
    color: #6c7399;
    margin-bottom: 4px;
}

.sidebar-subtitle {
    font-size: 14px;
    color: #a6aac3;
}

.category-list {
    margin-bottom: 24px;
    padding-left: 10px;
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    color: #6c7399;
    margin-bottom: 12px;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-left: 10px;
}

.tag {
    padding: 8px 14px;
    background: #f2f3fa;
    border-radius: 20px;
    font-size: 14px;
    color: #6c7399;
    cursor: pointer;
    transition: all 0.3s;
}

.tag:hover, .tag.active {
    background: #e4e6fd;
    color: #6c7399;
    font-weight: 500;
}

.topics-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    padding-left: 8px;
}

.topics-title {
    font-size: 16px;
    font-weight: 600;
    color: #6c7399;
    margin-bottom: 16px;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.topic-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 10px 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid #e6e9ed;
    text-align: center;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.topic-item:hover {
    background: #f2f3fa;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(108, 115, 153, 0.1);
}

.topic-item.active {
    background: #e4e6fd;
    border-left: 4px solid #6c7399;
    font-weight: 500;
}

/* 右侧短信界面 */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    position: relative;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e6e9ed;
    display: flex;
    align-items: center;
    gap: 16px;
    background: white;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(108, 115, 153, 0.1);
}

.chat-info {
    flex: 1;
}

.chat-name {
    font-size: 20px;
    font-weight: 600;
    color: #5d6675;
    margin-bottom: 4px;
}

.chat-status {
    font-size: 14px;
    color: #a6aac3;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2ecc71;
}

.messages-container {
    flex: 1;
    padding: 50px 24px 20px;
    overflow-y: auto;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="rgba(255,255,255,0.9)"/><path d="M0 50 L100 50" stroke="rgba(242,243,250,0.8)" stroke-width="1"/><path d="M0 25 L100 25 M0 75 L100 75" stroke="rgba(242,243,250,0.6)" stroke-width="1"/></svg>');
    background-size: 100px 100px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    max-width: 70%;
    padding: 14px 18px;
    border-radius: 18px;
    position: relative;
    animation: fadeIn 0.3s ease-out;
    line-height: 1.5;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(108, 115, 153, 0.1);
}

.other {
    align-self: flex-start;
    background: #f2f3fa;
    border-bottom-left-radius: 5px;
    color: #5d6675;
}

.me {
    align-self: flex-end;
    background: #e4e6fd;
    border-bottom-right-radius: 5px;
    color: #5d6675;
}

.message-time {
    font-size: 12px;
    color: #a6aac3;
    margin-top: 8px;
    text-align: right;
}

/* 顶部输入指示器 */
.typing-top-indicator {
    display: none;
    background: #f2f3fa;
    padding: 8px 16px;
    border-radius: 0 0 20px 20px;
    font-size: 13px;
    color: #a6aac3;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    animation: slideDown 0.4s ease-out;
    box-shadow: 0 4px 8px rgba(108, 115, 153, 0.1);
}

@keyframes slideDown {
    from { top: -30px; opacity: 0; }
    to { top: 0; opacity: 1; }
}

.typing-dots {
    display: inline-block;
}

.typing-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a6aac3;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.options-container {
    background: white;
    padding: 25px 24px 20px;
    border-top: 1px solid #e6e9ed;
    margin-top: 10px;
}

.options-title {
    font-size: 14px;
    color: #6c7399;
    margin-bottom: 15px;
    font-weight: 600;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-btn {
    background: #f8f9fa;
    border: 1px solid #e6e9ed;
    color: #5d6675;
    padding: 14px 20px;
    border-radius: 12px;
    text-align: left;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-btn:hover {
    background: #f2f3fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(108, 115, 153, 0.1);
}

.option-btn:active {
    transform: translateY(1px);
}

.option-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #6c7399;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-3px); }
}

@keyframes bubbleAppear {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.message-animation {
    animation: bubbleAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 滚动条样式 - 调整位置和样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
    margin-left: 8px;
    margin-right: 8px;
}

::-webkit-scrollbar-thumb {
    background: #d1d4dc;
    border-radius: 4px;
    border: 2px solid #f8f9fa;
}

::-webkit-scrollbar-thumb:hover {
    background: #a6aac3;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .topics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #e6e9ed;
        padding: 20px;
    }
    
    .topics-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .chat-container {
        width: 100%;
    }
    
    /* 移动端调整顶部指示器 */
    .typing-top-indicator {
        left: 50%;
        transform: translateX(-50%);
        width: 180px;
    }
}

@media (max-width: 600px) {
    .topics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .typing-top-indicator {
        width: 160px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

@media (max-width: 400px) {
    .topics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .typing-top-indicator {
        width: 140px;
    }
}