:root {
  color-scheme: light;
  --ink: #3f2925;
  --ink-soft: #745c54;
  --paper: #fbfdf5;
  --leaf: #6d9c3e;
  --leaf-dark: #466f26;
  --leaf-soft: #e9f5cf;
  --rose: #ed8295;
  --rose-soft: #fde7eb;
  --line: rgba(68, 91, 43, 0.16);
  --shadow: 0 22px 70px rgba(68, 84, 43, 0.14);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: #eef6dc; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(251, 253, 245, 0.96), rgba(232, 245, 206, 0.92)),
    #eef6dc;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

button, input { font: inherit; letter-spacing: 0; }
a { color: inherit; }
[hidden] { display: none !important; }

.account-nav {
  width: min(1120px, calc(100% - 40px));
  height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.account-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
}

.account-brand img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; }

.account-brand small { color: var(--leaf-dark); font-size: 11px; letter-spacing: 0; }
.back-home { color: var(--ink-soft); font-size: 14px; text-decoration: none; }
.back-home:hover { color: var(--leaf-dark); }

.account-page {
  width: min(1060px, calc(100% - 40px));
  min-height: calc(100vh - 116px);
  margin: 0 auto 40px;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(390px, 1.1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(251, 253, 245, 0.92);
  box-shadow: var(--shadow);
}

.account-visual {
  position: relative;
  min-height: 620px;
  padding: 54px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: #dcefb9;
}

.account-visual::after {
  content: "";
  position: absolute;
  inset: auto -50px -80px auto;
  width: 260px;
  height: 260px;
  border: 54px solid rgba(237, 130, 149, 0.18);
  border-radius: 50%;
}

.visual-copy { position: relative; z-index: 1; }
.visual-kicker { margin: 0 0 18px; color: var(--leaf-dark); font-size: 13px; font-weight: 800; }
.visual-copy h1 { max-width: 360px; margin: 0; font-size: 42px; line-height: 1.14; letter-spacing: 0; }
.visual-copy p { max-width: 340px; margin: 20px 0 0; color: var(--ink-soft); line-height: 1.8; }

.account-pet {
  position: relative;
  z-index: 1;
  width: min(100%, 320px);
  aspect-ratio: 1;
  align-self: center;
  object-fit: contain;
  image-rendering: auto;
}

.account-workspace {
  min-height: 620px;
  padding: 54px clamp(34px, 5vw, 68px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(251, 253, 245, 0.95);
}

.workspace-heading { margin-bottom: 30px; }
.workspace-heading p { margin: 0 0 10px; color: var(--leaf-dark); font-size: 13px; font-weight: 800; }
.workspace-heading h2 { margin: 0; font-size: 30px; line-height: 1.25; }
.workspace-heading small { display: block; margin-top: 10px; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }

.account-form { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.field input, .invitation-input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  outline: none;
  color: var(--ink);
  background: rgba(247, 250, 239, 0.9);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field input:focus, .invitation-input:focus {
  border-color: var(--leaf);
  box-shadow: 0 0 0 3px rgba(109, 156, 62, 0.14);
}

.role-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; border: 0; padding: 0; margin: 0; }
.captcha-field { display: grid; gap: 8px; }
.captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 144px; gap: 12px; }
.captcha-row input { min-width: 0; width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #f7faef; outline: none; text-transform: uppercase; }
.captcha-row input:focus { border-color: var(--leaf); box-shadow: 0 0 0 3px rgba(109,156,62,.14); }
.captcha-refresh { width: 144px; height: 48px; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; color: var(--leaf-dark); background: #eef6dc; cursor: pointer; }
.captcha-refresh img { display: block; width: 144px; height: 48px; }
.captcha-refresh:focus-visible { outline: 2px solid var(--leaf-dark); outline-offset: 3px; }
.primary-action:disabled, .captcha-refresh:disabled { cursor: wait; opacity: .65; }
.role-options legend { margin-bottom: 10px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.role-option { position: relative; }
.role-option input { position: absolute; opacity: 0; pointer-events: none; }
.role-option span {
  min-height: 72px;
  padding: 14px;
  display: grid;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f6faeb;
  cursor: pointer;
}
.role-option strong { font-size: 16px; }
.role-option small { margin-top: 3px; color: var(--ink-soft); }
.role-option input:checked + span { border-color: var(--rose); background: var(--rose-soft); box-shadow: inset 0 0 0 1px var(--rose); }
.role-options.is-invited .role-option:has(input:not(:checked)) { display: none; }
.role-options.is-invited { grid-template-columns: 1fr; }
.role-options.is-invited .role-option span { cursor: default; }

.primary-action, .secondary-action {
  min-height: 48px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  text-decoration: none;
  cursor: pointer;
  font-weight: 800;
}
.primary-action { color: #fdfdf8; background: var(--leaf-dark); box-shadow: 0 10px 24px rgba(70, 111, 38, 0.22); }
.primary-action:hover { background: #395d1e; }
.secondary-action { color: var(--leaf-dark); border: 1px solid rgba(70, 111, 38, 0.25); background: var(--leaf-soft); }
.text-action { color: var(--leaf-dark); font-size: 14px; font-weight: 700; text-decoration: none; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 24px; color: var(--ink-soft); font-size: 14px; }

.feedback { min-height: 24px; margin: 18px 0 0; color: #a84452; font-size: 13px; line-height: 1.6; }
.feedback.is-success { color: var(--leaf-dark); }

.account-footer {
  padding: 10px 20px 24px;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
}

.account-footer a { text-decoration: none; }
.account-footer a:hover { color: var(--leaf-dark); text-decoration: underline; }

.account-summary { display: grid; gap: 18px; }
.identity-line { display: flex; align-items: center; gap: 14px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.identity-avatar { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--rose-soft); color: #a84452; font-weight: 900; }
.identity-line strong, .identity-line small { display: block; }
.identity-line small { margin-top: 4px; color: var(--ink-soft); }
.status-line { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-soft); line-height: 1.6; }
.status-dot { flex: 0 0 auto; width: 9px; height: 9px; margin-top: 7px; border-radius: 50%; background: var(--rose); }
.status-dot.is-bound { background: var(--leaf); }
.action-stack { display: grid; gap: 10px; margin-top: 8px; }
.logout-button { border: 0; padding: 0; color: var(--ink-soft); background: transparent; cursor: pointer; text-align: left; }

.binding-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 24px; padding: 4px; border-radius: 6px; background: #edf4df; }
.binding-switch button { min-height: 40px; border: 0; border-radius: 4px; color: var(--ink-soft); background: transparent; cursor: pointer; font-weight: 700; }
.binding-switch button.is-active { color: var(--leaf-dark); background: #fafcf5; box-shadow: 0 2px 10px rgba(65, 83, 42, 0.1); }
.binding-panel { display: grid; gap: 16px; }
.invitation-code { min-height: 74px; display: grid; place-items: center; border: 1px dashed var(--rose); border-radius: 6px; color: #a84452; background: var(--rose-soft); font-size: 25px; font-weight: 900; letter-spacing: 0; }
.invitation-share { display: grid; gap: 10px; }
.invitation-share input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-soft); background: #f6faeb; font-size: 12px; }
.invitation-card { margin: -8px 0 24px; padding: 16px 18px; display: grid; gap: 4px; border: 1px solid rgba(237,130,149,.42); border-radius: 7px; background: var(--rose-soft); }
.invitation-card span, .invitation-card small { color: var(--ink-soft); font-size: 12px; }
.invitation-card strong { color: #a84452; font-size: 16px; }

@media (max-width: 800px) {
  .account-nav { width: min(100% - 28px, 680px); height: 66px; }
  .account-page { width: min(100% - 28px, 680px); min-height: 0; grid-template-columns: 1fr; }
  .account-visual { min-height: 230px; padding: 30px; }
  .visual-copy h1 { font-size: 30px; }
  .visual-copy p { margin-top: 10px; }
  .account-pet { position: absolute; right: 10px; bottom: -28px; width: 180px; opacity: 0.82; }
  .account-workspace { min-height: 500px; padding: 38px 28px; }
}

@media (max-width: 480px) {
  .account-visual { min-height: 240px; }
  .visual-copy p { max-width: 62%; font-size: 13px; }
  .visual-copy .visual-kicker { max-width: 100%; }
  .account-pet { width: 110px; bottom: -10px; }
  .role-options { grid-template-columns: 1fr; }
  .form-foot { align-items: flex-start; flex-direction: column; gap: 10px; }
}
