/* 吴家阅读打卡 - 公共样式（移动优先，温暖清新） */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #f6f3ec;
  --card: #ffffff;
  --ink: #3d3429;
  --sub: #8a7d6d;
  --orange: #f5a623;
  --green: #4caf7d;
  --blue: #4a90d9;
  --red: #e05d5d;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(61,52,41,.08);
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
}
.container { max-width: 520px; margin: 0 auto; padding: 16px 16px 40px; }

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.topbar h1 { font-size: 20px; }
.topbar .right { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--sub); }
.btn-link { background: none; border: none; color: var(--blue); font-size: 14px; cursor: pointer; padding: 4px; }

/* 卡片 */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 14px;
}
.card h2 { font-size: 17px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

/* 按钮 */
button { font-family: inherit; cursor: pointer; border: none; border-radius: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 20px; font-size: 16px; font-weight: 600;
  color: #fff; background: var(--blue); border-radius: 12px;
  transition: opacity .15s, transform .05s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-orange { background: var(--orange); }
.btn-green { background: var(--green); }
.btn-red { background: var(--red); }
.btn-ghost { background: #f0ece3; color: var(--ink); font-weight: 500; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 10px; }

/* 输入框 */
.input {
  width: 100%; padding: 13px 14px; font-size: 16px; border: 1.5px solid #ddd6c8;
  border-radius: 12px; outline: none; background: #fff; color: var(--ink);
}
.input:focus { border-color: var(--orange); }

/* 学生大按钮 */
.student-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.student-btn {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 700; color: var(--ink);
}
.student-btn .avatar { font-size: 40px; }
.student-btn small { font-size: 12px; color: var(--sub); font-weight: 400; }

/* 打卡卡片 */
.rec-card { position: relative; }
.rec-card .status-tag {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px;
}
.tag-none { background: #f0ece3; color: var(--sub); }
.tag-done { background: #e3f5ea; color: var(--green); }
.tag-part { background: #fff3d9; color: #c98a12; }
.tag-rec { background: #fde8e8; color: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.rec-timer { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; padding: 10px 0 4px; }
.rec-hint { text-align: center; color: var(--sub); font-size: 13px; margin-bottom: 12px; }
.rec-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.rec-actions .btn { flex: 1; min-width: 120px; }
.rec-audio { width: 100%; margin-top: 12px; }
.rec-saved-info { text-align: center; font-size: 13px; color: var(--sub); margin-top: 8px; }

/* 登录 */
.login-logo { text-align: center; padding: 34px 0 8px; }
.login-logo .big { font-size: 52px; }
.login-logo h1 { font-size: 24px; margin-top: 8px; }
.login-logo p { color: var(--sub); font-size: 14px; margin-top: 4px; }
.login-form { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.owner-link { text-align: center; margin-top: 16px; }
.owner-link button { background: none; border: none; color: var(--sub); font-size: 13px; text-decoration: underline; cursor: pointer; }
.hidden { display: none !important; }

/* 日历 */
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 8px; }
.calendar .dow { text-align: center; font-size: 11px; color: var(--sub); padding: 4px 0; }
.calendar .day {
  aspect-ratio: 1; border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
  background: #f3efe6; color: var(--sub);
}
.calendar .day.full { background: var(--green); color: #fff; }
.calendar .day.half { background: #ffe9c4; color: #b97d13; }
.calendar .day.today { outline: 2.5px solid var(--orange); }
.calendar .day .mini { font-size: 9px; font-weight: 400; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #efe9dd; }
th { font-size: 12px; color: var(--sub); font-weight: 600; }
tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #e3f5ea; color: var(--green); }
.badge.no { background: #f0ece3; color: var(--sub); }

/* 筛选条 */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filter-bar select, .filter-bar input { padding: 9px 10px; border: 1.5px solid #ddd6c8; border-radius: 10px; font-size: 14px; background: #fff; color: var(--ink); }
.filter-bar .grow { flex: 1; min-width: 130px; }

/* 统计条 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; text-align: center; }
.stat .num { font-size: 22px; font-weight: 800; }
.stat .lbl { font-size: 12px; color: var(--sub); }

/* 底部播放器 */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; background: #fff;
  box-shadow: 0 -2px 14px rgba(0,0,0,.1); padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  display: none; z-index: 50;
}
.player audio { width: 100%; }
.player .player-title { font-size: 12px; color: var(--sub); margin-bottom: 4px; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: rgba(40,34,26,.92); color: #fff; padding: 10px 20px; border-radius: 30px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 99; max-width: 86vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }