/* ===== Group Chat Styles ===== */
/* All class names use gc- prefix to avoid conflicts with main styles */
/* Theme variables (--bg-*, --text-*, etc.) inherited from style.css :root / body.dark */

/* ===== Overlay & Container ===== */

#gcOverlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10000;
    background: var(--bg-body);
    display: flex;
    flex-direction: column;
    height: 100dvh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.gc-container {
    display: flex;
    flex: 1;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* ===== Left Sidebar ===== */

.gc-sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gc-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
}

.gc-sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.gc-sidebar-close {
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 18px;
    cursor: pointer;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}
@media (hover: hover) {
	.gc-sidebar-close:hover {
	    background: var(--hover-bg);
	    color: var(--text-primary);
	}
}

.gc-sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Group list items */
.gc-group-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gc-group-item {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (hover: hover) {
	.gc-group-item:hover {
	    background: var(--hover-bg);
	}
}
.gc-group-item.active {
    background: var(--accent-light, rgba(102,126,234,0.15));
    color: var(--accent, #667eea);
    font-weight: 600;
}

.gc-group-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar action buttons */
.gc-sidebar-btn {
    width: 100%;
    padding: 9px 14px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}
@media (hover: hover) {
	.gc-sidebar-btn:hover {
	    background: var(--hover-bg);
	    color: var(--text-primary);
	}
}

.gc-new-group-btn {
    background: var(--accent, #667eea) !important;
    color: #fff !important;
    font-weight: 600;
    text-align: center !important;
}
@media (hover: hover) {
	.gc-new-group-btn:hover {
	    opacity: 0.9;
	}
}

.gc-sidebar-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* ===== Main Chat Area ===== */

.gc-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-body);
    position: relative;
}

.gc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-header);
    flex-shrink: 0;
}

.gc-header-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.gc-header-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
@media (hover: hover) {
	.gc-header-btn:hover {
	    background: var(--hover-bg);
	}
}
.gc-header-btn.gc-continuous-active {
    background: var(--color-error);
    color: #fff;
    border-color: var(--color-error);
}
@media (hover: hover) {
	.gc-header-btn.gc-continuous-active:hover {
	    background: var(--color-error);
	}
}

/* Messages container */
.gc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Individual message */
.gc-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 85%;
    animation: gcFadeIn 0.45s var(--ease-emphasis);
}

@keyframes gcFadeIn {
    from { opacity: 0; transform: translateY(14px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.gc-message-user {
    align-self: flex-end;
    max-width: 70%;
}

.gc-message-assistant {
    align-self: flex-start;
}

.gc-message-streaming .gc-bubble {
    border: 1px dashed var(--border-light);
}

/* Message header (avatar + name) */
.gc-msg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 4px;
}

.gc-msg-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: var(--bg-input);
    overflow: hidden;
}

.gc-avatar-img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.gc-avatar-deleted {
    opacity: 0.4;
    filter: grayscale(1);
}

.gc-msg-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.gc-name-deleted {
    opacity: 0.5;
    font-style: italic;
}

/* Message bubble */
.gc-bubble {
    position: relative;
    padding: 10px 14px;
    border-radius: var(--bubble-user-lg);
    font-size: var(--font-size, 15px);
    line-height: 1.6;
    word-break: break-word;
    width: fit-content;
    max-width: 100%;
}

/* User bubble: gradient bg, bottom-right tail */
.gc-bubble-user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--accent, #667eea), var(--accent-300, #8b5cf6));
    color: #fff;
    border-radius: var(--bubble-user-lg) var(--bubble-user-lg) var(--bubble-user-sm) var(--bubble-user-lg);
}
.gc-bubble-user::after {
    content: '';
    position: absolute;
    right: -4px;
    bottom: 2px;
    width: 8px; height: 8px;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--accent-300, #8b5cf6), var(--accent-hover, #7c3aed));
    transform: rotate(45deg);
    z-index: -1;
    opacity: 0.9;
}

/* AI bubble: light bg with glass inner shadow + border, bottom-left tail */
.gc-bubble-assistant {
    align-self: flex-start;
    background: var(--bg-bubble-assistant);
    color: var(--text-primary);
    border-radius: var(--bubble-ai-lg) var(--bubble-ai-lg) var(--bubble-ai-lg) var(--bubble-ai-sm);
    border: 1px solid var(--border-light);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}
.gc-bubble-assistant::before {
    content: '';
    position: absolute;
    left: -4px;
    bottom: 2px;
    width: 8px; height: 8px;
    border-radius: 2px;
    background: var(--border-light);
    transform: rotate(45deg);
}
.gc-bubble-assistant::after {
    content: '';
    position: absolute;
    left: -3px;
    bottom: 3px;
    width: 6px; height: 6px;
    border-radius: 1.5px;
    background: var(--bg-bubble-assistant);
    transform: rotate(45deg);
    opacity: 0.92;
}

.gc-bubble-incomplete {
    border-style: dashed;
    opacity: 0.85;
}

/* Active round highlight */
.gc-message.gc-round-active .gc-bubble-assistant {
    background: linear-gradient(0deg, rgba(255,255,255,0.07), rgba(255,255,255,0.07)), var(--bg-bubble-assistant);
}
.gc-message.gc-round-active .gc-bubble-user {
    box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.18);
}

/* Bubble content styling */
.gc-bubble p { margin: 0 0 8px 0; }
.gc-bubble p:last-child { margin-bottom: 0; }
.gc-bubble ul, .gc-bubble ol { margin: 4px 0; padding-left: 20px; }
.gc-bubble code {
    background: var(--code-bg, rgba(0,0,0,0.08));
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.gc-bubble pre {
    background: var(--code-bg, #1e1e1e);
    color: #d4d4d4;
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 8px 0;
}
.gc-bubble pre code {
    background: transparent;
    padding: 0;
    font-size: 13px;
}
.gc-bubble blockquote {
    border-left: 3px solid var(--accent, #667eea);
    margin: 8px 0;
    padding: 4px 12px;
    color: var(--text-tertiary);
}

/* Message meta (time, tokens) */
.gc-msg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 6px;
    font-size: 11px;
    color: var(--text-tertiary);
}

.gc-msg-time { cursor: default; }
.gc-msg-token { color: var(--text-tertiary); }
.gc-msg-edited { font-style: italic; }

/* Waveform thinking indicator — 4-bar wave animation */
.gc-waveform {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 22px;
    padding: 2px 0;
}
.gc-waveform span {
    display: block;
    width: 3px;
    height: 16px;
    border-radius: 2px;
    background: var(--accent, #667eea);
    transform-origin: bottom center;
    animation: gcWaveBar 0.85s ease-in-out infinite;
    will-change: transform;
}
.gc-waveform span:nth-child(1) { animation-delay: 0s; }
.gc-waveform span:nth-child(2) { animation-delay: 0.13s; }
.gc-waveform span:nth-child(3) { animation-delay: 0.26s; }
.gc-waveform span:nth-child(4) { animation-delay: 0.39s; }

@keyframes gcWaveBar {
    0%, 60%, 100% { transform: scaleY(0.3); opacity: 0.35; }
    20% { transform: scaleY(1); opacity: 1; }
}

/* Content enter — waveform → text transition */
@keyframes gcContentEnter {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Error display */
.gc-error-text {
    color: var(--error, var(--color-error));
    font-size: 13px;
}
.gc-retry-link {
    color: var(--accent, #667eea);
    cursor: pointer;
    text-decoration: underline;
}

/* ===== Queue Notice ===== */

.gc-queue-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    margin-bottom: 8px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
}

.gc-queue-preview {
    color: var(--text-primary);
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gc-queue-cancel {
    padding: 4px 12px;
    border: 1px solid rgba(255,68,68,0.3);
    border-radius: 6px;
    background: transparent;
    color: var(--color-error);
    font-size: 11px;
    cursor: pointer;
    flex-shrink: 0;
}
@media (hover: hover) {
	.gc-queue-cancel:hover {
	    background: rgba(255,68,68,0.08);
	}
}

/* ===== Input Area ===== */

.gc-input-area {
    padding: 12px 20px 16px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-header);
    flex-shrink: 0;
}

.gc-suggestions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
    min-height: 0;
}

.gc-suggestion-btn {
    padding: 6px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
@media (hover: hover) {
	.gc-suggestion-btn:hover {
	    background: var(--accent-light, rgba(102,126,234,0.1));
	    color: var(--accent, #667eea);
	    border-color: var(--accent, #667eea);
	}
}

.gc-input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.gc-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: var(--font-size, 15px);
    font-family: inherit;
    outline: none;
    max-height: 150px;
    line-height: 1.5;
    transition: border-color 0.15s;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-y: auto;
    cursor: text;
}
.gc-input:focus {
    border-color: var(--accent, #667eea);
}
.gc-input:empty::before {
    content: attr(data-placeholder);
    color: var(--text-tertiary);
    pointer-events: none;
}

.gc-at-tag {
    display: inline;
    padding: 1px 4px;
    background: rgba(var(--accent-rgb), 0.2);
    color: var(--accent, #667eea);
    border-radius: 4px;
    font-weight: 500;
    user-select: all;
}

.gc-send-btn {
    position: relative;
    overflow: hidden;
    width: 40px; height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--accent, #667eea);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s var(--ease-emphasis), opacity 0.15s;
}
@media (hover: hover) {
	.gc-send-btn:hover {
	    opacity: 0.9;
	    transform: scale(1.05);
	}
}
.gc-send-btn:active {
    transform: scale(0.92);
    transition: transform 0.08s ease;
}

/* Send button ripple */
.gc-send-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    transform: scale(0);
    animation: gcSendRipple 0.5s ease-out forwards;
    pointer-events: none;
}
@keyframes gcSendRipple {
    to { transform: scale(3.5); opacity: 0; }
}

/* Particle burst */
.gc-particle {
    position: absolute;
    border-radius: 50%;
    background: var(--accent, #667eea);
    pointer-events: none;
    z-index: 5;
}

.gc-stop-btn {
    width: 40px; height: 40px;
    border: none;
    border-radius: 50%;
    background: #ff4444;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s var(--ease-emphasis), opacity 0.15s;
}
@media (hover: hover) {
	.gc-stop-btn:hover { opacity: 0.9; }
}
.gc-stop-btn:active {
    transform: scale(0.92);
    transition: transform 0.08s ease;
}

/* ===== Right Sidebar (Members) ===== */

.gc-rightbar {
    width: 200px;
    min-width: 200px;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gc-rightbar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.gc-rightbar-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gc-rightbar-close {
    display: none;
    width: 28px; height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 16px;
    cursor: pointer;
    border-radius: 6px;
    align-items: center;
    justify-content: center;
}
@media (hover: hover) {
	.gc-rightbar-close:hover {
	    background: var(--hover-bg);
	    color: var(--text-primary);
	}
}

.gc-member-count {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 400;
}

.gc-member-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gc-member-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}
@media (hover: hover) {
	.gc-member-item:hover {
	    background: var(--hover-bg);
	}
}

.gc-member-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: var(--bg-input);
    overflow: hidden;
}
.gc-member-avatar .gc-avatar-img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.gc-member-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.gc-member-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gc-member-detail {
    font-size: 11px;
    color: var(--text-tertiary);
}

.gc-member-remove {
    width: 24px; height: 24px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
}
@media (hover: hover) {
	.gc-member-item:hover .gc-member-remove {
	    opacity: 1;
	}
}
@media (hover: hover) {
	.gc-member-remove:hover {
	    background: rgba(255,68,68,0.1);
	    color: #ff4444;
	}
}

.gc-member-dm {
    width: 28px; height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    margin-right: 2px;
}
@media (hover: hover) {
	.gc-member-dm:hover {
	    background: rgba(102,126,234,0.1);
	}
}

.gc-add-char-btn {
    margin: 8px;
    padding: 8px;
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-tertiary);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
@media (hover: hover) {
	.gc-add-char-btn:hover {
	    background: var(--hover-bg);
	    color: var(--text-primary);
	    border-color: var(--text-tertiary);
	}
}

/* ===== Modals ===== */

.gc-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10010;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gc-modal-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
}

.gc-modal-content {
    position: relative;
    background: var(--bg-body);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    box-shadow: var(--shadow-elevated);
    max-height: 85vh;
    width: 560px;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    flex-shrink: 0;
}
.gc-modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.gc-modal-close {
    width: 32px; height: 32px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 18px;
    cursor: pointer;
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (hover: hover) {
	.gc-modal-close:hover {
	    background: var(--hover-bg);
	    color: var(--text-primary);
	}
}

.gc-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.gc-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
    gap: 10px;
}

.gc-modal-footer-right {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

/* ===== Private Chat (DM) Modal ===== */

.gc-dm-modal {
    width: 520px;
    max-width: 95vw;
    height: 580px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.gc-dm-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gc-dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gc-dm-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: 85%;
    animation: gcFadeIn 0.45s var(--ease-emphasis);
}

.gc-dm-message.gc-dm-user {
    align-self: flex-end;
    flex-direction: row-reverse;
    max-width: 70%;
}

.gc-dm-message.gc-dm-assistant {
    align-self: flex-start;
}

.gc-dm-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: var(--bg-input);
    overflow: hidden;
}
.gc-dm-avatar .gc-avatar-img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.gc-dm-bubble {
    position: relative;
    padding: 10px 14px;
    border-radius: var(--bubble-user-lg);
    font-size: var(--font-size, 15px);
    line-height: 1.6;
    word-break: break-word;
}

.gc-dm-bubble-user {
    background: linear-gradient(135deg, var(--accent, #667eea), var(--accent-300, #8b5cf6));
    color: #fff;
    border-radius: var(--bubble-user-lg) var(--bubble-user-lg) var(--bubble-user-sm) var(--bubble-user-lg);
}
.gc-dm-bubble-user::after {
    content: '';
    position: absolute;
    right: -4px;
    bottom: 2px;
    width: 8px; height: 8px;
    border-radius: 2px;
    background: linear-gradient(135deg, var(--accent-300, #8b5cf6), var(--accent-hover, #7c3aed));
    transform: rotate(45deg);
    z-index: -1;
    opacity: 0.9;
}

.gc-dm-bubble-assistant {
    background: var(--bg-bubble-assistant);
    color: var(--text-primary);
    border-radius: var(--bubble-ai-lg) var(--bubble-ai-lg) var(--bubble-ai-lg) var(--bubble-ai-sm);
    border: 1px solid var(--border-light);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}
.gc-dm-bubble-assistant::before {
    content: '';
    position: absolute;
    left: -4px;
    bottom: 2px;
    width: 8px; height: 8px;
    border-radius: 2px;
    background: var(--border-light);
    transform: rotate(45deg);
}
.gc-dm-bubble-assistant::after {
    content: '';
    position: absolute;
    left: -3px;
    bottom: 3px;
    width: 6px; height: 6px;
    border-radius: 1.5px;
    background: var(--bg-bubble-assistant);
    transform: rotate(45deg);
    opacity: 0.92;
}

.gc-dm-bubble p { margin: 0 0 8px 0; }
.gc-dm-bubble p:last-child { margin-bottom: 0; }
.gc-dm-bubble ul, .gc-dm-bubble ol { margin: 4px 0; padding-left: 20px; }
.gc-dm-bubble code {
    background: var(--code-bg, rgba(0,0,0,0.08));
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}
.gc-dm-bubble pre {
    background: var(--code-bg, #1e1e1e);
    color: #d4d4d4;
    padding: 12px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.85em;
}

.gc-dm-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px;
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
}

.gc-dm-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--border-light);
}

.gc-dm-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: var(--font-size, 15px);
    font-family: inherit;
    line-height: 1.5;
    outline: none;
    resize: none;
    max-height: 120px;
}
.gc-dm-input:focus {
    border-color: var(--accent, #667eea);
}

.gc-dm-send-btn {
    width: 40px; height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--accent, #667eea);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s var(--ease-emphasis);
}
@media (hover: hover) {
	.gc-dm-send-btn:hover {
	    opacity: 0.9;
	}
}
.gc-dm-send-btn:active {
    transform: scale(0.92);
    transition: transform 0.08s ease;
}

@media (max-width: 600px) {
    .gc-dm-modal {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    .gc-dm-message {
        max-width: 90%;
    }
    .gc-dm-message.gc-dm-user {
        max-width: 82%;
    }
    .gc-member-dm {
        width: 44px; height: 44px;
        min-width: 44px; min-height: 44px;
        font-size: 18px;
    }
}

/* ===== Buttons (shared) ===== */

.gc-save-btn {
    padding: 8px 24px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--accent, #667eea);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
@media (hover: hover) {
	.gc-save-btn:hover { opacity: 0.9; }
}

.gc-cancel-btn {
    padding: 8px 24px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}
@media (hover: hover) {
	.gc-cancel-btn:hover { background: var(--hover-bg); }
}

.gc-delete-btn {
    padding: 8px 16px;
    border: 1px solid rgba(255,68,68,0.3);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-error);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
@media (hover: hover) {
	.gc-delete-btn:hover {
	    background: rgba(255,68,68,0.08);
	}
}

/* ===== Character Editor Modal ===== */

.gc-char-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.gc-char-avatar-preview {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    cursor: pointer;
    border: 3px solid var(--border-light);
    transition: border-color 0.15s;
    overflow: hidden;
}
@media (hover: hover) {
	.gc-char-avatar-preview:hover {
	    border-color: var(--accent, #667eea);
	}
}
.gc-char-avatar-preview .gc-avatar-img {
    width: 100%; height: 100%;
    object-fit: cover;
}

.gc-char-avatar-hint {
    font-size: 11px;
    color: var(--text-tertiary);
}

.gc-char-field {
    margin-bottom: 18px;
}
.gc-char-field label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.gc-char-count {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 400;
}

.gc-char-detail-val {
    font-size: 11px;
    color: var(--accent, #667eea);
    font-weight: 600;
}

.gc-char-field input[type="text"],
.gc-char-field textarea,
.gc-char-field select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.gc-char-field input[type="text"]:focus,
.gc-char-field textarea:focus,
.gc-char-field select:focus {
    border-color: var(--accent, #667eea);
}
.gc-char-field textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* Detail slider */
.gc-detail-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gc-detail-label {
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.gc-detail-slider-row input[type="range"] {
    flex: 1;
    accent-color: var(--accent, #667eea);
    height: 6px;
}

.gc-detail-presets {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.gc-detail-preset {
    padding: 4px 12px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 11px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
@media (hover: hover) {
	.gc-detail-preset:hover {
	    border-color: var(--accent, #667eea);
	    color: var(--accent, #667eea);
	}
}

.gc-ai-optimize-btn {
    margin-top: 8px;
    padding: 6px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
@media (hover: hover) {
	.gc-ai-optimize-btn:hover:not(:disabled) {
	    background: var(--hover-bg);
	}
}
.gc-ai-optimize-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.gc-char-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 6px;
    line-height: 1.5;
}

/* Preview area */
.gc-char-preview {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 14px;
    background: var(--bg-sidebar);
}

.gc-char-preview-header {
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}

.gc-char-preview-msg {
    margin-bottom: 10px;
}

.gc-char-preview-msg .gc-msg-header {
    margin-bottom: 4px;
}

.gc-test-speak-row {
    display: flex;
    gap: 8px;
}
.gc-test-speak-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
}
.gc-test-speak-row input:focus {
    border-color: var(--accent, #667eea);
}
.gc-test-speak-row button {
    padding: 8px 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent, #667eea);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ===== Avatar Picker Modal ===== */

.gc-avatar-picker {
    width: 420px;
}

.gc-avatar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    padding: 0 20px;
    gap: 0;
}

.gc-avatar-tab {
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 13px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
@media (hover: hover) {
	.gc-avatar-tab:hover {
	    color: var(--text-primary);
	}
}
.gc-avatar-tab.active {
    color: var(--accent, #667eea);
    border-bottom-color: var(--accent, #667eea);
    font-weight: 600;
}

.gc-avatar-tab-content {
    padding: 16px 20px;
}

/* Emoji grid */
.gc-emoji-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.gc-emoji-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
    max-height: 240px;
    overflow-y: auto;
}

.gc-emoji-item {
    width: 100%;
    aspect-ratio: 1;
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
@media (hover: hover) {
	.gc-emoji-item:hover {
	    background: var(--hover-bg);
	}
}

.gc-recent-emojis {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.gc-recent-label {
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* Upload zone */
.gc-upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
@media (hover: hover) {
	.gc-upload-zone:hover {
	    border-color: var(--accent, #667eea);
	    background: var(--hover-bg);
	}
}
.gc-upload-dragover {
    border-color: var(--accent, #667eea) !important;
    background: rgba(var(--accent-rgb, 102, 126, 234), 0.1) !important;
}

/* ===== Add Character Modal ===== */

.gc-add-char-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}
@media (hover: hover) {
	.gc-add-char-item:hover {
	    background: var(--hover-bg);
	    border-color: var(--border-light);
	}
}

/* ===== Character Management Modal ===== */

.gc-char-manage-actions {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.gc-char-manage-actions button {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent, #667eea);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.gc-char-manage-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gc-char-manage-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
@media (hover: hover) {
	.gc-char-manage-item:hover {
	    background: var(--hover-bg);
	}
}
.gc-char-manage-item button {
    margin-left: auto;
    padding: 6px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
@media (hover: hover) {
	.gc-char-manage-item button:hover {
	    background: var(--hover-bg);
	}
}

/* Character order list (in group settings) */
.gc-char-order-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gc-char-order-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-light);
}

.gc-char-order-num {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--accent, #667eea);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gc-char-order-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ===== Group Settings Modal ===== */

.gc-settings-field {
    margin-bottom: 18px;
}
.gc-settings-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.gc-settings-field input[type="text"],
.gc-settings-field select,
.gc-settings-field input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.gc-settings-field input[type="text"]:focus,
.gc-settings-field select:focus,
.gc-settings-field input[type="number"]:focus {
    border-color: var(--accent, #667eea);
}
.gc-settings-field input[type="range"] {
    width: 100%;
    accent-color: var(--accent, #667eea);
}

.gc-settings-danger {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

/* ===== Scroll to Bottom Button ===== */

.gc-scroll-bottom-btn {
    position: absolute;
    bottom: 72px;
    right: 36px;
    min-width: 36px; height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    background: var(--bg-body);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    transition: background 0.15s, transform 0.15s, border-radius 0.2s, padding 0.2s;
    white-space: nowrap;
}
@media (hover: hover) {
	.gc-scroll-bottom-btn:hover {
	    background: var(--hover-bg);
	    transform: scale(1.05);
	}
}
.gc-scroll-bottom-btn.gc-has-unread {
    padding: 0 14px 0 10px;
}
.gc-unread-badge {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--accent, #6366f1);
    padding: 1px 7px;
    border-radius: var(--radius-sm);
    line-height: 1.5;
    animation: gcBadgeIn 0.3s var(--ease-standard);
}
@keyframes gcBadgeIn {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
@keyframes gcPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.6); }
}

/* ===== @ Mention Picker ===== */

.gc-at-picker {
    position: fixed;
    z-index: 10030;
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    max-height: 240px;
    overflow-y: auto;
    min-width: 200px;
    max-width: 260px;
    display: none;
}

.gc-at-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.1s;
}
.gc-at-picker-item:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.gc-at-picker-item:last-child  { border-radius: 0 0 var(--radius-md) var(--radius-md); }
.gc-at-picker-item:only-child   { border-radius: var(--radius-md); }
.gc-at-picker-item.active {
    background: var(--hover-bg);
}
@media (hover: hover) {
    .gc-at-picker-item:hover {
        background: var(--hover-bg);
    }
}

.gc-at-picker-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: var(--bg-input);
}

.gc-at-picker-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Message More Button ===== */

.gc-msg-more-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px; height: 26px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    background: var(--bg-body);
    color: var(--text-tertiary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background 0.15s, color 0.15s;
    animation: gcFadeIn 0.15s ease;
}
@media (hover: hover) {
	.gc-msg-more-btn:hover {
	    background: var(--hover-bg);
	    color: var(--text-primary);
	}
}

.gc-message {
    position: relative;
}

/* ===== Message Context Menu ===== */

.gc-msg-menu {
    position: fixed;
    z-index: 10040;
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    min-width: 160px;
    display: none;
    overflow: hidden;
}

.gc-msg-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.1s;
}
.gc-msg-menu-item.gc-menu-active {
    background: var(--hover-bg);
}
@media (hover: hover) {
    .gc-msg-menu-item:hover {
        background: var(--hover-bg);
    }
}

/* ===== Toast Notification ===== */

.gc-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10050;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-elevated);
    border-left: 4px solid var(--accent, #667eea);
    display: none;
    white-space: nowrap;
}

@keyframes gcToastIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes gcToastOut {
    from { opacity: 1; transform: translateX(-50%) translateY(0); }
    to   { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

/* ===== Context Overflow Banner ===== */

.gc-context-banner {
    padding: 8px 16px;
    margin: 0 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.gc-banner-close {
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
}
@media (hover: hover) {
	.gc-banner-close:hover {
	    background: var(--hover-bg);
	}
}

/* ===== Branch Indicator & List ===== */

.gc-branch-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    margin-top: 6px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 11px;
    color: var(--text-tertiary);
    cursor: pointer;
    align-self: flex-start;
    transition: background 0.15s, color 0.15s;
}
@media (hover: hover) {
	.gc-branch-indicator:hover {
	    background: var(--hover-bg);
	    color: var(--accent, #667eea);
	    border-color: var(--accent, #667eea);
	}
}

.gc-branch-list {
    position: fixed;
    z-index: 10040;
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-elevated);
    min-width: 220px;
    max-width: 320px;
    display: none;
    overflow: hidden;
}

.gc-branch-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.gc-branch-list-close {
    width: 28px; height: 28px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 16px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (hover: hover) {
	.gc-branch-list-close:hover {
	    background: var(--hover-bg);
	}
}

.gc-branch-list-body {
    padding: 6px;
}

.gc-branch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.1s;
}
@media (hover: hover) {
	.gc-branch-item:hover {
	    background: var(--hover-bg);
	}
}
.gc-branch-item.active {
    background: var(--accent-light, rgba(102,126,234,0.12));
}

.gc-branch-item-num {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.gc-branch-item-time {
    font-size: 11px;
    color: var(--text-tertiary);
}

.gc-branch-more {
    color: var(--accent, #667eea);
    font-size: 12px;
    justify-content: center;
}

/* ===== Edit Message ===== */

.gc-edit-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-body);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    resize: vertical;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s;
}
.gc-edit-textarea:focus {
    border-color: var(--accent, #667eea);
}

.gc-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}

/* ===== Mobile Message Bottom Sheet ===== */

.gc-msg-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 10030;
}

.gc-msg-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--bg-body);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    z-index: 10031;
    padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.3s var(--ease-standard);
    box-shadow: var(--shadow-elevated);
}
.gc-msg-sheet.gc-msg-sheet-open {
    transform: translateY(0);
}

.gc-msg-sheet-handle {
    width: 36px; height: 4px;
    border-radius: 2px;
    background: var(--border-light);
    margin: 0 auto 12px;
}

.gc-msg-sheet-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-align: center;
}

.gc-msg-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    transition: background 0.15s;
}
@media (hover: hover) {
	.gc-msg-sheet-item:hover {
	    background: var(--hover-bg);
	}
}

.gc-msg-sheet-cancel {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 15px;
    cursor: pointer;
}

/* ===== Header Toggle Buttons (mobile-only) ===== */

.gc-hamburger-btn,
.gc-members-btn {
    display: none;
    width: 36px; height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
@media (hover: hover) {
	.gc-hamburger-btn:hover,
	.gc-members-btn:hover {
	    background: var(--hover-bg);
	    color: var(--text-primary);
	}
}

.gc-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===== Sidebar Overlays (mobile-only) ===== */

.gc-sidebar-overlay,
.gc-rightbar-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 10010;
}
.gc-sidebar-overlay.show,
.gc-rightbar-overlay.show {
    display: block;
}

/* ===== Responsive (mobile) ===== */

@media (max-width: 600px) {
    .gc-hamburger-btn,
    .gc-members-btn {
        display: flex;
    }

    .gc-sidebar {
        position: absolute;
        top: 0; bottom: 0;
        left: 0;
        width: 280px;
        z-index: 10020;
        transform: translateX(-100%);
        transition: transform 0.3s var(--ease-standard);
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    .gc-sidebar.gc-sidebar-open {
        transform: translateX(0);
    }

    .gc-rightbar {
        position: absolute;
        top: 0; bottom: 0;
        right: 0;
        width: 240px;
        z-index: 10020;
        transform: translateX(100%);
        transition: transform 0.3s var(--ease-standard);
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    }
    .gc-rightbar.gc-rightbar-open {
        transform: translateX(0);
    }

    .gc-message {
        max-width: 92%;
    }
    .gc-message-user {
        max-width: 82%;
    }

    .gc-modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    /* Show rightbar close button on mobile */
    .gc-rightbar-close {
        display: flex;
    }

    /* Suggestion buttons: horizontal scroll instead of wrap */
    .gc-suggestions {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    .gc-suggestion-btn {
        flex-shrink: 0;
    }

    /* Input expands on focus */
    .gc-input:focus {
        min-height: 80px;
        max-height: 120px;
    }

    /* Compact input area */
    .gc-input-area {
        padding: 10px 12px 12px;
    }

    /* Compact header */
    .gc-header {
        padding: 10px 14px;
    }

    /* Compact messages */
    .gc-messages {
        padding: 14px;
        gap: 12px;
    }

    /* Larger scroll-to-bottom button */
    .gc-scroll-bottom-btn {
        min-width: 44px; height: 44px;
        bottom: 100px;
        right: 12px;
        font-size: 20px;
    }

    /* Larger tap targets for sidebar entries */
    .gc-sidebar-btn {
        min-height: 44px;
    }
    .gc-group-item {
        min-height: 44px;
    }
    .gc-member-item {
        min-height: 44px;
        padding: 10px 12px;
    }

    /* Smaller avatars on mobile */
    .gc-msg-avatar {
        width: 24px; height: 24px;
        font-size: 14px;
    }
    .gc-msg-header {
        gap: 6px;
    }
    .gc-msg-name {
        font-size: 12px;
    }

    /* Header title smaller */
    .gc-header-name {
        font-size: 14px;
    }

    /* Safe area insets */
    .gc-sidebar {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .gc-rightbar {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .gc-input-area {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    /* Hide continuous button text on small screens */
    .gc-header-btn {
        font-size: 11px;
        padding: 6px 10px;
    }

    /* ===== Touch Targets (44x44px minimum) ===== */
    .gc-send-btn,
    .gc-stop-btn,
    .gc-dm-send-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    .gc-hamburger-btn,
    .gc-members-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    .gc-sidebar-close,
    .gc-modal-close {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 22px;
    }
    .gc-rightbar-close,
    .gc-branch-list-close {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    .gc-header-btn {
        min-height: 44px;
        padding: 10px 16px;
    }
    .gc-suggestion-btn {
        min-height: 44px;
        padding: 10px 16px;
    }
    .gc-msg-more-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }
    .gc-msg-sheet-item {
        min-height: 44px;
        padding: 12px 16px;
    }
    .gc-msg-sheet-cancel {
        min-height: 44px;
        padding: 12px 16px;
    }
}

/* ===== Touch :active feedback (mobile tap highlight) ===== */

/* --- Buttons — press-down scale --- */
.gc-sidebar-close:active,
.gc-new-group-btn:active,
.gc-header-btn:active,
.gc-header-btn.gc-continuous-active:active,
.gc-rightbar-close:active,
.gc-modal-close:active,
.gc-scroll-bottom-btn:active,
.gc-banner-close:active,
.gc-branch-list-close:active,
.gc-hamburger-btn:active,
.gc-members-btn:active,
.gc-queue-cancel:active,
.gc-add-char-btn:active,
.gc-save-btn:active,
.gc-cancel-btn:active,
.gc-delete-btn:active,
.gc-char-manage-item button:active,
.gc-detail-preset:active,
.gc-ai-optimize-btn:active:not(:disabled) {
    transform: scale(0.94);
    transition: transform 0.08s ease;
}

/* --- List items — brief bg highlight --- */
.gc-group-item:active,
.gc-sidebar-btn:active,
.gc-member-item:active,
.gc-at-picker-item:active,
.gc-msg-menu-item:active,
.gc-branch-item:active,
.gc-msg-sheet-item:active,
.gc-char-manage-item:active,
.gc-add-char-item:active {
    background: var(--hover-bg);
    transition: background 0.05s;
}

/* --- Misc interactive areas --- */
.gc-member-remove:active,
.gc-member-dm:active {
    opacity: 0.7;
}
.gc-suggestion-btn:active {
    transform: scale(0.97);
    opacity: 0.8;
}
.gc-avatar-tab:active,
.gc-emoji-item:active {
    transform: scale(0.95);
    transition: transform 0.08s ease;
}
.gc-upload-zone:active {
    opacity: 0.8;
}
.gc-branch-indicator:active {
    opacity: 0.7;
}
.gc-msg-more-btn:active {
    background: var(--hover-bg);
    transform: scale(0.92);
}
.gc-char-avatar-preview:active {
    opacity: 0.8;
    transform: scale(0.97);
}

/* #31 暗色模式边缘高光 — 0.5px 极淡白边 */
body.dark .gc-sidebar,
body.dark .gc-settings-panel,
body.dark .gc-language-dropdown,
body.dark .gc-share-modal,
body.dark .gc-prompt-panel {
    box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.04);
}
