/* ============================================================
   Union Web Login — 扁平简洁风格
   颜色：深灰按钮 #494949 / 薄荷字 #D1FFF0 / 输入框 #F8FAFC / 绿色点缀
   ============================================================ */
:root {
  --primary: #008b68;
  --primary-active: #02a87e;

  --btn-bg: #494949;
  --btn-bg-hover: #3a3a3a;
  --btn-text: #d1fff0;

  --input-bg: #f8fafc;

  --bg-page: #fbfbfb;
  --bg-card: #ffffff;

  --text-main: #1a1a1a;
  --text-secondary: #7b838d;
  --text-placeholder: #bbc1c9;
  --divider: #f0f0f0;
  --border: #eceff3;
  --danger: #e04e4e;

  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Microsoft YaHei', sans-serif;
  min-height: 100vh;
  background: #fbfbfb;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* ===== 两栏布局（右侧品牌绿面板 + 左侧表单）===== */
.page {
  display: flex;
  flex-direction: row-reverse;
  min-height: 100vh;
  background: #fbfbfb;
}

/* 表单区 */
.left {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  position: relative;
}

.brand {
  position: absolute;
  top: 34px;
  left: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: block;
}

.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* 品牌装饰面板 */
.right {
  flex: 0 0 44%;
  position: relative;
  overflow: hidden;
  margin: 18px;
  border-radius: 30px;
  color: #fff;
}

/* Grainient 动态渐变（铺满卡片，盖住上面的静态渐变兜底）*/
.grainient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  border-radius: inherit;
}

.right-copy {
  position: absolute;
  top: 60px;
  left: 52px;
  right: 52px;
  z-index: 2;
  text-shadow: 0 2px 18px rgba(0, 30, 22, 0.45);
}

.right-kicker {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.72);
  margin-bottom: 14px;
}

.right-title {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.5px;
}

.right-inner {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 40px;
  margin-top: 48px;
}

/* ===== 倾斜循环卡墙（team-card / job-row，两行错峰反向滚动）===== */
.card-wall {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  transform: translateY(80px) rotate(-15deg) scale(1.28);
  transform-origin: center;
  pointer-events: none;
}

.wall-row {
  display: flex;
  gap: 20px;
  width: max-content;
  will-change: transform;
}

.wall-row--a {
  animation: wall-left 42s linear infinite;
}

.wall-row--b {
  animation: wall-right 34s linear infinite; /* 速度不同 + 反向 = 错峰 */
}

@keyframes wall-left {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes wall-right {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .wall-row--a,
  .wall-row--b { animation: none; }
}

.card-wall .team-card,
.card-wall .job-row {
  position: relative;
  flex: 0 0 238px;
  width: 238px;
  height: 234px;
  padding: 16px;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: #1d1d1f;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(0, 34, 24, 0.22);
}

.card-wall .team-card { display: block; }

.card-wall .job-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-wall .team-logo {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

/* 有图：图直接铺满，白底干净，不透出任何色块 */
.card-wall .team-logo img,
.card-wall .job-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

/* 字母兜底：默认隐藏，仅无图 / 加载失败(.is-fallback)时显示 */
.card-wall .logo-txt {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: var(--tint, #008b68);
  color: #fff;
  font-weight: 700;
  line-height: 1;
}

.card-wall .team-logo .logo-txt { font-size: 18px; }
.card-wall .job-logo .logo-txt { font-size: 13px; }

.card-wall .is-fallback img { display: none; }
.card-wall .is-fallback .logo-txt { display: grid; }

.card-wall .team-card,
.card-wall .job-row {
  position: relative;
  z-index: 1;
}

.card-wall .team-card header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-wall .team-card h2,
.card-wall .job-row h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 600;
  color: #1d1d1f;
}

.card-wall .oneliner {
  display: -webkit-box;
  margin: 6px 0 10px;
  overflow: hidden;
  color: #6e6e73;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-wall .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.card-wall .chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f1f2f4;
  color: #7b838d;
  font-size: 11.5px;
  line-height: 16px;
}

.card-wall .job-type-tag {
  position: absolute;
  top: -0.5px;
  right: -0.5px;
  z-index: 2;
  min-width: 40px;
  padding: 3px 9px;
  border-radius: 0 8px 0 8px;
  background: #ebfaf5;
  color: #008b68;
  font-size: 10px;
  line-height: 15px;
  text-align: center;
}

.card-wall .job-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-right: 42px;
}

.card-wall .job-logo {
  position: relative;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.card-wall .job-company-row {
  flex: 1;
  min-width: 0;
}

.card-wall .job-company-name {
  display: block;
  color: #6e6e73;
  font-size: 12.5px;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-wall .job-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-wall .job-title-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.card-wall .job-title-row strong {
  flex-shrink: 0;
  color: #008b68;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  white-space: nowrap;
}

.card-wall .job-desc {
  margin: 0;
  color: #6e6e73;
  font-size: 12.5px;
  line-height: 19px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-wall .job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.card-wall .job-tags span {
  padding: 2px 6px;
  border-radius: 4px;
  background: #f1f2f4;
  color: #7b838d;
  font-size: 11.5px;
  line-height: 17px;
  white-space: nowrap;
}

.card-wall .job-card-foot {
  display: flex;
  gap: 10px;
  color: #86868b;
  font-size: 11px;
  line-height: 16px;
}

.stat-card {
  background: #fff;
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 22px 50px rgba(0, 46, 35, 0.26);
  width: 288px;
  max-width: 84%;
}

.stat-card--top {
  align-self: flex-start;
  margin-left: 5%;
}

.stat-card--bottom {
  align-self: flex-end;
  margin-right: 5%;
  width: 240px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.stat-big {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.1;
  margin: 6px 0 8px;
  color: var(--text-main);
}

.stat-unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 4px;
}

.stat-desc {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 60px;
  margin-top: 14px;
}

.bars span {
  flex: 1;
  border-radius: 5px 5px 3px 3px;
  background: linear-gradient(180deg, #6fcdae, #0ea5a5);
}

.bars span:last-child {
  background: linear-gradient(180deg, #12b083, #2f6fe0);
}

/* 左栏内容容器 */
.card {
  width: 100%;
  max-width: 360px;
  text-align: left;
}

/* ===== 标题 ===== */
.title {
  position: relative;
  display: inline-block;
  isolation: isolate;
  font-size: 30px;
  font-weight: 700;
  margin-bottom: 12px;
}

.subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

/* 手绘笔锋下划线（与标题等宽，由粗到细，位于文字下层） */
.title::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 13px;
  background: url('title-underline.svg') no-repeat center / 100% 100%;
  transform: rotate(1.5deg);
  transform-origin: left center;
}

/* 右上角闪烁星芒 */
.title::before {
  content: '';
  position: absolute;
  top: -14px;
  right: -26px;
  width: 30px;
  height: 27px;
  background: url('sparkle.svg') no-repeat center / contain;
  animation: twinkle 2.4s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.55; transform: scale(0.9) rotate(-4deg); }
  50%      { opacity: 1;    transform: scale(1) rotate(0deg); }
}

.hint {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
  text-align: center;
}

/* ===== 主按钮 ===== */
.wx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 46px;
  border: none;
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease;
}

.wx-btn:hover {
  background: var(--btn-bg-hover);
}

.wx-btn:active {
  background: var(--btn-bg);
}

/* display:inline-flex 会覆盖浏览器对 [hidden] 的默认 display:none，需显式声明 */
.wx-btn[hidden] {
  display: none;
}

/* 内嵌微信扫码二维码容器（wxLogin.js 注入 iframe，内页样式由 app.js 的 WX_QR_CSS 定制） */
.wx-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  font-size: 13px;
  color: #9ca3af;
}

.wx-qr[hidden] {
  display: none;
}

.wx-qr iframe {
  width: 202px;
  height: 280px;
  border: none;
}

/* 二维码不可用时的降级跳转链接 */
.qr-fallback {
  border: none;
  background: none;
  font-size: 13px;
  color: #07c160;
  cursor: pointer;
  text-decoration: underline;
}

/* ===== Tab 切换 ===== */
.tabs {
  position: relative;
  display: flex;
  margin-bottom: 28px;
}

.tab {
  flex: 1;
  padding: 0 0 12px;
  border: none;
  background: none;
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  isolation: isolate;
  transition: color 0.18s ease;
}

/* 选中态：文字后面垫一块薄荷绿马克笔高亮 */
.tab.active::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: 8px;
  width: 60px;
  height: 14px;
  transform: translateX(-50%);
  transform-origin: left center;
  background: url('tab-highlight.svg') no-repeat center / 100% 100%;
  animation: hl-swipe 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

/* 记号笔从左往右刷出 */
@keyframes hl-swipe {
  from {
    transform: translateX(-50%) scaleX(0);
    opacity: 0.3;
  }
  to {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
  }
}

.tab.active {
  color: var(--text-main);
  font-weight: 600;
}

.tabs::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--divider);
}

/* ===== 输入框 ===== */
.field {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  font-size: 15px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.18s ease;
}

.field::placeholder {
  color: var(--text-placeholder);
}

.field:focus {
  border-color: var(--primary);
}

#panel-phone .field,
#bind-view > .field {
  margin-bottom: 12px;
}

.code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.code-row .field {
  flex: 1;
  margin-bottom: 0;
}

/* ===== 验证码文字按钮 ===== */
.code-btn {
  flex-shrink: 0;
  align-self: stretch;
  padding: 0 6px 10px 14px;
  margin-left: 2px;
  border: none;
  border-left: 1px solid var(--divider);
  background: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.code-btn:hover:not(:disabled) {
  color: var(--primary-active);
}

.code-btn:disabled {
  color: var(--text-placeholder);
  cursor: not-allowed;
}

.form-error {
  font-size: 13px;
  color: var(--danger);
  text-align: left;
  margin: -2px 0 12px 2px;
  line-height: 1.5;
}

/* ===== 已登录资料 ===== */
.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
  background: var(--input-bg);
}

#nickname {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 10px;
}

#choose-nickname {
  font-size: 20px;
  margin-bottom: 20px;
}

#continue-btn {
  margin-bottom: 4px;
}

/* ===== 退出 ===== */
.logout-btn {
  margin-top: 8px;
  height: 46px;
  width: 100%;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.logout-btn:hover {
  border-color: var(--text-placeholder);
  color: var(--text-main);
}

#loading {
  color: var(--text-placeholder);
  font-size: 14px;
  padding: 8px 0;
}

/* 两个 tab 面板叠在同一格：隐藏的那个仍占位（容器高度恒为最高面板），
   切换微信 / 手机号时布局完全不变、不跳动 */
.tab-panels {
  display: grid;
}

.tab-panels > .tab-panel {
  grid-area: 1 / 1;
}

/* 覆盖默认 [hidden]{display:none}：隐藏面板保留占位，仅不可见、不可交互 */
.tab-panels > .tab-panel[hidden] {
  display: block;
  visibility: hidden;
  pointer-events: none;
}

/* ===== 切换动效：面板淡入上移 ===== */
.tab-panel:not([hidden]) {
  animation: panel-in 0.28s ease-out;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 尊重系统「减少动态效果」偏好 */
@media (prefers-reduced-motion: reduce) {
  .tab.active::before,
  .tab-panel:not([hidden]),
  .title::before {
    animation: none;
  }
}

/* ===== 响应式：窄屏隐藏右侧品牌面板，内容靠上 ===== */
@media (max-width: 900px) {
  .right {
    display: none;
  }
  .left {
    justify-content: flex-start;
    padding: 132px 24px 80px;
  }
  .brand {
    left: 50%;
    transform: translateX(-50%);
  }
}
