/* 拼图工坊 · 站点样式 */
:root {
  --ink: #14161c;
  --ink-2: #3b4150;
  --muted: #7b8294;
  --line: #ececf2;
  --bg: #f7f8fb;
  --card: #ffffff;
  --brand: #ff5a36;
  --brand-2: #ff2d55;
  --violet: #6a5cff;
  --violet-2: #8f7bff;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(20, 22, 28, .06);
  --shadow-lg: 0 24px 70px rgba(20, 22, 28, .14);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn.primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff; box-shadow: 0 10px 24px rgba(255, 72, 60, .28);
}
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(255, 72, 60, .34); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn.ghost:hover { border-color: #d8dbe6; transform: translateY(-1px); }
.btn.lg { height: 52px; padding: 0 28px; font-size: 16px; }
.btn.block { width: 100%; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(20, 22, 28, .06);
}
.nav-inner {
  max-width: 1220px; margin: 0 auto; padding: 0 28px;
  height: 68px; display: flex; align-items: center; gap: 32px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 30px; height: 30px; display: block; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { font-size: 17px; font-weight: 800; letter-spacing: .5px; }
.nav-links { display: flex; gap: 6px; flex: 1; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; font-size: 14.5px; color: var(--ink-2);
  transition: background .16s ease, color .16s ease;
}
.nav-links a:hover { background: #f1f2f7; }
.nav-links a.on { color: var(--ink); font-weight: 700; background: #fff2ee; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-right .btn { height: 38px; padding: 0 18px; font-size: 14px; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  border: 0; color: #fff; font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, var(--violet), var(--brand));
  display: inline-flex; align-items: center; justify-content: center;
}
.user-menu { position: relative; }
.user-drop {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 210px; padding: 8px; border-radius: 16px; background: #fff;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all .18s ease;
}
.user-menu.open .user-drop { opacity: 1; visibility: visible; transform: none; }
.user-drop-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.user-drop-head strong { display: block; font-size: 14.5px; }
.user-drop-head span { font-size: 12px; color: var(--muted); }
.user-drop a { display: block; padding: 9px 12px; border-radius: 10px; font-size: 14px; }
.user-drop a:hover { background: #f4f5f9; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; overflow: hidden; }
.hero-inner {
  max-width: 1220px; margin: 0 auto; padding: 0 28px;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center;
}
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2); box-shadow: var(--shadow);
}
.pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.hero h1 {
  margin: 22px 0 18px; font-size: clamp(36px, 4.4vw, 60px); line-height: 1.24; letter-spacing: -1px;
}
.hero h1 em { display: inline-block; margin-top: 2px; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--brand) 10%, var(--brand-2) 45%, var(--violet) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { max-width: 560px; color: var(--muted); font-size: 16px; }
.hero-actions { display: flex; gap: 12px; margin: 30px 0 34px; flex-wrap: wrap; }
.hero-stats { list-style: none; display: flex; gap: 40px; padding: 0; margin: 0; }
.hero-stats strong { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.hero-stats span { font-size: 13px; color: var(--muted); }

.hero-visual { position: relative; }
.collage-stage {
  position: relative; width: 100%; aspect-ratio: 1 / 1.02;
  border-radius: 28px; background: #fff; box-shadow: var(--shadow-lg);
  padding: 26px;
}
.collage-stage::before {
  content: ""; position: absolute; inset: 26px; border-radius: 18px;
  background:
    radial-gradient(120px 120px at 20% 20%, rgba(255, 178, 107, .22), transparent 70%),
    radial-gradient(160px 160px at 85% 80%, rgba(106, 92, 255, .16), transparent 70%),
    #fbfbfd;
}
.tile { position: absolute; border-radius: 16px; overflow: hidden; box-shadow: 0 16px 34px rgba(20, 22, 28, .16); }
.tile svg { width: 100%; height: 100%; display: block; }
.tile.t1 { width: 46%; height: 54%; left: 9%; top: 9%; transform: rotate(-4deg); z-index: 3; }
.tile.t2 { width: 38%; height: 24%; right: 8%; top: 11%; transform: rotate(6deg); z-index: 2; }
.tile.t3 { width: 40%; height: 30%; right: 7%; bottom: 12%; transform: rotate(-3deg); z-index: 4; }
.tile.t4 { width: 30%; height: 24%; left: 13%; bottom: 13%; transform: rotate(7deg); z-index: 2; }
.float-chip {
  position: absolute; padding: 9px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  box-shadow: 0 10px 24px rgba(20, 22, 28, .12); z-index: 6;
  animation: floaty 5s ease-in-out infinite;
}
.chip-a { left: 2%; bottom: 30%; }
.chip-b { right: 2%; top: 40%; animation-delay: -2.4s; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- 区块 ---------- */
.section { max-width: 1220px; margin: 0 auto; padding: 42px 28px 30px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.section-head h2 { margin: 0 0 6px; font-size: clamp(22px, 2.4vw, 30px); letter-spacing: -.5px; }
.section-head p { margin: 0; color: var(--muted); font-size: 14.5px; }
.more { color: var(--brand); font-weight: 700; font-size: 14px; white-space: nowrap; }
.more:hover { text-decoration: underline; }

/* ---------- 模板卡片 ---------- */
.tpl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.tpl-grid.wide { grid-template-columns: repeat(4, 1fr); }
.page-main .tpl-grid.wide { margin-bottom: 40px; }
.tpl-card {
  background: var(--card); border-radius: var(--radius); padding: 12px;
  border: 1px solid var(--line);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.tpl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #e2e4ee; }
.tpl-thumb {
  position: relative; border-radius: 14px; overflow: hidden; background: #f4f5f9;
  display: flex; align-items: center; justify-content: center; padding: 12px;
  height: 306px;
}
.tpl-thumb svg { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 10px; box-shadow: 0 6px 18px rgba(20, 22, 28, .08); }
.tpl-go {
  position: absolute; left: 50%; bottom: 16px; transform: translate(-50%, 12px);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 13px; font-weight: 700; padding: 8px 18px; border-radius: 999px;
  opacity: 0; transition: all .22s ease; box-shadow: 0 8px 20px rgba(255, 72, 60, .34);
}
.tpl-card:hover .tpl-go { opacity: 1; transform: translate(-50%, 0); }
.tpl-meta { padding: 12px 6px 4px; }
.tpl-meta strong { display: block; font-size: 15px; }
.tpl-meta span { font-size: 12.5px; color: var(--muted); }

/* ---------- 玩法 ---------- */
.way-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.way-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 24px;
}
.way-art { border-radius: 16px; overflow: hidden; background: #f5f6fa; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; padding: 12px; }
.way-art svg { width: 100%; height: auto; }
.way-card h3 { margin: 18px 4px 6px; font-size: 18px; }
.way-card p { margin: 0 4px; color: var(--muted); font-size: 14px; }

/* ---------- 工具卡 ---------- */
.tool-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tool-card {
  display: flex; align-items: flex-start; gap: 16px;
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #ffd9cf; }
.tool-ico {
  flex: 0 0 48px; width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: #fff2ee; color: var(--brand);
}
.tool-card h3 { margin: 0 0 4px; font-size: 17px; }
.tool-card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.tool-go { margin-left: auto; align-self: center; color: var(--brand); font-weight: 700; font-size: 13.5px; white-space: nowrap; }

/* ---------- 步骤 ---------- */
.step-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px;
}
.step-list li {
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px;
}
.step-num {
  display: inline-block; font-size: 12px; letter-spacing: 1px; color: var(--brand);
  background: #fff2ee; padding: 3px 10px; border-radius: 999px;
}
.step-title { display: block; margin: 14px 0 6px; font-size: 17px; font-weight: 700; }
.step-list p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- CTA ---------- */
.cta { max-width: 1220px; margin: 30px auto 80px; padding: 0 28px; }
.cta-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
  padding: 44px 46px; border-radius: 28px;
  background: linear-gradient(120deg, #201a2e 0%, #3a2350 45%, #51243b 100%);
  color: #fff; box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.cta-inner::after {
  content: ""; position: absolute; width: 400px; height: 400px; right: -120px; top: -160px;
  background: radial-gradient(circle, rgba(255, 90, 54, .55), transparent 65%);
}
.cta-inner h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.5px; }
.cta-inner p { margin: 0; opacity: .78; font-size: 14.5px; }
.cta-inner .btn { position: relative; z-index: 2; }

/* ---------- 页脚 ---------- */
.foot { background: #fff; border-top: 1px solid var(--line); margin-top: 20px; }
.foot-inner {
  max-width: 1220px; margin: 0 auto; padding: 40px 28px 26px;
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.foot-brand .brand-text { font-size: 16px; font-weight: 800; }
.foot-brand p { margin: 8px 0 0; color: var(--muted); font-size: 13.5px; }
.foot-links { display: flex; gap: 20px; align-items: center; font-size: 14px; color: var(--ink-2); }
.foot-links a:hover { color: var(--brand); }
.foot-bar { text-align: center; padding: 14px 0 22px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- 列表页 ---------- */
.page-main { padding-bottom: 40px; }
.page-hero { max-width: 1220px; margin: 0 auto; padding: 46px 28px 10px; }
.page-hero-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-hero h1 { margin: 0 0 8px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.5px; }
.page-hero p { margin: 0; color: var(--muted); font-size: 15px; }

.filters { margin-top: 26px; display: flex; flex-direction: column; gap: 10px; }
.filter-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-row > span { font-size: 13px; color: var(--muted); width: 42px; }
.chip {
  padding: 6px 15px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: 13.5px; color: var(--ink-2); transition: all .16s ease;
}
.chip:hover { border-color: #ffc9bd; color: var(--brand); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.empty {
  background: #fff; border: 1px dashed #d9dce8; border-radius: 22px;
  padding: 50px 24px; text-align: center; color: var(--muted);
}
.empty-actions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }

/* ---------- 作品卡片 ---------- */
.work-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.work-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 12px; }
.work-thumb {
  display: flex; align-items: center; justify-content: center;
  height: 246px; border-radius: 12px; overflow: hidden; background: #f4f5fa; padding: 8px;
}
.work-thumb img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.work-ph { color: var(--muted); font-size: 13px; }
.work-meta { padding: 10px 4px 4px; }
.work-meta strong { display: block; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-meta span { font-size: 12px; color: var(--muted); }
.work-actions { display: flex; gap: 8px; padding: 8px 2px 2px; }
.mini {
  flex: 1; text-align: center; padding: 7px 0; border-radius: 10px; font-size: 12.5px;
  background: #f4f5fa; color: var(--ink-2); border: 0; font-weight: 600;
}
.mini:hover { background: #ebedf5; }
.mini.danger { color: #d33; background: #fff1f1; flex: 0 0 64px; }
.mini.danger:hover { background: #ffe3e3; }

/* ---------- 登录 / 注册 ---------- */
.auth-wrap { max-width: 1220px; margin: 0 auto; padding: 70px 28px 90px; display: flex; justify-content: center; }
.auth-card {
  width: 100%; max-width: 420px; background: #fff; border-radius: 24px;
  padding: 38px 34px 30px; border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.auth-card h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: -.5px; }
.auth-sub { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form label { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.auth-form input {
  height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #fafbff; font-size: 14.5px; transition: border-color .16s ease, box-shadow .16s ease;
}
.auth-form input:focus { outline: none; border-color: #ffc0b3; box-shadow: 0 0 0 4px rgba(255, 90, 54, .1); background: #fff; }
.auth-form .btn { margin-top: 6px; height: 48px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 13.5px; color: var(--muted); }
.auth-foot a { color: var(--brand); font-weight: 600; }
.auth-foot .dot { margin: 0 8px; }
.alert { background: #fff3f2; color: #c5342a; border: 1px solid #ffd6d1; border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; font-size: 13.5px; }

/* ---------- 轻提示 ---------- */
.site-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 0);
  background: rgba(20, 22, 28, .92); color: #fff; font-size: 13px; padding: 10px 18px;
  border-radius: 999px; z-index: 90; transition: all .3s ease; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .tpl-grid, .tpl-grid.wide, .work-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-inner { grid-template-columns: 1fr; gap: 30px; }
  .hero-visual { max-width: 560px; margin: 0 auto; width: 100%; }
}
@media (max-width: 820px) {
  .nav-inner { gap: 10px; padding: 0 14px; height: 58px; }
  .nav-links { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { padding: 6px 9px; font-size: 13px; white-space: nowrap; }
  .nav-right .btn.ghost, .nav-right .btn.primary { display: none; }
  .tpl-thumb { height: 232px; padding: 9px; }
  .work-thumb { height: 200px; }
  .tpl-grid, .tpl-grid.wide, .work-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .tool-cards { grid-template-columns: 1fr; }
  .tool-card { flex-wrap: wrap; }
  .tool-go { margin-left: 0; }
  .way-grid, .step-list { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
  .section, .page-hero, .cta, .hero-inner { padding-left: 18px; padding-right: 18px; }
  .cta-inner { padding: 30px 24px; }
}
@media (max-width: 520px) {
  .hero h1 { font-size: 32px; }
  .hero-stats strong { font-size: 21px; }
  .brand-text { font-size: 15px; }
}

/* ---------- 图形验证码 ---------- */
.cap-row { display: flex; align-items: center; gap: 8px; }
.cap-row .cap-input {
  flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fafbff; font-size: 15px; letter-spacing: 3px; text-transform: uppercase;
}
.cap-row .cap-input:focus { outline: none; border-color: #ffc0b3; box-shadow: 0 0 0 4px rgba(255, 90, 54, .1); background: #fff; }
.cap-row .cap-img {
  width: 140px; height: 48px; flex: 0 0 140px; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; background: #fff; display: block;
}
.cap-row .cap-refresh {
  flex: 0 0 auto; border: 0; background: none; color: var(--brand); font-size: 12.5px;
  font-weight: 700; padding: 6px 2px; white-space: nowrap;
}
@media (max-width: 480px) {
  .auth-form .cap-row { flex-wrap: wrap; }
  .auth-form .cap-row .cap-input { flex: 1 1 100%; order: 1; }
  .auth-form .cap-row .cap-img { order: 2; }
  .auth-form .cap-row .cap-refresh { order: 3; }
}
