/* 戒色打卡 · 浅色扁平风，teal 主色 */
:root {
  --bg: #f6f8f7;
  --card: #ffffff;
  --ink: #1f2a27;
  --muted: #5f6b67;
  --line: #e2e8e5;
  --teal: #0f6e56;
  --teal-deep: #085041;
  --teal-soft: #e1f5ee;
  --teal-mid: #9fe1cb;
  --danger: #a32d2d;
  --danger-soft: #fcebeb;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink);
  line-height: 1.6; font-size: 15px;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px 48px; }
.view[hidden] { display: none; }

h1 { font-size: 22px; font-weight: 500; }
h2 { font-size: 17px; font-weight: 500; margin-bottom: 6px; }
.sub { color: var(--muted); font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.card-narrow { max-width: 420px; margin: 40px auto 0; }

/* 顶栏 */
.topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; gap: 12px; }
.userbox { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nickname { font-weight: 500; color: var(--teal-deep); }

/* 表单 */
label { display: block; font-size: 13.5px; font-weight: 500; margin: 14px 0 6px; }
label:first-child { margin-top: 0; }
.req { color: var(--danger); font-size: 11px; margin-left: 4px; }
.opt { color: var(--muted); font-size: 11px; margin-left: 4px; }
input[type="text"], input[type="password"], textarea {
  width: 100%; padding: 10px 12px; font-size: 15px; font-family: inherit;
  border: 1px solid var(--line); border-radius: 10px; background: #fbfcfb;
  outline: none; transition: border-color .15s;
}
input:focus, textarea:focus { border-color: var(--teal); }
textarea { resize: vertical; min-height: 88px; }
.counter { text-align: right; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.field { margin-bottom: 16px; }

/* 文件选择框 */
.filebox {
  border: 1.5px dashed var(--teal-mid); border-radius: 12px;
  background: var(--teal-soft); cursor: pointer;
  padding: 18px 14px; text-align: center; transition: border-color .15s;
}
.filebox:hover, .filebox:focus { border-color: var(--teal); }
.filebox-empty { display: flex; flex-direction: column; gap: 4px; }
.filebox-empty strong { font-size: 14px; font-weight: 500; color: var(--teal-deep); }
.filebox-empty span { font-size: 12px; color: var(--muted); }
.filebox-picked { display: flex; align-items: center; gap: 10px; text-align: left; }
.filebox-picked img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.filebox-picked .icon { width: 52px; height: 52px; border-radius: 8px; background: var(--teal-mid); display: flex; align-items: center; justify-content: center; color: var(--teal-deep); font-size: 20px; flex-shrink: 0; }
.filebox-picked .meta { min-width: 0; }
.filebox-picked .meta strong { display: block; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filebox-picked .meta span { font-size: 12px; color: var(--muted); }
.filebox-picked .clear { margin-left: auto; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 10px; cursor: pointer;
  font-size: 14.5px; font-family: inherit; padding: 11px 18px;
  transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-deep); }
.btn-primary:disabled { background: #b4b2a9; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--teal); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--teal); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; margin-top: 6px; }

.error {
  background: var(--danger-soft); color: var(--danger);
  font-size: 13px; border-radius: 8px; padding: 8px 12px; margin: 10px 0;
}

/* 提交进度 */
.progress { display: flex; align-items: center; gap: 10px; justify-content: center; margin-top: 12px; color: var(--muted); font-size: 13px; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--teal-mid); border-top-color: var(--teal);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 上传进度条 */
.bar {
  height: 8px; border-radius: 999px; background: var(--teal-soft);
  overflow: hidden; margin-top: 10px;
}
.bar > div {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--teal); transition: width .2s;
}

/* 打卡榜 */
.stats-head { display: flex; justify-content: space-between; align-items: center; }
.stats-actions { display: flex; gap: 8px; }

/* 管理操作列（ADR-0006）：仅 body.admin-mode 下可见 */
.admin-col { display: none; }
body.admin-mode .admin-col { display: table-cell; }
.admin-actions { display: flex; gap: 6px; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr.me td { background: var(--teal-soft); }
.badge {
  display: inline-block; font-size: 11px; color: var(--teal-deep);
  background: var(--teal-mid); border-radius: 999px; padding: 1px 8px; margin-left: 6px;
}
.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 8px; }

/* 成功页 */
.done-card { text-align: center; padding: 36px 24px; }
.done-mark {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  background: var(--teal-soft); color: var(--teal); font-size: 28px;
  display: flex; align-items: center; justify-content: center;
}
.done-card .sub { margin: 6px 0; }
.done-card .btn { margin-top: 18px; }

@media (max-width: 480px) {
  .wrap { padding: 16px 10px 40px; }
  .card { padding: 16px 14px; }
  h1 { font-size: 20px; }
}
