* {
    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: #f0f2f5;
    color: #333;
    font-size: 14px;
}

/* 顶部蓝色标题栏 */
.top-header {
    background: #409eff;
    color: #fff;
    text-align: center;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

/* 主内容区域 */
.main-content {
    display: flex;
    margin-top: 44px;
    min-height: calc(100vh - 44px);
}

/* 左侧面板 */
.left-panel {
    width: 380px;
    min-width: 380px;
    background: #fff;
    padding: 15px 20px;
    border-right: 1px solid #e8e8e8;
    overflow-y: auto;
    height: calc(100vh - 44px);
}

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 15px;
}

.tab-link {
    padding: 8px 16px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.tab-link:hover {
    color: #409eff;
}

.tab-link.active {
    color: #409eff;
    border-bottom-color: #409eff;
    font-weight: 500;
}

/* 标签内容 */
.tab-content-wrapper {
    position: relative;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 设置项 */
.setting-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    min-height: 32px;
}

.setting-item > label {
    min-width: 80px;
    text-align: left;
    color: #333;
    font-size: 13px;
    white-space: nowrap;
}

/* 表单控件 */
.form-control {
    height: 30px;
    border: 1px solid #dcdfe6;
    border-radius: 3px;
    padding: 0 8px;
    font-size: 13px;
    outline: none;
    background: #fff;
    color: #333;
}

.form-control:focus {
    border-color: #409eff;
}

select.form-control {
    min-width: 60px;
    cursor: pointer;
}

.time-select {
    width: 55px !important;
}

input[type="text"].form-control,
input[type="number"].form-control {
    width: 120px;
}

/* 单选按钮组 */
.radio-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    margin: 0;
    width: 14px;
    height: 14px;
    accent-color: #409eff;
}

/* 电量滑块 */
.battery-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.battery-group input[type="range"] {
    width: 120px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #e4e7ed;
    border-radius: 2px;
    outline: none;
}

.battery-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #409eff;
    cursor: pointer;
}

#batteryValue {
    font-size: 13px;
    color: #666;
    min-width: 35px;
}

/* 聊天背景上传 */
.bg-upload {
    display: flex;
    align-items: center;
}

.a-phone-set-bg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 1px dashed #dcdfe6;
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    color: #c0c4cc;
    font-size: 24px;
    text-decoration: none;
}

.a-phone-set-bg:hover {
    border-color: #409eff;
    color: #409eff;
}

.a-phone-set-bg .plus-icon {
    font-size: 24px;
    line-height: 1;
}

.a-phone-set-bg .img-phone-set-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: none;
}

.a-phone-set-bg input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* 对话设置 - 用户管理 */
.dialog-user {
    margin-bottom: 15px;
}

.dialog-user-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #333;
}

.dialog-user-title span {
    font-size: 11px;
    color: #999;
    font-weight: normal;
}

.dialog-user-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.dialog-user-item {
    position: relative;
    width: 60px;
    text-align: center;
}

.dialog-user-face {
    position: relative;
}

.dialog-user-face-a {
    display: block;
    width: 44px;
    height: 44px;
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto 4px;
    position: relative;
    border: 2px solid transparent;
    cursor: pointer;
}

.dialog-user-item.selected .dialog-user-face-a {
    border-color: #409eff;
}

.dialog-user-face-a i {
    display: block;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
}

.dialog-user-face-a input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dialog-user-face input[type="text"] {
    width: 100%;
    height: 24px;
    border: 1px solid #dcdfe6;
    border-radius: 3px;
    padding: 0 4px;
    font-size: 11px;
    text-align: center;
    outline: none;
}

.dialog-user-select {
    display: none;
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #409eff;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
}

.dialog-user-item.selected .dialog-user-select {
    display: block;
}

.dialog-user-delete {
    display: none;
    position: absolute;
    top: -5px;
    right: -5px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f56c6c;
    color: #fff;
    font-size: 10px;
    line-height: 14px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
}

.dialog-user-item:hover .dialog-user-delete {
    display: block;
}

/* 对话设置 - 消息 */
.dialog-message {
    padding: 5px 0;
}

.dialog-message .setting-item > label {
    min-width: 100px;
}

.dialog-message textarea {
    width: 100%;
    height: 60px;
    border: 1px solid #dcdfe6;
    border-radius: 3px;
    padding: 6px 8px;
    font-size: 13px;
    outline: none;
    resize: vertical;
}

.dialog-message textarea:focus {
    border-color: #409eff;
}

.date-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.date-group .form-control {
    min-width: 55px;
}

.inline-label {
    margin-left: 10px;
    font-size: 13px;
    color: #333;
}

/* 按钮组 */
.dialog-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.dialog-btn-group .btn {
    padding: 6px 12px;
    border: none;
    border-radius: 3px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.dialog-btn-group .btn:hover {
    opacity: 0.85;
}

.dialog-btn-group .btn-success {
    background: #67c23a;
}

.dialog-btn-group .btn-primary {
    background: #409eff;
}

.dialog-btn-group .btn-danger {
    background: #f56c6c;
}

/* 右侧预览区域 */
.right-panel {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 30px;
    background: #f0f2f5;
}

/* 手机框架 */
.phone-frame {
    width: 375px;
    height: 667px;
    background: #ededed;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

/* 状态栏 */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 14px 4px;
    background: #ededed;
    font-size: 14px;
    font-weight: 600;
    height: 40px;
}

.status-bar .time {
    font-size: 14px;
    font-weight: 600;
    color: #000;
}

.status-icons {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* 信号图标 */
.signal-icon {
    display: inline-block;
    width: 17px;
    height: 12px;
    background-image: url('../images/phone-signal.svg');
    background-repeat: no-repeat;
    background-size: 68px 12px;
}

.signal-icon.phone-sigle-v1 { background-position: 0 0; }
.signal-icon.phone-sigle-v2 { background-position: -17px 0; }
.signal-icon.phone-sigle-v3 { background-position: -34px 0; }
.signal-icon.phone-sigle-v4 { background-position: -51px 0; }

/* wifi信号图标 */
.wifi-icon {
    display: inline-block;
    width: 16px;
    height: 12px;
    background-image: url('../images/phone-wifi.svg');
    background-repeat: no-repeat;
    background-size: 48px 12px;
}

.wifi-icon.phone-wifi-s1 { background-position: 0 0; }
.wifi-icon.phone-wifi-s2 { background-position: -16px 0; }
.wifi-icon.phone-wifi-s3 { background-position: -32px 0; }

/* 电量图标 */
.battery-icon {
    display: inline-block;
    width: 25px;
    height: 12px;
    background-image: url('../images/phone-battery.svg');
    background-repeat: no-repeat;
    background-size: 275px 12px;
}

/* 充电状态 */
.battery-icon.phone-battery-charge {
    background-image: url('../images/phone-battery-charge.svg');
}

/* 聊天头部 */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #ededed;
    height: 44px;
}

.chat-header .back-btn {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.chat-header .back-btn img {
    width: 24px;
    height: 24px;
}

.chat-header .msg-count {
    font-size: 14px;
    color: #999;
    margin-left: 4px;
}

.chat-header .chat-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #000;
}

.chat-header .more-btn {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.chat-header .more-btn img {
    width: 24px;
    height: 24px;
}

/* 聊天内容区域 */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    background: #ededed;
}

.chat-body::-webkit-scrollbar {
    width: 4px;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #c0c4cc;
    border-radius: 2px;
}

/* 消息项 */
.message-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 8px;
}

.message-item.left {
    flex-direction: row;
}

.message-item.right {
    flex-direction: row-reverse;
}

.message-item .avatar {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.message-item .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-bubble {
    max-width: 65%;
    padding: 9px 12px;
    border-radius: 4px;
    position: relative;
    font-size: 15px;
    line-height: 1.4;
    word-break: break-all;
}

.message-item.left .message-bubble {
    background: #fff;
    color: #333;
}

.message-item.right .message-bubble {
    background: #95ec69;
    color: #333;
}

/* 时间标签 */
.message-item.time-label {
    justify-content: center;
}

.message-item.time-label .message-bubble {
    background: #dadada;
    color: #fff;
    font-size: 12px;
    padding: 3px 6px;
    border-radius: 3px;
    max-width: auto;
}

/* 图片消息 */
.image-msg img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 4px;
    display: block;
}

/* 语音消息 */
.voice {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 60px;
}

.voice-icon {
    width: 16px;
    height: 16px;
}

.voice-icon img {
    width: 100%;
    height: 100%;
}

.voice .duration {
    font-size: 13px;
}

/* 红包消息 */
.redpacket {
    background: #fa9d3b;
    border-radius: 6px;
    padding: 12px;
    min-width: 200px;
    color: #fff;
}

.redpacket .rp-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    margin-bottom: 8px;
}

.redpacket .rp-icon {
    width: 24px;
    height: 24px;
}

.redpacket .rp-icon img {
    width: 100%;
    height: 100%;
}

.redpacket .rp-label {
    font-size: 10px;
    opacity: 0.8;
}

/* 转账消息 */
.transfer {
    background: #fff;
    border-radius: 6px;
    padding: 12px;
    min-width: 200px;
    border: 1px solid #e8e8e8;
}

.transfer .tf-amount {
    font-size: 18px;
    color: #333;
    margin-bottom: 4px;
}

.transfer .tf-label {
    font-size: 11px;
    color: #999;
}

/* 聊天底部 */
.chat-footer {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    background: #f7f7f7;
    border-top: 1px solid #e8e8e8;
    gap: 8px;
    height: 48px;
}

.chat-footer .voice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.chat-footer .voice-btn img {
    width: 24px;
    height: 24px;
}

.chat-footer .input-bar {
    flex: 1;
    height: 32px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e8e8e8;
}

.chat-footer .emoji-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.chat-footer .emoji-btn img {
    width: 24px;
    height: 24px;
}

.chat-footer .plus-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.chat-footer .plus-btn img {
    width: 24px;
    height: 24px;
}

/* Home指示器 */
.home-indicator {
    height: 18px;
    background: #f7f7f7;
    display: flex;
    justify-content: center;
    align-items: center;
}

.home-indicator::before {
    content: '';
    width: 100px;
    height: 3px;
    background: #333;
    border-radius: 2px;
}
