/**
 * RiPro-V2 定制 · 在线聊天室 —— 前台样式
 */

.ripchat,
.ripchat-fab {
	--rc-accent: #6366f1;
	--rc-accent-2: #4f46e5;
	--rc-accent-soft: #eef2ff;
	--rc-accent-rgb: 99, 102, 241;
	--rc-bg: #ffffff;
	--rc-bg-soft: #f6f7fb;
	--rc-text: #111827;
	--rc-text-2: #6b7280;
	--rc-line: rgba(17, 24, 39, 0.08);
	--rc-bubble: #f1f3f9;
	--rc-bubble-text: #1f2937;
	--rc-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
	--rc-radius: 20px;
	--rc-height: 640px;
	--rc-surface: 255, 255, 255;
	--rc-card-alpha: 1;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: var(--rc-text);
	-webkit-font-smoothing: antialiased;
}

.ripchat[data-theme="dark"],
.ripchat-fab[data-theme="dark"] {
	--rc-bg: #0f1420;
	--rc-bg-soft: #161d2b;
	--rc-text: #e6eaf3;
	--rc-text-2: #8b98ad;
	--rc-line: rgba(255, 255, 255, 0.09);
	--rc-bubble: #1c2434;
	--rc-bubble-text: #e6eaf3;
	--rc-accent-soft: #1d2340;
	--rc-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
	--rc-surface: 15, 20, 32;
}

@media (prefers-color-scheme: dark) {
	.ripchat[data-theme="auto"],
	.ripchat-fab[data-theme="auto"] {
		--rc-bg: #0f1420;
		--rc-bg-soft: #161d2b;
		--rc-text: #e6eaf3;
		--rc-text-2: #8b98ad;
		--rc-line: rgba(255, 255, 255, 0.09);
		--rc-bubble: #1c2434;
		--rc-bubble-text: #e6eaf3;
		--rc-accent-soft: #1d2340;
		--rc-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
		--rc-surface: 15, 20, 32;
	}
}

.ripchat,
.ripchat *,
.ripchat *::before,
.ripchat *::after,
.ripchat-fab,
.ripchat-fab * {
	box-sizing: border-box;
}

/* ---------- 容器 ---------- */

.ripchat {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
}

.ripchat[data-mode="page"] {
	max-width: var(--rc-width, 100%);
	margin-left: auto;
	margin-right: auto;
}

.ripchat[data-mode="page"] .ripchat__shell {
	height: var(--rc-height);
	min-height: 380px;
}

.ripchat[data-mode="floating"],
.ripchat[data-mode="floating"] .ripchat__shell {
	height: 100%;
	min-height: 0;
}

.ripchat__shell {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background-color: rgba(var(--rc-surface), var(--rc-card-alpha));
	border: 1px solid var(--rc-line);
	border-radius: var(--rc-radius);
	box-shadow: var(--rc-shadow);
}

/* ---------- 头部 ---------- */

.ripchat__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--rc-line);
	background: transparent;
	position: relative;
	z-index: 3;
	flex: 0 0 auto;
}

.ripchat__brand {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.ripchat__pulse {
	position: relative;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #22c55e;
	box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
	animation: rc-pulse 2.4s infinite;
	flex: 0 0 auto;
}

@keyframes rc-pulse {
	0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
	70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
	100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.ripchat__brand-text {
	min-width: 0;
}

.ripchat__title {
	margin: 0;
	font-size: 15px;
	font-weight: 650;
	letter-spacing: 0.01em;
	color: var(--rc-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.3;
}

.ripchat__meta {
	margin: 2px 0 0;
	font-size: 12px;
	color: var(--rc-text-2);
	display: flex;
	align-items: center;
	gap: 4px;
}

.ripchat__meta b {
	color: var(--rc-accent);
	font-weight: 650;
	font-variant-numeric: tabular-nums;
}

.ripchat__header-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
}

.ripchat__ghost {
	appearance: none;
	border: 1px solid var(--rc-line);
	background: var(--rc-bg-soft);
	color: var(--rc-text-2);
	font: inherit;
	font-size: 12px;
	line-height: 1;
	padding: 7px 10px;
	border-radius: 10px;
	cursor: pointer;
	transition: all 0.16s ease;
}

.ripchat__ghost:hover {
	color: var(--rc-accent);
	border-color: rgba(var(--rc-accent-rgb), 0.35);
	background: var(--rc-accent-soft);
}

.ripchat__sound span {
	display: block;
	font-size: 13px;
}

.ripchat__sound.is-off {
	opacity: 0.55;
}

/* ---------- 欢迎语 ---------- */

.ripchat__welcome {
	flex: 0 0 auto;
	padding: 9px 18px;
	font-size: 12.5px;
	color: var(--rc-text-2);
	background: linear-gradient(90deg, rgba(var(--rc-accent-rgb), 0.07), transparent 70%);
	border-bottom: 1px solid var(--rc-line);
	line-height: 1.5;
}

/* ---------- 消息流 ---------- */

.ripchat__stream {
	position: relative;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 8px 16px 14px;
	background: transparent;
	scrollbar-width: thin;
	scrollbar-color: var(--rc-line) transparent;
	overscroll-behavior: contain;
}

.ripchat__stream::-webkit-scrollbar {
	width: 8px;
}

.ripchat__stream::-webkit-scrollbar-thumb {
	background: var(--rc-line);
	border-radius: 8px;
}

.ripchat__stream::-webkit-scrollbar-track {
	background: transparent;
}

.ripchat__topbox {
	display: flex;
	justify-content: center;
	padding: 4px 0 8px;
	min-height: 8px;
	flex: 0 0 auto;
}

.ripchat__more,
.ripchat__top-hint {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--rc-text-2);
	font: inherit;
	font-size: 12px;
	padding: 4px 10px;
	border-radius: 8px;
	cursor: pointer;
}

.ripchat__more:hover {
	background: var(--rc-bg-soft);
	color: var(--rc-accent);
}

.ripchat__list {
	display: flex;
	flex-direction: column;
	flex: 0 0 auto;
	margin-top: auto;
}

.ripchat__list:empty {
	margin-top: 0;
}

/* 单条消息 */

.ripchat__msg {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 5px 0;
	animation: rc-in 0.22s ease both;
}

@keyframes rc-in {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

.ripchat__msg.is-mine {
	flex-direction: row-reverse;
}

.ripchat__avatar {
	width: 38px;
	height: 38px;
	border-radius: 13px;
	object-fit: cover;
	flex: 0 0 auto;
	background: var(--rc-bg-soft);
	border: 1px solid var(--rc-line);
}

.ripchat__msg.is-grouped .ripchat__avatar {
	visibility: hidden;
	height: 0;
	margin-top: 2px;
}

.ripchat__body {
	min-width: 0;
	max-width: min(78%, 520px);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.ripchat__msg.is-mine .ripchat__body {
	align-items: flex-end;
}

.ripchat__meta-line {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 2px 4px;
	font-size: 11.5px;
	color: var(--rc-text-2);
	flex-wrap: wrap;
}

.ripchat__msg.is-mine .ripchat__meta-line {
	justify-content: flex-end;
}

.ripchat__msg.is-grouped .ripchat__meta-line {
	display: none;
}

.ripchat__name {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--rc-text);
	text-decoration: none;
}

.ripchat__name:hover {
	color: var(--rc-accent);
}

.ripchat__badge {
	display: inline-flex;
	align-items: center;
	height: 16px;
	padding: 0 6px;
	border-radius: 6px;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: #fff;
	background: linear-gradient(135deg, #f59e0b, #ef4444);
	box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

.ripchat__time {
	font-variant-numeric: tabular-nums;
	opacity: 0.8;
}

.ripchat__bubble {
	position: relative;
	padding: 9px 13px;
	border-radius: 15px;
	border-top-left-radius: 5px;
	background: var(--rc-bubble);
	color: var(--rc-bubble-text);
	font-size: 14px;
	line-height: 1.62;
	word-break: break-word;
	overflow-wrap: anywhere;
	max-width: 100%;
}

.ripchat__bubble--media {
	padding: 4px;
	line-height: 0;
}

.ripchat__msg.is-mine .ripchat__bubble {
	border-radius: 15px;
	border-top-right-radius: 5px;
	background: linear-gradient(135deg, var(--rc-accent), var(--rc-accent-2));
	color: #fff;
	box-shadow: 0 6px 18px rgba(var(--rc-accent-rgb), 0.28);
}

.ripchat__text {
	margin: 0;
	white-space: pre-wrap;
	word-break: break-word;
}

.ripchat__mention {
	color: var(--rc-accent);
	font-weight: 600;
	background: rgba(var(--rc-accent-rgb), 0.1);
	border-radius: 5px;
	padding: 0 2px;
}

.ripchat__msg.is-mine .ripchat__mention {
	color: #fff;
	background: rgba(255, 255, 255, 0.22);
}

.ripchat__bubble img.ripchat__image {
	display: block;
	max-width: 240px;
	max-height: 240px;
	width: auto;
	border-radius: 10px;
	cursor: zoom-in;
	margin: 2px 0;
	background: var(--rc-bg-soft);
}

.ripchat__msg.is-mine .ripchat__bubble--media {
	background: transparent;
	box-shadow: none;
	padding: 0;
}

.ripchat__del {
	align-self: center;
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--rc-text-2);
	font: inherit;
	font-size: 11px;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.15s ease;
	padding: 2px 4px;
	border-radius: 6px;
	flex: 0 0 auto;
}

.ripchat__msg:hover .ripchat__del {
	opacity: 0.7;
}

.ripchat__del:hover {
	opacity: 1;
	color: #ef4444;
	background: rgba(239, 68, 68, 0.08);
}

.ripchat__msg.is-removed .ripchat__bubble {
	opacity: 0.5;
	font-style: italic;
}

/* 空状态 / 加载 */

.ripchat__empty {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 60px 20px;
	margin: auto 0;
	color: var(--rc-text-2);
	font-size: 13px;
	text-align: center;
	flex: 0 0 auto;
}

.ripchat__empty.is-visible {
	display: flex;
}

.ripchat__empty-emoji {
	font-size: 34px;
	opacity: 0.85;
}

.ripchat__empty p {
	margin: 0;
}

.ripchat__loading {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: rgba(var(--rc-surface), 0.94);
	color: var(--rc-text-2);
	font-size: 12.5px;
	transition: opacity 0.25s ease;
	z-index: 2;
}

.ripchat__loading.is-hidden {
	opacity: 0;
	pointer-events: none;
}

.ripchat__spinner {
	width: 15px;
	height: 15px;
	border-radius: 50%;
	border: 2px solid var(--rc-line);
	border-top-color: var(--rc-accent);
	animation: rc-spin 0.7s linear infinite;
	display: inline-block;
}

@keyframes rc-spin {
	to { transform: rotate(360deg); }
}

.ripchat__jump {
	position: sticky;
	bottom: 6px;
	left: 50%;
	transform: translateX(-50%);
	appearance: none;
	border: 1px solid var(--rc-line);
	background: var(--rc-bg);
	color: var(--rc-accent);
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	padding: 6px 14px;
	border-radius: 999px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
	cursor: pointer;
	z-index: 4;
	margin: 0 auto;
	display: block;
}

.ripchat__jump[hidden] {
	display: none;
}

/* ---------- 禁言提示 ---------- */

.ripchat__mute {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	font-size: 12.5px;
	color: #b45309;
	background: #fffbeb;
	border-top: 1px solid #fde68a;
}

.ripchat[data-theme="dark"] .ripchat__mute {
	background: #2a2113;
	border-color: #4a3a1a;
	color: #fbbf24;
}

/* ---------- 输入区 ---------- */

.ripchat__composer {
	position: relative;
	flex: 0 0 auto;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 8px;
	padding: 11px 14px 13px;
	border-top: 1px solid var(--rc-line);
	background: transparent;
}

.ripchat__pending {
	order: -1;
	flex: 0 0 100%;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 2px 0 4px;
}

.ripchat__pending[hidden] {
	display: none;
}

.ripchat__pending-item {
	position: relative;
	width: 52px;
	height: 52px;
	border-radius: 12px;
	border: 1px solid var(--rc-line);
	background: var(--rc-bg-soft);
	flex: 0 0 auto;
}

.ripchat__pending-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 11px;
}

.ripchat__pending-badge {
	position: absolute;
	left: 3px;
	bottom: 3px;
	padding: 1px 5px;
	border-radius: 6px;
	background: rgba(15, 23, 42, 0.62);
	color: #fff;
	font-size: 10px;
	line-height: 1.5;
}

.ripchat__pending-remove {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 18px;
	height: 18px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(15, 23, 42, 0.74);
	color: #fff;
	font-size: 13px;
	line-height: 1;
	display: grid;
	place-items: center;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.28);
}

.ripchat__pending-remove:hover {
	background: var(--rc-accent);
}

.ripchat__pending-hint {
	font-size: 11.5px;
	color: var(--rc-text-2);
}

.ripchat__tools {
	display: flex;
	align-items: center;
	gap: 2px;
	padding-bottom: 7px;
	flex: 0 0 auto;
}

.ripchat__tool {
	appearance: none;
	border: 0;
	background: transparent;
	font-size: 16px;
	line-height: 1;
	width: 30px;
	height: 30px;
	border-radius: 9px;
	cursor: pointer;
	color: var(--rc-text-2);
	transition: background 0.15s ease, transform 0.15s ease;
	display: grid;
	place-items: center;
	padding: 0;
}

.ripchat__tool:hover {
	background: var(--rc-bg-soft);
	transform: translateY(-1px);
}

.ripchat__tool.is-active {
	background: var(--rc-accent-soft);
}

.ripchat__field {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	background: var(--rc-bg-soft);
	border: 1px solid var(--rc-line);
	border-radius: 14px;
	padding: 8px 12px 6px;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ripchat__field.is-focus {
	border-color: rgba(var(--rc-accent-rgb), 0.55);
	box-shadow: 0 0 0 3px rgba(var(--rc-accent-rgb), 0.12);
	background: var(--rc-bg);
}

.ripchat__textarea {
	display: block;
	width: 100%;
	min-height: 24px;
	max-height: 132px;
	border: 0;
	outline: 0;
	background: transparent;
	resize: none;
	font: inherit;
	font-size: 14px;
	line-height: 1.5;
	color: var(--rc-text);
	padding: 0;
	margin: 0;
	overflow-y: auto;
	box-shadow: none;
}

.ripchat__textarea::placeholder {
	color: var(--rc-text-2);
	opacity: 0.75;
}

.ripchat__count {
	display: block;
	text-align: right;
	font-size: 10.5px;
	color: var(--rc-text-2);
	opacity: 0;
	height: 0;
	overflow: hidden;
	transition: opacity 0.15s ease;
	font-variant-numeric: tabular-nums;
}

.ripchat__field.is-tight .ripchat__count {
	opacity: 0.85;
	height: auto;
}

.ripchat__field.is-tight .ripchat__count.is-over {
	color: #ef4444;
}

.ripchat__send {
	appearance: none;
	border: 0;
	flex: 0 0 auto;
	height: 38px;
	padding: 0 18px;
	margin-bottom: 1px;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--rc-accent), var(--rc-accent-2));
	color: #fff;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 6px 16px rgba(var(--rc-accent-rgb), 0.32);
	transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.ripchat__send:hover {
	transform: translateY(-1px);
	box-shadow: 0 9px 22px rgba(var(--rc-accent-rgb), 0.4);
}

.ripchat__send:active {
	transform: translateY(0);
}

.ripchat__send:disabled,
.ripchat__send.is-loading {
	opacity: 0.6;
	cursor: default;
	transform: none;
}

.ripchat__send.is-loading::after {
	content: "";
	display: inline-block;
	width: 11px;
	height: 11px;
	margin-left: 6px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	animation: rc-spin 0.7s linear infinite;
	vertical-align: -1px;
}

/* 游客提示 */

.ripchat__guest {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 14px 18px;
	border-top: 1px solid var(--rc-line);
	font-size: 12.5px;
	color: var(--rc-text-2);
	background: transparent;
}

.ripchat-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 42px;
	padding: 0 20px;
	border-radius: 12px;
	border: 1px solid var(--rc-line);
	background: var(--rc-bg);
	color: var(--rc-text);
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.18s ease;
	line-height: 1;
}

.ripchat-btn:hover {
	border-color: rgba(var(--rc-accent-rgb), 0.4);
	color: var(--rc-accent);
}

.ripchat-btn--primary {
	background: linear-gradient(135deg, var(--rc-accent), var(--rc-accent-2));
	border-color: transparent;
	color: #fff;
	box-shadow: 0 8px 20px rgba(var(--rc-accent-rgb), 0.3);
}

.ripchat-btn--primary:hover {
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 12px 26px rgba(var(--rc-accent-rgb), 0.38);
}

.ripchat-btn--sm {
	height: 32px;
	padding: 0 14px;
	font-size: 12.5px;
	border-radius: 9px;
}

/* ---------- 弹出层 ---------- */

.ripchat__popover {
	position: absolute;
	bottom: calc(100% + 10px);
	left: 14px;
	z-index: 20;
	background: var(--rc-bg);
	border: 1px solid var(--rc-line);
	border-radius: 16px;
	box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
	animation: rc-pop 0.18s ease both;
}

@keyframes rc-pop {
	from { opacity: 0; transform: translateY(6px) scale(0.98); }
	to { opacity: 1; transform: none; }
}

.ripchat__popover[hidden] {
	display: none;
}

.ripchat__emoji {
	width: min(320px, calc(100vw - 60px));
	padding: 8px;
	display: grid;
	grid-template-columns: repeat(8, 1fr);
	gap: 2px;
}

.ripchat__emoji button {
	appearance: none;
	border: 0;
	background: transparent;
	font-size: 19px;
	line-height: 1;
	padding: 6px 0;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.12s ease, transform 0.12s ease;
}

.ripchat__emoji button:hover {
	background: var(--rc-bg-soft);
	transform: scale(1.15);
}

.ripchat__mentions {
	min-width: 190px;
	max-width: 260px;
	max-height: 268px;
	overflow-y: auto;
	padding: 6px;
}

.ripchat__mention-title {
	padding: 6px 8px 4px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--rc-text-2);
}

.ripchat__mention-title:not(:first-child) {
	margin-top: 4px;
	padding-top: 9px;
	border-top: 1px solid var(--rc-line);
}

.ripchat__mentions button {
	appearance: none;
	border: 0;
	background: transparent;
	width: 100%;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	border-radius: 10px;
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	color: var(--rc-text);
	text-align: left;
}

.ripchat__mentions button:hover {
	background: var(--rc-bg-soft);
}

.ripchat__mentions img {
	width: 22px;
	height: 22px;
	border-radius: 7px;
	object-fit: cover;
	flex: 0 0 auto;
}

.ripchat__mentions .ripchat-mention-empty {
	padding: 10px;
	font-size: 12px;
	color: var(--rc-text-2);
	text-align: center;
}

/* 图片发送面板 */

.ripchat__imgpop {
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: min(304px, calc(100vw - 40px));
	padding: 10px;
}

.ripchat__imgtabs {
	display: flex;
	gap: 3px;
	padding: 3px;
	background: var(--rc-bg-soft);
	border-radius: 9px;
}

.ripchat__imgtabs button {
	flex: 1 1 0;
	appearance: none;
	border: 0;
	background: transparent;
	padding: 6px 8px;
	border-radius: 7px;
	font: inherit;
	font-size: 12px;
	color: var(--rc-text-2);
	cursor: pointer;
}

.ripchat__imgtabs button.is-active {
	background: var(--rc-bg);
	color: var(--rc-text);
	font-weight: 600;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.ripchat__imgpane {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ripchat__imgpane[hidden] {
	display: none;
}

.ripchat__full-btn {
	width: 100%;
}

.ripchat__url {
	width: 100%;
	height: 34px;
	padding: 0 10px;
	border: 1px solid var(--rc-line);
	border-radius: 9px;
	background: var(--rc-bg-soft);
	color: var(--rc-text);
	font: inherit;
	font-size: 12.5px;
	outline: 0;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ripchat__url:focus {
	border-color: rgba(var(--rc-accent-rgb), 0.5);
	box-shadow: 0 0 0 3px rgba(var(--rc-accent-rgb), 0.12);
	background: var(--rc-bg);
}

.ripchat__url-preview {
	display: flex;
	align-items: center;
	justify-content: center;
	max-height: 140px;
	border-radius: 9px;
	overflow: hidden;
	background: var(--rc-bg-soft);
	border: 1px solid var(--rc-line);
}

.ripchat__url-preview[hidden] {
	display: none;
}

.ripchat__url-preview img {
	display: block;
	max-width: 100%;
	max-height: 140px;
	object-fit: contain;
}

.ripchat__tip {
	margin: 0;
	font-size: 10.5px;
	line-height: 1.5;
	color: var(--rc-text-2);
}

.ripchat__tip.is-error {
	color: #ef4444;
}

/* ---------- 成员抽屉 ---------- */

.ripchat__members {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(280px, 82%);
	background: var(--rc-bg);
	border-left: 1px solid var(--rc-line);
	box-shadow: -18px 0 40px rgba(15, 23, 42, 0.14);
	z-index: 30;
	display: flex;
	flex-direction: column;
	animation: rc-slide 0.22s ease both;
}

@keyframes rc-slide {
	from { transform: translateX(100%); }
	to { transform: none; }
}

.ripchat__members[hidden] {
	display: none;
}

.ripchat__members-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid var(--rc-line);
	font-size: 13px;
}

.ripchat__members-head strong {
	font-weight: 650;
}

.ripchat__members-close {
	appearance: none;
	border: 0;
	background: transparent;
	cursor: pointer;
	color: var(--rc-text-2);
	font-size: 14px;
	line-height: 1;
	padding: 4px;
	border-radius: 6px;
}

.ripchat__members-close:hover {
	color: var(--rc-text);
	background: var(--rc-bg-soft);
}

.ripchat__members-list {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 8px;
}

.ripchat__member {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 7px 8px;
	border-radius: 10px;
	font-size: 13px;
	color: var(--rc-text);
}

.ripchat__member:hover {
	background: var(--rc-bg-soft);
}

.ripchat__member img {
	width: 28px;
	height: 28px;
	border-radius: 9px;
	object-fit: cover;
}

.ripchat__member .ripchat__member-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #22c55e;
	margin-left: auto;
	flex: 0 0 auto;
}

/* ---------- Toast ---------- */

.ripchat__toast {
	position: absolute;
	left: 50%;
	bottom: 88px;
	transform: translateX(-50%);
	z-index: 40;
	background: rgba(17, 24, 39, 0.9);
	color: #fff;
	font-size: 12.5px;
	padding: 8px 16px;
	border-radius: 999px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	animation: rc-pop 0.2s ease both;
	max-width: 80%;
	text-align: center;
}

.ripchat__toast[hidden] {
	display: none;
}

/* ---------- 登录锁定态 ---------- */

.ripchat--locked {
	max-width: 720px;
}

.ripchat-lock {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 10px;
	padding: 56px 28px;
	background: var(--rc-bg);
	border: 1px solid var(--rc-line);
	border-radius: var(--rc-radius);
	box-shadow: var(--rc-shadow);
}

.ripchat-lock__icon {
	width: 62px;
	height: 62px;
	display: grid;
	place-items: center;
	font-size: 28px;
	border-radius: 20px;
	background: var(--rc-accent-soft);
	margin-bottom: 4px;
}

.ripchat-lock__title {
	margin: 0;
	font-size: 18px;
	font-weight: 650;
	color: var(--rc-text);
}

.ripchat-lock__desc {
	margin: 0;
	font-size: 13px;
	color: var(--rc-text-2);
}

.ripchat-lock__actions {
	display: flex;
	gap: 10px;
	margin-top: 12px;
	flex-wrap: wrap;
	justify-content: center;
}

.ripchat--notice {
	padding: 18px 20px;
	border: 1px dashed var(--rc-line);
	border-radius: 14px;
	color: var(--rc-text-2);
	font-size: 13px;
	background: var(--rc-bg-soft);
}

/* ---------- 图片灯箱 ---------- */

.ripchat-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
	background: rgba(8, 12, 20, 0.82);
	backdrop-filter: blur(6px);
	cursor: zoom-out;
	animation: rc-fade 0.18s ease both;
}

@keyframes rc-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

.ripchat-lightbox[hidden] {
	display: none;
}

.ripchat-lightbox img {
	max-width: 92vw;
	max-height: 88vh;
	border-radius: 14px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
	background: #fff;
}

/* ---------- 悬浮窗 ---------- */

.ripchat-fab {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99990;
}

.ripchat-fab__trigger {
	position: relative;
	appearance: none;
	border: 0;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	color: #fff;
	background: linear-gradient(135deg, var(--rc-accent), var(--rc-accent-2));
	box-shadow: 0 14px 34px rgba(var(--rc-accent-rgb), 0.42);
	cursor: pointer;
	transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
	padding: 0;
}

.ripchat-fab__trigger:hover {
	transform: translateY(-2px) scale(1.04);
	box-shadow: 0 18px 42px rgba(var(--rc-accent-rgb), 0.5);
}

.ripchat-fab__trigger svg {
	width: 26px;
	height: 26px;
}

.ripchat-fab__dot {
	position: absolute;
	top: -2px;
	right: -2px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: #ef4444;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	border: 2px solid #fff;
	box-shadow: 0 3px 10px rgba(239, 68, 68, 0.4);
}

.ripchat-fab[data-theme="dark"] .ripchat-fab__dot,
.ripchat-fab[data-theme="auto"] .ripchat-fab__dot {
	border-color: rgba(15, 20, 32, 0.9);
}

.ripchat-fab__panel {
	position: fixed;
	right: 24px;
	bottom: 92px;
	width: 384px;
	height: min(620px, calc(100vh - 130px));
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
	animation: rc-fab-in 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
	background: var(--rc-bg);
}

@keyframes rc-fab-in {
	from { opacity: 0; transform: translateY(14px) scale(0.97); }
	to { opacity: 1; transform: none; }
}

.ripchat-fab__panel[hidden] {
	display: none;
}

.ripchat-fab__panel .ripchat {
	height: 100%;
}

.ripchat-fab__panel .ripchat__shell {
	border-radius: 20px;
	box-shadow: none;
	border: 0;
	height: 100%;
}

.ripchat-fab__panel .ripchat__title {
	font-size: 14px;
}

.ripchat-fab__panel .ripchat__composer {
	padding: 9px 10px 11px;
	gap: 6px;
}

.ripchat-fab__panel .ripchat__tool {
	width: 26px;
	height: 26px;
	font-size: 14px;
}

.ripchat-fab__panel .ripchat__pending-item {
	width: 44px;
	height: 44px;
}

.ripchat-fab__panel .ripchat__pending-hint {
	display: none;
}

.ripchat-fab__panel .ripchat__send {
	height: 36px;
	padding: 0 14px;
}

.ripchat-fab__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 50;
	appearance: none;
	border: 0;
	width: 26px;
	height: 26px;
	border-radius: 8px;
	background: var(--rc-bg-soft);
	color: var(--rc-text-2);
	font-size: 12px;
	cursor: pointer;
	display: none;
}

/* ---------- 响应式 ---------- */

@media (max-width: 782px) {
	.ripchat[data-mode="page"] {
		--rc-height: 78vh !important;
	}

	.ripchat__shell {
		border-radius: 16px;
	}

	.ripchat__header {
		padding: 11px 13px;
	}

	.ripchat__stream {
		padding: 6px 11px 10px;
	}

	.ripchat__bubble {
		font-size: 14px;
	}

	.ripchat__avatar {
		width: 33px;
		height: 33px;
		border-radius: 11px;
	}

	.ripchat__body {
		max-width: 82%;
	}

	.ripchat__tools {
		gap: 0;
	}

	.ripchat__tool {
		width: 27px;
		height: 27px;
		font-size: 15px;
	}

	.ripchat__send {
		padding: 0 14px;
		height: 36px;
	}

	.ripchat__emoji {
		grid-template-columns: repeat(8, 1fr);
	}

	.ripchat-fab {
		right: 16px;
		bottom: 16px;
	}

	.ripchat-fab[data-mobile="0"] {
		display: none;
	}

	.ripchat-fab__panel {
		right: 0;
		bottom: 0;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		border-radius: 0;
		z-index: 99995;
	}

	.ripchat-fab__panel .ripchat__shell {
		border-radius: 0;
	}

	.ripchat-fab__close {
		display: grid;
		place-items: center;
	}
}

@media (max-width: 420px) {
	.ripchat__tool[data-ripchat-mention-btn] {
		display: none;
	}

	.ripchat__send span {
		display: none;
	}

	.ripchat__send {
		width: 40px;
		padding: 0;
	}

	.ripchat__send::before {
		content: "↑";
		font-size: 16px;
		font-weight: 700;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ripchat *,
	.ripchat-fab * {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}
