/* ====================================================
   伴学台 · 用户中心 (web)  ·  复用后台设计令牌
   ==================================================== */
:root {
  --bs-primary: #1B7A3E;
  --bs-primary-dark: #15632F;
  --bs-primary-light: #E8F5EE;
  --bs-accent: #FF8C42;
  --bs-danger: #F5483B;
  --bs-warning: #FFB020;
  --bs-info: #3B82F6;
  --bs-bg: #F7F8FA;
  --bs-card: #FFFFFF;
  --bs-text: #1A1A1A;
  --bs-text-2: #8A8F99;
  --bs-text-3: #B7BCC6;
  --bs-line: #EEF0F3;
  --bs-input-bg: #F7F8FA;
  --bs-r-sm: 6px;
  --bs-r-md: 12px;
  --bs-r-lg: 16px;
  --bs-r-full: 9999px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  font-size: 14px;
  color: var(--bs-text);
  background: var(--bs-bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--bs-primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ====================== 登录页 ====================== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  background: var(--bs-bg);
}
.login-brand-panel {
  width: 42%;
  min-height: 100vh;
  background: linear-gradient(135deg, #1B7A3E 0%, #186E37 50%, #0F4D25 100%);
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.login-brand-deco { position: absolute; inset: 0; pointer-events: none; }
.login-deco { position: absolute; border-radius: var(--bs-r-full); }
.login-deco--circle1 { width: 380px; height: 380px; border: 1px solid rgba(255,255,255,0.06); top: -120px; left: -120px; }
.login-deco--circle2 { width: 420px; height: 420px; border: 1px solid rgba(255,255,255,0.06); bottom: -160px; right: -100px; }
.login-deco--sq1 { width: 60px; height: 60px; background: rgba(255,255,255,0.04); top: 15%; right: 15%; transform: rotate(12deg); border-radius: 12px; }
.login-deco--sq2 { width: 48px; height: 48px; background: rgba(255,255,255,0.05); top: 55%; left: 10%; transform: rotate(-6deg); border-radius: 8px; }
.login-deco--sq3 { width: 40px; height: 40px; background: rgba(255,255,255,0.04); bottom: 20%; right: 25%; }

.login-brand-inner { position: relative; z-index: 1; text-align: center; color: #fff; }
.login-brand-logo { width: 96px; height: 96px; margin: 0 auto 16px; background: rgba(255,255,255,0.12); border-radius: 24px; padding: 16px; backdrop-filter: blur(8px); }
.login-brand-name { font-size: 36px; font-weight: 700; letter-spacing: 4px; margin-bottom: 8px; }
.login-brand-slogan { font-size: 15px; color: rgba(255,255,255,0.8); letter-spacing: 3px; font-weight: 300; }
.login-brand-divider { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 24px 0 16px; }
.login-brand-divider span { width: 32px; height: 1px; background: rgba(255,255,255,0.2); }
.login-brand-divider i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,140,66,0.7); }
.login-brand-subslogan { font-size: 14px; color: rgba(255,255,255,0.5); }

.login-card-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 460px; }
.login-card-title { font-size: 28px; font-weight: 600; color: var(--bs-text); margin-bottom: 8px; }
.login-card-sub { font-size: 15px; color: var(--bs-text-2); margin-bottom: 32px; }

.login-qr-area { text-align: center; }
.login-qr-box {
  width: 240px; height: 240px;
  margin: 0 auto 16px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--bs-line);
  border-radius: var(--bs-r-lg);
  display: flex; align-items: center; justify-content: center;
}
.login-qr-box img, .login-qr-box canvas { width: 100% !important; height: 100% !important; }
.login-qr-tip { font-size: 14px; color: var(--bs-text); margin-bottom: 16px; }
.login-qr-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0 8px;
  color: var(--bs-text-3); font-size: 13px;
}
.login-qr-divider::before, .login-qr-divider::after { content: ''; flex: 1; height: 1px; background: var(--bs-line); }
.login-qr-hint { font-size: 13px; color: var(--bs-text-2); line-height: 1.6; }

.login-tips { margin-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.login-tip { display: flex; align-items: flex-start; gap: 12px; }
.login-tip__ico {
  width: 36px; height: 36px;
  border-radius: var(--bs-r-md);
  background: var(--bs-primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.login-tip__name { font-size: 14px; font-weight: 500; color: var(--bs-text); margin-bottom: 2px; }
.login-tip__desc { font-size: 12px; color: var(--bs-text-2); }

.login-refresh {
  width: 100%; margin-top: 24px;
  padding: 12px;
  background: transparent;
  border: 1px dashed var(--bs-line);
  border-radius: var(--bs-r-md);
  color: var(--bs-text-2);
  font-size: 13px;
  transition: all .2s;
}
.login-refresh:hover { color: var(--bs-primary); border-color: var(--bs-primary); }

@media (max-width: 900px) {
  .login-brand-panel { display: none; }
  .login-wrap { background: linear-gradient(135deg, #1B7A3E 0%, #186E37 100%); }
  .login-card { background: #fff; padding: 32px 24px; border-radius: var(--bs-r-lg); }
}

/* ====================== 主应用 ====================== */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: var(--bs-card);
  border-right: 1px solid var(--bs-line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sb-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--bs-line);
  display: flex; align-items: center; gap: 12px;
}
.sb-logo {
  width: 36px; height: 36px;
  border-radius: var(--bs-r-md);
  background: var(--bs-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.sb-brand__name { font-size: 16px; font-weight: 600; color: var(--bs-text); }
.sb-brand__sub { font-size: 12px; color: var(--bs-text-2); }

.sb-user {
  padding: 16px 20px;
  border-bottom: 1px solid var(--bs-line);
  display: flex; align-items: center; gap: 12px;
}
.sb-avatar {
  width: 40px; height: 40px;
  border-radius: var(--bs-r-full);
  background: var(--bs-primary-light);
  color: var(--bs-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}
.sb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sb-user__main { flex: 1; min-width: 0; }
.sb-user__name { font-size: 14px; font-weight: 500; color: var(--bs-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user__role { font-size: 12px; color: var(--bs-text-2); }

.sb-nav { flex: 1; padding: 12px 8px; overflow-y: auto; }
.nav-link {
  display: block;
  padding: 10px 16px;
  border-radius: var(--bs-r-md);
  color: var(--bs-text-2);
  font-size: 14px;
  margin-bottom: 2px;
  transition: all .15s;
  cursor: pointer;
}
.nav-link:hover { background: var(--bs-bg); color: var(--bs-text); }
.nav-link.active { background: var(--bs-primary-light); color: var(--bs-primary); font-weight: 500; }
.nav-link--logout { color: var(--bs-danger); margin-top: 12px; }
.nav-link--logout:hover { background: rgba(245, 72, 59, 0.08); }
.sb-foot { padding: 12px 8px 16px; border-top: 1px solid var(--bs-line); }

.main {
  flex: 1;
  padding: 32px 40px;
  max-width: 100%;
  overflow-x: hidden;
}
.page-loading { padding: 80px 0; text-align: center; color: var(--bs-text-2); }

.page-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.page-hd h1 { font-size: 22px; font-weight: 600; color: var(--bs-text); }
.page-hd p { font-size: 13px; color: var(--bs-text-2); margin-top: 4px; }

/* v23 修复：相邻 .card 之间原本无间距（"孩子进度"与"统计报表·本周"贴在一起）。
   统一加 16px 下边距；grid 内已用 gap 隔开，子卡片清零避免双重间距。 */
.card { background: var(--bs-card); border-radius: var(--bs-r-lg); padding: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 > .card, .grid-3 > .card, .grid-4 > .card { margin-bottom: 0; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.stat { padding: 20px; }
.stat__num { font-size: 30px; font-weight: 700; color: var(--bs-primary); line-height: 1.2; }
.stat__num--orange { color: var(--bs-accent); }
.stat__num--blue { color: var(--bs-info); }
.stat__num--gray { color: var(--bs-text-2); }
.stat__label { font-size: 13px; color: var(--bs-text-2); margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  background: var(--bs-primary); color: #fff;
  border: none; border-radius: var(--bs-r-md);
  cursor: pointer; transition: all .15s;
}
.btn:hover { background: var(--bs-primary-dark); }
.btn.gray { background: var(--bs-card); color: var(--bs-text); border: 1px solid var(--bs-line); }
.btn.gray:hover { background: var(--bs-bg); }
/* v22 补齐：.ghost 在 app.js 中被引用 30+ 处但从未定义（tools/check-css-refs.js 发现），
   部署后这些「取消 / 查看全部 / 兑换记录」等次要按钮会退化成无边框裸文字块 */
.btn.ghost {
  background: transparent; color: var(--bs-primary);
  border: 1px solid var(--bs-primary);
}
.btn.ghost:hover { background: var(--bs-primary-light, #E8F5EE); }
.btn.danger { background: var(--bs-danger); }
.btn.sm { padding: 5px 12px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.tag.g { background: var(--bs-primary-light); color: var(--bs-primary); }
.tag.o { background: rgba(255,140,66,0.12); color: var(--bs-accent); }
.tag.s { background: #F0F1F4; color: var(--bs-text-2); }
.tag.b { background: rgba(59,130,246,0.12); color: var(--bs-info); }

.empty { padding: 60px 20px; text-align: center; color: var(--bs-text-2); }
.empty__icon { font-size: 48px; margin-bottom: 12px; }
.empty__title { font-size: 14px; font-weight: 500; color: var(--bs-text); margin-bottom: 4px; }
.empty__desc { font-size: 12px; }

.list { display: flex; flex-direction: column; }
.list-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--bs-line);
  display: flex; align-items: center; gap: 12px;
}
.list-item:last-child { border-bottom: none; }
.list-item__main { flex: 1; min-width: 0; }
.list-item__title { font-size: 14px; font-weight: 500; color: var(--bs-text); }
.list-item__sub { font-size: 12px; color: var(--bs-text-2); margin-top: 2px; }
.list-item__action { flex-shrink: 0; }

.input, .textarea, select {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--bs-line); border-radius: var(--bs-r-md);
  font-size: 14px; color: var(--bs-text); background: var(--bs-input-bg);
  outline: none; transition: all .15s;
  font-family: inherit;
}
.input:focus, .textarea:focus, select:focus { border-color: var(--bs-primary); background: #fff; box-shadow: 0 0 0 3px rgba(27,122,62,0.1); }
.textarea { min-height: 100px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--bs-text-2); margin-bottom: 6px; }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #DDE0E6; border-radius: 22px; transition: .2s;
}
.switch .slider::before {
  position: absolute; content: ''; height: 18px; width: 18px;
  left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--bs-primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: rgba(0,0,0,0.85); color: #fff;
  padding: 10px 20px; border-radius: var(--bs-r-md);
  font-size: 14px; z-index: 9999;
  opacity: 0; transition: all .25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--bs-danger); }
.toast.success { background: var(--bs-primary); }

.kv { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--bs-line); }
.kv:last-child { border-bottom: none; }
.kv__k { font-size: 14px; color: var(--bs-text); }
.kv__v { font-size: 13px; color: var(--bs-text-2); }

/* 文章列表 */
.art-item { padding: 16px; border-bottom: 1px solid var(--bs-line); cursor: pointer; }
.art-item:hover { background: var(--bs-bg); }
.art-item__title { font-size: 15px; font-weight: 500; }
.art-item__summary { font-size: 13px; color: var(--bs-text-2); margin-top: 4px; }
.art-item__meta { display: flex; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--bs-text-3); }

/* 反馈 */
.fb-form { display: flex; flex-direction: column; gap: 16px; }
.fb-types { display: flex; gap: 8px; }
.fb-type { flex: 1; padding: 10px; text-align: center; border: 1px solid var(--bs-line); border-radius: var(--bs-r-md); cursor: pointer; font-size: 13px; }
.fb-type.active { border-color: var(--bs-primary); background: var(--bs-primary-light); color: var(--bs-primary); }

/* ===== 顶部用户信息栏（右侧顶部） ===== */
.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: var(--bs-card);
  border-bottom: 1px solid var(--bs-line);
  position: sticky; top: 0; z-index: 10;
}
.topbar__brand { font-size: 14px; font-weight: 600; color: var(--bs-text-2); }
.topbar__user { display: flex; align-items: center; gap: 10px; }
.topbar__user-main { text-align: right; }
.topbar__user-name { font-size: 14px; font-weight: 600; color: var(--bs-text); line-height: 1.2; }
.topbar__user-role { font-size: 12px; color: var(--bs-text-3); }
.sb-avatar--sm { width: 36px; height: 36px; font-size: 16px; }

/* ===== 通用弹层 ===== */
.modal-mask {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.45); z-index: 100;
}
.modal-mask.show { display: block; }
.modal-box {
  display: none; position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 32px));
  max-height: 82vh; overflow: hidden;
  background: var(--bs-card); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18); z-index: 101;
  flex-direction: column;
}
.modal-box.show { display: flex; }
.modal-hd {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--bs-line);
  flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 600; }
.modal-close { cursor: pointer; color: var(--bs-text-3); font-size: 16px; padding: 4px 8px; }
.modal-close:hover { color: var(--bs-text); }
.modal-bd { padding: 20px; overflow-y: auto; }
.modal-ft { padding: 12px 20px; border-top: 1px solid var(--bs-line); display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0; }

/* 弹层内表单元素 */
.modal-bd .field { margin-bottom: 14px; }
.modal-bd .field label { display: block; font-size: 13px; color: var(--bs-text-2); margin-bottom: 6px; }
.modal-bd .field textarea { width: 100%; box-sizing: border-box; }

/* 详情行 */
.dl { display: flex; flex-direction: column; gap: 2px; }
.dl-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--bs-line); font-size: 13px; }
.dl-row:last-child { border-bottom: none; }
.dl-row dt { width: 88px; color: var(--bs-text-3); flex-shrink: 0; }
.dl-row dd { flex: 1; color: var(--bs-text); margin: 0; word-break: break-all; }

/* 筛选 tab */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  padding: 6px 16px; border-radius: 20px; cursor: pointer;
  font-size: 13px; color: var(--bs-text-2);
  background: var(--bs-card); border: 1px solid var(--bs-line);
}
.tab.active { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }

/* 里程碑/步骤清单 */
.ms-list { display: flex; flex-direction: column; gap: 8px; }
.ms-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--bs-line); border-radius: 8px; }
.ms-item.done { background: var(--bs-primary-light); border-color: var(--bs-primary); }
.ms-item__mark { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--bs-line); display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.ms-item.done .ms-item__mark { border-color: var(--bs-primary); background: var(--bs-primary); color: #fff; }
.ms-item__txt { flex: 1; font-size: 13px; }
.ms-item__date { font-size: 12px; color: var(--bs-text-3); }

/* 打卡图片预览 */
.record-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.record-imgs img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; cursor: pointer; }

/* 详情内容块 */
.md-block { white-space: pre-wrap; font-size: 13px; line-height: 1.8; color: var(--bs-text); }

/* ===== 概览顶部：左轮播 + 右单卡片三TAB（问题 14） ===== */
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-carousel { position: relative; min-height: 240px; }
.hero-track { display: flex; transition: transform .45s ease; height: 100%; }
.hero-slide { flex: 0 0 100%; height: 280px; display: block; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-slide--empty { height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; font-size: 40px; background: var(--bs-primary-light); }
.hero-slide--empty div { font-size: 14px; color: var(--bs-text-2); }
.hero-dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 8px; z-index: 2; }
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; transition: all .3s; }
.hero-dot.active { background: #fff; width: 20px; border-radius: 4px; }
.hero-side { display: flex; flex-direction: column; padding: 16px; }
.hero-tabs { display: flex; gap: 4px; background: var(--bs-bg, #f5f6f8); border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.hero-tab { flex: 1; text-align: center; padding: 7px 0; font-size: 13px; color: var(--bs-text-2); border-radius: 8px; cursor: pointer; transition: all .25s; }
.hero-tab.active { background: var(--bs-card, #fff); color: var(--bs-primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.hero-side__num { font-size: 44px; font-weight: 700; color: var(--bs-primary); line-height: 1.1; }
.hero-side__unit { font-size: 14px; font-weight: 400; color: var(--bs-text-3); margin-left: 4px; }
.hero-side__label { font-size: 14px; font-weight: 600; margin-top: 6px; }
.hero-side__desc { flex: 1; font-size: 12px; color: var(--bs-text-3); margin-top: 8px; line-height: 1.7; word-break: break-all; }
.hero-side__btn { margin-top: 12px; align-self: flex-start; }

/* 概览右卡片：文章分类列表（web-1） */
.hero-arts { flex: 1; display: flex; flex-direction: column; gap: 4px; min-height: 120px; }
.hero-art { padding: 10px 10px; border-radius: 8px; cursor: pointer; transition: background .2s; }
.hero-art:hover { background: var(--bs-bg, #f5f6f8); }
.hero-art__title { font-size: 13px; font-weight: 500; color: var(--bs-text, #1a1a1a); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-art__meta { font-size: 11px; color: var(--bs-text-3); margin-top: 4px; }

/* 弹层内文件上传行（web-5/web-6） */
.file-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-row input[type="file"] { font-size: 12px; color: var(--bs-text-2); max-width: 240px; }
.file-preview { margin-top: 8px; }
.file-preview img { max-width: 100%; max-height: 180px; border-radius: 8px; border: 1px solid var(--bs-line); }

/* ===== 签到日历（问题 21-7：整体缩小 + 任务联动） ===== */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; color: var(--bs-text-3); padding-bottom: 6px; border-bottom: 1px solid var(--bs-line); margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-width: 420px; margin: 0 auto; }
.cal-cell { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--bs-text); border-radius: 8px; background: var(--bs-bg, #f5f6f8); }
.cal-cell--blank { background: none; }
.cal-cell--on { background: var(--bs-primary-light); color: var(--bs-primary); font-weight: 600; }
.cal-cell--today { border: 2px solid var(--bs-primary); }
.cal-cell__mark { position: absolute; top: 4px; right: 4px; font-size: 8px; color: var(--bs-primary); line-height: 1; }

/* 缩小版日历：固定高度替换 aspect-ratio，格子不再撑满整行 */
.cal-grid--sm { gap: 4px; max-width: 340px; }
.cal-grid--sm .cal-cell { aspect-ratio: auto; height: 46px; flex-direction: column; gap: 2px; border-radius: 6px; font-size: 12px; cursor: pointer; transition: background .15s; }
.cal-grid--sm .cal-cell:hover { background: var(--bs-primary-light); }
.cal-grid--sm .cal-cell--blank { height: 46px; }
.cal-grid--sm .cal-cell__d { line-height: 1.1; }
.cal-grid--sm .cal-cell__mark { position: absolute; top: 3px; right: 3px; font-size: 9px; font-weight: 700; }
.cal-cell__task { font-size: 10px; line-height: 1; padding: 1px 4px; border-radius: 4px; background: rgba(255,140,66,0.16); color: var(--bs-accent); }
.cal-cell__task.ok { background: rgba(27,122,62,0.14); color: var(--bs-primary); }
.cal-cell__dot { width: 5px; height: 5px; border-radius: 50%; background: var(--bs-info); display: inline-block; }
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--bs-line); font-size: 12px; color: var(--bs-text-2); }
.cal-legend span { display: flex; align-items: center; gap: 4px; }
.cal-legend .lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--bs-bg); }
.cal-legend .lg--on { background: var(--bs-primary-light); border: 1px solid var(--bs-primary); }
.cal-legend .lg--ok { background: rgba(27,122,62,0.14); }
.cal-legend .lg--todo { background: rgba(255,140,66,0.16); }

/* ===== 兑换商城（问题 21-4：1:1 卡片 + 详情） ===== */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.shop-card { position: relative; border: 1px solid var(--bs-line); border-radius: var(--bs-r-md); padding: 8px 8px 10px; cursor: pointer; transition: box-shadow .15s, transform .15s; background: var(--bs-card); }
.shop-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.08); transform: translateY(-2px); }
.shop-card--off { opacity: .55; }
.shop-card__img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; background: var(--bs-bg); display: block; }
.shop-card__img--empty { display: flex; align-items: center; justify-content: center; font-size: 34px; color: var(--bs-text-3); background: var(--bs-bg); }
.shop-card__badge { position: absolute; top: 14px; left: 14px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.shop-card__name { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--bs-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-card__price { margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--bs-primary); }
.shop-card__stock { margin-top: 2px; font-size: 11px; color: var(--bs-text-3); }
.shop-detail__img { width: 100%; max-width: 240px; margin: 0 auto 12px; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--bs-bg); }
.shop-detail__img img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }

/* ===== 积分排行榜（问题 21-5） ===== */
.rank-medal { width: 40px; flex: none; font-weight: 700; }

/* ===== 纯 CSS 柱状图（问题 21-6 统计报表 / 概览内嵌） ===== */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 190px; padding: 22px 2px 0; overflow-x: auto; }
.bar-col { flex: 1 1 0; min-width: 28px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.bar-col__v { font-size: 11px; color: var(--bs-text-2); margin-bottom: 4px; white-space: nowrap; }
.bar-col__bar { width: 100%; max-width: 28px; min-height: 2px; border-radius: 4px 4px 0 0; transition: height .25s; }
.bar-col__x { font-size: 10px; color: var(--bs-text-3); margin-top: 6px; white-space: nowrap; }

/* ===== 功能权限（问题 18） ===== */
.perm-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.perm-tab { padding: 6px 16px; border-radius: 20px; cursor: pointer; font-size: 13px; color: var(--bs-text-2); background: var(--bs-card); border: 1px solid var(--bs-line); }
.perm-tab.on { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.perm-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--bs-line); border-radius: 8px; font-size: 13px; color: var(--bs-text); cursor: pointer; }
.perm-item input { accent-color: var(--bs-primary); margin: 0; }
.perm-item--ro { cursor: default; color: var(--bs-text-2); }
