/* ============================================================
   作业打卡管理系统 · 薄荷绿主题（对应 UI 设计稿 #2C7A7B / #5BCFC5）
   ============================================================ */
:root {
  --teal: #2C7A7B; --teal-dark: #1F6B67; --mint: #5BCFC5;
  --mint-bg: #EAF7F6; --bg: #F5F9F9; --card: #ffffff;
  --ink: #0F1F2E; --sub: #5C7480; --mute: #8FA3AD; --line: #E3EDEB;
  --gold: #B7791F; --gold-bg: #FDF3D8; --red: #EB5757; --red-bg: #FDECEC;
  --shadow: 0 6px 18px rgba(15, 42, 40, .07);
  --radius: 18px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px;
  display: flex; min-height: 100vh;
}
a { text-decoration: none; color: inherit; }

/* ---------- 侧栏 ---------- */
.side {
  width: 232px; flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--line); padding: 22px 16px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.side-logo { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.logo-ico {
  width: 42px; height: 42px; border-radius: 14px; font-size: 22px;
  background: linear-gradient(135deg, var(--mint), var(--teal-dark));
  display: flex; align-items: center; justify-content: center;
}
.side-logo b { display: block; font-size: 16px; }
.side-logo i { display: block; font-style: normal; font-size: 11px; color: var(--mute); }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-radius: 12px; color: var(--sub); font-weight: 500; font-size: 14.5px;
}
.nav-item:hover { background: #F4F9F8; }
.nav-item.on { background: var(--mint-bg); color: var(--teal); font-weight: 600; }
.nav-ico { font-size: 17px; width: 22px; text-align: center; }
.nav-badge {
  margin-left: auto; font-style: normal; background: var(--red); color: #fff;
  font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.side-foot { border-top: 1px solid var(--line); padding-top: 14px; display: flex; align-items: center; gap: 8px; }
.side-user { display: flex; align-items: center; gap: 10px; flex: 1; }
.u-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--mint-bg);
  color: var(--teal); font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.side-user b { display: block; font-size: 13px; }
.side-user i { display: block; font-style: normal; font-size: 11px; color: var(--mute); }
.side-logout { font-size: 12px; color: var(--mute); padding: 6px 10px; border-radius: 8px; }
.side-logout:hover { background: var(--red-bg); color: var(--red); }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: var(--card); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 19px; font-weight: 600; }
.top-right { font-size: 12.5px; color: var(--mute); }
.content { padding: 24px 28px 40px; display: flex; flex-direction: column; gap: 20px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 22px; }
.p-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.muted { color: var(--mute); font-size: 12.5px; }
.teal { color: var(--teal); } .gold { color: var(--gold); } .red { color: var(--red); }

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stat-card { padding: 18px; display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 12px; }
.stat-ico { grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: 14px; background: var(--mint-bg); display: flex; align-items: center; justify-content: center; font-size: 21px; }
.stat-num { font-size: 24px; font-weight: 700; font-family: "DIN Alternate", "Segoe UI", sans-serif; }
.stat-unit { font-style: normal; font-size: 12px; color: var(--mute); margin-left: 3px; }
.stat-label { grid-column: 2; font-size: 12.5px; color: var(--sub); margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: 5fr 7fr; gap: 20px; align-items: start; }

/* ---------- 看板 hero + 柱状图 + 进度 ---------- */
.hero-card {
  background: linear-gradient(135deg, var(--mint) 0%, var(--teal-dark) 100%);
  border-radius: var(--radius); padding: 24px; color: #fff;
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px;
}
.hero-left { display: flex; flex-direction: column; gap: 6px; }
.hero-t { font-size: 13px; opacity: .9; }
.hero-big { font-size: 34px; font-weight: 700; }
.hero-big i { font-style: normal; font-size: 14px; font-weight: 400; opacity: .85; }
.hero-s { font-size: 12px; opacity: .8; }
.hero-ring-wrap { position: relative; width: 92px; height: 92px; flex-shrink: 0; }
.hero-ring {
  width: 92px; height: 92px; border-radius: 50%;
  -webkit-mask: radial-gradient(closest-side, transparent 66%, #000 67%);
  mask: radial-gradient(closest-side, transparent 66%, #000 67%);
}
.hero-ring-num {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
}

.bars { display: flex; align-items: flex-end; gap: 10px; height: 130px; padding: 0 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 5px; height: 100%; }
.bar { width: 22px; border-radius: 100px; background: #CBEBE7; min-height: 5px; }
.bar-on { background: linear-gradient(180deg, var(--mint), var(--teal)); }
.bar-v { font-style: normal; font-size: 11px; color: var(--teal); font-weight: 600; }
.bar-l { font-size: 11.5px; color: var(--mute); }

.prog-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.prog-name { width: 42px; font-weight: 600; font-size: 13px; }
.prog-track { flex: 1; height: 10px; border-radius: 100px; background: #EEF4F3; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 100px; }
.prog-v { width: 48px; text-align: right; color: var(--sub); font-size: 12.5px; }

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--mute); font-weight: 500; padding: 10px 10px; background: #F5F9F9; border-radius: 8px; }
.tbl th:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
.tbl th:last-child { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
.tbl td { padding: 13px 10px; border-bottom: 1px solid #F0F5F4; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl-sub { display: block; font-size: 12px; color: var(--mute); margin-top: 3px; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ops { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline { display: inline-flex; gap: 4px; align-items: center; }

/* ---------- chips / 按钮 / 表单 ---------- */
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 500; }
.chip-green { background: var(--mint-bg); color: var(--teal); }
.chip-gold { background: var(--gold-bg); color: var(--gold); }
.chip-red { background: var(--red-bg); color: var(--red); }
.chip-gray { background: #F1F5F4; color: var(--mute); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; font-size: 13.5px; font-weight: 500;
  padding: 9px 18px; border-radius: 10px; transition: .15s;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-ghost { background: #F1F7F6; color: var(--teal); }
.btn-ghost:hover { background: var(--mint-bg); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:hover { background: #FBDDDD; }
.btn-danger[disabled] { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.filter { display: flex; gap: 8px; align-items: center; }
.f-select, .f-input {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  font-size: 13.5px; color: var(--ink); background: #fff; outline: none;
}
.f-input:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(91, 207, 197, .18); }
.f-mini { width: 76px; padding: 5px 8px; font-size: 12.5px; }
.f-label { display: block; font-size: 12.5px; color: var(--sub); margin: 0 0 6px 2px; }
.form-panel { margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; align-items: end; }
.f-item .f-input { width: 100%; }
.f-full { grid-column: 1 / -1; }
.f-btns { display: flex; gap: 10px; margin-top: 4px; }
.f-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--sub); padding-bottom: 6px; }

/* ---------- 开关 ---------- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 2px; border-bottom: 1px solid #F0F5F4; cursor: pointer; }
.switch-row:last-of-type { border-bottom: none; }
.switch-row b { display: block; font-size: 13.5px; }
.switch-row i { display: block; font-style: normal; font-size: 12px; color: var(--mute); margin-top: 2px; }
.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { display: none; }
.sl { position: absolute; inset: 0; border-radius: 11px; background: #DCE7E5; transition: .2s; }
.sl::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .sl { background: var(--teal); }
.switch input:checked + .sl::after { left: 20px; }

/* ---------- 审核 ---------- */
.seg-row { display: flex; gap: 8px; }
.seg-btn { padding: 9px 20px; border-radius: 100px; background: #fff; box-shadow: var(--shadow); font-size: 13.5px; color: var(--sub); font-weight: 500; }
.seg-btn.on { background: var(--teal); color: #fff; }
.review-card { padding: 18px 22px; }
.rc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rc-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--mint-bg); color: var(--teal);
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rc-info { display: flex; flex-direction: column; gap: 2px; margin-right: 6px; }
.rc-task { font-weight: 600; margin-right: auto; }
.rc-body { margin-top: 14px; padding-left: 52px; }
.rc-meta { font-size: 12.5px; color: var(--sub); }
.rc-text { margin: 8px 0; font-size: 13.5px; line-height: 1.7; color: var(--ink); }
.rc-photos { display: flex; gap: 10px; margin: 10px 0; }
.rc-photos img { width: 108px; height: 108px; object-fit: cover; border-radius: 12px; }
.rc-audio { margin: 8px 0; width: 320px; }
.rc-note { font-size: 12.5px; color: var(--gold); background: var(--gold-bg); border-radius: 8px; padding: 6px 10px; display: inline-block; }
.rc-ops { display: flex; gap: 10px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.rc-note-input { flex: 1; }

/* ---------- 商城 ---------- */
.reward-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.reward-admin-card { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.is-soldout { opacity: .75; }
.ra-img { position: relative; height: 120px; border-radius: 14px; background: var(--mint-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ra-img img { width: 100%; height: 100%; object-fit: cover; }
.ra-img span { font-size: 52px; }
.ra-sold { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(15,42,40,.6); color: #fff; font-size: 12px; text-align: center; padding: 3px 0; font-style: normal; }
.ra-name { font-size: 15px; }
.ra-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.ra-ops { display: flex; gap: 6px; margin-top: 4px; }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }
.col-l { display: flex; flex-direction: column; gap: 20px; }
.col-r { display: flex; flex-direction: column; gap: 20px; }
.info-list div { display: flex; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid #F0F5F4; font-size: 13px; }
.info-list div:last-child { border-bottom: none; }
.info-list span { color: var(--sub); }
.ver-card { text-align: center; padding: 28px 22px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ver-ico { width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(135deg, var(--mint), var(--teal-dark)); display: flex; align-items: center; justify-content: center; font-size: 28px; }

/* ---------- 登录页 ---------- */
.login-body { background: linear-gradient(160deg, #EAF7F6 0%, #F5F9F9 45%, #DFF2EF 100%); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 400px; background: #fff; border-radius: 24px; box-shadow: 0 20px 60px rgba(31,107,103,.16); padding: 42px 40px; text-align: center; }
.login-logo { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: linear-gradient(135deg, var(--mint), var(--teal-dark)); display: flex; align-items: center; justify-content: center; font-size: 32px; }
.login-card h1 { font-size: 20px; margin-bottom: 6px; }
.login-sub { color: var(--mute); font-size: 13px; margin-bottom: 22px; }
.login-card form { text-align: left; display: flex; flex-direction: column; }
.login-card .f-label { margin-top: 12px; }
.login-card .btn-block { margin-top: 22px; height: 44px; font-size: 15px; }

/* ---------- flash ---------- */
.flash { padding: 11px 16px; border-radius: 12px; font-size: 13.5px; margin-bottom: 4px; }
.flash-success { background: var(--mint-bg); color: var(--teal); border: 1px solid #CBEAE6; }
.flash-error { background: var(--red-bg); color: var(--red); border: 1px solid #F8D3D3; }

/* ---------- 小程序管理 ---------- */
.mp-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.tag-line { font-size: 12px; color: var(--mute); font-weight: 400; }
.p-sub { font-size: 12.5px; color: var(--mute); line-height: 1.7; margin: 8px 0 0; }
.ci-log { margin-top: 14px; background: #0F1F2E; color: #C8F3EE; font-family: Consolas, Monaco, monospace;
          font-size: 12px; line-height: 1.7; padding: 14px 16px; border-radius: 12px; white-space: pre-wrap;
          word-break: break-all; max-height: 320px; overflow: auto; }
.tips-list { display: flex; flex-direction: column; gap: 10px; font-size: 12.5px; color: var(--sub); line-height: 1.6; }
.tips-list > div { background: var(--mint-bg); border-radius: 10px; padding: 9px 12px; }

@media (max-width: 1200px) {
  .stat-grid, .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .settings-grid, .mp-grid { grid-template-columns: 1fr; }
  .reward-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .side { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}
