* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0 0 48px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: #1f2329;
  background: #f5f6f7;
}
.hidden { display: none !important; }
header {
  background: #fff;
  border-bottom: 1px solid #e5e6eb;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand h1 { font-size: 17px; font-weight: 600; margin: 0; }
.brand .sub { color: #86909c; font-size: 12px; margin-top: 2px; }
.userbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 12px;
  color: #4e5969;
  max-width: 55%;
}
.link { color: #165dff; text-decoration: none; }
.linkbtn {
  color: #165dff;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  padding: 0;
}
main { max-width: 720px; margin: 16px auto; padding: 0 12px; }
.card {
  background: #fff;
  border: 1px solid #e5e6eb;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 13px; font-weight: 600; margin: 16px 0 8px; color: #4e5969; }
.notice {
  background: #f7f8fa;
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  padding: 10px 12px;
  color: #4e5969;
  line-height: 1.6;
  font-size: 13px;
  margin: 0 0 14px;
}
.field { margin-bottom: 14px; }
.field label, .session label {
  display: block;
  font-size: 13px;
  color: #4e5969;
  margin-bottom: 6px;
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.row-between label { margin-bottom: 0; }
input[type=text], input[type=datetime-local], textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #c9cdd4;
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: #1f2329;
}
select { cursor: pointer; }
textarea { resize: vertical; line-height: 1.5; }
.session { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input[type=text] { flex: 1; }
.inline input[type=date] { width: 150px; }
.inline input[type=time] { width: 130px; }
.inline select { width: 130px; }
.inline input[type=file] { max-width: 160px; font-size: 12px; }
.hint { color: #86909c; font-size: 12px; margin-top: 4px; }
.type-switch { display: flex; gap: 10px; flex-wrap: wrap; }
.type-opt {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  border: 1px solid #c9cdd4;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  color: #1f2329 !important;
  font-size: 13px !important;
  margin-bottom: 0 !important;
}
.type-opt:has(input:checked) { border-color: #165dff; background: #e8f3ff; color: #165dff !important; }
.type-opt input { margin: 0; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
button.primary, a.btn.primary {
  background: #165dff;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  display: inline-block;
}
a.btn.ghost {
  background: #fff;
  color: #165dff;
  border: 1px solid #bedaff;
  border-radius: 8px;
  padding: 9px 16px;
  text-decoration: none;
  display: inline-block;
}
button.primary:disabled { background: #94bfff; cursor: not-allowed; }
.result { color: #00b42a; font-size: 13px; }
.result.error { color: #f53f3f; }
.error-text { color: #f53f3f; }
.dev-login { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e5e6eb; }
.login-state { text-align: center; padding: 28px 12px; color: #4e5969; }
.login-state p { margin: 14px 0 0; font-size: 14px; }
.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border: 3px solid #e5e6eb;
  border-top-color: #165dff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.group-list {
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  max-height: 260px;
  overflow: auto;
  background: #fff;
}
.group-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-bottom: 1px solid #f2f3f5;
  cursor: pointer;
}
.group-item:last-child { border-bottom: none; }
.group-item input { margin-top: 3px; }
.g-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.g-name { font-size: 14px; color: #1f2329; word-break: break-all; }
.g-meta { font-size: 12px; color: #86909c; word-break: break-all; }
.empty { padding: 16px; color: #86909c; font-size: 13px; }

.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-item {
  border: 1px solid #e5e6eb;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.task-top { display: flex; justify-content: flex-start; align-items: center; gap: 8px; margin-bottom: 6px; }
.task-time { font-size: 12px; color: #86909c; margin-left: auto; }
.task-body { font-size: 14px; line-height: 1.5; margin-bottom: 6px; word-break: break-word; }
.task-meta { font-size: 12px; color: #86909c; line-height: 1.5; margin-bottom: 6px; word-break: break-all; }
.badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge.pending { background: #e8f3ff; color: #165dff; }
.badge.sent { background: #e8ffea; color: #00b42a; }
.badge.failed { background: #ffece8; color: #f53f3f; }
.badge.cancelled { background: #f2f3f5; color: #86909c; }
.repeat-badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; background: #f5f0ff; color: #722ed1; }

@media (max-width: 640px) {
  .grid, .session { grid-template-columns: 1fr; }
  .inline { flex-direction: column; align-items: stretch; }
  .inline input[type=file] { max-width: none; }
  .userbox { max-width: 48%; }
}
