/* style.css — 苹果简约 × 可爱 */
:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --text: #3a3a3c;
  --sub: #8e8e93;
  --peach: #ffb4a2;
  --mint: #b8e0d2;
  --sky: #a8d8ea;
  --yellow: #ffe5a5;
  --shadow: 0 8px 24px rgba(60, 60, 60, 0.08);
  --radius: 20px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #fff7f0 0%, #f2f7ff 100%);
  color: var(--text);
  min-height: 100vh;
}
.hidden { display: none !important; }

/* 登录页 */
.center-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.login-card { width: 340px; text-align: center; padding: 36px 28px; }
.logo { font-size: 56px; animation: bounce 2s infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.login-card h1 { font-size: 24px; margin: 8px 0 4px; }
.sub { color: var(--sub); font-size: 13px; margin-bottom: 20px; }
input, textarea {
  width: 100%; padding: 12px 16px; border: 1.5px solid #eee; border-radius: 14px;
  font-size: 15px; margin: 6px 0; outline: none; background: #fbfbfb; font-family: inherit;
}
input:focus, textarea:focus { border-color: var(--peach); background: #fff; }

/* 通用 */
header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 14px 20px; background: rgba(255,255,255,0.8); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
}
.title { font-size: 20px; font-weight: 600; }
nav { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-btn {
  border: none; background: transparent; padding: 8px 14px; border-radius: 999px;
  cursor: pointer; font-size: 14px; color: var(--sub); font-family: inherit;
}
.nav-btn.active { background: var(--peach); color: #fff; }
.nav-btn:hover { background: #ffe0d8; color: var(--text); }
.user-box { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); }

main { padding: 20px; max-width: 1100px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin-bottom: 18px; animation: fadein .35s ease;
}
@keyframes fadein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card h2 { font-size: 17px; margin-bottom: 12px; }
.center-card { text-align: center; }

/* 按钮 */
.btn-primary {
  background: linear-gradient(135deg, var(--peach), #ff9d8a); color: #fff; border: none;
  padding: 12px 26px; border-radius: 999px; font-size: 15px; cursor: pointer;
  box-shadow: 0 6px 14px rgba(255, 150, 130, 0.35); transition: transform .15s; font-family: inherit;
}
.btn-primary:hover { transform: scale(1.04); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary.big { font-size: 18px; padding: 14px 40px; margin-top: 16px; }
.btn-ghost {
  background: #f4f4f5; color: var(--text); border: none; padding: 10px 18px;
  border-radius: 999px; cursor: pointer; font-size: 13px; transition: background .15s; font-family: inherit;
}
.btn-ghost:hover { background: #e9e9ec; }
.btn-mini {
  background: var(--sky); color: #fff; border: none; padding: 5px 12px;
  border-radius: 999px; cursor: pointer; font-size: 12px; margin: 2px;
}
.btn-mini.warn { background: #ff8b8b; }
.error { color: #e05252; font-size: 13px; margin-top: 10px; min-height: 18px; }

/* 萌宠卡片 */
.pet-card { text-align: center; }
.pet-stage { position: relative; padding: 10px; }
#pet-svg { width: 200px; height: 200px; margin: 0 auto; }
#pet-canvas { width: 260px; height: 260px; margin: 0 auto; display: block; cursor: grab; }
@keyframes floatUp { to { transform: translateY(-70px); opacity: 0; } }
.pet-bubble {
  position: absolute; top: 0; right: 6%; background: var(--yellow); padding: 8px 12px;
  border-radius: 14px; font-size: 12px; max-width: 150px; box-shadow: var(--shadow);
}
.pet-name { font-size: 18px; font-weight: 600; }
.pet-level { color: var(--peach); font-size: 13px; margin-bottom: 8px; }
.progress { height: 10px; background: #f1f1f2; border-radius: 999px; overflow: hidden; }
.bar { height: 100%; background: linear-gradient(90deg, var(--mint), var(--sky)); width: 0; transition: width .5s; }
.pet-stats { display: flex; justify-content: space-around; margin: 12px 0; font-size: 13px; color: var(--sub); }
.pet-stats b { color: var(--text); }
.pet-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.dress-panel { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.dress-item {
  padding: 8px 12px; border-radius: 12px; background: #f7f7f8; cursor: pointer; font-size: 13px;
}
.dress-item.on { background: var(--peach); color: #fff; }

/* 任务 */
.task-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: 14px; background: #fafafa; margin: 8px 0;
}
.task-row.done { background: #eefaf4; }
.task-left { display: flex; align-items: center; gap: 10px; }
.task-icon { font-size: 22px; }
.task-name { font-size: 14px; }
.task-prog { font-size: 12px; color: var(--sub); }

/* 天气 */
#weather .temp { font-size: 34px; font-weight: 600; }
#weather .advice {
  background: linear-gradient(135deg, var(--sky), #c8e6f5); border-radius: 14px;
  padding: 12px 14px; margin-top: 10px; font-size: 13px;
}

/* 留言 */
.msg-input { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.msg-input input { flex: 1; min-width: 180px; margin: 0; }
.msg-item {
  background: #fafafa; border-radius: 14px; padding: 12px 14px; margin: 8px 0;
  display: flex; justify-content: space-between; gap: 8px;
}
.msg-item .meta { font-size: 12px; color: var(--sub); margin-bottom: 4px; }
.msg-item .del { color: #e05252; cursor: pointer; font-size: 12px; align-self: flex-start; }

/* 转盘 */
.wheel-box { position: relative; width: 260px; height: 260px; margin: 20px auto; }
.wheel {
  width: 100%; height: 100%; border-radius: 50%; border: 8px solid #fff;
  box-shadow: var(--shadow), 0 0 0 6px var(--peach);
  background: conic-gradient(var(--peach) 0 25%, var(--yellow) 25% 50%, var(--mint) 50% 75%, var(--sky) 75% 100%);
  transition: transform 3s cubic-bezier(.2,.8,.2,1); position: relative;
}
.wheel-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  background: #fff; border-radius: 50%; width: 86px; height: 86px;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.pointer {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 26px; color: var(--peach); text-shadow: 0 2px 4px rgba(0,0,0,.15);
}

/* 成长日记 */
.history { max-height: 320px; overflow-y: auto; }
.hist-item { padding: 8px 0; border-bottom: 1px solid #f2f2f4; font-size: 13px; display: flex; justify-content: space-between; }
.hist-item .when { color: var(--sub); font-size: 11px; white-space: nowrap; margin-left: 10px; }

/* 管理后台 */
.admin-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; background: #fafafa; border-radius: 12px; margin: 6px 0; font-size: 13px;
}
textarea { resize: vertical; }

@media (max-width: 520px) {
  header { padding: 12px; }
  .title { font-size: 17px; }
  nav { order: 3; width: 100%; justify-content: center; }
  .pet-bubble { position: static; margin: 8px auto 0; display: inline-block; }
}
