:root {
  --ink: #111827;
  --muted: #687385;
  --paper: #fbfcff;
  --surface: rgba(255, 255, 255, 0.84);
  --cyan: #00a7c8;
  --blue: #3157d5;
  --violet: #6d4aff;
  --lime: #9edb63;
  --line: rgba(17, 24, 39, 0.12);
  --shadow: 0 26px 90px rgba(24, 40, 94, 0.18);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(17, 24, 39, 0.045) 1px, transparent 1px),
    radial-gradient(circle at 12% 10%, rgba(0, 167, 200, 0.22), transparent 28rem),
    radial-gradient(circle at 88% 4%, rgba(109, 74, 255, 0.18), transparent 25rem),
    linear-gradient(180deg, #eef8ff 0%, #fbfcff 48%, #f4f7ef 100%);
  background-size: 32px 32px, 32px 32px, auto, auto, auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

#canvasHint {
  text-align: center;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 24px;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: white;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: -0.08em;
  border-radius: 14px;
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(255, 255, 255, 0.28) 47% 53%, transparent 54%),
    linear-gradient(145deg, var(--cyan), var(--blue) 55%, var(--violet));
  box-shadow: 0 14px 34px rgba(49, 87, 213, 0.28);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.desktop-nav {
  display: flex;
  gap: 26px;
  color: rgba(17, 24, 39, 0.72);
  font-size: 14px;
}

.desktop-nav a:hover {
  color: var(--blue);
}

.header-cta,
.button,
.control-panel button,
.preprocess-panel button,
.payment-placeholder button {
  border: 0;
  border-radius: 999px;
  font-weight: 850;
}

.header-cta {
  padding: 12px 18px;
  color: white;
  background: var(--ink);
}

.section-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 72px 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(360px, 0.78fr) minmax(760px, 1.22fr);
  align-items: start;
  gap: 42px;
  min-height: calc(100vh - 80px);
}

.hero h1 {
  max-width: 80%;
  margin: 0;
  font-size: clamp(44px, 6.7vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.hero-copy p {
  max-width: 100%;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
}

.button.primary {
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 16px 34px rgba(49, 87, 213, 0.28);
}

.button.ghost {
  background: white;
  border: 1px solid var(--line);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 590px;
  margin: 42px 0 0;
}

.hero-stats div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.68);
}

.hero-stats dt {
  font-size: 20px;
  font-weight: 950;
}

.hero-stats dd {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.tool-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.88);
  border-radius: 34px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.tool-topbar {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.tool-topbar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #f7c948;
}

.tool-topbar span:first-child {
  background: #ff6b6b;
}

.tool-topbar span:nth-child(2) {
  background: #35d07f;
}

.tool-topbar > strong {
  margin-left: 10px;
  font-size: 14px;
}

.tool-topbar-actions {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: 16px;
}

.tool-topbar-actions[hidden] {
  display: none !important;
}

.topbar-upload,
.topbar-blank,
.topbar-preprocess {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.topbar-blank {
  color: var(--blue);
  background: rgba(49, 87, 213, 0.08);
}

.topbar-preprocess {
  color: #166534;
  background: rgba(158, 219, 99, 0.16);
}

.tool-topbar em {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.tool-topbar em[data-state="working"] {
  color: var(--blue);
}

.tool-topbar em[data-state="ready"] {
  color: #166534;
}

.tool-topbar em[data-state="error"] {
  color: #b42318;
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.82fr) minmax(420px, 1.18fr) minmax(240px, 0.72fr);
  align-items: stretch;
  gap: 18px;
  padding: 22px;
}

.upload-panel,
.canvas-panel,
.control-panel,
.features article,
.workflow article,
.stats-card,
.payment-placeholder {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--paper);
}

.upload-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  min-width: 0;
  transition: padding 180ms ease, gap 180ms ease;
}

.upload-panel input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upload-panel label {
  display: grid;
  min-height: 300px;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 2px dashed rgba(49, 87, 213, 0.34);
  border-radius: 22px;
  background:
    linear-gradient(90deg, rgba(49, 87, 213, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(49, 87, 213, 0.08) 1px, transparent 1px);
  background-size: 18px 18px;
  cursor: pointer;
  text-align: center;
  transition: min-height 180ms ease, padding 180ms ease, gap 180ms ease;
}

.upload-panel.dragging label {
  border-color: var(--cyan);
  background-color: rgba(0, 167, 200, 0.06);
}

.upload-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  color: white;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  font-size: 32px;
  font-weight: 300;
}

.upload-panel small {
  max-width: 210px;
  color: var(--muted);
  line-height: 1.55;
}

.blank-board {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--blue);
  font-weight: 850;
  transition: min-height 180ms ease, font-size 180ms ease;
}

.canvas-panel {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 14px;
  min-height: 100%;
  min-width: 0;
  padding: 18px 22px 16px;
  text-align: center;
}

.canvas-frame {
  position: relative;
  display: grid;
  width: min(100%, 560px);
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  overflow: auto;
  border-radius: 26px;
  background:
    linear-gradient(45deg, rgba(17, 24, 39, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(17, 24, 39, 0.05) 25%, transparent 25%),
    #ffffff;
  background-size: 24px 24px;
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.08);
}

body.preview-protected .canvas-frame {
  outline: 2px dashed rgba(49, 87, 213, 0.45);
  outline-offset: 4px;
}

body.preview-protected .canvas-frame::after {
  content: "未付款预览 · 兑换卡密后下载正式图纸";
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: rgba(17, 24, 39, 0.72);
  pointer-events: none;
}



#previewCanvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  touch-action: none;
  cursor: crosshair;
}

#previewCanvas,
#sourcePreviewCanvas,
#processedPreviewCanvas,
#mobile-download-overlay img,
.canvas-frame canvas,
.compare-frame canvas {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
}

.canvas-panel p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.compare-panel {
  display: grid;
  gap: 12px;
  width: min(100%, 760px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
}

.compare-panel[hidden] {
  display: none !important;
}

.compare-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.compare-head strong {
  color: var(--ink);
  font-size: 14px;
}

.compare-head span {
  color: var(--muted);
  font-size: 12px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.compare-card {
  display: grid;
  gap: 8px;
}

.compare-card > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compare-frame {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(45deg, rgba(17, 24, 39, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(17, 24, 39, 0.04) 25%, transparent 25%),
    #ffffff;
  background-size: 20px 20px;
}

.compare-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.control-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
  min-width: 0;
}

.editor-panel {
  display: none;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(49, 87, 213, 0.04);
}

.preprocess-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(49, 87, 213, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(49, 87, 213, 0.08), rgba(109, 74, 255, 0.04));
}

.preprocess-modal {
  width: min(520px, calc(100vw - 48px));
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(49, 87, 213, 0.08), rgba(0, 167, 200, 0.05)),
    rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 70px rgba(17, 24, 39, 0.18);
}

.preprocess-head {
  display: grid;
  gap: 4px;
}

.preprocess-head strong {
  color: var(--ink);
  font-size: 14px;
}

.preprocess-head small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.preprocess-panel input[type="range"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tool-card.pattern-ready .tool-grid {
  grid-template-columns: minmax(0, 1.9fr) minmax(250px, 0.78fr);
}

.tool-card.pattern-ready .upload-panel {
  display: none;
}

.tool-card.pattern-ready .canvas-frame {
  width: min(100%, 880px);
}

.tool-card.pattern-ready .tool-topbar-actions {
  display: inline-flex;
}

.tool-card.pattern-ready .editor-panel {
  display: grid;
}

.editor-head,
.editor-active {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editor-head strong {
  font-size: 14px;
  color: var(--ink);
}

.editor-head span,
.editor-active span {
  color: var(--muted);
  font-size: 12px;
}

.editor-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.editor-tool {
  min-height: 40px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.editor-tool.secondary {
  color: var(--blue);
  background: rgba(49, 87, 213, 0.1);
}

.editor-tool:disabled {
  color: rgba(17, 24, 39, 0.45);
  background: rgba(17, 24, 39, 0.08);
  cursor: not-allowed;
}

.editor-active {
  justify-content: flex-start;
}

.editor-active i {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 6px;
  background: #ffffff;
}

.editor-palette {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.palette-swatch {
  display: grid;
  gap: 6px;
  place-items: center;
  min-height: 58px;
  padding: 8px 4px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.palette-swatch i {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  border-radius: 8px;
}

.palette-swatch.active {
  border-color: rgba(49, 87, 213, 0.38);
  box-shadow: 0 0 0 2px rgba(49, 87, 213, 0.1);
}

.palette-swatch:hover {
  transform: translateY(-1px);
}

.control-note {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.control-panel label,
.preprocess-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.control-panel output {
  float: right;
  color: var(--ink);
  font-weight: 900;
}

.control-panel input[type="range"] {
  accent-color: var(--blue);
}

.control-panel select,
.preprocess-panel select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--ink);
  padding: 0 10px;
}

.control-panel textarea,
.preprocess-panel textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  font: 600 13px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.control-panel textarea:disabled,
.preprocess-panel textarea:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.prompt-field button {
  width: 100%;
}

.ai-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(5px);
}

.ai-overlay[hidden] {
  display: none;
}

.preprocess-overlay {
  z-index: 980;
}

.debug-overlay {
  z-index: 1200;
  background: rgba(6, 10, 22, 0.72);
}

.debug-overlay-content {
  max-width: 420px;
}

.ai-overlay-content {
  display: grid;
  justify-items: center;
  gap: 14px;
  max-width: 360px;
  padding: 28px;
  border-radius: 18px;
  color: var(--ink);
  text-align: center;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
}

.ai-overlay-content strong {
  font-size: 18px;
}

.ai-overlay-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.ai-overlay-content .ai-wait-text {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.ai-overlay-content button {
  min-width: 160px;
  margin-top: 4px;
}

.error-overlay .ai-overlay-content {
  max-width: 420px;
}

.error-overlay .ai-overlay-content p {
  color: #1f2937;
}

.error-overlay .ai-overlay-content button {
  margin-top: 12px;
  width: 100%;
}

.ai-spinner {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(49, 87, 213, 0.18);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: ai-spin 0.9s linear infinite;
}

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

.actions {
  display: grid;
  gap: 10px;
}

.control-panel button,
.preprocess-panel button {
  min-height: 46px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.control-panel button.secondary,
.preprocess-panel button.secondary {
  color: var(--blue);
  background: rgba(49, 87, 213, 0.1);
}

.control-panel button:disabled,
.preprocess-panel button:disabled {
  color: rgba(17, 24, 39, 0.45);
  background: rgba(17, 24, 39, 0.08);
  cursor: not-allowed;
  box-shadow: none;
}

.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.features article,
.workflow article {
  padding: 24px;
  box-shadow: 0 14px 36px rgba(17, 24, 39, 0.06);
}

.features span {
  color: var(--blue);
  font-weight: 950;
}

.features h2,
.workflow h2,
.stats-section h2,
.membership h2 {
  margin: 10px 0 0;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -0.04em;
}

.features article h2 {
  font-size: 24px;
}

.features p,
.stats-section p,
.workflow p,
.membership p {
  color: var(--muted);
  line-height: 1.75;
}

.stats-section,
.membership {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  align-items: center;
  gap: 46px;
}

.stats-card {
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stats-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.stats-head span {
  color: var(--blue);
  font-weight: 950;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 40px);
  min-height: 44px;
  margin: 4px 20px 12px;
  padding: 0 14px;
  border: 0;
  border-radius: 11px;
  background: rgba(49, 87, 213, 0.1);
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background 0.15s ease,
    opacity 0.15s ease;
}

.copy-btn svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.copy-btn:hover:not(:disabled) {
  background: rgba(49, 87, 213, 0.16);
}

.copy-btn:disabled {
  color: rgba(17, 24, 39, 0.45);
  background: rgba(17, 24, 39, 0.08);
  cursor: not-allowed;
}

.copy-btn.copied {
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
}

.app-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 2000;
  transform: translate(-50%, 12px);
  max-width: 80vw;
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.app-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.size-hint {
  margin: 0;
  padding: 0 20px 10px;
  color: var(--muted);
  font-size: 12px;
}

.palette-list {
  display: grid;
  max-height: 430px;
  overflow: auto;
}

.palette-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.07);
}

.palette-row i {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(17, 24, 39, 0.16);
  border-radius: 10px;
}

.palette-row strong,
.palette-row small {
  display: block;
}

.palette-row small,
.empty-state {
  color: var(--muted);
}

.palette-row em {
  color: var(--ink);
  font-style: normal;
  font-weight: 950;
}

.palette-preview {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.palette-preview i {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(17, 24, 39, 0.18);
  border-radius: 6px;
}

.palette-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 8px;
}

.palette-filter {
  padding: 4px 10px;
  border: 1px solid rgba(49, 87, 213, 0.16);
  border-radius: 999px;
  background: rgba(49, 87, 213, 0.06);
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.palette-filter:hover {
  background: rgba(49, 87, 213, 0.12);
}

.palette-filter.active {
  background: #3157d5;
  border-color: #3157d5;
  color: #fff;
}

.palette-empty {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  margin: 0;
  padding: 24px 20px;
}

.workflow {
  text-align: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 30px;
  text-align: left;
}

.workflow strong {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: white;
  border-radius: 16px;
  background: var(--ink);
}

.payment-placeholder {
  display: grid;
  gap: 14px;
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(0, 167, 200, 0.1), rgba(109, 74, 255, 0.1)),
    var(--paper);
}

.payment-placeholder strong {
  font-size: 30px;
}

.payment-placeholder span {
  color: var(--blue);
  font-weight: 950;
}

.payment-placeholder button {
  width: fit-content;
  padding: 14px 22px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.payment-placeholder button.secondary {
  color: var(--blue);
  background: rgba(49, 87, 213, 0.1);
}

.payment-placeholder button:disabled {
  color: rgba(17, 24, 39, 0.48);
  background: rgba(17, 24, 39, 0.08);
  cursor: not-allowed;
}

.card-modal-overlay {
  z-index: 1300;
}

.project-modal {
  width: min(560px, calc(100vw - 40px));
  gap: 16px;
  padding: 24px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(49, 87, 213, 0.08), rgba(109, 74, 255, 0.03)),
    rgba(255, 255, 255, 0.98);
}

.project-modal .preprocess-head {
  align-items: flex-start;
}

.project-form {
  display: flex;
  gap: 10px;
}

.project-form input {
  flex: 1;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.project-list {
  display: grid;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
}

.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
}

.project-info {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.project-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.project-info span {
  color: var(--muted);
  font-size: 12px;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-actions button {
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: var(--accent, #3157d5);
  color: white;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.project-actions button.secondary {
  background: rgba(49, 87, 213, 0.1);
  color: #3157d5;
}

.project-actions button.danger {
  background: rgba(225, 29, 72, 0.1);
  color: #e11d48;
}

.card-modal {
  width: min(540px, calc(100vw - 40px));
  gap: 16px;
  padding: 24px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(49, 87, 213, 0.08), rgba(109, 74, 255, 0.03)),
    rgba(255, 255, 255, 0.98);
}

.card-modal-badge {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 900;
  background: rgba(49, 87, 213, 0.1);
}

.card-modal-benefits {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(49, 87, 213, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
}

.card-modal-benefits span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

body.modal-open {
  overflow: hidden;
}

.card-redeem-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.card-redeem-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.card-redeem-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card-redeem-actions button:first-child {
  min-width: 168px;
  box-shadow: 0 16px 34px rgba(49, 87, 213, 0.22);
}

.card-redeem-message {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.csv-preview-modal {
  width: min(620px, calc(100vw - 40px));
}

.csv-preview-body {
  max-height: 320px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.04);
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre;
}

/* 拼豆品牌指南 */
.guide-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.85);
}

.guide-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
}

.guide-table th,
.guide-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

.guide-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  background: rgba(49, 87, 213, 0.05);
}

.guide-table tr:last-child td {
  border-bottom: 0;
}

.guide-table td:first-child {
  font-weight: 800;
  color: var(--ink);
}

.guide-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.card-redeem-message[data-state="success"] {
  color: #166534;
}

.card-redeem-message[data-state="error"] {
  color: #b91c1c;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 34px 24px 48px;
  color: var(--muted);
}

.site-footer strong {
  color: var(--ink);
}

@media (max-width: 1060px) {
  .desktop-nav {
    display: none;
  }

  .hero,
  .stats-section,
  .membership {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-card.pattern-ready .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-topbar-actions {
    order: 3;
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
  }

  .editor-palette {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .features,
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .compare-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1061px) and (max-width: 1600px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    min-height: auto;
  }

  .tool-grid {
    grid-template-columns: minmax(240px, 0.82fr) minmax(420px, 1.18fr) minmax(240px, 0.72fr);
  }

  .canvas-frame {
    width: min(100%, 560px);
  }

  .tool-card.pattern-ready .tool-grid {
    grid-template-columns: minmax(0, 1.8fr) minmax(240px, 0.82fr);
  }

  .tool-card.pattern-ready .canvas-frame {
    width: min(100%, 820px);
  }
}

@media (max-width: 640px) {
  .site-header {
    padding: 14px 16px;
  }

  .header-cta {
    display: none;
  }

  .section-shell {
    padding: 52px 16px;
  }

  .hero-stats,
  .features,
  .steps {
    grid-template-columns: 1fr;
  }

  .editor-toolbar,
  .editor-palette {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer {
    flex-direction: column;
    padding-inline: 16px;
  }
}
