* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC",
               "Microsoft JhengHei", Roboto, sans-serif;
  background: #f4f5f7; color: #26282d;
  max-width: 640px; margin: 0 auto; padding: 16px 14px 60px;
}
.hidden { display: none !important; }

/* 登入 */
.login-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; text-align: center; }
.login-card .logo { font-size: 52px; line-height: 1.1; }
.login-card h1 { font-size: 22px; margin: 8px 0 4px; }
.login-card .sub { color: #6b7280; font-size: 14px; margin-bottom: 18px; }

.card {
  background: #fff; border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06); padding: 22px;
}

input[type=text], input[type=password], select, textarea {
  width: 100%; padding: 12px 14px; font-size: 16px;
  border: 1px solid #d1d5db; border-radius: 10px; margin-bottom: 10px;
  background: #fff; color: #26282d;
}
textarea { resize: vertical; font-family: inherit; }

.btn {
  border: none; cursor: pointer; border-radius: 10px; font-size: 16px;
  padding: 12px 18px; font-weight: 600; transition: opacity .15s;
}
.btn:active { opacity: .7; }
.btn.primary { background: #2563eb; color: #fff; width: 100%; }
.btn.ghost { background: #eef0f3; color: #333; }
.btn.danger { background: #fee2e2; color: #b91c1c; margin-top: 10px; width: 100%; }
.btn.small { width: auto; padding: 6px 12px; font-size: 13px; border-radius: 8px; }

.err { color: #dc2626; font-size: 14px; margin-top: 8px; min-height: 18px; }

/* header */
header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
header h1 { font-size: 20px; }
.hdr-right { display: flex; align-items: center; gap: 8px; }
#who { font-size: 14px; color: #6b7280; }

/* 進度 */
.progress-card { background: #fff; border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06); margin-bottom: 14px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 13px; color: #6b7280; margin-bottom: 8px; }
.progress-meta b { color: #26282d; }
.bar { height: 10px; background: #e5e7eb; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg,#22c55e,#16a34a); border-radius: 6px; transition: width .3s; }

/* filter */
.filter-row { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip { border: 1px solid #d1d5db; background: #fff; color: #374151; border-radius: 999px;
  padding: 7px 14px; font-size: 14px; cursor: pointer; }
.chip.active { background: #2563eb; border-color: #2563eb; color: #fff; }

.add { margin-bottom: 14px; }

/* list */
.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  background: #fff; border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05); border-left: 4px solid #d1d5db;
}
.item.done { opacity: .75; border-left-color: #16a34a; }
.item.planning { border-left-color: #f59e0b; }
.item.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.item .name { font-size: 16px; font-weight: 600; }
.item .done .name { text-decoration: line-through; color: #6b7280; }
.tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; background: #f3f4f6; color: #4b5563; padding: 3px 8px; border-radius: 6px; }
.item .note { font-size: 13px; color: #6b7280; margin-top: 6px; }
.status { display: flex; gap: 6px; margin-top: 10px; }
.status .sbtn { flex: 1; font-size: 13px; border: 1px solid #d1d5db; background: #fff;
  color: #6b7280; border-radius: 8px; padding: 8px 4px; cursor: pointer; }
.status .sbtn.on { background: #dcfce7; border-color: #16a34a; color: #15803d; font-weight: 600; }
.status .sbtn.plan.on { background: #fef3c7; border-color: #f59e0b; color: #b45309; }

.empty { text-align: center; color: #9ca3af; margin-top: 30px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.sheet { background: #fff; border-radius: 18px 18px 0 0; width: 100%;
  max-width: 640px; padding: 20px 18px 26px; max-height: 92vh; overflow-y: auto; }
.sheet h2 { font-size: 18px; margin-bottom: 12px; }
.row2 { display: flex; gap: 8px; }
.row2 select { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 6px 0; }
.check input { width: 18px; height: 18px; }
.modal-btns { display: flex; gap: 8px; margin-top: 12px; }
.modal-btns .btn { flex: 1; }
