/* ============================================================
   css/guest-room-join.css — 会客厅客人进房页样式
   两步进房 + 头像 + 身份 + 裁剪浮层
   ============================================================ */

/* ===== 两步进房流程 ===== */
.gr-step { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }

/* 查码结果 */
.gr-lookup-result {
    font-size: 12.5px;
    color: var(--accent, #C9A8A8);
    text-align: center;
    margin-bottom: 12px;
    line-height: 1.6;
}

/* ===== 头像区域 ===== */
.gr-avatar-area {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    margin-bottom: 16px; cursor: pointer;
}
.gr-avatar-circle {
    width: 68px; height: 68px;
    border-radius: 50%;
    border: 2px dashed rgba(201, 168, 168, 0.4);
    background: rgba(201, 168, 168, 0.06);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted, #BFB8AE);
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.gr-avatar-circle svg { width: 28px; height: 28px; }
.gr-avatar-circle:active { transform: scale(0.94); }
.gr-avatar-circle.has-avatar { border-style: solid; border-color: var(--accent, #C9A8A8); }
.gr-avatar-hint {
    font-size: 11px; color: var(--text-muted, #BFB8AE);
}

/* ===== 身份输入 ===== */
.gr-identity-wrap {
    display: flex; align-items: center; gap: 0; flex-wrap: nowrap;
}
.gr-identity-prefix, .gr-identity-suffix {
    font-size: 13px; color: var(--text-secondary, #8A8278);
    white-space: nowrap; flex-shrink: 0;
}
.gr-identity-owner {
    font-size: 14px; color: var(--accent, #C9A8A8);
    font-weight: 600; white-space: nowrap; flex-shrink: 0;
    padding: 0 2px;
}
.gr-identity-input {
    flex: 1; min-width: 60px; height: 36px; margin: 0 4px;
    text-align: center;
}

/* ===== 裁剪浮层 ===== */
.gr-crop-overlay {
    position: absolute; inset: 0; z-index: 6500;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.gr-crop-backdrop {
    position: absolute; inset: 0;
    background: rgba(30, 28, 26, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.gr-crop-body {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
    width: min(90%, 360px);
}
.gr-crop-hint {
    font-size: 12px; color: rgba(255,255,255,0.7);
    text-align: center;
}
.gr-crop-canvas-wrap {
    position: relative; width: 100%; aspect-ratio: 1;
    max-width: 320px; overflow: hidden; border-radius: 50%;
}
.gr-crop-canvas-wrap canvas {
    display: block; width: 100%; height: 100%;
    cursor: grab; touch-action: none;
}
.gr-crop-mask {
    position: absolute; inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(30,28,26,0.55);
    pointer-events: none;
}
.gr-crop-actions {
    display: flex; gap: 12px; width: 100%; max-width: 320px;
}
.gr-crop-actions .gr-btn { flex: 1; }

/* ===== 消息头像 ===== */
.gr-msg { display: flex; flex-direction: row; align-items: flex-end; gap: 8px; margin-bottom: 14px; animation: grMsgIn 0.35s cubic-bezier(0.22, 0.61, 0.36, 1); }
.gr-msg.me { flex-direction: row-reverse; }
.gr-msg-avatar {
    width: 32px; height: 32px; flex-shrink: 0;
    border-radius: 50%;
    background: rgba(201, 168, 168, 0.12);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: var(--text-secondary, #8A8278);
    overflow: hidden;
}
.gr-msg-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.gr-msg-body { display: flex; flex-direction: column; max-width: 76%; }
.gr-msg.me .gr-msg-body { align-items: flex-end; }
.gr-msg.ai .gr-msg-body, .gr-msg.them .gr-msg-body { align-items: flex-start; }

/* 旧样式覆盖：gr-msg内部气泡适配 */
.gr-msg .gr-bubble { max-width: 100%; }

/* ===== 失败消息 ===== */
.gr-msg.gr-failed .gr-bubble {
    opacity: 0.65;
    box-shadow: inset 0 0 0 1px rgba(220, 100, 100, 0.25);
}
.gr-fail-badge {
    display: flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; margin-top: 2px;
    border-radius: 50%;
    background: rgba(220, 100, 100, 0.12);
    color: rgba(200, 80, 80, 0.7);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease;
}
.gr-fail-badge svg { width: 14px; height: 14px; }
.gr-fail-badge:active { transform: scale(1.15); background: rgba(220, 100, 100, 0.22); }
.gr-msg.me .gr-fail-badge { align-self: flex-end; }

/* ===== 房间改名 ===== */
.gr-editable {
    cursor: pointer; border-bottom: 1px dashed transparent;
    transition: border-color 0.2s ease;
}
.gr-editable:hover { border-bottom-color: var(--accent, #C9A8A8); }
.gr-rename-input {
    width: 100%; max-width: 180px;
    border: none; border-bottom: 2px solid var(--accent, #C9A8A8);
    background: transparent;
    font-family: 'Noto Serif SC', 'STSong', serif;
    font-size: 15px; color: var(--text-primary, #1E1C1A);
    outline: none; padding: 2px 0;
}
