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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #f4f6f8;
  color: #1f2937;
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== 三栏布局 ===== */
.layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  padding: 24px 16px 40px;
  max-width: 1440px;
  margin: 0 auto;
}

/* 左右广告栏：仅预留空容器，不写占位样式与文字 */
.ad-side {
  width: 200px;
  flex: 0 0 200px;
  min-height: 1px;
}

/* 中间主内容区 */
.main {
  flex: 1 1 auto;
  max-width: 860px;
  min-width: 0;
}

/* ===== 响应式：≤1200px 隐藏左右广告栏 ===== */
@media (max-width: 1200px) {
  .ad-side {
    display: none;
  }
}

/* ===== 底部公共区域：仅预留空容器 ===== */
.ad-footer {
  width: 100%;
  min-height: 1px;
}

/* ===== SEO 内容区 ===== */
.seo-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  color: #374151;
  font-size: 14px;
  line-height: 1.9;
}

.seo-content h2 {
  font-size: 17px;
  color: #111827;
  margin: 22px 0 10px;
  padding-left: 10px;
  border-left: 3px solid #409eff;
}

.seo-content h2:first-child { margin-top: 0; }

.seo-content h3 {
  font-size: 14px;
  color: #111827;
  margin: 14px 0 4px;
}

.seo-content ul,
.seo-content ol { padding-left: 22px; }

.seo-content li { margin-bottom: 4px; }

/* ===== 头部 ===== */
.hero {
  text-align: center;
  padding: 24px 0 20px;
}

.hero h1 {
  font-size: 32px;
  font-weight: 700;
  color: #111827;
  letter-spacing: 1px;
}

.hero .subtitle {
  margin-top: 10px;
  font-size: 16px;
  color: #6b7280;
}

/* ===== 工具切换标签 ===== */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: #e5e7eb;
  padding: 4px;
  border-radius: 12px;
}

.tab {
  flex: 1;
  height: 42px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #4b5563;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tab.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ===== 工具卡片 ===== */
.tool-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  padding: 24px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  border-bottom: 1px solid #eef0f3;
  padding-bottom: 20px;
}

.upload-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-zone .hint {
  font-size: 13px;
  color: #9ca3af;
}

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.option-group label {
  font-size: 13px;
  color: #6b7280;
}

.option-group select,
.option-group input[type="number"] {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  color: #1f2937;
  outline: none;
}

.option-group select:focus,
.option-group input[type="number"]:focus {
  border-color: #2563eb;
}

/* ===== 按钮 ===== */
.btn {
  height: 40px;
  padding: 0 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-primary:disabled {
  background: #a5b4fc;
  cursor: not-allowed;
}

.btn-ghost {
  background: #f3f4f6;
  color: #374151;
}

.btn-ghost:hover {
  background: #e5e7eb;
}

/* ===== 预览区 ===== */
.preview-wrap {
  margin-top: 20px;
  min-height: 120px;
}

.empty-tip {
  text-align: center;
  color: #9ca3af;
  padding: 40px 0;
  font-size: 15px;
}

.preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.preview-item {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
  background: #f9fafb;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-item .remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  line-height: 20px;
  text-align: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
}

.preview-item .remove:hover {
  background: rgba(220, 38, 38, 0.9);
}

.preview-item .index {
  position: absolute;
  left: 4px;
  bottom: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
}

/* ===== 操作区 ===== */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  justify-content: center;
}

/* ===== 结果区 ===== */
.result-wrap {
  margin-top: 20px;
  text-align: center;
  display: none;
}

.result-wrap.show {
  display: block;
}

.result-wrap img {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.result-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.result-tip {
  margin-top: 10px;
  font-size: 13px;
  color: #6b7280;
}

/* ===== SEO 说明区 ===== */
.seo-section {
  margin-top: 32px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  padding: 24px;
}

.seo-section h2 {
  font-size: 20px;
  color: #111827;
  margin-bottom: 12px;
}

.seo-section p {
  color: #4b5563;
  margin-bottom: 12px;
}

.seo-section ul {
  padding-left: 20px;
  color: #4b5563;
}

.seo-section li {
  margin-bottom: 6px;
}

/* ===== 移动端适配 ===== */
@media (max-width: 640px) {
  .hero h1 {
    font-size: 24px;
  }

  .tool-card,
  .seo-section {
    padding: 16px;
  }

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