/* 毛衫设计 · 小报童风格白底 + 橙色品牌色 */
:root {
  --bg: #ffffff;
  --bg-subtle: #f7f7f8;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #8c8c8c;
  --accent: #fa8919;
  --accent-hover: #e67a00;
  --accent-dark: #d96b00;
  --accent-soft: #fff4e8;
  --border: #ebebeb;
  --border-strong: #d9d9d9;
  --input-bg: #ffffff;
  --code-bg: #f5f5f5;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-segment: 0 1px 3px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html[data-text-size="md"] { font-size: 18.5px; }
html[data-text-size="lg"] { font-size: 22px; }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.47059;
  -webkit-font-smoothing: antialiased;
  font-size: 1rem;
}

h1, h2, h3 {
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--text);
}
h1 { font-size: 1.75rem; margin: 0 0 0.75rem; line-height: 1.2; }
h2 { font-size: 1.25rem; margin: 1.25rem 0 0.5rem; }
h3 { font-size: 1.0625rem; margin: 1rem 0 0.5rem; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 1rem; }
.wrap-wide { max-width: 1280px; }

.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.logo {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  flex-shrink: 0;
  font-size: 1.0625rem;
}
.logo:hover { color: var(--accent); }

.nav-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.75rem;
}

.nav-main > a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.15rem;
  font-size: 0.9375rem;
}
.nav-main > a:hover { color: var(--accent); }
.nav-main > a.nav-register { color: var(--accent); font-weight: 600; }

.text-size-switch {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 9px;
  padding: 2px;
  flex-shrink: 0;
}

.text-size-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.3rem 0.7rem;
  border-radius: 7px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.2;
  min-width: 2.1rem;
}

.text-size-btn[aria-pressed="true"] {
  background: #ffffff;
  box-shadow: var(--shadow-segment);
  color: var(--text);
}

.site-main { padding: 2rem 0 4rem; min-height: 60vh; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  font-size: 0.875rem;
  color: var(--muted);
  background: var(--bg-subtle);
}

.site-footer a.footer-icp { color: var(--muted); text-decoration: none; }
.site-footer a.footer-icp:hover { color: var(--accent); text-decoration: underline; }
.footer-company { text-align: center; }
.footer-icp-line { margin: 0.5rem 0; font-size: 0.9375rem; color: var(--text); }
.footer-icp-num { font-weight: 700; color: var(--text) !important; }
.footer-operator { margin: 0 0 0.35rem; font-size: 0.95rem; color: var(--text); }
.footer-official { margin: 0.25rem 0 0.35rem; }
.footer-official a { color: var(--muted); }
.footer-contact { margin: 0.35rem 0; }
.footer-contact a { color: var(--muted); }
.footer-note { margin-top: 0.75rem; font-size: 0.8125rem; }

.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.lead { color: var(--muted); max-width: 40em; font-size: 1.0625rem; }
.hero-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

.home-hero {
  padding: 0.5rem 0 0.25rem;
  max-width: 40rem;
}
.home-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}
.home-lead { max-width: 38em; }
.home-promise {
  margin: 1.1rem 0 0;
  padding-left: 1.2rem;
  color: var(--text);
  font-size: 0.975rem;
  line-height: 1.55;
}
.home-promise li { margin: 0.4rem 0; }
.home-section { margin-top: 2.5rem; }
.home-section h2 { margin-bottom: 0.75rem; }
.home-section h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}
.home-cards { margin-top: 0.75rem; }
.home-benefits {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.home-benefits li {
  display: grid;
  gap: 0.2rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.home-benefits strong { color: var(--text); font-size: 1.02rem; }
.home-benefits span { color: var(--muted); font-size: 0.95rem; line-height: 1.5; }
.home-not {
  padding: 1.25rem 1.35rem;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}
.home-cta { margin-top: 2.5rem; }

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.btn {
  display: inline-block;
  padding: 0.625rem 1.125rem;
  border-radius: 980px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.2;
  min-height: 2.75rem;
}

.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.875rem; min-height: 2.25rem; }
.btn-block { width: 100%; text-align: center; }

.form label { display: block; margin-bottom: 1rem; font-weight: 500; }

.form input[type="text"],
.form input[type="email"],
.form input[type="password"],
.form input[type="number"],
.form select,
.form textarea {
  width: 100%;
  max-width: 420px;
  padding: 0.625rem 0.75rem;
  margin-top: 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  min-height: 2.75rem;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(250, 137, 25, 0.15);
}

.form textarea { min-height: 4.5rem; max-width: 100%; }

.alert { padding: 0.875rem 1rem; border-radius: var(--radius-md); margin: 0.75rem 0; font-size: 0.9375rem; }
.alert-error { background: #fff2f0; color: #cf1322; border: 1px solid #ffccc7; }
.alert-ok { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.alert-warn { background: #fffbe6; color: #ad6800; border: 1px solid #ffe58f; }

.hint { color: var(--muted); font-size: 0.9375rem; }
.label-optional { font-weight: normal; color: var(--muted); font-size: 0.875rem; }
.small { font-size: 0.875rem; }

.box-muted {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 1rem 1.125rem;
  border-radius: var(--radius-md);
  margin-top: 1.5rem;
}

.prose h2 { margin-top: 1.5rem; font-size: 1.125rem; }
.prose ul, .prose-list { padding-left: 1.25rem; }
.prose li { margin: 0.35rem 0; }
.prose a { color: var(--accent); }

.checkbox { display: flex; gap: 0.5rem; align-items: flex-start; max-width: 480px; }
.checkbox input { margin-top: 0.35rem; width: 1.125rem; height: 1.125rem; flex-shrink: 0; accent-color: var(--accent); }

.table-simple { width: 100%; border-collapse: collapse; font-size: 0.9375rem; margin: 1rem 0; }
.table-simple th, .table-simple td { border: 1px solid var(--border); padding: 0.625rem 0.75rem; text-align: left; }
.table-simple th { background: var(--bg-subtle); font-weight: 600; }

.dash-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; align-items: center; }
.inline-form { display: inline; }

code { background: var(--code-bg); padding: 0.12rem 0.4rem; border-radius: 6px; font-size: 0.9em; color: #595959; }

.subscription-banner { margin: 0; border-radius: 0; }
.card-pricing { border-color: var(--accent); }
.billing-status p { margin: 0.35rem 0; }
.tool-panel { margin-top: 2rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.tutorial-section { margin-top: 2rem; }
.steps-guide { padding-left: 1.25rem; }
.steps-guide li { margin: 0.5rem 0; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

.page-register .site-main,
.page-login .site-main { padding-top: 1.5rem; }

.register-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem 2.5rem;
  align-items: start;
}

.register-aside .register-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.register-aside h1 { font-size: 2rem; margin-bottom: 0.75rem; }
.register-points { margin: 1.25rem 0 0; padding-left: 1.25rem; }
.register-points li { margin: 0.65rem 0; line-height: 1.55; }

.register-form-card {
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow-card);
}
.register-form-card h2 { margin: 0 0 0.35rem; font-size: 1.375rem; }
.register-login-link {
  margin: 1.25rem 0 0;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.auth-layout {
  display: flex;
  justify-content: center;
  padding: 1rem 0 2rem;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}
.auth-card h1 { margin: 0 0 0.35rem; font-size: 1.5rem; }
.auth-switch {
  margin: 1.25rem 0 0;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* 编辑器 */
.page-editor .site-main { padding-top: 1rem; }

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.editor-title-field {
  flex: 1;
  min-width: 200px;
  font-weight: 600;
  margin: 0;
}

.editor-title-field input {
  display: block;
  width: 100%;
  max-width: 360px;
  margin-top: 0.35rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  min-height: 2.5rem;
}

.editor-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.editor-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.editor-layout-3 {
  grid-template-columns: minmax(240px, 280px) minmax(240px, 280px) 1fr;
}
.editor-side-libs {
  max-height: calc(100vh - 140px);
  overflow: auto;
  position: sticky;
  top: 72px;
}

.editor-side {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.editor-panel { padding: 1rem; }
.editor-panel h2 { margin: 0 0 0.75rem; font-size: 1.05rem; }

.editor-form label { margin-bottom: 0.75rem; font-size: 0.9375rem; }
.editor-form input,
.editor-form select,
.editor-form textarea {
  max-width: 100%;
  min-height: 2.35rem;
  font-size: 0.9375rem;
}

.editor-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.palette-swatch {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 2px solid var(--border-strong);
  cursor: pointer;
  padding: 0;
}

.palette-swatch.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.canvas-wrap {
  overflow: auto;
  max-height: min(70vh, 720px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background:
    linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
    linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
    linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-color: #fff;
  touch-action: none;
}

#pattern-canvas {
  display: block;
  cursor: crosshair;
  image-rendering: pixelated;
}

.editor-preview-hero {
  margin: 0 0 1rem;
  background: linear-gradient(180deg, #faf6f0 0%, #fff 55%);
}
.preview-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.preview-heading h2 { margin: 0; }
.lib-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.5rem 0 0.65rem;
}
.lib-cat-btn {
  border: 1px solid var(--border-strong);
  background: #fff;
  border-radius: 980px;
  padding: 0.25rem 0.65rem;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  color: var(--muted);
}
.lib-cat-btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 600;
}
.lib-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  max-height: 280px;
  overflow: auto;
  padding-right: 2px;
}
.lib-grid-style { max-height: 320px; }
.lib-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.45rem 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}
.lib-card:hover { border-color: var(--accent); }
.lib-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
  background: var(--accent-soft);
}
.lib-card canvas {
  image-rendering: pixelated;
  border-radius: 4px;
  background: #f3eee6;
}
.lib-card-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.lib-card-tag {
  font-size: 0.65rem;
  color: var(--muted);
}
.theme-grid {
  display: grid;
  gap: 0.4rem;
}
.theme-card {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8125rem;
  text-align: left;
}
.theme-card.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.theme-swatches {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.theme-swatches i {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.08);
}

.file-input-native {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}
.photo-pick-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-top: 0.35rem;
  cursor: pointer;
}

.editor-form input[type="range"] {
  width: 100%;
  max-width: 100%;
  min-height: auto;
  padding: 0;
  margin-top: 0.5rem;
  accent-color: var(--accent);
}

.btn.is-tool-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}

.colorway-grid {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.65rem;
  max-height: 320px;
  overflow: auto;
}
.colorway-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  grid-template-rows: auto auto;
  gap: 0.25rem 0.5rem;
  align-items: center;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  text-align: left;
}
.colorway-card:hover { border-color: var(--accent); }
.colorway-card canvas {
  grid-row: 1 / span 2;
  border-radius: 4px;
  image-rendering: pixelated;
}
.colorway-card .theme-swatches { grid-column: 2; }
.colorway-card span { grid-column: 2; color: var(--text); font-weight: 600; }

.editor-form .checkbox {
  max-width: none;
  font-weight: 500;
  font-size: 0.875rem;
}
.canvas-block-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}
.preview-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.preview-row-sock {
  justify-content: center;
}
.preview-sock-item {
  flex: 1 1 280px;
  max-width: 340px;
  text-align: center;
}
.preview-row canvas {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #f7f3ec;
  max-width: 100%;
  height: auto;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 1100px) {
  .editor-layout-3 {
    grid-template-columns: 1fr 1fr;
  }
  .editor-main { grid-column: 1 / -1; }
  .editor-side-libs { position: static; max-height: none; }
}
@media (max-width: 900px) {
  .editor-layout,
  .editor-layout-3 { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .register-layout { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 720px) {
  .header-inner { align-items: flex-start; }
  .nav-main { width: 100%; justify-content: flex-start; }
  .text-size-switch { margin-left: auto; }
  .hero h1 { font-size: 1.625rem; }
}
