/* ============================================================
   经络操打卡 · 样式（紫色 · 多邻国质感 · 克制动效）
   ============================================================ */
:root {
  --brand: #7c5cf0;
  --brand-deep: #5b3fd1;      /* 按钮 3D 底边 */
  --brand-ink: #4c39b8;
  --brand-weak: #efeafd;
  --gold: #d98f1f;
  --gold-weak: #fbf1de;
  --bg: #f6f4fb;
  --surface: #ffffff;
  --surface-2: #efecf8;
  --ink: #2a2438;
  --ink-2: #615a75;
  --ink-3: #9a93ab;
  --line: #e4dff0;
  --line-2: #d2cbe6;
  --danger: #d64550;
  --danger-deep: #a92f3a;
  --radius: 16px;
  --gutter: 18px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 22px; --s6: 30px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --press: 0.12s var(--ease);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink); min-height: 100vh; font-size: 15px; line-height: 1.6;
}
.hidden { display: none !important; }
.muted { color: var(--ink-3); font-size: 13px; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
input:focus-visible, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }

/* ============ 多邻国按钮：实色 + 3D 底边，按下下沉 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 14px; font-size: 15px; font-weight: 800;
  letter-spacing: 1px; padding: 11px 20px; background: var(--surface-2); color: var(--ink-2);
  box-shadow: 0 4px 0 var(--line-2);
  transition: transform var(--press), box-shadow var(--press), filter .15s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--line-2); }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 4px 0 var(--brand-deep); }
.btn.primary:active { box-shadow: 0 0 0 var(--brand-deep); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: var(--surface); color: var(--ink-2); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.btn.ghost:active { box-shadow: 0 0 0 var(--line); }
.btn.danger { background: var(--surface); color: var(--danger); border: 2px solid color-mix(in srgb, var(--danger) 35%, var(--line)); box-shadow: 0 3px 0 color-mix(in srgb, var(--danger) 30%, var(--line)); }
.btn.danger:active { box-shadow: 0 0 0 rgba(0,0,0,0); }
.btn.sm { font-size: 13px; padding: 7px 14px; border-radius: 11px; box-shadow: 0 3px 0 var(--line-2); }
.btn.big { padding: 15px 20px; font-size: 16px; border-radius: 16px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ============ 登录 / 实名 ============ */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--s5) var(--gutter); }
.auth-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 2px solid var(--line);
  border-radius: 22px; padding: 36px 28px 26px; text-align: center;
  animation: rise .3s var(--ease) both;
}
.auth-mark {
  width: 64px; height: 64px; margin: 0 auto var(--s4); border-radius: 18px;
  background: var(--brand); color: #fff; font-size: 32px; font-weight: 800;
  display: grid; place-items: center; box-shadow: 0 4px 0 var(--brand-deep);
}
.auth-title { font-size: 24px; font-weight: 800; letter-spacing: 1px; margin-bottom: 22px; }
.field { display: block; text-align: left; margin-bottom: 14px; }
.field span { display: block; font-size: 12px; font-weight: 800; color: var(--ink-2); margin-bottom: 5px; }
.field span em { font-style: normal; color: var(--gold); font-weight: 800; margin-left: 4px; }
.field input {
  width: 100%; border: 2px solid var(--line); border-radius: 12px; background: var(--surface);
  padding: 11px 13px; font-size: 15px; outline: none; transition: border-color .15s;
}
.field input:focus { border-color: var(--brand); }
.auth-hint {
  text-align: left; font-size: 12px; color: var(--gold); background: var(--gold-weak);
  border-radius: 10px; padding: 8px 11px; margin-bottom: 14px;
}
.auth-foot { font-size: 11px; color: var(--ink-3); margin-top: 14px; }
.auth-foot .link { color: var(--brand-ink); font-weight: 800; text-decoration: underline; }

/* ============ 主框架 ============ */
.app { max-width: 560px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + var(--s4)) var(--gutter) 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); animation: rise .3s var(--ease) both; }
.brand { font-size: 25px; font-weight: 800; letter-spacing: 1px; min-width: 0; }
.who {
  flex: none; font-size: 13px; font-weight: 800; color: var(--brand-ink);
  background: var(--brand-weak); border-radius: 999px; padding: 7px 14px;
  border: 2px solid color-mix(in srgb, var(--brand) 25%, transparent);
  transition: transform var(--press);
}
.who:active { transform: scale(.95); }

/* ---- 公告跑马灯 ---- */
.notice {
  display: flex; align-items: center; gap: 10px;
  background: var(--gold-weak); border: 2px solid #efd9ab;
  border-radius: 12px; padding: 8px 12px; margin-bottom: var(--s4);
}
.notice-tag {
  flex: none; font-size: 11px; font-weight: 800; color: #8a5a10;
  background: #f3e2bd; border-radius: 6px; padding: 2px 7px; letter-spacing: 2px;
}
.notice-scroll { flex: 1; overflow: hidden; white-space: nowrap; -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.notice-scroll span {
  display: inline-block; padding-left: 100%;
  font-size: 13px; font-weight: 700; color: #8a5a10;
  animation: marquee 14s linear infinite;
}
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---- 标签页（平滑滑动，无弹跳） ---- */
.tabs {
  position: relative; display: flex; background: var(--surface-2);
  border: 2px solid var(--line); border-radius: 15px; padding: 4px; margin-bottom: var(--s5); user-select: none;
}
.tab {
  position: relative; z-index: 1; flex: 1; border: none; background: none;
  font-size: 15px; font-weight: 800; color: var(--ink-3);
  padding: 10px 0; border-radius: 11px; transition: color .18s;
}
.tab.active { color: var(--brand-ink); }
.tab-ind {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; border-radius: 11px;
  background: var(--surface); border: 2px solid var(--line);
  box-shadow: 0 2px 0 var(--line);
  transition: left .22s var(--ease), width .22s var(--ease);
}
.page { animation: rise .3s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: var(--s6) 0 var(--s3); }
.sec-head h3 { font-size: 16px; font-weight: 800; }
.sec-count { font-size: 12px; color: var(--ink-3); font-weight: 800; }

/* ============ 打卡状态卡 ============ */
.hero {
  border: 2px solid var(--brand-deep); border-radius: 20px; padding: 24px var(--s5);
  color: #fff; background: var(--brand);
  display: flex; align-items: center; gap: var(--s4);
}
.hero.done { background: #8f7aee; border-color: #6a53cf; }
.hero-main { flex: 1; min-width: 0; }
.hero-badge {
  display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: 2px;
  background: rgba(255,255,255,.2); border-radius: 999px; padding: 3px 10px;
}
.hero-time { font-size: 34px; font-weight: 800; font-family: ui-monospace, monospace; letter-spacing: 1px; line-height: 1.2; }
.hero-note { font-size: 13px; opacity: .9; }
.hero-side { flex: none; width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.18); display: grid; place-items: center; font-size: 26px; font-weight: 800; }
.hero-todo { cursor: pointer; transition: transform var(--press); }
.hero-todo:active { transform: scale(.98); }
.hero-todo .hero-side.arrow { font-size: 24px; }

.rec-list { display: flex; flex-direction: column; gap: var(--s3); }
.rec-row {
  display: flex; align-items: center; gap: var(--s4);
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 13px var(--s4);
  animation: rise .3s var(--ease) both;
}
.rec-dot { flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--brand-weak); color: var(--brand-ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.rec-date { flex: 1; min-width: 0; }
.rec-date b { font-size: 15px; }
.rec-date i { font-style: normal; font-size: 12px; color: var(--ink-3); margin-left: 8px; }
.rec-time { font-size: 14px; font-weight: 800; color: var(--brand-ink); font-family: ui-monospace, monospace; }

.empty { text-align: center; padding: var(--s6) var(--s4); color: var(--ink-3); }
.empty p { font-weight: 700; font-size: 13px; }

/* ============ 总览 ============ */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.stat-card {
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: var(--s4); animation: rise .3s var(--ease) both;
}
.stat-card b { display: block; font-size: 30px; font-weight: 800; color: var(--brand-ink); line-height: 1.2; font-family: ui-monospace, monospace; }
.stat-card.gold b { color: var(--gold); }
.stat-card span { font-size: 12px; color: var(--ink-2); font-weight: 800; }
.stat-card.wide { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
.stat-card.wide b { display: inline; font-size: 24px; }

.cal-card { margin-top: var(--s4); background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: var(--s4); }
.cal-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--s3); }
.cal-head h3 { font-size: 15px; font-weight: 800; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 6px; }
.cal-week i { font-style: normal; text-align: center; font-size: 11px; color: var(--ink-3); font-weight: 800; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-cell {
  aspect-ratio: 1; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  border-radius: 10px; color: var(--ink-2); background: var(--surface-2);
}
.cal-cell.on { background: var(--brand); color: #fff; border: 2px solid var(--brand-deep); }
.cal-cell.today { outline: 3px solid var(--gold); outline-offset: 1px; }

/* ============ 同修 ============ */
.today-head { display: flex; align-items: center; justify-content: space-between; }
.page-title { font-size: 20px; font-weight: 800; }
.seg { display: flex; background: var(--surface-2); border: 2px solid var(--line); border-radius: 12px; padding: 3px; margin: var(--s4) 0; }
.seg-btn {
  flex: 1; border: none; background: none; font-size: 13px; font-weight: 800; color: var(--ink-3);
  padding: 8px 0; border-radius: 9px; transition: all .18s var(--ease);
}
.seg-btn.active { background: var(--surface); color: var(--brand-ink); box-shadow: 0 2px 0 var(--line); }
.done-band {
  border-radius: var(--radius); padding: var(--s3) var(--s4);
  background: var(--brand-weak); color: var(--brand-ink); border: 2px solid color-mix(in srgb, var(--brand) 25%, transparent);
  font-weight: 800; font-size: 14px;
}
.mate-list { display: flex; flex-direction: column; gap: var(--s2); }
.mate-row {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--surface); border: 2px solid var(--line); border-radius: 12px;
  padding: 10px var(--s4); animation: rise .3s var(--ease) both;
}
.mate-av {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 14px; font-weight: 800; color: #fff;
  background: var(--brand); border: 2px solid var(--brand-deep);
}
.mate-row .n { flex: 1; font-weight: 800; font-size: 14px; min-width: 0; }
.mate-row .n .real, .board-row .n .real { font-style: normal; font-size: 11px; color: var(--ink-3); font-weight: 700; margin-left: 6px; }
.mate-row .t { font-size: 13px; font-weight: 800; color: var(--brand-ink); font-family: ui-monospace, monospace; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  background: var(--surface); border: 2px dashed var(--line-2);
  border-radius: 999px; padding: 5px 14px;
}

/* 排行榜 */
.board { display: flex; flex-direction: column; gap: var(--s2); }
.board-row {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--surface); border: 2px solid var(--line); border-radius: 12px;
  padding: 10px var(--s4); animation: rise .3s var(--ease) both;
}
.board-rank {
  flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; background: var(--surface-2); color: var(--ink-2);
  border: 2px solid var(--line);
}
.board-row.top1 .board-rank { background: var(--gold); border-color: #b57612; color: #fff; }
.board-row.top2 .board-rank { background: #b9b2c9; border-color: #948ba8; color: #fff; }
.board-row.top3 .board-rank { background: #d99a6c; border-color: #ad7040; color: #fff; }
.board-row .n { flex: 1; font-weight: 800; font-size: 14px; }
.board-row .s { font-size: 13px; font-weight: 800; color: var(--gold); }
.board-row .s i { font-style: normal; font-size: 11px; color: var(--ink-3); font-weight: 700; margin-left: 2px; }
.board-row .tot { font-size: 12px; color: var(--ink-3); font-weight: 700; }

/* ============ 打卡大弹窗 ============ */
.lockmodal {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  background: rgba(35, 28, 56, .5); padding: var(--s5);
  animation: fadeIn .2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lock-card {
  width: 100%; max-width: 360px; background: var(--surface); border: 2px solid var(--line);
  border-radius: 24px; padding: 32px 24px 24px; text-align: center;
  animation: lockIn .25s var(--ease) both;
  display: flex; flex-direction: column; gap: var(--s3);
}
@keyframes lockIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.lock-mark {
  width: 68px; height: 68px; margin: 0 auto var(--s1); border-radius: 20px;
  background: var(--brand); border: 2px solid var(--brand-deep); box-shadow: 0 4px 0 var(--brand-deep);
  color: #fff; font-size: 32px; font-weight: 800; display: grid; place-items: center;
}
.lock-title { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.lock-sub { color: var(--ink-2); font-size: 14px; margin-bottom: var(--s2); }
.lock-btn { font-size: 17px; }
.lock-foot { font-size: 11px; color: var(--ink-3); margin-top: var(--s1); }

/* ============ 个人面板（底部滑出） ============ */
.sheet { position: fixed; inset: 0; z-index: 85; }
.sheet-mask { position: absolute; inset: 0; background: rgba(35, 28, 56, .45); animation: fadeIn .2s ease both; }
.sheet-card {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px;
  background: var(--surface); border: 2px solid var(--line); border-bottom: none;
  border-radius: 24px 24px 0 0; padding: 12px var(--gutter) calc(env(safe-area-inset-bottom) + 24px);
  animation: sheetUp .28s var(--ease) both;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { width: 44px; height: 5px; border-radius: 999px; background: var(--line-2); margin: 0 auto var(--s4); }
.sheet-title { font-size: 18px; font-weight: 800; margin-bottom: var(--s3); }
.profile-body { margin-bottom: var(--s4); }
.profile-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 2px; border-bottom: 2px solid var(--surface-2); font-size: 14px;
}
.profile-row:last-child { border-bottom: none; }
.profile-row span { color: var(--ink-3); font-weight: 700; }
.profile-row b { font-weight: 800; }

/* ============ toast ============ */
.toast {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: #fff; font-size: 14px; font-weight: 700;
  padding: 11px 20px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: all .25s var(--ease); z-index: 99; max-width: 82vw; text-align: center;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
