:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --ok: #16a34a;
  --maybe: #d97706;
  --no: #dc2626;
  --danger-bg: #fef2f2;
  --warning-bg: #fffbeb;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input, textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 700;
}
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  outline: none;
}
textarea {
  min-height: 120px;
  resize: vertical;
}
.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.brand {
  font-size: 28px;
  font-weight: 800;
}
.sub {
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.7;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}
.section-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 16px;
}
.btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-dark);
}
.btn-secondary {
  background: #eef2ff;
  color: var(--brand-dark);
}
.btn-muted {
  background: #eef2f7;
  color: #334155;
}
.btn-danger {
  background: #fee2e2;
  color: #991b1b;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge-active { background: #ecfdf5; color: var(--ok); }
.badge-closed { background: #eff6ff; color: var(--brand); }
.badge-deleted { background: #f3f4f6; color: #6b7280; }
.grid-2 {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 20px;
  align-items: start;
}
.grid-home {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.list {
  display: grid;
  gap: 12px;
}
.event-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
}
.event-card:hover {
  border-color: #c7d2fe;
}
.event-title {
  font-weight: 800;
  margin-bottom: 8px;
}
.event-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.empty {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 24px 18px;
  text-align: center;
  color: var(--muted);
  background: #fff;
}
.field {
  margin-bottom: 16px;
}
.label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
}
.tips {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.notice {
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.7;
}
.notice-info { background: #eff6ff; color: #1d4ed8; }
.notice-warning { background: var(--warning-bg); color: #92400e; }
.notice-danger { background: var(--danger-bg); color: #991b1b; }
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.claim-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.claim-btn {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}
.claim-btn[disabled] {
  cursor: not-allowed;
  color: var(--muted);
  background: #f9fafb;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.table-wrap table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}
.table-wrap th,
.table-wrap td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: center;
  font-size: 14px;
}
.table-wrap th:first-child,
.table-wrap td:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 1;
  min-width: 140px;
  text-align: left;
  font-weight: 800;
}
.table-wrap thead th {
  background: #fafafa;
  font-size: 13px;
  font-weight: 800;
}
.member-mine {
  background: #eff6ff !important;
}
.cell-btn {
  min-width: 60px;
  border-radius: 999px;
  padding: 8px 10px;
  border: 1px solid transparent;
  background: #fff;
  font-weight: 800;
}
.cell-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
.s-blank { background: #fff; color: #94a3b8; border-color: #e5e7eb; }
.s-yes { background: #ecfdf5; color: var(--ok); border-color: #bbf7d0; }
.s-maybe { background: #fffbeb; color: var(--maybe); border-color: #fde68a; }
.s-no { background: #fef2f2; color: var(--no); border-color: #fecaca; }
.best {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #eef4ff;
  color: var(--brand);
  font-size: 16px;
  font-weight: 800;
}
.stats-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.stat-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}
.stat-title {
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.6;
}
.code-inline {
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 8px;
}
.small {
  color: var(--muted);
  font-size: 12px;
}
.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: grid;
  gap: 10px;
}
.toast {
  min-width: 260px;
  max-width: 420px;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  color: #fff;
  font-size: 14px;
  line-height: 1.6;
}
.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }
.toast-info { background: #2563eb; }
.hidden { display: none !important; }
.footer-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}
.btn-link {display:inline-block;background:#eef2ff;color:#1d4ed8;padding:11px 16px;border-radius:12px;font-weight:700;}
.form-card {max-width:720px;margin:auto;}
.event-layout {display:grid;grid-template-columns:300px minmax(0,1fr);gap:20px;align-items:start;}
.event-layout .card {min-width:0;}
.event-description {white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.6;}
.self-unclaim {margin-top:10px;}
.progress {margin-top:24px;}
.slot-row {display:flex;align-items:center;gap:8px;margin-bottom:10px;flex-wrap:wrap;}
.slot-row input[type=date] {width:180px;}
.slot-row input[type=time] {width:115px;}
.slot-row button {padding:10px;}
#message:not([hidden]) {margin-bottom:16px;}
.table-wrap table {width:max-content;min-width:100%;}
.table-wrap th:not(:first-child),.table-wrap td:not(:first-child) {min-width:120px;max-width:190px;}
.table-wrap th {white-space:normal;overflow-wrap:anywhere;}
.cell-btn {min-height:44px;min-width:48px;}
@media (max-width:760px) {
  .wrap {padding:14px;}
  .brand {font-size:23px;}
  .page-header {flex-direction:row;align-items:center;}
  .card {padding:16px;border-radius:16px;}
  .event-layout {grid-template-columns:1fr;}
  .table-wrap th:first-child,.table-wrap td:first-child {min-width:92px;max-width:110px;overflow-wrap:anywhere;}
  .table-wrap th,.table-wrap td {padding:8px 6px;}
  .slot-row input[type=date] {width:100%;}
  .slot-row input[type=time] {width:calc(50% - 30px);}
}

@media (max-width: 980px) {
  .grid-2,
  .grid-home {
    grid-template-columns: 1fr;
  }
  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
