/* 主题变量 */
:root {
  --primary-color: #4a90e2;
  --text-color: #333333;
  --border-color: #e5e7eb;
  --background-color: #ffffff;
  --hover-color: #f3f4f6;
}

/* 暗色主题 */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #64b5f6;
    --text-color: #ffffff;
    --border-color: #404040;
    --background-color: #2d2d2d;
    --hover-color: #404040;
    --shadow-color: rgba(0, 0, 0, 0.3);
  }
}

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

body {
  width: 300px;
  margin: 0;
  padding: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-color);
  background: var(--background-color);
}

/* 容器 */
.container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 工具栏 */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar h1 {
  margin: 0;
  font-size: 18px;
}

/* 主要内容区 */
main {
  display: grid;
  gap: 20px;
}

/* 文本内容 */
.text-section {
  margin-bottom: 16px;
}

.text-section h2 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #666;
}

.text-content {
  min-height: 60px;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
}

/* 模板列表 */
.template-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 12px;
}

.template-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.template-item:hover {
  background: var(--hover-color);
}

.template-item.active {
  border-color: var(--primary-color);
}

.template-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 4px;
}

.template-item span {
  font-size: 12px;
  text-align: center;
}

/* 预览区域 */
.preview-section {
  margin-bottom: 24px;
}

.preview-container {
  aspect-ratio: 16/9;
  background: var(--hover-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

#previewCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 操作按钮 */
.action-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.action-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding-top: 8px;
}

button {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}

button:hover {
  background: var(--hover-color);
}

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

button.primary:hover {
  filter: brightness(1.1);
}

/* 设置面板 */
.settings-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.2s;
}

.settings-panel.hidden {
  opacity: 0;
  pointer-events: none;
}

.settings-content {
  width: 300px;
  padding: 20px;
  background: var(--background-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow-color);
}

/* 选项组 */
.option-group {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}

.option-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

.option-group select,
.option-group input[type="number"] {
  width: 120px;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--background-color);
  color: var(--text-color);
}

/* 提示消息 */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 4px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s;
}

.toast.show {
  opacity: 1;
}

/* 图标字体 */
@font-face {
  font-family: 'iconfont';
  src: url('../assets/fonts/iconfont.woff2') format('woff2');
}

.icon-help::before {
  content: '\e72f';
  font-family: 'iconfont';
}

.icon-settings::before {
  content: '\e78e';
  font-family: 'iconfont';
}

/* 加载动画 */
.loading {
  position: relative;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--primary-color);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 优化按钮样式 */
.toolbar-buttons {
  display: flex;
  gap: 8px;
}

.toolbar-buttons button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-color);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.2s;
}

.toolbar-buttons button:hover {
  background: var(--hover-color);
}

/* 成功动画 */
@keyframes success {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.success-animation {
  animation: success 0.3s ease-out;
}

/* 水印样式 */
.watermark-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.watermark-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* 优化按钮悬停效果 */
.action-section button {
  position: relative;
  overflow: hidden;
}

.action-section button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: currentColor;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
}

.action-section button:active::after {
  transform: translate(-50%, -50%) scale(2);
  opacity: 0.1;
}

/* 优化暗色主题 */
@media (prefers-color-scheme: dark) {
  :root {
    --primary-color: #60a5fa;
    --text-color: #e5e7eb;
    --border-color: #4b5563;
    --background-color: #1f2937;
    --hover-color: #374151;
    --shadow-color: rgba(0, 0, 0, 0.5);
  }
  
  .preview-container {
    border: 1px solid var(--border-color);
  }
  
  .template-item {
    background: var(--background-color);
  }
  
  .template-item:hover {
    background: var(--hover-color);
  }
} 

/* 尺寸设置 */
.size-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.size-settings input[type="number"] {
  width: 80px;
}

/* 导出设置 */
.export-settings {
  display: grid;
  gap: 12px;
}

.quality-setting {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
}

.quality-setting input[type="range"] {
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
  -webkit-appearance: none;
}

.quality-setting input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
}

.quality-value {
  font-size: 12px;
  min-width: 40px;
  text-align: right;
}

/* 预设颜色选择 */
.color-presets {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.color-preset {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.color-preset:hover {
  transform: scale(1.1);
}

.color-preset.active {
  border-color: var(--primary-color);
} 

/* 引导样式 */
.guide-tooltip {
  position: absolute;
  z-index: 1000;
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 240px;
  transform: translateX(-50%);
}

.guide-tooltip::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-bottom-color: white;
}

.guide-tooltip h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.guide-tooltip p {
  margin: 0 0 16px;
  font-size: 14px;
  color: #666;
}

.guide-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.guide-highlight {
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.3);
  border-radius: 4px;
}

.guide-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
} 

/* 模板管理 */
.template-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.template-content {
  width: 600px;
  max-height: 80vh;
  padding: 24px;
  background: var(--background-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--shadow-color);
  overflow-y: auto;
}

.template-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.template-tabs button {
  padding: 8px 16px;
  border: none;
  background: none;
  color: var(--text-color);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.template-tabs button.active {
  border-bottom-color: var(--primary-color);
  color: var(--primary-color);
}

.template-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.template-preview {
  aspect-ratio: 16/9;
  background: var(--hover-color);
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}

.template-form {
  margin-top: 24px;
}

.template-form input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--background-color);
  color: var(--text-color);
  margin-bottom: 12px;
}

.form-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
} 

/* 模板拖拽 */
.template-item.dragging {
  opacity: 0.5;
  cursor: move;
}

.template-item.drag-over {
  border: 2px dashed var(--primary-color);
}

/* 模板预览 */
.template-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.template-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
}

.template-name {
  font-size: 14px;
  font-weight: 500;
}

.delete-template {
  padding: 4px;
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.template-item:hover .delete-template {
  opacity: 1;
}

/* 模板操作按钮 */
.template-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.template-actions button {
  flex: 1;
  padding: 8px 16px;
  background: var(--hover-color);
  border: none;
  border-radius: 4px;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s;
}

.template-actions button:hover {
  background: var(--border-color);
} 

/* 图片处理选项 */
.image-options {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.image-options label {
  display: grid;
  gap: 8px;
}

.image-options select {
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--background-color);
  color: var(--text-color);
}

.compress-value {
  font-size: 12px;
  color: var(--text-color);
  opacity: 0.8;
}

/* 滤镜预览 */
.filter-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.filter-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.filter-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.filter-item.active::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid var(--primary-color);
  border-radius: 4px;
}

.filter-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 12px;
  text-align: center;
} 

/* 模板搜索 */
.template-filters {
  grid-column: 1 / -1;
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  margin-bottom: 12px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px;
  padding-left: 32px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--background-color);
  color: var(--text-color);
}

.search-box .icon-search {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-color);
  opacity: 0.5;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.category-tabs button {
  padding: 4px 12px;
  border: none;
  border-radius: 16px;
  background: var(--hover-color);
  color: var(--text-color);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.category-tabs button:hover {
  background: var(--border-color);
}

.category-tabs button.active {
  background: var(--primary-color);
  color: white;
}

/* 空状态提示 */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 0;
  color: var(--text-color);
  opacity: 0.5;
} 

.template-section {
  margin: 16px 0;
}

.template-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.template-btn {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

/* 样式设置 */
.style-controls {
  display: grid;
  gap: 12px;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hint {
  font-size: 12px;
  color: #666;
  margin-left: 4px;
}

/* 适配暗色主题 */
@media (prefers-color-scheme: dark) {
  .hint {
    color: #999;
  }
} 