:root {
  --primary-color: #2563eb;
  --secondary-color: #3b82f6;
  --light-bg: #f1f2f3;
  --dark-text: #1f2937;
  --light-text: #6b7280;
  --border-color: #e5e7eb;
  --card-bg: #ffffff;
  --success-color: #10b981;
  --danger-color: #ef4444;
}

* {
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--light-bg);
}

.container {
  box-sizing: border-box;
  width: 100%;
  min-width: 1240px;
  max-width: 1640px;
  margin: 25px auto;
  color: var(--dark-text);
}
.container *{
    box-sizing: border-box;
}
header {
  text-align: center;
  margin-bottom: 25px;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 5px;
  color: var(--primary-color);
}

.subtitle {
  font-size: 1rem;
  color: var(--light-text);
  max-width: 90%;
  margin: 0 auto;
}

.editor-container {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 20px;
  margin-bottom: 25px;
}

.panel {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 760px;
}

.panel-header {
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-editor {
  flex: 1;
  overflow: auto;
}

.CodeMirror {
  height: 100% !important;
  font-size: 15px;
  line-height: 1.5;
}

.preview {
  flex: 1;
  padding: 10px;
  overflow: auto;
  background: #f8fafc;
  width: 100%;
  height: 100%;
  position: relative;  /* 添加相对定位 */
}
.mermaid{
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
}

.preview-content {
  width: 100%;
  height: 100%;  /* 设置最小高度 */
}

.controls {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 25px;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.control-group, #widthInput, #heightInput{
  display: flex;
  flex-direction: column;
}

.control-label {
  font-weight: 600;
  font-size: 0.95rem;
  padding-bottom: 10px;
}

.radio-group {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
}

input[type="radio"] {
  accent-color: var(--primary-color);
}

input[type="number"],
select {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  width: 100%;
}

.buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--secondary-color);
}

.btn-secondary {
  background: #eef2ff;
  color: var(--primary-color);
}

.btn-secondary:hover {
  background: #e0e7ff;
}

.btn-danger {
  background: #fee2e2;
  color: var(--danger-color);
}

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

.features {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 20px;
  margin-bottom: 25px;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 25px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 15px;
  transition: transform 0.3s ease;
  border: 1px solid #eee;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.feature-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

footer {
  text-align: center;
  color: var(--light-text);
  font-size: 0.95rem;
  line-height: 1.75;
}

.error-message {
  color: var(--danger-color);
  padding: 10px;
  background: #fee2e2;
  border-radius: 8px;
  margin-top: 10px;
  display: none;
}

.hidden {
  display: none !important;
}
.code-editor textarea{
  border: 0;
  width: 100%;
}
.CodeMirror-scroll{
  margin: 0 !important;
  padding: 4px !important;
}
