@font-face {
  font-family: 'FiraCode-Regular';
  src: url('./assets/fonts/Fira-Code/FiraCode-Regular-1.ttf');
}

@font-face {
  font-family: 'FiraCode-Light';
  src: url('./assets/fonts/Fira-Code/FiraCode-Light-4.ttf');
}

@font-face {
  font-family: 'FiraCode-Bold';
  src: url('./assets/fonts/Fira-Code/FiraCode-Bold-5.ttf');
}

@font-face {
  font-family: 'FiraCode-Medium';
  src: url('./assets/fonts/Fira-Code/FiraCode-Medium-3.ttf');
}

@font-face {
  font-family: 'FiraCode-Retina';
  src: url('./assets/fonts/Fira-Code/FiraCode-Retina-2.ttf');
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'FiraCode-Regular', Microsoft YaHei, sans-serif;
  overflow: hidden;
  padding: 0;
  margin: 0;
  background: linear-gradient(135deg, #1f1c2c, #928dab);
  color: #eee;
}

.container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  padding: 12px;
  text-align: center;
}

.header h1 {
  margin: 0;
  font-size: 2rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.nav {
  min-height: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
}

.nav .select-block {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-right: 8px;
}

.nav .select-block>p {
  margin: 0 8px 0 0;
  color: #ddd;
}

.content {
  flex: 1;
  height: 0;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 16px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
}

.card-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#chart-container {
  flex: 1;
  width: 100%;
  height: 0;
}

.metadata {
  font-family: 'Microsoft YaHei';
  overflow: auto;
  width: 100%;
  height: 100%;
  resize: none;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 12px;
  border-radius: 8px;
}

.testButton {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 8px 16px;
  border: none;
  background: linear-gradient(135deg, #00c6ff, #0072ff);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.testButton:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* 图表包装器 */
.chart-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
  height: 100%;
}

/* 配置切换按钮 */
.config-toggle-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.config-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.config-toggle-btn:active {
  transform: scale(0.95);
}

/* 配置卡片 */
.config-card {
  min-width: 400px;
  max-width: 500px;
  width: 400px;
  height: 100%;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  display: none;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.config-card.show {
  display: flex;
  animation: slideInRight 0.3s ease-out;
}

.config-card.hide {
  animation: slideOutRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* 配置卡片头部 */
.config-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.config-card-header h4 {
  margin: 0;
  color: #fff;
  font-family: 'FiraCode-Medium';
  font-size: 1.1rem;
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.4);
}

/* 配置关闭按钮 */
.config-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.config-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

/* 配置卡片内容 */
.config-card-content {
  flex: 1;
  padding: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 配置内容显示 */
.config-content {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  margin: 0;
  color: #e2e8f0;
  font-family: 'FiraCode-Regular', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  overflow: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  resize: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.config-content::-webkit-scrollbar {
  width: 6px;
}

.config-content::-webkit-scrollbar-track {
  background: transparent;
}

.config-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.config-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* JSON语法高亮 */
.config-content .json-key {
  color: #7dd3fc;
}

.config-content .json-string {
  color: #a7f3d0;
}

.config-content .json-number {
  color: #fbbf24;
}

.config-content .json-boolean {
  color: #fb7185;
}

.config-content .json-null {
  color: #94a3b8;
}

/* 响应式调整 */
@media (max-width: 1200px) {
  .chart-wrapper {
    flex-direction: column;
    gap: 12px;
  }
  
  .config-card {
    width: 100%;
    max-width: none;
    height: 300px;
  }
  
  .config-card.show {
    animation: slideInUp 0.3s ease-out;
  }
  
  .config-card.hide {
    animation: slideOutDown 0.3s ease-out;
  }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideOutDown {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(100%);
  }
}

#js-metadata {
  display: block;
}

#js-card {
  display: none;
}

/* 根据布局设置尺寸 */
#js-card[layout='sm-1*1'] {
  width: 293px;
  height: 293px;
}

#js-card[layout='sm-2*1'] {
  width: 602px;
  height: 293px;
}

#js-card[layout='sm-1*2'] {
  width: 293px;
  height: 602px;
}

#js-card[layout='lg-1*1'] {
  width: 602px;
  height: 602px;
}

#js-card[layout='lg-3*2'] {
  width: 911px;
  height: 602px;
}

#js-card[layout='474*267'] {
  width: 474px;
  height: 267px;
}

#js-card[layout='326*267'] {
  width: 326px;
  height: 267px;
}

/* 布局容器 */
.navbar-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 8px;
  background-color: linear-gradient(135deg, #1f1c2c, #928dab);
}

/* 每个项 */
.navbar-item {
  display: flex;
  align-items: center;
}

/* 标签样式 */
.navbar-label {
  margin-right: 8px;
  font-size: 14px;
  color: #fff;
}

/* 下拉选择框样式 */
.navbar-select {
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  font-size: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 鼠标悬停和聚焦效果 */
.navbar-select:hover,
.navbar-select:focus {
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
  outline: none;
}

/* 组件用例下拉框样式 */
.component-select-container {
  position: relative;
}

.component-select {
  max-width: 300px;
  width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hidden {
  display: none;
}

.component-search-wrapper {
  position: relative;
  width: 300px;
}

.component-search {
  width: 100%;
  padding: 6px 12px;
  padding-right: 30px; /* 为清除按钮留出空间 */
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  font-size: 14px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.component-search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  font-size: 16px;
  color: #999;
  cursor: pointer;
  display: none;
  transition: color 0.2s;
  z-index: 5;
}

.component-search-clear:hover {
  color: #f44336;
}

.component-search:focus {
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
  outline: none;
}

.component-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.component-group {
  margin-bottom: 8px;
}

.component-group-label {
  padding: 6px 12px;
  background-color: #f5f5f5;
  font-weight: bold;
  color: #333;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}

.component-option {
  padding: 8px 12px;
  cursor: pointer;
  color: #333;
  transition: background-color 0.2s;
}

.component-option:hover {
  background-color: #f0f7ff;
}

.component-no-results {
  padding: 10px;
  text-align: center;
  color: #666;
  font-style: italic;
}

.component-select option,
.component-select optgroup {
  max-width: 300px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 8px 6px;
}

.component-select option {
  padding-left: 15px;
}

/* 响应式样式调整 */
@media (max-width: 768px) {
  .component-select,
  .component-search-wrapper,
  .component-search {
    max-width: 200px;
    width: 200px;
  }
  
  .component-select option,
  .component-select optgroup {
    max-width: 200px;
  }
} 