/* ===== 拼豆之家 - 全局样式 v2.0 现代重设计 ===== */
:root {
  --primary: #14B8A6;
  --primary-dark: #0D9488;
  --primary-light: #2DD4BF;
  --primary-bg: rgba(20, 184, 166, 0.1);
  --secondary: #0EA5E9;
  --accent: #F59E0B;
  --success: #10B981;
  --nav-bg: #0B2B2B;
  --nav-bg-hover: #134545;
  --bg: #FAF7F2;
  --bg-alt: #F0EBE3;
  --bg-card: #FFFFFF;
  --text: #1A1A1A;
  --text-secondary: #4A4A4A;
  --text-light: #7A7A7A;
  --text-muted: #B0B0B0;
  --border: #E8E4DE;
  --border-light: #F0EDE8;
  --shadow-xs: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.12);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;
  --grid-color: rgba(0,0,0,0.03);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  overflow-x: hidden;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--primary); color: white; }

/* ===== 导航栏 ===== */
.navbar {
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.3px;
}
.logo-img {
  height: 32px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}
.logo-fallback {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-weight: 700;
  font-size: 18px;
}
.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: white;
  box-shadow: 0 2px 8px rgba(232,69,44,0.3);
}
.nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
  flex: 1;
  justify-content: center;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  transition: all 0.2s;
  white-space: nowrap;
}
.nav-links a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.nav-links a.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
}
.nav-cta {
  background: var(--primary) !important;
  color: white !important;
  padding: 8px 20px !important;
  border-radius: var(--radius-full) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  box-shadow: 0 2px 8px rgba(232,69,44,0.3);
  transition: all 0.2s !important;
  white-space: nowrap;
}
.nav-cta:hover {
  background: var(--primary-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(232,69,44,0.4);
}
.nav-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,0.8);
  border-radius: 2px;
  transition: all 0.3s;
}
.mobile-menu {
  display: none;
  flex-direction: column;
  background: var(--nav-bg);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 8px 0;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  padding: 12px 32px;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
  font-size: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mobile-menu a.active { color: var(--primary-light); background: rgba(232,69,44,0.1); }
.mobile-menu a:last-child { border-bottom: none; }

/* ===== Hero 区域 ===== */
.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 72px 32px 56px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
  position: relative;
}
.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 0.2px;
}
.hero h1 {
  font-size: 52px;
  font-weight: 900;
  line-height: 1.12;
  margin-bottom: 24px;
  letter-spacing: -1.5px;
}
.hero h1 span {
  color: var(--primary);
  position: relative;
}
.hero h1 span::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--primary-bg);
  z-index: -1;
  border-radius: 4px;
}
.hero p {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 36px;
  line-height: 1.8;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 520px;
}
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  border: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 16px rgba(232,69,44,0.3);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(232,69,44,0.4);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: white;
  color: var(--text);
  border: 2px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.hero-visual {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-beads {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  padding: 28px;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  transform: rotate(-3deg);
  border: 1px solid var(--border-light);
}
.bead {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-shadow:
    inset 0 -2px 4px rgba(0,0,0,0.15),
    inset 0 2px 4px rgba(255,255,255,0.4),
    0 1px 2px rgba(0,0,0,0.1);
}

/* ===== 通用区块标题 ===== */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}
.section-header .section-tag {
  display: inline-block;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.section-header h2 {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 14px;
}
.section-header p {
  color: var(--text-light);
  font-size: 16px;
  max-width: 560px;
  margin: 0 auto;
}

/* ===== 功能卡片 ===== */
.features {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 32px;
}
.section-title {
  text-align: center;
  margin-bottom: 40px;
}
.section-title h2 {
  font-size: 34px;
  font-weight: 900;
  margin-bottom: 12px;
  letter-spacing: -0.8px;
}

/* ===== 导航栏下拉菜单 ===== */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 100;
  border: 1px solid var(--border-light);
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-menu a {
  display: block;
  padding: 10px 14px;
  color: var(--text-secondary) !important;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  text-decoration: none;
}
.nav-dropdown-menu a:hover {
  background: var(--primary-bg);
  color: var(--primary) !important;
}
.mobile-nav-group { width: 100%; }
.mobile-nav-sub {
  padding-left: 16px;
  border-left: 2px solid var(--border);
  margin: 4px 0;
}
.mobile-nav-sub a {
  font-size: 13px !important;
  padding: 6px 0 !important;
  color: var(--text-light) !important;
}
.section-title p {
  color: var(--text-light);
  font-size: 16px;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
/* 主题分类 */
.themes-section {
  padding: 64px 32px;
}
.themes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.theme-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
  border: 1px solid var(--border-light);
}
.theme-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.theme-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.theme-card h4 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.theme-card p {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}
.feature-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.feature-card:hover::before { transform: scaleX(1); }
.feature-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin-bottom: 22px;
}
.feature-card h3 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}
.feature-card p {
  color: var(--text-light);
  font-size: 14.5px;
  line-height: 1.75;
}

/* ===== 工具页面布局 ===== */
.tool-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  min-height: calc(100vh - 64px);
}
.tool-sidebar {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 88px;
  border: 1px solid var(--border-light);
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-light);
}
.sidebar-icon { font-size: 22px; }
.sidebar-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.3px;
}
.setting-block { margin-bottom: 20px; }
.setting-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.setting-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.setting-label-row .setting-label { margin-bottom: 0; }
.setting-value-badge {
  background: var(--primary);
  color: white;
  padding: 3px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}
.width-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.width-preset-btn {
  padding: 9px 0;
  border: 2px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.width-preset-btn:hover { border-color: var(--primary); color: var(--primary); }
.width-preset-btn.active {
  background: var(--text);
  color: white;
  border-color: var(--text);
}
.width-control-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.width-step-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: white;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  font-weight: 600;
}
.width-step-btn:hover { border-color: var(--primary); color: var(--primary); }
.width-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}
.width-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(232,69,44,0.4);
  border: 3px solid white;
}
.width-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(232,69,44,0.4);
}
.setting-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 6px 0 0;
  line-height: 1.4;
}
.setting-select, .setting-input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.setting-select:focus, .setting-input:focus {
  border-color: var(--primary);
  background: white;
}
.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 2px solid var(--border-light);
}
.btn-block { width: 100%; margin: 0 !important; }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.tool-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* ===== 上传区域 ===== */
.upload-zone {
  background: white;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 56px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  border: 1px solid var(--border-light);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-bg);
  border-style: solid;
}
.upload-zone .icon {
  font-size: 52px;
  margin-bottom: 18px;
  display: block;
}
.upload-zone h3 {
  font-size: 19px;
  margin-bottom: 8px;
  font-weight: 700;
}
.upload-zone p { color: var(--text-muted); font-size: 14px; }

/* ===== 预览区域 ===== */
.preview-area {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.preview-box { text-align: center; }
.preview-box h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
}
.preview-box canvas {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  image-rendering: pixelated;
  box-shadow: var(--shadow-xs);
}
.result-info {
  margin-top: 24px;
  padding: 18px;
  background: var(--bg);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 12px;
}
.info-item { text-align: center; }
.info-item .value {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.info-item .label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== 颜色图例 ===== */
.legend-area {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.legend-area h4 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}
.legend-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  cursor: pointer;
  user-select: none;
}
.legend-toggle {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}
.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: background 0.2s;
}
.legend-item:hover { background: var(--bg-alt); }
.legend-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

/* ===== 编辑器 ===== */
.editor-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 20px;
}
.editor-panel {
  background: white;
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 88px;
  border: 1px solid var(--border-light);
}
.editor-panel h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text);
  letter-spacing: -0.2px;
}
.editor-canvas-wrap {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  min-height: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--border-light);
}
.editor-canvas {
  image-rendering: pixelated;
  border-radius: var(--radius-sm);
  cursor: crosshair;
  max-width: 100%;
  box-shadow: var(--shadow-xs);
}
.tool-btn {
  width: 100%;
  padding: 11px;
  border: 2px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 6px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}
.tool-btn:hover { border-color: var(--primary); color: var(--primary); background: white; }
.tool-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  padding: 4px;
}
.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.12s;
}
.color-swatch:hover { transform: scale(1.2); z-index: 1; position: relative; }
.color-swatch.selected {
  border-color: var(--text);
  transform: scale(1.1);
  box-shadow: 0 0 0 2px white, 0 2px 6px rgba(0,0,0,0.2);
}

/* ===== 图纸库 ===== */
.gallery-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 32px 64px;
}
.gallery-search-bar {
  background: white;
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.search-box {
  position: relative;
  margin-bottom: 16px;
}
.search-box .search-input {
  width: 100%;
  padding: 13px 52px 13px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg);
  box-sizing: border-box;
}
.search-box .search-input:focus {
  border-color: var(--primary);
  background: white;
}
.search-icon-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.search-icon-btn:hover { background: var(--primary-dark); }
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group label {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}
.filter-select {
  padding: 9px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg);
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}
.filter-select:focus { border-color: var(--primary); }
.result-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.gallery-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid var(--border-light);
}
.gallery-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.gallery-thumb {
  aspect-ratio: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
}
.gallery-thumb canvas {
  image-rendering: pixelated;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.gallery-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(232,69,44,0.92);
  color: white;
  font-size: 11px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.gallery-info { padding: 16px 18px 18px; }
.gallery-info h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-info p { font-size: 12px; color: var(--text-muted); }
.gallery-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}
.card-rating { display: flex; align-items: center; gap: 4px; }
.card-stars { color: #FFC107; font-size: 12px; letter-spacing: 1px; }
.card-rating-num { color: var(--text-light); font-weight: 600; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.card-tag {
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all 0.2s;
  font-weight: 500;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 600;
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 图纸详情页 ===== */
.pattern-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 32px 60px;
}
.breadcrumb {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 6px; }
.pattern-header {
  background: white;
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.pattern-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.8px;
}
.pattern-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  color: var(--text-light);
}
.meta-tag {
  background: var(--primary-bg);
  color: var(--primary);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
}
.pattern-body {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 22px;
  margin-bottom: 22px;
}
.preview-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.preview-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.preview-controls { display: flex; gap: 8px; align-items: center; }
.ctrl-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
  font-weight: 600;
}
.ctrl-btn:hover { border-color: var(--primary); color: var(--primary); background: white; }
.zoom-level {
  font-size: 13px;
  color: var(--text-muted);
  min-width: 50px;
  text-align: center;
  font-weight: 600;
}
.preview-canvas-wrap {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
  overflow: auto;
}
.preview-canvas { image-rendering: pixelated; max-width: 100%; }
.side-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.side-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.3px;
}
.side-card h3::before {
  content: '';
  width: 4px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
}
.action-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.action-btn.btn-primary { background: var(--primary); color: white; }
.action-btn.btn-primary:hover { background: var(--primary-dark); }
.action-btn.btn-secondary {
  background: var(--bg);
  color: var(--text-secondary);
  border: 2px solid var(--border);
}
.action-btn.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.material-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.material-item {
  text-align: center;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius-md);
}
.material-item .num {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.material-item .label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.color-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.color-swatch-sm {
  width: 100%;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  box-shadow: inset 0 -1px 2px rgba(0,0,0,0.1);
}
.color-code { font-size: 11px; color: var(--text-light); font-weight: 600; }
.color-count { font-size: 11px; color: var(--text-muted); }
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); }
.info-value { color: var(--text); font-weight: 600; }
.rating-section { text-align: center; padding: 8px 0; }
.rating-big {
  font-size: 40px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -1px;
}
.rating-stars {
  font-size: 30px;
  color: var(--border);
  cursor: pointer;
  letter-spacing: 5px;
  margin: 10px 0;
}
.rating-stars .star {
  transition: transform 0.15s;
  display: inline-block;
}
.rating-stars .star:hover { transform: scale(1.2); }
.rating-stars .star.active { color: #FFC107; }
.rating-hint { font-size: 12px; color: var(--text-muted); }
.desc-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.desc-card h2 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.desc-card p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 12px;
}
.tips-box {
  background: var(--primary-bg);
  border-left: 4px solid var(--primary);
  padding: 18px 22px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 18px 0;
}
.tips-box h4 {
  color: var(--primary);
  font-size: 14px;
  margin-bottom: 8px;
  font-weight: 700;
}
.tips-box ul {
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}
.tips-box li { margin-bottom: 4px; }
.related-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.related-card h2 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 22px;
  letter-spacing: -0.5px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.related-item {
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.25s;
  cursor: pointer;
  background: white;
}
.related-item:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.related-thumb {
  height: 110px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.related-info { padding: 10px 12px; }
.related-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.related-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
  grid-column: 1/-1;
}
.empty-state .icon { font-size: 52px; margin-bottom: 18px; }
.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 18px; font-size: 14px; }

/* ===== 帮助页 ===== */
.help-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 32px 64px;
}
.help-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 34px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.help-section h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.help-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 22px 0 12px;
}
.help-section p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.8;
  font-size: 15px;
}
.help-section ol, .help-section ul {
  padding-left: 24px;
  margin-bottom: 16px;
}
.help-section li {
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.7;
  font-size: 14.5px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
  margin-right: 8px;
}
.help-card {
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin-bottom: 16px;
}
.help-card h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}
.help-card ul, .help-card ol { padding-left: 20px; margin-bottom: 8px; }
.help-card li {
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.7;
  font-size: 14px;
}
.help-card p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 8px;
}

/* ===== 页脚 ===== */
.footer {
  background: var(--nav-bg);
  color: rgba(255,255,255,0.6);
  padding: 56px 32px 28px;
  margin-top: 64px;
}
.footer-top {
  max-width: 1280px;
  margin: 0 auto 32px;
  text-align: center;
}
.footer-top h3 {
  color: white;
  font-size: 22px;
  margin-bottom: 10px;
  font-weight: 800;
}
.footer-top p {
  font-size: 14px;
  line-height: 1.75;
  color: rgba(255,255,255,0.6);
  max-width: 600px;
  margin: 0 auto;
}
.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 36px;
}
.footer-col h4 {
  color: white;
  font-size: 15px;
  margin-bottom: 18px;
  font-weight: 700;
  text-align: center;
}
.footer-col ul { list-style: none; text-align: center; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
  font-size: 14px;
  transition: color 0.2s;
  color: rgba(255,255,255,0.6);
}
.footer-col a:hover { color: var(--primary-light); }
.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}

/* ===== 三步流程 横向 ===== */
.steps-row {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-top: 16px;
}
.step-item {
  flex: 1;
  text-align: center;
}
.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}
.step-item h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text);
}
.step-item p {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.5;
}

/* ===== 移动端底部导航（新版） ===== */
#bottom-nav { display: none; }
@media (max-width: 768px) {
  #bottom-nav { display: block; }
  .bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid var(--border-light);
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    z-index: 999;
    box-shadow: 0 -4px 20px rgba(0,0,0,.07);
  }
  .bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-muted);
    padding: 7px 4px;
    border-radius: 14px;
    transition: all .2s;
  }
  .bottom-nav-item.active {
    color: var(--primary-dark);
    background: var(--primary-bg);
  }
  .bottom-nav-item .icon {
    width: 24px; height: 24px;
    display: grid; place-items: center;
  }
  .bottom-nav-item .icon svg {
    width: 22px; height: 22px;
    stroke: currentColor; fill: none;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  }
  .bottom-nav-item .label {
    font-size: 10px; font-weight: 600;
  }
  /* 中间凸起FAB按钮 */
  .bottom-nav-item.fab {
    flex: none;
    padding: 0;
    background: transparent;
    align-self: center;
  }
  .bottom-nav-item.fab .icon {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: #fff;
    box-shadow: 0 6px 18px rgba(20,184,166,.4);
    border: 3px solid #fff;
    margin-top: -20px;
  }
  .bottom-nav-item.fab .icon svg {
    width: 26px; height: 26px;
    stroke-width: 2;
  }
  .bottom-nav-item.fab .label {
    font-size: 9px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 2px;
  }
  body { padding-bottom: 0; }
  body { padding-bottom: 70px; }
}

/* ===== 加载动画 ===== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250, 248, 245, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(6px);
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 广告位 ===== */
.ad-slot {
  display: none;
  margin: 24px auto;
  text-align: center;
  max-width: 1280px;
}
.ad-slot.has-ad { display: block; }

/* ===== 通用页面容器 ===== */
.page-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 32px 64px;
}

/* ===== 关于页 ===== */
.about-section { display: flex; flex-direction: column; gap: 24px; }
.about-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 30px 34px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.about-card h3 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--primary);
  letter-spacing: -0.3px;
}
.about-card p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 10px;
  font-size: 15px;
}
.about-card ul { padding-left: 20px; margin-bottom: 12px; }
.about-card li {
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.7;
  font-size: 14.5px;
}
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg);
  border-radius: var(--radius-md);
  transition: background 0.2s;
}
.contact-item:hover { background: var(--bg-alt); }
.contact-icon {
  width: 46px;
  height: 46px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}
.contact-item strong { display: block; font-size: 14px; margin-bottom: 2px; }
.contact-item p { font-size: 13px; color: var(--text-light); margin: 0; }

/* ===== 表单通用 ===== */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group input[type="number"],
.form-group select,
.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg);
  transition: border-color 0.2s;
  box-sizing: border-box;
  outline: none;
}
.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  background: white;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ===== 裁剪弹窗 ===== */
.crop-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.crop-modal.show { display: flex; }
.crop-modal-box {
  background: white;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 960px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.3);
}
.crop-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 26px 30px 18px;
  border-bottom: 1px solid var(--border-light);
}
.crop-modal-header h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.5px;
}
.crop-modal-header p {
  font-size: 13px;
  color: var(--text-light);
  margin: 6px 0 0;
}
.crop-close-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.crop-close-btn:hover { background: var(--border); color: var(--text); }
.crop-modal-body {
  display: flex;
  gap: 28px;
  padding: 26px 30px;
  flex: 1;
  overflow: auto;
}
.crop-preview-wrap { flex: 1; min-width: 0; }
.crop-preview-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}
.crop-preview-container {
  position: relative;
  background: #f5f0e8;
  background-image: radial-gradient(circle, #ddd 1px, transparent 1px);
  background-size: 20px 20px;
  border-radius: var(--radius-md);
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
}
.crop-preview-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}
.crop-box {
  position: absolute;
  border: 2px dashed var(--primary);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.35);
  cursor: move;
  box-sizing: border-box;
}
.crop-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.3) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
  pointer-events: none;
}
.crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: white;
  border: 2px solid var(--primary);
  border-radius: 50%;
  z-index: 2;
}
.crop-handle.nw { top: -7px; left: -7px; cursor: nwse-resize; }
.crop-handle.ne { top: -7px; right: -7px; cursor: nesw-resize; }
.crop-handle.sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.crop-handle.se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.crop-settings-panel {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.crop-setting-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.crop-setting-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.crop-reset-btn {
  font-size: 12px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.crop-reset-btn:hover { background: var(--primary-bg); }
.crop-slider-row { display: flex; align-items: center; gap: 10px; }
.crop-step-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: white;
  font-size: 18px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  font-weight: 600;
}
.crop-step-btn:hover { border-color: var(--primary); color: var(--primary); }
.crop-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}
.crop-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(232,69,44,0.4);
  border: 3px solid white;
}
.crop-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 6px rgba(232,69,44,0.4);
}
.crop-size-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
  justify-content: center;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-md);
}
.crop-size-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.crop-size-x { font-size: 16px; color: var(--text-muted); }
.crop-size-unit { font-size: 13px; color: var(--text-muted); margin-left: 4px; }
.crop-setting-divider { height: 1px; background: var(--border-light); }
.crop-number-input, .crop-select {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.crop-number-input:focus, .crop-select:focus { border-color: var(--primary); background: white; }
.crop-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 30px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

/* ===== 分享弹窗 ===== */
.share-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.share-modal.show { display: flex; }
.share-modal-content {
  background: white;
  border-radius: var(--radius-xl);
  padding: 34px;
  width: 90%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
}
.share-modal-content h3 {
  margin-bottom: 22px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.share-modal-content input, .share-modal-content select {
  width: 100%;
  padding: 11px 14px;
  margin-bottom: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.share-modal-content input:focus, .share-modal-content select:focus {
  border-color: var(--primary);
  background: white;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; text-align: center; gap: 40px; padding: 48px 24px; }
  .hero p { margin-left: auto; margin-right: auto; }
  .hero-buttons { justify-content: center; }
  .hero-visual { height: 320px; }
  .features-grid { grid-template-columns: 1fr; }
  .tool-container { grid-template-columns: 1fr; padding: 20px 24px; }
  .tool-sidebar { position: static; order: 2; }
  .tool-main { order: 1; }
  .preview-grid { grid-template-columns: 1fr; }
  .editor-container { grid-template-columns: 1fr; padding: 20px 24px; }
  .editor-panel { position: static; order: 2; }
  .editor-canvas-wrap { order: 1; min-height: auto; padding: 20px; }
  .editor-panel:last-child { order: 3; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .pattern-body { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-inner { padding: 0 20px; }
}
@media (max-width: 768px) {
  .hero { grid-template-columns: 1fr; padding: 32px 20px; gap: 24px; }
  .hero-visual { order: 2; margin-top: 8px; height: 200px; }
  .hero-beads { padding: 16px; gap: 2px; transform: rotate(-2deg); }
  .bead { width: 14px; height: 14px; }
  .hero-content { order: 1; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 14px; margin-bottom: 20px; }
  .hero-buttons { gap: 10px; }
  .hero-buttons .btn { padding: 12px 16px; font-size: 14px; flex: 1; min-width: 0; }
  .hero-features { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-feature-item { background: white; border-radius: 10px; padding: 10px 8px; box-shadow: var(--shadow-sm); }
  .hero-feature-item .num { font-size: 18px; }
  .hero-feature-item .label { font-size: 11px; }
  .section-title h2, .section-header h2 { font-size: 22px; }
  .features { padding: 24px 16px; }
  .features-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .feature-card { padding: 14px 12px; }
  .feature-icon { width: 36px; height: 36px; font-size: 18px; margin-bottom: 8px; }
  .feature-card h3 { font-size: 14px; margin-bottom: 4px; }
  .feature-card p { font-size: 11px; line-height: 1.5; }
  .steps-row { padding: 14px 12px; gap: 8px; margin-top: 12px; }
  .step-num { width: 28px; height: 28px; font-size: 14px; margin-bottom: 6px; }
  .step-item h4 { font-size: 12px; margin-bottom: 2px; }
  .step-item p { font-size: 10px; line-height: 1.4; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .footer-col h4 { font-size: 12px; margin-bottom: 10px; }
  .footer-col li { margin-bottom: 6px; }
  .footer-col a { font-size: 11px; }
  .footer-top { margin-bottom: 20px; }
  .footer-top h3 { font-size: 18px; margin-bottom: 6px; }
  .footer-top p { font-size: 11px; line-height: 1.6; max-width: 100%; }
  .footer-bottom { font-size: 10px; padding-top: 16px; }
  .crop-modal-body { flex-direction: column; padding: 20px; }
  .crop-settings-panel { width: 100%; }
  .pattern-header, .desc-card, .related-card, .preview-card { padding: 18px; }
  .pattern-title { font-size: 20px; }
  .nav-cta { padding: 6px 14px !important; font-size: 13px !important; }
  .compare-section { padding: 24px 16px; }
  .compare-wrap { height: 180px; }
  .themes-section { padding: 24px 16px; }
  .themes-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .theme-card { padding: 16px 12px; }
  .theme-icon { font-size: 28px; margin-bottom: 6px; }
  .theme-card h4 { font-size: 14px; margin-bottom: 2px; }
  .theme-card p { font-size: 11px; }
}
@media (max-width: 500px) {
  .hero { padding: 24px 16px; }
  .hero h1 { font-size: 22px; letter-spacing: -0.5px; }
  .hero p { font-size: 13px; line-height: 1.6; margin-bottom: 16px; }
  .hero-tag { font-size: 11px; padding: 4px 10px; }
  .hero-buttons { flex-direction: row; gap: 8px; }
  .hero-buttons .btn { width: auto; flex: 1; padding: 10px 12px; font-size: 13px; }
  .hero-features { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-feature-item { padding: 8px 6px; }
  .hero-feature-item .num { font-size: 16px; }
  .hero-feature-item .label { font-size: 10px; }
  .logo .logo-img { height: 30px !important; }
  .logo span { font-size: 15px !important; margin-left: 6px !important; }
  .nav-cta { padding: 6px 10px !important; font-size: 11px !important; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .related-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .sidebar-actions .btn { padding: 12px; font-size: 14px; }
  .setting-input { font-size: 16px; }
  .pattern-header h1 { font-size: 20px; }
  .info-row { font-size: 13px; }
  .btn-block { padding: 12px; font-size: 14px; }
  .editor-panel { padding: 16px; }
  .editor-panel .color-picker-grid { max-height: 280px; }
  .tool-btn { padding: 10px; font-size: 14px; }
  .gallery-search-bar { padding: 16px; }
  .search-box { margin-bottom: 12px; }
  .search-box .search-input { font-size: 14px; padding: 11px 44px 11px 14px; }
  .search-icon-btn { width: 36px; height: 36px; font-size: 16px; }
  .filter-row { gap: 10px; }
  .filter-group { flex: 1; min-width: 45%; }
  .filter-select { width: 100%; font-size: 13px; padding: 8px; }
  .mobile-menu a { padding: 12px 20px; }
}
@media (max-width: 380px) {
  .search-box .search-input { font-size: 12px; padding: 10px 40px 10px 12px; }
  .search-icon-btn { width: 32px; height: 32px; font-size: 14px; right: 4px; }
  .filter-group { min-width: 100%; }
}
