* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #222;
  background-color: #f5f5f7;
  line-height: 1.6;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background-color: #ffffff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-logo img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.site-title {
  font-size: 18px;
  font-weight: 600;
}

.site-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
  color: #374151;
}

.site-nav a:hover {
  background-color: rgba(37, 99, 235, 0.08);
}

.site-nav a.is-active {
  background-color: #2563eb;
  color: #ffffff;
}

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 150px 16px 40px; /* 顶部间距增加到150px */
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* 菜单切换按钮（PC端默认隐藏） */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: #374151;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

.hero-section {
  text-align: center;
  max-width: 800px;
  width: 100%;
  margin-bottom: 40px;
}

.hero-section h1 {
  font-size: 32px;
  font-weight: 500;
  color: #1f2937;
  margin-bottom: 24px;
  margin-block-start: 0.67em;
  margin-block-end: 0.67em;
}

.hero-section p.description {
  display: none; /* 隐藏原来的描述，或者只在SEO中保留 */
}

.notice-text {
  margin-top: 24px;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.8;
  text-align: center;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
  width: 100%;
}

.tool-card {
  background-color: transparent; /* 去掉卡片背景 */
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.tool-card:hover {
  background-color: rgba(0,0,0,0.02);
}

.tool-card h2 {
  font-size: 16px;
  margin-bottom: 4px;
}

.tool-card p {
  display: none; /* 列表页简化显示 */
}

.tool-card a {
  font-size: 14px;
  color: #4b5563;
}

.tool-card a:hover {
  color: #2563eb;
}

/* 隐藏旧的section样式干扰 */
.section {
  background-color: transparent;
  box-shadow: none;
  padding: 0;
  width: 100%;
  text-align: center;
}

.section h1 {
  font-size: 32px;
  font-weight: 400;
  color: #333;
  margin-bottom: 30px;
}

.section p {
  color: #666;
}

.section h1 {
  font-size: 24px;
  margin-bottom: 8px;
}

.section h2 {
  font-size: 18px;
  margin-bottom: 8px;
}

.section p {
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 10px;
}

.form {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.form-row label {
  font-size: 14px;
  min-width: 88px;
  color: #374151;
}

.upload-row {
  justify-content: center;
}

.form-row .upload-input {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 36px;
  border-radius: 999px;
  background-color: #2563eb;
  border: 1px solid #1d4ed8;
  color: #ffffff;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  transition: background-color 0.2s;
}

.form-row .upload-input:hover {
  background-color: #1d4ed8;
}

.upload-input span {
  pointer-events: none;
}

.upload-input input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.form-row input[type="number"],
.form-row select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  font-size: 14px;
  min-width: 120px;
}

.form-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}



/* 编辑器区域布局 */
.editor-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 中间预览大图 */
.main-preview-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.preview-wrapper {
  width: 80%; /* 用户要求80% */
  max-width: 600px;
  height: 400px; /* 固定高度，形成滚动窗口 */
  background-color: #f3f4f6;
  border-radius: 8px;
  border: 1px dashed #d1d5db;
  display: flex;
  /* 移除 align-items: center，允许内容撑开或滚动 */
  justify-content: center; /* 水平居中 */
  overflow: auto; /* 允许滚动 */
  position: relative;
  /* 增加内边距，好看点 */
  padding: 10px;
}

.preview-wrapper img {
  /* 移除 max-height 限制，允许垂直滚动 */
  max-width: 100%; 
  height: auto;
  object-fit: contain;
  display: block;
  /* 默认隐藏，有图时JS显示 */
}

.preview-placeholder {
  position: absolute;
  color: #9ca3af;
  font-size: 14px;
  pointer-events: none;
}

/* 底部面板 */
.bottom-panel {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

/* 可拖拽列表容器 */
.sortable-list-container {
  margin-bottom: 20px;
}

.sortable-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 8px 4px;
  scroll-behavior: smooth;
  /* 隐藏滚动条但保留功能 */
  scrollbar-width: thin;
}

.sortable-list::-webkit-scrollbar {
  height: 6px;
}
.sortable-list::-webkit-scrollbar-thumb {
  background-color: #d1d5db;
  border-radius: 3px;
}

.sort-item {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: grab;
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  user-select: none;
  touch-action: none; /* 关键：阻止浏览器默认触摸行为 */
}

.sort-item.selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.sort-item.dragging {
  opacity: 0.5;
  transform: scale(0.95);
  cursor: grabbing;
}

.sort-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none; /* 防止图片拖拽干扰 */
}

.drag-hint {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 8px;
}

/* 底部控制栏 */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
  flex-wrap: wrap;
  gap: 16px;
}

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

.control-group .label {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

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

.radio-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #4b5563;
  cursor: pointer;
}

.radio-btn input[type="radio"] {
  accent-color: #2563eb;
  width: 16px;
  height: 16px;
}

.save-button {
  background-color: #1890ff;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  height: 48px;
  min-width: 120px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.save-button:hover {
  background-color: #096dd9;
}

.save-button:active {
  background-color: #0050b3;
}

.save-button:disabled {
  background-color: #bfbfbf;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .preview-wrapper {
    width: 100%; /* 移动端占满 */
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .control-group {
    justify-content: center;
  }

  .save-button {
    width: 100%;
  }
}



.page-footer {
  padding: 16px 24px 24px;
  font-size: 12px;
  color: #6b7280;
  text-align: center;
}

@media (max-width: 640px) {
  .page {
    padding-top: 80px; /* 移动端顶部间距稍微减小，避免太空 */
  }

  .site-header {
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    flex-direction: row; /* 保持水平排列，Logo和菜单按钮各一边 */
    padding: 12px 16px;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    gap: 8px;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
  }

  .hero {
    padding: 20px 16px;
  }

  .hero h1 {
    font-size: 22px;
  }
}
