* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  margin: 0;
  background: #f5f7fa;
  color: #1f2937;
}

header {
  background: #ffffff;
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
}
header h1 { margin: 0; font-size: 20px; }
.hint { margin: 6px 0 0; color: #6b7280; font-size: 13px; }

main {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  padding: 24px;
  align-items: flex-start;
}

.calendar-wrap {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  flex: 1 1 520px;
  max-width: 720px;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-header button {
  width: 36px;
  height: 36px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.cal-header button:hover { background: #f3f4f6; }
#calTitle { font-weight: 600; }

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 6px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cell {
  min-height: 84px;
  border: 1px solid #eef0f3;
  border-radius: 8px;
  padding: 6px;
  background: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cell.empty { background: transparent; border: none; }
.cell.disabled { background: #f3f4f6; color: #c0c4cc; cursor: not-allowed; }
.cell:not(.disabled):not(.empty) { cursor: pointer; }
.cell:not(.disabled):not(.empty):hover { border-color: #3b82f6; background: #f0f7ff; }
.cell.applied { background: #fff7ed; border-color: #fdba74; }
.cell.today { box-shadow: inset 0 0 0 2px #93c5fd; }

.date-num { font-size: 14px; font-weight: 600; }

.tags { display: flex; flex-wrap: wrap; gap: 3px; }
.tag {
  background: #16a34a;
  color: #ffffff;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  line-height: 1.6;
}

.form-wrap {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  flex: 1 1 280px;
  max-width: 340px;
}
.form-wrap h2 { margin-top: 0; font-size: 16px; }

form label {
  display: block;
  font-size: 13px;
  color: #374151;
  margin-bottom: 14px;
}
form select, form input {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
}
form button {
  width: 100%;
  padding: 10px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
form button:hover { background: #1d4ed8; }

.msg { font-size: 13px; min-height: 18px; margin: 10px 0 0; }
.msg.ok { color: #16a34a; }
.msg.err { color: #dc2626; }

.legend {
  margin-top: 16px;
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.dot.applied { background: #fdba74; }
.dot.disabled { background: #f3f4f6; border: 1px solid #e5e7eb; }
.dot.today { background: transparent; box-shadow: inset 0 0 0 2px #93c5fd; }
