/* CheeryWorks account — clean, flat UI. Brand-aligned with cheeryworks.com
   (green #19af75, system fonts, light headings) but no diagonal hero. */

:root {
  --brand: #19af75;
  --brand-dark: #148a5d;
  --ink: #1d2b24;
  --muted: #6b7c74;
  --line: #e7ece9;
  --bg: #ffffff;
  --card: #ffffff;
  --foot-bg: #222;
  --page-base: #222;
  --danger: #d24a43;
  --radius: 12px;
  /* 与门户 .container 一致(layout.scss max-width:1000px),保持内容区宽度统一。 */
  --maxw: 1000px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 页面底色 = 门户 #222(滚动/橡皮筋回弹时露出的就是它,不再是白);
   body 内容区为白色。不强制 min-height —— 中间白区高度跟随内容(与门户一致),
   footer 之下露出的是 #222 底色,和 footer 自身同色、无缝。 */
/* html 至少铺满视口高度:内容短时深色底(#222)仍铺到底,避免桌面模式/移动端
   内容下方露出浏览器默认白底而出现一条线。body 内容区为白、随内容高度。 */
html { background: var(--page-base); min-height: 100vh; }
body { background: var(--bg); }

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

h1, h2, h3 { font-weight: 400; color: var(--ink); margin: 0 0 .4em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* top bar — 绿色品牌头,与 cheeryworks.com header 完全一致:
   门户 header padding 20px 0 + logo width 200(高 ≈92px)→ 总高 ≈132px。
   这里用同样的 padding 与 logo 尺寸,两站 header 高度像素级对齐。 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  /* 全宽色条,内容收束居中到 1000px(与门户 .container content-box 内容宽一致)。 */
  padding: 20px max(20px, calc((100% - var(--maxw)) / 2));
  background: var(--brand); color: #fff;
}
.topbar .brand-logo { display: flex; align-items: center; gap: 10px; font-weight: 500; color: #fff; }
.topbar .brand-logo img { width: 200px; max-width: 60vw; height: auto; }
.topbar .actions { display: flex; align-items: center; gap: 12px; }
/* 绿底上的头像(下拉菜单触发器):半透明白圈 + 白字/白图标 */
.avatar { width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.55); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-btn { padding: 0; cursor: pointer; transition: background .15s ease; }
.avatar-btn:hover { background: rgba(255, 255, 255, 0.28); }
/* 头像下拉菜单:白底深字,右对齐 —— 与门户 header 头像下拉一致(name+email 头部 + 菜单项)。 */
.avatar-wrap { position: relative; }
.avatar-menu { display: none; position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 200px; max-width: calc(100vw - 24px); background: #fff; border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18); padding: 6px; z-index: 40; text-align: left; }
.avatar-wrap.open .avatar-menu { display: block; }
/* 下拉顶部:名字 + 邮箱 */
.avatar-head { padding: 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.avatar-head .nm { display: block; font-weight: 600; color: var(--ink); font-size: .95rem; }
.avatar-head .em { display: block; color: var(--muted); font-size: .82rem; word-break: break-all; margin-top: 2px; }
.menu-item { display: block; width: 100%; text-align: left; margin: 0; padding: 10px 12px;
  border: 0; border-radius: 6px; background: none; color: var(--ink); font-size: .95rem;
  font-family: inherit; cursor: pointer; white-space: nowrap; }
.menu-item:hover { background: #f1f4f2; text-decoration: none; }
.menu-item.danger { color: var(--danger); }
/* 页脚语言切换:icon 菜单。globe 按钮点开向上弹出语言列表,当前语言打勾。 */
.lang-menu { position: relative; display: inline-flex; }
.lang-btn { display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; cursor: pointer;
  background: none; color: inherit; }
.lang-btn:hover { background: rgba(255, 255, 255, 0.12); }
.lang-dropdown { display: none; position: absolute; right: 0; bottom: calc(100% + 8px);
  min-width: 140px; background: #fff; border-radius: 10px; padding: 6px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22); z-index: 40; text-align: left; }
.lang-menu.open .lang-dropdown { display: block; }
.lang-item { display: flex; align-items: center; justify-content: space-between; width: 100%;
  margin: 0; padding: 9px 12px; border: 0; border-radius: 6px; background: none;
  color: var(--ink); font-size: .92rem; font-family: inherit; cursor: pointer; }
.lang-item:hover { background: #f1f4f2; }
.lang-item.selected { font-weight: 600; color: var(--brand-dark); }
.lang-item.selected::after { content: "✓"; margin-left: 12px; }

/* 登录方式 / 设备:左侧主名 + 次要信息上下排布 */
.id-meta { display: flex; flex-direction: column; gap: 2px; }
.id-meta .small { word-break: break-all; }

/* 关联新登录方式:标签 + 小按钮换行排布 */
.link-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* 危险区:淡红描边,与普通卡片区分 */
.danger-zone { border-color: #f0d3d1; background: #fffafa; }
.danger-zone .btn.danger { width: auto; margin-top: 6px; }

/* layout */
/* content-box(覆盖全局 border-box):内容区足 1000px,padding 在外 —— 与门户
   .container 的 content-box 行为一致(否则 border-box 下内容只剩 960)。 */
.wrap { box-sizing: content-box; max-width: var(--maxw); margin: 0 auto; padding: 40px 20px; }
/* 登录页中间区:比常规 wrap 高约 50%(上下 padding 40 → 120),卡片居中其中 */
.wrap.narrow { max-width: 420px; padding: 120px 20px; }

/* card */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(20, 40, 30, 0.05); }
.card h2 { font-size: 1.05rem; color: var(--muted); font-weight: 500; margin-bottom: 14px;
  letter-spacing: .02em; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.row + .row { border-top: 1px solid var(--line); }
.label { color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 18px; border-radius: 10px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-size: 1rem; font-weight: 500; cursor: pointer;
  transition: background .12s; text-decoration: none; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: #f1f4f2; }
.btn.danger { background: #fff; color: var(--danger); border-color: #f0d3d1; }
.btn.danger:hover { background: #fdf3f2; }
.btn.sm { width: auto; padding: 8px 14px; font-size: .9rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .ic { width: 20px; height: 20px; }

/* login */
.login-card { text-align: center; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 26px; }
.provider + .provider { margin-top: 12px; }
.btn.wechat { background: #07c160; }
.btn.wechat:hover { background: #06a552; }
.btn.github { background: #24292f; }
.btn.github:hover { background: #1b1f23; }

/* email verification-code login — the primary method, first on the page; stacked inputs/buttons */
.email-login { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.email-login input { display: block; width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 8px; font-size: .95rem; font-family: inherit; }
.hint { margin-top: 2px; font-size: .88rem; color: var(--muted); }
.hint.err { color: var(--danger); }

/* separator between the primary email login and the other methods below */
.or-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px;
  color: var(--muted); font-size: .82rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .8rem; }
.badge.ok { background: #e6f6ee; color: var(--brand-dark); }
.badge.no { background: #fdeceb; color: var(--danger); }

/* inline form (invite redeem) */
.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: .95rem; }
.notice { margin-top: 10px; font-size: .88rem; }
.notice.err { color: var(--danger); }
.notice.ok { color: var(--brand-dark); }

/* 深色页脚,与 cheeryworks.com 完全一致(版权左、备案+联系右,同行、非斜体、16px):
   门户 footer padding 100px 0 50px 0 + legal-line 顶距 30px + .container 1000px,
   这里同款 —— 与门户的唯一区别就是门户那个有斜切(diagonal),本页脚不斜切。 */
/* footer 内容对齐到 footer 最上端:去掉顶部大留白,内容紧贴顶端(留 28px 透气) */
.site-foot { background: var(--foot-bg); color: #999; padding: 28px 0 50px; }
.site-foot a { color: #999; }
.site-foot a:hover { color: #fff; text-decoration: none; }
.site-foot .ft-inner { box-sizing: content-box; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.site-foot .ft-row { display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px; }
.site-foot .copyright,
.site-foot .ft-right { font-size: 16px; margin: 0; font-style: normal; }
