/* Nano AI 登录 / 注册 v3（Claude 本地方案）
   与首页同一视觉：深琥珀渐变 + 金色香蕉图标；左侧是用户公开分享的真实作品，右侧是奶油色表单。 */
:root {
  color-scheme: light;
  --ink: #2a2520;
  --ink-2: #5c554c;
  --muted: #8a8177;
  --line: #e4ddd2;
  --field: #fffdf9;
  --card: #fbf8f3;
  --gold: #e7b95c;
  --gold-deep: #b98a2f;
  --btn: #2a2520;
  --btn-ink: #fdf6e8;
  --danger: #a4412c;
  --ok: #3c7a4b;
  --stage-a: #1b140d;
  --stage-b: #3a2612;
  --stage-glow: #c9822c;
  --radius: 14px;
  font-family: "PingFang SC", "Microsoft YaHei", "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--card); color: var(--ink); }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.auth { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr); min-height: 100vh; min-height: 100dvh; }

/* ---------- 左侧：作品墙 ---------- */
.stage {
  position: relative; overflow: hidden; color: #f6ead6;
  background: radial-gradient(120% 80% at 18% 0%, rgba(201,130,44,.55), transparent 55%),
              radial-gradient(90% 70% at 100% 100%, rgba(201,130,44,.28), transparent 60%),
              linear-gradient(160deg, var(--stage-b), var(--stage-a) 70%);
  display: flex; flex-direction: column; padding: 36px 44px 28px;
  position: sticky; top: 0; height: 100vh; height: 100dvh;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; position: relative; z-index: 2; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 24px;
  background: linear-gradient(145deg, #f7d58d, #d9a043); box-shadow: 0 8px 20px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.45); }
.brand-mark span { transform: rotate(-8deg); display: block; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: .2px; }
.brand-sub { font-size: 12px; opacity: .72; padding-left: 12px; border-left: 1px solid rgba(246,234,214,.25); }
.stage-copy { position: relative; z-index: 2; margin-top: 44px; max-width: 520px; }
.stage-copy h2 { margin: 0; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.15; font-weight: 750; letter-spacing: .5px; }
.stage-copy h2 em { font-style: normal; color: var(--gold); }
.stage-copy p { margin: 14px 0 0; font-size: 15px; opacity: .78; }
.gallery { position: relative; z-index: 1; flex: 1 1 0; margin: 30px -8px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 88%, transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 10%, #000 88%, transparent); min-height: 0; overflow: hidden; }
.gallery-col { display: flex; flex-direction: column; gap: 12px; will-change: transform; }
.gallery.is-moving .gallery-col { animation: drift 70s linear infinite; }
.gallery.is-moving .gallery-col:nth-child(2) { animation-duration: 88s; animation-direction: reverse; }
.gallery.is-moving .gallery-col:nth-child(3) { animation-duration: 78s; }
.gallery:hover .gallery-col { animation-play-state: paused; }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-50%); } }
.work { position: relative; margin: 0; border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.06); box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.work img { display: block; width: 100%; height: auto; opacity: 0; transition: opacity .5s; }
.work img.loaded { opacity: 1; }
.work figcaption { position: absolute; left: 8px; bottom: 8px; font-size: 11px; padding: 3px 8px; border-radius: 999px; background: rgba(20,14,8,.62); color: #f6ead6; backdrop-filter: blur(6px); }
.gallery-placeholder { border-radius: 12px; background: linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02)); }
.stage-foot { position: relative; z-index: 2; margin-top: 18px; font-size: 12px; opacity: .6; }

/* ---------- 右侧：表单 ---------- */
.panel-wrap { display: flex; flex-direction: column; padding: 28px clamp(24px, 5vw, 64px); }
.panel-top { display: flex; justify-content: flex-end; font-size: 13px; color: var(--muted); }
.panel-top a { text-decoration: none; }
.panel-top a:hover { color: var(--ink); }
.card { width: 100%; max-width: 400px; margin: auto; padding: 32px 0 24px; }
.card h1 { margin: 0; font-size: 28px; line-height: 1.25; font-weight: 750; }
.lead { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; }
.perk { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: #7a5518; background: linear-gradient(135deg, #fbecc9, #f6dca4); border: 1px solid #efd29a; }
.perk b { font-size: 15px; }
form { margin-top: 26px; display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field-head { display: flex; justify-content: space-between; align-items: baseline; }
label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.control { position: relative; display: flex; align-items: center; }
.control input { width: 100%; height: 50px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--field);
  font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; }
.control input::placeholder { color: #b3aaa0; }
.control input:focus { border-color: var(--gold-deep); box-shadow: 0 0 0 4px rgba(231,185,92,.25); }
.control .password-toggle { position: absolute; right: 6px; width: 40px; height: 40px; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.control .password-toggle:hover { color: var(--ink); background: #f3ede3; }
.control input:not(:only-child) { padding-right: 52px; }
.code-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.code-button { height: 50px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--line); background: #f4eee4; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; min-width: 112px; }
.code-button:hover:not(:disabled) { background: #efe6d6; }
.code-button:disabled { color: var(--muted); cursor: default; }
.text-button { border: 0; background: none; padding: 0; font-size: 13px; color: var(--gold-deep); cursor: pointer; font-weight: 600; }
.text-button:hover { text-decoration: underline; }
.submit-button { height: 52px; border: 0; border-radius: var(--radius); background: var(--btn); color: var(--btn-ink); font-size: 16px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 10px 24px rgba(42,37,32,.18); transition: transform .12s, background .15s; }
.submit-button:hover:not(:disabled) { background: #3a332b; }
.submit-button:active:not(:disabled) { transform: translateY(1px); }
.submit-button:disabled { opacity: .7; cursor: default; }
.invite { border-top: 1px dashed var(--line); padding-top: 14px; }
.invite summary { list-style: none; cursor: pointer; font-size: 13px; color: var(--ink-2); display: inline-flex; gap: 6px; align-items: center; }
.invite summary::-webkit-details-marker { display: none; }
.invite summary::after { content: "+"; color: var(--gold-deep); font-weight: 700; }
.invite[open] summary::after { content: "−"; }
.invite .field { margin-top: 12px; }
.switch { margin: 22px 0 0; text-align: center; font-size: 14px; color: var(--ink-2); }
.switch .text-button { font-size: 14px; }
.legal { margin: 14px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.legal a { color: var(--ink-2); }
.back { margin-bottom: 18px; }

/* 提示：放在按钮下方，读起来就在视线里（沿用原脚本的 #toast / show / error / success 类名） */
.toast { display: none; margin-top: 16px; padding: 11px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5;
  background: #f4eee4; color: var(--ink-2); border: 1px solid var(--line); }
.toast.show { display: block; }
.toast.error { background: #fbeee9; color: var(--danger); border-color: #f0cfc4; }
.toast.success { background: #eef6ef; color: var(--ok); border-color: #cfe5d3; }

.page-foot { text-align: center; font-size: 12px; color: var(--muted); display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.page-foot a { text-decoration: none; }

/* ---------- 手机 ---------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .stage { padding: 18px 20px 0; min-height: 0; position: relative; height: auto; }
  .stage-copy { margin-top: 18px; }
  .stage-copy h2 { font-size: 24px; }
  .stage-copy p { font-size: 13px; margin-top: 6px; }
  .gallery { display: none; }
  .stage-foot { display: none; }
  .stage::after { content: ""; display: block; height: 22px; }
  .panel-wrap { padding: 0 20px 24px; margin-top: -14px; }
  .panel-top { display: none; }
  .card { background: var(--card); border-radius: 22px 22px 0 0; padding: 26px 0 8px; margin: 0 auto; }
  .card h1 { font-size: 24px; }
  .mobile-works { display: block !important; margin: 26px -20px 8px; }
}
.mobile-works { display: none; }
.mobile-works h3 { margin: 0 20px 10px; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.mobile-works-row { display: flex; gap: 10px; overflow-x: auto; padding: 0 20px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.mobile-works-row::-webkit-scrollbar { display: none; }
.mobile-works-row .work { flex: 0 0 38%; scroll-snap-align: start; box-shadow: none; }
.mobile-works-row .work img { aspect-ratio: 3 / 4; object-fit: cover; }

@media (prefers-reduced-motion: reduce) {
  .gallery.is-moving .gallery-col { animation: none; }
  .work img, .submit-button { transition: none; }
}

.mobile-works[hidden] { display: none !important; }

/* ---------- 左侧"显影"：WebGL 画布 + 生成状态 ---------- */
.stage[data-develop] { cursor: crosshair; }
.develop-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .8s; }
.stage.is-ready .develop-canvas { opacity: 1; }
.stage-shade { position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(to bottom, rgba(20,13,6,.72), rgba(20,13,6,0) 34%, rgba(20,13,6,0) 58%, rgba(20,13,6,.82)); }
.stage .brand, .stage .stage-copy { position: relative; z-index: 2; }
.stage .brand, .stage .stage-copy, .stage-hint { cursor: default; }
.develop-hud { position: relative; z-index: 2; margin-top: auto; max-width: 440px; padding: 14px 16px; border-radius: 14px;
  background: rgba(22,15,8,.52); border: 1px solid rgba(246,234,214,.14); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "PingFang SC", monospace; pointer-events: none; }
.hud-row { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .3px; color: #f6ead6; }
.hud-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(231,185,92,.25); animation: pulse 1.2s ease-in-out infinite; }
.stage.is-done .hud-dot { background: #7fd49a; box-shadow: 0 0 0 3px rgba(127,212,154,.2); animation: none; }
.hud-step { margin-left: auto; opacity: .75; }
.hud-step b { font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; }
.hud-prompt { margin: 10px 0 8px; min-height: 42px; font-size: 14px; line-height: 1.5; color: #fbf1df; font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
.hud-caret { display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--gold); animation: blink 1s steps(1) infinite; }
.stage.is-done .hud-caret { display: none; }
.hud-meta { display: flex; gap: 14px; font-size: 11px; color: rgba(246,234,214,.6); }
.stage-hint { position: relative; z-index: 2; margin: 14px 0 0; font-size: 12px; color: rgba(246,234,214,.62); }
.stage-hint button { border: 0; background: none; padding: 0; color: var(--gold); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.hint-touch { display: none; }
@media (hover: none) { .hint-desktop { display: none; } .hint-touch { display: inline; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 900px) {
  .stage[data-develop] { min-height: 300px; padding-bottom: 18px; }
  .stage[data-develop] .develop-hud { margin-top: 18px; padding: 10px 12px; }
  .hud-prompt { min-height: 0; font-size: 13px; margin: 6px 0 4px; }
  .stage-hint { margin-top: 10px; }
}

/* Right-side typography only: matches current production auth v2. */
.panel-wrap{font-family:"Inter","PingFang SC","Microsoft YaHei",system-ui,sans-serif;font-synthesis:none}
.panel-wrap .card h1{font-weight:600}
.panel-wrap label{font-weight:500}
.panel-wrap input,.panel-wrap .lead,.panel-wrap .code-button,.panel-wrap .hint{font-weight:400}
.panel-wrap .submit-button,.panel-wrap .text-button{font-weight:500}
.panel-wrap .field-head .text-button{font-weight:400}
.develop-fallback{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.stage.is-ready .develop-fallback{visibility:hidden}

.stage.motion-reduced .hud-dot,.stage.motion-reduced .hud-caret{animation:none}
