/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 容器布局 */
.container {
    display: flex;
    max-width: 1400px;
    margin: 20px auto;
    height: calc(100vh - 40px);
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* 左侧编辑面板 */
.edit-panel {
    flex: 1;
    padding: 20px;
    border-right: 1px solid #e0e0e0;
    overflow-y: auto;
}

.edit-panel h2 {
    margin-bottom: 20px;
    color: #07c160;
}

.edit-panel h3 {
    margin: 15px 0 10px;
    color: #666;
}

/* 头像设置样式 */
.avatar-upload {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.avatar-item {
    flex: 1;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    margin-top: 10px;
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-preview input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 昵称设置样式 */
.nickname-input {
    margin-bottom: 20px;
}

.nickname-input input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 5px;
}

/* 聊天内容编辑样式 */
.chat-edit-section {
    margin-bottom: 20px;
}

.message-list {
    margin-bottom: 15px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
}

.message-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin-bottom: 8px;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-item:hover {
    background-color: #f5f5f5;
}

.message-content {
    flex: 1;
    margin-right: 10px;
}

.message-content .sender {
    font-weight: bold;
    color: #07c160;
    margin-right: 8px;
}

.message-content .text {
    color: #333;
}

.message-content .time {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
}

.message-item button {
    padding: 4px 8px;
    font-size: 12px;
    background-color: #ff4d4f;
}

.message-item button:hover {
    background-color: #ff7875;
}

.add-message {
    background-color: white;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.add-message textarea {
    width: 100%;
    height: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    margin-bottom: 10px;
    font-size: 14px;
}

.message-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.message-controls select,
.message-controls input[type="datetime-local"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    flex: 1;
    min-width: 120px;
}

/* 导出设置样式 */
.export-controls {
    display: flex;
    gap: 10px;
}

/* 按钮样式 */
button {
    background-color: #07c160;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #06ae56;
}

/* 右侧预览面板 */
.preview-panel {
    flex: 1;
    background-color: #ededed;
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: 450px;
}

/* 状态栏 */
.status-bar {
    height: 44px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 14px;
    color: #000;
}

.status-bar .time {
    font-weight: 600;
}

.status-bar .right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-bar .battery {
    color: #06ae56;
}

/* 微信头部 */
.wechat-header {
    background-color: #ededed;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #d6d6d6;
    height: 44px;
}

.wechat-header .left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wechat-header .back {
    font-size: 18px;
    color: #000;
    display: flex;
    align-items: center;
}

.wechat-header .title {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wechat-header .contact-name {
    font-size: 17px;
    font-weight: 500;
}

.wechat-header .more {
    font-size: 20px;
    color: #000;
}

/* 聊天区域 */
.wechat-chat {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: #ededed;
}

/* 消息时间 */
.message-time {
    text-align: center;
    margin: 8px 0;
    color: #999;
    font-size: 14px;
}

/* 聊天气泡 */
.message {
    display: flex;
    margin-bottom: 16px;
    align-items: flex-start;
}

.message.me {
    flex-direction: row-reverse;
}

.message .avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    margin: 0 12px;
}

.message .content {
    max-width: 60%;
    padding: 10px 16px;
    border-radius: 4px;
    position: relative;
    font-size: 17px;
    line-height: 1.4;
}

.message.other .content {
    background-color: #fff;
    border-top-left-radius: 0;
}

.message.me .content {
    background-color: #95ec69;
    border-top-right-radius: 0;
}

/* 底部输入栏 */
.wechat-footer {
    height: 50px;
    background-color: #f7f7f7;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 8px;
}

.wechat-footer .voice-btn,
.wechat-footer .emoji-btn,
.wechat-footer .more-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7d7d7d;
    font-size: 20px;
}

.wechat-footer .input-area {
    flex: 1;
    background-color: #fff;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 16px;
    min-height: 36px;
    border: 1px solid #ddd;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        margin: 0;
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }

    .edit-panel {
        flex: none;
        height: auto;
        max-height: 50vh;
        padding: 12px;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .edit-panel h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .edit-panel h3 {
        font-size: 16px;
        margin: 10px 0 8px;
    }

    .avatar-upload {
        gap: 12px;
    }

    .avatar-preview {
        width: 60px;
        height: 60px;
    }

    .message-controls {
        flex-wrap: wrap;
    }

    .message-controls select,
    .message-controls input[type="datetime-local"] {
        font-size: 14px;
        padding: 6px 10px;
    }

    .add-message textarea {
        height: 80px;
        font-size: 14px;
    }

    button {
        padding: 6px 12px;
        font-size: 14px;
    }

    .preview-panel {
        flex: 1;
        max-width: none;
        width: 100%;
    }

    /* 优化移动端触摸体验 */
    .message-item {
        padding: 10px;
    }

    .message-item button {
        min-width: 44px;
        min-height: 32px;
    }

    .wechat-footer {
        height: 44px;
    }

    .wechat-footer .voice-btn,
    .wechat-footer .emoji-btn,
    .wechat-footer .more-btn {
        width: 44px;
        height: 44px;
    }

    .wechat-footer .input-area {
        min-height: 32px;
        font-size: 15px;
    }

    /* 添加底部安全区域 */
    .wechat-footer {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    /* 优化滚动体验 */
    .message-list,
    .wechat-chat {
        -webkit-overflow-scrolling: touch;
    }

    /* 优化表单控件 */
    input, select, textarea {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
}

/* 针对更小屏幕的优化 */
@media (max-width: 375px) {
    .edit-panel {
        padding: 8px;
    }

    .message-controls {
        gap: 6px;
    }

    .export-controls {
        flex-direction: column;
        gap: 8px;
    }

    .export-controls select,
    .export-controls button {
        width: 100%;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .container {
        flex-direction: row;
    }

    .edit-panel {
        width: 40%;
        max-height: none;
        border-right: 1px solid #e0e0e0;
        border-bottom: none;
    }

    .preview-panel {
        width: 60%;
    }
} 