/* Messhow 前台 — 一体式边缘抽屉 */
.messhow-panel {
    --ms-orange: #e67e22;
    --ms-orange-dark: #d35400;
    --ms-w: 268px;
    --ms-fold: 48px;

    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    font-family: "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.messhow-shell {
    width: var(--ms-w);
    background: #fff;
    border-radius: 10px 0 0 10px;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-right: none;
    overflow: hidden;
    transition: width 0.28s ease;
}

.messhow-panel.collapsed .messhow-shell {
    width: var(--ms-fold);
}

/* 顶栏 = 标题 + 收起 */
.messhow-bar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    height: 46px;
    background: var(--ms-orange);
    color: #fff;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.messhow-bar:hover {
    background: var(--ms-orange-dark);
}

.messhow-bar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.messhow-bar-icon svg {
    width: 18px;
    height: 18px;
}

.messhow-bar-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messhow-bar-chevron {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
    transition: transform 0.28s ease;
}

.messhow-bar-chevron svg {
    width: 18px;
    height: 18px;
}

.messhow-panel.collapsed .messhow-bar-chevron {
    transform: rotate(180deg);
}

.messhow-panel.collapsed .messhow-bar-title {
    display: none;
}

.messhow-panel.collapsed .messhow-bar {
    justify-content: center;
    padding: 0;
}

/* 内容区 */
.messhow-content {
    max-height: min(420px, 60vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.messhow-panel.collapsed .messhow-content {
    display: none;
}

.messhow-list {
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.messhow-list::-webkit-scrollbar {
    width: 4px;
}

.messhow-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 4px;
}

/* 列表行 */
.messhow-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.15s;
}

.messhow-item:last-child {
    border-bottom: none;
}

.messhow-item:hover {
    background: #fef8f3;
}

.messhow-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f5f6f8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    overflow: hidden;
}

.messhow-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.messhow-item-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.messhow-item-name {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messhow-item-count {
    font-size: 12px;
    color: #95a5a6;
}

.messhow-footer {
    padding: 8px;
    text-align: center;
    font-size: 11px;
    color: #bdc3c7;
    border-top: 1px solid #f0f2f5;
    background: #fafbfc;
}

/* 左侧吸附 */
.messhow-panel.position-left {
    right: auto;
    left: 0;
}

.messhow-panel.position-left .messhow-shell {
    border-radius: 0 10px 10px 0;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    border-left: none;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
}

.messhow-panel.position-left .messhow-bar-chevron svg {
    transform: scaleX(-1);
}

@media (max-width: 480px) {
    .messhow-panel {
        --ms-w: min(268px, calc(100vw - 24px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .messhow-shell,
    .messhow-bar-chevron,
    .messhow-item {
        transition: none;
    }
}
