* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  background: linear-gradient(160deg, #fff7e8 0%, #ffeef5 55%, #eef4ff 100%);
  min-height: 100vh; color: #2b2440; touch-action: manipulation;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ---------- 登录 ---------- */
.login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 50; }
.login-card { background: #fff; border-radius: 28px; padding: 36px 28px; width: 100%; max-width: 380px; text-align: center; box-shadow: 0 18px 50px rgba(124,92,255,.18); }
.login-logo { font-size: 72px; animation: bounce 1.6s infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.login-title { margin: 8px 0 0; font-size: 24px; }
.login-sub { margin: 4px 0 20px; color: #8d86a8; font-size: 14px; }
.seg { display: flex; background: #f3efff; border-radius: 14px; padding: 4px; margin-bottom: 16px; }
.seg-btn { flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 11px; font-size: 15px; color: #6b63a0; }
.seg-btn.active { background: #fff; color: #7c5cff; font-weight: 700; box-shadow: 0 2px 8px rgba(124,92,255,.15); }
.input { width: 100%; border: 2px solid #ece7fb; border-radius: 14px; padding: 12px 14px; outline: none; background: #fff; }
.input:focus { border-color: #7c5cff; }
.err { color: #e03131; margin-top: 10px; min-height: 18px; font-size: 14px; }

/* ---------- 按钮 ---------- */
.btn { border: 0; border-radius: 14px; padding: 12px 18px; font-size: 16px; font-weight: 700; background: #f1edfa; color: #4a4170; }
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(135deg,#ff8a3d,#ff5f9e); color: #fff; }
.btn-green { background: #2f9e44; color: #fff; }
.btn-blue { background: #1971c2; color: #fff; }
.btn-ghost { background: transparent; color: #8d86a8; }
.btn-sm { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-danger { background: #ffe3e3; color: #e03131; }

/* ---------- 孩子看板 ---------- */
.board { max-width: 760px; margin: 0 auto; padding: 16px 14px 40px; }
.monster-card { background: linear-gradient(135deg,#7c5cff,#a06bff); color: #fff; border-radius: 24px; padding: 18px; display: flex; gap: 14px; align-items: center; box-shadow: 0 12px 30px rgba(124,92,255,.35); }
.monster-emoji { font-size: 64px; line-height: 1; }
.monster-info { flex: 1; min-width: 0; }
.monster-title { font-size: 20px; font-weight: 800; }
.monster-sub { font-size: 13px; opacity: .92; margin-top: 2px; }
.xpbar { height: 10px; background: rgba(255,255,255,.3); border-radius: 99px; margin-top: 8px; overflow: hidden; }
.xpbar-fill { height: 100%; width: 0%; background: linear-gradient(90deg,#ffd43b,#ff922b); border-radius: 99px; transition: width .6s; }
.ring-wrap { position: relative; width: 84px; height: 84px; flex: none; }
.ring { width: 84px; height: 84px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-bg { stroke: rgba(255,255,255,.25); }
.ring-fg { stroke: #ffd43b; stroke-linecap: round; stroke-dasharray: 213.6; stroke-dashoffset: 213.6; transition: stroke-dashoffset .6s; }
.ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: #fff; border-radius: 16px; padding: 10px 6px; text-align: center; box-shadow: 0 4px 14px rgba(43,36,64,.06); }
.stat-v { font-size: 20px; font-weight: 800; color: #7c5cff; }
.stat-v.duration { font-size: 14px; line-height: 1.4; }
.stat-k { font-size: 12px; color: #8d86a8; margin-top: 2px; }
.mood { background: #fff; border-radius: 16px; padding: 12px 16px; margin-bottom: 6px; font-size: 15px; box-shadow: 0 4px 14px rgba(43,36,64,.06); }
.sec-title { font-size: 18px; margin: 18px 2px 10px; }
.badge { background: #7c5cff; color: #fff; border-radius: 99px; padding: 2px 9px; font-size: 13px; }
.badge-dot { position: absolute; top: -4px; right: -4px; background: #fa5252; color: #fff; border-radius: 99px; font-size: 10px; padding: 1px 6px; }

.task-card { background: #fff; border-radius: 20px; padding: 16px; margin-bottom: 12px; box-shadow: 0 6px 18px rgba(43,36,64,.07); }
.task-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sub-chip { border-radius: 99px; padding: 4px 10px; font-size: 13px; font-weight: 700; }
.sub-zh { background:#fff3e0; color:#e8590c; }
.sub-ma { background:#e7f5ff; color:#1971c2; }
.sub-en { background:#f3e8ff; color:#6741d9; }
.sub-c86 { background:#fff0f6; color:#c2255c; }
.sub-go { background:#e6fcf5; color:#0b7285; }
.sub-rope { background:#ebfbee; color:#2b8a3e; }
.wild-badge { font-size:12px; background:#fff1e0; color:#d9480f; border-radius:99px; padding:2px 8px; white-space:nowrap; }
.hunted-badge { font-size:12px; background:#d3f9d8; color:#2b8a3e; border-radius:99px; padding:2px 8px; white-space:nowrap; }
.task-card.defeated-dim { background:#eceef2; border:1px solid #dfe3e8; box-shadow:none; }
.task-card.defeated-dim .task-title { color:#868e96; }
.task-card.defeated-dim .task-content { color:#9aa1a9; }
.task-card.wild-pending { background:#fffdf4; border:2px solid #ffd43b; }
.sub-other { background:#f1f3f5; color:#495057; }
.task-title { font-size: 17px; font-weight: 800; flex: 1; min-width: 0; }
.task-meta { font-size: 12px; color: #8d86a8; margin: 6px 2px 0; }
.task-points { font-weight: 800; color: #f59f00; white-space: nowrap; font-size: 14px; }
.task-content { margin: 10px 2px 0; font-size: 16px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.dropzone { border: 2px dashed #d9d2f2; border-radius: 16px; padding: 20px 14px; text-align: center; cursor: pointer; background: #faf8ff; transition: all .2s; }
.dropzone:hover, .dropzone.drag-over { border-color: #7c5cff; background: #f3efff; }
.dropzone.drag-over { transform: scale(1.01); }
.dropzone.uploading { opacity: .6; pointer-events: none; }
.dz-hint { font-size: 14px; color: #6b63a0; line-height: 1.9; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.media-item { border-radius: 14px; overflow: hidden; background: #f6f3ff; position: relative; }
.media-item img, .media-item video { width: 100%; height: 110px; object-fit: cover; display: block; cursor: zoom-in; }
.media-item .rm { position: absolute; top: 6px; left: 6px; background: rgba(224,49,49,.9); color: #fff; border: 0; border-radius: 99px; font-size: 12px; padding: 2px 8px; }
.media-tag { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 2px 7px; border-radius: 99px; }
.task-btns { display: flex; gap: 8px; margin-top: 12px; }
.task-btns .btn { flex: 1; padding: 12px 4px; font-size: 14px; border: 2px solid transparent; }
.task-btns .btn.on { border-color: #2b2440; }
.btn-undone { background: #f1f3f5; color: #868e96; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 10px; }
.shop-card { background: #fff; border-radius: 18px; padding: 14px; text-align: center; box-shadow: 0 4px 14px rgba(43,36,64,.07); }
.shop-emoji { font-size: 38px; }
.shop-name { font-size: 14px; font-weight: 700; margin: 6px 0; min-height: 36px; }
.shop-cost { font-size: 13px; color: #f59f00; font-weight: 800; margin-bottom: 8px; }

.week { display: flex; gap: 8px; align-items: flex-end; height: 150px; background: #fff; border-radius: 18px; padding: 14px 12px; box-shadow: 0 4px 14px rgba(43,36,64,.07); }
.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; }
.week-bar { width: 62%; max-width: 34px; background: linear-gradient(180deg,#c9bfff,#a06bff); border-radius: 8px 8px 4px 4px; min-height: 4px; transition: height .5s; }
.week-col.today .week-bar { background: linear-gradient(180deg,#ffd43b,#ff922b); }
.week-pts { font-size: 11px; font-weight: 700; color: #7c5cff; min-height: 15px; }
.week-day { font-size: 11px; color: #8d86a8; }
.week-check { font-size: 10px; color: #2f9e44; min-height: 13px; }

.redeem-list { background:#fff; border-radius: 18px; padding: 4px 14px; box-shadow: 0 4px 14px rgba(43,36,64,.07); }
.redeem-row { display:flex; align-items:center; gap:10px; padding: 10px 0; border-bottom: 1px solid #f1edfa; font-size: 14px; }
.redeem-row:last-child { border-bottom: 0; }
.r-status { margin-left:auto; font-size: 12px; border-radius: 99px; padding: 3px 9px; white-space: nowrap; }
.r-pending { background:#fff3e0; color:#e8590c; }
.r-approved { background:#e6fcf5; color:#0b7285; }
.r-rejected { background:#f1f3f5; color:#868e96; }

.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px); background: rgba(43,36,64,.92); color: #fff; padding: 12px 20px; border-radius: 99px; font-size: 15px; opacity: 0; transition: all .3s; z-index: 90; max-width: 86vw; text-align: center; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.modal { position: fixed; inset: 0; background: rgba(30,20,60,.5); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 80; }
.modal-card { background: #fff; border-radius: 22px; padding: 24px; max-width: 340px; width: 100%; text-align: center; font-size: 16px; line-height: 1.6; }
.modal-btns { display: flex; gap: 10px; margin-top: 18px; }
.modal-btns .btn { flex: 1; }

.lightbox { position: fixed; inset: 0; background: rgba(15,10,30,.92); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 12px; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 100%; border-radius: 8px; }
.close-hint { position: absolute; top: 12px; right: 18px; color: #fff; font-size: 30px; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 95; overflow: hidden; }
.confetti span { position: absolute; top: -40px; font-size: 34px; animation: fall 2.8s linear forwards; }
@keyframes fall { to { transform: translateY(115vh) rotate(360deg); } }
.celeb { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 96; pointer-events: none; }
.celeb-card { background: #fff; border-radius: 24px; padding: 26px 34px; font-size: 22px; font-weight: 800; text-align: center; line-height: 1.8; box-shadow: 0 20px 60px rgba(0,0,0,.3); animation: pop .5s; }
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------- 家长控制台 ---------- */
.p-wrap { max-width: 860px; margin: 0 auto; padding: 14px 14px 50px; }
.p-head { display: flex; align-items: center; gap: 10px; }
.p-head h1 { font-size: 20px; margin: 0; flex: 1; }
.ptabs { display: flex; gap: 6px; margin: 14px 0; overflow-x: auto; padding-bottom: 4px; }
.ptab { border: 0; background: #fff; border-radius: 99px; padding: 9px 14px; font-size: 14px; font-weight: 700; color: #6b63a0; white-space: nowrap; box-shadow: 0 3px 10px rgba(43,36,64,.08); position: relative; }
.ptab.active { background: #7c5cff; color: #fff; }
.panel { background: #fff; border-radius: 20px; padding: 18px; box-shadow: 0 6px 18px rgba(43,36,64,.07); margin-bottom: 16px; }
.panel h2 { margin: 0 0 14px; font-size: 17px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #6b63a0; margin-bottom: 5px; font-weight: 700; }
.field .input, .field select, .field textarea { width: 100%; border: 2px solid #ece7fb; border-radius: 12px; padding: 10px 12px; outline: none; background: #fff; }
.field textarea { min-height: 96px; resize: vertical; }
.field-row { display: flex; gap: 10px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 130px; }
.form-btns { display: flex; gap: 10px; }
.hint { font-size: 13px; color: #8d86a8; line-height: 1.8; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #f1edfa; flex-wrap: wrap; }
.task-row:last-child { border-bottom: 0; }
.t-info { flex: 1; min-width: 0; }
.t-title { font-weight: 700; font-size: 15px; word-break: break-all; }
.t-sub { font-size: 12px; color: #8d86a8; margin-top: 2px; word-break: break-all; }
.t-status { font-size: 12px; border-radius: 99px; padding: 3px 9px; white-space: nowrap; }
.st-done { background:#e6fcf5; color:#0b7285; }
.st-school { background:#e7f5ff; color:#1971c2; }
.st-undone { background:#f1f3f5; color:#868e96; }
.inbox-card { border: 2px solid #f1edfa; border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.sug-list { background: #f8f6ff; border-radius: 12px; padding: 10px 12px; margin: 10px 0; font-size: 13px; }
.sug-item { padding: 4px 0; border-bottom: 1px dashed #e5defa; word-break: break-all; }
.sug-item:last-child { border-bottom: 0; }
.wd-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.wd-btn { width: 42px; height: 42px; border-radius: 12px; border: 2px solid #ece7fb; background: #fff; font-size: 13px; font-weight: 700; color: #6b63a0; }
.wd-btn.on { background: #7c5cff; border-color: #7c5cff; color: #fff; }
table.log { width: 100%; border-collapse: collapse; font-size: 13px; }
table.log td, table.log th { padding: 7px 6px; border-bottom: 1px solid #f1edfa; text-align: left; }
.pos { color: #2f9e44; font-weight: 700; }
.neg { color: #e03131; font-weight: 700; }
.footer { text-align: center; margin-top: 26px; color: #8d86a8; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 10px; }

/* 怪兽分级徽章：小怪 / 大怪 / 特大怪 */
.tier-chip { display: inline-block; border-radius: 99px; padding: 2px 9px; font-size: 12px; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.tier-small { background: #eef2ff; color: #5f6cff; }
.tier-big { background: #fff3e0; color: #e8590c; }
.tier-boss { background: #ffe0eb; color: #d6336c; }
.tier-boss { animation: boss-glow 1.6s ease-in-out infinite; }
@keyframes boss-glow { 0%,100% { box-shadow: 0 0 0 rgba(214,51,108,.0); } 50% { box-shadow: 0 0 10px rgba(214,51,108,.45); } }

/* ---------- 备案页脚 ---------- */
.beian-footer { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; align-items: center; gap: 16px; flex-wrap: wrap; padding: 6px 12px; background: rgba(43,36,64,.78); backdrop-filter: blur(6px); font-size: 11px; z-index: 80; }
.beian-footer a { color: #cfc9e8; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.beian-footer a:hover { color: #fff; }
.beian-footer img { height: 13px; width: auto; opacity: .9; }
.board { padding-bottom: 56px; }
