body {
  font-family: 'Helvetica Neue', Helvetica, Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  margin: 0;
  background: linear-gradient(135deg, #181c2a 0%, #232a4d 100%);
  color: #eaf6ff;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(24,28,42,0.95);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
header h1 {
  background: linear-gradient(90deg, #00eaff 0%, #7f6fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 2px;
}
main {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.input-panel {
  flex: 1 1 340px;
  max-width: 360px;
  background: rgba(30,34,54,0.98);
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.12);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.input-panel label, .icon-selector-row, .bg-selector-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 1rem;
}
.input-panel input[type="text"]:not(.text-input),
.input-panel select {
  padding: 0.5rem;
  border: 1px solid #2e375a;
  border-radius: 8px;
  font-size: 1rem;
  background: #232a4d;
  color: #eaf6ff;
}
.input-panel input[type="color"]:not(.color-picker) {
  width: 40px;
  height: 32px;
  border: none;
  background: none;
  padding: 0;
}
.input-panel button, .bg-selector-row button, #download-btn {
  padding: 0.7rem 1.2rem;
  background: linear-gradient(90deg, #00eaff 0%, #7f6fff 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  transition: background 0.2s, box-shadow 0.2s;
}
.input-panel button:hover, .bg-selector-row button:hover, #download-btn:hover {
  background: linear-gradient(90deg, #7f6fff 0%, #00eaff 100%);
  box-shadow: 0 4px 16px rgba(0,234,255,0.15);
}
.icon-list {
  display: flex;
  gap: 0.3rem;
}
.icon-list img, .icon-list svg {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #232a4d;
  border: 2px solid #2e375a;
  box-shadow: 0 1px 4px rgba(0,234,255,0.08);
  cursor: pointer;
  transition: border 0.2s;
}
.icon-list img.selected, .icon-list svg.selected {
  border: 2px solid #00eaff;
}
.bg-preview-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 0.8rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  justify-items: center;
}
.bg-preview-list img, .bg-preview-list canvas {
  width: 60px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border 0.2s;
  background: rgba(24,28,42,0.5);
}
.bg-preview-list img.selected, .bg-preview-list canvas.selected {
  border: 2px solid #00eaff;
}
.preview-panel {
  flex: 2 1 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  background: rgba(30,34,54,0.98);
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.12);
  padding: 2rem 1.5rem;
  min-width: 320px;
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  align-self: flex-start;
}
#cover-canvas {
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0,234,255,0.10);
  background: #232a4d;
  max-width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
#cover-canvas:hover {
  box-shadow: 0 4px 20px rgba(0,234,255,0.15);
}
.preview-panel::before {
  content: "💡 提示：点击拖动文字调整位置";
  position: absolute;
  top: 0.5rem;
  right: 1.5rem;
  font-size: 0.8rem;
  color: #7fbcff;
  opacity: 0.7;
  pointer-events: none;
}
footer {
  text-align: center;
  padding: 1rem;
  color: #7fbcff;
  font-size: 0.95rem;
  background: none;
  margin-top: 2rem;
}
#modal-container {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}
#modal-container.active {
  display: flex;
  background: rgba(24,28,42,0.75);
}
.modal {
  background: #232a4d;
  border-radius: 16px;
  box-shadow: 0 4px 32px rgba(0,234,255,0.15);
  padding: 2rem;
  min-width: 320px;
  max-width: 90vw;
  color: #eaf6ff;
}
.modal-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}
.modal-tab {
  padding: 0.5rem 1.2rem;
  border-radius: 8px 8px 0 0;
  background: #181c2a;
  color: #7fbcff;
  cursor: pointer;
  font-weight: bold;
  border: none;
  outline: none;
  transition: background 0.2s;
}
.modal-tab.active {
  background: linear-gradient(90deg, #00eaff 0%, #7f6fff 100%);
  color: #fff;
}
@media (max-width: 900px) {
  main {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  .input-panel, .preview-panel {
    max-width: 100%;
    min-width: 0;
  }
  .preview-panel {
    position: relative;
    top: auto;
    max-height: none;
    overflow-y: visible;
  }
}
/* 主标题特效样式（仅供预览，实际渲染需配合JS/Canvas） */
.effect-gradient {
  background: linear-gradient(90deg, #00eaff 0%, #7f6fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.effect-glow {
  color: #00eaff;
  text-shadow: 0 0 8px #00eaff, 0 0 16px #7f6fff;
}
.effect-3d {
  color: #fff;
  text-shadow: 2px 2px 0 #00eaff, 4px 4px 0 #232a4d;
}
.bg-selector-tabs {
  display: flex;
  background: rgba(24, 28, 42, 0.9);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 6px;
  gap: 4px;
  margin-bottom: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
.bg-tab {
  flex: 1 1 0;
  padding: 0.8rem 0;
  background: transparent;
  color: #7fbcff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  position: relative;
  letter-spacing: 0.5px;
}
.bg-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  color: #9fc7ff;
  transform: translateY(-1px);
}
.bg-tab.active {
  background: linear-gradient(135deg, rgba(0, 234, 255, 0.25), rgba(127, 111, 255, 0.25));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 234, 255, 0.3);
  color: #fff;
  box-shadow: 0 8px 32px rgba(0, 234, 255, 0.25), 
              0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  transform: translateY(-2px);
}
.bg-tab.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0, 234, 255, 0.1), rgba(127, 111, 255, 0.1));
  border-radius: 12px;
  z-index: -1;
}
.bg-tab.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00eaff, transparent);
  border-radius: 1px;
  box-shadow: 0 0 8px rgba(0, 234, 255, 0.6);
}
.bg-tab-content {
  display: block;
  background: rgba(35, 42, 77, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1.2rem;
  margin-bottom: 1rem;
  min-height: 120px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.unsplash-search-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.unsplash-search-row input[type="text"] {
  flex: 1 1 0;
  padding: 0.5rem;
  border: 1px solid #2e375a;
  border-radius: 8px;
  background: #181c2a;
  color: #eaf6ff;
  font-size: 1rem;
}
.unsplash-search-row button {
  padding: 0.5rem 1.2rem;
  background: linear-gradient(90deg, #00eaff 0%, #7f6fff 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}
#bg-upload-input {
  margin-bottom: 0.5rem;
}
.effect-checkbox-group {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 0.5rem;
}
.effect-checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 1rem;
  cursor: pointer;
}
.effect-checkbox {
  accent-color: #00eaff;
  width: 18px;
  height: 18px;
  margin-right: 0.2rem;
}
.btn {
  padding: 0.7rem 1.2rem;
  background: linear-gradient(90deg, #00eaff 0%, #7f6fff 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  transition: background 0.2s, box-shadow 0.2s;
  outline: none;
}
.btn:hover {
  background: linear-gradient(90deg, #7f6fff 0%, #00eaff 100%);
  box-shadow: 0 4px 16px rgba(0,234,255,0.15);
}
.upload-btn-label {
  display: inline-block;
  cursor: pointer;
}
.upload-btn {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: linear-gradient(90deg, #00eaff 0%, #7f6fff 100%);
  color: #fff;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  transition: background 0.2s, box-shadow 0.2s;
}
.upload-btn:hover {
  background: linear-gradient(90deg, #7f6fff 0%, #00eaff 100%);
  box-shadow: 0 4px 16px rgba(0,234,255,0.15);
}
.template-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.template-card canvas {
  border-radius: 8px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border 0.3s, box-shadow 0.3s, transform 0.2s;
  width: 60px;
  height: 40px;
}
.template-card canvas:hover {
  border: 3px solid #7fbcff;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(127, 188, 255, 0.2);
}
.template-card canvas.selected {
  border: 3px solid #00eaff;
  box-shadow: 0 6px 20px rgba(0, 234, 255, 0.4);
  transform: scale(1.08);
}
.input-group {
  margin-bottom: 1.5rem;
}

.input-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.input-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: #9fc7ff;
  letter-spacing: 0.3px;
}

.color-picker {
  width: 32px;
  height: 32px;
  border: 2px solid #2e375a;
  border-radius: 6px;
  background: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.color-picker:hover {
  border-color: #7fbcff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(127, 188, 255, 0.2);
}

.color-picker:active {
  transform: translateY(0);
}

.text-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #2e375a;
  border-radius: 10px;
  font-size: 1rem;
  background: linear-gradient(135deg, #232a4d 0%, #1e2442 100%);
  color: #eaf6ff;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.text-input:focus {
  outline: none;
  border-color: #00eaff;
  background: linear-gradient(135deg, #1e2442 0%, #232a4d 100%);
  box-shadow: 0 4px 16px rgba(0, 234, 255, 0.15);
  transform: translateY(-1px);
}

.text-input::placeholder {
  color: #7fbcff;
  opacity: 0.7;
}

/* 自定义滚动条样式 */
.preview-panel::-webkit-scrollbar {
  width: 8px;
}

.preview-panel::-webkit-scrollbar-track {
  background: rgba(24,28,42,0.3);
  border-radius: 4px;
}

.preview-panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #00eaff 0%, #7f6fff 100%);
  border-radius: 4px;
  transition: background 0.2s;
}

.preview-panel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #7f6fff 0%, #00eaff 100%);
}

/* 预设模板样式 */
.preset-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.preset-btn {
  padding: 0.6rem 0.8rem;
  background: linear-gradient(90deg, #232a4d 0%, #2e375a 100%);
  color: #eaf6ff;
  border: 1px solid #3a4561;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-weight: 500;
}

.preset-btn:hover {
  background: linear-gradient(90deg, #2e375a 0%, #3a4561 100%);
  border-color: #00eaff;
  color: #00eaff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,234,255,0.2);
}

.preset-btn:active {
  transform: translateY(0);
}

/* 滤镜控制样式 */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-top: 0.5rem;
  padding: 1rem;
  background: rgba(35,42,77,0.5);
  border-radius: 8px;
  border: 1px solid #2e375a;
}

.filter-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: #7fbcff;
  gap: 1rem;
}

.filter-group input[type="range"] {
  flex: 1;
  height: 4px;
  background: #2e375a;
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
}

.filter-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: linear-gradient(90deg, #00eaff 0%, #7f6fff 100%);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.filter-group input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: linear-gradient(90deg, #00eaff 0%, #7f6fff 100%);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.filter-group input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,234,255,0.4);
}

.filter-group input[type="range"]:hover::-moz-range-thumb {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0,234,255,0.4);
}

/* 特效复选框样式增强 */
.effect-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(35,42,77,0.3);
  border-radius: 8px;
  border: 1px solid #2e375a;
  margin-bottom: 1rem;
}

.effect-checkbox-group > span {
  font-weight: 500;
  color: #eaf6ff;
  width: 100%;
  margin-bottom: 0.5rem;
}

.effect-checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.3rem 0;
  transition: color 0.2s;
  font-size: 0.9rem;
}

.effect-checkbox-group label:hover {
  color: #00eaff;
}

.effect-checkbox {
  width: 16px;
  height: 16px;
  accent-color: #00eaff;
}

/* 动画效果 */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.preset-btn, .filter-group {
  animation: slideIn 0.3s ease-out;
}

/* 头部控件样式 */
.header-controls {
  display: flex;
  gap: 0.5rem;
}

.header-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.8rem;
  background: rgba(0,234,255,0.1);
  color: #00eaff;
  border: 1px solid rgba(0,234,255,0.3);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.header-btn:hover {
  background: rgba(0,234,255,0.2);
  border-color: #00eaff;
  transform: translateY(-1px);
}

.header-btn span {
  font-size: 1rem;
}

/* 预览控件样式 */
.preview-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.secondary-btn {
  padding: 0.6rem 1rem;
  background: rgba(127,188,255,0.1);
  color: #7fbcff;
  border: 1px solid rgba(127,188,255,0.3);
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-btn:hover {
  background: rgba(127,188,255,0.2);
  border-color: #7fbcff;
  transform: translateY(-1px);
}

/* 教程引导样式 */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-content {
  background: linear-gradient(135deg, #181c2a 0%, #232a4d 100%);
  border-radius: 16px;
  padding: 2rem;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  color: #eaf6ff;
  border: 2px solid #00eaff;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.tutorial-step {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(30,34,54,0.5);
  border-radius: 8px;
  border-left: 4px solid #00eaff;
}

.tutorial-step h3 {
  margin: 0 0 0.5rem 0;
  color: #00eaff;
  font-size: 1.1rem;
}

.tutorial-step p {
  margin: 0;
  color: #7fbcff;
  line-height: 1.5;
}

/* 历史记录样式 */
.history-panel {
  background: linear-gradient(135deg, #181c2a 0%, #232a4d 100%);
  border-radius: 16px;
  padding: 2rem;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  color: #eaf6ff;
  border: 2px solid #00eaff;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.history-item {
  background: rgba(30,34,54,0.5);
  border-radius: 8px;
  padding: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.history-item:hover {
  border-color: #00eaff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,234,255,0.2);
}

.history-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.history-item .item-info {
  font-size: 0.8rem;
  color: #7fbcff;
}

/* 分享面板样式 */
.share-panel {
  background: linear-gradient(135deg, #181c2a 0%, #232a4d 100%);
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  color: #eaf6ff;
  border: 2px solid #00eaff;
  text-align: center;
}

.share-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.share-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(30,34,54,0.5);
  border: 1px solid #2e375a;
  border-radius: 8px;
  color: #eaf6ff;
  text-decoration: none;
  transition: all 0.2s;
}

.share-button:hover {
  border-color: #00eaff;
  background: rgba(0,234,255,0.1);
  transform: translateY(-2px);
}

.share-button .icon {
  font-size: 2rem;
}

/* 响应式优化 */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }
  
  .header-controls {
    order: -1;
  }
  
  .preset-buttons {
    grid-template-columns: 1fr;
  }
  
  .filter-group {
    padding: 0.8rem;
  }
  
  .filter-group label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .effect-checkbox-group {
    gap: 0.8rem;
  }
  
  .preview-controls {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .tutorial-content,
  .history-panel,
  .share-panel {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  .history-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}