* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* 手机容器 */
.phone-container {
    width: 375px;
    height: 667px;
    background-color: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
}

/* ========== 状态栏 ========== */
.status-bar {
    background-color: #ededed;
    padding: 12px 20px 6px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    border-bottom: 1px solid #e5e5e5;
}

.status-left {
    flex: 1;
}

.status-center {
    flex: 1;
    text-align: center;
    font-weight: normal;
    color: #333;
}

.status-right {
    flex: 1;
    text-align: right;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.signal-icon, .battery-icon {
    font-size: 14px;
    line-height: 1;
}

/* ========== 编辑页面 ========== */
.edit-screen {
    height: 100%;
    overflow-y: auto;
    padding: 10px 15px;
    background-color: #f5f5f5;
    padding-bottom: 80px;
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-settings {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.setting-item {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.setting-item .label {
    width: 75px;
    font-size: 14px;
    color: #666;
}

.avatar-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.avatar-upload {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.avatar-upload .avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.upload-tip {
    font-size: 10px;
    color: #999;
}

.random-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.random-btn:hover {
    background-color: #f0f0f0;
}

.nickname-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.input {
    flex: 1;
    height: 35px;
    background-color: #f5f5f5;
    border-radius: 4px;
    padding: 0 10px;
    font-size: 14px;
    border: 1px solid #eee;
    outline: none;
}

.input:focus {
    border-color: #07c160;
}

/* 头像库管理 */
.avatar-library {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.upload-library-btn {
    background-color: #07c160;
    color: #fff;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 15px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    max-height: 150px;
    overflow-y: auto;
    padding: 5px;
}

.library-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
}

.library-item.selected {
    border-color: #07c160;
}

.library-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.library-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    border: none;
}

.empty-library {
    grid-column: span 4;
    text-align: center;
    color: #999;
    padding: 20px;
    font-size: 14px;
}

/* 状态栏设置 */
.status-settings {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.setting-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.setting-row .label {
    width: 75px;
    font-size: 14px;
    color: #666;
}

.time-input {
    flex: 1;
    height: 35px;
    background-color: #f5f5f5;
    border-radius: 4px;
    padding: 0 10px;
    font-size: 14px;
    border: 1px solid #eee;
    outline: none;
}

.time-input:focus {
    border-color: #07c160;
}

.battery-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.battery-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #f0f0f0;
    border-radius: 2px;
    outline: none;
}

.battery-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #07c160;
    border-radius: 50%;
    cursor: pointer;
}

.battery-value {
    min-width: 45px;
    font-size: 14px;
    color: #333;
}

.signal-options {
    display: flex;
    gap: 15px;
    flex: 1;
}

.signal-options label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.signal-options input[type="radio"] {
    cursor: pointer;
}

.message-editor {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.add-btn {
    background-color: #07c160;
    color: #fff;
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 15px;
    border: none;
    cursor: pointer;
}

.message-list {
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.message-list::-webkit-scrollbar {
    display: none;
}

.message-item {
    background-color: #f8f8f8;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    position: relative;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 12px;
    color: #999;
}

.message-content {
    font-size: 14px;
    color: #333;
}

.message-content.image {
    display: flex;
    justify-content: center;
}

.msg-image {
    max-width: 100%;
    border-radius: 4px;
    display: block;
    cursor: pointer;
}

.video-container {
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    overflow: hidden;
    cursor: pointer;
}

.video-thumb {
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.play-icon {
    position: absolute;
    color: #fff;
    font-size: 30px;
    background-color: rgba(0,0,0,0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-actions {
    position: absolute;
    right: 10px;
    top: 10px;
    display: flex;
    gap: 5px;
}

.action-btn {
    background-color: #ff4d4f;
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 375px;
    margin: 0 auto;
    background-color: #fff;
    padding: 10px 15px;
    display: flex;
    gap: 10px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.preview-btn {
    flex: 1;
    background-color: #07c160;
    color: #fff;
    border-radius: 20px;
    font-size: 14px;
    padding: 10px;
    border: none;
    cursor: pointer;
}

/* ========== 模态框 ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    width: 300px;
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
}

.modal-title {
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
}

.modal-options {
    margin-bottom: 15px;
}

.option {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
    cursor: pointer;
}

.option:active {
    background-color: #f5f5f5;
}

.modal-footer {
    display: flex;
    justify-content: center;
}

.cancel-btn {
    background-color: #f5f5f5;
    color: #666;
    border-radius: 20px;
    width: 100px;
    font-size: 14px;
    padding: 8px;
    border: none;
    cursor: pointer;
}

/* ========== 预览页面 ========== */
.preview-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #ededed;
    overflow: hidden;
}

.chat-header {
    height: 60px;
    background-color: #ededed;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
    flex-shrink: 0;
    box-sizing: border-box;
}

.back-icon {
    width: 30px;
    height: 30px;
    padding: 5px;
    margin-top: 15px;
    cursor: pointer;
    font-size: 24px;
    color: #07c160;
}

.chat-info {
    display: flex;
    align-items: center;
    margin-top: 12px;
}

.chat-info .name {
    font-size: 17px;
    font-weight: 450;
}

.placeholder {
    width: 30px;
    margin-top: 15px;
}

/* 消息区域 */
.message-scroll {
    flex: 1;
    height: 0;
    padding: 5px 10px;
    overflow-y: scroll;
    width: 100%;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.message-scroll::-webkit-scrollbar {
    display: none;
}

.message-list {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.message-wrapper {
    display: flex;
    margin-bottom: 10px;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.message-wrapper.mine {
    justify-content: flex-end;
}

.msg-avatar, .msg-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    flex-shrink: 0;
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.msg-avatar {
    object-fit: cover;
    border-radius: 5px;
}

.message-wrapper.mine .msg-avatar,
.message-wrapper.mine .msg-avatar-placeholder {
    margin-left: 10px;
    order: 2;
}

.message-wrapper.other .msg-avatar,
.message-wrapper.other .msg-avatar-placeholder {
    margin-right: 10px;
    order: 0;
}

.message-content-wrapper {
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 120px);
    flex-shrink: 1;
    min-width: 50px;
}

.message-wrapper.mine .message-content-wrapper {
    align-items: flex-end;
}

.message-wrapper.other .message-content-wrapper {
    align-items: flex-start;
}

.message-bubble {
    max-width: 100%;
}

.bubble-text {
    max-width: 100%;
    background-color: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    word-break: break-all;
}

.message-wrapper.mine .bubble-text {
    background-color: #95ec69;
}

.bubble-image {
    border-radius: 8px;
    overflow: hidden;
    background-color: #f0f0f0;
    position: relative;
}

.bubble-image img {
    display: block;
    width: 100%;
    height: 100%;
}

.bubble-video {
    border-radius: 8px;
    overflow: hidden;
    background-color: #000;
    position: relative;
}

.video-thumb {
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0.9;
}

.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: rgba(0,0,0,0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    z-index: 2;
}

.bubble-image, .bubble-video {
    max-width: 100%;
}

/* 工具类 */
.hidden {
    display: none !important;
}