/* ===== CSS变量定义 (Minimalist Palette) ===== */
:root {
  /* 明亮主题 */
  --primary-color: #005fcc;
  --primary-hover: #004c99;
  --secondary-color: #555555;
  --accent-color: #005fcc;
  --success-color: #2e6b27;
  --warning-color: #ff8800;
  --error-color: #d62f2f;
  
  /* 背景色 */
  --bg-primary: #ffffff;
  --bg-secondary: #f7f7f7;
  --bg-tertiary: #eeeeee;
  --bg-accent: #e0e0e0;
  
  /* 文字颜色 */
  --text-primary: #212121;
  --text-secondary: #555555;
  --text-tertiary: #888888;
  --text-muted: #aaaaaa;
  
  /* 边框颜色 */
  --border-primary: #e0e0e0;
  --border-secondary: #cccccc;
  --border-focus: #005fcc;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 4px 8px 0 rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 8px 16px 0 rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(0, 95, 204, 0.15);
  
  /* 字体 */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Source Code Pro', monospace;
  
  /* 尺寸 */
  --header-height: 64px;
  --sidebar-width: 320px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  
  /* 动画 */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.5s ease;
}

/* 暗黑主题 (Minimalist Palette) */
[data-theme="dark"] {
  --primary-color: #3b82f6;
  --primary-hover: #60a5fa;
  --secondary-color: #bbbbbb;
  --success-color: #30d158;
  --warning-color: #ffd60a;
  --error-color: #ff453a;

  /* 背景色 */
  --bg-primary: #181818;
  --bg-secondary: #212121;
  --bg-tertiary: #303030;
  --bg-accent: #3a3a3a;
  
  /* 文字颜色 */
  --text-primary: #e5e5e5;
  --text-secondary: #bbbbbb;
  --text-tertiary: #888888;
  --text-muted: #555555;
  
  /* 边框颜色 */
  --border-primary: #3a3a3a;
  --border-secondary: #4a4a4a;
  --border-focus: #3b82f6;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* ===== 基础样式重置 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
}

/* ===== 主容器 ===== */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ===== 头部导航 ===== */
.header {
  height: var(--header-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-primary);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all var(--transition-normal);
}

.header-content {
  height: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.logo-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  margin-right: 10px;
}

.logo-text {
  font-family: 'Caveat', cursive;
  font-size: 2.2rem;
  font-weight: 700;
  transition: color var(--transition-fast);
}

.logo i {
  color: var(--primary-color);
  font-size: 24px;
}

.logo .logo-text {
  transition: color var(--transition-fast);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 语言切换器 */
.lang-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 32px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.lang-toggle:hover {
  border-color: var(--primary-color);
  background: var(--bg-tertiary);
}

.lang-text {
  position: absolute;
  width: 100%;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: transform var(--transition-normal), opacity var(--transition-fast);
  opacity: 0;
  transform: translateX(100%);
}

[lang="en"] .lang-toggle .lang-text:first-child,
[lang="zh-CN"] .lang-toggle .lang-text:last-child {
  transform: translateX(0);
  opacity: 1;
  color: var(--text-primary);
}

[lang="en"] .lang-toggle .lang-text:last-child {
  transform: translateX(100%);
  opacity: 0;
}

[lang="zh-CN"] .lang-toggle .lang-text:first-child {
  transform: translateX(-100%);
  opacity: 0;
}

/* 主题切换按钮 */
.theme-toggle {
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: var(--border-radius);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  padding: 0;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle .theme-icon {
  width: 22px;
  height: 22px;
  position: absolute;
  transition: transform 0.4s ease, opacity 0.4s ease, stroke 0.25s ease;
  stroke: var(--text-primary);
}

.theme-toggle:hover .theme-icon {
    stroke: var(--primary-color);
}

.theme-toggle #theme-icon-sun {
  transform: scale(1) rotate(0deg);
}

[data-theme="light"] .theme-toggle #theme-icon-moon {
  opacity: 0;
  transform: scale(0) rotate(90deg);
}

[data-theme="dark"] .theme-toggle #theme-icon-sun {
  opacity: 0;
  transform: scale(0) rotate(-90deg);
}

[data-theme="dark"] .theme-toggle #theme-icon-moon {
  transform: scale(1) rotate(0deg);
}

/* ===== 主要内容区域 ===== */
.main-content {
  flex: 1;
  display: flex;
  min-height: calc(100vh - var(--header-height) - 60px);
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-primary);
}

.sidebar-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.search-container {
  position: relative;
}

.search-container input {
  width: 100%;
  padding: 10px 36px;
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.search-container input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.1);
}

.search-container input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.search-clear:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.search-clear i {
  font-size: 12px;
}

.search-container input:not(:placeholder-shown) + .search-icon + .search-clear {
  opacity: 1;
  visibility: visible;
}

/* 选中的技术栈 */
.selected-stack {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-primary);
  max-height: 200px;
  overflow-y: auto;
}

.selected-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.selected-header span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.clear-all {
  background: none;
  border: none;
  color: var(--error-color);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--border-radius);
  transition: all var(--transition-fast);
}

.clear-all:hover {
  background: var(--error-color);
  color: white;
}

.selected-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  font-size: 12px;
}

.selected-item.new {
  animation: fadeInScale 0.3s ease;
}

.selected-item .remove {
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  transition: background-color var(--transition-fast);
}

.selected-item .remove:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* 技术栈分类 */
.stack-categories {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.category {
  margin-bottom: 8px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.category-header:hover {
  background: var(--bg-tertiary);
}

.category-header i:first-child {
  color: var(--primary-color);
  width: 16px;
}

.category-header span {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.toggle-icon {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.category.expanded .toggle-icon {
  transform: rotate(180deg);
}

.category-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal);
}

.category.expanded .category-content {
  max-height: 500px;
}

.stack-grid {
  padding: 16px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.stack-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.stack-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stack-item.selected {
  /* border-color: var(--primary-color); */
  /* background: var(--primary-color); */
  /* color: white; */
}

.stack-item.selected:hover {
  /* background: var(--primary-hover); */
}

.stack-item i {
  font-size: 20px;
  margin-bottom: 6px;
  color: var(--primary-color);
  transition: color var(--transition-fast);
}

.stack-item.selected i {
  /* color: white; */
}

.stack-item span {
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
}

/* ===== 编辑器容器 ===== */
.editor-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
}

/* 编辑器工具栏 */
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-secondary);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.file-info i {
  color: var(--primary-color);
}

.line-count {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 8px;
  background: var(--bg-accent);
  border-radius: var(--border-radius);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  min-width: 80px;
  padding: 0 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 14px;
  white-space: nowrap;
  transform: translateY(-1px);
}

.toolbar-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-secondary);
}

.toolbar-btn i {
  font-size: 14px;
  flex-shrink: 0;
}

.toolbar-btn span {
  line-height: 1;
}

/* 编辑器区域 */
.editor-wrapper {
  flex: 1;
  display: flex;
  background: var(--bg-primary);
  overflow: hidden;
  position: relative;
}

.line-numbers {
  width: 60px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-muted);
  padding: 16px 8px;
  text-align: right;
  user-select: none;
  overflow: hidden;
  white-space: pre;
}

.editor {
  flex: 1;
  padding: 16px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  overflow-y: auto;
  white-space: pre;
  tab-size: 2;
}

.editor::placeholder {
  color: var(--text-muted);
}

/* 操作按钮 */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px;
  border-top: 1px solid var(--border-primary);
  background: var(--bg-secondary);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

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

.action-btn.primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.action-btn.secondary {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}

.action-btn.secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-secondary);
  transform: translateY(-2px);
}

.action-btn i {
  font-size: 14px;
}

/* ===== 底部 ===== */
.footer {
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-primary);
  padding: 16px 0;
  margin-top: auto;
  transition: all var(--transition-normal);
}

.footer-content {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
  font-weight: 500;
}

.footer-link:hover {
  color: var(--primary-color);
}

/* 备案信息样式 */
.beian-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.beian-link:hover {
  color: var(--text-primary);
}

.beian-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .footer-right {
    flex-direction: column;
    gap: 8px;
  }
}

/* ===== 模态框 ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.modal.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: var(--bg-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  margin: auto;
  padding: 24px;
  position: relative;
  width: 90%;
  max-width: 900px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.4em;
  color: var(--text-primary);
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5em;
  padding: 4px;
  transition: color var(--transition-fast);
}

.close-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

/* 上传区域 */
.upload-area {
  border: 2px dashed var(--border-primary);
  border-radius: var(--border-radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.05);
}

.upload-area i {
  font-size: 48px;
  color: var(--primary-color);
  margin-bottom: 16px;
}

.upload-area p {
  color: var(--text-secondary);
  font-size: 16px;
}

/* 模板网格 */
.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 20px;
  overflow-y: auto;
  max-height: calc(80vh - 120px);
}

.template-item {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  height: 240px;
  display: flex;
  flex-direction: column;
}

.template-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.template-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.template-header h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.2em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.template-tech-count {
  font-size: 0.9em;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 6px 12px;
  border-radius: 16px;
  font-weight: 500;
  flex-shrink: 0;
  margin-left: 8px;
}

.template-description {
  color: var(--text-secondary);
  font-size: 0.95em;
  margin: 12px 0;
  line-height: 1.5;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.template-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.tech-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  font-size: 0.9em;
  color: var(--text-secondary);
  font-weight: 500;
}

.tech-tag i {
  font-size: 1em;
  color: var(--text-muted);
}

.tech-tag.more {
  background: var(--bg-primary);
  border: 1px dashed var(--border-color);
  color: var(--text-muted);
}

/* 历史记录列表 */
.history-list {
  max-height: 400px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history-item:hover {
  background: var(--bg-secondary);
  border-color: var(--border-secondary);
}

.history-info {
  flex: 1;
}

.history-info h5 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.history-info small {
  font-size: 12px;
  color: var(--text-muted);
}

.history-actions {
  display: flex;
  gap: 8px;
}

.history-btn {
  padding: 4px 8px;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition-fast);
}

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

.history-btn.secondary {
  background: var(--bg-accent);
  color: var(--text-secondary);
}

/* 预览内容 */
.preview-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 500px;
  overflow-y: auto;
  color: var(--text-primary);
}

/* 分享选项 */
.share-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.share-option label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.share-input-group {
  display: flex;
  gap: 8px;
}

.share-input-group input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
}

.copy-share-btn {
  padding: 10px 16px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-share-btn:hover {
  background: var(--primary-hover);
}

/* ===== 提示消息 ===== */
.toast {
  position: fixed;
  top: 80px;
  right: 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 16px 20px;
  z-index: 1001;
  transform: translateX(calc(100% + 24px));
  transition: all var(--transition-normal);
  max-width: 300px;
  opacity: 0;
  visibility: hidden;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast-icon {
  font-size: 16px;
}

.toast.success .toast-icon {
  color: var(--success-color);
}

.toast.error .toast-icon {
  color: var(--error-color);
}

.toast.warning .toast-icon {
  color: var(--warning-color);
}

.toast-message {
  font-size: 14px;
  color: var(--text-primary);
}

/* ===== 动画 ===== */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== 响应式设计 ===== */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 280px;
  }

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

@media (max-width: 768px) {
  :root {
    --sidebar-width: 100%;
  }
  
  .main-content {
    flex-direction: column;
  }
  
  .sidebar {
    height: 50vh;
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-primary);
  }
  
  .editor-container {
    height: 50vh;
  }
  
  .stack-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
  }
  
  .action-buttons {
    flex-wrap: wrap;
  }
  
  .modal-content {
    width: 95%;
  }
}

@media (max-width: 480px) {
  .logo-text {
    display: none;
  }
  
  .toolbar-right .toolbar-btn span {
    display: none;
  }
  
  .action-btn span {
    display: none;
  }

  .toast {
    right: 12px;
    left: 12px;
    max-width: none;
    transform: translateY(-100%);
  }

  .toast.show {
    transform: translateY(0);
  }
}

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

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== 焦点样式 ===== */
button:focus,
input:focus,
textarea:focus {
  outline: none;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.github-link {
  color: var(--text-primary);
  font-size: 20px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  text-decoration: none;
}

.github-link:hover {
  color: var(--primary-color);
  transform: scale(1.1);
} 

/* 通用样式 */
.hidden {
  display: none !important;
} 