/* ==========================================================================
   新增组件样式（主线浅色体系）
   家长中心图表 / 账号表单 / OpenMoji 插画 / 开关 / 头像选择
   ========================================================================== */

/* ------------------------------ OpenMoji 插画 ------------------------------ */
.om-art {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.om-fallback { display: block; width: 100%; }
.om-fallback svg { width: 100%; height: auto; }

.wpic__art .om-art { width: 100%; }
.spell-prompt .om-art { width: clamp(88px, 14vw, 132px); margin-inline: auto; }
.speaker .om-art { width: 60%; margin-inline: auto; }

/* 首页插画带 */
.emoji-strip {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-3);
  flex-wrap: wrap;
  justify-content: center;
}
.emoji-chip {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: var(--sh-1);
  display: grid;
  place-items: center;
  padding: 6px;
  transition: transform var(--dur) var(--ease);
}
.emoji-chip:nth-child(odd) { transform: rotate(-4deg); }
.emoji-chip:nth-child(even) { transform: rotate(4deg); }
.emoji-chip:hover { transform: translateY(-4px) rotate(0deg); }
.emoji-chip .om-art { width: 100%; }

/* 挑战模式入口卡（位于浅色地图页） */
.card--challenge {
  background: linear-gradient(100deg, #101736, #2A1B54 60%, #3A1B5C);
  color: #fff;
  border: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card--challenge::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 60px at 88% 20%, rgba(0, 224, 255, .30), transparent 70%);
  pointer-events: none;
}
.card--challenge:hover { transform: translateY(-3px); box-shadow: 0 18px 40px rgba(30, 10, 70, .32); }
.btn--arcade {
  background: #FFD500;
  color: #2C2850;
  min-height: 44px;
  padding: 0 22px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-pill);
}

/* ------------------------------ 统计小卡 ------------------------------ */
.pstat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--s-3);
}
.pstat {
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: var(--s-4);
  box-shadow: var(--sh-1);
}
.pstat__val { font-family: var(--f-num); font-size: var(--t-xl); font-weight: 700; line-height: 1.1; }
.pstat__label { font-size: var(--t-xs); color: var(--c-ink2); margin-top: 6px; }
.pstat__sub { font-size: var(--t-xs); color: var(--c-ink3); margin-top: 2px; }

/* ------------------------------ 柱状图 ------------------------------ */
.chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s-2);
  height: 148px;
  padding-top: var(--s-5);
}
.chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
}
.chart__track {
  flex: 1;
  width: 100%;
  max-width: 40px;
  background: var(--c-lav);
  border-radius: var(--r-pill);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.chart__bar {
  width: 100%;
  background: var(--c-grad);
  border-radius: var(--r-pill);
  transition: height var(--dur-slow) var(--ease);
}
.chart__bar.is-today { background: linear-gradient(180deg, #FFD166, #F0A020); }
.chart__label { font-size: var(--t-xs); color: var(--c-ink3); }
.chart__val { font-family: var(--f-num); font-size: 11px; color: var(--c-ink3); min-height: 14px; }

/* ------------------------------ 行列表 ------------------------------ */
.plist { display: flex; flex-direction: column; }
.prow {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 12px 0;
  border-bottom: 1px solid var(--c-line);
}
.prow:last-child { border-bottom: 0; }
.prow__word { font-size: var(--t-md); }
.prow__zh { flex: 1; font-size: var(--t-sm); color: var(--c-ink3); }

/* ------------------------------ 开关 ------------------------------ */
.switch {
  width: 52px;
  height: 30px;
  border-radius: var(--r-pill);
  background: var(--c-line2);
  position: relative;
  flex: 0 0 auto;
  transition: background var(--dur) var(--ease);
}
.switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--sh-1);
  transition: transform var(--dur) var(--ease);
}
.switch.is-on { background: var(--c-purple); }
.switch.is-on span { transform: translateX(22px); }

/* ------------------------------ 表单 ------------------------------ */
.input {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--s-4);
  border: 1px solid var(--c-line2);
  border-radius: var(--r-md);
  background: #fff;
  font-size: var(--t-sm);
  font-family: inherit;
  color: var(--c-ink);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input:focus {
  outline: none;
  border-color: var(--c-purple);
  box-shadow: 0 0 0 4px rgba(125, 92, 255, .14);
}
.input::placeholder { color: var(--c-ink4); }
select.input { appearance: none; cursor: pointer; }
.input--pin {
  text-align: center;
  letter-spacing: .5em;
  font-size: var(--t-2xl);
  min-height: 64px;
  padding-left: calc(var(--s-4) + .5em);
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: var(--t-xs); font-weight: 600; color: var(--c-ink2); }
.hint { font-size: var(--t-xs); color: var(--c-ink3); margin-top: -6px; }

.form-msg {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  line-height: 1.6;
}
.form-msg.is-bad { background: var(--c-red-bg); color: #B3352F; }
.form-msg.is-ok  { background: var(--c-green-bg); color: #15714A; }

.link {
  color: var(--c-purple);
  font-weight: 600;
  text-decoration: underline;
  font-size: inherit;
}

/* 分段控件 */
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--c-lav);
  padding: 4px;
  border-radius: var(--r-md);
}
.seg__item {
  min-height: 42px;
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--c-ink3);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.seg__item.is-on { background: #fff; color: var(--c-purple); box-shadow: var(--sh-1); }

/* 头像选择 */
.avatar-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: var(--s-2);
}
.avatar-pick__item {
  aspect-ratio: 1;
  font-size: 24px;
  border-radius: var(--r-sm);
  border: 2px solid var(--c-line);
  background: #fff;
  display: grid;
  place-items: center;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.avatar-pick__item:hover { transform: translateY(-2px); }
.avatar-pick__item.is-on { border-color: var(--c-purple); background: var(--c-lav); }

/* 监护人同意块 */
.guardian {
  border: 1px solid #F3D9A0;
  background: #FFFAEC;
  border-radius: var(--r-md);
  padding: var(--s-4);
}
.guardian__row {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  font-size: var(--t-sm);
  line-height: 1.75;
  color: #7A5A00;
}
.guardian__row input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--c-purple); }

/* ------------------------------ 小屏适配 ------------------------------ */
@media (max-width: 760px) {
  /* 顶栏按钮多，窄屏下换成图标化排版，避免横向溢出 */
  .topbar { flex-wrap: wrap; row-gap: var(--s-3); }
  .brand__sub { display: none; }
  .topbar__right { flex-wrap: wrap; row-gap: var(--s-2); }
  .topbar__right .btn {
    min-height: 40px !important;
    padding: 0 12px !important;
    font-size: var(--t-xs) !important;
  }
  .emoji-chip { width: 44px; height: 44px; }
  .chart { height: 120px; }
  .pstat { padding: var(--s-3); }
  .pstat__val { font-size: var(--t-lg); }
}

@media (max-width: 420px) {
  .emoji-strip { gap: 6px; }
  .emoji-chip { width: 38px; height: 38px; padding: 4px; }
}
