:root {
  --bg: #eef3fb;
  --ink: #1b2333;
  --muted: #7b8496;
  --line: #e6ebf4;
  --blue: #3d6ef5;
  --blue-deep: #2d5ae0;
  --card: #ffffff;
  --rail: 84px;
  --shadow: 0 12px 32px rgba(54, 86, 160, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(880px 380px at 72% -8%, rgba(186, 214, 255, 0.9), transparent 68%),
    radial-gradient(640px 320px at 18% 0%, rgba(255, 255, 255, 0.95), transparent 62%),
    linear-gradient(180deg, #e7f0ff 0%, #f4f7fb 280px, #f5f7fb 100%);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { max-width: 100%; display: block; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: #fff;
  padding: 8px 12px;
  z-index: 80;
}
.skip:focus { left: 8px; }

.shell { margin-left: var(--rail); min-height: 100vh; }
.wrap { width: min(1360px, calc(100% - 48px)); margin: 0 auto; }

.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 12px;
  background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.rail-nav { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; }
.rail-item {
  width: 68px;
  min-height: 58px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #667085;
  text-decoration: none;
  font-size: 11px;
}
.rail-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rail-item:hover { color: var(--blue); background: #f4f7ff; }
.rail-item.is-on { color: var(--blue); background: #eef3ff; font-weight: 600; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  display: flex;
  align-items: center;
  background: rgba(238, 244, 252, 0.86);
  backdrop-filter: blur(16px);
}
.topbar-inner { display: flex; align-items: center; gap: 18px; min-height: 64px; width: 100%; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.mark { width: 28px; height: 28px; display: block; }
.top-nav { display: flex; align-items: center; gap: 2px; min-width: 0; flex-wrap: wrap; }
.top-nav > a, .nav-drop > a {
  color: #4d576b;
  text-decoration: none;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
}
.top-nav > a:hover, .top-nav > a.is-on, .nav-drop > a:hover { color: var(--blue); background: rgba(255, 255, 255, 0.75); }
.nav-drop { position: relative; }
.nav-drop .menu {
  display: none;
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  min-width: 148px;
  padding: 8px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 6;
}
.nav-drop:hover .menu, .nav-drop:focus-within .menu { display: block; }
.nav-drop .menu a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.nav-drop .menu a:hover { background: #f3f6fb; color: var(--blue); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
}
.nav-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #5482ff 0%, #3d6ef5 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 16px rgba(61, 110, 245, 0.25);
}
.btn-primary:hover { background: var(--blue-deep); }
.btn-block { width: 100%; height: 40px; border-radius: 12px; }
.btn-ghost {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  color: #526078;
  text-decoration: none;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.75); color: var(--blue); }

.hero { position: relative; text-align: center; padding: 28px 0 8px; }
.hello { margin: 0; color: #7d8ba3; font-size: 13px; letter-spacing: 0.18em; }
.ask { margin: 8px 0 0; font-size: 32px; font-weight: 600; letter-spacing: 0.06em; color: #243049; }
.modes {
  display: inline-flex;
  margin-top: 16px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.8);
}
.modes button {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5d6880;
}
.modes button.is-on { background: #fff; color: var(--blue); font-weight: 600; box-shadow: 0 4px 12px rgba(40, 70, 140, 0.08); }
.hero-search {
  display: flex;
  align-items: center;
  max-width: 760px;
  margin: 18px auto 0;
  padding: 6px 6px 6px 16px;
  background: #fff;
  border: 1.5px solid #c9d8fb;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(70, 110, 190, 0.08);
}
.hero-search input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; color: var(--ink); box-shadow: none; }
.hero-search input:focus,
.hero-search input:focus-visible { outline: none; box-shadow: none; }
.hero-search input::placeholder { color: #a0a8b8; }
.hero-search button {
  height: 40px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
}
.hero-search button:hover { background: var(--blue-deep); }
.hero-hint { margin: 10px 0 0; color: #8b95a8; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin-top: 12px; }
.chips[hidden] { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5c677c;
  text-decoration: none;
  font-size: 13px;
}
.chip i { width: 8px; height: 8px; border-radius: 2px; background: var(--blue); }
.chips .chip:nth-child(5n+1) i { background: #f07167; }
.chips .chip:nth-child(5n+2) i { background: #f0b429; }
.chips .chip:nth-child(5n+3) i { background: #3d6ef5; }
.chips .chip:nth-child(5n+4) i { background: #3cbf8f; }
.chips .chip:nth-child(5n) i { background: #9b6bff; }
.chip:hover { color: var(--blue); }

.panel {
  margin-top: 22px;
  padding: 20px 20px 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  box-shadow: 0 16px 40px rgba(62, 96, 168, 0.06);
}
.panel-head, .river-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h2, .river-head h2, .block-title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: 0.02em; }
.panel-head p, .river-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.more { flex: none; color: #8b93a6; text-decoration: none; font-size: 13px; }
.more:hover { color: var(--blue); }
#create, #tpl { scroll-margin-top: 80px; }

.tool-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.tool {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 86px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #f6f8fc;
  color: inherit;
  text-align: left;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.tool:hover { background: #fff; border-color: #d7e3ff; box-shadow: 0 10px 24px rgba(61, 110, 245, 0.08); transform: translateY(-1px); }
.tool.is-main { background: #f4f7ff; border: 1px dashed #c5d4ff; }
.tool-art { width: 74px; height: 64px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.tool-art svg { width: 64px; height: 48px; }
.tool-copy { min-width: 0; }
.tool-copy strong, .tool-copy em { display: block; }
.tool-copy strong { font-size: 14px; font-weight: 600; }
.tool-copy em { margin-top: 3px; font-style: normal; font-size: 12px; color: var(--muted); line-height: 1.4; }
.art-canvas { background: #e7eeff; }
.art-goods { background: linear-gradient(160deg, #fff4e5, #ffe1c2); }
.art-poster { background: linear-gradient(160deg, #ffe8e4, #ffd0e4); }
.art-ai { background: linear-gradient(160deg, #ece8ff, #d9e4ff); }
.art-copy { background: linear-gradient(160deg, #fff6d8, #ffe7b0); }
.art-collage { background: linear-gradient(160deg, #e5f8ef, #d5f0e4); }
.art-long { background: linear-gradient(160deg, #e5f2ff, #d5e6ff); }
.art-invite { background: linear-gradient(160deg, #fde8f2, #ffd6e6); }
.art-fest { background: linear-gradient(160deg, #fff1d6, #ffd9a8); }
.art-brand { background: linear-gradient(160deg, #e8eeff, #d5def8); }

.rivers { margin-top: 8px; }
.river { position: relative; }
.river-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 6px 2px 16px;
}
.river-track::-webkit-scrollbar { height: 0; }
.river-btn {
  position: absolute;
  top: 88px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(28, 45, 90, 0.14);
}
.river-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.river-btn.prev { left: 4px; }
.river-btn.next { right: 4px; }
.river-btn:disabled { opacity: 0; pointer-events: none; }

.poster { width: 158px; flex: none; color: inherit; text-decoration: none; }
.poster-frame {
  position: relative;
  display: block;
  height: 210px;
  overflow: hidden;
  border-radius: 12px;
  background: #e8eef8;
  box-shadow: 0 8px 18px rgba(36, 58, 110, 0.08);
}
.poster-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.poster:hover img { transform: scale(1.05); }
.poster:hover .poster-frame { box-shadow: 0 12px 26px rgba(36, 58, 110, 0.14); }
.poster-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  text-align: center;
  background: linear-gradient(160deg, #dbe7ff, #f7e7c8);
  color: #243049;
  font-size: 13px;
  font-weight: 600;
}
.poster-name {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: #5c677c;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.empty-home {
  margin-top: 18px;
  padding: 48px 20px;
  text-align: center;
  background: #fff;
  border-radius: 20px;
}
.empty-home h2 { margin: 0 0 8px; font-size: 20px; }
.empty-home p { margin: 0 0 16px; color: var(--muted); }

.page-head { padding: 12px 0 18px; }
.page-head h1 { margin: 0; font-size: 28px; font-weight: 600; }
.page-head p { margin: 8px 0 0; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.filters a {
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  color: #526078;
  text-decoration: none;
  font-size: 13px;
}
.filters a.is-on, .filters a:hover { background: var(--blue); color: #fff; }
.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 18px 14px;
}
.wall .poster { width: auto; }
.wall .poster-frame { height: auto; aspect-ratio: 3 / 4; }
.wall-status { min-height: 1.4em; margin: 14px 0 0; color: var(--muted); font-size: 13px; text-align: center; }
.load-more {
  display: block;
  height: 40px;
  margin: 8px auto 0;
  padding: 0 18px;
  border: 1px solid #d5deee;
  border-radius: 999px;
  background: #fff;
  color: #3d4c68;
}
.load-more[hidden] { display: none; }

.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.brand-grid a {
  display: grid;
  place-items: center;
  min-height: 92px;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-weight: 600;
}
.brand-grid a:hover { color: var(--blue); box-shadow: var(--shadow); }
.rich { padding: 8px 0 24px; line-height: 1.8; color: #3c465c; }
.rich img { max-width: 100%; height: auto; }

.person {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 18px;
  background: #fff;
}
.person img, .avatar-fallback {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  background: #e7eefc;
}
.avatar-fallback { display: grid; place-items: center; color: var(--blue); font-weight: 700; }
.person h1 { margin: 0; font-size: 22px; }
.person p { margin: 6px 0 0; color: var(--muted); }

.crumb { margin: 8px 0 14px; color: #8b93a6; font-size: 13px; }
.crumb a { color: inherit; text-decoration: none; }
.crumb a:hover { color: var(--blue); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.detail-stage, .detail-side { background: #fff; border-radius: 20px; box-shadow: var(--shadow); }
.detail-stage { padding: 16px; }
.detail-stage > img { width: 100%; max-height: 72vh; object-fit: contain; border-radius: 12px; background: #f3f6fb; }
.thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; }
.thumb { width: 68px; height: 68px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #f3f6fb; flex: none; }
.thumb.is-on { border-color: var(--blue); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-copy { margin-top: 16px; padding: 4px 8px 8px; color: #3c465c; line-height: 1.75; }
.detail-copy img { max-width: 100%; }
.detail-side { position: sticky; top: 80px; padding: 20px; }
.detail-side h1 { margin: 0; font-size: 22px; line-height: 1.35; }
.muted { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.mini-author { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: inherit; text-decoration: none; }
.mini-author img, .mini-author .avatar-fallback { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.mini-author strong { display: block; font-size: 14px; }
.mini-author em { display: block; margin-top: 2px; color: var(--muted); font-style: normal; font-size: 12px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-row-next { margin-top: 8px; }
.tag-row a { padding: 4px 10px; border-radius: 999px; background: #f3f6fb; color: var(--blue); text-decoration: none; font-size: 12px; }
.unlock-box, .pay-box { margin-top: 16px; padding: 14px; border-radius: 14px; background: #f6f8fc; }
.unlock-box p, .pay-box p { margin: 0 0 10px; }
.price { color: #e07a2f; font-weight: 700; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid #e1e7f2; border-radius: 10px; background: #fff; }
.qr { width: 96px; height: 96px; margin-top: 10px; border-radius: 8px; object-fit: cover; background: #fff; }
.related { margin-top: 28px; }
.related h2 { margin: 0 0 12px; font-size: 18px; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding: 28px 0 24px;
  color: #98a0b3;
  font-size: 12px;
}

.mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 28, 48, 0.38);
}
.mask[hidden] { display: none; }
.sheet { width: min(640px, 100%); padding: 20px; border-radius: 20px; background: #fff; box-shadow: 0 24px 80px rgba(16, 24, 40, 0.2); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h3 { margin: 0; font-size: 18px; }
.icon-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: #f3f5f9; color: var(--ink); }
.size-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.size-grid a { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 12px; background: #f6f8fc; color: var(--ink); text-decoration: none; }
.size-grid a span { color: var(--muted); font-size: 12px; }
.size-grid a:hover { background: #eef3ff; color: var(--blue); }
.sheet-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.no-scroll { overflow: hidden; }

@media (max-width: 1280px) {
  .tool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
  .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail { grid-template-columns: 1fr; }
  .detail-side { position: static; }
}
@media (max-width: 860px) {
  .shell { margin-left: 0; }
  body { padding-bottom: 72px; }
  .wrap { width: min(1360px, calc(100% - 28px)); }
  .rail {
    inset: auto 0 0 0;
    width: 100%;
    height: 64px;
    flex-direction: row;
    padding: 0;
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .rail-nav { flex-direction: row; justify-content: space-around; }
  .rail-item { width: auto; flex: 1; min-height: 64px; border-radius: 0; background: transparent; }
  .nav-toggle { display: inline-grid; place-items: center; }
  .top-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 12px;
    right: 12px;
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--shadow);
  }
  .top-nav.is-open { display: flex; }
  .nav-drop .menu { display: block; position: static; min-width: 0; padding: 0 0 4px 12px; box-shadow: none; }
  .topbar { position: sticky; }
  .ask { font-size: 24px; letter-spacing: 0.02em; }
  .btn-ghost { display: none; }
}
@media (max-width: 760px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .size-grid { grid-template-columns: 1fr 1fr; }
  .page-head h1 { font-size: 22px; }
}
@media (max-width: 460px) {
  .tool-grid { grid-template-columns: 1fr; }
  .hero-search { padding-left: 12px; }
  .hero-search button { padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .poster-frame img, .tool { transition: none; }
}
