/* ============================================================
   员工上班卫生打卡系统 v3.1 · 暗色精修主题
   新增：日期行对齐 / 项目组徽章 / 最近五天汇总 / 删除密码弹窗
   ============================================================ */
:root {
  --bg: #0d0d17;
  --bg-card: #151529;
  --bg-field: #101021;
  --bg-deep: #0a0a13;
  --border: #262640;
  --border-hi: #3a3a5e;
  --text: #e4e4f2;
  --text-dim: #8d8dae;
  --text-bright: #ffffff;
  --green: #00e676;
  --yellow: #ffc107;
  --red: #ff5252;
  --teal: #00c6a7;
  --blue: #448aff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .38);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
  color-scheme: dark;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 18% 0%, rgba(0, 198, 167, .07) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 85% 100%, rgba(68, 138, 255, .07) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.app-container { max-width: 560px; margin: 0 auto; padding: 0 14px; position: relative; z-index: 1; }

/* ===== 头部 ===== */
.app-header { text-align: center; padding: 26px 0 14px; }
.logo {
  font-size: 23px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(135deg, #00e676 0%, #00c6a7 55%, #448aff 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.subtitle { font-size: 12px; color: var(--text-dim); margin-top: 2px; letter-spacing: .3px; }

/* ===== 卡片 ===== */
.card {
  background: linear-gradient(180deg, var(--bg-card) 0%, #131325 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  animation: slideup .4s ease both;
}
.card-title {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 14.5px; font-weight: 700; letter-spacing: .3px;
  color: var(--text-bright); margin-bottom: 12px;
}
.sub-note { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--text-dim); }
.tip { font-size: 12px; color: var(--text-dim); text-align: center; margin-top: 10px; }

/* ===== 日期行（对齐修复核心）===== */
.date-row { display: flex; align-items: stretch; gap: 10px; }
.input-date {
  flex: 1; min-width: 0;
  height: 46px;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-bright);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  padding: 0 12px;
  outline: none;
  transition: border-color .2s;
}
.input-date:focus { border-color: var(--teal); }
.weekday-badge {
  flex-shrink: 0; min-width: 80px;
  display: flex; align-items: center; justify-content: center;
  height: 46px; padding: 0 14px;
  background: linear-gradient(180deg, #1b1b33, #14142a);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.wd-text {
  font-size: 15px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(135deg, #00e676, #00c6a7);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ===== 选人 ===== */
.people-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.person-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  height: 42px;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .1s;
  animation: popin .35s ease both;
}
.person-btn:nth-child(1) { animation-delay: .02s; }
.person-btn:nth-child(2) { animation-delay: .05s; }
.person-btn:nth-child(3) { animation-delay: .08s; }
.person-btn:nth-child(4) { animation-delay: .11s; }
.person-btn:nth-child(5) { animation-delay: .14s; }
.person-btn:nth-child(6) { animation-delay: .17s; }
.person-btn:active { transform: scale(.96); }
.person-btn .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--pc, #888);
  box-shadow: 0 0 6px var(--pc, #888);
  flex-shrink: 0;
}
.person-btn.active {
  border-color: var(--pc, var(--teal));
  background: color-mix(in srgb, var(--pc, #00c6a7) 14%, var(--bg-field));
  color: var(--text-bright);
}

/* ===== 周六阿姨开关 ===== */
.sat-switch { display: flex; gap: 8px; }
.sat-btn {
  flex: 1; height: 42px;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 14px; font-weight: 600; font-family: inherit;
  cursor: pointer;
  transition: all .18s;
}
.sat-btn.active {
  border-color: var(--teal);
  color: var(--text-bright);
  background: rgba(0, 198, 167, .13);
  box-shadow: 0 0 0 1px rgba(0, 198, 167, .25) inset;
}

/* ===== 进度 ===== */
.done-badge {
  margin-left: auto;
  font-size: 12px; font-weight: 700;
  background: rgba(0, 230, 118, .12);
  color: var(--green);
  border: 1px solid rgba(0, 230, 118, .35);
  border-radius: 20px;
  padding: 1px 10px;
}
.progress-wrap {
  height: 7px; border-radius: 4px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #00c6a7, #00e676);
  border-radius: 4px;
  transition: width .45s cubic-bezier(.25, .8, .35, 1);
}

/* ===== 项目组卡片 ===== */
.group-list { display: flex; flex-direction: column; gap: 10px; }
.group-card {
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .2s;
}
.group-card.open { border-color: var(--border-hi); }
.group-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
  user-select: none;
}
.group-head:active { background: rgba(255, 255, 255, .03); }
.group-badge {
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  font-size: 17px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #5c6bc0, #3949ab);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .3);
}
.group-card[data-grp="A"] .group-badge { background: linear-gradient(135deg, #ff7043, #e53935); }
.group-card[data-grp="B"] .group-badge { background: linear-gradient(135deg, #42a5f5, #1e88e5); }
.group-card[data-grp="C"] .group-badge { background: linear-gradient(135deg, #ffb74d, #fb8c00); }
.group-mid { flex: 1; min-width: 0; }
.group-name { font-size: 14.5px; font-weight: 700; color: var(--text-bright); line-height: 1.3; }
.group-count { font-size: 12px; color: var(--text-dim); line-height: 1.3; }
.group-owners { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 46%; }
.owner-chip {
  font-size: 11px; font-weight: 700;
  color: var(--pc, #aaa);
  background: color-mix(in srgb, var(--pc, #aaa) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--pc, #aaa) 55%, transparent);
  border-radius: 20px;
  padding: 1px 8px;
  white-space: nowrap;
}
.owner-none { font-size: 11px; color: var(--text-dim); border: 1px dashed var(--border-hi); border-radius: 20px; padding: 1px 8px; white-space: nowrap; }
.group-arrow { color: var(--text-dim); font-size: 14px; flex-shrink: 0; transition: transform .2s; }
.group-card.open .group-arrow { transform: rotate(90deg); }
.group-body { border-top: 1px solid var(--border); padding: 8px; display: flex; flex-direction: column; gap: 7px; animation: fadein .25s ease; }

/* ===== 子任务 ===== */
.task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px;
  border-radius: 9px;
  border: 1px solid transparent;
}
.task-item.todo {
  background: var(--bg-deep);
  border-color: var(--border);
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.task-item.todo:active { border-color: var(--border-hi); background: #15152a; }
.task-item.done {
  border-left: 3px solid var(--pc, #888);
  background: color-mix(in srgb, var(--pc, #888) 9%, var(--bg-deep));
}
.task-info { flex: 1; min-width: 0; }
.task-name { font-size: 13.5px; line-height: 1.45; }
.task-item.todo .task-name { color: var(--text); }
.task-item.done .task-name { color: var(--text-bright); font-weight: 600; }
.task-by { font-size: 11.5px; color: var(--text-dim); margin-top: 1px; }
.task-item.done .task-by { color: var(--pc, var(--text-dim)); }
.check-circle {
  width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--border-hi);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: transparent;
  transition: all .18s;
}
.task-item.todo:active .check-circle { border-color: var(--teal); color: var(--teal); }
.undo-btn {
  width: 28px; height: 28px; flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px; cursor: pointer;
  transition: all .18s;
}
.undo-btn:hover { border-color: var(--red); color: var(--red); }
.claim-btn {
  height: 40px;
  background: rgba(0, 198, 167, .1);
  border: 1px solid rgba(0, 198, 167, .45);
  border-radius: 9px;
  color: var(--teal);
  font-size: 13.5px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  transition: all .18s;
}
.claim-btn:active { background: rgba(0, 198, 167, .2); }
.claim-btn.mine {
  background: transparent;
  border-color: var(--border-hi);
  color: var(--text-dim);
}

/* ===== 视频上传 ===== */
.video-upload-area { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 0; }
.upload-btn {
  display: inline-block;
  height: 44px; line-height: 44px; padding: 0 26px;
  background: linear-gradient(135deg, #448aff, #5c6bc0);
  border: none; border-radius: 22px;
  color: #fff; font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(68, 138, 255, .3);
  transition: transform .12s;
}
.upload-btn:active { transform: scale(.95); }
.upload-hint { font-size: 12px; color: var(--text-dim); text-align: center; }
.video-list { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }
.video-item {
  display: flex; align-items: center; gap: 8px;
  border-left: 3px solid var(--pc, #888);
  background: var(--bg-deep);
  border-radius: 8px;
  padding: 8px 11px;
}
.video-link { flex: 1; min-width: 0; color: var(--text); font-size: 13px; text-decoration: none; word-break: break-all; }
.video-link:active { color: var(--blue); }
.v-tag {
  flex-shrink: 0; font-size: 10.5px; font-weight: 700;
  color: var(--yellow); background: rgba(255, 193, 7, .1);
  border: 1px solid rgba(255, 193, 7, .35);
  border-radius: 20px; padding: 1px 7px; white-space: nowrap;
}
.v-tag.ok {
  color: var(--teal); background: rgba(0, 198, 167, .1);
  border-color: rgba(0, 198, 167, .35);
}

/* ===== 最近五天汇总 ===== */
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 11px;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.recent-row.today {
  border-color: rgba(0, 198, 167, .5);
  background: rgba(0, 198, 167, .06);
}
.r-date { width: 52px; flex-shrink: 0; text-align: center; }
.r-day { font-size: 15px; font-weight: 800; color: var(--text-bright); line-height: 1.25; }
.r-wd { font-size: 11px; color: var(--text-dim); line-height: 1.25; }
.r-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.r-bar { height: 6px; border-radius: 3px; background: var(--bg-deep); border: 1px solid var(--border); overflow: hidden; }
.r-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #f5a623, #ffc107);
  border-radius: 3px;
  transition: width .5s ease;
}
.r-fill.ok { background: linear-gradient(90deg, #00c6a7, #00e676); }
.r-meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-height: 14px; }
.mini-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.r-vid { font-size: 11px; color: var(--text-dim); margin-left: 3px; }
.r-empty { font-size: 11px; color: var(--text-dim); }
.r-status { flex-shrink: 0; font-size: 11.5px; font-weight: 700; border-radius: 20px; padding: 2px 9px; white-space: nowrap; }
.r-status.ok { color: var(--green); background: rgba(0, 230, 118, .1); border: 1px solid rgba(0, 230, 118, .35); }
.r-status.bad { color: var(--yellow); background: rgba(255, 193, 7, .1); border: 1px solid rgba(255, 193, 7, .35); }
.r-status.none { color: var(--text-dim); background: var(--bg-deep); border: 1px solid var(--border); }
.r-del {
  width: 30px; height: 30px; flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px; cursor: pointer;
  transition: all .18s;
}
.r-del:active { border-color: var(--red); color: var(--red); background: rgba(255, 82, 82, .1); }

/* ===== 全部完成庆祝条 ===== */
.all-done {
  position: fixed; left: 14px; right: 14px; bottom: 16px;
  max-width: 532px; margin: 0 auto;
  background: linear-gradient(135deg, rgba(0, 198, 167, .95), rgba(0, 230, 118, .95));
  color: #052b1e;
  font-size: 14.5px; font-weight: 800;
  text-align: center;
  border-radius: 14px;
  padding: 13px;
  box-shadow: 0 8px 26px rgba(0, 230, 118, .35);
  z-index: 50;
  animation: slideup .4s ease;
}

/* ===== 删除密码弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 5, 12, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadein .18s ease;
}
.modal {
  width: 100%; max-width: 330px;
  background: linear-gradient(180deg, #1a1a32, #14142a);
  border: 1px solid var(--border-hi);
  border-radius: 20px;
  padding: 24px 20px 18px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
  animation: modalpop .28s cubic-bezier(.34, 1.4, .64, 1);
}
.modal-icon { font-size: 34px; line-height: 1; margin-bottom: 10px; }
.modal-title { font-size: 16.5px; font-weight: 800; color: var(--text-bright); }
.modal-tip { font-size: 12px; color: var(--text-dim); margin: 5px 0 14px; }
.modal-input {
  width: 100%; height: 46px;
  background: var(--bg-field);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  color: var(--text-bright);
  font-size: 18px; font-weight: 800; font-family: inherit;
  letter-spacing: 6px;
  text-align: center;
  outline: none;
  transition: border-color .2s;
}
.modal-input:focus { border-color: var(--red); }
.modal-err {
  font-size: 12px; color: var(--red); font-weight: 700;
  margin-top: 7px;
  animation: popin .25s ease;
}
.modal-btns { display: flex; gap: 10px; margin-top: 16px; }
.modal-btns button {
  flex: 1; height: 44px;
  border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  transition: transform .12s, filter .15s;
}
.modal-btns button:active { transform: scale(.96); }
.btn-secondary {
  background: var(--bg-field);
  border: 1px solid var(--border-hi);
  color: var(--text);
}
.btn-danger {
  background: linear-gradient(135deg, #ff5252, #d32f2f);
  border: none;
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 82, 82, .3);
}
.btn-danger:disabled { filter: grayscale(.5) brightness(.7); }
.btn-primary {
  background: linear-gradient(135deg, #00c6a7, #00e676);
  border: none;
  color: #052b1e;
  box-shadow: 0 4px 14px rgba(0, 198, 167, .3);
}

/* ===== 后台管理页 ===== */
.admin-wrap .card { animation: none; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-toolbar .input-date { flex: 1; min-width: 140px; }
.sat-inline { display: flex; gap: 6px; }
.sat-inline .sat-btn { flex: none; padding: 0 12px; height: 40px; }
.admin-toolbar button { height: 40px; padding: 0 14px; border-radius: 9px; font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer; border: none; }

.report-box { display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--text-dim); }
.report-item { background: var(--bg-field); border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.report-head { padding: 8px 12px; font-size: 12px; color: var(--text); border-bottom: 1px solid var(--border); }
.report-pre { padding: 10px 12px; font-size: 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; color: var(--text-dim); font-family: inherit; }

/* ===== 后台九宫格登录 ===== */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; z-index: 1; }
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px 26px;
  width: 100%; max-width: 320px;
  text-align: center;
  box-shadow: var(--shadow);
  animation: modalpop .35s cubic-bezier(.34, 1.3, .64, 1);
}
.login-card h2 { font-size: 18px; color: var(--text-bright); margin-bottom: 4px; }
.pin-tip { font-size: 12px; color: var(--text-dim); margin-bottom: 18px; }
.pin-display { display: flex; justify-content: center; gap: 14px; margin-bottom: 22px; }
.pin-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border-hi);
  transition: all .15s;
}
.pin-dot.filled { background: var(--teal); border-color: var(--teal); box-shadow: 0 0 8px rgba(0, 198, 167, .6); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pin-key {
  height: 56px;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-bright);
  font-size: 20px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  transition: all .12s;
}
.pin-key:active { background: rgba(0, 198, 167, .15); border-color: var(--teal); transform: scale(.94); }
.pin-key.fn { font-size: 16px; color: var(--text-dim); }

/* ===== 动画 ===== */
@keyframes popin { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }
@keyframes slideup { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalpop { from { opacity: 0; transform: scale(.82) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ===== 响应式 ===== */
@media (max-width: 400px) {
  .people-grid { grid-template-columns: repeat(2, 1fr); }
  .weekday-badge { min-width: 66px; padding: 0 10px; }
  .group-owners { max-width: 40%; }
  .r-date { width: 46px; }
  .card { padding: 14px; }
}
