/* ==========================================
   短信 (Message) APP 专属样式
   所有类名均带有 message- 前缀以隔离作用域
========================================== */

.message-app-container {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    color: #000000;
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 核心：iOS 清透毛玻璃效果 */
.message-glass-effect {
    background-color: rgba(255, 255, 255, 0.75); 
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 0.5px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

/* 顶部悬浮操作区 */
.message-top-actions {
    position: absolute;
    top: 54px; /* 适配刘海屏，避开状态栏 */
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    z-index: 20;
    pointer-events: none;
}

.message-top-actions > * {
    pointer-events: auto;
}

.message-capsule-btn {
    height: 35px; 
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-size: 19px; 
    font-weight: 500;
    color: #000;
    cursor: pointer;
    outline: none;
    transition: color 0.2s;
}

.message-circle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    outline: none;
}

/* --- 新版 iOS 风格下拉菜单 --- */
.message-ios-menu {
    position: absolute;
    top: 100px; 
    right: 20px;
    width: 210px; 
    background-color: rgba(250, 250, 250, 0.85);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-radius: 22px; 
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transform-origin: top right;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 0;
    overflow: hidden; 
}

.message-ios-menu.show {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.message-ios-menu-item {
    padding: 11px 16px;
    display: flex;
    align-items: center;
    font-size: 16px;
    color: #000;
    cursor: pointer;
    gap: 12px;
}

.message-ios-menu-item:first-child {
    padding-top: 14px;
}
.message-ios-menu-item:last-child {
    padding-bottom: 14px;
}

.message-ios-menu-item:active {
    background-color: rgba(0, 0, 0, 0.08);
}

.message-ios-menu-item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.message-ios-menu-item .message-check-icon {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #000;
    stroke-width: 2.5;
}

.message-check-placeholder {
    width: 14px;
    flex-shrink: 0;
}

.message-ios-menu-divider {
    height: 0.5px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 2px 0 2px 54px; 
}

.message-ios-menu-header {
    font-size: 12px;
    color: #8e8e93;
    padding: 6px 16px 6px 54px;
}

/* 消息列表区域 */
.message-list {
    flex: 1;
    overflow-y: auto;
    padding-top: 110px; 
    padding-bottom: 100px; 
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.message-list::-webkit-scrollbar {
    display: none;
}

.message-title {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding: 0 20px;
}

.message-item {
    display: flex;
    align-items: center;
    padding: 0 20px;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.3s, height 0.3s, padding 0.3s;
}

.message-item:active {
    background-color: #f9f9f9;
}

/* --- 编辑模式：多选圆圈 --- */
.message-select-wrapper {
    width: 0;
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    align-items: center;
}

.message-select-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid #c7c7cc;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.message-select-circle svg {
    width: 12px;
    height: 12px;
    stroke: #fff;
    stroke-width: 3;
    fill: none;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

/* 选中状态 */
.message-item.selected .message-select-circle {
    background-color: #007aff;
    border-color: #007aff;
}

.message-item.selected .message-select-circle svg {
    opacity: 1;
    transform: scale(1);
}

/* 扁平化默认头像 */
.message-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 15px;
    background-color: #ffffff; 
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.message-avatar svg {
    width: 100%;
    height: 100%;
    fill: #8fa8d6; 
    transform: scale(1.25); 
}

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

/* 消息内容区 */
.message-content {
    flex: 1;
    padding: 12px 0;
    border-bottom: 0.5px solid #e5e5ea;
    min-width: 0;
}

.message-item:last-child .message-content {
    border-bottom: none;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.message-sender {
    font-size: 17px;
    font-weight: 600;
    color: #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 10px;
}

.message-date-wrap {
    display: flex;
    align-items: center;
    color: #8e8e93;
    font-size: 15px;
    flex-shrink: 0;
}

.message-chevron {
    margin-left: 6px;
    fill: #c7c7cc;
    transition: opacity 0.3s;
}

.message-preview {
    font-size: 15px;
    color: #8e8e93;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 底部悬浮区域 (正常模式) */
.message-bottom-bar-wrapper {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 20;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s;
}

.message-search-capsule {
    flex: 1;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px 0 20px;
    height: 52px;
}

.message-search-left {
    display: flex;
    align-items: center;
    color: #8e8e93;
    font-size: 17px;
}

.message-search-left svg {
    margin-right: 8px;
}

.message-mic-right {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.message-create-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
    border: none;
    outline: none;
}

/* --- 底部操作栏 (编辑模式) --- */
.message-edit-action-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85px;
    padding: 0 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 20;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.3s;
}

.message-edit-action-btn {
    background: none;
    border: none;
    font-size: 17px;
    color: #007aff;
    cursor: pointer;
}

#message-deleteBtn {
    color: #ff3b30; 
}

.message-edit-action-btn:disabled {
    color: #c7c7cc !important;
    cursor: not-allowed;
}

/* --- 编辑模式状态控制 --- */
.message-app-container.edit-mode .message-select-wrapper {
    width: 37px; 
}
.message-app-container.edit-mode .message-chevron {
    opacity: 0;
}
.message-app-container.edit-mode .message-bottom-bar-wrapper {
    transform: translateY(150%);
    opacity: 0;
    pointer-events: none;
}
.message-app-container.edit-mode .message-edit-action-bar {
    transform: translateY(0);
    opacity: 1;
}
.message-app-container.edit-mode .message-capsule-btn {
    color: #007aff; 
}

/* --- 新建消息抽屉 --- */
.message-new-sheet {
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border-radius: 36px 36px 0 0;
    z-index: 150;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
}
.message-new-sheet.show {
    transform: translateY(0);
}
.message-new-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    position: relative;
}
.message-new-title {
    font-size: 17px;
    font-weight: 600;
}
.message-new-close {
    position: absolute;
    right: 16px;
    width: 30px;
    height: 30px;
    background: rgba(0,0,0,0.05);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.message-new-close svg {
    width: 16px;
    height: 16px;
    stroke: #8e8e93;
}
.message-new-fields-container {
    margin: 0 16px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 0.5px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
}
.message-new-to-bar, .message-new-from-bar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    position: relative;
}
.message-new-divider {
    height: 0.5px;
    background-color: rgba(0,0,0,0.1);
    margin-left: 12px;
}
.message-new-to-label {
    color: #8e8e93;
    font-size: 16px;
    margin-right: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}
.message-new-to-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
}
.message-new-add-btn {
    width: 28px;
    height: 28px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.message-new-add-btn svg {
    width: 16px;
    height: 16px;
    stroke: #007aff;
}
/* 悬浮下拉框样式 */
.message-new-contacts-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 280px;
    overflow-y: auto;
    z-index: 200;
    display: none;
}
.message-new-contacts-dropdown.show {
    display: block;
}
.message-new-contact-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 0.5px solid #f2f2f7;
    cursor: pointer;
}
.message-new-contact-item:last-child {
    border-bottom: none;
}
.message-new-contact-item:active {
    background-color: #f9f9f9;
}
.message-new-contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e5e5ea;
    margin-right: 12px;
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    flex-shrink: 0;
}
.message-new-contact-avatar svg {
    width: 24px;
    height: 24px;
    fill: #8e8e93;
}
.message-new-contact-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}
.message-new-contact-name {
    font-size: 16px;
    color: #000;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.message-new-contact-sub {
    font-size: 13px;
    color: #8e8e93;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.message-new-footer {
    position: absolute;
    bottom: 20px; left: 16px; right: 16px;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
    background: transparent;
}

