/* ------------------------------------------------------------------
   pindou 用户中心：登录 / 注册 / 我的账户
------------------------------------------------------------------- */
:root {
  --bg: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --violet: #7c3aed;
  --violet-dark: #6d28d9;
  --fuchsia: #d946ef;
  --soft: #f8fafc;
  --violet-soft: #f5f3ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(76, 29, 149, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(50rem 30rem at 12% -10%, rgba(237, 233, 254, 0.9), transparent 60%),
    radial-gradient(42rem 26rem at 95% 0%, rgba(252, 231, 243, 0.9), transparent 60%),
    var(--bg);
  display: flex;
  flex-direction: column;
}

a {
  color: var(--violet-dark);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.site-mini-header {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand:hover {
  text-decoration: none;
}
.brand svg {
  width: 26px;
  height: 26px;
}
.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 6px);
  gap: 2px;
}
.brand-mark i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: block;
}

.mini-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--muted);
}

.auth-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 16px 20px 48px;
}

.auth-card {
  width: min(100%, 430px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--violet);
}

.auth-card h1,
.account-hero h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.auth-lede {
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.field {
  display: block;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.field span {
  display: block;
  margin-bottom: 7px;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus {
  border-color: #a78bfa;
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.16);
}
.field .hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.btn-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(90deg, var(--violet), var(--fuchsia));
  box-shadow: 0 10px 22px rgba(124, 58, 237, 0.24);
}
.btn-primary:hover {
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.65;
  cursor: progress;
  transform: none;
}
.btn-primary.is-full {
  width: 100%;
}
.btn-ghost {
  border: 1px solid var(--line);
  color: #334155;
  background: #fff;
}
.btn-ghost:hover {
  border-color: #c4b5fd;
  text-decoration: none;
}

.form-error {
  margin: 0 0 14px;
  border: 1px solid #fecaca;
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}

.auth-switch {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

.site-mini-footer {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px;
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

/* ---------------- 账户页 ---------------- */
.account-main {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 12px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.account-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(76, 29, 149, 0.07);
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--violet), var(--fuchsia));
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.25);
  flex: none;
}

.account-hero .hero-info {
  flex: 1;
  min-width: 220px;
}

.account-meta {
  margin: 8px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  background: var(--violet-soft);
  color: var(--violet-dark);
}
.badge.member {
  background: #fef3c7;
  color: #b45309;
}
.badge.admin {
  background: #e0f2fe;
  color: #0369a1;
}
.badge.muted {
  background: var(--soft);
  color: var(--muted);
}

.account-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stat-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.stat-box .label {
  font-size: 12px;
  color: var(--muted);
}
.stat-box .value {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stat-box .sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.member-box {
  border: 1px solid #ddd6fe;
  background: linear-gradient(135deg, #f5f3ff, #fdf4ff);
  border-radius: 18px;
  padding: 20px 22px;
}
.member-box h2 {
  margin: 0;
  font-size: 16px;
}
.member-box p {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #4c1d95;
}

.works-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
}
.works-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.works-head h2 {
  margin: 0;
  font-size: 18px;
}
.works-head p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.works-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}

.work-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.work-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f8fafc;
  display: block;
}
.work-card .work-body {
  padding: 10px 12px 12px;
}
.work-card .work-title {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.work-card .work-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}
.work-card .work-actions {
  margin-top: 9px;
  display: flex;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}
.work-card .delete-btn {
  border: 0;
  background: none;
  padding: 0;
  color: #dc2626;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.work-card .delete-btn:hover {
  text-decoration: underline;
}

.empty-state {
  margin-top: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.empty-state a {
  font-weight: 700;
}

.account-loading {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 640px) {
  .auth-card {
    padding: 24px 20px;
    border-radius: 20px;
  }
  .auth-card h1,
  .account-hero h1 {
    font-size: 24px;
  }
  .account-stats {
    grid-template-columns: 1fr;
  }
  .account-hero {
    padding: 20px;
  }
  .account-actions {
    width: 100%;
  }
  .account-actions .btn-primary,
  .account-actions .btn-ghost {
    flex: 1;
  }
  .works-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

/* 原创设计卡片 */
.design-card canvas {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f8fafc;
  display: block;
  image-rendering: pixelated;
}
.design-card .work-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.design-card .design-badge {
  flex: none;
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 9px;
  font-weight: 700;
  background: #f1f5f9;
  color: #64748b;
}
.design-card .design-badge.published { background: #dcfce7; color: #15803d; }
.design-card .design-badge.draft { background: #fef3c7; color: #b45309; }
.design-card .work-actions {
  flex-wrap: wrap;
  row-gap: 5px;
}
.design-card .work-actions button {
  border: 0;
  background: none;
  padding: 0;
  color: #6d28d9;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.design-card .work-actions button.danger { color: #dc2626; }
.design-card .work-actions button:hover { text-decoration: underline; }