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

body {
	font-family: 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	height: 100vh;
	overflow: hidden;
}

.container {
	display: flex;
	height: 100vh;
}

/* 左侧目录 */
.sidebar {
	width: 300px;
	background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
	color: #fff;
	overflow-y: auto;
	box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
	padding: 25px 20px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	font-size: 18px;
	font-weight: bold;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.category {
	margin-bottom: 10px;
}

.category-title {
	padding: 15px 20px;
	background: rgba(52, 73, 94, 0.8);
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-weight: bold;
	transition: all 0.3s ease;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.category-title:hover {
	background: rgba(93, 125, 143, 0.9);
	transform: translateX(5px);
}

.category-title::after {
	content: '▼';
	font-size: 12px;
	transition: transform 0.3s;
}

.category.collapsed .category-title::after {
	transform: rotate(-90deg);
}

.category-content {
	display: block;
}

.category.collapsed .category-content {
	display: none;
}

.question-item {
	padding: 12px 20px 12px 45px;
	cursor: pointer;
	border-left: 3px solid transparent;
	transition: all 0.3s ease;
	font-size: 14px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.9);
}

.question-item:hover {
	background: rgba(102, 126, 234, 0.3);
	border-left-color: #667eea;
	color: #fff;
	transform: translateX(3px);
}

.question-item.active {
	background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
	border-left-color: #fff;
	color: #fff;
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

/* 右侧内容区 */
.main-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: rgba(255, 255, 255, 0.95);
	margin: 0 15px 15px 15px;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.content-header {
	height: 55px;
	background: linear-gradient(90deg, #fff 0%, #f8f9fa 100%);
	border-bottom: 2px solid #e9ecef;
	display: flex;
	align-items: center;
	padding: 0 25px;
	flex-shrink: 0;
}

.content-title {
	font-size: 18px;
	font-weight: 600;
	color: #2c3e50;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.windows-container {
	flex: 1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	padding: 10px;
	min-height: 0;
	overflow: hidden;
}

.window-column {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 0;
	flex: 1;
}

.window {
	background: #fff;
	border-radius: 12px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
	border: 1px solid rgba(0, 0, 0, 0.05);
	flex: 1;
	min-height: 0;
}

.window-header {
	height: 45px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: #fff;
	display: flex;
	align-items: center;
	padding: 0 18px;
	font-weight: 600;
	flex-shrink: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.window-header.tutorial {
	background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.window-header.result {
	background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.window-header.editor {
	background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.window-header.test {
	background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.window-content {
	flex: 1;
	padding: 15px;
	overflow: auto;
	position: relative;
	min-height: 0;
}

/* 代码编辑器 */
.code-editor {
	width: 100%;
	height: 100%;
	font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
	font-size: 14px;
	line-height: 1.7;
	padding: 15px;
	border: none;
	outline: none;
	resize: none;
	background: #1e1e1e;
	color: #d4d4d4;
	min-height: 300px;
	border-radius: 0;
}

/* 教程内容样式 */
.tutorial-content {
	color: #2c3e50;
	line-height: 1.8;
}

.tutorial-content pre {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	padding: 15px;
	border-radius: 8px;
	overflow-x: auto;
	border-left: 4px solid #667eea;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	margin: 15px 0;
}

.tutorial-content code {
	background: rgba(102, 126, 234, 0.1);
	padding: 3px 8px;
	border-radius: 4px;
	font-family: 'Fira Code', 'Consolas', monospace;
	color: #667eea;
	font-size: 13px;
}

.tutorial-content pre code {
	background: none;
	padding: 0;
	color: #2c3e50;
}

.tutorial-content p {
	margin: 12px 0;
	line-height: 1.8;
	color: #444;
}

.tutorial-content h4 {
	margin: 20px 0 12px;
	color: #2c3e50;
	font-size: 16px;
	font-weight: 600;
}

/* 运行结果窗口 */
#iframeContainer {
	flex: 1;
	min-height: 0;
	overflow: auto;
}

#resultFrame {
	width: 100%;
	height: 100%;
	border: none;
	background: #fff;
}

/* 按钮样式 */
.btn {
	padding: 8px 20px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	transition: all 0.3s;
	margin: 5px;
}

.btn-primary {
	background: #3498db;
	color: #fff;
}

.btn-primary:hover {
	background: #2980b9;
}

.btn-success {
	background: #2ecc71;
	color: #fff;
}

.btn-success:hover {
	background: #27ae60;
}

.btn-warning {
	background: #f39c12;
	color: #fff;
}

.btn-warning:hover {
	background: #e67e22;
}

.btn-danger {
	background: #e74c3c;
	color: #fff;
}

.btn-danger:hover {
	background: #c0392b;
}

.btn-info {
	background: #17a2b8;
	color: #fff;
}

.btn-info:hover {
	background: #138496;
}

/* 测试结果 */
.test-result {
	padding: 15px;
	border-radius: 4px;
	margin-top: 10px;
}

.test-result.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.test-result.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.test-result.info {
	background: #d1ecf1;
	color: #0c5460;
	border: 1px solid #bee5eb;
}

/* 滚动条样式 */
::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}

::-webkit-scrollbar-track {
	background: rgba(0, 0, 0, 0.05);
	border-radius: 10px;
}

::-webkit-scrollbar-thumb {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
	background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* 结果窗口样式 */
.result-box {
	min-height: 100%;
}

/* CodeMirror 编辑器样式 */
#cmContainer .CodeMirror {
	height: 100% !important;
	font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
	font-size: 14px;
	line-height: 1.6;
	border-radius: 0;
}

.CodeMirror-hints {
	z-index: 9999;
	background: #272822;
	border: 1px solid #3d3d3d;
	border-radius: 4px;
	font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
	font-size: 13px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
	max-height: 200px;
	overflow-y: auto;
}

.CodeMirror-hint {
	color: #f8f8f2;
	padding: 6px 12px;
	margin: 2px 0;
	cursor: pointer;
}

.CodeMirror-hint:hover {
	background: #49483e;
	color: #fff;
}

.CodeMirror-hint-active {
	background: #49483e;
	color: #fff;
}

.CodeMirror-selected {
	background: #49483e !important;
}
