/* 原 styles.css L2995-L4391 连续区间纯移动（UI 重构阶段 A）。内容：通用弹层/反馈/账号/入口选择/微信/裁剪比例网格。层叠顺序由 01→12 的 <link> 顺序保持。 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--modal-overlay);
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(1060px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-radius: 8px;
  background: var(--popover-bg);
  box-shadow: var(--shadow-popover);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.2;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.account-modal-card {
  position: relative;
  width: min(900px, 100%);
  height: min(760px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  grid-template-columns: minmax(300px, 0.39fr) minmax(0, 0.61fr);
  grid-template-rows: minmax(0, 1fr);
  border: 1px solid color-mix(in srgb, var(--paper) 72%, var(--line));
  border-radius: 24px;
  background: color-mix(in srgb, var(--popover-bg) 90%, transparent);
  box-shadow: 0 36px 90px rgba(15, 23, 42, 0.28);
  isolation: isolate;
}

#accountModal {
  background: color-mix(in srgb, var(--modal-overlay) 88%, rgba(226, 232, 240, 0.14));
  backdrop-filter: blur(3px) saturate(0.94);
}

.account-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.account-modal-close:hover,
.account-modal-close:focus-visible {
  background: color-mix(in srgb, var(--soft) 88%, transparent);
}

.account-value-pane {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 34px;
  min-width: 0;
  padding: 72px 42px 46px;
  border-right: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  background: color-mix(in srgb, var(--soft) 78%, transparent);
  backdrop-filter: blur(20px) saturate(1.06);
}

.account-value-brand {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.account-value-pane h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 850;
  line-height: 1.28;
  letter-spacing: -0.035em;
}

.account-benefits {
  display: grid;
  align-content: start;
  gap: 64px;
  padding-top: 40px;
}

.account-benefit-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.account-benefit-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 13px;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.account-benefit-icon svg {
  width: 21px;
  height: 21px;
}

.account-benefit-row > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.account-benefit-row strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.account-benefit-row span:not(.account-benefit-icon) {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.entry-choice-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 32px;
  background:
    radial-gradient(circle at 12% 14%, color-mix(in srgb, var(--active-bg) 10%, transparent), transparent 30%),
    radial-gradient(circle at 90% 82%, color-mix(in srgb, #f59e0b 9%, transparent), transparent 28%),
    var(--paper);
}

.entry-choice-modal.hidden {
  display: none;
}

.entry-choice-card {
  width: min(880px, 100%);
}

.entry-choice-loading {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--ink);
  text-align: center;
}

.entry-choice-loading[hidden],
.entry-choice-content[hidden] {
  display: none;
}

.entry-choice-loading strong {
  margin-top: 8px;
  font-size: 16px;
}

.entry-choice-loading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.entry-choice-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--active-bg);
  border-radius: 999px;
  animation: export-progress-spin 0.8s linear infinite;
}

.entry-choice-content {
  display: grid;
  gap: 22px;
}

.entry-choice-head {
  max-width: 650px;
}

.entry-choice-brand {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 7px 10px;
  border-radius: 7px;
  color: #fff;
  background: var(--active-bg);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.entry-choice-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.entry-choice-head p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.65;
}

.entry-choice-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.entry-choice-option {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 16px;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--popover-bg);
  box-shadow: var(--shadow-soft);
}

.entry-choice-option.account-option {
  border-color: color-mix(in srgb, var(--active-border) 62%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--active-border) 45%, transparent), var(--shadow-soft);
}

.entry-choice-option-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  color: var(--ink);
  background: var(--soft);
}

.account-option .entry-choice-option-icon {
  color: #fff;
  background: var(--active-bg);
}

.entry-choice-option-icon svg {
  width: 21px;
  height: 21px;
}

.entry-choice-recommended {
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--active-bg);
  font-size: 11px;
  font-weight: 850;
}

.entry-choice-option h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 22px;
}

.entry-choice-option p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.entry-choice-option ul {
  display: grid;
  align-content: start;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry-choice-option li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--control-text);
  font-size: 12px;
  font-weight: 750;
}

.entry-choice-option li svg {
  width: 15px;
  height: 15px;
  color: #16a34a;
}

.guest-option li:last-child svg {
  color: #d97706;
}

.entry-choice-button {
  width: 100%;
  min-height: 46px;
  justify-content: center;
}

.entry-choice-button svg {
  width: 16px;
  height: 16px;
}

.entry-choice-returning {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-choice-notice {
  padding: 11px 13px;
  border-left: 3px solid #f59e0b;
  color: #92400e;
  background: #fffbeb;
  font-size: 12px;
  font-weight: 750;
}

.entry-choice-notice.error {
  border-color: #dc2626;
  color: #b91c1c;
  background: #fef2f2;
}

.entry-choice-footnote {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.welcome-back-modal {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 28px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: none;
}

.welcome-back-modal.hidden {
  display: none;
}

.welcome-back-card {
  position: relative;
  width: min(548px, 100%);
  padding: 34px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 24px;
  color: var(--ink);
  background: color-mix(in srgb, var(--popover-bg) 96%, transparent);
  box-shadow: 0 36px 90px rgba(15, 23, 42, 0.28);
}

.welcome-back-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.welcome-back-head {
  max-width: 500px;
  padding-right: 36px;
}

.welcome-back-head h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 30px);
  line-height: 1.16;
  letter-spacing: -0.04em;
}

.welcome-back-head p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
}

.welcome-back-features {
  display: grid;
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.welcome-back-features article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  border-bottom: 1px solid var(--line);
}

.welcome-back-feature-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--ink);
  background: var(--soft);
}

.welcome-back-feature-icon svg {
  width: 19px;
  height: 19px;
}

.welcome-back-features strong {
  display: block;
  font-size: 15px;
}

.welcome-back-features p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.welcome-back-feature-state {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--paper));
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.welcome-back-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.welcome-back-actions button {
  min-height: 44px;
  justify-content: center;
}

.welcome-back-footnote {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.account-modal-body {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  overflow: auto;
  min-width: 0;
  padding: 72px clamp(44px, 5vw, 76px);
  background: var(--popover-bg);
}

.account-notice {
  width: min(370px, 100%);
  padding: 12px 14px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  color: #92400e;
  background: #fffbeb;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.account-notice.error {
  border-color: #ef4444;
  color: #b91c1c;
  background: #fef2f2;
}

.account-notice.success {
  border-color: #16a34a;
  color: #166534;
  background: #f0fdf4;
}

/* 云端维护中时登录框里的游客兜底入口，紧贴上方说明 */
.account-guest-fallback {
  width: 100%;
  max-width: 370px;
  margin: -6px 0 14px;
}

/* .account-modal-body 是 justify-items: center 的网格，
   不显式给宽度这一块会缩到按钮自身宽度，比下面的表单窄一截。 */
.account-oauth {
  display: grid;
  gap: 9px;
  width: 100%;
  max-width: 370px;
  margin-bottom: 18px;
}

.account-oauth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.account-oauth-button:hover {
  border-color: color-mix(in srgb, var(--ink) 34%, transparent);
  background: color-mix(in srgb, var(--ink) 4%, var(--paper));
}

.account-oauth-button svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.account-oauth-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.account-oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.account-oauth-divider::before,
.account-oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* 从重置邮件回来时只该看到「设置新密码」一个输入框，
   登录/注册切换、邮箱、原密码这些都跟这一步无关。 */
.account-auth-form.is-resetting .account-auth-mode,
.account-auth-form.is-resetting > label:not(#accountNewPasswordField),
.account-auth-form.is-resetting .account-resend-confirmation {
  display: none;
}

.account-resend-confirmation {
  justify-self: center;
  min-height: 34px;
  border: 0;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  margin-top: -14px;
  cursor: pointer;
}

.account-resend-confirmation span {
  color: #0071e3;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-resend-confirmation[hidden] {
  display: none;
}

.account-auth-form {
  display: grid;
  width: min(370px, 100%);
  gap: 40px;
}

.account-signed-in {
  display: grid;
  width: min(420px, 100%);
  gap: 40px;
}

.account-auth-form[hidden],
.account-signed-in[hidden] {
  display: none;
}

.account-auth-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.account-auth-mode button {
  min-height: 48px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.account-auth-mode button.is-active {
  color: #fff;
  background: #17202f;
  box-shadow: 0 5px 14px rgb(15 23 42 / 15%);
}

.account-auth-mode button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: 2px;
}

.account-intro {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.account-icon {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #17202f;
}

.account-icon svg {
  width: 20px;
  height: 20px;
}

.account-intro strong,
.account-user-card strong,
.account-sync-card strong {
  color: var(--ink);
  font-size: 14px;
}

.account-intro p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-auth-form label {
  display: grid;
  gap: 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.account-auth-form input {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--control-bg);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.account-auth-form input:focus {
  border-color: color-mix(in srgb, #0071e3 66%, var(--line));
  background: var(--popover-bg);
  box-shadow: 0 0 0 4px color-mix(in srgb, #0071e3 12%, transparent);
}

.account-input-wrap {
  position: relative;
  display: block;
}

.account-input-wrap input {
  padding-right: 50px;
}

.account-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  transform: translateY(-50%);
}

.account-password-toggle:hover,
.account-password-toggle:focus-visible {
  color: var(--ink);
  background: var(--soft);
}

.account-password-toggle svg {
  width: 18px;
  height: 18px;
}

.account-auth-actions {
  display: grid;
}

.account-auth-actions button,
.account-wide-button {
  min-height: 56px;
}

.account-auth-actions .primary-button {
  width: 100%;
  justify-content: center;
  border-radius: 10px;
  color: #fff;
  background: #0071e3;
  box-shadow: 0 10px 24px color-mix(in srgb, #0071e3 22%, transparent);
  font-size: 15px;
}

.account-auth-actions .primary-button:hover:not(:disabled) {
  background: #0066cc;
  transform: translateY(-1px);
}

.account-user-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.account-user-card img {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  object-fit: cover;
}

.account-user-card div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.account-user-card span:not(.account-online) {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-online {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #15803d;
  font-size: 11px;
  font-weight: 850;
}

.account-online svg {
  width: 15px;
  height: 15px;
}

.account-switch-panel {
  display: grid;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.account-switch-heading > svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.account-switch-panel .account-account-list {
  max-height: 190px;
  overflow: auto;
}

.account-switch-panel .account-session-option {
  background: var(--popover-bg);
}

.account-switch-panel .account-session-option:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 7%, var(--popover-bg));
}

.account-sync-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-left: 3px solid #16a34a;
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
}

.account-wide-button {
  width: 100%;
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
}

.crop-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  min-height: 0;
}

.crop-stage {
  min-width: 0;
  padding: 18px;
  background: var(--crop-stage-bg);
}

#cropCanvas {
  display: block;
  width: 100%;
  height: min(500px, calc(100vh - 220px));
  border-radius: 8px;
  background: var(--crop-canvas-bg);
  cursor: crosshair;
}

.crop-controls {
  display: grid;
  align-content: space-between;
  gap: 20px;
  padding: 18px;
  border-left: 1px solid var(--line);
  background: var(--control-bg);
}

.ratio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ratio-button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--control-text);
  background: var(--popover-bg);
  font-size: 13px;
  font-weight: 750;
}

.ratio-button.active {
  border-color: var(--active-border);
  color: var(--active-text);
  background: var(--active-bg);
}

.crop-actions {
  display: grid;
  gap: 10px;
}

.wechat-modal-card {
  width: min(620px, 100%);
}

.wechat-sync-form {
  display: grid;
  gap: 18px;
  overflow: auto;
  padding: 22px;
}

.wechat-field {
  display: grid;
  gap: 8px;
}

.wechat-field > span,
.wechat-cover-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.wechat-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--control-bg);
  font: inherit;
}

.wechat-field input:focus {
  border-color: var(--active-border);
  outline: 2px solid color-mix(in srgb, var(--active-border) 18%, transparent);
}

.wechat-cover-field {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.wechat-cover-preview {
  aspect-ratio: 2.35 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

.wechat-cover-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wechat-cover-preview svg {
  width: 18px;
  height: 18px;
}

.wechat-cover-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.wechat-cover-copy > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.wechat-cover-button {
  position: relative;
  width: fit-content;
  min-height: 40px;
  padding: 0 13px;
  cursor: pointer;
}

.wechat-cover-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.wechat-service-status {
  padding: 12px 14px;
  border-left: 3px solid var(--line);
  color: var(--muted);
  background: var(--soft);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.wechat-service-status.ready {
  border-left-color: #16a34a;
  color: var(--ink);
}

.wechat-service-status.error {
  border-left-color: #ef4444;
  color: #b91c1c;
}

.wechat-sync-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.wechat-sync-actions button {
  min-height: 44px;
  padding: 0 16px;
}

