/* ============================================
   账号相关页面（注册 / 找回密码 / 账号设置）
   和日记页同一套暖纸色，进这些页面时不会觉得跳到了另一个网站。
   ============================================ */

@font-face { font-family: 'DiarySerif'; src: url('../fonts/serif-light.woff') format('woff'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'DiarySerif'; src: url('../fonts/serif-regular.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --paper: #F6F0E6;
  --ink: #2F2822;
  --ink-2: #4A3F36;
  --muted: #756656;
  --hair: rgba(70, 50, 35, .16);
  --accent: #C75B47;
  --ok: #4E7A52;
  --warn: #B4543C;

  --serif: 'DiarySerif', 'Songti SC', 'Noto Serif CJK SC', 'Source Han Serif SC', 'STSong', 'SimSun', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Noto Sans CJK SC', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  padding: 28px 20px 56px;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  animation: page-in .7s ease both;
}
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 50% -120px, #FFFBF2 0%, rgba(255, 251, 242, 0) 70%);
}

button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ----- 顶栏 ----- */
.topbar {
  max-width: 560px;
  margin: 0 auto 26px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.link-btn {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .04em;
  cursor: pointer;
  text-decoration: none;
}
.link-btn:hover { color: var(--ink); }
.topbar .spacer { flex: 1; }

/* ----- 卡片 ----- */
.shell { max-width: 560px; margin: 0 auto; }
.card {
  padding: 30px 26px 26px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: rgba(255, 252, 246, .72);
  box-shadow: 0 10px 34px rgba(90, 64, 42, .06);
}
.card + .card { margin-top: 18px; }

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: .06em;
}
.brand svg { color: var(--accent); }

.lede {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

/* ----- 表单 ----- */
.field { margin-bottom: 15px; }
.field label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
}
.field input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--hair);
  border-radius: 9px;
  background: rgba(255, 255, 255, .7);
  color: var(--ink);
  font-size: 15px;
  transition: border-color .18s ease, background .18s ease;
}
.field input::placeholder { color: #A99C8C; }
.field input:focus {
  outline: none;
  border-color: rgba(199, 91, 71, .55);
  background: #fff;
}
.field input[aria-invalid="true"] { border-color: rgba(180, 84, 60, .6); }
.hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

/* 验证码一行：输入框 + 发送按钮 */
.code-row { display: flex; gap: 9px; }
.code-row input { flex: 1; min-width: 0; letter-spacing: .22em; }
.code-row .btn { flex: none; white-space: nowrap; }

/* ----- 按钮 ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--ink);
  color: #FBF6EC;
  font-size: 14px;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background .18s ease, opacity .18s ease, transform .12s ease;
}
.btn:hover:not(:disabled) { background: #45392F; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.block { width: 100%; margin-top: 4px; }
.btn.ghost {
  border-color: var(--hair);
  background: transparent;
  color: var(--ink-2);
}
.btn.ghost:hover:not(:disabled) { background: rgba(70, 50, 35, .05); }
.btn.small { padding: 9px 13px; font-size: 13px; }

/* ----- 提示 ----- */
.msg {
  min-height: 20px;
  margin: 13px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
}
.msg.is-error { color: var(--warn); }
.msg.is-ok { color: var(--ok); }

.row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.value { font-family: var(--serif); font-size: 16px; letter-spacing: .02em; }
.muted { color: var(--muted); font-size: 13px; }

.hidden { display: none !important; }

.divider {
  margin: 20px 0 16px;
  border: 0;
  border-top: 1px solid var(--hair);
}

.foot {
  margin: 26px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 2;
}
.foot a { color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--hair); }
.foot a:hover { border-bottom-color: var(--accent); }

@media (max-width: 420px) {
  body { padding: 20px 14px 40px; }
  .card { padding: 24px 18px 20px; }
  .code-row { flex-direction: column; }
  .code-row .btn { width: 100%; }
}