/* 途黎提醒 H5 · 微信风格移动优先 */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --green: #07c160;
  --green-dark: #06ad56;
  --bg: #f2f2f7;
  --card: #ffffff;
  --text: #17181a;
  --muted: #8a8b90;
  --line: #e5e6eb;
  --danger: #fa5151;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

html, body { height: 100%; }
body {
  background: #d9dbe0;
  color: var(--text);
  font: 16px/1.5 -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  display: flex;
  justify-content: center;
}

/* 桌面预览时模拟手机宽度 */
.phone {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

.view { padding: 16px 16px 96px; }
.hidden { display: none !important; }

/* ===== 登录页 ===== */
.login-hero { text-align: center; padding: 56px 0 28px; }
.login-hero .logo { font-size: 56px; }
.login-hero h1 { font-size: 24px; margin-top: 8px; }
.login-hero .sub { color: var(--muted); font-size: 14px; margin-top: 6px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px;
}
.login-card .field:last-of-type { margin-bottom: 20px; }

/* ===== 表单 ===== */
.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px;
}
.field input[type="text"], .field input[type="number"],
.field input[type="date"], .field input[type="time"], .field select {
  width: 100%; padding: 11px 12px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px; background: #fafafa;
  appearance: none;
}
.field input:focus, .field select:focus { outline: 2px solid var(--green); border-color: transparent; }

.row { display: flex; gap: 12px; align-items: center; }
.row.grow > .field, .field.grow { flex: 1; }
.row.end { justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 分段选择（radio 伪装） */
.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fafafa; }
.seg input { display: none; }
.seg label {
  flex: 1; text-align: center; padding: 9px 0; font-size: 14px; color: var(--muted); cursor: pointer;
}
.seg input:checked + label { background: var(--green); color: #fff; }

/* ===== 按钮 ===== */
.btn {
  border: none; border-radius: 10px; font-size: 16px; padding: 11px 18px; cursor: pointer;
  transition: opacity .15s;
}
.btn:active { opacity: .7; }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:active { background: var(--green-dark); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.block { width: 100%; }

.fab {
  position: fixed; right: calc(50% - 430px / 2 + 20px); bottom: 28px;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 28px; border: none;
  box-shadow: 0 6px 16px rgba(7, 193, 96, .4); cursor: pointer;
}
@media (max-width: 430px) { .fab { right: 20px; } }

.hint { font-size: 12px; color: var(--muted); margin-top: 14px; }
.hint code { background: #f0f1f5; padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ===== 顶栏 ===== */
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; background: #e5e6eb;
  object-fit: cover;
}
#nickname { font-weight: 600; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .seg { flex: 1; }

/* ===== 列表 ===== */
.list { display: flex; flex-direction: column; gap: 12px; }
.item {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px;
}
.item .head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.item .title { font-size: 17px; font-weight: 600; word-break: break-all; }
.item .title.done { text-decoration: line-through; color: var(--muted); }
.item .meta { margin-top: 6px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.item .next { color: var(--green-dark); font-weight: 600; }
.item .ops { display: flex; gap: 8px; margin-top: 12px; }
.badge {
  font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #eef9f2; color: var(--green-dark);
  white-space: nowrap;
}
.badge.gray { background: #f0f1f5; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* ===== 弹层 ===== */
.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 10;
}
.sheet {
  background: var(--card); width: 100%; max-width: 430px;
  border-radius: 18px 18px 0 0; padding: 20px 18px 28px;
  max-height: 86vh; overflow-y: auto;
}
.sheet h2 { font-size: 18px; margin-bottom: 16px; text-align: center; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(0, 0, 0, .78); color: #fff; padding: 10px 18px;
  border-radius: 10px; font-size: 14px; z-index: 20; max-width: 80%;
}
