/* ============================================================
   心心同学进步卡 · 前台样式（仅适配平板 / 大屏触控）
   ============================================================ */

:root {
  --mint:      #7fd8c8;
  --mint-deep: #3fb8a3;
  --mint-soft: #e6f8f4;
  --sky:       #8fc7f0;
  --sun:       #ffd479;
  --coral:     #ff9a8b;
  --ink:       #2c3e50;
  --ink-soft:  #6b7c8c;
  --line:      #e3eef0;
  --white:     #ffffff;
  --radius:    28px;
  --shadow-lg: 0 24px 60px rgba(63, 184, 163, .18);
  --shadow-md: 0 10px 30px rgba(63, 184, 163, .14);
  --shadow-sm: 0 4px 14px rgba(44, 62, 80, .07);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  height: 100%;
  overflow: hidden;              /* 首屏锁定，禁止整页滚动 */
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #f2fbf9 0%, #eaf6fd 45%, #fdf6ec 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- 背景装饰 ---------- */
.bg-deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5;
  animation: float 18s ease-in-out infinite;
}
.b1 { width: 420px; height: 420px; background: #b8f0e4; top: -140px; left: -120px; }
.b2 { width: 380px; height: 380px; background: #cfe8ff; bottom: -160px; right: -100px; animation-delay: -6s; }
.b3 { width: 300px; height: 300px; background: #ffe9c2; top: 40%; right: 12%; animation-delay: -12s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(24px, -30px) scale(1.08); }
}

/* ---------- 主舞台（首屏一屏内，不滚动） ---------- */
.stage {
  position: relative; z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(18px, 3.2vh, 40px) clamp(24px, 4vw, 56px) clamp(14px, 2.4vh, 30px);
  height: 100vh;
  height: 100dvh;                /* 移动端/平板浏览器地址栏自适应 */
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.4vh, 30px);
  overflow: hidden;
}

/* ---------- 问候 ---------- */
.hello { display: flex; align-items: center; gap: 18px; flex: 0 0 auto; }
.hello-emoji {
  width: clamp(48px, 6.4vh, 68px); height: clamp(48px, 6.4vh, 68px);
  flex: 0 0 auto;
  display: grid; place-items: center;
  font-size: clamp(24px, 3.2vh, 34px);
  background: var(--white);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
}
.hello-text h1 {
  margin: 0 0 4px;
  font-size: clamp(21px, 2.9vh, 30px); font-weight: 700; letter-spacing: .5px;
}
.hello-text p { margin: 0; font-size: clamp(13px, 1.7vh, 17px); color: var(--ink-soft); }

/* ---------- 分值卡片（自适应撑满剩余高度） ---------- */
.score-card {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ffffff 0%, #f4fdfb 100%);
  border-radius: clamp(24px, 3.4vh, 40px);
  padding: clamp(16px, 3vh, 48px) clamp(20px, 3vw, 48px);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(127, 216, 200, .35);
  text-align: center;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.8,.3,1);
}
.score-card::before {
  content: "";
  position: absolute; inset: -40% -10% auto -10%;
  height: 260px;
  background: radial-gradient(ellipse at center, rgba(127,216,200,.28), transparent 70%);
  pointer-events: none;
}
.score-card.bump { transform: scale(1.015); }

.score-label {
  position: relative;
  font-size: clamp(14px, 1.9vh, 19px); font-weight: 600; letter-spacing: 3px;
  color: var(--mint-deep);
  margin-bottom: clamp(4px, 1vh, 10px);
}

.score-value {
  position: relative;
  display: flex; align-items: baseline; justify-content: center; gap: 10px;
  line-height: 1;
}
#scoreNum {
  font-size: clamp(72px, 19vh, 168px);
  font-weight: 800;
  letter-spacing: -6px;
  background: linear-gradient(135deg, #3fb8a3 0%, #57c9e8 55%, #7fd8c8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
  transition: transform .3s ease;
}
#scoreNum.pop { animation: pop .55s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.14); }
  100% { transform: scale(1); }
}
.score-unit {
  font-size: clamp(18px, 3.4vh, 34px); font-weight: 700; color: var(--mint-deep); opacity: .8;
  -webkit-text-fill-color: var(--mint-deep);
}

.score-spark {
  position: relative;
  height: clamp(14px, 2.4vh, 26px); margin-top: 4px;
  font-size: clamp(14px, 2.2vh, 22px); letter-spacing: 6px;
  color: var(--sun);
  min-height: 14px;
}

.score-foot {
  position: relative;
  margin-top: clamp(6px, 1.6vh, 18px);
  display: inline-flex; align-items: center; gap: 8px;
  font-size: clamp(12px, 1.6vh, 15px); color: var(--ink-soft);
  background: rgba(127,216,200,.12);
  padding: clamp(5px, .9vh, 8px) 18px; border-radius: 999px;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--mint-deep);
  box-shadow: 0 0 0 4px rgba(63,184,163,.18);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%     { opacity: .35; }
}

/* ---------- 按钮 ---------- */
.actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 2vw, 24px);
}
.btn {
  appearance: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: clamp(16px, 2.2vh, 21px); font-weight: 700;
  border-radius: clamp(16px, 2.4vh, 24px);
  padding: clamp(14px, 2.6vh, 26px) clamp(14px, 2vw, 28px);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  transition: transform .18s ease, box-shadow .25s ease, background .25s ease;
  user-select: none;
}
.btn:active { transform: scale(.975); }
.btn-ico { font-size: clamp(18px, 2.4vh, 24px); }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #4ecdb6 0%, #3fb8a3 100%);
  box-shadow: 0 14px 32px rgba(63,184,163,.34);
}
.btn-primary:hover { box-shadow: 0 18px 40px rgba(63,184,163,.44); }

.btn-ghost {
  color: var(--mint-deep);
  background: var(--white);
  border: 2px solid rgba(127,216,200,.55);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { background: var(--mint-soft); }

.btn-sm { font-size: 18px; padding: 16px 30px; border-radius: 18px; }

.foot {
  flex: 0 0 auto;
  text-align: center;
  font-size: clamp(11px, 1.5vh, 15px); color: #9fb0bd; letter-spacing: 1px;
}

/* ---------- 全屏面板（申请 / 记录） ---------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(30, 55, 60, .38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(0px, 2.4vh, 32px) clamp(0px, 2.4vw, 40px);
  animation: fadeIn .22s ease;
  overflow: hidden;
}
.sheet-mask[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%; max-width: 720px;
  height: 100%;
  max-height: 100%;
  background: var(--white);
  border-radius: clamp(20px, 3vh, 32px);
  box-shadow: 0 30px 80px rgba(20, 60, 60, .28);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: rise .28s cubic-bezier(.2,.9,.3,1);
}
.sheet-wide { max-width: 900px; }
@keyframes rise {
  from { transform: translateY(28px) scale(.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.sheet-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(14px, 2.2vh, 26px) clamp(18px, 3vw, 32px) clamp(10px, 1.6vh, 18px);
  border-bottom: 1px solid var(--line);
}
.sheet-head h2 { margin: 0; font-size: clamp(19px, 2.6vh, 24px); font-weight: 700; }
.sheet-close {
  appearance: none; border: 0; cursor: pointer;
  width: 42px; height: 42px; border-radius: 14px;
  background: #f2f7f8; color: var(--ink-soft);
  font-size: 18px; line-height: 1;
  transition: background .2s;
}
.sheet-close:hover { background: #e6eef0; }

/* 面板主体：唯一可滚动区域 */
.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: clamp(14px, 2.2vh, 22px) clamp(18px, 3vw, 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.sheet-body.scroll-y { overflow-y: auto; }
.sheet-tip { margin: 0 0 18px; font-size: 16px; color: var(--ink-soft); line-height: 1.6; }

.sheet-foot {
  flex: 0 0 auto;
  display: flex; gap: 16px; justify-content: flex-end;
  padding: clamp(12px, 1.8vh, 18px) clamp(18px, 3vw, 32px) clamp(14px, 2.2vh, 26px);
  border-top: 1px solid var(--line);
  background: #fbfefe;
}

/* ---------- 事项选择 ---------- */
.item-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.item {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 22px;
  border: 2px solid var(--line);
  border-radius: 20px;
  cursor: pointer;
  transition: all .2s ease;
  background: #fcfefe;
}
.item input { position: absolute; opacity: 0; pointer-events: none; }
.item-main { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.item-title { font-size: 19px; font-weight: 600; }
.item-score {
  font-size: 17px; font-weight: 700; color: var(--mint-deep);
  background: var(--mint-soft);
  padding: 6px 14px; border-radius: 999px;
  white-space: nowrap;
}
.item-check {
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid; place-items: center;
  font-size: 15px; color: transparent;
  transition: all .2s ease;
}
.item.selected {
  border-color: var(--mint);
  background: linear-gradient(135deg, #f2fdfa, #eafaf6);
  box-shadow: 0 8px 22px rgba(63,184,163,.16);
}
.item.selected .item-check {
  background: var(--mint-deep); border-color: var(--mint-deep); color: #fff;
}

/* ---------- 可累计事项：标签 + 次数选择器 ---------- */
.rep-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 1.5;
  color: #2f7fd1;
  background: #eaf3ff;
  border-radius: 999px;
  vertical-align: middle;
  white-space: nowrap;
}
.times-box {
  margin: 0 0 20px;
  padding: 16px 20px;
  border: 2px solid #d9ecff;
  border-radius: 20px;
  background: linear-gradient(135deg, #f6fbff, #eef7ff);
}
.times-box[hidden] { display: none; }
.times-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.times-sum {
  font-size: 16px; font-weight: 700; color: #2f7fd1;
}
.times-ctrl { display: flex; align-items: center; gap: 10px; }
.times-btn {
  width: 46px; height: 46px;
  flex: 0 0 46px;
  border: 2px solid #cfe6ff;
  border-radius: 14px;
  background: #fff;
  color: #2f7fd1;
  font-size: 24px; font-weight: 700; line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.times-btn:hover:not(:disabled) { background: #2f7fd1; border-color: #2f7fd1; color: #fff; }
.times-btn:active:not(:disabled) { transform: scale(.94); }
.times-btn:disabled { opacity: .38; cursor: not-allowed; }
.times-num {
  min-width: 62px;
  text-align: center;
  font-size: 26px; font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.times-unit { font-size: 16px; color: var(--ink-soft); }

/* ---------- 表单 ---------- */
.field { display: block; }
.field-label {
  display: block; font-size: 16px; font-weight: 600;
  color: var(--ink-soft); margin-bottom: 10px;
}
textarea, input[type="text"], input[type="password"], input[type="number"], select {
  width: 100%;
  font-family: inherit; font-size: 17px; color: var(--ink);
  padding: 16px 18px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fcfefe;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  resize: vertical;
}
textarea:focus, input:focus, select:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 4px rgba(127,216,200,.18);
}

/* ---------- 记录 ---------- */
.tabs { display: flex; gap: 10px; padding: 16px 32px 0; }
.tab {
  appearance: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: 17px; font-weight: 600;
  padding: 12px 24px; border-radius: 999px;
  background: #f2f7f8; color: var(--ink-soft);
  transition: all .2s;
}
.tab.active { background: var(--mint-deep); color: #fff; box-shadow: 0 8px 20px rgba(63,184,163,.3); }

.rec-list { display: flex; flex-direction: column; gap: 12px; }
.rec {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px;
  border-radius: 20px;
  background: #fbfdfd;
  border: 1px solid var(--line);
}
.rec-ico {
  width: 46px; height: 46px; flex: 0 0 46px;
  border-radius: 15px; display: grid; place-items: center;
  font-size: 20px;
}
.rec.add .rec-ico { background: #e6f8f4; }
.rec.sub .rec-ico { background: #ffeeeb; }
.rec-main { flex: 1; min-width: 0; }
.rec-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; word-break: break-all; }
.rec-meta { font-size: 14px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 10px; }
.rec-score { font-size: 24px; font-weight: 800; white-space: nowrap; }
.rec.add .rec-score { color: var(--mint-deep); }
.rec.sub .rec-score { color: var(--coral); }

.badge {
  display: inline-block; font-size: 13px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px;
}
.badge.pending  { background: #fff5e0; color: #d99a1a; }
.badge.approved { background: #e6f8f4; color: var(--mint-deep); }
.badge.rejected { background: #ffeeeb; color: #e2685a; }

.reject-box {
  margin-top: 10px;
  padding: 12px 16px;
  background: #fff6f4;
  border-left: 4px solid var(--coral);
  border-radius: 10px;
  font-size: 15px; color: #b8503f; line-height: 1.6;
}

.empty {
  text-align: center; padding: 46px 20px;
  color: #a8b8c4; font-size: 17px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%) translateY(20px);
  z-index: 99;
  background: rgba(44, 62, 80, .94);
  color: #fff; font-size: 17px; font-weight: 600;
  padding: 16px 30px; border-radius: 999px;
  box-shadow: 0 14px 36px rgba(0,0,0,.24);
  opacity: 0; transition: all .28s ease;
  max-width: 80vw; text-align: center;
}
.toast[hidden] { display: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: rgba(226, 104, 90, .96); }

/* ---------- 平板竖屏（只调横向留白，纵向交给 clamp 自适应） ---------- */
@media (max-width: 900px) {
  .stage { padding-left: 28px; padding-right: 28px; }
  .sheet-mask { padding: 0; }
  .sheet { border-radius: 0; max-width: 100%; }
}

/* ---------- 小屏兜底（手机也能看，但不做重点适配） ---------- */
@media (max-width: 620px) {
  .stage { padding-left: 16px; padding-right: 16px; }
  .actions { grid-template-columns: 1fr; gap: 12px; }
  .btn { font-size: 17px; padding: 16px; }
  .sheet-body, .sheet-head, .sheet-foot { padding-left: 18px; padding-right: 18px; }
  .tabs { padding-left: 18px; padding-right: 18px; }
}

/* ---------- 矮屏兜底（横屏平板 / 小窗口，保证首屏仍不滚动） ---------- */
@media (max-height: 620px) {
  .stage { gap: 10px; padding-top: 12px; padding-bottom: 10px; }
  .hello-emoji { width: 42px; height: 42px; font-size: 20px; border-radius: 14px; }
  .hello-text h1 { font-size: 19px; }
  .hello-text p { font-size: 12px; }
  #scoreNum { font-size: clamp(56px, 16vh, 110px); letter-spacing: -3px; }
  .score-unit { font-size: 18px; }
  .score-spark { display: none; }
  .score-foot { margin-top: 4px; font-size: 12px; padding: 4px 14px; }
  .btn { font-size: 16px; padding: 12px 14px; border-radius: 14px; }
  .foot { display: none; }
  .times-box { padding: 10px 14px; margin-bottom: 12px; border-radius: 16px; }
  .times-head { margin-bottom: 8px; }
  .times-btn { width: 38px; height: 38px; flex: 0 0 38px; font-size: 20px; border-radius: 12px; }
  .times-num { font-size: 21px; min-width: 50px; }
  .times-sum { font-size: 14px; }
}
