* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
	width: 100%;
	height: 100%;
	overflow: hidden;
}

body {
	font-family: system-ui, -apple-system, sans-serif;
	background: linear-gradient(135deg, #2d3436 0%, #636e72 100%);
	width: 100%;
	height: 100%;
	min-height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 20px;
	overflow: hidden;
}

/* 右上角主题切换按钮 */
.theme-btn {
	position: fixed;
	right: 16px;
	top: 16px;
	z-index: 61;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255,255,255,0.95);
	border: 1px solid rgba(0,0,0,0.08);
	font-size: 20px;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0,0,0,0.1);
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.theme-btn:hover {
	box-shadow: 0 8px 24px rgba(0,0,0,0.15);
	transform: scale(1.05);
}
body.dark-mode .theme-btn {
	background: rgba(20,25,35,0.85);
	border: 1px solid rgba(255,255,255,0.06);
}

/* 容器 */
.container {
	/* 左右两部分布局 */
	position: fixed;
	left: 50%;
	transform: translateX(-50%);
	top: 12px;
	z-index: 60;
	background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,250,0.94));
	padding: 16px 20px;
	max-width: 700px;
	width: auto;
	box-shadow: 0 10px 30px rgba(0,0,0,0.12);
	border-radius: 12px;
	border: 1px solid rgba(0,0,0,0.06);
	display: grid;
	grid-template-columns: 120px 1fr;
	gap: 20px;
	align-items: stretch;
}

/* 左侧：头像 + 名字（垂直居中） */
.left-panel {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

.avatar {
	width: 100px;
	height: 100px;
	border-radius: 50%;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 48px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.08);
	flex-shrink: 0;
}

.name {
	font-size: 18px;
	font-weight: bold;
	color: #333;
	margin: 0;
	letter-spacing: 0.5px;
	line-height: 1.3;
	text-align: center;
}

/* 右侧：上部时间/IP（横排） + 下部输入框 */
.right-panel {
	display: grid;
	grid-template-rows: auto 1fr;
	gap: 12px;
	align-items: stretch;
}

.info-top {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.info-item {
	margin: 0;
	text-align: left;
	padding: 12px 14px;
	background: #f5f5f5;
	border-radius: 8px;
	transition: all 0.2s ease;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 48px;
}

.info-item:hover {
	background: #efefef;
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.info-label {
	font-size: 11px;
	color: #999;
	text-transform: uppercase;
	margin-bottom: 4px;
	font-weight: 600;
	letter-spacing: 0.4px;
}

.info-value {
	font-size: 16px;
	color: #333;
	font-family: 'Monaco', 'Menlo', system-ui, -apple-system, sans-serif;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.3px;
}

.textarea-wrapper {
	margin: 0;
	display: flex;
	flex-direction: column;
	padding: 2px;
}

textarea {
	width: 100%;
	height: 120px;
	padding: 12px 14px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font-family: system-ui, -apple-system, sans-serif;
	font-size: 14px;
	resize: vertical;
	outline: none;
	transition: all 0.2s ease;
	line-height: 1.6;
	box-sizing: border-box;
	background: #ffffff;
}

textarea:focus {
	border-color: #636e72;
	box-shadow: 0 0 0 2px rgba(99, 110, 114, 0.1);
	background: #ffffff;
}

/* 白板（覆盖整页） */
#whiteboard {
	position: fixed;
	inset: 0;
	background: #ffffff;
	background-image:
		linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px),
		linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px);
	background-size: 40px 40px, 40px 40px;
	z-index: 0;
	overflow: hidden;
	-webkit-user-select: none;
	user-select: none;
}

/* 深色模式：改变白板与主要面板外观 */
body.dark-mode #whiteboard {
	background: #0d1117;
	background-image:
		linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px),
		linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
	background-size: 40px 40px, 40px 40px;
}
body.dark-mode .container {
	background: linear-gradient(180deg, rgba(18,22,26,0.95), rgba(24,28,34,0.92));
	border: 1px solid rgba(255,255,255,0.08);
	box-shadow: 0 10px 30px rgba(2,6,12,0.6);
}

body.dark-mode .name {
	color: #f0f6fc;
}

/* 深色模式下的信息项优化 */
body.dark-mode .info-item {
	background: linear-gradient(135deg, rgba(45,52,62,0.8), rgba(35,42,52,0.8));
	color: #e8f0f8;
	border: 1px solid rgba(255,255,255,0.1);
	box-shadow: inset 0 1px 2px rgba(255,255,255,0.05);
}

body.dark-mode .info-item:hover {
	background: linear-gradient(135deg, rgba(55,65,80,0.9), rgba(45,55,65,0.9));
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
	border: 1px solid rgba(255,255,255,0.15);
}

body.dark-mode .info-label {
	color: #a0a8b8;
	font-weight: 700;
}

body.dark-mode .info-value {
	color: #e8f0f8;
	font-weight: 600;
}

/* 深色模式下的输入框优化 */
body.dark-mode textarea {
	background: linear-gradient(180deg, rgba(30,35,45,0.5), rgba(25,30,40,0.5));
	color: #333;
	border: 1px solid rgba(255,255,255,0.12);
}

body.dark-mode textarea::placeholder {
	color: #6b7280;
}

body.dark-mode textarea:focus {
	background: linear-gradient(180deg, rgba(35,42,55,0.8), rgba(30,37,50,0.8));
	color: #e8f0f8;
	border: 1px solid rgba(100,200,255,0.3);
	box-shadow: 0 0 0 2px rgba(100, 200, 255, 0.15);
}

body.dark-mode textarea::-webkit-scrollbar {
	width: 8px;
}

body.dark-mode textarea::-webkit-scrollbar-track {
	background: transparent;
}

body.dark-mode textarea::-webkit-scrollbar-thumb {
	background: rgba(100, 200, 255, 0.2);
	border-radius: 4px;
}

body.dark-mode textarea::-webkit-scrollbar-thumb:hover {
	background: rgba(100, 200, 255, 0.4);
}

/* 白板提示 */
.board-hint {
	position: fixed;
	right: 12px;
	bottom: 12px;
	background: rgba(255,255,255,0.9);
	color: #333;
	padding: 8px 12px;
	border-radius: 8px;
	font-size: 13px;
	box-shadow: 0 6px 18px rgba(0,0,0,0.08);
	z-index: 30;
	transition: all 0.2s ease;
}

body.dark-mode .board-hint {
	background: rgba(20,25,35,0.92);
	color: #d0d8e8;
	border: 1px solid rgba(255,255,255,0.08);
	box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

/* 白板元素（文本/图片等） */
.board-item {
	position: absolute;
	transform-origin: center center;
	cursor: move;
	touch-action: none;
	user-select: none;
	transition: box-shadow .08s;
}

.board-item.selected {
	box-shadow: 0 8px 28px rgba(0,0,0,0.15);
	z-index: 40;
}

.board-item.text {
	min-width: 80px;
	min-height: 40px;
	padding: 8px;
	background: rgba(255,255,255,0.9);
	border-radius: 6px;
	border: 1px dashed rgba(0,0,0,0.08);
	font-size: 16px;
	color: #111;
	white-space: pre-wrap;
	word-break: break-word;
}

.board-item img {
	display: block;
	max-width: 420px;
	max-height: 320px;
	border-radius: 6px;
	height: auto;
	width: auto;
}

/* 白板元素在深色模式下的文本/边框 */
body.dark-mode .board-item.text {
	background: rgba(30,40,55,0.85);
	color: #e8f0f8;
	border: 1px dashed rgba(255,255,255,0.15);
	box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
body.dark-mode .board-item img { 
	filter: none;
	border-radius: 6px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

body.dark-mode .board-item.selected {
	box-shadow: 0 8px 28px rgba(100,200,255,0.2);
}

/* 缩放/旋转把手 */
.handle {
	position: absolute;
	width: 28px;
	height: 28px;
	background: #fff;
	border: 1px solid rgba(0,0,0,0.18);
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0,0,0,0.15);
	z-index: 60;
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	font-weight: bold;
	user-select: none;
	/* 逆向缩放：抵消父元素的缩放影响 */
	transform: scale(var(--handle-scale, 1));
}

.board-item.selected .handle {
	opacity: 1;
	pointer-events: auto;
	z-index: 100;
}

.handle-scale { 
	right: -14px; 
	bottom: -14px; 
	cursor: nwse-resize;
}

.handle-scale::before {
	content: '⤡';
	color: #4a9eff;
}

.handle-rotate { 
	right: -14px; 
	top: -14px; 
	cursor: grab;
}

.handle-rotate::before {
	content: '↻';
	color: #ff6b6b;
}

.board-item.selected .handle-scale {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
	border: 2px solid #fff;
	box-shadow: 0 2px 12px rgba(102, 126, 234, 0.5), 0 0 20px rgba(118, 75, 162, 0.3);
}

.board-item.selected .handle-scale::before {
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.board-item.selected .handle-rotate {
	background: linear-gradient(135deg, #f093fb 0%, #f5576c 50%, #ff6b6b 100%);
	border: 2px solid #fff;
	box-shadow: 0 2px 12px rgba(245, 87, 108, 0.5), 0 0 20px rgba(255, 107, 107, 0.3);
}

.board-item.selected .handle-rotate::before {
	color: #fff;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 把手悬停效果 */
.board-item.selected .handle-scale:hover {
	background: linear-gradient(135deg, #764ba2 0%, #667eea 50%, #f093fb 100%);
	box-shadow: 0 4px 16px rgba(102, 126, 234, 0.6), 0 0 28px rgba(118, 75, 162, 0.4);
	transform: scale(var(--handle-scale, 1)) scale(1.1);
	transition: all 0.2s ease;
}

.board-item.selected .handle-rotate:hover {
	background: linear-gradient(135deg, #f5576c 0%, #f093fb 50%, #ff6b6b 100%);
	box-shadow: 0 4px 16px rgba(245, 87, 108, 0.6), 0 0 28px rgba(255, 107, 107, 0.4);
	transform: scale(var(--handle-scale, 1)) scale(1.1);
	transition: all 0.2s ease;
}

/* 深色模式下的把手 */
body.dark-mode .handle {
	background: rgba(200, 220, 255, 0.9);
	border: 1px solid rgba(100, 200, 255, 0.4);
}

body.dark-mode .board-item.selected .handle-scale {
	background: linear-gradient(135deg, #4facfe 0%, #00f2fe 50%, #667eea 100%);
	border: 2px solid rgba(255, 255, 255, 0.95);
	box-shadow: 0 2px 12px rgba(79, 172, 254, 0.6), 0 0 24px rgba(0, 242, 254, 0.4);
}

body.dark-mode .board-item.selected .handle-scale::before {
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-mode .board-item.selected .handle-rotate {
	background: linear-gradient(135deg, #fa709a 0%, #fee140 50%, #ff6b6b 100%);
	border: 2px solid rgba(255, 255, 255, 0.95);
	box-shadow: 0 2px 12px rgba(250, 112, 154, 0.6), 0 0 24px rgba(255, 107, 107, 0.4);
}

body.dark-mode .board-item.selected .handle-rotate::before {
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* 深色模式下的把手悬停效果 */
body.dark-mode .board-item.selected .handle-scale:hover {
	background: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #667eea 100%);
	box-shadow: 0 4px 16px rgba(79, 172, 254, 0.7), 0 0 32px rgba(0, 242, 254, 0.5);
	transform: scale(var(--handle-scale, 1)) scale(1.1);
	transition: all 0.2s ease;
}

body.dark-mode .board-item.selected .handle-rotate:hover {
	background: linear-gradient(135deg, #fee140 0%, #fa709a 50%, #ff6b6b 100%);
	box-shadow: 0 4px 16px rgba(250, 112, 154, 0.7), 0 0 32px rgba(255, 107, 107, 0.5);
	transform: scale(var(--handle-scale, 1)) scale(1.1);
	transition: all 0.2s ease;
}

/* 文字可编辑时的样式 */
.board-item.text[contenteditable="true"] {
	outline: 2px dashed rgba(99,110,114,0.2);
}

@media (max-width: 800px) {
	.container {
		grid-template-columns: 90px 1fr;
		gap: 12px;
		padding: 14px 16px;
		max-width: 90vw;
	}

	.avatar {
		width: 80px;
		height: 80px;
		font-size: 36px;
	}

	.name {
		font-size: 16px;
	}

	.info-item {
		padding: 10px 12px;
		font-size: 13px;
		min-height: 44px;
	}

	textarea {
		height: 100px;
		font-size: 13px;
	}
}

@media (max-width: 600px) {
	.container {
		grid-template-columns: 1fr;
		gap: 10px;
		padding: 12px 14px;
		max-width: calc(100vw - 24px);
	}

	.left-panel {
		flex-direction: row;
		gap: 12px;
	}

	.avatar {
		width: 70px;
		height: 70px;
		font-size: 32px;
		flex-shrink: 0;
	}

	.name {
		font-size: 16px;
		align-self: center;
	}

	.right-panel {
		grid-template-rows: auto 1fr;
		gap: 10px;
	}

	.info-top {
		grid-template-columns: 1fr 1fr;
	}

	.info-item {
		padding: 10px;
		font-size: 13px;
		min-height: 40px;
	}

	textarea {
		height: 80px;
		font-size: 13px;
	}
}

@media (max-width: 400px) {
	.container {
		max-width: calc(100vw - 16px);
		padding: 10px 12px;
	}

	.avatar {
		width: 60px;
		height: 60px;
		font-size: 28px;
	}

	.name {
		font-size: 14px;
	}

	textarea {
		height: 70px;
	}
}
