:root {
	--dm-blue: #087fcf;
	--dm-blue-dark: #066daf;
	--dm-blue-soft: #eaf4fd;
	--dm-coral: #cf766f;
	--dm-ink: #20252b;
	--dm-muted: #727980;
	--dm-line: #e4e7ea;
	--dm-surface: #f7f8f9;
}

[hidden] { display: none !important; }

body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.damoxing-content {
	flex: 1 0 auto;
	width: min(1440px, 100%);
	padding: 0px 0 22px;
	background: #fff;
}

.dm-chat-shell {
	height: clamp(620px, calc(100vh - 270px), 780px);
	display: grid;
	grid-template-columns: 270px minmax(0, 1fr);
	align-items: stretch;
	border: 1px solid var(--dm-line);
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

.dm-sidebar {
	height: 100%;
	min-height: 0;
	box-sizing: border-box;
	padding: 32px 24px;
	border-right: 1px solid var(--dm-line);
	background: #fbfbfb;
	overflow: hidden;
}

.dm-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 28px;
}

.dm-brand img,
.dm-empty img,
.dm-avatar img {
	display: block;
	object-fit: contain;
}

.dm-brand strong {
	font-size: 23px;
	font-weight: 700;
	letter-spacing: .02em;
}

.dm-new-chat {
	width: 100%;
	height: 50px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	border: 0;
	border-radius: 7px;
	color: #fff;
	background: var(--dm-blue);
	font: 500 17px/1 "Microsoft Yahei", sans-serif;
	cursor: pointer;
	transition: background-color .18s ease, transform .18s ease;
}

.dm-new-chat:hover { background: var(--dm-blue-dark); }
.dm-new-chat:active { transform: translateY(1px); }

.dm-privacy {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 24px 4px 0;
	color: #60676e;
	font-size: 14px;
	line-height: 1.5;
}

.dm-workspace {
	position: relative;
	min-width: 0;
	min-height: 0;
	height: 100%;
	box-sizing: border-box;
	display: grid;
	grid-template-rows: minmax(0, 1fr) auto auto auto;
	padding: 0 32px 22px;
	overflow: hidden;
}

.dm-messages {
	min-height: 0;
	overflow-x: hidden;
	overflow-y: scroll;
	padding: 38px 14px 28px 6px;
	scrollbar-gutter: stable;
	scrollbar-width: thin;
	scrollbar-color: #aebbc5 #f2f4f6;
}

.dm-messages::-webkit-scrollbar { width: 10px; }
.dm-messages::-webkit-scrollbar-track { background: #f2f4f6; border-radius: 10px; }
.dm-messages::-webkit-scrollbar-thumb { background: #aebbc5; border: 2px solid #f2f4f6; border-radius: 10px; }
.dm-messages::-webkit-scrollbar-thumb:hover { background: #8799a7; }

.dm-empty {
	max-width: 680px;
	margin: 72px auto 0;
	text-align: center;
}

.dm-empty h1 {
	margin: 18px 0 10px;
	color: var(--dm-ink);
	font-size: 30px;
	line-height: 1.3;
	font-weight: 700;
}

.dm-empty > p {
	margin: 0;
	color: var(--dm-muted);
	font-size: 16px;
}

.dm-prompts {
	max-width: 580px;
	margin: 34px auto 0;
	border-top: 1px solid var(--dm-line);
}

.dm-prompts button {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 12px;
	border: 0;
	border-bottom: 1px solid var(--dm-line);
	color: #464d54;
	background: transparent;
	font: 400 15px/1.5 "Microsoft Yahei", sans-serif;
	text-align: left;
	cursor: pointer;
	transition: color .18s ease, padding .18s ease;
}

.dm-prompts button:hover { color: var(--dm-blue); padding-left: 18px; }
.dm-message {
	display: flex;
	gap: 16px;
	max-width: 900px;
	margin: 0 auto 34px;
	animation: dm-message-in .2s ease-out both;
}

.dm-message--user {
	justify-content: flex-end;
	align-items: flex-start;
}

.dm-avatar {
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--dm-blue);
	color: #fff;
	font-size: 19px;
}

.dm-avatar--ai { background: transparent; border-radius: 8px; }

.dm-bubble {
	max-width: min(780px, calc(100% - 58px));
	padding: 17px 20px;
	border-radius: 8px;
	color: #30363c;
	background: var(--dm-surface);
	font-size: 16px;
	line-height: 1.8;
	white-space: pre-wrap;
	word-break: break-word;
}

.dm-message--assistant .dm-bubble {
	width: min(780px, calc(100% - 58px));
	max-width: none;
	padding: 3px 2px 10px;
	border-radius: 0;
	background: transparent;
	white-space: normal;
}

.dm-message--assistant .dm-bubble > :first-child { margin-top: 0; }
.dm-message--assistant .dm-bubble > :last-child { margin-bottom: 0; }

.dm-bubble p {
	margin: 0 0 16px;
}

.dm-bubble h2,
.dm-bubble h3,
.dm-bubble h4,
.dm-bubble h5,
.dm-bubble h6 {
	margin: 26px 0 12px;
	color: #19232c;
	line-height: 1.45;
	font-weight: 700;
}

.dm-bubble h2 { font-size: 22px; }
.dm-bubble h3 { font-size: 19px; }
.dm-bubble h4,
.dm-bubble h5,
.dm-bubble h6 { font-size: 17px; }

.dm-bubble ul,
.dm-bubble ol {
	margin: 9px 0 18px;
	padding-left: 26px;
}

.dm-bubble li {
	margin: 7px 0;
	padding-left: 3px;
}

.dm-bubble li::marker { color: var(--dm-blue); font-weight: 700; }

.dm-bubble blockquote {
	margin: 16px 0;
	padding: 12px 16px;
	border-left: 3px solid var(--dm-blue);
	border-radius: 0 6px 6px 0;
	color: #4d5b67;
	background: #f2f7fb;
}

.dm-bubble hr {
	height: 1px;
	margin: 24px 0;
	border: 0;
	background: var(--dm-line);
}

.dm-bubble a {
	color: var(--dm-blue-dark);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.dm-bubble code {
	padding: 2px 6px;
	border: 1px solid #dfe5e9;
	border-radius: 4px;
	color: #9c3b35;
	background: #f6f8f9;
	font: 14px/1.6 Consolas, monospace;
}

.dm-code-block {
	position: relative;
	margin: 17px 0 20px;
	padding-top: 32px;
	border: 1px solid #283845;
	border-radius: 8px;
	background: #17232d;
	overflow: hidden;
}

.dm-code-language {
	position: absolute;
	top: 7px;
	left: 15px;
	color: #9fb0bd;
	font: 12px/1.5 Consolas, monospace;
}

.dm-code-block pre {
	margin: 0;
	padding: 4px 16px 17px;
	overflow-x: auto;
}

.dm-code-block code {
	display: block;
	padding: 0;
	border: 0;
	color: #e6edf3;
	background: transparent;
	font-size: 14px;
	white-space: pre;
}

.dm-message--user .dm-bubble {
	order: -1;
	max-width: 70%;
	padding: 13px 18px;
	background: var(--dm-blue-soft);
	line-height: 1.65;
}

.dm-bubble.is-streaming::after {
	display: inline-block;
	width: 7px;
	height: 17px;
	margin-left: 3px;
	background: var(--dm-blue);
	vertical-align: -2px;
	content: "";
	animation: dm-caret .8s steps(2, start) infinite;
}

.dm-error {
	margin-top: 12px;
	color: #a33d36;
	font-size: 14px;
}

.dm-retry {
	margin-top: 12px;
	padding: 7px 13px;
	border: 1px solid #cbd2d8;
	border-radius: 5px;
	color: #3f474e;
	background: #fff;
	cursor: pointer;
}

.dm-composer {
	position: relative;
	z-index: 2;
	flex: 0 0 auto;
	display: flex;
	align-items: flex-end;
	gap: 14px;
	padding: 13px 13px 13px 20px;
	border: 1px solid #bfc5ca;
	border-radius: 9px;
	background: #fff;
	transition: border-color .18s ease, box-shadow .18s ease;
}

.dm-composer:focus-within {
	border-color: var(--dm-blue);
	box-shadow: 0 0 0 3px rgba(8, 127, 207, .11);
}

.dm-composer textarea {
	min-height: 28px;
	max-height: 140px;
	flex: 1;
	resize: none;
	overflow-y: auto;
	padding: 7px 0;
	border: 0;
	outline: 0;
	color: var(--dm-ink);
	background: transparent;
	font: 400 16px/1.6 "Microsoft Yahei", sans-serif;
}

.dm-composer textarea::placeholder { color: #9ba1a6; }

.dm-composer-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.dm-voice-launch {
	height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	padding: 0 13px;
	border: 1px solid #b9d5e8;
	border-radius: 7px;
	color: var(--dm-blue-dark);
	background: #f2f8fc;
	font: 500 14px/1 "Microsoft Yahei", sans-serif;
	cursor: pointer;
	transition: border-color .18s ease, background-color .18s ease, transform .18s ease, opacity .18s ease;
}

.dm-voice-launch svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.dm-voice-launch:hover:not(:disabled) {
	border-color: var(--dm-blue);
	background: var(--dm-blue-soft);
}

.dm-voice-launch:active:not(:disabled) { transform: translateY(1px); }
.dm-voice-launch:disabled { opacity: .42; cursor: not-allowed; }

.dm-stop {
	height: 43px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 0 14px;
	border: 1px solid #d4d9dd;
	border-radius: 6px;
	color: #4f565c;
	background: #fff;
	font: 400 14px/1 "Microsoft Yahei", sans-serif;
	cursor: pointer;
}

.dm-send {
	width: 64px;
	height: 48px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 7px;
	color: #fff;
	background: var(--dm-blue);
	font: 500 15px/1 "Microsoft Yahei", sans-serif;
	cursor: pointer;
	transition: background-color .18s ease, opacity .18s ease;
}

.dm-send:hover:not(:disabled) { background: var(--dm-blue-dark); }
.dm-send:disabled { opacity: .38; cursor: not-allowed; }

.dm-voice-panel {
	position: absolute;
	inset: 0;
	z-index: 12;
	min-width: 0;
	min-height: 0;
	box-sizing: border-box;
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto auto;
	padding: 24px 32px 20px;
	color: var(--dm-ink);
	background:
		radial-gradient(circle at 50% 43%, rgba(8, 127, 207, .13) 0, rgba(8, 127, 207, .05) 24%, transparent 48%),
		linear-gradient(155deg, #fbfdff 0%, #f3f8fb 58%, #ffffff 100%);
	overflow: hidden;
}

.dm-voice-panel::before,
.dm-voice-panel::after {
	position: absolute;
	pointer-events: none;
	content: "";
}

.dm-voice-panel::before {
	inset: 0;
	background-image: radial-gradient(rgba(8, 127, 207, .13) .7px, transparent .7px);
	background-size: 22px 22px;
	-webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .48), transparent 72%);
	mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .48), transparent 72%);
	opacity: .34;
}

.dm-voice-panel::after {
	width: 260px;
	height: 260px;
	right: -150px;
	bottom: -170px;
	border: 46px solid rgba(207, 118, 111, .07);
	border-radius: 50%;
}

.dm-voice-topbar,
.dm-voice-stage,
.dm-voice-controls,
.dm-voice-privacy {
	position: relative;
	z-index: 1;
}

.dm-voice-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

.dm-voice-mode-mark {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	color: #4d5c67;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .08em;
}

.dm-voice-mode-mark > span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--dm-coral);
	box-shadow: 0 0 0 5px rgba(207, 118, 111, .12);
}

.dm-voice-keyboard {
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0 14px;
	border: 1px solid #d6e1e8;
	border-radius: 20px;
	color: #4b5963;
	background: rgba(255, 255, 255, .8);
	font: 500 13px/1 "Microsoft Yahei", sans-serif;
	cursor: pointer;
	backdrop-filter: blur(8px);
}

.dm-voice-keyboard svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.dm-voice-keyboard:hover { border-color: #a8c7dc; color: var(--dm-blue-dark); }

.dm-voice-stage {
	min-height: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 18px 0 8px;
	text-align: center;
}

.dm-voice-kicker {
	margin-bottom: 18px;
	color: #72818c;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
}

.dm-voice-orb {
	position: relative;
	width: 176px;
	height: 176px;
	flex: 0 0 176px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.dm-voice-ring {
	position: absolute;
	inset: 0;
	border: 1px solid rgba(8, 127, 207, .18);
	border-radius: 50%;
}

.dm-voice-ring--middle { inset: 17px; border-color: rgba(8, 127, 207, .24); }

.dm-voice-orb-core {
	position: relative;
	width: 108px;
	height: 108px;
	display: grid;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, .72);
	border-radius: 50%;
	color: #fff;
	background: linear-gradient(145deg, #1593dd 0%, #087fcf 54%, #066bac 100%);
	box-shadow: 0 18px 46px rgba(8, 105, 170, .27), inset 0 1px 1px rgba(255, 255, 255, .32);
	transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}

.dm-voice-orb-core > svg {
	width: 38px;
	height: 38px;
	fill: currentColor;
	transition: opacity .18s ease, transform .18s ease;
}

.dm-voice-bars {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	opacity: 0;
	transition: opacity .18s ease;
}

.dm-voice-bars i {
	width: 4px;
	height: 20px;
	border-radius: 3px;
	background: currentColor;
	transform-origin: center;
}

.dm-voice-stage[data-state="connecting"] .dm-voice-ring--outer,
.dm-voice-stage[data-state="thinking"] .dm-voice-ring--outer {
	border-top-color: var(--dm-blue);
	border-right-color: transparent;
	animation: dm-voice-spin 1.25s linear infinite;
}

.dm-voice-stage[data-state="listening"] .dm-voice-ring--middle {
	animation: dm-voice-breathe 2.2s ease-in-out infinite;
}

.dm-voice-stage[data-state="hearing"] .dm-voice-ring--outer,
.dm-voice-stage[data-state="speaking"] .dm-voice-ring--outer {
	animation: dm-voice-wave 1.35s ease-out infinite;
}

.dm-voice-stage[data-state="hearing"] .dm-voice-orb-core,
.dm-voice-stage[data-state="speaking"] .dm-voice-orb-core {
	transform: scale(1.04);
	box-shadow: 0 22px 54px rgba(8, 105, 170, .34), inset 0 1px 1px rgba(255, 255, 255, .32);
}

.dm-voice-stage[data-state="speaking"] .dm-voice-orb-core > svg { opacity: 0; transform: scale(.8); }
.dm-voice-stage[data-state="speaking"] .dm-voice-bars { opacity: 1; }
.dm-voice-stage[data-state="speaking"] .dm-voice-bars i { animation: dm-voice-bar .75s ease-in-out infinite alternate; }
.dm-voice-stage[data-state="speaking"] .dm-voice-bars i:nth-child(2) { animation-delay: -.45s; }
.dm-voice-stage[data-state="speaking"] .dm-voice-bars i:nth-child(3) { animation-delay: -.2s; }
.dm-voice-stage[data-state="speaking"] .dm-voice-bars i:nth-child(4) { animation-delay: -.6s; }
.dm-voice-stage[data-state="speaking"] .dm-voice-bars i:nth-child(5) { animation-delay: -.3s; }

.dm-voice-stage[data-state="muted"] .dm-voice-orb-core {
	color: #73808a;
	background: linear-gradient(145deg, #edf1f3, #dce4e9);
	box-shadow: 0 14px 34px rgba(63, 79, 89, .16);
}

.dm-voice-stage[data-state="error"] .dm-voice-ring { border-color: rgba(207, 118, 111, .28); }
.dm-voice-stage[data-state="error"] .dm-voice-orb-core {
	background: linear-gradient(145deg, #d98a83, var(--dm-coral));
	box-shadow: 0 18px 44px rgba(166, 79, 72, .25);
}

.dm-voice-title {
	margin: 17px 0 7px;
	color: #1e303d;
	font-size: 24px;
	line-height: 1.35;
	font-weight: 700;
}

.dm-voice-hint {
	margin: 0;
	color: #71808b;
	font-size: 14px;
	line-height: 1.6;
}

.dm-voice-live {
	width: min(540px, 84%);
	min-height: 70px;
	box-sizing: border-box;
	margin-top: 19px;
	padding: 12px 18px 13px;
	border: 1px solid rgba(188, 207, 220, .72);
	border-radius: 12px;
	background: rgba(255, 255, 255, .72);
	box-shadow: 0 10px 34px rgba(46, 86, 113, .07);
	backdrop-filter: blur(10px);
}

.dm-voice-live-label {
	display: block;
	margin-bottom: 5px;
	color: var(--dm-blue-dark);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
}

.dm-voice-live-text {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	color: #485761;
	font-size: 14px;
	line-height: 1.65;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.dm-voice-controls {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 46px;
	padding-top: 8px;
}

.dm-voice-control {
	min-width: 70px;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 7px;
	border: 0;
	color: #596873;
	background: transparent;
	font: 400 12px/1.2 "Microsoft Yahei", sans-serif;
	cursor: pointer;
}

.dm-voice-control svg {
	width: 23px;
	height: 23px;
	box-sizing: content-box;
	padding: 13px;
	border: 1px solid #d3dfe6;
	border-radius: 50%;
	fill: currentColor;
	background: rgba(255, 255, 255, .9);
	box-shadow: 0 7px 22px rgba(52, 83, 104, .09);
	transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}

.dm-voice-control:hover:not(:disabled) svg { transform: translateY(-2px); border-color: #a8c8dc; }
.dm-voice-control:disabled { opacity: .42; cursor: not-allowed; }
.dm-voice-mic.is-muted svg { color: #fff; border-color: var(--dm-coral); background: var(--dm-coral); }
.dm-voice-exit { color: #a44f49; }
.dm-voice-exit svg { color: #fff; border-color: var(--dm-coral); background: var(--dm-coral); }

.dm-voice-privacy {
	margin: 12px 0 0;
	color: #89949c;
	font-size: 11px;
	line-height: 1.5;
	text-align: center;
}

.dm-voice-audio {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	pointer-events: none;
}

.dm-composer-meta {
	display: flex;
	justify-content: center;
	gap: 68px;
	padding: 13px 0 0;
	color: #888f95;
	font-size: 12px;
}

.sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

@keyframes dm-message-in {
	from { opacity: 0; transform: translateY(5px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes dm-caret { 50% { opacity: 0; } }

@keyframes dm-voice-spin {
	to { transform: rotate(360deg); }
}

@keyframes dm-voice-breathe {
	0%, 100% { transform: scale(.94); opacity: .62; }
	50% { transform: scale(1.06); opacity: 1; }
}

@keyframes dm-voice-wave {
	0% { transform: scale(.84); opacity: .7; }
	72%, 100% { transform: scale(1.12); opacity: 0; }
}

@keyframes dm-voice-bar {
	from { transform: scaleY(.48); }
	to { transform: scaleY(1.45); }
}

@media (prefers-reduced-motion: reduce) {
	.dm-message, .dm-bubble.is-streaming::after,
	.dm-voice-ring, .dm-voice-bars i { animation: none !important; }
	.dm-new-chat, .dm-prompts button, .dm-voice-launch,
	.dm-voice-orb-core, .dm-voice-control svg { transition: none; }
}

@media (max-width: 900px) {
	.damoxing-content { padding-top: 10px; }
	.dm-chat-shell {
		height: calc(100dvh - 150px);
		min-height: 560px;
		max-height: 760px;
		grid-template-columns: 1fr;
		grid-template-rows: auto minmax(0, 1fr);
		border-right: 0;
		border-left: 0;
		border-radius: 0;
	}
	.dm-sidebar {
		height: auto;
		display: grid;
		grid-template-columns: 1fr auto;
		align-items: center;
		gap: 14px;
		padding: 14px 18px;
		border-right: 0;
		border-bottom: 1px solid var(--dm-line);
	}
	.dm-brand { margin: 0; }
	.dm-brand img { width: 38px; height: 38px; }
	.dm-brand strong { font-size: 19px; }
	.dm-new-chat { width: auto; height: 42px; padding: 0 16px; font-size: 15px; }
	.dm-privacy { display: none; }
	.dm-workspace { min-height: 0; height: 100%; padding: 0 14px 18px; }
	.dm-messages { padding: 24px 0 18px; }
	.dm-empty { margin-top: 34px; }
	.dm-empty h1 { font-size: 25px; }
	.dm-message { gap: 9px; margin-bottom: 20px; }
	.dm-avatar { width: 34px; height: 34px; flex-basis: 34px; font-size: 15px; }
	.dm-avatar img { width: 34px; height: 34px; }
	.dm-bubble { max-width: calc(100% - 43px); padding: 13px 15px; font-size: 15px; }
	.dm-message--assistant .dm-bubble { width: calc(100% - 43px); padding: 2px 0 8px; }
	.dm-message--user .dm-bubble { max-width: 82%; }
	.dm-stop { padding: 0 12px; }
	.dm-voice-launch { width: 48px; padding: 0; }
	.dm-voice-launch span { display: none; }
	.dm-composer-meta { justify-content: space-between; gap: 12px; font-size: 11px; }
	.dm-voice-panel { padding: 18px 20px 16px; }
	.dm-voice-orb { width: 156px; height: 156px; flex-basis: 156px; }
	.dm-voice-orb-core { width: 98px; height: 98px; }
	.dm-voice-title { font-size: 22px; }
	.dm-voice-live { width: min(500px, 92%); }
}
